Commit Graph

28 Commits

Author SHA1 Message Date
Alan Modra df5f2391f7 ld error/warning messages
This patch standardizes messages in ld, to better conform to the GNU
coding standard.  Besides issues of capitalization and full-stops,
I've
- Split up help messages for target options, so that adding a new
  option does not mean loss of translation for all the others.
- Embedded tabs have been removed, since a user might have tab stops
  set at other than 8 char intervals.
- Added missing program name (%P).  ld isn't the compiler.
- Put %F and %X first (and removed %X if %F was present).  These can
  go anywhere, but look silly in the m%Fiddle of a message, and
  choosing "%P%F:" in some messages but "%F%P:" in others leads to the
  likelihood of duplication in ld.pot.  Besides, the colon belongs
  with %P.

	* emulparams/call_nop.sh, * emulparams/cet.sh,
	* emulparams/elf32mcore.sh, * emultempl/aarch64elf.em
	* emultempl/aix.em, * emultempl/alphaelf.em, * emultempl/armcoff.em,
	* emultempl/armelf.em, * emultempl/avrelf.em, * emultempl/beos.em,
	* emultempl/bfin.em, * emultempl/cr16elf.em, * emultempl/elf32.em,
	* emultempl/elf-generic.em, * emultempl/hppaelf.em,
	* emultempl/linux.em, * emultempl/lnk960.em,
	* emultempl/m68hc1xelf.em, * emultempl/m68kcoff.em,
	* emultempl/m68kelf.em, * emultempl/metagelf.em,
	* emultempl/mipself.em, * emultempl/mmix-elfnmmo.em,
	* emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nds32elf.em,
	* emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em,
	* emultempl/ppc32elf.em, * emultempl/ppc64elf.em,
	* emultempl/scoreelf.em, * emultempl/sh64elf.em,
	* emultempl/spuelf.em, * emultempl/sunos.em, * emultempl/tic6xdsbt.em,
	* emultempl/ticoff.em, * emultempl/v850elf.em, * emultempl/vms.em,
	* emultempl/vxworks.em, * emultempl/xtensaelf.em, * ldcref.c,
	* ldctor.c, * ldexp.c, * ldfile.c, * ldgram.y, * ldlang.c,
	* ldmain.c, * ldmisc.c, * ldwrite.c, * lexsup.c, * mri.c, * pe-dll.c,
	* plugin.c: Standardize error/warning messages.
	* testsuite/ld-arc/jli-overflow.err,
	* testsuite/ld-arm/cmse-implib-errors.out,
	* testsuite/ld-arm/cmse-new-earlier-later-implib.out,
	* testsuite/ld-arm/cmse-new-implib-not-sg-in-implib.out,
	* testsuite/ld-arm/cmse-new-wrong-implib.out,
	* testsuite/ld-arm/cmse-veneers-no-gnu_sgstubs.out,
	* testsuite/ld-arm/cmse-veneers-wrong-entryfct.out,
	* testsuite/ld-arm/vxworks1-static.d,
	* testsuite/ld-cris/tls-err-20x.d, * testsuite/ld-cris/tls-err-29.d,
	* testsuite/ld-cris/tls-err-31.d, * testsuite/ld-cris/tls-err-33.d,
	* testsuite/ld-cris/tls-err-35.d, * testsuite/ld-cris/tls-err-37.d,
	* testsuite/ld-cris/tls-err-39.d, * testsuite/ld-cris/tls-err-41.d,
	* testsuite/ld-cris/tls-err-43.d, * testsuite/ld-cris/tls-err-45.d,
	* testsuite/ld-cris/tls-err-47.d, * testsuite/ld-cris/tls-err-49.d,
	* testsuite/ld-cris/tls-err-51.d, * testsuite/ld-cris/tls-err-67.d,
	* testsuite/ld-elf/dwarf2.err, * testsuite/ld-elf/dwarf3.err,
	* testsuite/ld-elf/orphan-5.l, * testsuite/ld-elf/orphan-6.l,
	* testsuite/ld-i386/vxworks1-static.d,
	* testsuite/ld-mips-elf/bal-jalx-pic-micromips-n32.d,
	* testsuite/ld-mips-elf/bal-jalx-pic-micromips-n64.d,
	* testsuite/ld-mips-elf/bal-jalx-pic-micromips.d,
	* testsuite/ld-mips-elf/bal-jalx-pic-n32.d,
	* testsuite/ld-mips-elf/bal-jalx-pic-n64.d,
	* testsuite/ld-mips-elf/bal-jalx-pic.d,
	* testsuite/ld-mips-elf/jal-global-overflow-1.d,
	* testsuite/ld-mips-elf/jal-local-overflow-1.d,
	* testsuite/ld-mips-elf/mode-change-error-1.d,
	* testsuite/ld-mips-elf/unaligned-branch-2.d,
	* testsuite/ld-mips-elf/unaligned-branch-ignore-2.d,
	* testsuite/ld-mips-elf/unaligned-branch-ignore-micromips.d,
	* testsuite/ld-mips-elf/unaligned-branch-ignore-mips16.d,
	* testsuite/ld-mips-elf/unaligned-branch-ignore-r6-1.d,
	* testsuite/ld-mips-elf/unaligned-branch-micromips.d,
	* testsuite/ld-mips-elf/unaligned-branch-mips16.d,
	* testsuite/ld-mips-elf/unaligned-branch-r6-1.d,
	* testsuite/ld-mips-elf/unaligned-branch-r6-2.d,
	* testsuite/ld-mips-elf/unaligned-branch.d,
	* testsuite/ld-mips-elf/unaligned-jalx-1.d,
	* testsuite/ld-mips-elf/unaligned-jalx-3.d,
	* testsuite/ld-mips-elf/unaligned-jalx-addend-1.d,
	* testsuite/ld-mips-elf/unaligned-jalx-addend-3.d,
	* testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d,
	* testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d,
	* testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d,
	* testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d,
	* testsuite/ld-mips-elf/unaligned-jump-micromips.d,
	* testsuite/ld-mips-elf/unaligned-jump-mips16.d,
	* testsuite/ld-mips-elf/unaligned-jump.d,
	* testsuite/ld-mips-elf/unaligned-ldpc-1.d,
	* testsuite/ld-mips-elf/unaligned-lwpc-1.d,
	* testsuite/ld-mips-elf/undefined.d,
	* testsuite/ld-mips-elf/vxworks1-static.d,
	* testsuite/ld-mmix/bpo-20.d, * testsuite/ld-mmix/bpo-20m.d,
	* testsuite/ld-mmix/bpo-7.d, * testsuite/ld-mmix/bpo-7m.d,
	* testsuite/ld-mmix/bpo-8.d, * testsuite/ld-mmix/bpo-8m.d,
	* testsuite/ld-mmix/greg-17.d, * testsuite/ld-mmix/greg-18.d,
	* testsuite/ld-mmix/greg-8.d, * testsuite/ld-mmix/greg-9.d,
	* testsuite/ld-plugin/plugin-14.d, * testsuite/ld-plugin/plugin-15.d,
	* testsuite/ld-plugin/plugin-16.d, * testsuite/ld-plugin/plugin-20.d,
	* testsuite/ld-plugin/plugin-21.d, * testsuite/ld-plugin/plugin-22.d,
	* testsuite/ld-plugin/plugin-23.d, * testsuite/ld-plugin/plugin-6.d,
	* testsuite/ld-plugin/plugin-7.d, * testsuite/ld-plugin/plugin-8.d,
	* testsuite/ld-powerpc/aix-weak-3-32.d,
	* testsuite/ld-powerpc/aix-weak-3-64.d,
	* testsuite/ld-powerpc/vxworks1-static.d,
	* testsuite/ld-sh/vxworks1-static.d,
	* testsuite/ld-sparc/vxworks1-static.d,
	* testsuite/ld-undefined/undefined.exp,
	* testsuite/ld-x86-64/pie1.d: Update for changed errors and warnings.
	* testsuite/ld-elf/warn1.d, * testsuite/ld-elf/warn2.d: Correct regex.
2018-02-26 10:51:12 +10:30
Alan Modra 219d1afa89 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
Alan Modra 2571583aed Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
Alan Modra 6f2750feaf Copyright update for binutils 2016-01-01 23:00:01 +10:30
H.J. Lu 5fe2850dd9 Set DF_1_PIE in gld${EMULATION_NAME}_after_parse
We can't add OPTION_PIE to gld${EMULATION_NAME}_handle_option since
it has been handled in parse_args in lexsup.c.  This patch moves
setting DF_1_PIE to gld${EMULATION_NAME}_after_parse.

ld/

	* emultempl/alphaelf.em (alpha_after_parse): Call
	gld${EMULATION_NAME}_after_parse instead of
	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/mipself.em (mips_after_parse): Likewise.
	* emultempl/nds32elf.em (nds32_elf_after_parse): Likewise.
	* emultempl/elf32.em: Don't include ldlex.h.
	(gld${EMULATION_NAME}_after_parse): New function.
	(gld${EMULATION_NAME}_handle_option) [GENERATE_PIE_SCRIPT]
	<OPTION_PIE>: Removed.
	(ld_${EMULATION_NAME}_emulation): Replace after_parse_default
	with gld${EMULATION_NAME}_after_parse.
	* emultempl/ia64elf.em (gld${EMULATION_NAME}_after_parse):
	Renamed to ...
	(ia64elf_after_parse): This.  Call
	gld${EMULATION_NAME}_after_parse instead of after_parse_default.
	(LDEMUL_AFTER_PARSE): Replace gld${EMULATION_NAME}_after_parse
	with ia64elf_after_parse.

ld/testsuite/

	* ld-elf/pie.d: New test.
2015-09-22 06:08:55 -07:00
H.J. Lu 0e1862bb40 Add output_type to bfd_link_info
The "shared" field in bfd_link_info is set for both DSO and and PIE.
There are separate fields for executable and relocatable outputs.  This
patch adds an "output_type" field:

enum output_type
{
  type_unknown = 0,
  type_executable,
  type_dll,
  type_relocatable
};

and a "pic" field to bfd_link_info to replace shared, executable and
relocatable fields so that we can use the "output_type" field to check
for output type and the "pic" field check if output is PIC.  Macros,
bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic
and bfd_link_pie, are provided to check for output features.

bfd/

	* bfd/aoutx.h: Replace shared, executable, relocatable and pie
	fields with bfd_link_executable, bfd_link_dll,
	bfd_link_relocatable, bfd_link_pic and bfd_link_pie.
	* bfd/bout.c: Likewise.
	* bfd/coff-alpha.c: Likewise.
	* bfd/coff-arm.c: Likewise.
	* bfd/coff-i386.c: Likewise.
	* bfd/coff-i960.c: Likewise.
	* bfd/coff-m68k.c: Likewise.
	* bfd/coff-mcore.c: Likewise.
	* bfd/coff-mips.c: Likewise.
	* bfd/coff-ppc.c: Likewise.
	* bfd/coff-rs6000.c: Likewise.
	* bfd/coff-sh.c: Likewise.
	* bfd/coff-tic80.c: Likewise.
	* bfd/coff-x86_64.c: Likewise.
	* bfd/coff64-rs6000.c: Likewise.
	* bfd/coffgen.c: Likewise.
	* bfd/cofflink.c: Likewise.
	* bfd/ecoff.c: Likewise.
	* bfd/ecofflink.c: Likewise.
	* bfd/elf-bfd.h: Likewise.
	* bfd/elf-eh-frame.c: Likewise.
	* bfd/elf-ifunc.c: Likewise.
	* bfd/elf-m10200.c: Likewise.
	* bfd/elf-m10300.c: Likewise.
	* bfd/elf-s390-common.c: Likewise.
	* bfd/elf-vxworks.c: Likewise.
	* bfd/elf.c: Likewise.
	* bfd/elf32-arm.c: Likewise.
	* bfd/elf32-avr.c: Likewise.
	* bfd/elf32-bfin.c: Likewise.
	* bfd/elf32-cr16.c: Likewise.
	* bfd/elf32-cr16c.c: Likewise.
	* bfd/elf32-cris.c: Likewise.
	* bfd/elf32-crx.c: Likewise.
	* bfd/elf32-d10v.c: Likewise.
	* bfd/elf32-dlx.c: Likewise.
	* bfd/elf32-epiphany.c: Likewise.
	* bfd/elf32-fr30.c: Likewise.
	* bfd/elf32-frv.c: Likewise.
	* bfd/elf32-ft32.c: Likewise.
	* bfd/elf32-h8300.c: Likewise.
	* bfd/elf32-hppa.c: Likewise.
	* bfd/elf32-i370.c: Likewise.
	* bfd/elf32-i386.c: Likewise.
	* bfd/elf32-i860.c: Likewise.
	* bfd/elf32-ip2k.c: Likewise.
	* bfd/elf32-iq2000.c: Likewise.
	* bfd/elf32-lm32.c: Likewise.
	* bfd/elf32-m32c.c: Likewise.
	* bfd/elf32-m32r.c: Likewise.
	* bfd/elf32-m68hc11.c: Likewise.
	* bfd/elf32-m68hc1x.c: Likewise.
	* bfd/elf32-m68k.c: Likewise.
	* bfd/elf32-mcore.c: Likewise.
	* bfd/elf32-mep.c: Likewise.
	* bfd/elf32-metag.c: Likewise.
	* bfd/elf32-microblaze.c: Likewise.
	* bfd/elf32-moxie.c: Likewise.
	* bfd/elf32-msp430.c: Likewise.
	* bfd/elf32-mt.c: Likewise.
	* bfd/elf32-nds32.c: Likewise.
	* bfd/elf32-nios2.c: Likewise.
	* bfd/elf32-or1k.c: Likewise.
	* bfd/elf32-ppc.c: Likewise.
	* bfd/elf32-rl78.c: Likewise.
	* bfd/elf32-rx.c: Likewise.
	* bfd/elf32-s390.c: Likewise.
	* bfd/elf32-score.c: Likewise.
	* bfd/elf32-score7.c: Likewise.
	* bfd/elf32-sh-symbian.c: Likewise.
	* bfd/elf32-sh.c: Likewise.
	* bfd/elf32-sh64.c: Likewise.
	* bfd/elf32-spu.c: Likewise.
	* bfd/elf32-tic6x.c: Likewise.
	* bfd/elf32-tilepro.c: Likewise.
	* bfd/elf32-v850.c: Likewise.
	* bfd/elf32-vax.c: Likewise.
	* bfd/elf32-visium.c: Likewise.
	* bfd/elf32-xc16x.c: Likewise.
	* bfd/elf32-xstormy16.c: Likewise.
	* bfd/elf32-xtensa.c: Likewise.
	* bfd/elf64-alpha.c: Likewise.
	* bfd/elf64-hppa.c: Likewise.
	* bfd/elf64-ia64-vms.c: Likewise.
	* bfd/elf64-mmix.c: Likewise.
	* bfd/elf64-ppc.c: Likewise.
	* bfd/elf64-s390.c: Likewise.
	* bfd/elf64-sh64.c: Likewise.
	* bfd/elf64-x86-64.c: Likewise.
	* bfd/elflink.c: Likewise.
	* bfd/elfnn-aarch64.c: Likewise.
	* bfd/elfnn-ia64.c: Likewise.
	* bfd/elfxx-mips.c: Likewise.
	* bfd/elfxx-sparc.c: Likewise.
	* bfd/elfxx-tilegx.c: Likewise.
	* bfd/i386linux.c: Likewise.
	* bfd/linker.c: Likewise.
	* bfd/m68klinux.c: Likewise.
	* bfd/pdp11.c: Likewise.
	* bfd/pe-mips.c: Likewise.
	* bfd/peXXigen.c: Likewise.
	* bfd/reloc.c: Likewise.
	* bfd/reloc16.c: Likewise.
	* bfd/sparclinux.c: Likewise.
	* bfd/sunos.c: Likewise.
	* bfd/vms-alpha.c: Likewise.
	* bfd/xcofflink.c: Likewise.

include/

	* include/bfdlink.h (output_type): New enum.
	(bfd_link_executable): New macro.
	(bfd_link_dll): Likewise.
	(bfd_link_relocatable): Likewise.
	(bfd_link_pic): Likewise.
	(bfd_link_pie): Likewise.
	(bfd_link_info): Remove shared, executable, pie and relocatable.
	Add output_type and pic.

ld/

	* ld/ldctor.c: Replace shared, executable, relocatable and pie
	fields with bfd_link_executable, bfd_link_dll,
	bfd_link_relocatable, bfd_link_pic and bfd_link_pie.
	* ld/ldemul.c: Likewise.
	* ld/ldfile.c: Likewise.
	* ld/ldlang.c: Likewise.
	* ld/ldmain.c: Likewise.
	* ld/ldwrite.c: Likewise.
	* ld/lexsup.c: Likewise.
	* ld/pe-dll.c: Likewise.
	* ld/plugin.c: Likewise.
	* ld/emultempl/aarch64elf.em: Likewise.
	* ld/emultempl/aix.em: Likewise.
	* ld/emultempl/alphaelf.em: Likewise.
	* ld/emultempl/armcoff.em: Likewise.
	* ld/emultempl/armelf.em: Likewise.
	* ld/emultempl/avrelf.em: Likewise.
	* ld/emultempl/beos.em: Likewise.
	* ld/emultempl/cr16elf.em: Likewise.
	* ld/emultempl/elf-generic.em: Likewise.
	* ld/emultempl/elf32.em: Likewise.
	* ld/emultempl/genelf.em: Likewise.
	* ld/emultempl/generic.em: Likewise.
	* ld/emultempl/gld960.em: Likewise.
	* ld/emultempl/gld960c.em: Likewise.
	* ld/emultempl/hppaelf.em: Likewise.
	* ld/emultempl/irix.em: Likewise.
	* ld/emultempl/linux.em: Likewise.
	* ld/emultempl/lnk960.em: Likewise.
	* ld/emultempl/m68hc1xelf.em: Likewise.
	* ld/emultempl/m68kcoff.em: Likewise.
	* ld/emultempl/m68kelf.em: Likewise.
	* ld/emultempl/metagelf.em: Likewise.
	* ld/emultempl/mipself.em: Likewise.
	* ld/emultempl/mmo.em: Likewise.
	* ld/emultempl/msp430.em: Likewise.
	* ld/emultempl/nds32elf.em: Likewise.
	* ld/emultempl/needrelax.em: Likewise.
	* ld/emultempl/nios2elf.em: Likewise.
	* ld/emultempl/pe.em: Likewise.
	* ld/emultempl/pep.em: Likewise.
	* ld/emultempl/ppc32elf.em: Likewise.
	* ld/emultempl/ppc64elf.em: Likewise.
	* ld/emultempl/sh64elf.em: Likewise.
	* ld/emultempl/solaris2.em: Likewise.
	* ld/emultempl/spuelf.em: Likewise.
	* ld/emultempl/sunos.em: Likewise.
	* ld/emultempl/tic6xdsbt.em: Likewise.
	* ld/emultempl/ticoff.em: Likewise.
	* ld/emultempl/v850elf.em: Likewise.
	* ld/emultempl/vms.em: Likewise.
	* ld/emultempl/vxworks.em: Likewise.
2015-08-18 05:51:19 -07:00
Alan Modra b90efa5b79 ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
Richard Henderson d1c109de72 Fix alpha-elf relaxation
ld/
	* emultempl/alphaelf.em (alpha_after_parse): Enable 2 relax passes.
bfd/
	* elf64-alpha.c (elf64_alpha_size_got_sections): New may_merge
	parameter; honor it and disable got merging when false.
	(elf64_alpha_relax_got_load): Do not relax to GPREL relocs during
	the first pass of relaxation.
	(elf64_alpha_relax_with_lituse): Likewise.  Move relaxed relocs to
	the end of the LITERAL+LITUSE chain.
	(elf64_alpha_relax_section): Only process LITERAL relocs during the
	second pass of relaxation.
2014-04-21 08:14:18 -07:00
Alan Modra 4b95cf5c0c Update copyright years 2014-03-05 22:16:15 +10:30
Alan Modra eeaa4577b6 Revert 2013-02-04, 2013-01-22 and 2013-01-21 changes. 2013-02-05 21:47:32 +00:00
H.J. Lu 663fa5434e Don't enable new dtags by default with -rpath
ld/

2013-02-04  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/15096
	* emultempl/alphaelf.em (alpha_after_parse): Call
	gld${EMULATION_NAME}_after_parse instead of 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/mipself.em (mips_after_parse): Likewise.

	* emultempl/ia64elf.em (gld${EMULATION_NAME}_after_parse): Renamed
	to ...
	(gld_${EMULATION_NAME}_after_parse): This.  Call
	gld${EMULATION_NAME}_after_parse instead of after_parse_default.
	(LDEMUL_AFTER_PARSE): Set to gld_${EMULATION_NAME}_after_parse.

	* emultempl/elf32.em (new_dtags_set): New variable.
	(gld${EMULATION_NAME}_before_parse): Don't set link_info.new_dtags
	here.
	(gld${EMULATION_NAME}_after_parse): New function.
	(ld_${EMULATION_NAME}_emulation): Replace after_parse_default'
	with gld${EMULATION_NAME}_after_parse.
	(gld${EMULATION_NAME}_handle_option): Set new_dtags_set to TRUE
	when setting link_info.new_dtags.

ld/testsuite/

2013-02-04  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/15096
	* ld-elf/new-dtags-1.d: New test.
	* ld-elf/new-dtags-2.d: Likewise.
	* ld-elf/new-dtags-3.d: Likewise.
	* ld-elf/new-dtags-4.d: Likewise.
	* ld-elf/new-dtags-5.d: Likewise.
	* ld-elf/new-dtags-6.d: Likewise.
	* ld-elf/new-dtags-7.d: Likewise.
	* ld-elf/new-dtags-8.d: Likewise.
2013-02-05 01:36:05 +00:00
Nick Clifton 4dfe6ac6fe * elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add
entries for other architectures.
        (struct elf_link_hash_table): Add hash_table_id field.
        (elf_hash_table_id): New accessor macro.
        * elflink.c (_bfd_elf_link_hash_table_init): Add target_id
        parameter.
        * elf-m10300.c (elf32_mn10300_hash_table): Check table id before
        returning cast pointer.
        (elf32_mn10300_link_hash_table_create): Identify new table as
        containing MN10300 extensions.
        (mn10300_elf_relax_section): Check pointer returned by
        elf32_mn10300_hash_table.
        * elf32-arm.c: Likewise, except using ARM extensions.
        * elf32-avr.c: Likewise, except using AVR extensions.
        * elf32-bfin.c: Likewise, except using BFIN extensions.
        * elf32-cris.c: Likewise, except using CRIS extensions.
        * elf32-frv.c: Likewise, except using FRV extensions.
        * elf32-hppa.c: Likewise, except using HPPA32 extensions.
        * elf32-i386.c: Likewise, except using I386 extensions.
        * elf32-lm32.c: Likewise, except using LM32 extensions.
        * elf32-m32r.c: Likewise, except using M32RM extensions.
        * elf32-m68hc11.c: Likewise, except using M68HC11 extensions.
        * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions.
        * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions.
        * elf32-m68k.c: Likewise, except using M68K extensions.
        * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions.
        * elf32-ppc.c: Likewise, except using PPC32 extensions.
        * elf32-s390.c: Likewise, except using S390 extensions.
        * elf32-sh.c: Likewise, except using SH extensions.
        * elf32-spu.c: Likewise, except using SPU extensions.
        * elf32-xtensa.c: Likewise, except using XTENSA extensions.
        * elf64-alpha.c: Likewise, except using ALPHA extensions.
        * elf64-hppa.c: Likewise, except using HPPA64 extensions.
        * elf64-ppc.c: Likewise, except using PPC64 extensions.
        * elf64-s390.c: Likewise, except using S390 extensions.
        * elf64-x86-64.c: Likewise, except using X86_64 extensions.
        * elfxx-ia64.c: Likewise, except using IA64 extensions.
        * elfxx-mips.c: Likewise, except using MIPS extensions.
        * elfxx-sparc.c: Likewise, except using SPARC extensions.
        * elfxx-sparc.h: Likewise, except using SPARC extensions.
        * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete
        redundant structure.
        (elf32_cr16_hash_table): Delete unused macro.
        (elf32_cr16_link_hash_traverse): Delete unused macro.
        * elf32-score.c: Likewise.
        * elf32-score7.c: Likewise.
        * elf32-vax.c: Likewise.
        * elf64-sh64.c: Likewise.

        * emultempl/alphaelf.em: Update value expected from elf_object_id.
        * emultempl/hppaelf.em: Likewise.
        * emultempl/mipself.em: Likewise.
        * emultempl/ppc32elf.em: Likewise.
        * emultempl/ppc64elf.em: Likewise.
2010-02-04 09:16:43 +00:00
Nick Clifton 28d5f67740 PR ld/10956
* ld.h (struct args_type): Rename 'relax' field to
        'disable_target_specific_optimizations' and turn it into a
        tri-state variable.
        (RELAXATION_DISABLED_BY_DEFAULT): New macro.
        (RELAXATION_DISABLED_BY_USER): New macro.
        (RELAXATION_ENABLED): New macro.
        (DISABLE_RELAXATION): New macro.
        (ENABLE_RELAXATION): New macro.
        * lexsup (enum option_values): Add OPTION_NO_RELAX.
        (struct ld_options): Add --no-relax.
        (parse_args): Handle OPTION_NO_RELAX.  Use DISABLE_RELAXATION and
        ENABLE_RELAXATION macros.
        * ldlang.c (lang_relax_sections): Use RELAXATION_ENABLED macro.
        (lang_process): Likewise.
        * ldmain.c (main): Initialise
        disable_target_specific_optimizations field.
        (multiple_definition): Use RELAXATION_ENABLED macro.
        * ld.texinfo: Document new command line option.
        * emultempl/alphaelf.em: Remove --no-relax option.
        (before_allocation): Test RELAXATION_DISABLED_BY_USER macro.
        Use ENABLE_RELAXATION macro.
        * emultempl/avrelf.em: (after_allocation): Test RELAXATION_ENABLED
        macro.
        * emultempl/cr16elf.em: Remove --no-relax option.
        (before_allocation): Test RELAXATION_DISABLED_BY_USER macro.
        Use ENABLE_RELAXATION macro.
        * emultempl/crxelf.em: Remove --no-relax option.
        (before_allocation): Test RELAXATION_DISABLED_BY_USER macro.
        Use ENABLE_RELAXATION macro.
        * emultempl/mmix-elfnmmo.em: (before_allocation): Use
        ENABLE_RELAXATION macro.
        * emultempl/needrelax.em: (before_allocation): Use
        ENABLE_RELAXATION macro.
        * emultempl/ppc32elf.em: (before_allocation): Test
        RELAXATION_DISABLED_BY_DEFAULT macro. Use
        ENABLE_RELAXATION macro.
        * emultempl/sh64elf.em: (before_allocation): Test
        RELAXATION_ENABLED macro. Use DISABLE_RELAXATION macro.
        * emultempl/xtensaelf.em: Remove --no-relax option.
        (before_allocation): Test RELAXATION_ENABLED macro.
        Use ENABLE_RELAXATION macro.
2009-11-26 13:45:25 +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 aa820537ea update copyright dates 2009-09-02 07:25:43 +00:00
Alan Modra eaeb0a9d5c PR 10474
* ldemul.c (after_allocation_default): Run lang_relax_sections.
	* ldlang.h (lang_relax_sections): Declare.
	* ldlang.c (relax_sections): Delete.
	(lang_relax_sections): New function.
	(lang_process): Don't relax directly from here.
	* emultempl/alphaelf.em (alpha_finish): Call finish_default.
	* emultempl/armelf.em (arm_elf_after_allocation): Delete.  Move body..
	(gld${EMULATION_NAME}_finish): ..to here.  Move existing code..
	(gld${EMULATION_NAME}_after_allocation): ..to here.  New function.
	(LDEMUL_AFTER_ALLOCATION): Update.
	* emultempl/avrelf.em (avr_elf_finish, LDEMUL_FINISH): Delete.
	(avr_elf_after_allocation): New function.
	(LDEMUL_AFTER_ALLOCATION): Define.
	* emultempl/elf-generic.em (gld${EMULATION_NAME}_map_segments): Call
	lang_relax_sections.
	* emultempl/elf32.em (gld${EMULATION_NAME}_finish): Delete.  Move..
	(gld${EMULATION_NAME}_after_allocation): ..code to here.  New function.
	(LDEMUL_AFTER_ALLOCATION, LDEMUL_FINISH): Update.
	* emultempl/genelf.em (gld${EMULATION_NAME}_finish): Delete.  Move..
	(gld${EMULATION_NAME}_after_allocation): ..code to here.  New function.
	(LDEMUL_FINISH): Delete.
	(LDEMUL_AFTER_ALLOCATION): Define.
	* emultempl/hppaelf.em (gld${EMULATION_NAME}_finish): Delete.  Move..
	(gld${EMULATION_NAME}_after_allocation): ..to here.  New function.
	(LDEMUL_FINISH): Delete.
	(LDEMUL_AFTER_ALLOCATION): Define.
	* emultempl/m68hc1xelf.em (m68hc11elf_finish): Delete.  Move..
	(m68hc11elf_after_allocation): ..to here.  New function.
	(LDEMUL_FINISH): Delete.
	(LDEMUL_AFTER_ALLOCATION): Define.
	* emultempl/m68kelf.em (m68k_elf_after_allocation): Call
	gld${EMULATION_NAME}_after_allocation.
	* emultempl/mmix-elfnmmo.em (mmix_after_allocation): Call
	gld${EMULATION_NAME}_after_allocation.
	* emultempl/mmo.em (mmo_finish): Delete.  Move body..
	(gld${EMULATION_NAME}_after_allocation): ..to here.  New function.
	(LDEMUL_FINISH): Define.
	* emultempl/ppc64elf.em (ppc_layout_sections_again): Set elf_gp.
	(gld${EMULATION_NAME}_finish): Move code sizing sections..
	(gld${EMULATION_NAME}_after_allocation): ..to here.
	* emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_after_allocation):
	Call gld${EMULATION_NAME}_after_allocation.
	* emultempl/spuelf.em (gld${EMULATION_NAME}_finish): Delete
	bfd_elf_discard_info and map_segments call.
2009-08-10 07:50:56 +00:00
Alan Modra 5503fea1b9 * emultempl/alphaelf.em (alpha_after_open): Use elf_object_id.
* emultempl/hppaelf.em (hppaelf_create_output_section_statements):
	Likewise.
	* emultempl/ppc64elf.em (ppc_create_output_section_statements):
	Likewise.
	* emultempl/ppc32elf.em (is_ppc_elf32_vec): Delete.  Replace all
	uses with..
	(is_ppc_elf): ..this new macro.
2008-02-15 09:03:02 +00:00
Alan Modra f13a99db51 include/
* bfdlink.h (struct bfd_link_hash_table): Delete creator field.
	(struct bfd_link_info): Add output_bfd.
bfd/
	* elflink.c: Replace all accesses to hash->creator field with
	output_bfd->xvec.
	* cofflink.c: Likewise.
	* coff-h8300.c: Likewise.
	* ecoff.c: Likewise.
	* elf32-m68hc1x.c: Likewise.
	* elf32-ppc.c: Likewise.
	* elf64-alpha.c: Likewise.
	* elf64-ppc.c: Likewise.
	* elf64-sparc.c: Likewise.
	* elfxx-mips.c: Likewise.
	* i386linux.c: Likewise.
	* m68klinux.c: Likewise.
	* sparclinux.c: Likewise.
	* sunos.c: Likewise.
	* xcofflink.c: Likewise.
	* linker.c: Likewise.
	(_bfd_link_hash_table_init): Don't store creator.
ld/
	* ldmain.h (output_bfd): Delete.
	* ldmain.c (output_bfd): Delete.
	Replace all occurrences of output_bfd with link_info.output_bfd.
	* ldcref.c: Likewise.
	* ldctor.c: Likewise.
	* ldemul.c: Likewise.
	* ldexp.c: Likewise.
	* ldfile.c: Likewise.
	* ldlang.c: Likewise.
	* ldmisc.c: Likewise.
	* ldwrite.c: Likewise.
	* pe-dll.c: Likewise.
	* emultempl/aix.em: Likewise.
	* emultempl/alphaelf.em: Likewise.
	* emultempl/armcoff.em: Likewise.
	* emultempl/armelf.em: Likewise.
	* emultempl/avrelf.em: Likewise.
	* emultempl/beos.em: Likewise.
	* emultempl/elf-generic.em: Likewise.
	* emultempl/elf32.em: Likewise.
	* emultempl/gld960.em: Likewise.
	* emultempl/hppaelf.em: Likewise.
	* emultempl/irix.em: Likewise.
	* emultempl/linux.em: Likewise.
	* emultempl/lnk960.em: Likewise.
	* emultempl/m68hc1xelf.em: Likewise.
	* emultempl/mmix-elfnmmo.em: Likewise.
	* emultempl/mmo.em: Likewise.
	* emultempl/pe.em: Likewise.
	* emultempl/pep.em: Likewise.
	* emultempl/ppc32elf.em: Likewise.
	* emultempl/ppc64elf.em: Likewise.
	* emultempl/scoreelf.em: Likewise.
	* emultempl/sh64elf.em: Likewise.
	* emultempl/spuelf.em: Likewise.
	* emultempl/sunos.em: Likewise.
	* emultempl/vanilla.em: Likewise.
	* emultempl/vxworks.em: Likewise.
	* emultempl/xtensaelf.em: Likewise.
	* emultempl/z80.em: Likewise.
	* ldlang.c (open_output): Don't return output, instead write
	link_info_output_bfd directly.
	* emultempl/alphaelf.em: Replace occurrences of link_info.hash->creator
	with link_info.output_bfd->xvec.
	* emultempl/hppaelf.em: Likewise.
	* emultempl/ppc32elf.em: Likewise.
	* emultempl/ppc64elf.em: Likewise.
	* emultempl/spuelf.em: Likewise.
2008-02-15 03:35:53 +00:00
Alan Modra 442996eee8 * emultempl/alphaelf.em: Format option help.
* emultempl/armcoff.em: Likewise.
	* emultempl/armelf.em: Likewise.
	* emultempl/avrelf.em: Likewise.
	* emultempl/elf32.em: Likewise.
	* emultempl/hppaelf.em: Likewise.
	* emultempl/ia64elf.em: Likewise.
	* emultempl/m68hc1xelf.em: Likewise.
	* emultempl/ppc32elf.em: Likewise.
	* emultempl/ppc64elf.em: Likewise.
	* emultempl/scoreelf.em: Likewise.
	* emultempl/spuelf.em: Likewise.
	* emultempl/ticoff.em: Likewise.
	* emultempl/vxworks.em: Likewise.
	* emultempl/xtensaelf.em: Likewise.
2007-08-17 13:50:48 +00:00
Roland McGrath 92b93329b5 2007-07-19 Roland McGrath <roland@redhat.com>
* genscripts.sh (source_em, fragment): New sh functions.
	Truncate e${EMULATION_NAME}.c file before .em script fills it.
	Use source_em in place of . for the .em script.
	* emultempl/generic.em: Use fragment and source_em functions.
	* emultempl/aix.em: Likewise.
	* emultempl/alphaelf.em: Likewise.
	* emultempl/armcoff.em: Likewise.
	* emultempl/armelf.em: Likewise.
	* emultempl/avrelf.em: Likewise.
	* emultempl/beos.em: Likewise.
	* emultempl/cr16elf.em: Likewise.
	* emultempl/crxelf.em: Likewise.
	* emultempl/elf-generic.em: Likewise.
	* emultempl/elf32.em: Likewise.
	* emultempl/genelf.em: Likewise.
	* emultempl/gld960.em: Likewise.
	* emultempl/gld960c.em: Likewise.
	* emultempl/hppaelf.em: Likewise.
	* emultempl/ia64elf.em: Likewise.
	* emultempl/irix.em: Likewise.
	* emultempl/linux.em: Likewise.
	* emultempl/lnk960.em: Likewise.
	* emultempl/m68hc1xelf.em: Likewise.
	* emultempl/m68kcoff.em: Likewise.
	* emultempl/m68kelf.em: Likewise.
	* emultempl/mipsecoff.em: Likewise.
	* emultempl/mipself.em: Likewise.
	* emultempl/mmix-elfnmmo.em: Likewise.
	* emultempl/mmixelf.em: Likewise.
	* emultempl/mmo.em: Likewise.
	* emultempl/needrelax.em: Likewise.
	* emultempl/netbsd.em: Likewise.
	* emultempl/pe.em: Likewise.
	* emultempl/pep.em: Likewise.
	* emultempl/ppc32elf.em: Likewise.
	* emultempl/ppc64elf.em: Likewise.
	* emultempl/scoreelf.em: Likewise.
	* emultempl/sh64elf.em: Likewise.
	* emultempl/spuelf.em: Likewise.
	* emultempl/sunos.em: Likewise.
	* emultempl/ticoff.em: Likewise.
	* emultempl/vanilla.em: Likewise.
	* emultempl/vxworks.em: Likewise.
	* emultempl/xtensaelf.em: Likewise.
	* emultempl/z80.em: Likewise.
2007-07-19 19:56:10 +00:00
Nick Clifton f96b4a7b0f Update sources to GPLv3 2007-07-06 14:09:45 +00:00
Richard Henderson 8d6d53d427 * emulparams/elf64alpha.sh (PLT): New.
(TEXT_PLT): New.
        * emultempl/alphaelf.em (disable_relaxation): New.
        (limit_32bit): Rename from elf64alpha_32bit; update all users.
        (elf64_alpha_use_secureplt): Declare.
        (bfd_elf64_alpha_vec, bfd_elf64_alpha_freebsd_vec): Declare.
        (alpha_after_open): New.
        (alpha_before_allocation): New.
        (OPTION_NO_RELAX, OPTION_SECUREPLT, OPTION_NO_SECUREPLT): New.
        (PARSE_AND_LIST_LONGOPTS): Include them.
        (PARSE_AND_LIST_OPTIONS): Likewise.
        (PARSE_AND_LIST_ARGS_CASES): Likewise.
        (LDEMUL_AFTER_OPEN, LDEMUL_BEFORE_ALLOCATION): New.
        * scripttempl/elf.sc (TEXT_PLT): New.
        (PLT): Use it.
2005-05-29 23:16:09 +00:00
Nick Clifton 75be928bd2 Update FSF addresses 2005-05-12 07:32:09 +00:00
Alan Modra aef6203bd6 update copyright dates 2005-03-03 11:52:12 +00:00
Nick Clifton 7a5df8d098 emultempl/alphaelf.em (alpha_after_parse): Add extra, NULL, parameter to
invocation of lang_section_start.
emultempl/aix.em (_handle_option): Likewise.

Makefile.am (eelf64alpha.c, eelf64alpha_fbsd.c,	eelf64alpha_nbsd.c): Add
  dependency upon emultempl/alphaelf.em.
Makefile.in: Regenerate.
2004-10-27 15:53:21 +00:00
Alan Modra 0c7a8e5acd * emultempl/aix.em: Convert to C90, remove unnecessary prototypes
and casts.  Replace PTR with void *.  Formatting.
	* emultempl/alphaelf.em: Likewise
	* emultempl/armcoff.em: Likewise
	* emultempl/armelf.em: Likewise
	* emultempl/armelf_oabi.em: Likewise
	* emultempl/beos.em: Likewise
	* emultempl/elf32.em: Likewise
	* emultempl/generic.em: Likewise
	* emultempl/gld960.em: Likewise
	* emultempl/gld960c.em: Likewise
	* emultempl/hppaelf.em: Likewise
	* emultempl/linux.em: Likewise
	* emultempl/lnk960.em: Likewise
	* emultempl/m68hc1xelf.em: Likewise
	* emultempl/m68kcoff.em: Likewise
	* emultempl/m68kelf.em: Likewise
	* emultempl/mipsecoff.em: Likewise
	* emultempl/mipself.em: Likewise
	* emultempl/mmix-elfnmmo.em: Likewise
	* emultempl/mmixelf.em: Likewise
	* emultempl/mmo.em: Likewise
	* emultempl/needrelax.em: Likewise
	* emultempl/netbsd.em: Likewise
	* emultempl/pe.em: Likewise
	* emultempl/sh64elf.em: Likewise
	* emultempl/sunos.em: Likewise
	* emultempl/ticoff.em: Likewise
	* emultempl/vanilla.em: Likewise
	* emultempl/xtensaelf.em: Likewise
	* Makefile.am: Correct dependencies.
	* Makefile.in: Regenerate.
2003-06-27 00:38:25 +00:00
Alan Modra 1049f94e8e Correct spelling of "relocatable". 2003-06-25 06:40:27 +00:00
Alan Modra c279ca3ee9 * emulparams/elf64alpha.sh (EXTRA_EM_FILE): Define.
(PARSE_AND_LIST_PROLOGUE, PARSE_AND_LIST_LONGOPTS,
	PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_ARGS_CASES,
	PARSE_AND_LIST_EPILOGUE): Don't define.
	* emultempl/alphaelf.em: New file.
2003-03-02 22:07:10 +00:00