Commit Graph

282 Commits

Author SHA1 Message Date
H.J. Lu b7761f1106 Support arch-dependent fill
bfd/

2012-01-31  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13616
	* archures.c (bfd_arch_info): Add fill.
	(bfd_default_arch_struct): Add bfd_arch_default_fill.
	(bfd_arch_default_fill): New.

	* configure.in: Set bfd version to 2.22.52.
	* configure: Regenerated.

	* cpu-alpha.c: Add bfd_arch_default_fill to bfd_arch_info
	initializer.
	* cpu-arc.c: Likewise.
	* cpu-arm.c: Likewise.
	* cpu-avr.c: Likewise.
	* cpu-bfin.c: Likewise.
	* cpu-cr16.c: Likewise.
	* cpu-cr16c.c: Likewise.
	* cpu-cris.c: Likewise.
	* cpu-crx.c: Likewise.
	* cpu-d10v.c: Likewise.
	* cpu-d30v.c: Likewise.
	* cpu-dlx.c: Likewise.
	* cpu-epiphany.c: Likewise.
	* cpu-fr30.c: Likewise.
	* cpu-frv.c: Likewise.
	* cpu-h8300.c: Likewise.
	* cpu-h8500.c: Likewise.
	* cpu-hppa.c: Likewise.
	* cpu-i370.c: Likewise.
	* cpu-i860.c: Likewise.
	* cpu-i960.c: Likewise.
	* cpu-ia64.c: Likewise.
	* cpu-ip2k.c: Likewise.
	* cpu-iq2000.c: Likewise.
	* cpu-lm32.c: Likewise.
	* cpu-m10200.c: Likewise.
	* cpu-m10300.c: Likewise.
	* cpu-m32c.c: Likewise.
	* cpu-m32r.c: Likewise.
	* cpu-m68hc11.c: Likewise.
	* cpu-m68hc12.c: Likewise.
	* cpu-m68k.c: Likewise.
	* cpu-m88k.c: Likewise.
	* cpu-mcore.c: Likewise.
	* cpu-mep.c: Likewise.
	* cpu-microblaze.c: Likewise.
	* cpu-mips.c: Likewise.
	* cpu-mmix.c: Likewise.
	* cpu-moxie.c: Likewise.
	* cpu-msp430.c: Likewise.
	* cpu-mt.c: Likewise.
	* cpu-ns32k.c: Likewise.
	* cpu-openrisc.c: Likewise.
	* cpu-or32.c: Likewise.
	* cpu-pdp11.c: Likewise.
	* cpu-pj.c: Likewise.
	* cpu-plugin.c: Likewise.
	* cpu-powerpc.c: Likewise.
	* cpu-rl78.c: Likewise.
	* cpu-rs6000.c: Likewise.
	* cpu-rx.c: Likewise.
	* cpu-s390.c: Likewise.
	* cpu-score.c: Likewise.
	* cpu-sh.c: Likewise.
	* cpu-sparc.c: Likewise.
	* cpu-spu.c: Likewise.
	* cpu-tic30.c: Likewise.
	* cpu-tic4x.c: Likewise.
	* cpu-tic54x.c: Likewise.
	* cpu-tic6x.c: Likewise.
	* cpu-tic80.c: Likewise.
	* cpu-tilegx.c: Likewise.
	* cpu-tilepro.c: Likewise.
	* cpu-v850.c: Likewise.
	* cpu-vax.c: Likewise.
	* cpu-w65.c: Likewise.
	* cpu-we32k.c: Likewise.
	* cpu-xc16x.c: Likewise.
	* cpu-xstormy16.c: Likewise.
	* cpu-xtensa.c: Likewise.
	* cpu-z80.c: Likewise.
	* cpu-z8k.c: Likewise.

	* cpu-i386.c: Include "libiberty.h".
	(bfd_arch_i386_fill): New.
	Add bfd_arch_i386_fill to  bfd_arch_info initializer.

	* cpu-k1om.c: Add bfd_arch_i386_fill to  bfd_arch_info initializer.
	* cpu-l1om.c: Likewise.

	* linker.c (default_data_link_order): Call abfd->arch_info->fill
	if fill size is 0.

	* bfd-in2.h: Regenerated.

include/

2012-01-31  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13616
	* bfdlink.h (bfd_link_order): Update comments on data size.

ld/

2012-01-31  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13616
	* emulparams/elf32_x86_64.sh: Remove NOP.
	* emulparams/elf_i386.sh: Likewise.
	* emulparams/elf_i386_be.sh: Likewise.
	* emulparams/elf_i386_ldso.sh: Likewise.
	* emulparams/elf_i386_vxworks.sh: Likewise.
	* emulparams/elf_k1om.sh: Likewise.
	* emulparams/elf_l1om.sh: Likewise.
	* emulparams/elf_x86_64.sh: Likewise.

	* ldlang.c (zero_fill): Initialized to 0.

	* ldwrite.c (build_link_order): Set data size to linker odrder
	size when they are the same.

	* scripttempl/elf.sc: Don't specify fill if NOP is undefined.

ld/testsuite/

2012-01-31  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13616
	* ld-i386/tlsbindesc.dd: Update no-op padding.
	* ld-i386/tlsnopic.dd: Likewise.
	* ld-i386/tlspic.dd: Likewise.
	* ld-x86-64/tlsbin.dd: Likewise.
	* ld-x86-64/tlsbindesc.dd: Likewise.
	* ld-x86-64/tlspic.dd: Likewise.
2012-01-31 17:54:39 +00:00
Tristan Gingold bbd0c8e204 2011-11-03 Tristan Gingold <gingold@adacore.com>
* scripttempl/aix.sc: Consider header size for .text and .data
	alignment.
2011-11-03 11:53:39 +00:00
Kai Tietz ebe9c501ff * scripttempl/pe.sc (.text): Add support for
.gnu.linkonce.t.* section.
        (.debug_info): Only use .gnu.linkonce.wi.* for
        relocating.
        * scripttempl/pep.sc: Likewise.
2011-09-27 15:59:55 +00:00
Kai Tietz b990ad6169 2011-08-06 Kai Tietz <ktietz@redhat.com>
* scripttempl/pep.sc: Add .debug_macro section.
        * scripttempl/pe.sc: Likewise.
2011-08-06 11:21:44 +00:00
Nick Clifton cc643b88f1 Fix spelling mistakes. 2011-06-02 13:43:24 +00:00
Nick Clifton f20db198c0 * scripttempl/v850.sc (_heap_start): Provide. 2011-05-27 10:47:46 +00:00
Dave Korn 730035f7af bfd/ChangeLog:
PR ld/12365
	* cofflink.c (bfd_coff_link_input_bfd): Check for and warn about
	references to symbols defined in discarded sections.

ld/ChangeLog:

	PR ld/12365
	* scripttempl/pe.sc (__rt_psrelocs_start): New symbol definition.
	(__rt_psrelocs_end): Likewise.
	(__rt_psrelocs_size): Likewise difference between the above.
	(__RUNTIME_PSEUDO_RELOC_LIST_END__): Move outside .rdata section
	immediately after end of pseudo-reloc data.
	(___RUNTIME_PSEUDO_RELOC_LIST_END___): Likewise.
	(__RUNTIME_PSEUDO_RELOC_LIST__): Move outside .rdata section and
	calculate backward from list end.
	(___RUNTIME_PSEUDO_RELOC_LIST___): Likewise.
	* scripttempl/pep.sc: Likewise.

ld/testsuite/ChangeLog:

	PR ld/12365
	* ld-plugin/plugin-7.d: Allow underscore in error message.
	* ld-plugin/plugin-8.d: Likewise.
2011-05-07 14:29:10 +00:00
Tristan Gingold 55221e4b5a 2011-05-06 Tristan Gingold <gingold@adacore.com>
* scripttempl/alphavms.sc (CODE): Add *$CODE*.
2011-05-06 10:44:31 +00:00
Nick Clifton 72b016b4ac * dw2gencfi.c (dwcfi_seg_list): New struct.
(dwcfi_hash): New static hash variable.
	(get_debugseg_name): New.
	(alloc_debugseg_item): New.
	(make_debug_seg): New.
	(dwcfi_hash_insert): New.
	(dwcfi_hash_find): New.
	(dwcfi_hash_find_or_make): New.
	(cfi_insn_data): New member cur_seg.
	(cie_entry): Likewise.
	(fde_entry): New cseg and handled members.
	(alloc_fde_entry): Initialize cseg member.
	(alloc_cfi_insn_data): Initialize cur_seg member.
	(dot_cfi_sections): Compare for beginning of
	section names via strncmp.
	(get_cfi_seg): New.
	(cfi_finish): Treat link-once sections.
	(is_now_linkonce_segment): New local helper.
	(output_cie): Ignore cie entries not member of current
	segment.
	(output_fde): Likewise.
	(select_cie_for_fde): Likewise.
	(cfi_change_reg_numbers): Add new argument for current segment
	and ignore insn elements, if not part of current segment.
	* ehopt.c (get_cie_info): Use strncmp for
	section name matching.
	(heck_eh_frame): Likewise.

	* coffcode.h (sec_to_styp_flags): Allow linkonce for
	debugging sections.

	* scripttempl/pe.sc: Handle .eh_frame($|.)* sections.
	* scripttempl/pep.sc: Likewise.

	* ld-pe/pe.exp: Add cfi/cfi32 tests.
	* ld-pe/cfi.d: New.
	* ld-pe/cfi32.d: New.
	* ld-pe/cfia.s: New.
	* ld-pe/cfib.s: New.
2011-04-26 15:28:08 +00:00
Tristan Gingold 9165b2bff2 2011-04-21 Tristan Gingold <gingold@adacore.com>
* scripttempl/alphavms.sc: Add dwarf2 embedding marks.
2011-04-21 12:22:25 +00:00
Nick Clifton ed0d9c711c * scripttempl/elf.sc (.exception_ranges): Add new section. 2011-04-11 15:38:12 +00:00
Eric B. Weddington ef844a53d2 2011-03-21 Eric B. Weddington <eric.weddington@atmel.com>
* scripttempl/avr.sc: Add fuse, lock, and signature memory regions.
2011-03-21 20:07:42 +00:00
Alan Modra dc56ba2d58 remove accidental SANE_EXPR change 2011-02-10 08:35:26 +00:00
Alan Modra 09b910c68c * scripttempl/armbpabi.sc: Revert 2010-11-02 H.J. Lu.
* scripttempl/avr.sc: Likewise.
	* scripttempl/elf32cr16.sc: Likewise.
	* scripttempl/elf32crx.sc: Likewise.
	* scripttempl/elf32msp430.sc: Likewise.
	* scripttempl/elf32msp430_3.sc: Likewise.
	* scripttempl/elf32sh-symbian.sc: Likewise.
	* scripttempl/elf64hppa.sc: Likewise.
	* scripttempl/elf_chaos.sc: Likewise.
	* scripttempl/elfd10v.sc: Likewise.
	* scripttempl/elfd30v.sc: Likewise.
	* scripttempl/elfi370.sc: Likewise.
	* scripttempl/elfm68hc11.sc: Likewise.
	* scripttempl/elfm68hc12.sc: Likewise.
	* scripttempl/elfxtensa.sc: Likewise.
	* scripttempl/ip2k.sc: Likewise.
	* scripttempl/iq2000.sc: Likewise.
	* scripttempl/mep.sc: Likewise.
	* scripttempl/mmo.sc: Likewise.
	* scripttempl/v850.sc: Likewise.
	* scripttempl/xstormy16.sc: Likewise.
	* scripttempl/elf.sc: Revert 2010-10-29  H.J. Lu.
2011-02-10 08:18:58 +00:00
H.J. Lu 02ecc8e968 Add SORT_BY_INIT_PRIORITY.
bfd/

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

	* elf.c (_bfd_elf_new_section_hook): Special handling for
	.init_array/.fini_array output sections.

ld/

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

	* Makefile.am (GENSCRIPTS): Add @enable_initfini_array@.

	* NEWS: Mention SORT_BY_INIT_PRIORITY.

	* configure.in: Add AC_CANONICAL_BUILD.
	Add --enable-initfini-array.

	* genscripts.sh (ENABLE_INITFINI_ARRAY): New.

	* ld.h (sort_type): Add by_init_priority.

	* ld.texinfo: Document SORT_BY_INIT_PRIORITY.

	* ldgram.y (SORT_BY_INIT_PRIORITY): New.
	(wildcard_spec): Handle SORT_BY_INIT_PRIORITY.

	* ldlang.c (get_init_priority): New.
	(compare_section): Use get_init_priority for by_init_priority.

	* ldlex.l (SORT_BY_INIT_PRIORITY): New.

	* scripttempl/elf.sc: Support ENABLE_INITFINI_ARRAY.

	* Makefile.in: Regenerated.
	* aclocal.m4: Regenerated.
	* config.in: Likewise.
	* configure: Likewise.

ld/testsuite/

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

	* ld-elf/elf.exp (array_tests): Add init-mixed.
	(array_tests_static): Likewise.
	Also delete tmpdir/init-mixed.

	* ld-elf/init-mixed.c: New.
	* ld-elf/init-mixed.out: Likewise.
2010-12-15 14:56:40 +00:00
Alan Modra add44f8d5c * scripttempl/elf.sc: Group .text.exit, text.startup and .text.hot
sections.
2010-11-25 03:03:02 +00:00
Kai Tietz 802d48223b bfd/
2010-11-04  Kai Tietz  <kai.tietz@onevision.com>

        * coffcode.h (GNU_LINKONCE_WT): New.
        (sec_to_styp_flags): Add handling of new debug
        section.
        (styp_to_sec_flags): Likewise.

ld/
010-11-04  Kai Tietz  <kai.tietz@onevision.com>

       * scripttempl/pe.sc (.debug_types): New.
       * scripttempl/pep.sc: Likewise.
2010-11-04 16:03:25 +00:00
H.J. Lu 34734a010b Include compressed DWARF debug sections in ELF linker scripts.
binutils/testsuite/

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

	* binutils-all/libdw2.out: Also accept MIPS_DWARF.

ld/

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

	* scripttempl/armbpabi.sc: Include compressed DWARF debug
	sections.
	* scripttempl/avr.sc: Likewise.
	* scripttempl/elf32cr16.sc: Likewise.
	* scripttempl/elf32crx.sc: Likewise.
	* scripttempl/elf32msp430.sc: Likewise.
	* scripttempl/elf32msp430_3.sc: Likewise.
	* scripttempl/elf32sh-symbian.sc: Likewise.
	* scripttempl/elf64hppa.sc: Likewise.
	* scripttempl/elf_chaos.sc: Likewise.
	* scripttempl/elfd10v.sc: Likewise.
	* scripttempl/elfd30v.sc: Likewise.
	* scripttempl/elfi370.sc: Likewise.
	* scripttempl/elfm68hc11.sc: Likewise.
	* scripttempl/elfm68hc12.sc: Likewise.
	* scripttempl/elfxtensa.sc: Likewise.
	* scripttempl/ip2k.sc: Likewise.
	* scripttempl/iq2000.sc: Likewise.
	* scripttempl/mep.sc: Likewise.
	* scripttempl/mmo.sc: Likewise.
	* scripttempl/v850.sc: Likewise.
	* scripttempl/xstormy16.sc: Likewise.

ld/testsuite/

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

	* ld-elf/compress1a.d: Also check MIPS_DWARF.
	* ld-elf/compress1b.d: Likewise.
	* ld-elf/compress1c.d: Likewise.
2010-11-02 13:47:44 +00:00
H.J. Lu 4a114e3e0c Add compressed debug section support to binutils and ld.
bfd/

2010-10-29  H.J. Lu  <hongjiu.lu@intel.com>
	    Cary Coutant  <ccoutant@google.com>

	* archive.c (bfd_openr_next_archived_file): Copy BFD_COMPRESS
	and BFD_DECOMPRESS.

	* bfd.c (BFD_COMPRESS): New.
	(BFD_DECOMPRESS): Likewise.
	(BFD_FLAGS_SAVED): Likewise.
	(bfd_preserve_save): Replace BFD_IN_MEMORY with BFD_FLAGS_SAVED.

	* compress.c (bfd_uncompress_section_contents): Removed.
	(get_uncompressed_size): New.
	(decompress_contents): Likewise.
	(bfd_compress_section_contents): Likewise.
	(bfd_get_full_section_contents): Likewise.
	(bfd_is_section_compressed): Likewise.
	(bfd_init_section_decompress_status): Likewise.
	(bfd_init_section_compress_status): Likewise.

	* dwarf2.c (dwarf_debug_sections): New.
	(dwarf_debug_section_enum): Likewise.
	(read_section): Remove section_name and compressed_section_name.
	Add dwarf_debug_section_enum.  Try compressed debug section.
	(read_indirect_string): Updated.
	(read_abbrevs): Likewise.
	(decode_line_info): Likewise.
	(read_debug_ranges): Likewise.
	(find_line): Updated.

	* ecoff.c (bfd_debug_section): Add compress_status and
	compressed_size.

	* elf.c (_bfd_elf_make_section_from_shdr): Call
	bfd_is_section_compressed to check if a DWARF debug section is
	compressed.  Call bfd_init_section_compress_status or
	bfd_init_section_decompress_status if needed.

	* elflink.c (elf_link_input_bfd): Replace bfd_get_section_contents
	with bfd_get_full_section_contents.
	* merge.c (_bfd_add_merge_section): Likewise.
	* reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
	* simple.c (bfd_simple_get_relocated_section_contents): Likewise.

	* elfxx-target.h (TARGET_BIG_SYM): Allow BFD_COMPRESS and
	BFD_DECOMPRESS.
	(TARGET_LITTLE_SYM): Likewise.

	* libbfd-in.h (dwarf_debug_section): New.
	(dwarf_debug_sections): Likewise.

	* libbfd.c (_bfd_generic_get_section_contents): Issue an error
	when getting contents on compressed/decompressed section.

	* section.c (COMPRESS_SECTION_NONE): New.
	(COMPRESS_SECTION_DONE): Likewise.
	(DECOMPRESS_SECTION_SIZED): Likewise.
	(BFD_FAKE_SECTION): Add compress_status and compressed_size.
	(bfd_malloc_and_get_section): Replace bfd_get_section_contents
	with bfd_get_full_section_contents.

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

binutils/

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

	* addr2line.c (process_file): Set BFD_DECOMPRESS.

	* objcopy.c (do_debug_sections): New.
	(OPTION_COMPRESS_DEBUG_SECTIONS): New.
	(OPTION_DECOMPRESS_DEBUG_SECTIONS): Likewise.
	(copy_options): Add OPTION_COMPRESS_DEBUG_SECTIONS and
	OPTION_DECOMPRESS_DEBUG_SECTIONS.
	(copy_usage): Add --compress-debug-sections and
	--decompress-debug-sections.
	(copy_file): Set BFD_COMPRESS or BFD_DECOMPRESS.
	(copy_section): Replace bfd_get_section_contents with
	bfd_get_full_section_contents.
	(copy_main): Handle OPTION_COMPRESS_DEBUG_SECTIONS and
	OPTION_DECOMPRESS_DEBUG_SECTIONS.  Check do_debug_sections to
	rename DWARF debug sections.

	* objdump.c (load_specific_debug_section): Replace
	bfd_get_section_contents with bfd_get_full_section_contents.
	Remove bfd_uncompress_section_contents.
	(dump_section): Replace bfd_get_section_contents with
	bfd_get_full_section_contents.
	(display_file): Set BFD_DECOMPRESS if needed.

	* readelf.c (uncompress_section_contents): Set buffer to NULL
	to indiate decompression failure.
	(load_specific_debug_section): Always call
	uncompress_section_contents.

	* doc/binutils.texi: Document --compress-debug-sections and
	--decompress-debug-sections.

binutils/testsuite/

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

	* binutils-all/compress.exp: New.
	* binutils-all/dw2-1.S: Likewise.
	* binutils-all/dw2-2.S: Likewise.
	* binutils-all/libdw2-compressed.out: Likewise.
	* binutils-all/libdw2.out: Likewise.

gas/

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

	* write.c (compress_debug): Optimize section flags check.

gas/testsuite/

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

	* elf/dwarf2-1.s: Replace .zdebug_abbrev section with
	.debug_abbrev section.
	* elf/dwarf2-2.3: Likewise.

	* elf/dwarf2-1.d: Pass --compress-debug-sections to assembler.
	Updated.
	* elf/dwarf2-2.d: Likewise.

	* gas/i386/i386.exp: Remove xfail on dw2-compress-2 and
	x86-64-dw2-compress-2.

ld/

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

	* ldfile.c (ldfile_try_open_bfd): Set BFD_DECOMPRESS after
	bfd_openr returns.
	* emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Likewise.

	* scripttempl/elf.sc: Include compressed DWARF debug sections.

ld/testsuite/

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

	* ld-elf/compress.exp: New.
	* ld-elf/compress1.s: Likewise.
	* ld-elf/compress1a.d: Likewise.
	* ld-elf/compress1b.d: Likewise.
	* ld-elf/compress1c.d: Likewise.
2010-10-29 12:10:39 +00:00
Dave Korn 9396a3cecf * scripttempl/armcoff.sc: Revert 2010-09-22 change. 2010-09-24 04:41:12 +00:00
Kai Tietz d487497340 2010-09-22 Kai Tietz <kai.tietz@onevision.com>
* emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Add
        idata to orphan set.
        * emultempl/pep.em: Likewise.
        * scripttempl/armcoff.sc: Separate idata
        and add __IAT_start__ and __IAT_end__ labels.
        * scripttempl/pe.sc: Likewise.
        * scripttempl/pep.sc: Likewise.
2010-09-22 08:03:42 +00:00
Kai Tietz 2d7f492901 ChangeLog gas
2010-09-15  Kai Tietz  <kai.tietz@onevision.com>

       * config/obj-coff-seh.h (seh_context): New member code_seg.
       * config/obj-coff-seh.c: Implementing xdata/pdata section cloning
       for link-once code-segment.

ChangeLog ld

2010-09-15  Kai Tietz  <kai.tietz@onevision.com>

       * scripttempl/pep.sc: Add .xdata segment and
       put into .pdata all segments beginning with .pdata.

ChangeLog gas/testsuite
2010-09-15  Kai Tietz  <kai.tietz@onevision.com>

       * gas/pe/pe.exp: Add peseh-x64-4,5,6 tests.
       * gas/pe/peseh-x64-4.s: New.
       * gas/pe/peseh-x64-4.d: New.
       * gas/pe/peseh-x64-5.d: New.
       * gas/pe/peseh-x64-6.d: New.
2010-09-15 19:43:56 +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
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 360cfc9c8b remove maxq-coff port 2010-06-29 04:17:34 +00:00
Tristan Gingold 46d00b8af1 bfd/
2010-06-01  Tristan Gingold  <gingold@adacore.com>

	* vms-alpha.c (struct vms_private_data_struct): Add
	transfer_address field.  Remove unused dst_info field.
	(alpha_vms_write_exec): Use transfer_address.
	(_bfd_vms_write_egsd): Add a comment about LIB$INITIALIZE.
	(alpha_vms_bfd_final_link): Set transfer_address.

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

	* scripttempl/alphavms.sc: Add comments. Move $LINK$ to the
	readonly output-section. Handle LIB$INITIALIZE and sections
	created by gcc.
	* emultempl/vms.em (vms_place_orphan): Add comments.
2010-06-01 09:52:28 +00:00
Tristan Gingold 8b351884bb 2010-04-14 Tristan Gingold <gingold@adacore.com>
* emulparams/alphavms.sh: New file.
	* emultempl/vms.em: New file.
	* scripttempl/alphavms.sc: New file.
	* configure.tgt (alpha*-*-*vms*): Added.
	* Makefile.am (ALL_EMULATIONS): Add ealphavms.o
	(ealphavms.c): New target.
	* Makefile.in: Regenerate.
2010-04-14 09:27:27 +00:00
Joseph Myers 349e935bad * scripttempl/elf.sc (RODATA_NAME, SDATA_NAME, SBSS_NAME,
BSS_NAME): Define if not already defined.  Use in place of some
	hardcoded section names.
2010-03-23 16:02:02 +00:00
H.J. Lu 576ee33af3 Re-indent INIT_ARRAY.
2010-03-18  H.J. Lu  <hongjiu.lu@intel.com>

	* scripttempl/elf.sc (INIT_ARRAY): Re-indent.
2010-03-18 18:40:29 +00:00
Jie Zhang 3cff7cc71f * scripttempl/armbpabi.sc: Don't combine .init_array.* or
.fini_array.* when do relocatable linking.
	* scripttempl/elf.sc: Likewise.
	* scripttempl/elf32sh-symbian.sc: Likewise.
	* scripttempl/elf64hppa.sc: Likewise.
	* scripttempl/elfxtensa.sc: Likewise.

	testsuite/
	* ld-elf/init-fini-arrays.s: New test.
	* ld-elf/init-fini-arrays.d: New test.
2010-02-27 12:34:25 +00:00
Alan Modra 9445af9a0e * scripttempl/elf.sc (.fini_array): Place input .fini_array after
.fini_array.*.
	* scripttempl/armbpabi.sc: Likewise.
	* scripttempl/elf32sh-symbian.sc: Likewise.
	* scripttempl/elf64hppa.sc: Likewise.
	* scripttempl/elfxtensa.sc: Likewise.
2010-02-26 11:36:32 +00:00
Alan Modra 829da89821 PR ld/11012
* emulparams/elf64ppc.sh (OTHER_GOT_RELOC_SECTIONS): Move .rela.opd ..
	(INITIAL_RELOC_SECTIONS): .. to here.  New define.
	* scripttempl/elf.sc: Expand INITIAL_RELOC_SECTIONS.
2009-12-09 01:26:03 +00:00
Kai Tietz fecc36fdd1 2009-11-25 Kai Tietz <kai.tietz@onevision.com>
* scripttempl/pe.sc: (.note.GNU-stack): Mark as discardable.
        (.gnu.lto_*): Likewise.
        * scripttempl/pep.sc: (.note.GNU-stack): Mark as discardable.
        (.gnu.lto_*): Likewise.
2009-11-25 06:59:01 +00:00
Alan Modra ec2d9b2927 Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
Alan Modra df381c72f4 * scripttempl/elf32cr16.sc: Emit empty script for ld -r and ld -Ur.
* scripttempl/elf32cr16c.sc: Likewise.
	* scripttempl/elf32crx.sc: Likewise.
	* scripttempl/tic54xcoff.sc: Likewise.
	* scripttempl/aix.sc: Delete ${RELOCATING-0}.
	* scripttempl/avr.sc: Likewise.
	* scripttempl/elf32msp430.sc: Likewise.
	* scripttempl/elf32msp430_3.sc: Likewise.
	* scripttempl/elf32sh-symbian.sc: Likewise.
	* scripttempl/elf_chaos.sc: Likewise.
	* scripttempl/elfi370.sc: Likewise.
	* scripttempl/nw.sc: Likewise.
	* scripttempl/psos.sc: Likewise.
	* scripttempl/armbpabi.sc: Delete ${RELOCATING-0} and ${CONSTRUCTING-0}.
	* scripttempl/elf.sc: Likewise.
	* scripttempl/elf64hppa.sc: Likewise.
	* scripttempl/elfd10v.sc: Likewise.
	* scripttempl/elfd30v.sc: Likewise.
	* scripttempl/elfm68hc11.sc: Likewise.
	* scripttempl/elfm68hc12.sc: Likewise.
	* scripttempl/elfmicroblaze.sc: Likewise.
	* scripttempl/elfxtensa.sc: Likewise.
	* scripttempl/iq2000.sc: Likewise.
	* scripttempl/mep.sc: Likewise.
	* scripttempl/xstormy16.sc: Likewise.
2009-09-28 07:08:50 +00:00
Alan Modra 7807ee0cd2 Delete unused scripts. 2009-09-22 00:17:48 +00:00
Alan Modra 97b11f4094 PR ld/6766
* lexsup.c (parse_args <-e>): Revert 2009-03-18 change.
	* ldemul.c (after_parse_default): Add entry symbol as undef.
	* emultempl/alphaelf.em (alpha_after_parse): Call after_parse_default.
	* emultempl/cr16elf.em (cr16elf_after_parse): Likewise.
	* emultempl/crxelf.em (crxelf_after_parse): Likewise.
	* emultempl/hppaelf.em (hppaelf_after_parse): Likewise.
	* emultempl/ia64elf.em (gld${EMULATION_NAME}_after_parse): Likewise.
	* emultempl/pe.em (gld_${EMULATION_NAME}_after_parse): Call
	after_parse_default and delete now duplicate code.
	* emultempl/pep.em (gld_${EMULATION_NAME}_after_parse): Likewise.
	* scripttempl/elf32cr16.sc: No need to make entry extern.
	* scripttempl/elf32cr16c.sc: Likewise.
	* scripttempl/elf32crx.sc: Likewise.
	* scripttempl/elf32xc16xs.sc: Only provide ENTRY on final link.
2009-09-13 07:19:18 +00:00
Alan Modra 596d6d9145 Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
Alan Modra 4c4fb5dac5 * scripttempl/elf.sc (.text): Add cold text sections. 2009-09-04 06:35:29 +00:00
Dave Korn 032f3e01ca ld/ChangeLog:
* scripttempl/pe.sc (.text): Add "*(.text.*)" in order to catch
	new GCC hot/cold/unlikely partitions.
	* scripttempl/pep.sc: Likewise.
	* scripttempl/epocpe.sc: Likewise.
	* scripttempl/mcorepe.sc: Likewise.
	* scripttempl/ppcpe.sc: Likewise.

ld/testsuite/ChangeLog:

	* ld-pe/longsecn.d: Adjusted to match new .text section merging
	in default PE linker scripts.
	* ld-pe/longsecn-1.d: Likewise.
	* ld-pe/longsecn-2.d: Likewise.
2009-09-03 18:04:35 +00:00
Jie Zhang 8d17e044d8 * scripttempl/elf.sc: Add ${USER_LABEL_PREFIX} to _start, etext,
_stack and __bss_start.
	* emulparams/bfin.sh (ENTRY): Remove.
2009-09-01 02:54:10 +00:00
Nick Clifton 43e56c3465 * scripttempl/elfxtensa.sc (DISCARDED): Discard sections with
.gnu.lto_ prefix.
        * scripttempl/armbpabi.sc: Likewise.
        * scripttempl/elf32sh-symbian.sc: Likewise.
        * scripttempl/elf64hppa.sc: Likewise.
        * scripttempl/mep.sc: Likewise.
2009-08-24 15:22:59 +00:00
Nick Clifton 032b94c5fd * scripttempl/elf.sc: Discard sections with .gnu.lto_ prefix. 2009-08-21 10:38:14 +00:00
Nick Clifton 7ba29e2a41 Add support for Xilinx MicroBlaze processor.
* bfd/Makefile.am: Add cpu-microblaze.{lo,c}, elf32-microblaze.{lo,c}.
        * bfd/Makefile.in: Same.
        * bfd/archures.c: Add bfd_arch_microblaze.
        * bfd/bfd-in2.h: Regenerate.
        * bfd/config.bfd: Add microblaze target.
        * bfd/configure: Add bfd_elf32_microblaze_vec target.
        * bfd/configure.in: Same.
        * bfd/cpu-microblaze.c: New.
        * bfd/elf32-microblaze.c: New.
        * bfd/libbfd-in.h: Add prototype _bfd_dwarf2_fixup_section_debug_loc().
        * bfd/libbfd.h: Regenerate.
        * bfd/reloc.c: Add MICROBLAZE relocations.
        * bfd/section.c: Add struct relax_table and relax_count to section.
        * bfd/targets.c: Add bfd_elf32_microblaze_vec.
        * binutils/MAINTAINERS: Add self as maintainer.
        * binutils/readelf.c: Include elf/microblaze.h, add EM_MICROBLAZE &
        EM_MICROBLAZE_OLD to guess_is_rela(), dump_relocations(),
        get_machine_name().
        * config.sub: Add microblaze target.
        * configure: Same.
        * configure.ac: Same.
        * gas/Makefile.am: add microblaze to CPU_TYPES, config/tc-microblaze.c to
        TARGET_CPU_CFILES, config/tc-microblaze.h to TARGET_CPU_HFILES, add
        DEP_microblaze_elf target.
        * gas/Makefile.in: Same.
        * gas/config/tc-microblaze.c: Add MicroBlaze assembler.
        * gas/config/tc-microblaze.h: Add header for tc-microblaze.c.
        * gas/configure: Add microblaze target.
        * gas/configure.in: Same.
        * gas/configure.tgt: Same.
        * gas/doc/Makefile.am: Add c-microblaze.texi to CPU_DOCS.
        * gas/doc/Makefile.in: Same.
        * gas/doc/all.texi: Set MICROBLAZE.
        * gas/doc/as.texinfo: Add MicroBlaze doc links.
        * gas/doc/c-microblaze.texi: New MicroBlaze docs.
        * include/dis-asm.h: Decl print_insn_microblaze().
        * include/elf/common.h: Define EM_MICROBLAZE & EM_MICROBLAZE_OLD.
        * include/elf/microblaze.h: New reloc definitions.
        * ld/Makefile.am: Add eelf32mb_linux.o, eelf32microblaze.o to
        ALL_EMULATIONS, targets.
        * ld/Makefile.in: Same.
        * ld/configure.tgt: Add microblaze*-linux*, microblaze* targets.
        * ld/emulparams/elf32mb_linux.sh: New.
        * ld/emulparams/elf32microblaze.sh. New.
        * ld/scripttempl/elfmicroblaze.sc: New.
        * opcodes/Makefile.am: Add microblaze-opc.h to HFILES, microblaze-dis.c to
        CFILES, microblaze-dis.lo to ALL_MACHINES, targets.
        * opcodes/Makefile.in: Same.
        * opcodes/configure: Add bfd_microblaze_arch target.
        * opcodes/configure.in: Same.
        * opcodes/disassemble.c: Define ARCH_microblaze, return
        print_insn_microblaze().
        * opcodes/microblaze-dis.c: New MicroBlaze disassembler.
        * opcodes/microblaze-opc.h: New MicroBlaze opcode definitions.
        * opcodes/microblaze-opcm.h: New MicroBlaze opcode types.
2009-08-06 17:38:04 +00:00
Alan Modra 8dfab6dd9a * emulparams/elf32ppc.sh (PLT): Don't include ".iplt".
* emulparams/elf_i386.sh (IREL_IN_PLT): Define.
	* emulparams/elf_x86_64.sh (IREL_IN_PLT): Define.
	* scripttempl/elf.sc: Create separate .iplt and .rela.iplt sections
	when !IREL_IN_PLT.
2009-07-29 14:59:23 +00:00
Hans-Peter Nilsson 18c32df5b4 * scripttempl/mmo.sc: For relocateable links, set $OUTPUT_FORMAT to
the new $RELOCATEABLE_OUTPUT_FORMAT, if set.
	(OUTPUT_FORMAT): Use the variable $OUTPUT_FORMAT.
	(ENTRY): Don't emit for relocateable links.
	(/DISCARD/): Don't discard .gnu.warning.* for relocateable links.
	* emulparams/mmo.sh (RELOCATEABLE_OUTPUT_FORMAT): Set, to
	elf64-mmix.
	* emulparams/elf64mmix.sh (OTHER_TEXT_SECTIONS): Empty, don't
	provide "Main" or set "_start.", for relocateable links.
2009-07-29 00:25:22 +00:00
Tristan Gingold 27505b5d0f 2009-07-03 Tristan Gingold <gingold@adacore.com>
* scripttempl/pep.sc: Put .eh_frame in its own section.
	* scripttempl/pe.sc: Ditto.
2009-07-03 10:44:57 +00:00
Kai Tietz 224180050f 2009-06-27 Kai Tietz <kai.tietz@onevision.com>
* scripttempl/pe.sc (.debug_pubtypes): Fixed syntax error.
	* scripttempl/pep.sc (.debug_pubtypes): Likewise.
2009-06-27 08:57:08 +00:00
Kai Tietz a626fe20fb 2009-06-26 Kai Tietz <kai.tietz@onevision.com>
* scripttempl/pe.sc (.debug_pubtypes): Added section rule.
        * scripttempl/pep.sc: Likewise.
2009-06-26 17:23:10 +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