• R/O
  • HTTP
  • SSH
  • HTTPS

Listed des commits

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


users/hjl/cache
RSS
Révision l'heure Auteur
68e7d80 users/hjl/cache 2016-05-04 02:40:49 H.J. Lu

Extract convert_load_reloc from x86 convert_load

* elf32-i386.c (elf_i386_convert_load): Extract the GOT load
conversion to ...
(elf_i386_convert_load_reloc): This. New function.
* elf64-x86-64.c (elf_x86_64_convert_load): Extract the GOT load
conversion to ...
(elf_x86_64_convert_load_reloc): This. New function.

efc9f74 2016-05-04 02:40:41 H.J. Lu

Cache the section contents in x86 check_relocs

Cache the section contents in x86 check_relocs for sections without
TLS relocations.

* elf32-i386.c (elf_i386_check_tls_transition): Remove abfd.
Don't check if contents == NULL.
(elf_i386_tls_transition): Add from_relocate_section. Check
from_relocate_section instead of contents != NULL. Update
elf_i386_check_tls_transition call.
(elf_i386_check_relocs): Cache the section contents if
keep_memory is FALSE. Pass FALSE as from_relocate_section to
elf_i386_tls_transition.
(elf_i386_relocate_section): Pass TRUE as from_relocate_section
to elf_i386_tls_transition.
(elf_backend_caches_rawsize): New.
* elf64-x86-64.c (elf_x86_64_check_tls_transition): Don't check
if contents == NULL.
(elf_x86_64_tls_transition): Add from_relocate_section. Check
from_relocate_section instead of contents != NULL.
(elf_x86_64_check_relocs): Cache the section contents if
keep_memory is FALSE. Pass FALSE as from_relocate_section to
elf_x86_64_tls_transition.
(elf_x86_64_relocate_section): Pass TRUE as from_relocate_section
to elf_x86_64_tls_transition.
(elf_backend_caches_rawsize): New.

99d1b26 2016-05-03 21:36:22 Nick Clifton

Updated Swedish translation for the binutils.

86f1abe 2016-05-03 20:16:56 Pedro Alves

Fix gdb/python/python.c use-after-free

Valgrind shows:

==26964== Invalid read of size 1
==26964== at 0x6E14100: __GI_strcmp (strcmp.S:180)
==26964== by 0x6DB55AA: setlocale (setlocale.c:238)
==26964== by 0x4E0455: _initialize_python() (python.c:1731)
==26964== by 0x786731: initialize_all_files() (init.c:319)
==26964== by 0x72EF0A: gdb_init(char*) (top.c:1929)
==26964== by 0x60BCAC: captured_main(void*) (main.c:863)
==26964== by 0x606AD5: catch_errors(int (*)(void*), void*, char*, return_mask) (exceptions.c:234)
==26964== by 0x60C608: gdb_main(captured_main_args*) (main.c:1165)
==26964== by 0x40CAEC: main (gdb.c:32)
==26964== Address 0x81d30a0 is 0 bytes inside a block of size 181 free'd
==26964== at 0x4C29CF0: free (vg_replace_malloc.c:530)
==26964== by 0x6DB5B65: setname (setlocale.c:201)
==26964== by 0x6DB5B65: setlocale (setlocale.c:388)
==26964== by 0x4E037F: _initialize_python() (python.c:1712)
==26964== by 0x786731: initialize_all_files() (init.c:319)
==26964== by 0x72EF0A: gdb_init(char*) (top.c:1929)
==26964== by 0x60BCAC: captured_main(void*) (main.c:863)
==26964== by 0x606AD5: catch_errors(int (*)(void*), void*, char*, return_mask) (exceptions.c:234)
==26964== by 0x60C608: gdb_main(captured_main_args*) (main.c:1165)
==26964== by 0x40CAEC: main (gdb.c:32)

The problem is doing this:

oldloc = setlocale (LC_ALL, NULL);
setlocale (LC_ALL, "");
...
setlocale (LC_ALL, oldloc);

I.e., the second setlocale call frees 'oldloc'.

From http://pubs.opengroup.org/onlinepubs/9699919799/functions/setlocale.html :

"The returned string pointer might be invalidated or the string
content might be overwritten by a subsequent call to setlocale()."

gdb/ChangeLog:
2016-05-03 Pedro Alves <palves@redhat.com>

PR python/20037
* python/python.c (_initialize_python) [IS_PY3K]: xstrdup/xfree
oldloc.

1aa9670 2016-05-03 20:16:55 Pedro Alves

Remove gdb/python/python.c code that handles strlen failing with -1

This makes no sense -- strlen doesn't really ever fail with -1.

gdb/ChangeLog:
2016-05-03 Pedro Alves <palves@redhat.com>

* python/python.c (_initialize_python) [IS_PY3K]: Remove dead
code.

1f56df9 2016-05-03 19:59:37 Jiong Wang

[AArch64] Also puts value in place for R_AARCH64_RELATIVE

When handling absolute relocations for global symbols bind within the
shared object, AArch64 will generate one dynamic RELATIVE relocation,
but won't apply the value for this absolution relocations at static
linking stage. This is different from AArch64 gold linker and x86-64.

This is not a bug as AArch64 is RELA, there is only guarantee that
relocation addend is placed in the relocation entry. But some
system softwares originally writen for x86-64 might assume AArch64
bfd linker gets the same behavior as x86-64, then they could take
advantage of this buy skipping those RELATIVE dynamic relocations
if the load address is the same as the static linking address.

This patch makes AArch64 BFD linker applies absolution relocations at
static linking stage for scenario described above. Meanwhile old AArch64
android loader has a bug (PR19163) which relies on current linker behavior
as a workaround, so the same option --no-apply-dynamic-relocs added.

20f55f3 2016-05-03 19:48:56 Szabolcs Nagy

Fix generation of AArhc64 instruction table.

* aarch64-gen.c (VERIFIER): Define.
* aarch64-opc.c (VERIFIER): Define.
(verify_ldpsw): Use static linkage.
* aarch64-opc.h (verify_ldpsw): Remove.
* aarch64-tbl.h: Use VERIFIER for verifiers.

b782c63 2016-05-03 18:56:30 Pitchumani Sivanupandi

Assume that the GAS testsuite for the AVR is being run without -mlink-relax specified.

* testsuite/gas/lns/lns.exp: Add avr to list of targets using
DW_LNS_fixed_advance_pc.

a2076b3 2016-05-03 18:44:35 Senthil Kumar Selvaraj

Skip ELF STT_COMMON linker tests if shared libraries are not supported.

* testsuite/ld-elfcomm/elfcomm.exp: Check for shared lib support
before running STT_COMMON tests.

a4a1c15 2016-05-03 18:31:22 Pedro Alves

Fix PR gdb/16818, workaround Python's forcing of -export-dynamic

GDB's use of --dynamic-list to only export the proc-service symbols is
broken due to Python's "python-config --ldflags" saying we should link
with -export-dynamic, causing us to export _all_ extern symbols
anyway. On Fedora 23:

$ python-config --ldflags
-lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic
$ python3.4-config --ldflags
-L/usr/lib64 -lpython3.4m -lpthread -ldl -lutil -lm -Xlinker -export-dynamic

Having GDB export all its symbols leads to issues such as PR gdb/16818
(GDB crashes when using name for target remote hostname:port), where a
GDB symbol unintentionally preempts a symbol in one of the NSS modules
glibc loads into the process. NSS modules should not define symbols
outside the implementation namespace or the relevant standards, but,
alas, that's a longstanding and hard to fix issue. See libc-alpha
discussion at:

[symbol name space issues with NSS modules]
https://sourceware.org/ml/libc-alpha/2016-04/msg00130.html

Python should instead be either using GCC's symbol visibility feature
or -Wl,--dynamic-list as well, to only export Python API symbols, but,
it doesn't. There are bugs open upstream for that:

[Use -Wl,--dynamic-list=x.list, not -Xlinker -export-dynamic]
http://bugs.python.org/issue10112

[Use GCC visibility attrs in PyAPI_*]
http://bugs.python.org/issue11410

But that's taking a long while to resolve.

I thought of working around this Python issue by making GDB build with
-fvisibility=hidden, as Jan suggests in Python issue 10112, as then
Python's "-Xlinker -export-dynamic" has no effect. However, that
would need to be done in the whole source tree (bfd, libiberty, etc.),
and I think that would break GCC plugins, as I believe those have
access to all of GCCs symbols, by "design". So we'd need a new
configure switch, or have the libraries in the tree detect which of
GCC or GDB is being built, but that doesn't work, because the answer
can be "both" with combined builds...

So this patch instead works around Python's bug, by simply sed'ing
away "-Xlinker -export-dynamic" from the result of python-config.py
--ldflags, making -Wl,--dynamic-list work again as it used to. It's
ugly, but so is the bug...

Note that if -Wl,--dynamic-list doesn't work, we always link with
-rdynamic, so static Python should still work.

Tested on F23 with --python=python (Python 2.7) and
--python=python3.4.

gdb/ChangeLog:y
2016-05-03 Pedro Alves <palves@redhat.com>

* configure.ac (PYTHON_LIBS): Sed away "-Xlinker -export-dynamic".
* configure: Regenerate.

1b4f615 2016-05-03 18:30:51 Pedro Alves

Fix "-Wl,--dynamic-list" gdb/configure test

The -Wl,--dynamic-list test is currently broken on Fedora 23, when you
configure with --with-python=python3.4. We see:

configure:13741: checking for the dynamic export flag
configure:13796: gcc -o conftest -g3 -O0 -fno-strict-aliasing -DNDEBUG -fwrapv -Wl,--dynamic-list=/home/pedro/gdb/mygit/src/gdb/proc-service.list conftest.c -ldl -lncurses -lm -ldl -lpthread -ldl -lutil -lm -lpython3.4m -Xlinker -export-dynamic >&5
conftest.c:182:30: fatal error: python3.4/Python.h: No such file or directory
compilation terminated.
configure:13796: $? = 1

The correct -I path is in PYTHON_CPPFLAGS:

PYTHON_CPPFLAGS='-I/usr/include/python3.4m -I/usr/include/python3.4m'

(Other Python-related tests in the file are already doing this.)

gdb/ChangeLog:
2016-05-03 Pedro Alves <palves@redhat.com>

* configure.ac (checking for the dynamic export flag): Add
$PYTHON_CPPFLAGS to CPPFLAGS.
* configure: Regenerate.

b631e59 2016-05-03 17:40:54 Kyrylo Tkachov

[gdb] Fix -Wparentheses warnings

2016-05-03 Kyrylo Tkachov <kyrylo.tkachov@arm.com>

* symfile.c (find_pc_overlay): Add braces to avoid -Wparentheses
warning.
(find_pc_mapped_section): Likewise.
(list_overlays_command): Likewise.

a1da439 2016-05-03 09:00:09 GDB Administrator

Automatic date update in version.in

444e826 2016-05-03 02:10:33 Simon Marchi

Fix detach.exp remote check

This test seems to work with both native-gdbserver and
native-extended-gdbserver, so I removed the remote check.

When running with native-gdbserver (a stub-like target), detach makes
gdbserver stop and gdb disconnect. runto_main just spawns a brand new
gdbserver. So it tests the exact same thing twice. It doesn't hurt
though.

With native-extended-gdbserver, the test is probably a bit more useful
(and similar to native). It tests running/detaching twice using the
same gdb/gdbserver instances, since with extended-remote, you can
detach/attach/run all you want, unlike with remote.

gdb/testsuite/ChangeLog:

* gdb.base/detach.exp: Remove is_remote check.

740feea 2016-05-03 02:04:56 Simon Marchi

Fix annota-input-while-running.exp remote check

The comment says that we can't use runto_main here becore it doesn't
know how to handle annotation. Instead, the test puts a breakpoint at
main and calls run by hand. Therefore, it can't work with stub targets,
since they can't "run". The check should be then changed to check the
use_gdb_stub variable instead of [is_remote target].

But as an alternative, we can just use runto_main and enable annotations
after, since the "run to main" part is not really part of what we want
to test.

I also removed the "set test..." line that is unused.

gdb/testsuite/ChangeLog:

* gdb.base/annota-input-while-running.exp: Don't check for
[is_remote target]. Enable annotations after running to main.
Remove unused "set test..." line.

1270fac 2016-05-03 01:37:43 Eli Zaretskii

Fix startup on MS-Windows when 'gdb.ini' is found in $HOME

* windows-nat.c (_initialize_check_for_gdb_ini): Fix off-by-one
error in allocation of space for "$HOME/.gdbinit" string. This
caused GDB to abort on startup whenever a '~/gdb.ini' file was
actually found, because xsnprintf would hit an assertion
violation.

2e1fb61 2016-05-02 09:00:18 GDB Administrator

Automatic date update in version.in

7d8e798 2016-05-01 09:00:20 GDB Administrator

Automatic date update in version.in

94af225 2016-04-30 09:00:19 GDB Administrator

Automatic date update in version.in

493f652 2016-04-30 00:27:29 H.J. Lu

Set interpreter in x86 create_dynamic_sections

Set interpreter in x86 create_dynamic_sections to make this information
available to x86 check_relocs.

* elf32-i386.c (elf_i386_size_dynamic_sections): Move interp
setting to ...
(elf_i386_create_dynamic_sections): Here.
* elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Move
interp setting to ...
(elf_x86_64_create_dynamic_sections): Here.

e62b972 2016-04-30 00:21:51 H.J. Lu

Pass GOT_RELOC to UNDEFINED_WEAK_RESOLVED_TO_ZERO

When UNDEFINED_WEAK_RESOLVED_TO_ZERO is checked to convert load via
GOT, has_got_reloc is always TRUE. This patch adds GOT_RELOC, which
is TRUE in x86 convert_load, to UNDEFINED_WEAK_RESOLVED_TO_ZERO.

* elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Take GOT_RELOC
and replace (EH)->has_got_reloc with GOT_RELOC.
(elf_i386_fixup_symbol): Pass has_got_reloc to
UNDEFINED_WEAK_RESOLVED_TO_ZERO.
(elf_i386_allocate_dynrelocs): Likewise.
(elf_i386_relocate_section): Likewise.
(elf_i386_finish_dynamic_symbol): Likewise.
(elf_i386_convert_load): Pass TRUE to
UNDEFINED_WEAK_RESOLVED_TO_ZERO.
* elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Take
GOT_RELOC and replace (EH)->has_got_reloc with GOT_RELOC.
(elf_x86_64_fixup_symbol): Pass has_got_reloc to
UNDEFINED_WEAK_RESOLVED_TO_ZERO.
(elf_x86_64_allocate_dynrelocs): Likewise.
(elf_x86_64_relocate_section): Likewise.
(elf_x86_64_finish_dynamic_symbol): Likewise.
(elf_x86_64_convert_load): Pass TRUE to
UNDEFINED_WEAK_RESOLVED_TO_ZERO.

010f98a 2016-04-29 22:52:55 H.J. Lu

Download source only on remote host

There is no need to download source if we aren't on remote host.
Otherwise, each ld test run on local host leaves behind a couple
test files.

* config/default.exp (NOPIE_CFLAGS): Download source only on
remote host.
(NOPIE_LDFLAGS): Likewise.
* testsuite/lib/ld-lib.exp (check_lto_available): Likewise.
(check_lto_fat_available): Likewise.
(check_lto_shared_available): Likewise.
(check_ifunc_available): Likewise.
(check_ifunc_attribute_available): Likewise.

d347c9d 2016-04-29 22:05:12 Pitchumani Sivanupandi

Enhance readelf's recognition of AVR relocation types.

* readelf.c (is_32bit_pcrel_reloc): Return true if reloc is 32-bit
PC relocation for AVR target.
(is_none_reloc): Return true if reloc is any of AVR diff
relocations.

c337a16 2016-04-29 20:31:54 H.J. Lu

i386: Don't relocate section when check_relocs failed

No need to relocate section when check_relocs failed.

* elf32-i386.c (check_relocs_failed): New.
(elf_i386_check_relocs): Set check_relocs_failed on error.
(elf_i386_relocate_section): Skip if check_relocs failed.

afd9ace 2016-04-29 20:29:38 H.J. Lu

X86-64: Set check_relocs_failed on error

When checking relocations, set check_relocs_failed on error.

* elf64-x86-64.c (elf_x86_64_check_relocs): Set
check_relocs_failed on error.

5522f91 2016-04-29 17:24:42 Nick Clifton

Enhance support for copying and stripping Solaris and ARM binaries.

PR 19938
bfd * elf-bfd.h (struct elf_backend_data): Rename
elf_backend_set_special_section_info_and_link to
elf_backend_copy_special_section_fields.
* elfxx-target.h: Likewise.
* elf.c (section_match): Ignore the SHF_INFO_LINK flag when
comparing section flags.
(copy_special_section_fields): New function.
(_bfd_elf_copy_private_bfd_data): Copy the EI_ABIVERSION field.
Perform two scans over special sections. The first one looks for
a direct mapping between the output section and an input section.
The second scan looks for a possible match based upon section
characteristics.
* elf32-arm.c (elf32_arm_copy_special_section_fields): New
function. Handle setting the sh_link field of SHT_ARM_EXIDX
sections.
* elf32-i386.c (elf32_i386_set_special_info_link): Rename to
elf32_i386_copy_solaris_special_section_fields.
* elf32-sparc.c (elf32_sparc_set_special_section_info_link):
Rename to elf32_sparc_copy_solaris_special_section_fields.
* elf64-x86-64.c (elf64_x86_64_set_special_info_link): Rename to
elf64_x86_64_copy_solaris_special_section_fields.

binutils* readelf.c (get_solaris_segment_type): New function.
(get_segment_type): Call it.

2deb93c 2016-04-29 09:00:17 GDB Administrator

Automatic date update in version.in

0400cf2 2016-04-29 03:11:51 Simon Marchi

Don't show deprecated commands in help

Just like completion doesn't show deprecated commands, I think that help
should not list them, so that we don't incite users to use them.

gdb/ChangeLog:

* cli/cli-decode.c (help_cmd_list): Do not list commands that
are deprecated.

9080ac9 2016-04-29 01:56:08 Simon Marchi

Add test for tracepoint enable/disable

This patch adds a test for tracepoints enabling/disabling, which
didn't work properly for fast tracepoints on big endian systems.

gdb/testsuite/ChangeLog:

* gdb.trace/trace-enable-disable.exp: New file.
* gdb.trace/trace-enable-disable.c: New file.

35fd2de 2016-04-29 01:56:05 Par Olsson

Fix write endianness/size problem for fast tracepoint enabled flag

I am sending this fix on behalf of Par Olsson, as a follow-up of this
one:

https://www.sourceware.org/ml/gdb-patches/2015-10/msg00196.html

This problem is exposed when enabling/disabling fast tracepoints on big
endian machines. The flag is defined as an int8_t, but is written from
gdbserver as an integer (usually 32 bits). When the agent code reads it
as an int8_t, it only considers the most significant byte, which is
always 0.

Also, we were writing 32 bits in an 8 bits field, so the write would
overflow, but since the following bytes are padding (the next field is
an uint64_t), it luckily didn't cause any issue on little endian
systems.

The fix was originally tested on ARM big endian systems, but I don't
have access to such a system. However, thanks to Marcin's PowerPC fast
tracepoint patches and gcc110 (big endian Power7) on the gcc compile
farm, I was able to reproduce the problem, test the fix and write a
test (the following patch).

gdb/gdbserver/ChangeLog:

YYYY-MM-DD Par Olsson <par.olsson@windriver.com>

* tracepoint.c (write_inferior_int8): New function.
(cmd_qtenable_disable): Write enable flag using
write_inferior_int8.