Commit Graph

11328 Commits

Author SHA1 Message Date
Alan Modra 9a560ca009 daily update 2014-09-10 09:31:19 +09:30
Alan Modra 0a62cfe567 daily update 2014-09-09 09:31:20 +09:30
Alan Modra 22af555fc2 daily update 2014-09-08 09:30:39 +09:30
Alan Modra 3f9d8762a4 daily update 2014-09-07 09:30:40 +09:30
Alan Modra cf07f4d983 daily update 2014-09-06 09:30:42 +09:30
Alan Modra 514104634d daily update 2014-09-05 09:31:04 +09:30
Alan Modra 38a1a52644 daily update 2014-09-04 09:30:40 +09:30
Alan Modra 7db018e4e0 daily update 2014-09-03 09:30:52 +09:30
Alan Modra f1fb1cd70a daily update 2014-09-02 09:30:41 +09:30
Alan Modra e36bf69878 daily update 2014-09-01 09:30:42 +09:30
Alan Modra d126d60cdc daily update 2014-08-31 09:30:41 +09:30
Alan Modra 6128f9cf2b ppc476 patch area size miscalculation
ppc476 sections that end exactly on a page boundary need the
workaround applied when a function ends in "bctr", or when pasting
together code from multiple sections.  The space allocated for the
patch area didn't allow for this case, while the code in
relocate_section performing the patches did, leading to an assertion
failure.

	* elf32-ppc.c (ppc_elf_relax_section): Fix off by one error.
2014-08-30 10:12:44 +09:30
Alan Modra 70cc888ddc daily update 2014-08-30 09:30:43 +09:30
Alan Modra 4805fc5533 PowerPC64 call lacks nop error
* elf64-ppc.c (ppc64_elf_relocate_section): Report a different
	error for calls via a toc adjusting stub without a nop.
2014-08-29 10:52:50 +09:30
Alan Modra b138affb02 Prevent alpha_vms_object_p stopping bfd_check_format_matches scan
Any error other than bfd_error_wrong_format returned from object_p()
is effectively a fatal error.

	* vms-alpha.c (alpha_vma_object_p): Don't return file_truncated
	error.  Remove redundant bfd_set_error.
2014-08-29 10:37:52 +09:30
Alan Modra bd25671c6f Report an error for S-records with less than the miniumum size
* srec.c (srec_scan): Revert last change.  Report an error for
	S-records with less than the miniumum byte count.
2014-08-29 10:36:57 +09:30
Alan Modra 53e989de26 daily update 2014-08-29 09:30:41 +09:30
H.J. Lu 376c8d5bbb Check S-record with 0 size
* srec.c (srec_scan): Return error for 0 size.
2014-08-28 08:24:19 -07:00
Alan Modra 53116d5d21 daily update 2014-08-28 09:30:36 +09:30
H.J. Lu c8831961f9 Use bfd_is_abs_section to check discarded input section
bfd/

	PR ld/17306
	* elf32-i386.c (elf_i386_convert_mov_to_lea): Use bfd_is_abs_section
	to check discarded input section.
	* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.

ld/testsuite/

	PR ld/17306
	* ld-i386/i386.exp (i386tests): Add tests for PR ld/17306.
	* ld-x86-64/x86-64.exp (x86_64tests): Likewise.

	* ld-i386/pr17306a.s: New file.
	* ld-i386/pr17306b.s: Likewise.
	* ld-x86-64/pr17306a.s: Likewise.
	* ld-x86-64/pr17306b.s: Likewise.
2014-08-27 07:59:48 -07:00
H.J. Lu 29a9f53e85 Don't attach dynamic sections to input from ld --just-symbols
bfd/

	PR ld/17313
	* elflink.c (elf_link_add_object_symbols): Don't attach dynamic
	sections to input from ld --just-symbols.

2014-08-27  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/17313
	* ld-i386/i386.exp (i386tests): Add tests for PR ld/17313.
	* ld-x86-64/x86-64.exp (x86_64tests): Likewise.
2014-08-27 07:39:48 -07:00
Alan Modra 7322eefb9e daily update 2014-08-27 09:31:12 +09:30
DJ Delorie 32e79d3920 Disambiguate test for relaxation type.
* elf32-rl78.c (rl78_elf_relax_section): Disambiguate test for
relaxation type.
2014-08-26 14:03:29 -04:00
Jiong Wang 614b09cefb [AArch64] Improve copy relocation support on four absolute relocation types
2014-08-26  Jiong Wang  <jiong.wang@arm.com>

  bfd/
	* elfnn-aarch64.c (elfNN_aarch64_check_relocs): Initialize non_got_ref
	properly for MOVW_G0/1/2_NC and MOVW_G3.  Reject them when linking
	shared library.
	(elfNN_aarch64_gc_sweep_hook): Add check on these relocs.

  ld/testsuite/
	* ld-aarch64/copy-relocs-so.s: New test file.
	* ld-aarch64/copy-relocs-exe.s: Likewise.
	* ld-aarch64/copy-relocs.d: New expectation file.
	* ld-aarch64/emit-relocs-264-bad.d: New test file.
	* ld-aarch64/emit-relocs-266-bad.d: Likewise.
	* ld-aarch64/emit-relocs-268-bad.d: Likewise.
	* ld-aarch64/emit-relocs-269-bad.d: Likewise.
	* ld-aarch64/aarch64-elf.exp: Run new added test.
2014-08-26 15:48:47 +01:00
Nick Clifton 0d6d4c8205 Fix a typo in the selection pattern for the or1knd cpu.
* config.bfd: Fix typo in or1knd selection.
2014-08-26 10:27:21 +01:00
Alan Modra 9c11efa4c2 daily update 2014-08-26 09:30:37 +09:30
Alan Modra 957979137f daily update 2014-08-25 09:30:41 +09:30
Alan Modra ca71f0dbc6 daily update 2014-08-24 09:31:13 +09:30
Alan Modra 9bda4a968f daily update 2014-08-23 09:42:52 +09:30
Kai Tietz a4a027b7f4 Fix file-alignment for objcopy for pe-coff
2014-08-22  Kai Tietz  <ktietz@redhat.com>

	PR binutils/11822
	* coffcode.h (coff_compute_section_file_positions): Keep
	FileAlignment valid as set.
2014-08-22 11:26:26 +02:00
Alan Modra 4564fb94da Delete redundant struct cie field
cie->output_sec is used to when merging CIEs to ensure that only CIEs
from the same output section are merged.  I noticed an assignment to
this field in _bfd_elf_parse_eh_frame, and thought "That's wrong,
output_section isn't set properly when _bfd_elf_parse_eh_frame is
called from gc-sections code".  It turns out that this assignment is
premature, and in fact a dead store.  find_merged_cie overwrites with
the correct value before the field is ever used.  On looking a little
more it becomes apparent that cie->cie_inf.u.cie.u.sec->output_section
holds the same value, so cie->output_sec is redundant.

	* elf-eh-frame.c (struct cie): Delete "output_sec" field.
	(cie_eq, cie_compute_hash): Use output_section from cie_inf instead.
2014-08-22 10:09:09 +09:30
Alan Modra da44f4e546 Index PowerPC64 linker generated .eh_frame in .eh_frame_hdr
I noticed recently that .eh_frame FDEs generated by the linker for
call stubs and .glink weren't being indexed in .eh_frame_hdr, due to
bfd_elf_discard_info being run before the linker generated .eh_frame
sections were available for parsing.  This patch moves code around in
elf64-ppc.c and ppc64elf.em to avoid that problem.

Another problem fixed here is that --gc-sections parses .eh_frame
early, and the existing machinery allows only one go at parsing the
.eh_frame sections.  That resulted in the linker generated .eh_frame
CIEs not being merged and no .eh_frame_hdr index entries for those
FDEs.  It turns out that all the info from parsing .eh_frame is
attached to the section, so order of parsing isn't important, and
after parsing sec_info_type being set will prevent a section being
parsed again.  At least, when parsing doesn't hit an error.  So there
isn't really any need for "parsed_eh_frame".  "merge_cies" is also
redundant, which means _bfd_elf_{begin,end}_eh_frame_parsing can also
disappear.

bfd/
	* elf-bfd.h (struct eh_frame_hdr_info): Delete merge_cies and
	parsed_eh_frames.
	(_bfd_elf_begin_eh_frame_parsing): Delete.
	(_bfd_elf_end_eh_frame_parsing): Delete.
	* elf-eh-frame.c (_bfd_elf_begin_eh_frame_parsing): Delete.
	(_bfd_elf_end_eh_frame_parsing): Delete.
	(_bfd_elf_parse_eh_frame): Don't test parsed_eh_frame.  Test
	!info->relocatable in place of merge_cies.
	* elflink.c (bfd_elf_gc_sections, bfd_elf_discard_info): Adjust.
	* elf64-ppc.c (glink_eh_frame_cie): Pad to multiple of 8.
	(ppc64_elf_size_stubs): Likewise pad stub FDE.
	(ppc64_elf_build_stubs): Move code setting glink .eh_frame to..
	(ppc64_elf_size_stubs): ..here and..
	(ppc64_elf_finish_dynamic_sections): ..here.
ld/
	* emultempl/ppc64elf.em (gld${EMULATION_NAME}_after_allocation): Call
	bfd_elf_discard_info after generating glink .eh_frame.  Delete
	redundant test on ppc64_elf_setup_section_lists status.
2014-08-22 10:09:09 +09:30
Alan Modra 7f85237141 daily update 2014-08-22 10:02:05 +09:30
Maciej W. Rozycki 1d7c96351a PowerPC64/BFD: Fix ppc64_elf_set_toc indentation
* elf64-ppc.h (ppc64_elf_set_toc): Fix indentation.
2014-08-21 12:31:58 +01:00
Terry Guo c542398150 bfd/ChangeLog
2014-08-21  Tony Wang  <tony.wang@arm.com>

	* elf32-arm.c (elf32_arm_final_link_relocate): Implement
	the veneer routine for R_ARM_THM_JUMP19.
	(arm_type_of_stub): Add conditional clause for R_ARM_THM_JUMP19
	(elf32_arm_size_stub): Ditto.

ld/testsuite/ChangeLog
2014-08-21  Tony Wang  <tony.wang@arm.com>

	* ld-arm/jump-reloc-veneers-cond.s: New test.
	* ld-arm/farcall-cond-thumb-arm.s: Ditto.
	* ld-arm/jump-reloc-veneers-cond-short.d: Expected output
	for target without a veneer generation.
	* ld-arm/jump-reloc-veneers-cond-long.d: Expected output
	for target with a veneer generation.
	* ld-arm/farcall-cond-thumb-arm.d: Expected output for
	inter working veneer generation.
	* ld-arm/arm-elf.exp: Add tests for conditional branch veneer.
2014-08-21 18:00:35 +08:00
Roland McGrath 469a34932a Fix PR ld/17277: bogus dynamic relocs and TEXTREL for ARM PC-relative relocs
bfd/
	PR ld/17277
	* elf32-arm.c (elf32_arm_check_relocs): Increment P->pc_count for
	all reloc types with pc_relative set in the howto, not just for
	R_ARM_REL32 and R_ARM_REL32_NOI.
	(allocate_dynrelocs_for_symbol): Update comment.
	(elf32_arm_gc_sweep_hook): For all reloc types with pc_relative
	set in the howto, set call_reloc_p and may_need_local_target_p but
	not may_become_dynamic_p; not only for R_ARM_REL32 and R_ARM_REL32_NOI.
	(elf32_arm_check_relocs): Likewise.

ld/testsuite/
	PR ld/17277
	* ld-arm/pcrel-shared.s: New file.
	* ld-arm/pcrel-shared.rd: New file.
	* ld-arm/arm-elf.exp (armelftests_common): Add it.
2014-08-20 10:12:57 -07:00
Will Newton 01e6c1a48d ARM: Add support for armeb-*-eabi*
At the moment it is possible to configure binutils for these triples
but the resulting linker defaults to little endian with huge numbers
of testsuite failures, which on the face of it does not appear to make
much sense.

This patch makes the behaviour similar to armeb-elf and the testsuite
is clean.

bfd/ChangeLog:

2014-08-20  Will Newton  <will.newton@linaro.org>

	* config.bfd: Default armeb-*-eabi* to big endian.

ld/ChangeLog:

2014-08-20  Will Newton  <will.newton@linaro.org>

	* configure.tgt: Default armeb-*-eabi* to big endian.
2014-08-20 16:58:36 +01:00
Alan Modra 4627fc13ce daily update 2014-08-20 09:31:14 +09:30
Alan Modra 2974be626b Fix --diable-shared --enable-plugins build breakage
Directories that don't use libtool need to add -ldl (on most *nix
hosts) to provide dlopen for libbfd.

config/
	* plugins.m4 (AC_PLUGINS): If plugins are enabled, add -ldl to
	LIBS via AC_SEARCH_LIBS.
gdb/
	* acinclude.m4 (GDB_AC_CHECK_BFD): Don't add -ldl.
	* config.in: Regenerate.
sim/ppc/
	* configure.ac: Invoke AC_PLUGINS.
	* config.in: Regenerate.

and regen lots of configure files.
2014-08-19 21:59:56 +09:30
Alan Modra 774891604b daily update 2014-08-19 09:31:12 +09:30
Alan Modra 1009ef284f PowerPC fix for ifunc broken by d1eca1e4
This probably could be fixed by making changes in relocate_section for
ifunc, but it's simpler to disable the optimisation for ifunc.

	* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't attempt to
	use dynrelocs for ifunc.
	* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Similarly.
2014-08-18 21:00:46 +09:30
Alan Modra 1240be6b7d PR 17287, DT_NEEDED of unneeded libraries affects --as-needed
PR 17287
bfd/
	* elflink.c (on_needed_list): Only consider libraries that have
	been loaded.
ld/
	* ld.texinfo (--as-needed): Clarify that references from libraries
	must be from needed libraries.
ld/testsuite/
	* ld-plugin/needed3.c: New file.
	* ld-elf/shared.exp: Add needed3 test.
2014-08-18 18:45:01 +09:30
Alan Modra 759388538d Return error status from bfd_elf_discard_info.
bfd/
	* elflink.c (bfd_elf_discard_info): Return int error status.
	* stabs.c (_bfd_discard_section_stabs): Comment typo fix.
	* bfd-in.h (bfd_elf_discard_info): Updata prototype.
	* bfd-in2.h: Regenerate.
ld/
	* emultempl/aarch64elf.em (gld${EMULATION_NAME}_after_allocation):
	Handle error status from bfd_elf_discard_info.
	* emultempl/armelf.em: Likewise.
	* emultempl/elf32.em: Likewise.
	* emultempl/hppaelf.em: Likewise.
	* emultempl/metagelf.em: Likewise.
	* emultempl/nios2elf.em: Likewise.
	* emultempl/ppc64elf.em: Likewise.
	* emultempl/tic6xdsbt.em: Likewise.
	* emultempl/vms.em: Likewise.
2014-08-18 09:33:35 +09:30
Alan Modra 87ea0aeaa3 daily update 2014-08-18 09:30:46 +09:30
Alan Modra d2db64e914 daily update 2014-08-17 09:30:44 +09:30
Alan Modra a0d09f12db daily update 2014-08-16 09:31:03 +09:30
Alan Modra 7dba4c934c daily update 2014-08-15 09:31:09 +09:30
Alan Modra 513ea82edf Fix for objdump segfault on broken PE executable
* peXXigen.c (pe_print_reloc): Protect against access past end
	of .reloc section.
2014-08-14 16:57:08 +09:30
Alan Modra 18cd5bce47 Linker part of PR16563 fix
Presents .eh_frame input sections to the optimisation machinery in
elf-eh-frame.c in the order they are given by the linker script.

	PR 16563
bfd/
	* elflink.c (bfd_elf_discard_info): Process .eh_frame and .stab
	in the order they are mapped to output sections.
ld/
	* ldlang.c (map_head_is_link_order): Rename from
	stripped_excluded_sections.
	(lang_clear_os_map): New function, extracted from..
	(strip_excluded_output_sections): ..here.
	* ldlang.h (lang_clear_os_map): Declare.
	* ldwrite.c (ldwrite): Call lang_clear_os_map.
	* emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_after_allocation):
	Likewise.
2014-08-14 13:49:31 +09:30
Alan Modra b879806f2f configury changes to make ld plugin support controlled by --enable-plugins
This also makes --enable-plugins default to on for hosts that can
support plugins, so we have consistent lto toolchain support.  The
ACX_LARGEFILE moves aren't strictly necessary, but are harmless and
will be necessary if plugin support is extended to more hosts via
libtool's dlopen support.  I started down that path then decided it
was more work than I was interested in doing.  (ACX_LARGEFILE invokes
AC_PLUGINS.)

config/
	* plugins.m4: Test for dlfcn.h or windows.h here to set default
	for --enable-plugins.  Report error if someone tries to enable
	plugins on a host we don't support.
bfd/
	* configure.ac: Delete redundant plugin related checks.
	* configure: Regenerate.
binutils/
	* configure.ac: Move ACX_LARGEFILE after LT_INIT.
	* config.in: Regenerate.
	* configure: Regenerate.
gas/
	* configure.ac: Move ACX_LARGEFILE after LT_INIT.
	* config.in: Regenerate.
	* configure: Regenerate.
gprof/
	* configure.ac: Move ACX_LARGEFILE after LT_INIT.
	* configure: Regenerate.
	* gconfig.in: Regenerate.
ld/
	* configure.ac: Move AC_PROG_CC and other macros earlier.  Delete
	plugin checks now done in config/plugins.m4.
	* config.in: Regenerate.
	* configure: Regenerate.
2014-08-14 13:46:09 +09:30