Commit Graph

3400 Commits

Author SHA1 Message Date
Alan Modra 02f9d0c5fb * ld-gc/abi-note.d: Exclude aout and oldld targets.
* ld-gc/start.d: Likewise.
	* ld-scripts/section-match-1.d: Likewise, and tic30.
2010-09-10 07:18:36 +00:00
Alan Modra 8658f98909 PR ld/11931
* ldlang.h (lang_for_each_statement_worker): Declare.
	* ldlang.c (lang_for_each_statement_worker): Make global.  Don't
	recurse into children of output_section_statement with constraint
	set to -1.
	(print_assignment): Handle NULL output_section->bfd_section.
	(lang_size_sections_1): Ignore output section statement address
	when constraint is -1.
	* emultempl/xtensaelf.em (lang_for_each_statement_worker): Delete.
2010-09-10 01:23:12 +00:00
Hans-Peter Nilsson d3615e3a49 * ld-scripts/rgn-at5.d: Restrict to *-*-linux*. 2010-09-10 01:00:28 +00:00
H.J. Lu a2d1e02801 Don't warn zero LMA adjustment.
bfd/

2010-09-09  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/11998
	* elf.c (assign_file_positions_for_load_sections): Don't warn
	zero LMA adjustment.

ld/testsuite/

2010-09-09  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/11998
	* ld-scripts/rgn-at5.d: New.
	* ld-scripts/rgn-at5.s: Likewise.
	* ld-scripts/rgn-at5.t: Likewise.
2010-09-09 19:22:29 +00:00
Tristan Gingold 7587572432 binutils/
2010-09-09  Tristan Gingold  <gingold@adacore.com>

	* NEWS: Add entry to NEWS for hppa/som.


ld/
2010-09-09  Tristan Gingold  <gingold@adacore.com>

	* NEWS: Add a entry for alpha-vms.
2010-09-09 10:46:33 +00:00
H.J. Lu f4923a1611 Add missing files. 2010-09-07 17:52:32 +00:00
Nick Clifton 3dbcc61de6 * ldwrite.c (clone_section): Call bfd_copy_private_section_data on
newly cloned section.
        * ld-x86-64/split-by-file.rd: New test.
        * ld-x86-64/split-by-file1.s: New test source code.
        * ld-x86-64/split-by-file2.s: New test source code.
        * ld-x86-64/x86-64.exp: Run the new test.
        * readelf.c (process_section_headers): Mention meaning of 'l'
        section flag for x86-64 targets.
2010-09-07 15:02:17 +00:00
Richard Henderson c518ddd883 Select 32-bit pei for 64-bit pei configurations. 2010-09-02 22:54:44 +00:00
Nick Clifton 0d6cedc074 Fix typo 2010-09-01 08:06:58 +00:00
Nick Clifton b97b635e0f * ld-scripts/section-match.exp: New file. Runs ths
section-match-1 test.
        * ld-scripts/section-match-1.d: New file.
        * ld-scripts/section-match-1.s: New file.
        * ld-scripts/section-match-1.t: New file.
2010-09-01 08:05:16 +00:00
Nick Clifton 107c6e11a7 * ldlex.l (WILDCHAR): Add the caret and exclamation point
characters, so that they can be used inside regexps.
2010-08-31 16:08:24 +00:00
Nick Clifton c09e9a8c9e * ld.texinfo (MEMORY): Clarify the behaviour of the ! character in
a region's attributes.
2010-08-31 10:26:11 +00:00
Alan Modra 6be999b866 * scripttempl/mmo.sc: Move assignment to "Main" inside .text
output section statement.
2010-08-31 05:11:29 +00:00
H.J. Lu 8dd881b6e3 Check audit entry only on ELF input.
2010-08-25  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/11946
	* emultempl/elf32.em (_before_allocation): Check audit entry
	only on ELF input.
2010-08-25 16:57:32 +00:00
H.J. Lu 5fec85997f Move gas/ld NEWS from binutils to gas/ld. 2010-08-25 16:03:58 +00:00
Julian Brown 4563a86028 bfd/
* elf32-arm.c (arm_stub_required_alignment): New.
    (arm_build_one_stub): Use above to partition stubs.
    (make_branch_to_a8_stub): Use arm_stub_a8_veneer_lwm not
    arm_stub_a8_veneer_b_cond.

    ld/testsuite/
    * ld-arm/arm-elf.exp (armelftests): Add cortex-a8-fix-blx-bcond.s.
    * ld-arm/cortex-a8-fix-blx-bcond.s: New.
    * ld-arm/cortex-a8-fix-blx-bcond.d: New.
2010-08-25 12:37:30 +00:00
H.J. Lu b51176f170 Fix typos in ld-x86-64/x86-64.exp.
2010-08-24  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-x86-64/x86-64.exp: Fix typos.
2010-08-24 16:36:25 +00:00
Maciej W. Rozycki 9eeefea8dd binutils/
* readelf.c (display_mips_gnu_attribute): Replace GCC options
	with a textual description of a MIPS32r2 64-bit FPU.

	ld/testsuite/
	* ld-mips-elf/attr-gnu-4-04.d: Adjust Tag_GNU_MIPS_ABI_FP for
	the new MIPS32r2 64-bit FPU description.
	* ld-mips-elf/attr-gnu-4-40.d: Likewise.
	* ld-mips-elf/attr-gnu-4-44.d: Likewise.
2010-08-23 13:51:40 +00:00
H.J. Lu 4440bb7785 Find one .eh_frame section for --eh-frame-hdr.
2010-08-22  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/11937
	* emultempl/elf32.em (_after_open): Find one .eh_frame section
	for --eh-frame-hdr.
2010-08-22 20:21:21 +00:00
H.J. Lu 39334f3a47 Don't check relocation if input ELF object ID doesn't match output.
bfd/

2010-08-22  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/11933
	* elflink.c (elf_link_add_object_symbols): Don't check relocation
	if input ELF object ID doesn't match output.

ld/testsuite/

2010-08-22  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/11933
	* ld-x86-64/mixed1a.s: New.
	* ld-x86-64/mixed1b.s: Likewise.
	* ld-x86-64/mixed2a.s: Likewise.
	* ld-x86-64/mixed2b.s: Likewise.

	* ld-x86-64/x86-64.exp: Text mixed x86_64 and i386 inputs.
2010-08-22 19:14:25 +00:00
H.J. Lu a654efd60a Find an ELF input for --build-id and --eh-frame-hdr.
2010-08-22  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/11937
	* emultempl/elf32.em (_after_open): Find an ELF input for
	--build-id and --eh-frame-hdr.
2010-08-22 19:11:58 +00:00
Maciej W. Rozycki d820eaae5f * Makefile.am (eshlelf_fd.c): Correct the name of the tool
directory.
	* Makefile.in: Regenerate.
2010-08-20 21:18:39 +00:00
Maciej W. Rozycki d898aefbfa * ld-sh/sh.exp: Add missing newline. 2010-08-20 21:13:03 +00:00
Maciej W. Rozycki 0982e15774 binutils/
* ChangeLog: Add a missing entry for 2010-04-20's commit.

	ld/testsuite/
	* ld-mips-elf/attr-gnu-4-01.d: Correct Tag_GNU_MIPS_ABI_FP.
	* ld-mips-elf/attr-gnu-4-02.d: Likewise.
	* ld-mips-elf/attr-gnu-4-10.d: Likewise.
	* ld-mips-elf/attr-gnu-4-11.d: Likewise.
	* ld-mips-elf/attr-gnu-4-15.d: Likewise.
	* ld-mips-elf/attr-gnu-4-20.d: Likewise.
	* ld-mips-elf/attr-gnu-4-22.d: Likewise.
	* ld-mips-elf/attr-gnu-4-25.d: Likewise.
2010-08-20 21:04:07 +00:00
Nick Clifton c13526cafc * emultempl/elf32.em (_after_open): Check for get_elf_backend_data
returning NULL.
2010-08-20 15:01:45 +00:00
Alan Modra 7542af2ae8 binutils/
* NEWS: Mention change in linker script expression evaluation.
ld/
	* ld.texinfo (Expression Section): Detail expression evaluation.
	(Builtin Functions <ADDR>): Correct.
	(Builtin Functions <LOADADDR>): Don't mention LOADADDR normally
	the same as ADDR.
	(Builtin Functions <SEGMENT_START>): Typo fix.
	* ldexp.c (new_number): New function.
	(make_abs, exp_get_abs_int): Cope with NULL expld.result.section.
	(fold_unary <'~', '!', '-'>): Don't make_abs.
	(fold_binary): Simplify result section logic.  Return NULL section
	for logical ops.
	(fold_binary <SEGMENT_START>): Use new_rel_from_abs to set value to
	a consistent result.
	(fold_name <SIZEOF_HEADERS>): Return new_number, not new_abs.
	(fold_name <DEFINED, SIZEOF, ALIGNOF, LENGTH, CONSTANT>): Likewise.
	(fold_name <NAME>): No need to handle absolute symbols differently
	from relative ones.
	(fold_name <ORIGIN>): Don't return valid result when
	lang_first_phase_enum.  Return new_rel_from_abs, not new_abs.
	(exp_fold_tree_1 <etree_value>): Return new_number, not new_rel.
	(exp_fold_tree_1): Ajust for NULL expld.result.section.  When assigning
	a plain number to dot, assume the value is relative to expld.section.
	Make terms not in an output section, absolute.
	* ldlang.c (print_assignment): Fix style nit.
	(lang_size_sections_1): Cope with NULL expld.result.section.
	(lang_do_assignments_1): Likewise.
ld/testsuite/
	* ld-scripts/memory.t: Remove ORIGIN fudge.
2010-08-19 05:51:50 +00:00
H.J. Lu 56d4289c6c Check if .got.plt section is discarded before using it.
bfd/

2010-08-13  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/11913
	* elf32-i386.c (elf_i386_finish_dynamic_sections): Check if
	 .got.plt section is discarded.
	 * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Likewise.

ld/testsuite/

2010-08-13  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/11913
	* ld-i386/discarded1.d: New.
	* ld-i386/discarded1.s: Likewise.
	* ld-i386/discarded1.t: Likewise.
	* ld-x86-64/discarded1.d: Likewise.
	* ld-x86-64/discarded1.s: Likewise.
	* ld-x86-64/discarded1.t: Likewise.

	* ld-i386/i386.exp: Run discarded1.
	* ld-x86-64/x86-64.exp: Likewise.
2010-08-13 20:50:27 +00:00
Alan Modra 5942515f80 * ldexp.c (new_rel): Remove "str". Update all call sites.
(exp_fold_tree_1): When assigning to dot, calculate nextdot
	using expld.result.section rather than expld.section.
2010-08-12 13:36:50 +00:00
Catherine Moore 776167e8fa 2010-08-09 Catherine Moore <clm@codesourcery.com>
* elfxx-mips.c (mips_elf_perform_relocation): Improve
        interlinking error message.

2010-08-09  Catherine Moore  <clm@codesourcery.com>

        * ld-mips-elf/mode-change-error-1.d: New.
        * ld-mips-elf/mode-change-error-1a.s: New.
        * ld-mips-elf/mode-change-error-1b.s: New.
        * ld-mips-elf/mips-elf.exp: Run new test.
2010-08-09 19:54:13 +00:00
Alan Modra 1e0061d22e PR ld/11887
* ldlang.c (lang_add_vers_depend): Don't leave version_needed
	uninitialised.
2010-08-06 01:51:17 +00:00
Alan Modra b3808325c5 * ld-powerpc/tocopt.s, * ld-powerpc/tocopt.d: New test.
* ld-powerpc/powerpc.exp: Run it.
2010-08-05 14:38:10 +00:00
Alan Modra ae78bbeb22 * ldexp.c (exp_print_tree): Print function-like binary nodes as
functions rather than in-fix operators.  Use fputs and fputc
	where appropriate.
2010-07-28 06:43:32 +00:00
Nick Clifton 1cd986c585 Add support for v850E2 and v850E2V3 2010-07-23 14:52:54 +00:00
Mike Frysinger bb1515f254 ld: improve linker script section
The example version script in the manual currently suggests:
	extern "C++" { "int f(int, double)"; }

But a C++ function like that doesn't encode the return type into the
mangled  name, so when the linker demangles things, it ends up with
"f(int, double)"  and so it never matches.

The example also lacks a trailing semicolon after the brace, so the
linker always complains about a syntax error in the file.

While the language section documents the possibilities, it isn't clear
as to which is the default language.  So explicitly state that the C
language is the default.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-07-20 19:25:42 +00:00
Alan Modra f463846733 include/elf/
* internal.h (ELF_TBSS_SPECIAL): New macro, extracted from..
	(ELF_SECTION_SIZE): ..here.
	(ELF_SECTION_IN_SEGMENT_1): Add "strict" arg.
	(ELF_SECTION_IN_SEGMENT_STRICT): New macro.
bfd/
	* elf.c (assign_file_positions_for_load_sections): Check that
	zero size sections are allocated in segments too.
	(assign_file_positions_for_non_load_sections): Warn if zero
	size alloc sections are found here.
	(copy_elf_program_header): Don't drop zero size sections from
	segment map.
	(copy_private_bfd_data): Check for changes in zero size sections.
binutils/
	* readelf.c (process_program_headers): Don't ignore all zero size
	sections.
ld/testsuite/
	* ld-powerpc/tlsexe.r: Update.
	* ld-powerpc/tlsexetoc.r: Update.
	* ld-powerpc/tlsso.r: Update.
	* ld-powerpc/tlstocso.r: Update.
2010-07-20 14:08:32 +00:00
Alan Modra 8c05cf89c7 * ld-powerpc/vxworks-relax.s: Add branches to match expected output.
* ld-powerpc/vxworks-relax-2.s: Likewise.
	* ld-powerpc/vxworks1-lib.rd: Reorder reloc sections.
2010-07-20 07:22:37 +00:00
Andreas Schwab 3437afb199 binutils/testsuite/:
* binutils-all/readelf.s: Ignore "Key to Flags" contents.
* binutils-all/readelf.s-64: Likewise.
* binutils-all/i386/compressed-1b.d: Likewise.
* binutils-all/i386/compressed-1c.d: Likewise.
* binutils-all/x86-64/compressed-1b.d: Likewise.
* binutils-all/x86-64/compressed-1c.d: Likewise.

gas/testsuite/:
* gas/i386/x86-64-unwind.d: Ignore "Key to Flags" contents.
* gas/ia64/alias-ilp32.d: Likewise.
* gas/ia64/alias.d: Likewise.
* gas/ia64/group-1.d: Likewise.
* gas/ia64/group-2.d: Likewise.
* gas/ia64/secname-ilp32.d: Likewise.
* gas/ia64/secname.d: Likewise.
* gas/ia64/unwind-ilp32.d: Likewise.
* gas/ia64/unwind.d: Likewise.
* gas/mmix/byte-1.d: Likewise.
* gas/mmix/loc-1.d: Likewise.
* gas/mmix/loc-2.d: Likewise.
* gas/mmix/loc-3.d: Likewise.
* gas/mmix/loc-4.d: Likewise.
* gas/mmix/loc-5.d: Likewise.

ld/testsuite/:
* ld-mmix/bspec1.d: Ignore "Key to Flags" contents.
* ld-mmix/bspec2.d: Likewise.
* ld-mmix/local1.d: Likewise.
* ld-mmix/local3.d: Likewise.
* ld-mmix/local5.d: Likewise.
* ld-mmix/local7.d: Likewise.
* ld-mmix/undef-3.d: Likewise.
* ld-sh/sh64/crange1.rd: Likewise.
* ld-sh/sh64/crange2.rd: Likewise.
* ld-sh/sh64/crange3-cmpct.rd: Likewise.
* ld-sh/sh64/crange3-media.rd: Likewise.
* ld-sh/sh64/crange3.rd: Likewise.
* ld-sh/sh64/crangerel1.rd: Likewise.
* ld-sh/sh64/crangerel2.rd: Likewise.
2010-07-19 15:11:03 +00:00
Alan Modra f4427a75c8 * ldlang.c (lang_check_section_addresses): Catch overlap for
sections that wrap around the address space.
2010-07-17 03:12:02 +00:00
H.J. Lu 25d17eb4cc Add testcases for PR ld/11817.
2010-07-14  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/11817
	* ld-i386/compressed1.s: New.
	* ld-i386/compressed1.d: Likewise.
	* ld-x86-64/compressed1.s: Likewise.
	* ld-x86-64/compressed1.d: Likewise.

	* ld-i386/i386.exp: Run compressed1.
	* ld-x86-64/x86-64.exp: Likewise.
2010-07-15 00:42:23 +00:00
H.J. Lu a7b16ceb92 Don't allocate .got.plt section if there are no GOT nor PLT entries.
bfd/

2010-07-13  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/11812
	* elf32-i386.c (elf_i386_size_dynamic_sections): Don't
	 allocate .got.plt section if there are no GOT nor PLT
	 entries.
	 * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Likewise.

ld/testsuite/

2010-07-13  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/11812
	* ld-elf/exclude3b.d: Don't run on ia64-*-*.  Replace .got with
	.dynamic.

	* ld-elf/exclude3d.d: New.
	* ld-i386/nogot1.d: Likewise.
	* ld-i386/nogot1.s: Likewise.
	* ld-x86-64/nogot1.d: Likewise.
	* ld-x86-64/nogot1.s: Likewise.

	* ld-i386/i386.exp: Run nogot1.
	* ld-x86-64/x86-64.exp: Likewise.
2010-07-14 00:30:57 +00:00
H.J. Lu 2f39597837 Don't hard code expected output.
2010-07-13  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-i386/hidden2.d: Don't hard code expected output.
	* ld-i386/protected3.d: Likewise.
	* ld-x86-64/hidden2.d: Likewise.
	* ld-x86-64/protected3.d: Likewise.
2010-07-13 17:42:29 +00:00
H.J. Lu bb1cb422ae Support garbage collection against STT_GNU_IFUNC symbols.
bfd/

2010-07-13  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/11791
	* elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Support
	garbage collection against STT_GNU_IFUNC symbols.

	* elf32-i386.c (elf_i386_get_local_sym_hash): Don't set
	elf.plt.offset/elf.got.offset to -1.
	(elf_i386_tls_transition): Skip TLS transition for functions.
	(elf_i386_gc_sweep_hook): Support STT_GNU_IFUNC symbols.

	* elf64-x86-64.c (elf64_x86_64_get_local_sym_hash): Don't set
	elf.plt.offset/elf.got.offset to -1.
	(elf64_x86_64_tls_transition): Skip TLS transition for functions.
	(elf64_x86_64_gc_sweep_hook): Support STT_GNU_IFUNC symbols.

ld/testsuite/

2010-07-13  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/11791
	* ld-ifunc/ifunc-10-i386.d: New.
	* ld-ifunc/ifunc-10-i386.s: Likewise.
	* ld-ifunc/ifunc-10-x86-64.d: Likewise.
	* ld-ifunc/ifunc-10-x86-64.s: Likewise.
	* ld-ifunc/ifunc-11-i386.d: Likewise.
	* ld-ifunc/ifunc-11-i386.s: Likewise.
	* ld-ifunc/ifunc-11-x86-64.d: Likewise.
	* ld-ifunc/ifunc-11-x86-64.s: Likewise.
2010-07-13 16:59:14 +00:00
Alan Modra 50248c890f bfd/
* elf32-ppc.c (ppc_elf_relax_section): Insert branch around
	trampolines only for .init and .fini sections.
ld/testsuite/
	* ld-powerpc/relax.s: Add branch back to _start.
	* ld-powerpc/relax.d: Update.
	* ld-powerpc/relaxr.d: Update.
2010-07-06 09:29:47 +00:00
Alan Modra cef3d14b43 * lib/ld-lib.exp (default_ld_simple_link): Add $gcc_ld_flag before
any other options in $ld.
2010-07-01 13:15:47 +00:00
Nick Clifton ec51c3818e * scripttempl/xstormy16.sc (.gcc_except_table): Include sections
with the .gcc_except_table. prefix.
2010-06-29 09:43:04 +00:00
Alan Modra 6eb21c2a31 remove maxq-coff port 2010-06-29 04:32:29 +00:00
Alan Modra 360cfc9c8b remove maxq-coff port 2010-06-29 04:17:34 +00:00
Alan Modra c7e2358a88 fix set but unused variable warnings 2010-06-27 04:07:55 +00:00
Alan Modra ba761f19f5 include/elf/
* ppc64.h (R_PPC64_LO_DS_OPT): Define.
bfd/
	* elf64-ppc.c (toc_skip_enum): Define.
	(ppc64_elf_edit_toc): Use two low bits of skip array as markers.
	Optimize largetoc sequences.
	(adjust_toc_syms): Update for skip array change.
	(ppc64_elf_relocate_section): Handle R_PPC64_LO_DS_OPT.
ld/
	* emultempl/ppc64elf.em (prelim_size_sections): New function.
	(ppc_before_allocation): Use it.  Size sections before toc edit too.
2010-06-25 05:20:57 +00:00
Alan Modra bded3693ae * emultempl/elf32.em (find_exp_assignment): Handle etree_provided. 2010-06-25 04:46:05 +00:00