• R/O
  • HTTP
  • SSH
  • HTTPS

Liste der Commits

Tags
Keine Tags

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/relocs
RSS
Rev. Zeit Autor
2e75d73 users/hjl/relocs 2016-05-04 02:37:17 H.J. Lu

Update x86-64 tests

4e0b303 2016-05-04 02:37:16 H.J. Lu

Pass --no-relax to ld-x86-64/pr18591.d

29f90d5 2016-05-04 02:37:16 H.J. Lu

Call elf_x86_64_convert_load_reloc from elf_x86_64_check_relocs

27ba297 2016-05-04 02:37:16 H.J. Lu

Update i386 tests

42a1024 2016-05-04 02:37:16 H.J. Lu

Call elf_i386_convert_load_reloc from elf_i386_check_relocs

973751e 2016-05-04 02:37:16 H.J. Lu

Add a do_assignments hook to ldemul

When ELF relocation check is moved after lang_gc_sections, we should
call bfd_elf_record_link_assignment before ELF relocation check so that
linker defined symbols will be processed earlier to stabilize symbols.
We have to do it in lang_do_assignments just before the call to
lang_do_assignments_1.

bfd/

* elf-bfd.h (_bfd_elf_record_start_stop): New prototype.
* elflink.c (start_stop_symbol): New struct.
(start_stop_symbol_info): Likewise.
(elf_link_collect_start_stop): New function.
(_bfd_elf_record_start_stop): Likewise.

ld/

* ldemul.c (ldemul_do_assignments): New function.
* ldemul.h (ldemul_do_assignments): New prototype.
(ld_emulation_xfer_struct): Add do_assignments.
* ldlang.c (lang_do_assignments): Call ldemul_do_assignments
just before lang_do_assignments_1 in lang_mark_phase_enum.
* emultempl/aix.em (ld_${EMULATION_NAME}_emulation): Initialize
the do_assignments field to NULL.
* emultempl/armcoff.em (ld_${EMULATION_NAME}_emulation): Likewise.
* emultempl/beos.em (ld_${EMULATION_NAME}_emulation): Likewise.
* emultempl/generic.em (ld_${EMULATION_NAME}_emulation): Likewise.
* emultempl/gld960.em (ld_gld960_emulation): Likewise.
* emultempl/gld960c.em (ld_gld960coff_emulation): Likewise.
* emultempl/linux.em (ld_${EMULATION_NAME}_emulation): Likewise.
* emultempl/lnk960.em (ld_lnk960_emulation): Likewise.
* emultempl/m68kcoff.em (ld_${EMULATION_NAME}_emulation): Likewise.
* emultempl/msp430.em (ld_${EMULATION_NAME}_emulation): Likewise.
* emultempl/pe.em (ld_${EMULATION_NAME}_emulation): Likewise.
* emultempl/pep.em (ld_${EMULATION_NAME}_emulation): Likewise.
* emultempl/sunos.em (ld_${EMULATION_NAME}_emulation): Likewise.
* emultempl/ticoff.em (ld_${EMULATION_NAME}_emulation): Likewise.
* emultempl/vanilla.em (ld_${EMULATION_NAME}_emulation): Likewise.
* emultempl/elf32.em (ehdr_start): New variable.
(ehdr_start_save): Likewise.
(gld${EMULATION_NAME}_do_assignments): New function.
(gld${EMULATION_NAME}_restore_ehdr_start): Likewise.
(ehdr_start_empty): Removed.
(gld${EMULATION_NAME}_before_allocation): Don't adjust
__ehdr_start here. Call gld${EMULATION_NAME}_restore_ehdr_start
at the end.
(ld_${EMULATION_NAME}_emulation): Initialize the do_assignments
field with gld${EMULATION_NAME}_do_assignments by default.

fd5c6c0 2016-05-04 02:35:35 H.J. Lu

X86: Extract convert_load_reloc from 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.

7fcc88b 2016-05-04 02:35:35 H.J. Lu

x86: Cache the section contents in 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.