Commit Graph

3064 Commits

Author SHA1 Message Date
H.J. Lu 4c5448074d bfd/
2009-06-19  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_tls_transition): Add a parameter,
	r_symndx.  Report local symbol name on error.
	(elf_i386_check_relocs): Updated.  Report local symbol name on
	error.
	(elf_i386_gc_sweep_hook): Updated.
	(elf_i386_relocate_section): Likewise.

	* elf64-x86-64.c (elf64_x86_64_tls_transition): Add a parameter,
	r_symndx.  Report local symbol name on error.
	(elf64_x86_64_check_relocs): Updated.  Report local symbol name
	on error.
	(elf64_x86_64_gc_sweep_hook): Updated.
	(elf64_x86_64_relocate_section): Likewise.

ld/testsuite/

2009-06-19  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-i386/i386.exp: Run tlsgd2.

	* ld-i386/tlsgd2.d: New.
	* ld-i386/tlsgd2.s: Likewise.

	* ld-x86-64/tlsgd3.d: Updated.
2009-06-19 16:00:33 +00:00
Nick Clifton 32425da952 Fix formatting of recent entry 2009-06-18 10:41:42 +00:00
Dave Korn 470c710ef0 * ld-pe/pe-run.exp (proc test_direct_link_dll): Always pass
--enable-auto-import to the linker.
	* ld-pe/vers-script-1.d:  Replace '\$' by '_' in all symbol names.
	* ld-pe/vers-script-3.d:  Likewise.
	* ld-pe/vers-script-4.d:  Likewise.
	* ld-pe/vers-script-dll.c:  Likewise.
	* lib/ld-lib.exp (proc is_pecoff_format):  Also return true for
	"*-*-cegcc*" targets.
2009-06-18 02:47:51 +00:00
Dave Korn 361dff7384 2009-06-18 Dave Korn <dave.korn.cygwin@gmail.com>
Merge cegcc and mingw32ce target name changes from CeGCC project,
replacing "arm-*-" by "arm*-*-" where needed.

  2008-09-24  Pedro Alves  <pedroalves@users.sourceforge.net>

	ld/
	* configure.tgt (arm*-*-cegcc*): Set LIB_PATH to
	${tooldir}/lib/w32api.

  2007-12-25  Pedro Alves  <pedro_alves@portugalmail.pt>

	bfd/
	* config.bfd: Add arm*-*-cegcc* target.

  2007-12-25  Pedro Alves  <pedro_alves@portugalmail.pt>

	binutils/
	* configure.in: Add arm*-*-cegcc* and arm*-*-mingw32ce* targets.
	* configure: Regenerate.

  2007-12-25  Pedro Alves  <pedro_alves@portugalmail.pt>

	gas/
	* configure.tgt: Add arm*-*-cegcc* target.

  2007-12-25  Pedro Alves  <pedro_alves@portugalmail.pt>

	ld/
	* configure.tgt: Add arm*-*-cegcc* target.

  2007-12-17  Pedro Alves  <pedro_alves@portugalmail.pt>

	bfd/
	* config.bfd: Add arm-*-mingw32ce* target.

  2007-12-17  Pedro Alves  <pedro_alves@portugalmail.pt>

	gas/
	* configure.tgt: Add arm-*-mingw32ce* target.

  2007-12-17  Pedro Alves  <pedro_alves@portugalmail.pt>

	ld/
	* configure.tgt: Add arm-*-mingw32ce* target.
2009-06-18 02:11:03 +00:00
H.J. Lu 1628149bdd 2009-06-15 H.J. Lu <hongjiu.lu@intel.com>
* ld-ifunc/ifunc-9-x86.d: Fix a typo.
2009-06-15 13:28:56 +00:00
H.J. Lu 44c4ea11d3 bfd/
2009-06-14  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/10270
	* elf32-i386.c (elf_i386_allocate_dynrelocs): Disallow
	dynamic IFUNC pointer in non-shared object.  Use .got.plt
	for IFUNC definition in PIE.
	(elf_i386_allocate_dynrelocs): Resolve IFUNC definition in
	PIE locally.

	* elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Disallow
	dynamic IFUNC pointer in non-shared object.  Use .got.plt
	for IFUNC definition in PIE.
	(elf64_x86_64_relocate_section): Resolve IFUNC definition in
	PIE locally.

ld/testsuite/

2009-06-14  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/10270
	* ld-ifunc/ifunc-9-x86.d: New.
	* ld-ifunc/ifunc-9-x86.s: Likewise.
2009-06-14 22:13:30 +00:00
H.J. Lu c25bc9fc0d bfd/
2009-06-13  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/10269
	* elf32-i386.c: Include "objalloc.h" and "hashtab.h".
	(elf_i386_link_hash_table): Add loc_hash_table and
	loc_hash_memory.
	(elf_i386_local_hash): New.
	(elf_i386_local_htab_hash): Likewise.
	(elf_i386_local_htab_eq): Likewise.
	(elf_i386_get_local_sym_hash): Likewise.
	(elf_i386_link_hash_table_free): Likewise.
	(elf_i386_allocate_local_dynrelocs): Likewise.
	(elf_i386_finish_local_dynamic_symbol): Likewise.
	(bfd_elf64_bfd_link_hash_table_free): Likewise.
	(elf_i386_link_hash_table_create): Create loc_hash_table and
	loc_hash_memory.
	(elf_i386_check_relocs): Handle local STT_GNU_IFUNC symbols.
	(elf_i386_size_dynamic_sections): Likewise.
	(elf_i386_relocate_section): Likewise.
	(elf_i386_finish_dynamic_sections): Likewise.
	(elf_i386_finish_dynamic_symbol): Check _DYNAMIC only if sym
	isn't NULL.

	* elf64-x86-64.c: Include "objalloc.h" and "hashtab.h".
	(elf64_x86_64_link_hash_table): Add loc_hash_table and
	loc_hash_memory.
	(elf64_x86_64_local_hash): New.
	(elf64_x86_64_local_htab_hash): Likewise.
	(elf64_x86_64_local_htab_eq): Likewise.
	(elf64_x86_64_get_local_sym_hash): Likewise.
	(elf64_x86_64_link_hash_table_free): Likewise.
	(elf64_x86_64_allocate_local_dynrelocs): Likewise.
	(elf64_x86_64_finish_local_dynamic_symbol): Likewise.
	(bfd_elf64_bfd_link_hash_table_free): Likewise.
	(elf64_x86_64_link_hash_table_create): Create loc_hash_table
	and loc_hash_memory.
	(elf64_x86_64_check_relocs): Handle local STT_GNU_IFUNC
	symbols.
	(elf64_x86_64_size_dynamic_sections): Likewise.
	(elf64_x86_64_relocate_section): Likewise.
	(elf64_x86_64_finish_dynamic_sections): Likewise.
	(elf64_x86_64_finish_dynamic_symbol): Check _DYNAMIC only if
	sym isn't NULL.

gas/

2009-06-13  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/10269
	* config/tc-i386.c (md_apply_fix): Use TC_FORCE_RELOCATION
	instead of generic_force_reloc.

	* config/tc-i386.h (TC_FORCE_RELOCATION): New.

ld/testsuite/

2009-06-13  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/10269
	*: ld-ifunc/ifunc-1-local-x86.d: New.
	*: ld-ifunc/ifunc-1-local-x86.s: Likewise.
	*: ld-ifunc/ifunc-2-local-i386.d: Likewise.
	*: ld-ifunc/ifunc-2-local-i386.s: Likewise.
	*: ld-ifunc/ifunc-2-local-x86-64.d: Likewise.
	*: ld-ifunc/ifunc-2-local-x86-64.s: Likewise.
	*: ld-ifunc/ifunc-4-local-x86.d: Likewise.
	*: ld-ifunc/ifunc-4-local-x86.s: Likewise.
	*: ld-ifunc/ifunc-5-local-i386.s: Likewise.
	*: ld-ifunc/ifunc-5-local-x86-64.s: Likewise.
	*: ld-ifunc/ifunc-5a-local-i386.d: Likewise.
	*: ld-ifunc/ifunc-5a-local-x86-64.d: Likewise.
	*: ld-ifunc/ifunc-5b-local-i386.d: Likewise.
	*: ld-ifunc/ifunc-5b-local-x86-64.d: Likewise.
2009-06-14 01:39:46 +00:00
Phil Blundell f37111339e 2009-06-10 Philip Blundell <philb@gnu.org>
* emultempl/armelf.em (gld${EMULATION_NAME}_finish): Avoid crash
	if section has no ELF data.
2009-06-12 14:27:21 +00:00
H.J. Lu 2a81c24ab1 bfd/
2009-06-06  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_link_hash_table): Add irelifunc.
	(elf_i386_link_hash_table_create): Initialize irelifunc.
	(elf_i386_check_relocs): Updated.  Set up irelifunc for
	shared objects.
	(elf_i386_allocate_dynrelocs): Use irelifunc for dynamic
	relocation for non-GOT reference of STT_GNU_IFUNC symbol in
	shared objects.
	(elf_i386_relocate_section): Likewise.

	* elf64-x86-64.c (elf64_x86_64_link_hash_table): Add irelifunc.
	(elf64_x86_64_link_hash_table_create): Initialize irelifunc.
	(elf64_x86_64_check_relocs): Updated.  Set up irelifunc for
	shared objects.
	(elf64_x86_64_allocate_dynrelocs): Use irelifunc for dynamic
	relocation for non-GOT reference of STT_GNU_IFUNC symbol in
	shared objects.
	(elf64_x86_64_relocate_section): Likewise.

	* elf-bfd.h (_bfd_elf_create_static_ifunc_sections): Renamed to
	...
	(_bfd_elf_create_ifunc_sections): This.

	* elflink.c (_bfd_elf_create_static_ifunc_sections): Renamd to
	...
	(_bfd_elf_create_ifunc_sections): This.  Create .rel[a].ifunc
	for shared objects.

ld/

2009-06-06  H.J. Lu  <hongjiu.lu@intel.com>

	* scripttempl/elf.sc: Add .rel.ifunc and .rela.ifunc.
2009-06-06 22:39:25 +00:00
H.J. Lu fc1e878931 2009-06-05 H.J. Lu <hongjiu.lu@intel.com>
* scripttempl/elf.sc: Remove .rel.ifunc.dyn and .rela.ifunc.dyn.
2009-06-05 16:49:16 +00:00
Alan Modra 67a648f17a * dep-in.sed: Don't use \n in replacement part of s command.
* Makefile.am (DEP1): LC_ALL for uniq.
	* Makefile.in: Regenerate.
2009-06-04 06:57:56 +00:00
H.J. Lu a951221dcc 2009-06-03 H.J. Lu <hongjiu.lu@intel.com>
* ld-ifunc/ifunc-2-x86-64.d: Pass --64 to as and -melf_x86_64 to
	ld.
	* ld-ifunc/ifunc-5a-x86-64.d: Likewise.
	* ld-ifunc/ifunc-5b-x86-64.d: Likewise.
	* ld-ifunc/ifunc-6a-x86-64.d: Likewise.
	* ld-ifunc/ifunc-6b-x86-64.d: Likewise.
	* ld-ifunc/ifunc-7a-x86-64.d: Likewise.
	* ld-ifunc/ifunc-7b-x86-64.d: Likewise.

	* ld-ifunc/ifunc-8a-i386.s: New.
	* ld-ifunc/ifunc-8a-x86-64.s: Likewise.
	* ld-ifunc/ifunc-8b-i386.s: Likewise.
	* ld-ifunc/ifunc-8b-x86-64.s: Likewise.
	* ld-ifunc/ifunc-8-i386.d: Likewise.
	* ld-ifunc/ifunc-8-x86-64.d: Likewise.
2009-06-03 17:32:02 +00:00
Richard Sandiford 94313f361f bfd/
* coff-rs6000.c (xcoff_ppc_relocate_section): Allow undefined
	symbols to be left unimported when linking statically.
	* xcofflink.c (xcoff_link_add_symbols): Ignore global linkage
	code when linking statically.

ld/testsuite/
	* ld-powerpc/aix-glink-3.s, ld-powerpc/aix-glink-3a.s,
	ld-powerpc/aix-glink-3b.s, ld-powerpc/aix-glink-3.dd,
	ld-powerpc/aix-glink-3-32.d, ld-powerpc/aix-glink-3-64.d: New tests.
	* ld-powerpc/aix52.exp: Run them.  Move the lineno tests to maintain
	alphabetical order.
2009-06-02 18:51:34 +00:00
H.J. Lu 7afd84dc1f bfd/
2009-06-02  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_check_relocs): Increment
	got.refcount for R_386_GOT32/R_386_GOTOFF relocations
	against STT_GNU_IFUNC symbol.
	(elf_i386_allocate_dynrelocs): Set got.refcount to 0 if
	local STT_GNU_IFUNC definition is used.
	(elf_i386_relocate_section): Handle got.offset != -1 for
	R_386_GOT32/R_386_GOTOFF relocations against STT_GNU_IFUNC
	symbol.

	* elf64-x86-64.c (elf64_x86_64_check_relocs): Increment
	got.refcount for R_X86_64_GOTPCREL/R_X86_64_GOTPCREL64
	relocations against STT_GNU_IFUNC symbol.
	(elf64_x86_64_allocate_dynrelocs): Set got.refcount to 0 if
	local STT_GNU_IFUNC definition is used.
	(elf64_x86_64_relocate_section): Handle got.offset != -1
	for R_X86_64_GOTPCREL/R_X86_64_GOTPCREL64 relocations against
	STT_GNU_IFUNC symbol.

ld/testsuite/

2009-06-02  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-ifunc/ifunc-5-i386.d: Renamed to ...
	* ld-ifunc/ifunc-5a-i386.d: This.

	* ld-ifunc/ifunc-5-x86-64.d: Renamed to ...
	* ld-ifunc/ifunc-5a-x86-64.d: This.

	* ld-ifunc/ifunc-5b-i386.d: New.
	* ld-ifunc/ifunc-5b-x86-64.d: Likewise.
	* ld-ifunc/ifunc-6a-i386.d: Likewise.
	* ld-ifunc/ifunc-6a-x86-64.d: Likewise.
	* ld-ifunc/ifunc-6b-i386.d: Likewise.
	* ld-ifunc/ifunc-6b-x86-64.d: Likewise.
	* ld-ifunc/ifunc-6-i386.s: Likewise.
	* ld-ifunc/ifunc-6-x86-64.s: Likewise.
	* ld-ifunc/ifunc-7a-i386.d: Likewise.
	* ld-ifunc/ifunc-7a-x86-64.d: Likewise.
	* ld-ifunc/ifunc-7b-i386.d: Likewise.
	* ld-ifunc/ifunc-7b-x86-64.d: Likewise.
	* ld-ifunc/ifunc-7-i386.s: Likewise.
	* ld-ifunc/ifunc-7-x86-64.s: Likewise.
2009-06-02 17:31:42 +00:00
H.J. Lu cbe950e9fe bfd/
2009-06-01  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/10205
	* elf32-i386.c (elf_howto_table): Add R_386_IRELATIVE.
	(elf_i386_reloc_type_lookup): Likewise.
	(R_386_tls): Removed.
	(R_386_irelative): New.
	(R_386_vt_offset): Updated.
	(elf_i386_rtype_to_howto): Likewise.
	(elf_i386_link_hash_table): Add igotplt, iplt and irelplt.
	(elf_i386_link_hash_table_create): Initialize igotplt,
	iplt and irelplt.
	(elf_i386_check_relocs): Handle STT_GNU_IFUNC symbol first.
	(elf_i386_adjust_dynamic_symbol): Likewise.
	(elf_i386_allocate_dynrelocs): Likewise.
	(elf_i386_relocate_section): Likewise.
	(elf_i386_size_dynamic_sections): Set up .iplt and .igot.plt
	sections.
	(elf_i386_finish_dynamic_symbol): When building a static
	executable, use .iplt, .igot.plt and .rel.iplt sections for
	STT_GNU_IFUNC symbols.  Generate R_386_IRELATIVE relocation for
	locally defined STT_GNU_IFUNC symbol.

	* elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_IRELATIVE.
	(x86_64_reloc_map): Likewise.
	(R_X86_64_standard): Updated.
	(elf64_x86_64_link_hash_table): Add igotplt, iplt and irelplt.
	(elf64_x86_64_link_hash_table_create): Initialize igotplt,
	iplt and irelplt.
	(elf64_x86_64_check_relocs): Handle STT_GNU_IFUNC symbol first.
	(elf64_x86_64_adjust_dynamic_symbol): Likewise.
	(elf64_x86_64_allocate_dynrelocs): Likewise.
	(elf64_x86_64_relocate_section): Likewise.
	(elf64_x86_64_size_dynamic_sections): Set up .iplt and .igot.plt
	sections.
	(elf64_x86_64_finish_dynamic_symbol): When building a static
	executable, use .iplt, .igot.plt and .rela.iplt sections for
	STT_GNU_IFUNC symbols.  Generate R_X86_64_IRELATIVE relocation
	for locally defined STT_GNU_IFUNC symbol.

	* reloc.c (BFD_RELOC_386_IRELATIVE): New.
	(BFD_RELOC_X86_64_IRELATIVE): Likewise.

	* bfd-in2.h: Regenerated.
	* libbfd.h: Likewise.

include/elf/

2009-06-01  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/10205
	* i386.h (R_386_IRELATIVE): New.
	* x86-64.h (R_X86_64_IRELATIVE): Likewise.

ld/testsuite/

2009-06-01  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/10205
	* ld-ifunc/ifunc.exp (contains_irelative_reloc): New.
	Use it on executable and shared library.
	Run *.d.

	* ld-ifunc/lib.c: Add a hidden alias, __GI_library_func2, for
	library_func2.
	(library_func): New.

	* ld-ifunc/ifunc-1-x86.d: New.
	* ld-ifunc/ifunc-1-x86.s: Likewise.
	* ld-ifunc/ifunc-2-i386.d: Likewise.
	* ld-ifunc/ifunc-2-i386.s: Likewise.
	* ld-ifunc/ifunc-2-x86-64.d: Likewise.
	* ld-ifunc/ifunc-2-x86-64.s: Likewise.
	* ld-ifunc/ifunc-3a-x86.d: Likewise.
	* ld-ifunc/ifunc-3b-x86.d: Likewise.
	* ld-ifunc/ifunc-3-x86.s: Likewise.
	* ld-ifunc/ifunc-4-x86.d: Likewise.
	* ld-ifunc/ifunc-4-x86.s: Likewise.
	* ld-ifunc/ifunc-5-i386.d: Likewise.
	* ld-ifunc/ifunc-5-i386.s: Likewise.
	* ld-ifunc/ifunc-5-x86-64.d: Likewise.
	* ld-ifunc/ifunc-5-x86-64.s: Likewise.
2009-06-01 13:11:52 +00:00
H.J. Lu 3aa14d16c6 bfd/
2009-06-01  H.J. Lu  <hongjiu.lu@intel.com>

	* elf-bfd.h (struct bfd_elf_section_data): Remove indirect_relocs.
	(_bfd_elf_make_ifunc_reloc_section): Removed.
	(_bfd_elf_is_ifunc_symbol): Likewise.
	(_bfd_elf_create_static_ifunc_sections): New.

	* elflink.c (_bfd_elf_adjust_dynamic_symbol): Move STT_GNU_IFUNC
	symbol check to ...
	(elf_link_add_object_symbols): Here.
	(_bfd_elf_link_hash_hide_symbol): Don't clean plt on
	STT_GNU_IFUNC symbol.
	(elf_link_output_extsym): Call elf_backend_finish_dynamic_symbol
	if a STT_GNU_IFUNC symbol is referenced in a non-shared object.
	(IFUNC_INFIX): Removed.
	(get_ifunc_reloc_section_name): Likewise.
	(_bfd_elf_make_ifunc_reloc_section): Likewise.
	(_bfd_elf_is_ifunc_symbol): Likewise.
	(_bfd_elf_create_static_ifunc_sections): New.

ld/

2009-06-01  H.J. Lu  <hongjiu.lu@intel.com>

	* scripttempl/elf.sc (PLT): Add "*(.iplt)".
	(GOT): Add "*(.igot.plt)a" and "*(.igot)".
	(GOTPLT): Add "*(.igot)".
	(__rel_iplt_start): New.
	(__rel_iplt_end): Likewise.
	(__rela_iplt_start): Likewise.
	(__rela_iplt_end): Likewise.
2009-06-01 12:53:00 +00:00
Dave Korn 05056a8d5b ld/ChangeLog
* deffilep.y (%union):  Add new string-type semantic value 'digits'.
	(%token):  Remove NUMBER as token, add DIGITS.
	(%type):  Add NUMBER as type.  Add new id types anylang_id, opt_id.
	(ALIGNCOMM):  Parse an anylang_id instead of a plain ID.
	(anylang_id):  New production.
	(opt_digits):  Likewise.
	(opt_id):  Likewise.
	(NUMBER):  Likewise.
	(def_lex):  Return strings of digits in raw string form as DIGITS
	token, instead of converting to numeric integer type.

ld/testsuite/ChangeLog

	* ld-pe/non-c-lang-syms.c:  New dump test source file.
	* ld-pe/non-c-lang-syms.d:  New dump test pattern file.
	* ld-pe/pe.exp:  Run new "foreign symbol" test.
2009-05-27 18:40:56 +00:00
Nathan Sidwell c8a1f2548b bfd/
* elf32-ppc.c (ppc_elf_relax_section): Work with a partial
	link.
	* bout.c (b_out_bfd_relax_section): Reject relocatable links.
	* elf32-m10300.c (mn10300_elf_relax_section): Likewise.
	* elf32-avr.c (elf32_avr_relax_section): Likewise.
	* elf32-frv.c (elf32_avr_relax_section): Likewise.
	* elf32-xtensa.c (elf_xtensa_relax_section): Likewise.
	* elf64-mmix.c (mmix_elf_relax_section): Likewise.
	* elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_relax_section): Likewise.
	* reloc.c (bfd_generic_relax_section): Likewise.
	* reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
	* vms.c (vms_bfd_relax_section): Likewise.

	ld/
	* ldmain.c (main): Don't reject --relax -r.
	* ld.texinfo (PowerPC ELF32): Document behaviour of relaxing
	partial links.

	ld/testsuite/
	* ld-powerpc/vxworks-relax-2.s: New.
	* ld-powerpc/vxworks-relax-2.rd: New.
	* ld-powerpc/powerpc.exp: Add it.
2009-05-27 13:31:24 +00:00
Nick Clifton f12e7348b2 Update Indonesian translations.
Update translation templates.
2009-05-26 16:49:41 +00:00
Alan Modra 00f3247a62 * dep-in.sed: Output one filename per line with all lines having
continuation backslash.  Prefix first line with "A", following
	lines with "B".
	* Makefile.am (DEP): Don't use dep.sed here.
	(DEP1): Run $MKDEP on single files, use dep.sed here on dependencies,
	sort and uniq.
	* Makefile.in: Regenerate.
2009-05-26 03:20:10 +00:00
Alan Modra e50d6125d6 * ldlang.c (lang_check_section_addresses): Ignore non-alloc sections. 2009-05-26 01:20:39 +00:00
Hans-Peter Nilsson cb150213b2 * ld-scripts/rgn-over7.d: Adjust expected message for recent change. 2009-05-22 15:54:36 +00:00
Julian Brown 48229727d8 ld/
* emultempl/armelf.em (fix_cortex_a8): New.
    (arm_elf_before_allocation): Call bfd_elf32_arm_set_cortex_a8_fix.
    (arm_elf_create_output_section_statements): Add fix_cortex_a8 to
    bfd_elf32_arm_set_target_relocs.
    (OPTION_FIX_CORTEX_A8, OPTION_NO_FIX_CORTEX_A8): New.
    (PARSE_AND_LIST_LONGOPTS): Add [no-]fix-cortex-a8 options.
    (PARSE_AND_LIST_OPTIONS): Add [no-]fix-cortex-a8 options.
    (PARSE_AND_LIST_ARGS_CASES): Handle OPTION_[NO_]FIX_CORTEX_A8.
    * ld.texinfo (--[no-]fix-cortex-a8): Briefly document new options.

    bfd/
    * elf32-arm.c (THUMB16_BCOND_INSN, THUMB32_INSN, THUMB32_B_INSN):
    New macros.
    (elf32_arm_stub_a8_veneer_b_cond, elf32_arm_stub_a8_veneer_b)
    (elf32_arm_stub_a8_veneer_blx): New stub sequences.
    (elf32_arm_stub_type): Add arm_stub_a8_veneer_b_cond,
    arm_stub_a8_veneer_b and arm_stub_a8_veneer_blx.
    (elf32_arm_stub_hash_entry): Add target_addend, orig_insn fields.
    (a8_erratum_fix, a8_erratum_reloc): New structs.
    (elf32_arm_link_hash_table): Add a8_erratum_fixes,
    num_a8_erratum_fixes, fix_cortex_a8 fields.
    (elf32_arm_link_hash_table_create): Zero fix_cortex_a8.
    (elf32_arm_add_stub): Split into two parts, creating...
    (elf32_arm_create_or_find_stub_sec): New function.
    (elf32_arm_final_link_relocate): Add forward declaration.
    (arm_build_one_stub): Add support for THUMB32_TYPE, Thumb-2
    relocations, multiple relocations per stub.
    (find_stub_size_and_template): New (using parts of
    arm_size_one_stub).
    (arm_size_one_stub): Use find_stub_size_and_template.
    (a8_reloc_compare): New.
    (find_thumb_glue): Add forward declaration.
    (cortex_a8_erratum_scan): New.
    (elf32_arm_size_stubs): Add Cortex-A8 erratum workaround support.
    (bfd_elf32_arm_set_cortex_a8_fix): New.
    (bfd_elf32_arm_set_target_relocs): Add fix_cortex_a8 argument.
    (arm_map_one_stub): Add THUMB32_TYPE support.
    (a8_branch_to_stub_data): New.
    (make_branch_to_a8_stub): New.
    (elf32_arm_write_section): Add Cortex-A8 erratum workaround support.
    * bfd-in.h (bfd_elf32_arm_set_cortex_a8_fix): New.
    (bfd_elf32_arm_set_target_relocs): Add argument for controlling
    Cortex-A8 erratum workaround.
    * bfd-in2.h: Regenerate.

    ld/testsuite/
    * ld-arm/cortex-a8-arm-target.s: New.
    * ld-arm/cortex-a8-thumb-target.s: New.
    * ld-arm/cortex-a8-fix-b-rel.s: New.
    * ld-arm/cortex-a8-fix-b-rel-arm.d: New.
    * ld-arm/cortex-a8-fix-b-rel-thumb.d: New.
    * ld-arm/cortex-a8-fix-b.s: New.
    * ld-arm/cortex-a8-fix-b.d: New.
    * ld-arm/cortex-a8-fix-bl-rel.s: New.
    * ld-arm/cortex-a8-fix-bl-rel-arm.d: New.
    * ld-arm/cortex-a8-fix-bl-rel-thumb.d: New.
    * ld-arm/cortex-a8-fix-bl.s: New.
    * ld-arm/cortex-a8-fix-bl.d: New.
    * ld-arm/cortex-a8-fix-bcc-rel.s: New.
    * ld-arm/cortex-a8-fix-bcc-rel-thumb.d: New.
    * ld-arm/cortex-a8-fix-bcc.s: New.
    * ld-arm/cortex-a8-fix-bcc.d: New.
    * ld-arm/cortex-a8-fix-blx-rel.s: New.
    * ld-arm/cortex-a8-fix-blx-rel-arm.d: New.
    * ld-arm/cortex-a8-fix-blx-rel-thumb.d: New.
    * ld-arm/cortex-a8-fix-blx.s: New.
    * ld-arm/cortex-a8-fix-blx.d: New.
    * ld-arm/arm-elf.exp: Add new tests.
2009-05-22 11:58:45 +00:00
Nathan Sidwell ec6d26bed6 * ldlang.c (lang_check_section_addresses): Ignore non-loadable
sections when checking for overlap.  Clarify error message
	concerns load address.

	testsuite/
	* ld-scripts/rgn-at4.t: New.
	* ld-scripts/rgn-at4.d: New.
2009-05-22 11:27:44 +00:00
Alan Modra 2b3decb5e1 Run "make dep-am" and regenerate 2009-05-22 09:33:16 +00:00
Dave Korn c344f84568 * ld-pe/aligncomm-1.c (_alloca): Add dummy definition to
satisfy final link on Windows targets when using gcc-3.
	* ld-pe/aligncomm-2.c (_alloca):  Likewise.
	* ld-pe/aligncomm-3.c (_alloca):  Likewise.
	* ld-pe/aligncomm-4.c (_alloca):  Likewise.
2009-05-21 16:28:45 +00:00
Alan Modra 32e9651ca5 Missed from my 2009-04-16 commit 2009-05-21 06:13:28 +00:00
H.J. Lu b982bd0589 Correct ChangeLog entry. 2009-05-20 16:02:54 +00:00
Dave Korn eca41774ed * lib/ld-lib.exp (run_ld_link_tests): Filter test names against
runtests list.
2009-05-20 13:40:38 +00:00
Dave Korn c1711530e6 ==> bfd/ChangeLog <==
2009-05-19  Dave Korn  <dave.korn.cygwin@gmail.com>

	* cofflink.c (process_embedded_commands):  Ignore "-aligncomm".

==> gas/ChangeLog <==
2009-05-19  Dave Korn  <dave.korn.cygwin@gmail.com>

	* NEWS:  Mention new feature.
	* config/obj-coff.c (obj_coff_common_parse):  New function.
	(obj_coff_comm):  Likewise.
	(coff_pseudo_table):  Override default ".comm" definition on PE.
	* doc/as.texinfo:  Document new feature.

==> gas/testsuite/ChangeLog <==
2009-05-19  Dave Korn  <dave.korn.cygwin@gmail.com>

	* gas/pe/:  New directory for PE format-specific tests.
	* gas/pe/aligncomm-a.d:  New test pattern file.
	* gas/pe/aligncomm-a.s:  New test source file.
	* gas/pe/aligncomm-b.d:  New test pattern file.
	* gas/pe/aligncomm-b.s:  New test source file.
	* gas/pe/aligncomm-c.d:  New test pattern file.
	* gas/pe/aligncomm-c.s:  New test source file.
	* gas/pe/aligncomm-d.d:  New test pattern file.
	* gas/pe/aligncomm-d.s:  New test source file.
	* gas/pe/pe.exp:  New test control script.
	* lib/gas-defs.exp (is_pecoff_format):  New function.

==> ld/ChangeLog <==
2009-05-19  Dave Korn  <dave.korn.cygwin@gmail.com>

	* NEWS:  Mention new feature.
	* deffile.h (def_file_aligncomm):  Add new struct definition.
	(def_file):  Add new def_file_aligncomm member.
	* deffilep.y (%token):  Add new ALIGNCOMM token.
	(command):  Add production rule for ALIGNCOMM.
	(def_file_free):  Free any chained def_file_aligncomm structs.
	(diropts[]):  Add entry for '-aligncomm' .drectve command.
	(def_aligncomm):  New grammar function.
	* ld.texinfo:  Document new feature.
	* pe-dll.c (process_def_file):  Rename from this ...
	(process_def_file_and_drectve):  ... to this, updating all callers,
	and process any aligncomms chained to the def file after scanning
	all .drectve sections.
	(generate_edata):  Updated to match.
	(pe_dll_build_sections):  Likewise.

==> ld/testsuite/ChangeLog <==
2009-05-19  Dave Korn  <dave.korn.cygwin@gmail.com>

	* ld-pe/aligncomm-1.c:  New test source file.
	* ld-pe/aligncomm-2.c:  Likewise.
	* ld-pe/aligncomm-3.c:  Likewise.
	* ld-pe/aligncomm-4.c:  Likewise.
	* ld-pe/aligncomm.d:  New test pattern file.

	* ld-pe/direct.exp:  Deleted, and content moved into ...
	* ld-pe/pe-run.exp:  ... New common file for all PE run tests.

	* ld-pe/vers-script.exp:  Deleted, and content merged into ...
	* ld-pe/pe-compile.exp:  ... New common file for PE tests needing
	a compiler, adding aligned common tests.

	* ld-pe/pe.exp:  Update header comment.
2009-05-19 16:08:08 +00:00
H.J. Lu 989f09292e Correct the last ChangeLog entry. 2009-05-18 18:01:02 +00:00
Dave Korn 177b81d66a Committed on behalf of
2008-08-07  Aaron W. LaFramboise  <aaron98wiridge9@aaronwl.com>

ld/ChangeLog:

	* pe-dll.c (process_def_file): Do not create empty export table.

ld/testsuite/ChangeLog:

	* ld-pe/exports.d: New file.
	* ld-pe/exports.s: New file.
	* ld-pe/pe.exp: New test for empty export table.
2009-05-17 05:10:21 +00:00
Alan Modra 9253d285c4 typo fix 2009-05-16 03:22:28 +00:00
Alan Modra c91db5c06f * ld-elf/orphan3.d, * ld-elf/orphan3a.s, * ld-elf/orphan3b.s,
* ld-elf/orphan3c.s, * ld-elf/orphan3d.s, * ld-elf/orphan3e.s,
	* ld-elf/orphan3f.s: Increase section size to 16.
	* ld-pe/orphan.d, * ld-pe/orphana.s, * ld-pe/orphanb.s,
	* ld-pe/orphand.s, * ld-pe/orphane.s: Likewise.
2009-05-16 01:56:44 +00:00
Alan Modra d127ecce68 ld/
* ldlang.c (lang_output_section_statement_lookup): Add function
	comment.  Make "name" non-const.  Ensure duplicate entries use
	the same string, allowing simple comparison in hash bucket loop.
	Tweak constraint check.
	(next_matching_output_section_statement): New function.
	* ldlang.h (lang_output_section_statement_lookup): Update.
	(next_matching_output_section_statement): Declare.
	* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
	combine orphan sections when input sections flags differ in
	alloc or load.
	* emultempl/pe.em: Formatting throughout.
	(gld${EMULATION_NAME}_place_orphan): As for elf32.em.
	* emultempl/pep.em: Formatting throughout.
	(gld${EMULATION_NAME}_place_orphan): As for elf32.em.
ld/testsuite/
	* ld-elf/orphan3.d, * ld-elf/orphan3a.s, * ld-elf/orphan3b.s,
	* ld-elf/orphan3c.s, * ld-elf/orphan3d.s, * ld-elf/orphan3e.s,
	* ld-elf/orphan3f.s: New test.
	* ld-pe/orphan.d, * ld-pe/orphana.s, * ld-pe/orphanb.s,
	* ld-pe/orphand.s, * ld-pe/orphane.s: New test.
	* ld-pe/direct.exp: Use is_pecoff_format.
	* ld-pe/longsecn.exp: Delete.
	* ld-pe/pe.exp: Run new test and longsecn tests.
2009-05-15 14:22:36 +00:00
Paul Brook 22a8f80ef5 2009-05-15 Andrew Stubbs <ams@codesourcery.com>
Paul Brook  <paul@codesourcery.com>

	bfd/
	* elf32-arm.c (elf32_arm_fix_exidx_coverage): Don't attempt to
	fix discarded sections.

	ld/testsuite/
	* ld-arm/arm-elf.exp: Add unwind-5.
	* ld-arm/discard-unwind.ld: New file.
	* ld-arm/unwind-5.d: New test.
	* ld-arm/unwind-5.s: New test.
2009-05-15 00:08:12 +00:00
Ulrich Weigand cdc83fba73 bfd/
* elf32-spu.c (build_stub): Always build "compact" sofware
	i-cache stubs.

ld/
	* emultempl/spuelf.em (PARSE_AND_LIST_ARGS_CASES): Always use
	compact stubs with software i-cache.

ld/testsuite/
	* ld-spu/icache1.d: Update for compact stubs.
2009-05-14 16:56:09 +00:00
Ulrich Weigand 97fc8d845e bfd/
* elf32-spu.c (struct spu_link_hash_table): Add fromelem_size_log2.
	(spu_elf_setup): Initialize it.
	(spu_elf_size_stubs): Move .ovtab into .bss for software i-cache.
	Update to new-sytle cache manager data structures.
	(spu_elf_build_stubs): Generate new-style cache manager data
	structures and symbols.
	(spu_elf_auto_overlay): Update size computation.

ld/testsuite/
	* ld-spu/icache1.d: Update all addresses to accomodate icache
	buffer shifted down 0x800 bytes.
2009-05-14 16:04:02 +00:00
Ulrich Weigand 452de53c12 bfd/
* elf32-spu.c (spu_elf_modify_segment_map): Move all PF_OVERLAY
	segments first amongst the program headers.

ld/testsuite/
	* ld-spu/icache.d: Update file offsets.
	* ld-spu/ovl.d: Likewise.
	* ld-spu/ovl1.d: Likewise.
2009-05-14 15:26:36 +00:00
Alan Modra bbb0fc04cc bfd/
* elf32-spu.c (spu_elf_size_stubs): Split out section placement to..
	(spu_elf_place_overlay_data): ..here.  New function.
	* elf32-spu.h (spu_elf_place_overlay_data): Declare.
ld/
	* emultempl/spuelf.em (spu_before_allocation): Call
	spu_elf_place_overlay_data.
ld/testsuite/
	* ld-spu/icache1.d: Update for changed overlay manager placement.
	* ld-spu/ovl.d: Likewise.
	* ld-spu/ovl2.d: Likewise.
2009-05-14 04:30:03 +00:00
Alan Modra 011aa75f62 * ldlang.c (lang_insert_orphan): Add __start_<section> symbol
assignment inside output section statement.  Ensure only one
	set of symbols per output section.
	* emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Add non-
	dollar sections before dollar sections.  Correct add_child
	list insertion.
	* emultempl/pep.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
2009-05-14 02:21:45 +00:00
Nick Clifton ad16af38c6 Revert previous delta 2009-05-07 15:07:32 +00:00
Nick Clifton e7a2059d2a * ld-elf/eh-group.exp: Only run these tests for ELF based
targets.
2009-05-07 13:44:43 +00:00
Paul Brook 2468f9c95d 2009-05-05 Paul Brook <paul@codesourcery.com>
bfd/
	* bfd-in.h (elf32_arm_fix_exidx_coverage): Add prototype.
	* bfd-in2.h: Regenerate.
	* elf32-arm.c (arm_unwind_edit_type, arm_unwind_table_edit): Define.
	(_arm_elf_section_data): Add text and exidx fields.
	(add_unwind_table_edit, get_arm_elf_section_data, adjust_exidx_size,
	insert_cantunwind_after, elf32_arm_fix_exidx_coverage, offset_prel31,
	copy_exidx_entry): New functions.
	(elf32_arm_write_section): Fixup .ARM.exidx contents.

	ld/
	* emultempl/armelf.em (compare_output_sec_vma): New function.
	(gld${EMULATION_NAME}_finish): Add exidx munging code.

	ld/testsuite/
	* ld-arm/arm.ld: Add .ARM.exidx and .ARM.extab.
	* ld-arm/arm-elf.exp: Add unwind-[1-4].
	* ld-arm/unwind-1.d: New test.
	* ld-arm/unwind-1.s: New test.
	* ld-arm/unwind-2.d: New test.
	* ld-arm/unwind-2.s: New test.
	* ld-arm/unwind-3.d: New test.
	* ld-arm/unwind-3.s: New test.
	* ld-arm/unwind-4.d: New test.
	* ld-arm/unwind-4.s: New test.
2009-05-05 14:18:30 +00:00
Nick Clifton 84f1b567bb * scripttempl/avr.sc (MEMORY): Use DATA_ORIGIN.
* emulparams/avr1.sh (DATA_ORIGIN): Add.
        * emulparams/avr2.sh (DATA_ORIGIN): Add.
        * emulparams/avr25.sh (DATA_ORIGIN): Add.
        * emulparams/avr3.sh (DATA_ORIGIN): Add.
        * emulparams/avr31.sh (DATA_ORIGIN): Add.
        * emulparams/avr35.sh (DATA_ORIGIN): Add.
        * emulparams/avr4.sh (DATA_ORIGIN): Add.
        * emulparams/avr5.sh (DATA_ORIGIN): Add.
        * emulparams/avr51.sh (DATA_ORIGIN): Add.
        (DATA_LENGTH): Update.
        * emulparams/avr6.sh (DATA_ORIGIN): Add.
        (DATA_LENGTH): Update.
2009-05-05 11:28:36 +00:00
Dave Korn 09e2aba432 bfd/ChangeLog
* elflink.c (find_version_for_sym):  Remove from here, ...
	* linker.c (bfd_find_version_for_sym):  ... rename, replace
	here, make public and update all callers.
	* bfd-in2.h:  Regenerate.

ld/ChangeLog

	* NEWS:  Mention new feature.
	* ld.texinfo (--version-script):  Document extent of PE support.
	(WIN32):  Mention --version-script.  Extend auto-export description.
	* pe-dll.c (process_def_file):  Use version script info to filter
	symbols from auto-export.
	* testsuite/ld-pe/vers-script-1.d:  New file.
	* testsuite/ld-pe/vers-script-2.d:  New file.
	* testsuite/ld-pe/vers-script-3.d:  New file.
	* testsuite/ld-pe/vers-script-4.d:  New file.
	* testsuite/ld-pe/vers-script-1.ver:  New file.
	* testsuite/ld-pe/vers-script-2.ver:  New file.
	* testsuite/ld-pe/vers-script-3.ver:  New file.
	* testsuite/ld-pe/vers-script-4.ver:  New file.
	* testsuite/ld-pe/vers-script-dll.c:  New file.
	* testsuite/ld-pe/vers-script.exp:  New test script.
2009-05-04 12:09:30 +00:00
Nathan Sidwell 1f7f5cbe1c * emulparams/vxworks.sh (TEXT_START_ADDR): Override. 2009-05-01 15:23:42 +00:00
Julian Brown 49dff77b6e ld/testsuite/
* ld-arm/arm-elf.exp (armeabitests): Add thumb2-bl-blx-interwork test.
	* ld-arm/thumb2-bl-blx-interwork.s: New.
	* ld-arm/thumb2-bl-blx-interwork.d: New.
2009-05-01 13:49:19 +00:00
Nick Clifton d8045f234d include/elf
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * common.h (STT_GNU_IFUNC): Define.

elfcpp
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * (enum STT): Add STT_GNU_IFUNC.

gas
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * config/obj-elf.c (obj_elf_type): Add support for a
        gnu_indirect_function type.
        * config/tc-i386.c (tc_i386_fix_adjustable): Do not adjust fixups
        against indirect function symbols.
        * doc/as.texinfo (.type): Document the support for the
        gnu_indirect_function symbol type.
        * NEWS: Mention the new feature.

gas/testsuite
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * gas/elf/elf.exp: Extend type test to include an ifunc symbol.
        Provide an alternative test for targets which do not support ifunc
        symbols.
        (type.s): Add entry for an ifunc symbol.
        (type.e): Add ifunc entry to expected symbol dump.
        (section2.e-armelf): Add  entry for ifunc symbol.
        (type-noifunc.s): New file.
        (type-noifunc.e): New file.

bfd/
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs
        section pointer.
        (struct elf_obj_data): Add has_ifunc_symbols boolean.
        * elf.c (swap_out_syms): Convert BSF_GNU_INDIRECT_FUNCTION flags
        into a STT_GNU_IFUNC symbol type.
        (_bfd_elf_is_function_type): Accept STT_GNU_IFUNC as a function
        type.
        (_bfd_elf_set_osabi): Set the osasbi field to ELFOSABI_LINUX if
        the binary contains ifunc symbols.
        * elfcode.h (elf_slurp_symbol_table): Translate the STT_GNU_IFUNC
        symbol type into a BSF_GNU_INDIRECT_FUNCTION flag.
        * elf32-i386.c (is_indirect_function): New function.
        (elf_i386_check_relocs): Create an ifunc output section.
        (allocate_dynrelocs): Create dynamic relocs in the ifunc output
        section if necessary.
        (elf_i386_relocate_section): Emit a reloc against an ifunc symbol
        if necessary.
        (elf_i386_add_symbol_hook): New function. Set the
        has_ifunc_symbols field of the elf_obj_data structure if an ifunc
        symbol is encountered.
        (elf_backend_post_process_headers): Define.
        (elf_backend_add_symbol_hook): Define.
        (elf_i386_post_process_headers): Rename to
        elf_i388_fbsd_post_process_headers.
        * elf64-x86_64.c (IS_X86_64_PCREL_TYPE): New macro.
        (is_indirect_function): New function.
        (elf64_x86_64_check_relocs): Create an ifunc output section.
        (allocate_dynrelocs): Create dynamic relocs in the ifunc output
        section if necessary.
        (elf64_x86_64_relocate_section): Emit a reloc against an ifunc
        symbol if necessary.
        (elf_i386_add_symbol_hook): Set the has_ifunc_symbols field of the
        elf_obj_data structure if an ifunc symbol is encountered.
        (elf_backend_post_process_headers): Define.
        * elflink.c (_bfd_elf_adjust_dynamic_symbol): Always create a PLT
        if we have ifunc symbols to handle.
        (get_ifunc_reloc_section_name): New function.  Computes the name
        for an ifunc section.
        (_bfd_elf_make_ifunc_reloc_section): New function.  Creates a
        section to hold ifunc relocs.
        * syms.c (BSF_GNU_INDIRECT_FUNCTION): Define.
        (bfd_print_symbol_vandf): Handle ifunc symbols.
        (bfd_decode_symclass): Likewise.
        * bfd-in2.h: Regenerate.

binutils
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * readelf.c (dump_relocations): Display a relocation against an
        ifunc symbol as if it were a function invocation.
        (get_symbol_type): Handle STT_GNU_IFUNC.

ld
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * NEWS: Mention support for IFUNC symbols.

ld/testsuite
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * ld-ifunc: New directory.
        * ld-ifunc/ifunc.exp: New file: Run the IFUNC tests.
        * ld-ifunc/prog.c: New file.
        * ld-ifunc/lib.c: New file.
2009-04-30 15:47:13 +00:00
Anthony Green efaf18f368 Move moxie stack out in memory. 2009-04-30 04:29:23 +00:00