Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
Use "continue" instead of "break" to skip IFUNC relocations in debug
sections.
* elf32-i386.c (elf_i386_relocate_section): Properly skip IFUNC
relocations in debug sections.
* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
|
|
|
|
2015-08-11 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (elfNN_aarch64_relocate_section): Improve warning
message for R_AARCH64_LD64_GOTPAGE_LO15/R_AARCH64_LD32_GOTPAGE_LO14.
|
|
2015-08-11 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): New.
(aarch64_can_relax_tls): Use the new IS_AARCH64_TLS_RELAX_RELOC.
|
|
2015-08-11 Jiong Wang <jiong.wang@arm.com>
bfd/
* bfd/elfnn-aarch64.c (aarch64_type_of_stub): New parameter "sym_sec".
Loose the check for symbol from ABS section.
(elfNN_aarch64_size_stubs): Pass sym_sec.
ld/testsuite/
* ld-aarch64/farcall-b-defsym.s: New test.
* ld-aarch64/farcall-bl-defsym.s: Likewise.
* ld-aarch64/farcall-b-defsym.d: New expectation.
* ld-aarch64/farcall-bl-defsym.d: Likewise.
|
|
2015-08-11 Jiong Wang <jiong.wang@arm.com>
bfd/
PR ld/18668
* elfnn-aarch64.c (aarch64_type_of_stub): Update destination for
calls go through plt stub.
(elfNN_aarch64_final_link_relocate): Adjust code logic for CALL26,
JUMP26 relocation to support inserting veneer for call to plt stub.
ld/testsuite/
* ld-aarch64/farcall-b-gsym.s: New test.
* ld-aarch64/farcall-b-plt.s: Likewise.
* ld-aarch64/farcall-bl-plt.s: Likewise.
* ld-aarch64/farcall-b-gsym.d: New expect file.
* ld-aarch64/farcall-b-plt.d: Likewise.
* ld-aarch64/farcall-bl-plt.d: Likewise.
|
|
2015-08-11 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
(aarch64_reloc_got_type): Likewise.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_relocate_section): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/testsuite/
* ld-aarch64/emit-relocs-529.s: New testcase.
* ld-aarch64/emit-relocs-529-overflow.s: Likewise.
* ld-aarch64/emit-relocs-86.s: Likewise.
* ld-aarch64/emit-relocs-86-overflow.s: Likewise.
* ld-aarch64/emit-relocs-529.d: New expectation file.
* ld-aarch64/emit-relocs-529-overflow.d: Likewise.
* ld-aarch64/emit-relocs-86.d: Likewise.
* ld-aarch64/emit-relocs-86-overflow.d: Likewise.
* ld-aarch64/aarch64-elf.exp: Run new testcases.
|
|
2015-08-11 Jiong Wang <jiong.wang@arm.com>
include/elf/
* aarch64.h (R_AARCH64_P32_TLSLD_ADD_DTPREL_LO12): Define.
bfd/
* reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12): New entry.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
gas/
* config/tc-aarch64.c (reloc_table): New relocation modifiers
"dtprel_lo12".
(md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
(aarch64_force_relocation): Likewise.
gas/testsuite/
* gas/aarch64/reloc-dtprel_lo12-1.s: New testcase.
* gas/aarch64/reloc-dtprel_lo12-ilp32-1.s: Likewise.
* gas/aarch64/reloc-dtprel_lo12-1.d: New expectation file.
* gas/aarch64/reloc-dtprel_lo12-ilp32-1.d: Likewise.
|
|
2015-08-11 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
(aarch64_reloc_got_type): Likewise.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_relocate_section): Likewise.
(elfNN_aarch64_gc_sweep_hook): Likewise.
(elfNN_aarch64_check_relocs): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/testsuite/
* ld-aarch64/tls-small-ld.s: Update testcase.
|
|
2015-08-11 Jiong Wang <jiong.wang@arm.com>
bfd/
* reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC): New entry.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
gas/
* config/tc-aarch64.c (reloc_table): New relocation modifiers.
(md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
(aarch64_force_relocation): Likewise.
gas/testsuite/
* gas/aarch64/reloc-tlsldm_lo12_nc-1.s: New testcase.
* gas/aarch64/reloc-tlsldm_lo12_nc-ilp32-1.s: Likewise.
* gas/aarch64/reloc-tlsldm_lo12_nc-1.d: New expectation file.
* gas/aarch64/reloc-tlsldm_lo12_nc-ilp32-1.d: Likewise.
|
|
2015-08-11 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.
(aarch64_reloc_got_type): Likewise.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_relocate_section): Likewise.
(elfNN_aarch64_gc_sweep_hook): Likewise.
(elfNN_aarch64_check_relocs): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/testsuite/
* ld-aarch64/tls-small-ld.s: New file.
* ld-aarch64/tls-small-ld.d: Likewise.
* ld-aarch64/aarch64-elf.exp: Run new test.
|
|
2015-08-11 Jiong Wang <jiong.wang@arm.com>
bfd/
* reloc.c (BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21): New entry.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.
gas/
* config/tc-aarch64.c (reloc_table): New relocation modifiers.
(md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.
(aarch64_force_relocation): Likewise.
gas/testsuite/
* gas/aarch64/reloc-tlsldm-page-1.s: New testcase.
* gas/aarch64/reloc-tlsldm-page-ilp32-1.s: Likewise.
* gas/aarch64/reloc-tlsldm-page-1.d: New expectation file.
* gas/aarch64/reloc-tlsldm-page-ilp32-1.d: Likewise.
|
|
Skip IFUNC relocations in debug sections ignored by ld.so.
bfd/
PR ld/18808
* elf32-i386.c (elf_i386_relocate_section): Skip IFUNC
relocations in debug sections.
* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
ld/testsuite/
PR ld/18808
* ld-ifunc/ifunc.exp: Add a test for PR ld/18808.
* ld-ifunc/pr18808.out: New file.
* ld-ifunc/pr18808a.c: Likewise.
* ld-ifunc/pr18808b.c: Likewise.
|
|
PR ld/18759
* elf32-or1k.c (R_OR1K_32_PCREL): Set pcrel_offset to TRUE.
(R_OR1K_16_PCREL): Likewise.
(R_OR1K_8_PCREL): Likewise.
|
|
PR binutils/18747
* coff-sh.c (_bfd_sh_align_load_span): Fix typo when setting
opcode count.
|
|
corrupt files.
PR binutils/18758
* elf.c (_bfd_elf_setup_sections): Add checks for corrupt section
group information.
* peicode.h (pe_ILF_make_a_section): Ensure alignment of the
used_by_bfd pointer.
(pe_ILF_build_a_bfd): Ensure alignment of vars.data pointer.
|
|
* elf.c (_bfd_elf_copy_private_bfd_data): Fix a typo.
|
|
|
|
This patch replaces the "hidden" field with the "versioned" field in
elf_link_hash_entry so that we can avoid calling strchr and strrchr if
the symbol is unversioned.
* elf-bfd.h (elf_symbol_version): New enum.
(elf_link_hash_entry): Replace hidden with versioned.
* elflink.c (_bfd_elf_merge_symbol): Don't look for symbol
version if the symbol is unversioned. Initialize versioned.
(_bfd_elf_add_default_symbol): Don't look for symbol version
if the symbol is unversioned or hidden. Initialize versioned.
(elf_collect_hash_codes): Don't look for symbol version if the
symbol is unversioned.
(elf_collect_gnu_hash_codes): Likewise.
(bfd_elf_gc_mark_dynamic_ref_symbol): Likewise.
(_bfd_elf_link_hash_copy_indirect): Check versioned instead of
hidden.
(elf_link_output_extsym): Likewise.
|
|
|
|
|
|
|
|
When copying the sh_link and sh_info fields in stripped section headers,
we also check if the sh_type, sh_flags, /sh_addralign and sh_entsize
fields of the output section match the output. Since --only-keep-debug
turns all non-debug sections into SHT_NOBITS sections, the output
SHT_NOBITS type matches any input type.
bfd/
PR binutils/18785
* elf.c (_bfd_elf_copy_private_bfd_data): When copying the
sh_link and sh_info fields in stripped section headers, we also
check if the sh_type, sh_flags, /sh_addralign and sh_entsize
fields of the output section match the output. Since
--only-keep-debug turns all non-debug sections into SHT_NOBITS
sections, the output SHT_NOBITS type matches any input type.
binutils/testsuite/
PR binutils/18785
* binutils-all/objcopy.exp: Run strip-12.
* binutils-all/strip-12.d: New file.
* binutils-all/strip-12.s: Likewise.
|
|
The hidden versioned symbol can only be merged with the versioned
symbol with the same symbol version. _bfd_elf_merge_symbol should
check the symbol version before merging the new hidden versioned
symbol with the existing symbol. _bfd_elf_link_hash_copy_indirect can't
copy any references to the hidden versioned symbol. We need to
bind a symbol locally when linking executable if it is locally defined,
hidden versioned, not referenced by shared library and not exported.
bfd/
PR ld/18720
* elflink.c (_bfd_elf_merge_symbol): Add a parameter to indicate
if the new symbol matches the existing one. The new hidden
versioned symbol matches the existing symbol if they have the
same symbol version. Update the existing symbol only if they
match.
(_bfd_elf_add_default_symbol): Update call to
_bfd_elf_merge_symbol.
(_bfd_elf_link_assign_sym_version): Don't set the hidden field
here.
(elf_link_add_object_symbols): Override a definition only if the
new symbol matches the existing one.
(_bfd_elf_link_hash_copy_indirect): Don't copy any references to
the hidden versioned symbol.
(elf_link_output_extsym): Bind a symbol locally when linking
executable if it is locally defined, hidden versioned, not
referenced by shared library and not exported. Turn on
VERSYM_HIDDEN only if the hidden vesioned symbol is defined
locally.
ld/testsuite/
PR ld/18720
* ld-elf/indirect.exp: Run tests for PR ld/18720.
* ld-elf/pr18720.out: New file.
* ld-elf/pr18720a.c: Likewise.
* ld-elf/pr18720b.c: Likewise.
* ld-elf/pr18720c.c: Likewise.
|
|
|
|
|
|
that the sh_link and sh_info fields in stripped section headers are preserved.
bfd * elf.c (_bfd_elf_copy_private_bfd_data): Copy the sh_link and
sh_info fields of sections whose type has been changed to
SHT_NOBITS.
bin * doc/binutils.texi: Document that the --only-keep-debug option
to strip and objcopy preserves the section headers of stripped
sections.
tests * binutils-all/objcopy.exp (keep_debug_symbols_and_check_links):
New proc. Checks that debug-info-only binaries retain the
sh_link field in stripped sections.
|
|
|
|
PR binutils/18750
* ihex.c (ihex_scan): Fixes incorrect escape sequence in error message
and stack overflow when char is signed and \200-\376 was in place of hex
digit; also fixes \377 was handled as EOF instead of "incorrect character".
(ihex_read_section): Changed for consistency.
(ihex_bad_byte): Prevent (now impossible to trigger) stack
overflow and incorrect escape sequence handling.
* srec.c (srec_bad_byte): Likewise.
* readelf.c (process_mips_specific): Fix incorrect escape
sequence handling.
|
|
|
|
It's bfd_link_info, not elf_link_hash_entry, for the old reference:
* elf32-cris.c (cris_elf_relocate_section)
(elf_cris_finish_dynamic_symbol, cris_elf_check_relocs)
(elf_cris_discard_excess_dso_dynamics): Use SYMBOLIC_BIND, not
just bfd_link_info->symbolic, to check if a symbol should be bound
symbolically.
|
|
* elf32-cris.c (cris_elf_relocate_section)
(elf_cris_finish_dynamic_symbol, cris_elf_check_relocs)
(elf_cris_discard_excess_dso_dynamics): Use SYMBOLIC_BIND, not
just h->symbolic, to check if a symbol should be bound
symbolically.
|
|
|
|
|
|
|
|
|
|
We should change the default symbol for the versioned symbol only when
not performing a relocatable link.
bfd/
PR ld/18735
* elflink.c (_bfd_elf_add_default_symbol): Add the default
symbol if not performing a relocatable link.
(elf_link_add_object_symbols): Adjust the default symbol if
not performing a relocatable link.
ld/testsuite/
PR ld/18735
* ld-elf/pr18735.d: New file.
* ld-elf/pr18735.s: Likewise.
|
|
|
|
This patch changes "ld -r" not to set link_info.executable. It
removes !info->relocatable check for info->executable and adds it
for !info->executable in elflink.c.
bfd/
* elflink.c (elf_link_add_object_symbols): Remove
!info->relocatable check for info->executable. Add
!info->relocatable check for !info->executable.
(elf_link_output_extsym): Remove
!info->relocatable check for info->executable.
ld/
* lexsup.c (parse_args): Don't set link_info.executable to
TRUE for link_info.relocatable.
|
|
* mmo.c (mmo_write_symbols_and_terminator): Skip symbol-type
assignment loop for bfd plugin objects.
|
|
|
|
Commit 23283c1b changed the layout of some bss style sections on
powerpc64, but neglected to add a page gap before the third PT_LOAD
segment created by this reording. Without a page gap we get two
PT_LOAD headers that overlap by one page in memory. That shouldn't be
allowed because the dynamic loader will load garbage from the first
page of the last segment over the last page of the previous segment.
bfd/
* elf.c (_bfd_elf_map_sections_to_segments): Do not make a new
segment for loaded sections after nonloaded sections if the
sections are on the same page.
ld/testsuite/
* ld-powerpc/elfv2so.d: Update
|
|
This should fix some build errors seen on AIX, MinGW, and possibly other
non-GNU systems too due to missing asprintf().
bfd/
* configure.in: Add asprintf and vasprintf to AC_CHECK_DECLS.
* config.in, configure: Regenerate.
|
|
|
|
bfd/
* configure: Regenerated.
binutils/
* configure: Regenerated.
gas/
* configure: Regenerated.
gold/
* configure: Regenerated.
gprof/
* configure: Regenerated.
ld/
* configure: Regenerated.
opcodes/
* configure: Regenerated.
|
|
* elf32-msp430.c (uses_large_model): New function.
(msp430_elf_eh_frame_address_size): New function.
(elf_backend_eh_frame_address_size): Define.
|
|
Emit *GLOB_DAT instead of *RELATIVE relocs for protected data
in shared objects.
This is needed for the fix of glibc bug 17711:
https://sourceware.org/bugzilla/show_bug.cgi?id=17711
bfd:
PR ld/18705
* elfnn-aarch64.c (elf_backend_extern_protected_data): Define.
ld/testsuite:
PR ld/18705
* ld-aarch64/protected-data.d: New.
* ld-aarch64/protected-data.s: New.
* ld-aarch64/aarch64-elf.exp: Add new test.
|
|
Emit *GLOB_DAT instead of *RELATIVE relocs for protected data
in shared objects.
This is needed for the fix of glibc bug 17711:
https://sourceware.org/bugzilla/show_bug.cgi?id=17711
bfd:
PR ld/18705
* elf32-arm.c (elf_backend_extern_protected_data): Define.
ld/testsuite:
PR ld/18705
* ld-arm/protected-data.d: New.
* ld-arm/protected-data.s: New.
* ld-arm/arm-elf.exp: Add new test.
|
|
|