Commit Graph

12057 Commits

Author SHA1 Message Date
Hans-Peter Nilsson 4122b41366 Fix ChangeLog for "FAIL: -Bsymbolic-functions" for cris-linux in ld
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.
2015-08-03 20:44:05 +02:00
Hans-Peter Nilsson cb1c8103f1 Fix "FAIL: -Bsymbolic-functions" for cris-linux in ld
* 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.
2015-08-03 20:34:51 +02:00
GDB Administrator 17c42309df Automatic date update in version.in 2015-08-03 00:00:08 +00:00
GDB Administrator 5e99d4b301 Automatic date update in version.in 2015-08-02 00:00:08 +00:00
GDB Administrator 5efafabf7b Automatic date update in version.in 2015-08-01 00:00:08 +00:00
GDB Administrator 22d31b1192 Automatic date update in version.in 2015-07-31 00:00:08 +00:00
H.J. Lu c6e8a9a802 Don't change the default symbol for relocatable link
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.
2015-07-30 03:28:00 -07:00
GDB Administrator 13be649613 Automatic date update in version.in 2015-07-30 00:00:08 +00:00
H.J. Lu e77e648e93 Don't set link_info.executable for "ld -r"
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.
2015-07-29 09:14:05 -07:00
Hans-Peter Nilsson 11509220a0 bfd/mmo.c (MMIX): Fix massive gcc LTO testsuite failures.
* mmo.c (mmo_write_symbols_and_terminator): Skip symbol-type
	assignment loop for bfd plugin objects.
2015-07-29 05:40:30 +02:00
GDB Administrator a66f09dd91 Automatic date update in version.in 2015-07-29 00:00:09 +00:00
Alan Modra e5654c0f84 Fallout from "Reorder more powerpc64 sections for -z relro"
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
2015-07-28 18:42:43 +09:30
Iain Buclaw d6f1bafa2c Check for asprintf and vasprintf during configure stage.
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.
2015-07-28 09:57:32 +02:00
GDB Administrator 671c4e31fb Automatic date update in version.in 2015-07-28 00:00:08 +00:00
H.J. Lu 37a42ee9ad Regenerate configure files
bfd/

	* configure: Regenerated.

binutils/

	* configure: Regenerated.

gas/

	* configure: Regenerated.

gold/

	* configure: Regenerated.

gprof/

	* configure: Regenerated.

ld/

	* configure: Regenerated.

opcodes/

	* configure: Regenerated.
2015-07-27 07:56:32 -07:00
Nick Clifton 79559014b2 Fix the address size computation for the MSP430 port.
* elf32-msp430.c (uses_large_model): New function.
	(msp430_elf_eh_frame_address_size): New function.
	(elf_backend_eh_frame_address_size): Define.
2015-07-27 15:15:28 +01:00
Szabolcs Nagy 32f573bcb3 [AArch64] Fix extern protected data handling
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.
2015-07-27 11:48:48 +01:00
Szabolcs Nagy b68a20d667 [ARM] Fix extern protected data handling
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.
2015-07-27 11:45:27 +01:00
GDB Administrator 0c096ed760 Automatic date update in version.in 2015-07-27 00:00:08 +00:00
GDB Administrator 805cee45cd Automatic date update in version.in 2015-07-26 00:00:11 +00:00
H.J. Lu 18d9555c6e Add missing ChangeLog files 2015-07-25 08:10:51 -07:00
H.J. Lu 1659f720b0 Skip missing symbol version section check for executable
Missing symbol version section is a run-time problem only if it will
be referenced dynamically at run-time.  We should skip the check for
locally defined symbol, which isn't referenced by shared library, when
linking executable.

bfd/

	PR ld/18718
	* elflink.c (elf_link_output_extsym): Check symbol version
	section check only if not linking executable, the symbol is
	referenced by shared library or not locally defined.

ld/testsuite/

	PR ld/18718
	* ld-elf/pr18718.c: New file.
	* ld-elf/shared.exp: Run tests for PR ld/18718.
2015-07-25 08:07:33 -07:00
Alan Modra a496fbc880 Fix broken -Bsymbolic-functions
For selected targets.  The testcase reveals a number of targets that
still need fixing.

bfd/
	* elf32-arm.c (elf32_arm_final_link_relocate): Use SYMBOLIC_BIND to
	check if a symbol should be bound symbolically.
	* elf32-hppa.c (elf32_hppa_check_relocs,
	elf32_hppa_adjust_dynamic_symbol, elf32_hppa_relocate_section,
	elf32_hppa_finish_dynamic_symbol): Likewise.
	* elf32-m68k.c (elf_m68k_check_relocs,
	elf_m68k_relocate_section): Likewise.
	* elf32-nios2.c (nios2_elf32_relocate_section,
	nios2_elf32_check_relocs, allocate_dynrelocs): Likewise.
	* elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol,
	elf32_tic6x_relocate_section): Likewise.
ld/testsuite/
	* ld-elf/symbolic-func.s,
	* ld-elf/symbolic-func.r: New test.
	* ld-elf/elf.exp: Run it.
2015-07-25 20:41:04 +09:30
GDB Administrator f7d3050b19 Automatic date update in version.in 2015-07-25 00:00:08 +00:00
Alan Modra 91cb26dac4 Correct reloc section name
* elf.c (_bfd_elf_assign_file_positions_for_non_load): Use .rela
	prefix for reloc section corresponding to rela section associated
	with renamed debug section.
2015-07-24 14:48:55 +09:30
Alan Modra 2fb9328d8d bfd_get_section_by_name_if hash chain traversal
This function stops too soon, as I found when the hash chain happened
to contain two .debug_macro sections and a .bss section:
.debug_macro -> .bss -> .debug_macro

	* section.c (bfd_get_section_by_name_if): Iterate over entire hash
	chain.
2015-07-24 14:48:35 +09:30
GDB Administrator f0b0791b05 Automatic date update in version.in 2015-07-24 00:00:14 +00:00
Joseph Myers d5cff5df74 Fix DT_MIPS_RLD_MAP_REL tag for n64 target and 32-bit host.
For the case of MIPS n64 target and 32-bit host, the computation of
the DT_MIPS_RLD_MAP_REL tag involves sdyn->output_section->vma +
sdyn->output_offset (64-bit) being added to b (32-bit host pointer),
so losing the high part and resulting in an incorrect
DT_MIPS_RLD_MAP_REL tag, and all dynamically linked glibc tests
failing for n64.  This patch fixes this (spot-tested with glibc tests;
however, I don't have a self-contained testcase for this bug).

	* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections)
	<DT_MIPS_RLD_MAP_REL>: Add target address to host address
	difference, not to host pointer.
2015-07-23 21:52:04 +00:00
GDB Administrator 510fac86d7 Automatic date update in version.in 2015-07-23 00:00:07 +00:00
Alan Modra bb854a36d1 Fix ppc64 ELFv1 assertion failure
Bogus assembly can hit an assertion in opd_entry_value when the symbol
referenced by a function descriptor is undefined.  Worse, the code
after the assert copies unitialised memory to return the code section.
This uninitialised pointer can later be dereferencd, possibly causing
a linker segmentation fault.

	* elf64-ppc.c (opd_entry_value): Remove assertion.  Instead,
	return -1 if symbol referenced is not defined.  Tidy.
2015-07-22 19:20:38 +09:30
GDB Administrator 6dca8d51d5 Automatic date update in version.in 2015-07-22 00:00:08 +00:00
GDB Administrator 391538482e Automatic date update in version.in 2015-07-21 00:00:07 +00:00
H.J. Lu 7ac018954b Make binutils abort message GDB friendly
We used to generate abort messages like:

internal error, aborting at .../bfd/elf64-x86-64.c line 1554 in elf_x86_64_check_relocs

We can't cut and paste "file line ???" to GDB.  This patch changes those
abort messages to

internal error, aborting at .../bfd/elf64-x86-64.c:1554 in elf_x86_64_check_relocs

so that we can cut and paste "file:???" to GDB.

bfd/

	* bfd.c (_bfd_abort): Replace " line " with ":" in output
	message.

gas/

	* messages.c (as_assert): Replace " line " with ":" in output
	message.
	(as_abort): Likewise.

ld/

	* ldmisc.c (ld_abort): Replace " line " with ":" in output
	message.
2015-07-20 05:53:31 -07:00
Alan Modra f2d7e0f450 Regen two files
bfd/
	* po/SRC-POTFILES.in: Regenerate.
binutils/
	* doc/Makefile.in: Regenerate.
2015-07-20 14:31:23 +09:30
GDB Administrator 5e63e45255 Automatic date update in version.in 2015-07-20 00:00:07 +00:00
GDB Administrator 0bda1f8819 Automatic date update in version.in 2015-07-19 00:00:08 +00:00
GDB Administrator ce62125ee9 Automatic date update in version.in 2015-07-18 00:00:08 +00:00
Jiong Wang 4c0a9a6fa1 [AArch64] Sort TLS reloc types alphabetically 2015-07-17 13:03:26 +01:00
GDB Administrator 4f9b735fea Automatic date update in version.in 2015-07-17 00:00:08 +00:00
Jiong Wang 77a69ff840 [AArch64][3/3] LD support BFD_RELOC_AARCH64_TLSLD_ADR_PREL21 2015-07-16 15:46:21 +01:00
Jiong Wang 6c37fedc41 [AArch64][2/3] GAS support BFD_RELOC_AARCH64_TLSLD_ADR_PREL21 2015-07-16 15:43:21 +01:00
GDB Administrator bb20bd8373 Automatic date update in version.in 2015-07-16 00:00:07 +00:00
GDB Administrator 2101878487 Automatic date update in version.in 2015-07-15 00:00:08 +00:00
GDB Administrator 05e83eb1b6 Automatic date update in version.in 2015-07-14 00:00:08 +00:00
GDB Administrator c576455ba7 Automatic date update in version.in 2015-07-13 00:00:08 +00:00
GDB Administrator 9394ff46fb Automatic date update in version.in 2015-07-12 00:00:08 +00:00
GDB Administrator e571fc2b05 Automatic date update in version.in 2015-07-11 00:00:08 +00:00
H.J. Lu 889884731e Properly convert objects between different ELF classes
The output SHF_COMPRESSED section size is different from input if
ELF classes of input and output aren't the same.  We must adjust
the section sizes as well as the compression headers in
SHF_COMPRESSED sections when converting objects between different
ELF classes.

bfd/

	 PR binutils/18656
	 * bfd.c (bfd_convert_section_size): New function.
	 (bfd_convert_section_contents): Likewise.
	 * bfd-in2.h: Regenerated.

binutils/

2015-07-10  H.J. Lu  <hongjiu.lu@intel.com>

	 PR binutils/18656
	 * objcopy.c (setup_section): Call bfd_convert_section_size
	 to get the output section size.
	 (copy_section): Get the section size from the output section
	 and call bfd_get_full_section_contents to convert section
	 contents for output.

binutils/testsuite/

	 PR binutils/18656
	 * binutils-all/compress.exp (convert_test): New proc.
	 Run conversion tests between x86-64 and x32.
2015-07-10 14:27:39 -07:00
GDB Administrator f250f5c6dd Automatic date update in version.in 2015-07-10 00:00:08 +00:00
Catherine Moore de231f2015 2015-07-09 Catherine Moore <clm@codesourcery.com>
* elflink.c (bfd_elf_size_dynamic_sections): Call to
        _bfd_elf_maybe_strip_eh_frame_hdr should be before
        bed->elf_backend_size_dynamic_sections.
2015-07-09 08:07:47 -07:00