summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/ld
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2004-06-16 05:45:41 +0000
committerobrien <obrien@FreeBSD.org>2004-06-16 05:45:41 +0000
commit2504df11e1275f63f4c53377bf91eee996360cb5 (patch)
tree04848ae93445e503c4190ca1748abe15eabc9e11 /contrib/binutils/ld
parent6b4c52b743ec5e2e9f65d42b517feefad5017901 (diff)
downloadFreeBSD-src-2504df11e1275f63f4c53377bf91eee996360cb5.zip
FreeBSD-src-2504df11e1275f63f4c53377bf91eee996360cb5.tar.gz
Import of Binutils from the FSF 2.15 branch (just post-.0 release).
These bits are taken from the FSF anoncvs repo on 23-May-2004 04:41:00 UTC.
Diffstat (limited to 'contrib/binutils/ld')
-rw-r--r--contrib/binutils/ld/ChangeLog4975
-rw-r--r--contrib/binutils/ld/ChangeLog-00013376
-rw-r--r--contrib/binutils/ld/ChangeLog-02033580
-rw-r--r--contrib/binutils/ld/ChangeLog-91972
-rw-r--r--contrib/binutils/ld/Makefile.am542
-rw-r--r--contrib/binutils/ld/Makefile.in547
-rw-r--r--contrib/binutils/ld/NEWS45
-rw-r--r--contrib/binutils/ld/README3
-rw-r--r--contrib/binutils/ld/aclocal.m418
-rw-r--r--contrib/binutils/ld/config.in9
-rwxr-xr-xcontrib/binutils/ld/configure972
-rw-r--r--contrib/binutils/ld/configure.host91
-rw-r--r--contrib/binutils/ld/configure.in44
-rw-r--r--contrib/binutils/ld/configure.tgt261
-rw-r--r--contrib/binutils/ld/deffile.h57
-rw-r--r--contrib/binutils/ld/deffilep.y384
-rw-r--r--contrib/binutils/ld/dep-in.sed1
-rw-r--r--contrib/binutils/ld/emulparams/arcelf.sh11
-rw-r--r--contrib/binutils/ld/emulparams/armelf.sh4
-rw-r--r--contrib/binutils/ld/emulparams/armelf_linux.sh5
-rw-r--r--contrib/binutils/ld/emulparams/armelf_oabi.sh3
-rw-r--r--contrib/binutils/ld/emulparams/armpe.sh4
-rw-r--r--contrib/binutils/ld/emulparams/elf32_sparc.sh1
-rw-r--r--contrib/binutils/ld/emulparams/elf32b4300.sh10
-rw-r--r--contrib/binutils/ld/emulparams/elf32bmip.sh37
-rwxr-xr-xcontrib/binutils/ld/emulparams/elf32bmipn32.sh22
-rwxr-xr-xcontrib/binutils/ld/emulparams/elf32bsmip.sh3
-rw-r--r--contrib/binutils/ld/emulparams/elf32ebmip.sh2
-rw-r--r--contrib/binutils/ld/emulparams/elf32elmip.sh2
-rw-r--r--contrib/binutils/ld/emulparams/elf32l4300.sh4
-rw-r--r--contrib/binutils/ld/emulparams/elf32lmip.sh7
-rwxr-xr-xcontrib/binutils/ld/emulparams/elf32lsmip.sh2
-rw-r--r--contrib/binutils/ld/emulparams/elf32ppc.sh29
-rw-r--r--contrib/binutils/ld/emulparams/elf64_ia64.sh18
-rw-r--r--contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh2
-rw-r--r--contrib/binutils/ld/emulparams/elf64_s390.sh35
-rw-r--r--contrib/binutils/ld/emulparams/elf64_sparc.sh45
-rw-r--r--contrib/binutils/ld/emulparams/elf64alpha.sh53
-rwxr-xr-xcontrib/binutils/ld/emulparams/elf64bmip.sh23
-rw-r--r--contrib/binutils/ld/emulparams/elf64ppc.sh44
-rw-r--r--contrib/binutils/ld/emulparams/elf_i386.sh1
-rw-r--r--contrib/binutils/ld/emulparams/elf_s390.sh2
-rw-r--r--contrib/binutils/ld/emulparams/elf_x86_64.sh34
-rw-r--r--contrib/binutils/ld/emulparams/sh.sh8
-rw-r--r--contrib/binutils/ld/emulparams/shl.sh2
-rwxr-xr-xcontrib/binutils/ld/emulparams/shlelf.sh2
-rw-r--r--contrib/binutils/ld/emulparams/vanilla.sh4
-rw-r--r--contrib/binutils/ld/emulparams/vsta.sh8
-rw-r--r--contrib/binutils/ld/emultempl/alphaelf.em80
-rw-r--r--contrib/binutils/ld/emultempl/armcoff.em134
-rw-r--r--contrib/binutils/ld/emultempl/armelf.em66
-rw-r--r--contrib/binutils/ld/emultempl/armelf_oabi.em54
-rw-r--r--contrib/binutils/ld/emultempl/elf32.em666
-rw-r--r--contrib/binutils/ld/emultempl/generic.em46
-rw-r--r--contrib/binutils/ld/emultempl/ia64elf.em62
-rw-r--r--contrib/binutils/ld/emultempl/linux.em90
-rw-r--r--contrib/binutils/ld/emultempl/needrelax.em10
-rw-r--r--contrib/binutils/ld/emultempl/netbsd.em13
-rw-r--r--contrib/binutils/ld/emultempl/pe.em982
-rw-r--r--contrib/binutils/ld/emultempl/ppc64elf.em279
-rw-r--r--contrib/binutils/ld/emultempl/sunos.em185
-rw-r--r--contrib/binutils/ld/emultempl/ticoff.em101
-rw-r--r--contrib/binutils/ld/emultempl/vanilla.em19
-rw-r--r--contrib/binutils/ld/fdl.texi367
-rw-r--r--contrib/binutils/ld/gen-doc.texi5
-rwxr-xr-xcontrib/binutils/ld/genscripts.sh231
-rw-r--r--contrib/binutils/ld/h8-doc.texi2
-rw-r--r--contrib/binutils/ld/ld.1367
-rw-r--r--contrib/binutils/ld/ld.h103
-rw-r--r--contrib/binutils/ld/ld.texinfo1465
-rw-r--r--contrib/binutils/ld/ldcref.c152
-rw-r--r--contrib/binutils/ld/ldctor.c69
-rw-r--r--contrib/binutils/ld/ldctor.h13
-rw-r--r--contrib/binutils/ld/ldemul.c136
-rw-r--r--contrib/binutils/ld/ldemul.h173
-rw-r--r--contrib/binutils/ld/ldexp.c406
-rw-r--r--contrib/binutils/ld/ldexp.h89
-rw-r--r--contrib/binutils/ld/ldfile.c279
-rw-r--r--contrib/binutils/ld/ldfile.h42
-rw-r--r--contrib/binutils/ld/ldgram.y168
-rw-r--r--contrib/binutils/ld/ldint.texinfo4
-rw-r--r--contrib/binutils/ld/ldlang.c2224
-rw-r--r--contrib/binutils/ld/ldlang.h405
-rw-r--r--contrib/binutils/ld/ldlex.h34
-rw-r--r--contrib/binutils/ld/ldlex.l140
-rw-r--r--contrib/binutils/ld/ldmain.c781
-rw-r--r--contrib/binutils/ld/ldmain.h23
-rw-r--r--contrib/binutils/ld/ldmisc.c244
-rw-r--r--contrib/binutils/ld/ldmisc.h27
-rw-r--r--contrib/binutils/ld/ldver.c4
-rw-r--r--contrib/binutils/ld/ldver.h4
-rw-r--r--contrib/binutils/ld/ldver.texi1
-rw-r--r--contrib/binutils/ld/ldwrite.c133
-rw-r--r--contrib/binutils/ld/ldwrite.h7
-rw-r--r--contrib/binutils/ld/lexsup.c563
-rw-r--r--contrib/binutils/ld/mri.c126
-rw-r--r--contrib/binutils/ld/mri.h28
-rw-r--r--contrib/binutils/ld/pe-dll.c810
-rw-r--r--contrib/binutils/ld/pe-dll.h42
-rw-r--r--contrib/binutils/ld/scripttempl/armcoff.sc4
-rw-r--r--contrib/binutils/ld/scripttempl/elf.sc27
-rw-r--r--contrib/binutils/ld/scripttempl/pe.sc15
-rw-r--r--contrib/binutils/ld/sysdep.h29
103 files changed, 16744 insertions, 11119 deletions
diff --git a/contrib/binutils/ld/ChangeLog b/contrib/binutils/ld/ChangeLog
index 428de76..4b3c1f9 100644
--- a/contrib/binutils/ld/ChangeLog
+++ b/contrib/binutils/ld/ChangeLog
@@ -1,4802 +1,319 @@
-2002-11-27 David O'Brien <obrien@FreeBSD.org>
+2004-05-13 Joel Sherrill <joel@oarcorp.com>
- * configure.host: Fix generic FreeBSD configuration entry.
+ * configure.tgt (or32-*-rtems*): Switch to elf and
+ support versioned targets.
-2002-11-20 Alan Modra <amodra@bigpond.net.au>
+2004-05-13 Nick Clifton <nickc@redhat.com>
- * emulparams/elf64ppc.sh (DATA_ADDR): Don't define.
-
-2002-10-30 Daniel Jacobowitz <drow@mvista.com>
-
- * ld.1: Regenerated.
- * ldgram.c: Regenerated.
- * po/ld.pot: Regenerated.
-
-2002-10-29 Daniel Jacobowitz <drow@mvista.com>
-
- * emultempl/aix.em: Use include <> for generated headers.
- * emultempl/beos.em: Likewise.
- * emultempl/elf32.em: Likewise.
- * emultempl/pe.em: Likewise.
- * ldctor.c: Likewise.
- * ldexp.c: Likewise.
- * ldfile.c: Likewise.
- * ldlang.c: Likewise.
- * ldlex.c: Likewise.
- * ldlex.l: Likewise.
- * ldmain.c: Likewise.
- * ldmisc.c: Likewise.
- * ldwrite.c: Likewise.
- * lexsup.c: Likewise.
- * mri.c: Likewise.
- * pe-dll.c: Likewise.
-
-2002-10-28 Daniel Jacobowitz <drow@mvista.com>
-
- Merge from mainline:
- 2002-10-23 Jakub Jelinek <jakub@redhat.com>
- * emultempl/elf32.em (place_orphan): Don't put non-allocated .rel*
- sections into .rel{,a}.dyn.
-
- 2002-10-21 Danny Smith <dannysmith@users.sourceforeg.net>
- * scripttempl/pe.sc (__RUNTIME_PSEUDO_RELOC_LIST__,
- __RUNTIME_PSEUDO_RELOC_LIST_END__): Add only when relocating.
-
- 2002-10-16 Jakub Jelinek <jakub@redhat.com>
- * configure.tgt (s390x-*-linux*): Add elf_s390 emulation.
- (s390-*-linux*): Add elf64_s390 emulation if want64.
- * emulparams/elf64_sparc.sh (LIB_PATH): Update to match 2002-05-22
- genscript.sh changes.
- * emulparams/elf_x86_64.sh (LIB_PATH): Likewise.
- * emulparams/elf64_s390.sh (LIB_PATH): Set up native 64 bit dirs.
-
- 2002-10-10 Jakub Jelinek <jakub@redhat.com>
- * ldfile.c (ldfile_try_open_bfd): When searching skip linker scripts if
- they have OUTPUT_FORMAT not matching actual output format.
- * ldlang.c (lang_get_output_target): New function.
- (open_output): Use it.
- * ldlang.h (lang_get_output_target): New prototype.
-
- 2002-10-07 Ralf Habacker <Ralf.Habacker@freenet.de>
- * pe-dll.cc (autofilter_symbolprefixlist): Don't re-export
- auto-import symbols.
- (make_one): Create _nm_<symbol> for data only.
-
- 2002-10-10 Alan Modra <amodra@bigpond.net.au>
- * emultempl/elf32.em (output_rel_find): Prefer .rel script sections
- when orphan is .rel, .rela when orphan is .rela.
- (gld${EMULATION_NAME}_place_orphan): Handle combreloc .rel* case
- first. Remove outsecname var.
-
- 2002-09-30 Alan Modra <amodra@bigpond.net.au>
- * scripttempl/elfd30v.sc: Order reloc sections placing .plt last.
- * scripttempl/elfm68hc11.sc: Likewise.
- * scripttempl/elfm68hc12.sc: Likewise.
-
- * emultempl/elf32.em (output_rel_find): Always place orphan loadable
- reloc sections just before .rel.plt/.rela.plt.
- (gld${EMULATION_NAME}_place_orphan <.rel>): Remove combreloc code.
- Only put loadable reloc sections in hold_rel.
-
- 2002-09-29 H.J. Lu <hjl@gnu.org>
- * emulparams/elf32ppc.sh (OTHER_GOT_RELOC_SECTIONS): New.
-
- 2002-08-27 Egor Duda <deo@logos-m.ru>
- * scripttempl/pe.sc: Handle .rdata_runtime_pseudo_reloc sections.
- Add symbols for application to access them.
-
-2002-10-15 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (load_symbols): Revert last change.
-
-2002-10-14 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (load_symbols): Don't call bfd_link_add_symbols when
- just_syms_flag.
- (lang_reasonable_defaults): Don't compare against false.
- (size_input_section): Likewise.
- (lang_size_sections_1): Likewise.
- (lang_do_assignments): Likewise.
- (lang_add_output): Likewise.
-
-2002-10-11 Alan Modra <amodra@bigpond.net.au>
-
- * pe-dll.c (make_import_fixup_mark): Avoid type-punned pointer.
-
- * ldgram.y (memory_spec): Provide empty action.
- (section <NAME>): Likewise.
-
-2002-10-02 Alan Modra <amodra@bigpond.net.au>
-
- * emulparams/elf64ppc.sh (MAXPAGESIZE): Set to 0x10000.
-
-2002-09-25 Daniel Jacobowitz <drow@mvista.com>
-
- From "Anita Kulkarni" <AnitaK@kpit.com>
- * scripttempl/sh.sc: Handle .eh_frame* and .gcc_exc*
- sections.
-
-2002-09-25 Alan Modra <amodra@bigpond.net.au>
-
- * ldexp.c (fold_unary): New. Split out from exp_fold_tree.
- (fold_binary): Correct abs - non-abs case.
- (fold_trinary): New. Split out from exp_fold_tree.
-
-2002-09-24 Alan Modra <amodra@bigpond.net.au>
-
- * emulparams/elf64ppc.sh (DATA_ADDR): Define.
- * emulparams/elf64_aix.sh (DATA_ADDR): Don't use a fixed address
- for start of .data, instead align up to 256M boundary.
- * scripttempl/aix.sc: Likewise.
-
-2002-09-23 Daniel Jacobowitz <drow@mvista.com>
-
- Merge from mainline:
- 2002-09-22 Mark Elbrecht <snowball3@softhome.net>
- * scripttempl/i386go32.sc: Handle bss unique sections.
-
- 2002-09-11 Nick Clifton <nickc@redhat.com>
- * po/tr.po: Updated Turkish translation.
-
- 2002-08-28 Alan Modra <amodra@bigpond.net.au>
- * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Replace strtoll,
- strtoul and strtoull with bfd_scan_vma.
- (gld${EMULATION_NAME}_read_file): Likewise.
+ * po/fr.po: Updated French translation.
- 2002-08-07 Nick Clifton <nickc@redhat.com>
- * emultempl/armelf.em (arm_elf_before_allocation): Only search
- for an interworking bfd if there are input bfds.
+2004-05-05 Alexandre Oliva <aoliva@redhat.com>
- 2002-08-06 Alan Modra <amodra@bigpond.net.au>
- * emultempl/aix.em (gld*_before_parse): Set default arch. Reverts
- 2002-05-10 change.
+ * emulparams/elf32frvfd.sh (OUTPUT_FORMAT): Switch to new
+ elf32-frvfdpic.
- 2002-08-06 H.J. Lu <hjl@gnu.org>
- * ld.texinfo: Document --no-undefined-version.
+2004-04-29 Alan Modra <amodra@bigpond.net.au>
- * ldlang.c (lang_new_vers_pattern): Set the `symver' and
- `script.' fields to 0.
+ * pe-dll.c: Revert changes accidentally committed 2004-03-08.
+ (fill_edata): Correct pointer arithmetic.
- * ldmain.c (main): Initialize the allow_undefined_version to
- true.
+2004-04-21 Hans-Peter Nilsson <hp@axis.com>
- * lexsup.c (OPTION_NO_UNDEFINED_VERSION): New.
- (ld_options): Add --no-undefined-version.
- (parse_args): Support OPTION_NO_UNDEFINED_VERSION.
+ * NEWS: Mention change in DEFINED semantics.
- 2002-07-04 Bruno Haible <bruno@clisp.org>
- * emulparams/elf_i386_fbsd.sh: Set OUTPUT_FORMAT to
- elf32-i386-freebsd.
- * emulparams/elf64alpha_fbsd.sh: Set OUTPUT_FORMAT to
- elf64-alpha-freebsd.
+2004-04-20 Chris Demetriou <cgd@broadcom.com>
-2002-08-13 Alan Modra <amodra@bigpond.net.au>
+ * NEWS: Note that MIPS --embedded-relocs option is deprecated.
- * emulparams/elf32_dlx.sh (TARGET_PAGE_SIZE): Set to 1.
- (MAXPAGESIZE): Set to 1.
+2004-04-11 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
- * ld.h (ALIGN_N): Delete.
- * ldexp.h (align_n): Declare.
- * ldexp.c (align_n): New function.
- (fold_binary): Use align_n instead of ALIGN_N.
- (exp_fold_tree): Likewise.
- * ldlang.c (lang_size_sections_1): Likewise.
- (lang_one_common): Likewise.
- * ld.texinfo (ALIGN): Remove power of 2 restriction.
+ * configure.host: Remove mips*-dec-bsd* target.
+ * configure.tgt: Likewise.
-2002-07-23 Daniel Jacobowitz <drow@mvista.com>
+2004-04-09 Daniel Jacobowitz <drow@mvista.com>
Merge from mainline:
- 2002-07-14 H.J. Lu <hjl@gnu.org>
- * ld.texinfo: Document a .symver takes precedence over a
- version script.
-
-2002-07-25 Nick Clifton <nickc@redhat.com>
-
+ 2004-03-30 Nick Clifton <nickc@redhat.com>
* po/sv.po: Updated Swedish translation.
- * po/es.po: Updated Spanish translation.
- * po/fr.po: Updated French translation.
-
-2002-07-24 Nick Clifton <nickc@redhat.com>
-
- * po/sv.po: Updated Swedish translation.
- * po/es.po: Updated Spanish translation.
-
-2002-07-23 Daniel Jacobowitz <drow@mvista.com>
-
- * po/ld.pot: Regenerated.
-
-2002-07-23 Nick Clifton <nickc@redhat.com>
-
- * po/ld.po: Updated French translation.
-
-2002-07-20 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
- bomb on /DISCARD/ input section.
- * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
- * emultempl/mmo.em (mmo_place_orphan): Likewise.
-
-2002-07-19 Hans-Peter Nilsson <hp@bitrange.com>
-
- * emultempl/mmo.em (mmo_place_orphan): Handle case of no .text
- output section.
-
-2002-07-16 Nick Clifton <nickc@cambridge.redhat.com>
-
- * NEWS: Add 'Changes in 2.13'.
-
-2002-07-12 Alan Modra <amodra@bigpond.net.au>
-
- * emulparams/elf64ppc.sh (ARCH): Set to powerpc:common64.
- (COMMONPAGESIZE): Define.
-
-2002-07-09 Alan Modra <amodra@bigpond.net.au>
-
- * emulparams/hppanbsd.sh: Remark that hppaobsd.sh references this file.
-
-2002-07-09 Federico G. Schwindt <fgsch@olimpo.com.br>
-
- * configure.tgt: Add support for alpha-*-openbsd*, hppa-*-openbsd*,
- powerpc-*-openbsd* and sparc64-*-openbsd*.
- * Makefile.am (ALL_EMULATIONS): Add ehppaobsd.o.
- * Makefile.in: Regenerate.
- * emulparams/hppaobsd.sh: New file.
-
-2002-07-05 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (print_wild_statement): Fix output formatting.
-
-2002-07-04 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c: (strip_excluded_output_sections): New function.
- (lang_process): Call it.
- (lang_size_sections_1): Revert 2002-06-10 change.
-
-2002-07-03 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am (check-DEJAGNU): Revert 2002-06-25 change.
- Run "make dep-am".
- * Makefile.in: Regenerate.
-
-2002-07-02 Alan Modra <amodra@bigpond.net.au>
-
- * ldfile.c (ldfile_try_open_bfd): Formatting.
-
- * ldmisc.c (demangle): Move so that it doesn't intrude between
- vfinfo comment and body. Add comment.
-
-2002-07-01 John David Anglin <dave@hiauly1.hia.nrc.ca>
-
- * emulparams/vax.sh (OUTPUT_FORMAT): Use a.out-vax-bsd format.
-
-2002-07-01 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.h (entry_sym): Make it a struct bfd_sym_chain.
- * ldlang.c (entry_sym): Likewise.
- (ldlang_undef_chain_list_type): Likewise.
- (lang_finish): Adjust references to entry_symbol.
- (lang_add_entry): Likewise.
- (lang_gc_sections): Use link_info.gc_sym_list.
- (lang_process): Set link_info.gc_sym_list.
- * ldlex.l: Include bfdlink.h.
- * ldmain.c (main): Init link_info.gc_sym_list.
- * emultempl/aix.em: Adjust references to entry_symbol.
- * emultempl/armcoff.em: Likewise.
- * emultempl/armelf.em: Likewise.
- * emultempl/pe.em: Likewise.
- * emultempl/ppc64elf.em (ppc_after_open): New function.
- (LDEMUL_AFTER_OPEN): Define.
- * emulparams/elf64ppc.sh: KEEP .opd sections.
-
-2002-06-29 Stephane Carrez <stcarrez@nerim.fr>
-
- * emulparams/m68hc12elfb.sh (EEPROM_MEMORY): Define.
- * emulparams/m68hc11elfb.sh (EEPROM_MEMORY): Define.
- * emulparams/m68hc11elf.sh (EEPROM_SIZE): Define.
- (EEPROM_START_ADDR): Define.
- (EEPROM_MEMORY): Define.
- * emulparams/m68hc12elf.sh: Likewise.
- * scripttempl/elfm68hc11.sc: Handle .eeprom section; handle .softregs
- section to put soft registers in .page0.
- * scripttempl/elfm68hc12.sc: Likewise but put soft registers in bss.
-
-2002-06-26 John David Anglin <dave@hiauly1.hia.nrc.ca>
-
- * emulparams/hppa64linux.sh (OTHER_GOT_RELOC_SECTIONS): Add rela.opd
- section. Add ${RELOCATING-0}.
-
-Wed Jun 26 16:33:58 2002 J"orn Rennecke <joern.rennecke@superh.com>
-
- * emulparams/shelf.sh (STACK_ADDR): Don't define.
- (OTHER_SECTIONS): Define.
- * emulparams/shelf_nbsd.sh ((STACK_ADDR): Don't undef.
- (OTHER_SECTIONS): Undef.
-
-2002-06-26 Alan Modra <amodra@bigpond.net.au>
-
- * ldmisc.c (demangle): Restore dots stripped from sym name.
-
-2002-06-25 H.J. Lu <hjl@gnu.org>
-
- * Makefile.am (check-DEJAGNU): Set LC_ALL=C and export it.
- * Makefile.in: Regenerated.
-
-2002-06-20 Nick Clifton <nickc@cambridge.redhat.com>
-
- * ld.texinfo (Bug Reporting): Update text to suggest a limit on
- the size of attached object files, to allow make the object files
- available via FTP or HTTP and to mention that the mail will be
- sent to a mailing list.
-
-2002-06-20 Nathanael Nerode <neroden@twcny.rr.com>
-
- * ld/configure.host (romp): Drop support.
-
-2002-06-18 Chris Demetriou <cgd@broadcom.com>
-
- * emultempl/mipself.em (mips_elf${ELFSIZE}_check_sections): Check
- section flags for SEC_DATA, rather than for SEC_CODE being unset.
-
-2002-06-18 Chris Demetriou <cgd@broadcom.com>
-
- * emultempl/mipself.em (mips_elf${ELFSIZE}_check_sections): Fix
- format specifier used to print BFD name.
-
-2002-06-18 Dave Brolley <brolley@redhat.com>
-
- From Catherine Moore, Michael Meissner, Jim Blandy:
- * emulparams/elf32frv.sh: New file.
- * configure.tgt: Support frv-*-*.
- * Makefile.am (ALL_EMULATIONS): Add eelf32frv.o.
- (eelf32frv.c): New target.
-
-2002-06-17 Tom Rix <trix@redhat.com>
-
- * emultempl/elf32.em: gld*_get_script: Check for
- GENERATE_COMBRELOC_SCRIPT.
- * scripttempl/elfd10v.sc : Fix STACK and INSN.
- * emulparams/d10velf.sh : Fix TEXT_START_ADDR.
-
-Thu Jun 13 20:18:38 2002 J"orn Rennecke <joern.rennecke@superh.com>
-
- * configure.tgt: Add support for sh[1234]*le*-*-elf, sh[1234]*-*-elf.
-
-2002-06-12 H.J. Lu <hjl@gnu.org>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Return
- false if xvec doesn't match.
-
-2002-06-10 Richard Sandiford <rsandifo@redhat.com>
-
- * ldlang.c (lang_size_sections_1): Skip removed output sections.
-
-2002-06-08 Alan Modra <amodra@bigpond.net.au>
-
- * ldexp.c: Replace CONST with const.
- * ldfile.c: Likewise.
- * ldfile.h: Likewise.
- * ldlex.l: Likewise.
- * mri.c: Likewise.
- * pe-dll.h: Likewise.
-
-2002-06-07 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/ppc64elf.em (new_vers_pattern): Warning fix.
-
-2002-06-07 Charles Wilson <cwilson@ece.gatech.edu>
-
- * ld/ldmain.c (main): initialize link_info.pei386_auto_import
- to -1 == implicit enable.
- * ld/emultempl/pe.em (gld_${EMULATION_NAME}_before_parse):
- initialize link_info.pei386_auto_import to -1 == implicit
- enable.
- (gld_${EMULATION_NAME}_parse_args): When processing
- --enable-auto-import and --disable-auto-import options, use
- '1' and '0' instead of 'true' and 'false'.
- (pe_find_data_imports): Only issue message about auto-import
- when the feature is implicitly enabled. Downgrade message to
- informational instead of warning.
-
-2002-06-07 Alan Modra <amodra@bigpond.net.au>
-
- * scripttempl/elf.sc (.tbss): Fix mismatched parentheses/braces.
-
-2002-06-06 John David Anglin <dave@hiauly1.hia.nrc.ca>
-
- * configure.host (hppa*64*-*-hpux11*): Define NATIVE_LIB_DIRS,
- HOSTING_CRT0 and HOSTING_LIBS.
-
-2002-06-05 J"orn Rennecke <joern.rennecke@superh.com>
-
- * configure.tgt (shle*-*-elf*, sh64le-*-elf*): New configurations.
-
-2002-06-05 Jason Thorpe <thorpej@wasabisystems.com>
-
- * emulparams/ns32knbsd.sh (EXECUTABLE_SYMBOLS): Set _DYNAMIC to 0.
- (NONPAGED_TEXT_START_ADDR): Set to 0x1000.
-
-2002-06-05 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Place
- SEC_EXCLUDE sections when doing a relocatable link.
-
-2002-06-04 Jason Thorpe <thorpej@wasabisystems.com>
-
- * Makefile.am (ALL_EMULATIONS): Add eshelf32_nbsd.o,
- eshlelf32_nbsd.o, eshelf64_nbsd.o, and eshlelf64_nbsd.o.
- (eshelf32_nbsd.c, eshelf64_nbsd.c, eshlelf32_nbsd.c)
- (eshlelf64_nbsd.c): New rules.
- * Makefile.in: Regenerate.
- * configure.tgt (sh5le-*-netbsd*, sh5-*-netbsd*, sh64le-*-netbsd*)
- (sh64-*-netbsd*): New targets.
- * emulparams/shelf32_nbsd.sh: New file.
- * emulparams/shelf64_nbsd.sh: New file.
- * emulparams/shlelf32_nbsd.sh: New file.
- * emulparams/shlelf64_nbsd.sh: New file.
-
-2002-06-04 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (section_already_linked): Call bfd_discard_group. Typo fix.
-
-2002-06-02 Marek Michalkiewicz <marekm@amelek.gda.pl>
-
- * scripttempl/avr.sc: Changes to support current GCC and avr-libc,
- C++ constructors/destructors, loosely based on the m68hc11 port.
-
-2002-05-31 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.in: Regenerate.
- * aclocal.m4: Regenerate.
- * config.in: Regenerate.
- * configure: Regenerate.
-
-2002-05-31 Graeme Peterson <gp@qnx.com>
-
- * Makefile.am (ALL_EMULATIONS): Add ei386nto.o.
- (ei386nto.c): Add rule.
- * Makefile.in: Regenerate.
- * configure.tgt: Add i[3456]86-*-nto-qnx*.
- * emulparams/i386nto.sh: New file.
-
-2002-05-29 Jason Thorpe <thorpej@wasabisystems.com>
-
- * NEWS: Add entry for VAX ELF support.
-
-2002-05-29 Matt Thomas <matt@3am-software.com>
- Jason Thorpe <thorpej@wasabisystems.com>
-
- * Makefile.am (ALL_EMULATIONS): Add eelf32vax.o and evaxnbsd.o.
- (eelf32vax.c)
- (evaxnbsd.c): New rules.
- * Makefile.in: Regenerate.
- * configure.tgt (vax-*-netbsdelf*)
- (vax-*-netbsdaout*)
- (vax-*-netbsd*): New targets.
- * emulparams/elf32vax.sh: New file.
- * emulparams/vaxnbsd.sh: New file.
-
-2002-05-29 Adam Nemet <anemet@lnxw.com>
-
- * emultempl/armelf.em (arm_elf_after_open): Don't determine
- bfd_for_interwork, instead add glue sections to each input bfd.
- (bfd_for_interwork): New global.
- (arm_elf_set_bfd_for_interworking): New function.
- (arm_elf_before_allocation): Use it.
-
-2002-05-28 Kuang Hwa Lin <kuang@sbcglobal.net>
-
- * Makefile.am: Add DLX make target.
- * configure.tgt: Add DLX configuration.
- * Makefile.in: Regenerate.
- * emulparams/elf32_dlx.sh: New file
- * scripttempl/dlx.sc: New file
-
-2002-05-27 Per Lundberg <per@caleb.dnsalias.org>
-
- * Makefile.am (eelf_i386_chaos): Use elf_chaos.sc script.
- * Makefile.in: Regenerate.
- * emulparams/elf_chaos.sh: Use elf_chaos script.
- * scripttempl/elf_chaos.sc: New file.
-
-2002-05-27 Richard Sandiford <rsandifo@redhat.com>
-
- * ldlang.c (lang_size_sections_1): Move check for conflicting load
- addresses and regions from here...
- (lang_get_regions): ...to this new function.
- (lang_leave_output_section_statement): Use lang_get_regions.
- (lang_leave_overlay): Likewise.
- * mri.c (mri_draw_tree): Pass null as last argument to
- lang_leave_output_section_statement.
- * emultempl/elf32.em (gld*_place_orphan): Likewise.
- * emultempl/mmo.em (mmo_place_orphan): Likewise.
- * emultempl/pe.em (gld*_place_orphan): Likewise.
-
-2002-05-26 Jason Thorpe <thorpej@wasabisystems.com>
-
- * configure.tgt: Use ns32k-*-netbsd* instead of ns32k-pc532-netbsd*.
-
-2002-05-25 Kazu Hirata <kazu@cs.umass.edu>
-
- * ldemul.c: Fix formatting.
- * ldfile.c: Likewise.
- * pe-dll.c: Likewise.
- * pe-dll.h: Likewise.
-
-2002-05-25 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (lang_process): Formatting, grammar.
-
- * ldlex.l: Use #include "" instead of <> for local header files.
-
-2002-05-24 TAMURA Kent <kent@netbsd.org>
-
- * configure.tgt: Add a target for i386-netbsdpe.
-
-2002-05-23 Jakub Jelinek <jakub@redhat.com>
-
- * scripttempl/elf.sc: Add .rel{,a}.t{bss,data}, .tdata and .tbss.
- * ldlang.c (lang_add_section): Set SEC_THREAD_LOCAL for
- output section if necessary. Handle .tbss.
- (lang_size_sections): Clear _raw_size for .tbss section
- (it allocates space in PT_TLS segment only).
- * ldwrite.c (build_link_order): Build link order for .tbss too.
-
-2002-05-23 Alan Modra <amodra@bigpond.net.au>
-
- * configure.in: Correct spelling of AC_PREREQ.
-2002-05-21 Danny Smith <dannysmith@users.sourceforge.net>
+ 2004-03-20 Alexandre Oliva <aoliva@redhat.com>
+ * emulparams/elf32frvfd.sh (MAXPAGESIZE): Change to 16Kb.
- * pe-dll.c (autofilter_liblist): Add more system libs excluded by
- default.
- (autofilter_objlist): Add crtbegin.o, crtend.o.
+ 2004-03-08 Danny Smith <dannysmith@users.sourceforge.net>
+ * pe-dll.c (pe_dll_generate_implib): Skip sections marked as
+ private when building implib.
-2002-05-21 Danny Smith <dannysmith@users.sourceforge.net>
+ 2004-03-01 Andreas Schwab <schwab@suse.de>
+ * ld.texinfo (Options): Fix example for --wrap.
- * emultempl/pe.em (OPTION_EXCLUDE_LIBS): Add new define.
- (longopts): Add new option --exclude-libs.
- (gld_${EMULATION_NAME}_list_options): Give quick help about it.
- (gld_${EMULATION_NAME}_parse_args): Use it.
- * pe-dll.h (pe_dll_add_excludes): Add second param to prototype.
- * pe-dll.c (exclude_list_struct): Add field type to distinguish symbols
- from whole archives.
- (pe_dll_add_excludes): Set excludes->type.
- (auto_export): Add new variable libname and set to archive basename if
- abfd. Use it when filtering default and user-specified libarary
- excludes. Let string "ALL" mean all libs when filtering user-specified
- libs.
- * ld.texinfo: Document --exclude-libs.
+ 2004-02-25 Danny Smith <dannysmith@users.sourceforge.net>
+ * pe-dll.c (fill_edata): Check that exported_symbol_sections is
+ not NULL.
-2002-05-22 Alan Modra <amodra@bigpond.net.au>
+ 2004-02-23 Ian Lance Taylor <ian@wasabisystems.com>
+ * ldlang.c (lang_check): Use %P, not %E, in error message.
- * ldemul.c (ldemul_new_vers_pattern): New function.
- * ldemul.h (ldemul_new_vers_pattern): Declare.
- (struct ld_emulation_xfer_struct): Add new_vers_pattern.
- * ldlang.c (lang_new_vers_pattern): Call ldemul_new_vers_pattern.
- * emultempl/ppc64elf.em (dotsyms): New static var.
- (gld${EMULATION_NAME}_new_vers_pattern): New function.
- (LDEMUL_NEW_VERS_PATTERN): Define.
- (PARSE_AND_LIST_PROLOGUE): Add OPTION_DOTSYMS, OPTION_NO_DOTSYMS.
- (PARSE_AND_LIST_LONGOPTS): Likewise.
- (PARSE_AND_LIST_ARGS_CASES): Handle them.
- * emultempl/aix.em (ld_${EMULATION_NAME}_emulation): Update
- initialiser.
- * emultempl/armcoff.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/linux.em: Likewise.
- * emultempl/lnk960.em: Likewise.
- * emultempl/m68kcoff.em: Likewise.
- * emultempl/mipsecoff.em: Likewise.
- * emultempl/pe.em: Likewise.
- * emultempl/sunos.em: Likewise.
- * emultempl/ticoff.em: Likewise.
- * emultempl/vanilla.em: Likewise.
+2004-04-08 Richard Sandiford <rsandifo@redhat.com>
-2002-05-22 Alan Modra <amodra@bigpond.net.au>
-
- * genscripts.sh (LIB_PATH): For native targets, concatenate $libdir
- and $NATIVE_LIB_DIRS. Add $tool_lib before other libs.
- (LIB_SEARCH_DIRS): No need to use "tr".
- (COMPILE_IN): Only set for native targets.
- * configure.host (NATIVE_LIB_DIRS): Specify all native search dirs
- here, rather than adding lib:/usr/lib:/usr/local/lib in genscripts.sh.
- * configure.tgt (powerpc*): Set tdir_*.
- (powerpcle*): Correct targ_extra_emuls.
- * emulparams/elf32ppc.sh (LIB_PATH): Set up native 64 bit dirs.
- * emulparams/elf64ppc.sh (LIB_PATH): Likewise.
-
-2002-05-22 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/pe.em (set_pe_subsystem): Don't set "cmdline" when
- calling lang_add_entry.
-
-2002-05-21 H.J. Lu (hjl@gnu.org)
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_parse_args): Handle
- "-z muldefs".
- (gld${EMULATION_NAME}_list_options): Add "-z muldefs".
-
- * ld.texinfo: Updated for --allow-multiple-definition and
- "-z muldefs".
-
- * ldmain.c (main): Initialize the allow_multiple_definition
- field to false.
-
- * lexsup.c (OPTION_ALLOW_MULTIPLE_DEFINITION): New.
- (ld_options): Add --allow-multiple-definition.
- (parse_args): Support OPTION_ALLOW_MULTIPLE_DEFINITION.
-
-2002-05-21 Jason Thorpe <thorpej@wasabisystems.com>
-
- * Makefile.am (ALL_EMULATIONS): Add earmelfb_nbsd.o.
- (earmelfb_nbsd.c): New rule.
- * Makefile.in: Regenerate.
- * configure.tgt (armeb-*-netbsdelf*): New target.
- (arm-*-netbsdelf*): Add armelfb_nbsd to targ_extra_emuls.
- (arm-*-netbsd*): Likewise.
- * emulparams/armelfb_nbsd.sh: New file.
-
-2002-05-18 Tom Rix <trix@redhat.com>
-
- * emultempl/aix.em (gld*_parse_args): Add -bnortl and -bnortllib
- support.
-
-2002-05-17 Marek Michalkiewicz <marekm@amelek.gda.pl>
-
- * Makefile.am: Add new emulations avr1, avr2, avr3, avr4, avr5.
- * Makefile.in: Regenerate.
- * configure.tgt (avr-*-*): Add avr[1-5] to targ_extra_emuls.
-
-2002-05-16 Marek Michalkiewicz <marekm@amelek.gda.pl>
-
- * emulparams/avr1.sh: New file.
- * emulparams/avr2.sh: New file.
- * emulparams/avr3.sh: New file.
- * emulparams/avr4.sh: New file.
- * emulparams/avr5.sh: New file.
- * scripttempl/avr.sc: New file.
-
-2002-05-15 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (section_already_linked): Call bfd_link_just_syms.
- (lang_place_orphans): Abort if just_syms_flag.
-
-2002-05-10 Tom Rix <trix@redhat.com>
-
- * emultempl/aix.em: (gld*_set_output_arch): New function. Use
- architecture and machine information in the output bfd.
- (gld*_before_parse): Remove old arch and machine code.
- (choose_target): Rename to gld*_choose_target.
- (rtld): Change type to int.
- * ldfile.c (ldfile_try_open_bfd): Disable compatiblity check for
- objects in XCOFF archives.
- * ldfile.h: Update copyright date.
-
-2002-05-10 Jakub Jelinek <jakub@redhat.com>
-
- * ldmain.c (main): Enable -z combreloc by default.
-
-2002-05-07 Federico G. Schwindt <fgsch@olimpo.com.br>
-
- * Makefile.am: Honour DESTDIR.
- * Makefile.in: Regenerate.
-
-2002-05-07 Richard Sandiford <rsandifo@redhat.com>
-
- * ldlang.h (lang_output_section_statement_type): Add update_dot_tree.
- (lang_enter_overlay): Remove the last two parameters.
- (lang_leave_overlay): Take them here instead.
- * ldgram.y (memspec_at_opt): Set $$ to null if no region is given.
- (section): Pass LMA and crossref flag to lang_leave_overlay rather
- than lang_enter_overlay.
- * ldlang.c (lang_memory_region_lookup): Return null for null names.
- (lang_output_section_statement_lookup): Initialize update_dot_tree.
- (lang_size_sections_1): Evaluate it.
- (lang_leave_output_section_statement): Rework LMA lookup.
- (overlay_lma, overlay_nocrossrefs): Remove.
- (lang_enter_overlay): Remove LMA and crossref arguments.
- (lang_enter_overlay_section): Don't set the LMA here.
- (lang_leave_overlay): Take LMA and crossref arguments. Move the '.'
- assignment to the last section's update_dot_tree. Unconditionally
- use the load and run-time regions specified in the OVERLAY statement.
- Likewise the first section's LMA. Only set the other sections' LMAs
- when no load region is given.
-
-2002-05-06 Nick Clifton <nickc@redhat.com>
-
- * po/sv.po: New translation.
-
-2002-05-04 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/hppaelf.em (build_section_lists): New function.
- (gld${EMULATION_NAME}_finish): Call elf32_hppa_setup_section_lists
- and build_section_lists.
-
-2002-05-03 Kazu Hirata <kazu@cs.umass.edu>
-
- * ld.h: Fix formatting.
- * ldexp.c: Likewise.
- * ldfile.c: Likewise.
- * ldlang.c: Likewise.
- * ldmain.c: Likewise.
- * lexsup.c: Likewise.
- * pe-dll.c: Likewise.
-
-2002-05-02 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/ppc64elf.em (gld${EMULATION_NAME}_after_allocation):
- Adjust for ppc64_elf_set_toc change. #include libbfd.h.
- (build_section_lists): Do output_section tests here.
-
-2002-04-30 Tom Rix <trix@redhat.com>
-
- * emultempl/aix.em : (gld*_parse_arge): Formatting changes.
-
-2002-05-01 Alan Modra <amodra@bigpond.net.au>
-
- Long branch stubs, multiple stub sections.
- * emultempl/ppc64elf.em: Include ldctor.h.
- (stub_file): New var.
- (group_size): New var.
- (ppc_create_output_section_statements): New function.
- (struct hook_stub_info): New.
- (hook_in_stub): New function.
- (ppc_add_stub_section): New function.
- (ppc_layout_sections_again): New function.
- (build_section_lists): New function.
- (gld${EMULATION_NAME}_finish): Rewrite.
- (real_func): New var.
- (ppc_for_each_input_file_wrapper): New function.
- (ppc_lang_for_each_input_file): New function.
- (lang_for_each_input_file): Define.
- (PARSE_AND_LIST_PROLOGUE): Define.
- (PARSE_AND_LIST_LONGOPTS): Define.
- (PARSE_AND_LIST_OPTIONS): Define.
- (PARSE_AND_LIST_ARGS_CASES): Define.
- (LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Define.
-
-2002-04-30 Tom Rix <trix@redhat.com>
-
- * emultempl/aix.em (gld*_parse_arge, gld*_before_allocation): Add
- -blibpath, -bnolibpath support.
-
-2002-04-30 Mark Mitchell <mark@codesourcery.com>
-
- * Makefile.am (ALL_EMULATIONS): Add elf32ppcwindiss.o.
- (eelf32ppcwindiss.c): New target.
- * Makefile.in: Regenerated.
- * configure.tgt: Add support for powerpc-*-windiss.
- * emulparams/elf32ppcwindiss.sh: New file.
-
-2002-04-30 Richard Sandiford <rsandifo@redhat.com>
-
- * ldlang.c (print_assignment): Update print_dot for assignments to ".".
- * ldexp.c (exp_print_token): Add "infix_p" argument.
- (exp_print_tree): Update accordingly.
-
-2002-04-28 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am (mpw): New maintainer mode rule to make mpw-*.c files.
- * Makefile.in: Regenerate.
- * mpw-elfmips.c: Delete.
- * mpw-eppcmac.c: Delete.
- * mpw-esh.c: Delete.
- * mpw-idtmips.c: Delete.
-
-Wed Apr 17 19:23:14 2002 J"orn Rennecke <joern.rennecke@superh.com>
-
- * emulparams/shelf32.sh (MACHINE): Now sh5.
-
-2002-04-17 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
-
- * ldgram.y: Fix syntax warning.
-
-2002-04-11 Nick Clifton <nickc@cambridge.redhat.com>
-
- * emultempl/armelf.em (PARSE_AND_LIST_SHORTOPTS): Add 'n' in order
- to prevent "-n" from being taken as an abbreviation for
- "--no-pipeline-knowledge".
-
-2002-04-08 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (lang_size_sections_1): Don't complain about
- SEC_NEVER_LOAD sections having no memory region specified.
-
- * ld.texinfo (Format Commands <OUTPUT_FORMAT>): Typo fix.
-
-2002-04-07 matthew green <mrg@redhat.com>
-
- * ld/configure.host (*-*-netbsd*): Add support for NetBSD/ELF.
-
-2002-04-04 Alan Modra <amodra@bigpond.net.au>
-
- * dep-in.sed: Cope with absolute paths.
- * Makefile.am (dep.sed): Subst TOPDIR and BFDDIR.
- Run "make dep-am".
- * Makefile.in: Regenerate.
-
-2002-04-04 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
-
- * emulparams/elf64btsmip.sh: n64 replaces .reginfo with .MIPS.options.
-
-2002-04-03 Jakub Jelinek <jakub@redhat.com>
-
- * ldexp.c (fold_binary) [DATA_SEGMENT_ALIGN]: If common page size
- is smaller than maximum, round dot up to common page boundary.
-
-2002-03-28 Alan Modra <amodra@bigpond.net.au>
-
- * configure.host: Set up for generic hosts first, then tweak as
- necessary in more specific targets.
- (HOSTING_LIBS): Include libgcc_eh.a if found.
-
-2002-03-23 Andreas Jaeger <aj@suse.de>
-
- * emulparams/elf_x86_64.sh (COMMONPAGESIZE): Set it.
-
-2002-03-21 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am: Run "make dep-am".
- * Makefile.in: Regenerate.
-
-2002-03-21 Albert Chin-A-Young <china@thewrittenword.com>
-
- * genscripts.sh (LIB_SEARCH_DIRS): Quote path.
-
-2002-03-20 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (ldlang_add_undef): If the output bfd has been opened,
- add the symbol to the linker hash table immediately.
- (lang_place_undefineds): Split symbol creation out..
- (insert_undefined): ..to here.
-
-2002-03-18 David O'Brien <obrien@FreeBSD.org>
-
- * emultempl/elf32.em: Use lbasename vs. basename to fix problem where
- the contents of the buffer returned from basename function will are
- getting overwritten while still being used.
-
-Mon Mar 18 17:38:39 CET 2002 Jan Hubicka <jh@suse.cz>
- Andreas Jaeger <aj@suse.de>
- Andreas Schwab <schwab@suse.de>
-
- * configure.tgt (x86_64-*-linux-gnu*): Configure i386 as native.
- * elf_x86_64.sh (ARCH): Set to i386:x86-64
- set libraries to default to lib64 paths.
-
-2002-03-18 Tom Rix <trix@redhat.com>
-
- * Makefile.am : Add eaix5ppc and eaix5rs6, AIX 5 support.
- * configure.tgt : Same.
- * emulparms/aix5ppc.sh : New file. For eaix5ppc.
- * emulparms/aix5rs6.sh : New file. For eaix5rs6.
- * emulparms/aixppc.sh : OUPUT_FORMAT_32BIT and OUTPUT_FORMAT_64BIT
- emulation parameters for better -b32, -b64 support.
- * emulparms/aixrs6.sh : Same.
- * emulparms/ppcmacos.sh : Same.
- * emultempl/aix.em (choose_target) : Use new emulation parameters
- OUTPUT_FORMAT_32BIT and OUTPUT_FORMAT_64BIT.
- * Makefile.in : Regenerate.
-
-2002-03-18 Nick Clifton <nickc@cambridge.redhat.com>
-
- * po/fr.po: Updated version.
-
-2002-03-18 Alan Modra <amodra@bigpond.net.au>
-
- * ldmain.c (main): Move .text readonly flag fudges from here..
- * ldlang.c (lang_process): ..to here.
-
-2002-03-14 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (lang_check): Remove the word size check added in last
- change. Treat emitrelocations case as for relocatable links.
-
-2002-03-13 Nick Clifton <nickc@cambridge.redhat.com>
-
- * po/fr.po: Updated version.
-
-2002-03-13 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (lang_check): Do relocatable link checks first, so that
- warn_mismatch can't override. Check compatible and word size too.
-
-2002-03-07 Daniel Jacobowitz <drow@mvista.com>
-
- * ld.texinfo: Wrap @menu in @ifnottex, not @ifinfo.
-
-2002-03-05 Jakub Jelinek <jakub@redhat.com>
-
- * scripttempl/elf.sc: Only use DATA_SEGMENT_END() together with
- DATA_SEGMENT_ALIGN.
-
-2002-03-04 H.J. Lu <hjl@gnu.org>
-
- * scripttempl/elf.sc: Put .preinit_array, .init_array and
- .fini_array in the data segment.
-
-2002-03-04 Alan Modra <amodra@bigpond.net.au>
-
- * scripttempl/elf.sc: Correct syntax errors in 2002-03-01 commit.
-
-2002-03-01 David Mosberger <davidm@hpl.hp.com>
-
- * scripttempl/elf.sc (SECTIONS): Add entries for .preinit_array,
- .init_array, and .fini_array.
-
-2002-02-20 Andreas Schwab <schwab@suse.de>
-
- * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Don't fold
- .IA64_unwind* in a relocatable link.
-
-2002-02-20 Nick Clifton <nickc@cambridge.redhat.com>
-
- * NEWS: Mark 2.12 branch.
-
-2002-02-19 Martin Schwidefsky <schwidefsky@de.ibm.com>
-
- * emulparams/elf64_s390.sh (ARCH): Change to "s390:64-bit".
- * emulparams/elf_s390.sh (ARCH): Change to "s390:31-bit".
-
-2002-02-18 Tom Rix <trix@redhat.com>
-
- * emultempl/aix.em (gld*_parse_args): Add -brtl support.
- (gld*_before_allocation): Same.
- (gld*_create_output_section_statements): Generate
- __rtinit if run time linking. Add librtl.a to the link.
- (gld*_read_file): Clean.
-
-2002-02-18 Alan Modra <amodra@bigpond.net.au>
-
- * emulparams/elf64ppc.sh (OTHER_TEXT_SECTIONS): Define.
-
-2002-02-18 David O'Brien <obrien@FreeBSD.org>
-
- * Makefile.am: Add new files earmelf_fbsd, eelf32ppc_fbsd,
- eelf_i386_fbsd, eelf64_ia64_fbsd, eelf_x86_64_fbsd, eelf64_sparc_fbsd,
- and eelf64alpha_fbsd.
+ * emulparams/elf32bsmip.sh (EXTRA_EM_FILE): Define to irix.
+ * emulparams/elf64bmip.sh (EXTRA_EM_FILE): Likewise.
+ * emulparams/elf32bmipn32.sh (EXTRA_EM_FILE): Likewise.
+ * emultempl/irix.em: New file.
+ * Makefile.am (eelf32bsmip.c, eelf32bmipn32.c, eelf64bmip.c): Update
+ dependencies.
* Makefile.in: Regenerate.
- * configure.tgt(sparc64-*-freebsd, ia64-*-freebsd, i[3456]86-*-freebsd,
- x86_64-*-freebsd, arm-*-freebsd, alpha*-*-freebsd, powerpc-*-freebsd):
- use a FreeBSD-specific emulation rather than the psABI one.
- * emulparams/elf_fbsd.sh (ELF_INTERPRETER_NAME): Set appropriate value
- for all FreeBSD ELF systems.
- * emulparams/armelf_fbsd.sh: Bridge elf_fbsd.sh and the "native" psABI
- emulation.
- * emulparams/elf32ppc_fbsd.sh: Likewise.
- * emulparams/elf64_ia64_fbsd.sh: Likewise.
- * emulparams/elf64_sparc_fbsd.sh: Likewise.
- * emulparams/elf64alpha_fbsd.sh: Likewise.
- * emulparams/elf_i386_fbsd.sh: Likewise.
- * emulparams/elf_x86_64_fbsd.sh: Likewise.
-
-2002-02-18 Nick Clifton <nickc@cambridge.redhat.com>
-
- * po/tr.po: Updated version.
-
-2002-02-18 Alan Modra <amodra@bigpond.net.au>
-
- * ld.texinfo (Output Section Fill): Fix amateur texinfo.
- (FILL): Likewise.
-
-2002-02-17 Hans-Peter Nilsson <hp@bitrange.com>
-
- * emultempl/mmo.em (mmo_after_open): Don't call
- _bfd_mmix_check_all_relocs when producing ELF output.
-
-2002-02-15 Richard Henderson <rth@redhat.com>
-
- * emulparams/elf64alpha.sh (NOP): Adjust for big-endian
- definition. Emit a unop+nop pair.
-
-2002-02-15 Hans-Peter Nilsson <hp@bitrange.com>
- * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Also check
- for presence of .MMIX.reg_contents.linker_allocated before early
- exit.
+2004-04-08 Alan Modra <amodra@bigpond.net.au>
- * NEWS: Mention support for MMIX.
-
-2002-02-15 Alan Modra <amodra@bigpond.net.au>
-
- Support arbitrary length fill patterns.
- * ld.texinfo (Output Section Fill): Describe fill expressions.
- (FILL): Refer to the above.
- * ldexp.h (etree_value_type): Add "str" field.
- (union etree_union): Add "str" to "value" struct.
- (exp_bigintop): Declare.
- (exp_get_fill): Declare.
- * ldexp.c: Include "safe-ctype.h".
- (exp_intop): Set value.str to NULL.
- (exp_bigintop): New function.
- (new_rel): Pass in "str", and set new.str from it.
- (new_rel_from_section): Set new.str to NULL.
- (fold_name): Adjust calls to new_rel.
- (exp_fold_tree): Likewise.
- (exp_get_fill): New function.
- * ldgram.y (struct big_int bigint, fill_type *fill): New.
- (INT): Returns a "bigint". Adjust all code handling INTs.
- (fill_opt): Returns a "fill".
- (fill_exp): Split out of fill_opt, use for FILL.
- * ldlang.h (struct _fill_type): New.
- (fill_type): Move typedef to ldexp.h.
- (lang_output_section_statement_type): "fill" is now a pointer.
- (lang_fill_statement_type): Likewise.
- (lang_padding_statement_type): Likewise.
- (lang_add_fill): Now takes a "fill_type *" param.
- (lang_leave_output_section_statement): Likewise.
- (lang_do_assignments): Likewise.
- (lang_size_sections): Likewise.
- (lang_leave_overlay_section): Likewise.
- (lang_leave_overlay): Likewise.
- * ldlang.c: Include ldgram.h after ldexp.h.
- (lang_output_section_statement_lookup): Adjust for fill_type change.
- (print_fill_statement): Likewise.
- (print_padding_statement): Likewise.
- (insert_pad): Now takes a "fill_type *" arg.
- (size_input_section): Likewise.
- (lang_size_sections_1): Likewise.
- (lang_size_sections): Likewise.
- (lang_do_assignments): Likewise.
- (lang_add_fill): Likewise.
- (lang_leave_output_section_statement): Likewise.
- (lang_leave_overlay_section): Likewise.
- (lang_leave_overlay): Likewise.
- Adjust all callers of the above function.
- * ldlex.l: Include ldgram.h after ldexp.h. Allow hex numbers
- starting with "0X" as well as "0x". Return bigint.str for hex
- numbers starting with "0x" or "0X", zero bigint.str otherwise.
- Always use base 16 for numbers starting with "$".
- * ldmain.c: Include ldgram.h after ldexp.h.
- * ldwrite.c (build_link_order): Use bfd_data_link_order in place
- of bfd_fill_link_order.
- * pe-dll.c: Adjust lang_do_assignments calls.
- * emultempl/elf32.em: Likewise.
+ Apply from mainline.
+ 2004-03-27 Alan Modra <amodra@bigpond.net.au>
+ * emultempl/elf32.em: Update new bfd_elf_discard_info name.
* emultempl/hppaelf.em: Likewise.
* emultempl/ppc64elf.em: Likewise.
- * emultempl/beos.em: Include ldgram.h after ldexp.h, adjust
- lang_add_assignment call.
- * emultempl/pe.em: Likewise.
-
-2002-02-14 Phil Edwards <pme@gcc.gnu.org>
-
- * ld.texinfo (VERSION scripts): Symbol names are globbing patterns.
- * ldgram.y (lang_new_vers_regex): Rename to lang_new_vers_pattern;
- the pattern in question is not a regexp.
- * ldlang.c: Likewise.
- * ldlang.h: Likewise.
- * ldlex.l (V_IDENTIFIER): Allow '[', ']', '-', '!', and '^' also.
-
-2002-02-12 Jakub Jelinek <jakub@redhat.com>
-
- * ldlex.l (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): New tokens.
- * ldgram.y (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): New tokens.
- (exp): Add DATA_SEGMENT_ALIGN (exp, exp) and DATA_SEGMENT_END (exp).
- * ldexp.c (exp_data_seg): New variable.
- (exp_print_token): Handle DATA_SEGMENT_ALIGN and DATA_SEGMENT_END.
- (fold_binary): Handle DATA_SEGMENT_ALIGN.
- (exp_fold_tree): Handle DATA_SEGMENT_END.
- Pass allocation_done when recursing instead of hardcoding
- lang_allocating_phase_enum.
- * ldexp.h (exp_data_seg): New.
- * ldlang.c (lang_size_sections_1): Renamed from lang_size_sections.
- (lang_size_sections): New.
- * ld.texinfo (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): Document.
- * scripttempl/elf.sc: Use DATA_SEGMENT_ALIGN and DATA_SEGMENT_END
- if COMMONPAGESIZE is defined.
- * emulparams/elf_i386.sh (COMMONPAGESIZE): Set to 4K.
- * emulparams/elf32_sparc.sh (COMMONPAGESIZE): Set to 8K.
- * emulparams/elf64_sparc.sh (COMMONPAGESIZE): Set to 8K.
- * emulparams/elf64alpha.sh (COMMONPAGESIZE): Set to 8K.
- * emulparams/elf64_ia64.sh (COMMONPAGESIZE): Set to 16K for shared
- libraries only.
-
-2002-02-11 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.in: Regenerate.
-
-2002-02-10 Daniel Jacobowitz <drow@mvista.com>
-
- * lexsup.c: Remove strtoul declaration.
-
-2002-02-10 Daniel Jacobowitz <drow@mvista.com>
-
- * ldmain.c: Add prototype for main ().
- * lexsup.c: Guard declaration of strtoul with HAVE_STDLIB_H.
- * emultempl/lnk960.em (lnk960_choose_target): Function should
- take two arguments.
-
-2002-02-10 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (entry_section): New initialised variable.
- (lang_finish): Use it.
- * ldlang.h (entry_section): Declare.
- * emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Set
- entry_section to ".opd".
-
-2002-02-09 Chris Demetriou <cgd@broadcom.com>
-
- * ld.texinfo (Options): Add back in -nostdlib documentation,
- which had been inadvertently removed.
-
-2002-02-09 Hans-Peter Nilsson <hp@bitrange.com>
-
- * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Adjust
- register section vma to a sane value after emitting error. Make
- fatal conditions cause program exit when emitting message.
-
-2002-02-08 Ivan Guzvinec <ivang@opencores.org>
-
- * configure.tgt: Add or32-*-rtems target.
-
-2002-02-08 Alexandre Oliva <aoliva@redhat.com>
-
- Contribute sh64-elf.
- 2002-01-24 Alexandre Oliva <aoliva@redhat.com>
- * emulparams/shelf32.sh (STACK_ADDR): Define as formerly defined
- in OTHER_RELOCATABLE_SECTIONS.
- 2002-01-18 Alexandre Oliva <aoliva@redhat.com>
- * emulparams/shelf32.sh (STACK_ADDR): Define.
- (OTHER_RELOCATABLE_SECTIONS): Renamed to...
- (OTHER_SECTIONS): this. Removed stack settings.
- * emulparams/shelf64.sh (OTHER_RELOCATABLE_SECTIONS): Do not set.
- (OTHER_SECTIONS): Reset after sourcing shelf32.sh.
- 2001-03-12 DJ Delorie <dj@redhat.com>
- * emultempl/sh64elf.em (sh64_elf_$_before_allocation): Disable
- relaxing if any shmedia or mixed sections are found.
- 2001-03-07 DJ Delorie <dj@redhat.com>
- * emultempl/sh64elf.em (sh64_elf_before_allocation): Pass f to
- einfo. Gracefully decline to output to non-elf formats.
- 2001-03-06 Hans-Peter Nilsson <hpn@redhat.com>
- * emulparams/shelf64.sh (OTHER_RELOCATING_SECTIONS) <.stack>:
- Default to _end aligned to next multiple of 0x40000, plus 0x40000.
- * emulparams/shelf32.sh: Ditto.
- 2001-01-14 Hans-Peter Nilsson <hpn@cygnus.com>
- * emulparams/shelf32.sh (OTHER_RELOCATING_SECTIONS): Tweak
- comment.
- 2001-01-10 Ben Elliston <bje@redhat.com>
- * emulparams/shelf32.sh (OTHER_RELOCATING_SECTIONS): Avoid
- non-portable shell constructs. From Hans-Peter Nilsson.
- 2001-01-09 Hans-Peter Nilsson <hpn@cygnus.com>
- * emulparams/shelf64.sh (EXTRA_EM_FILE): Define empty.
- * Makefile.am (eshelf64.c, eshlelf64.c, eshlelf32.c): Adjust
- dependencies to the shell script include chain.
- * Makefile.in: Regenerate.
- 2001-01-06 Hans-Peter Nilsson <hpn@cygnus.com>
- * emultempl/sh64elf.em: Update and tweak comments.
- (sh64_elf_${EMULATION_NAME}_after_allocation): Always allocate and
- make a .cranges section SEC_IN_MEMORY.
- 2000-12-30 Hans-Peter Nilsson <hpn@cygnus.com>
- * emultempl/sh64elf.em
- (sh64_elf_${EMULATION_NAME}_before_allocation): Don't stop when
- .cranges section found to be necessary; continue and set stored
- section contents flags for sections with non-mixed contents.
- Use a struct sh64_section_data container and sh64_elf_section_data
- to store contents-type flags.
- Remove unused update of "isec".
- (sh64_elf_${EMULATION_NAME}_after_allocation): Only process
- sections marked SHF_SH5_ISA32_MIXED. Use sh64_elf_section_data to
- access contents-type flags. Assert that the associated container
- is initialized. Use that container, not elf_gp_size, to hold size
- of linker-generated cranges contents.
- 2000-12-18 Hans-Peter Nilsson <hpn@cygnus.com>
- * emultempl/sh64elf.em
- (sh64_elf_${EMULATION_NAME}_before_allocation): Exit early if
- there's already a .cranges section. When section flag difference
- is found, don't NULL-check cranges a second time. Tweak comments.
- (sh64_elf_${EMULATION_NAME}_after_allocation): Use size after
- merging, not max size, as size of ld-generated .cranges contents.
- Don't set ELF section flags in output section. When checking for
- needed .cranges descriptors, don't use a variable; compare
- incoming ELF section flags directly to SHF_SH5_ISA32_MIXED. Tweak
- comments.
- 2000-12-18 Hans-Peter Nilsson <hpn@cygnus.com>
- * emultempl/sh64elf.em: New file.
- * Makefile.am (eshelf32.c, eshlelf32.c): Adjust dependencies.
- * Makefile.in: Regenerate.
- * emulparams/shelf32.sh (OUTPUT_FORMAT): Only set if not set.
- (OTHER_RELOCATING_SECTIONS): Ditto.
- (EXTRA_EM_FILE): New, set to sh64elf if not set.
- * emulparams/shlelf32.sh: Stub out all settings except
- OUTPUT_FORMAT. Source shelf32.sh.
- * emulparams/shelf64.sh: Similar, but also keep ELF_SIZE and
- OTHER_RELOCATING_SECTIONS.
- (OTHER_RELOCATING_SECTIONS): Remove .cranges.
- * emulparams/shlelf64.sh: Stub out all settings except
- OUTPUT_FORMAT. Source shelf64.sh.
- 2000-12-15 Hans-Peter Nilsson <hpn@cygnus.com>
- * emulparams/shelf64.sh (OTHER_RELOCATING_SECTIONS): Include
- .cranges section.
- (DATA_START_SYMBOLS): Define, provide ___data.
- (OTHER_READONLY_SYMBOLS): Define, provide ___rodata and align to 8
- for consecutive .data section.
- (OTHER_GOT_SECTIONS): Define, align to 8 for consecutive .bss
- section after .data section.
- * emulparams/shlelf64.sh: Ditto.
- * emulparams/shelf32.sh: Ditto.
- (ALIGNMENT): Define to 8.
- * emulparams/shelf32.sh: Ditto.
- 2000-12-12 Hans-Peter Nilsson <hpn@cygnus.com>
- * configure.tgt (sh64-*-elf*): Assign targ_extra_libpath to get
- built-in linker scripts.
- 2000-11-30 Hans-Peter Nilsson <hpn@cygnus.com>
- * emulparams/shlelf64.sh: New.
- * emulparams/shelf64.sh: New.
- * configure.tgt (sh64-*-elf*): Add shelf64 and shlelf64 to
- targ_extra_emuls.
- * Makefile.am: Add support for shlelf64 and shelf64.
- * Makefile.in: Regenerate.
- 2000-11-29 Hans-Peter Nilsson <hpn@cygnus.com>
- * configure.tgt (sh64-*-elf*): Add shelf as default.
- Add shlelf to targ_extra_emuls.
- 2000-11-24 Hans-Peter Nilsson <hpn@cygnus.com>
- * emulparams/shelf32.sh: New file.
- * emulparams/shlelf32.sh: New file.
- * Makefile.am: Add support for shlelf32 and shelf32.
- * configure.tgt: Map sh64-*-elf* to shlelf32 and shelf32.
- * Makefile.in: Regenerate.
-
-2002-02-05 Hans-Peter Nilsson <hp@axis.com>
-
- * ldlang.c (lang_reset_memory_regions): Rename from
- reset_memory_regions. Change all callers. Make public.
- * ldlang.h (lang_reset_memory_regions): Prototype.
- * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Call
- lang_reset_memory_regions before lang_size_sections.
- * emultempl/hppaelf.em (hppaelf_layout_sections_again): Likewise.
- * emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Likewise.
-
-2002-02-04 Hans-Peter Nilsson <hp@bitrange.com>
-
- * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Use signed
- arithmetic when checking for too many global registers.
-
-2002-02-02 Jason Thorpe <thorpej@wasabisystems.com>
-
- * Makefile.am (ALL_EMULATIONS): Add ehppanbsd.o.
- (ehppanbsd.c): New rule.
- * Makefile.in: Regenerate.
- * configure.tgt (hppa*-*-netbsd*): New target.
- * emulparams/hppalinux.sh: Add comment to check other files
- that source this file it is modified, and list which
- files that do.
- * emulparams/hppanbsd.sh: New file.
-
-2002-02-01 Geoffrey Keating <geoffk@redhat.com>
-
- * scripttempl/xstormy16.sc: Don't allocate extra space for the
- stack.
-
-2002-02-01 Hans-Peter Nilsson <hp@bitrange.com>
-
- Support on-demand global register allocation from
- R_MMIX_BASE_PLUS_OFFSET relocs.
- * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Rename from
- mmix_set_reg_section_vma. Call
- _bfd_mmix_finalize_linker_allocated_gregs.
- (mmix_before_allocation): New function.
- (LDEMUL_AFTER_ALLOCATION): Set to mmix_after_allocation.
- (LDEMUL_BEFORE_ALLOCATION): Define to mmix_before_allocation.
- * scripttempl/mmo.sc (.text): Mark .init, .fini as KEEP.
- (.MMIX.reg_contents): Add .MMIX.reg_contents.linker_allocated
- before .MMIX.reg_contents.
- * emultempl/mmo.em (gldmmo_before_allocation): Define to default.
- (mmo_after_open): New function.
- (LDEMUL_AFTER_OPEN): Define to mmo_after_open.
- * emulparams/elf64mmix.sh (OTHER_SECTIONS): Tweak formatting. Add
- .MMIX.reg_contents.linker_allocated before .MMIX.reg_contents.
-
-2002-01-31 Ivan Guzvinec <ivang@opencores.org>
-
- * emulparams/or32.sh: New file.
- * emulparams/or32elf.sh: New file.
- * scripttempl/or32.sc: New file.
- * configure.tgt : Add support for or32.
- * configure: Regenerate
- * Makefile.am: Add support for or32.
- * Makefile.in: Regenerate.
- * NEWS: Mention support for or32.
- * po/ld.pot: Regenerate.
-
-2002-01-29 Chris Demetriou <cgd@broadcom.com>
- Mitch Lichtenberg <mpl@broadcom.com>
-
- * emulparams/elf32bmip.sh (EXTRA_EM_FILE): Define to be mipself.
- * emultempl/mipself.em: New file to handle MIPS ELF embedded
- reloc creation (ld --embedded-relocs).
-
-2002-01-27 Daniel Jacobowitz <drow@mvista.com>
-
- * configure: Regenerated.
-
-2002-01-26 Hans-Peter Nilsson <hp@bitrange.com>
-
- * Makefile.am (install): Depend on install-info.
- * Makefile.in: Regenerate.
-
-2002-01-26 Christian Rose <menthos@menthos.com>
-
- * ldmain.c (main): Use full sentences to ease translation.
-
-2002-01-26 Nick Clifton <nickc@cambridge.redhat.com>
-
- * po/fr.po: Updated version.
-
-2002-01-25 Nick Clifton <nickc@cambridge.redhat.com>
-
- * po/es.po: Updated version.
-
-2002-01-25 Andreas Jaeger <aj@suse.de>
-
- * ldlex.l (yy_input): Correct error check.
-
-2002-01-25 Alan Modra <amodra@bigpond.net.au>
-
- * ldmisc.c (demangle): Put back dots when string not demangled.
-
-2002-01-22 Richard Henderson <rth@redhat.com>
-
- * emulparams/elf64alpha.sh (NOP): Use unop.
-
-2002-01-21 Andreas Jaeger <aj@suse.de>
-
- * ldlex.l: Use fread instead of read.
-
-2002-01-21 Jason Thorpe <thorpej@wasabisystems.com>
-
- * configure.tgt (ia64-*-netbsd*): New target.
-
-2002-01-21 H.J. Lu <hjl@gnu.org>
-
- * emulparams/elf32btsmip.sh (SHLIB_TEXT_START_ADDR): Change to
- 0.
- * emulparams/elf64btsmip.sh (SHLIB_TEXT_START_ADDR): Likewise.
-
-2002-01-18 Andreas Jaeger <aj@suse.de>
-
- * ldver.c (ldversion): Update year.
-
-2002-01-17 Nick Clifton <nickc@cambridge.redhat.com>
-
- * po/ld.pot: Regenerate.
-
-2002-01-16 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am (eelf64ppc.c, eelf64lppc.c): Depend on ppc64elf.em.
- * Makefile.in: Regenerate.
- * emulparams/elf64ppc.sh (EXTRA_EM_FILE): Define.
- * emultempl/ppc64elf.em: New file.
-
-2002-01-15 DJ Delorie <dj@redhat.com>
-
- * scripttempl/pe.sc: Add support for constructor priorities.
-
-2002-01-07 Marek Michalkiewicz <marekm@amelek.gda.pl>
-
- * emulparams/avr1200.sh (DATA_START): Define as 0x60.
- * emulparams/avr23xx.sh: Likewise.
- * emulparams/avr4433.sh: Likewise.
- * emulparams/avr44x4.sh: Likewise.
- * emulparams/avr85xx.sh: Likewise.
- * emulparams/avrmega103.sh: Likewise.
- * emulparams/avrmega161.sh: Likewise.
- * emulparams/avrmega603.sh: Likewise.
- * scripttempl/elf32avr.sc: Use DATA_START instead of 0x60.
-
-2002-01-08 Alexandre Oliva <aoliva@redhat.com>
-
- * ldlang.c (walk_wild_section): Exclude object file if enclosing
- archive is excluded.
-
-2002-01-07 Jason Thorpe <thorpej@wasabisystems.com>
-
- * Makefile.am (ALL_EMULATIONS): Add eshelf_nbsd.o and eshlelf_nbsd.o.
- (eshelf_nbsd.c): New rule.
- (eshlelf_nbsd.c): New rule.
- * Makefile.in: Regenerate.
- * configure.tgt (sh*le-*-netbsdelf*): New target.
- (sh*-*-netbsdelf*): New target.
- * emulparams/shelf.sh: Document that shelf_nbsd.sh sources this file.
- * ld/emulparams/shelf_nbsd.sh: New emulation.
- * ld/emulparams/shlelf_nbsd.sh: New emulation.
-
-2002-01-07 Nick Clifton <nickc@cambridge.redhat.com>
-
- * po/es.po: New file: Spanish translation.
- * configure.in (ALL_LINGUAS): Add es.
- * configure: Regenerate.
-
-2002-01-06 John Marshall <jmarshall@acm.org>
-
- * ld.texinfo: Note that --emit-relocs is currently only
- implemented for ELF.
-
-2002-01-05 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Make use
- of bfd_section_list_remove and bfd_section_list_insert macros.
- * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
- * emultempl/mmo.em (mmo_place_orphan): Likewise.
-
-2002-01-04 Jason Thorpe <thorpej@wasabisystems.com>
-
- * configure.tgt (x86_64-*-netbsd*): New target.
-
-2001-12-21 Tom Rix <trix@redhat.com>
-
- (gld*_create_output_section_statements): New function.
- For -binitfini support.
- * emultempl/aix.em (gld*_before_parse): Fix comment.
- * emultempl/aix.em (gld*_parse_args): Fix comment.
-
-2001-12-20 Jason Thorpe <thorpej@wasabisystems.com>
-
- * configure.tgt (mips*-dec-netbsd*): Delete alias for
- mips*el-*-netbsd*.
- (sparc64-*-netbsd*): Add elf32_sparc to targ_extra_emuls.
-
- * configure.tgt (arm-*-netbsdelf*): Add target.
- (arm-*-netbsd*): Add armelf and armelf_nbsd to targ_extra_emuls.
- * emulparams/armelf_nbsd.sh: Added.
- * Makefile.am: Add rules for earmelf_nbsd.
- * Makefile.in: Regenerate.
-
-2001-12-19 Andreas Jaeger <aj@suse.de>,
- Susanne Oberhauser <froh@suse.de>
-
- * configure.host: Add rules for x86_64-*linux-gnu. Change
- s390x-linux entry to use gcc to report configuration, replace gcc
- with $CC in s390-linux
-
-2001-12-19 Andreas Jaeger <aj@suse.de>
-
- * ld.texinfo (VERSION): Fix markup.
-
-2001-12-18 matthew green <mrg@eterna.com.au>
-
- * Makefile.am (ALL_EMULATIONS): Add m68kelfnbsd.o.
- (m68kelfnbsd.c): New rule.
- * Makefile.in: Regenerate.
- * configure.tgt (m68*-hp-netbsd*): Renamed to ..
- (m68*-*-netbsd*4k*): .. this.
- (m68*-*-netbsdelf*): New target.
- (m68*-*-netbsd*): Also include ELF support.
- (m68*-*-netbsdaout*): New alias for m68*-*-netbsd*.
- * emulparams/m68kelfnbsd.sh: New emulation.
-
-2001-12-18 Jakub Jelinek <jakub@redhat.com>
-
- * ldgram.y (vers_node): Support anonymous version tags.
- * ldlang.c (lang_register_vers_node): Ensure anonymous version
- tag is not defined together with non-anonymous versions.
- * ld.texinfo: Document it.
-
-2001-12-18 Nick Clifton <nickc@cambridge.redhat.com>
-
- * po/tr.po: New file: Turkish translation.
- * configure.in (ALL_LINGUAS): Add tr.
- * configure: Regenerate.
-
-2001-12-17 Jason Thorpe <thorpej@wasabisystems.com>
-
- * Makefile.am: Add rules for eelf64alpha_nbsd.
- * Makefile.in: Regenerate.
- * configure.tgt (alpha*-*-netbsd*): Set
- targ_emul to elf64alpha_nbsd.
- * emulparams/elf64alpha_nbsd.sh: Added.
-
-2001-12-17 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Adjust
- section_tail when fiddling with section list.
- (gld${EMULATION_NAME}_list_options): Ensure sentences aren't
- broken into separate strings to make translation easier.
- * emultempl/mmo.em (mmo_place_orphan): Adjust section_tail when
- fiddling with section list.
- * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
-
-2001-12-16 Hans-Peter Nilsson <hp@bitrange.com>
-
- * scripttempl/mmo.sc: Add .debug_ranges to listed sections.
-
-2001-12-15 Alan Modra <amodra@bigpond.net.au>
-
- * ldmain.c (main): Initialise link_info.eh_frame_hdr.
-
-2001-12-13 Jakub Jelinek <jakub@redhat.com>
-
- * emultempl/elf32.em (finish): Supply output_bfd
- to bfd_elf*_discard_info.
- (OPTION_EH_FRAME_HDR): Define.
- (longopts): Add --eh-frame-hdr.
- (parse_args): Handle it.
- (list_options): Add --eh-frame-hdr to help.
- * emultempl/hppaelf.em (finish): Supply output_bfd
- to bfd_elf*_discard_info.
- * scripttempl/elf.sc (.eh_frame_hdr): Add.
-
-2001-12-13 Alan Modra <amodra@bigpond.net.au>
-
- * lexsup.c (parse_args): Don't pass shortopts to second call to
- getopt functions. Restore optind rather than decrementing before
- second call. Remove errind as it now duplicates last_optind.
-
-2001-12-11 Christopher Faylor <cgf@redhat.com>
-
- * emultempl/pe.em (gld_${EMULATION_NAME}_list_options): Fix typo.
-
-2001-12-07 Geoffrey Keating <geoffk@redhat.com>
- Richard Henderson <rth@redhat.com>
-
- * Makefile.am: Add support for xstormy16.
- * configure.tgt: Add support for xstormy16.
- * Makefile.in: Regenerate.
- * emulparams/elf32xstormy16.sh: New file.
- * scripttempl/xstormy16.sc: New file.
-
-2001-10-01 Christopher Faylor <cgf@cygnus.com>
-
- * Makefile.in (LIB_PATH): Make configurable.
- (GENSCRIPTS): Set LIB_PATH in environment.
- * configure.in: Substitute LIB_PATH.
- * configure: Regenerate.
- * configure.tgt (*cygwin): Set LIB_PATH for cross build.
- * configure.host (*cygwin): Add /usr/lib/w32api to NATIVE_LIB_DIRS.
-
-2001-12-07 Nick Clifton <nickc@cambridge.redhat.com>
-
- * lexsup.c (ld_options): Insert 'PROGRAM' into the text string
- describing the -N option so that it is easier to translate into
- foreign languages.
-
-2001-12-05 Nick Clifton <nickc@cambridge.redhat.com>
-
- * emultempl/pe.em (..._list_options): Replace multiple fprintf
- statements describing a single option with a single, newline
- escaped fprintf. This allows better translation into other
- languages.
-
- * ldmain.c (add_archive_element): Combine multiple strings
- into a single string to permit better translation into other
- languages.
-
-2001-12-05 Tom Rix <trix@redhat.com>
-
- * Makefile.am: Remove eaixppc64.
- * Makefile.in: Regenerate.
-
-2001-12-04 Tom Rix <trix@redhat.com>
-
- * emultempl/aix.em (choose_target): Change default target to
- OUTPUT_FORMAT for ppcmacos. Add braces to remove compiler
- warning.
- (gld*_read_file): Fix typo.
- (change_symbol_mode): Add prototype.
- (is_syscall): Same.
-
- * emulparams/aixppc.sh (SYSCALL_MASK, SYMBOL_MODE_MASK): Delete.
- * emulparams/aixrs6.sh : Same.
- * emulparams/ppcmacos.sh : Same.
- * emulparams/aixppc64.sh : Delete file.
- * emultempl/aix.em : Formatting changes.
-
-2001-12-04 Hans-Peter Nilsson <hp@axis.com>
-
- * emulparams/criself.sh (NO_SMALL_DATA): Set, to yes.
- (OTHER_BSS_END_SYMBOLS): Don't refer to .sbss when setting
- __Sbss.
- (OTHER_END_SYMBOLS): Fix formatting.
- * emulparams/crislinux.sh (NO_SMALL_DATA): Set, to yes.
- (OTHER_END_SYMBOLS): Fix formatting.
-
-2001-12-04 Alan Modra <amodra@bigpond.net.au>
-
- * ldexp.c (exp_print_token): Correct "table" entry for RSHIFT.
-
-2001-12-02 Tom Rix <trix@redhat.com>
-
- * configure.tgt : Remove eaixppc64 emulations.
- * Makefile.in : Remove eaixppc64.c
- * ldemul.c (ldemul_choose_target): New parameters argc, argv.
- (ldemul_default_target): Same.
- * emultempl/gld960.em (gld960_choose_target): Same.
- * emultempl/gld960c.em (gld960_choose_target): Same.
- * scripttempl/aix.sc: Remove OUTPUT_FORMAT.
- * emultempl/aix.em (is_syscall): syscall_mask now a variable.
- * emultempl/aix.em (gld*_read_file): symbol_mode_mask now a variable.
- * emultempl/aix.em (gld*_parse_args): Handle -b32 -b64 emulation.
- * emultempl/aix.em (choose_target): New function. Handle emulation of
- -b32 and -b64.
-
-2001-11-27 H.J. Lu <hjl@gnu.org>
-
- * emulparams/elf_i386.sh (NO_SMALL_DATA): Set to yes.
- * emulparams/elf_i386_be.sh (NO_SMALL_DATA): Likewise.
- * emulparams/elf_i386_chaos.sh (NO_SMALL_DATA): Likewise.
- * emulparams/elf_i386_ldso.sh (NO_SMALL_DATA): Likewise.
- * emulparams/elf_x86_64.sh (NO_SMALL_DATA): Likewise.
- * emulparams/m68kelf.sh (NO_SMALL_DATA): Likewise.
- * emulparams/elf32_sparc.sh (NO_SMALL_DATA): Likewise.
- * emulparams/elf64_sparc.sh (NO_SMALL_DATA): Likewise.
-
- * scripttempl/elf.sc (SBSS): New. Define if ${NO_SMALL_DATA}
- is not empty.
- (SDATA): Likewise.
- (REL_SDATA): Likewise.
- (REL_SBSS): Likewise.
- (REL_SDATA2): Likewise.
- (REL_SBSS2): Likewise.
- (SBSS2): Define if ${NO_SMALL_DATA} is not empty.
- (SDATA2): Likewise.
-
-2001-11-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>
-
- * scripttempl/elfm68hc11.sc (CTOR, DTOR): Put constructor and
- destructor in rom.
- * scripttempl/elfm68hc12.sc (CTOR, DTOR): Likewise.
-
-2001-11-22 H.J. Lu <hjl@gnu.org>
-
- * Makefile.in: Regenerated with automake based on automake
- 1.4-8 in RedHat 7.1.
-
-2001-11-22 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Define.
- (config.status): Delete rule.
- Add extra dependencies to cover sourced emulparams files.
- * Makefile.in: Regenerate.
-
- * scripttempl/elf.sc: Order <section>, <section>.* and
- corresponding linkonce sections as seen in input files.
- Formatting fixes. Zero vma of all sections if not relocating.
- (STACK): Define and insert if STACK_ADDR defined.
- (OTHER_RELOCATING_SECTIONS): Delete.
- (OTHER_END_SYMBOLS): Define.
- (OTHER_READONLY_SECTIONS): Always insert, not just when relocating.
- (OTHER_READWRITE_SECTIONS): Likewise.
- (OTHER_GOT_SECTIONS): Likewise.
- (OTHER_SDATA_SECTIONS): Likewise.
- (OTHER_BSS_SECTIONS): Likewise.
- * scripttempl/elfi370.sc (OTHER_READONLY_SECTIONS): Likewise.
- (OTHER_READWRITE_SECTIONS): Likewise.
- * scripttempl/nw.sc (OTHER_READONLY_SECTIONS): Likewise.
- (OTHER_READWRITE_SECTIONS): Likewise
-
- * emulparams/armelf.sh (OTHER_RELOCATING_SECTIONS): Delete.
- (STACK_ADDR): Define.
- * emulparams/armelf_oabi.sh: As for armelf.sh.
- * emulparams/elf32mcore.sh: As for armelf.sh.
- * emulparams/h8300elf.sh: As for armelf.sh.
- * emulparams/mn10200.sh: As for armelf.sh.
- * emulparams/shelf.sh: As for armelf.sh.
-
- * emulparams/elf32fr30.sh (OTHER_RELOCATING_SECTIONS): Delete.
- (OTHER_END_SYMBOLS): Define.
- * emulparams/m32relf.sh: As for elf32fr30.sh.
- * emulparams/h8300helf.sh: As for elf32fr30.sh.
- * emulparams/h8300self.sh: As for elf32fr30.sh.
-
- * emulparams/criself.sh (OTHER_READONLY_SECTIONS): Protect symbol
- defines with RELOCATING test.
- (OTHER_SDATA_SECTIONS): Likewise.
- (OTHER_RELOCATING_SECTIONS): Delete, replacing with..
- (OTHER_END_SYMBOLS): ..this.
- * emulparams/crislinux.sh: As for criself.sh.
-
- * emulparams/elf32bmipn32.sh (OTHER_SDATA_SECTIONS): Zero vma
- if not relocating.
- (OTHER_RELOCATING_SECTIONS): Delete, replacing with..
- (OTHER_SECTIONS): ..this. Zero vma if not relocating. Order
- normal and linkonce sections as seen in input files.
- * emulparams/elf32bmip.sh (DATA_ADDR): Don't define if EMBEDDED.
- (TEXT_DYNAMIC): Likewise.
- (INITIAL_READONLY_SECTIONS): Zero vma if not relocating.
- (OTHER_SDATA_SECTIONS): Likewise.
- * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Likewise.
- * emulparams/shlelf_linux.sh (OTHER_READWRITE_SECTIONS): Likewise.
- * emulparams/elf64alpha.sh (OTHER_READONLY_SECTIONS): Likewise.
- * emulparams/hppalinux.sh (OTHER_READONLY_SECTIONS): Likewise.
- * emulparams/elf64_aix.sh (OTHER_GOT_SECTIONS): Likewise.
- (OTHER_PLT_RELOC_SECTIONS): Likewise.
- (OTHER_READONLY_SECTIONS): Likewise. Order normal and linkonce
- sections as seen in input files.
- * emulparams/elf64_ia64.sh: As for emulparams/elf64_aix.sh.
- * emulparams/hppa64linux.sh (OTHER_READONLY_SECTIONS): Zero vma
- if not relocating.
- (OTHER_READWRITE_SECTIONS, OTHER_BSS_SECTIONS): Likewise.
- (OTHER_BSS_END_SYMBOLS): Merge from elf64hppa.sh.
- * emulparams/elf64mmix.sh (OTHER_RELOCATING_SECTIONS): Delete.
- (OTHER_SECTIONS): Instead, use this..
- (OTHER_END_SYMBOLS): ..and this.
-
- * emulparams/elf32b4300.sh: Source elf32bmip.sh, remove duplicates.
- * emulparams/elf32bsmip.sh: Likewise.
- * emulparams/elf32btsmip.sh: Likewise.
- * emulparams/elf32ebmip.sh: Likewise.
- * emulparams/elf32lmip.sh: Likewise.
- * emulparams/elf32elmip.sh: Source elf32lmip.sh, remove duplicates.
- * emulparams/elf32lsmip.sh: Likewise.
- * emulparams/elf32ltsmip.sh: Source elf32btsmip.sh, remove duplicates.
- * emulparams/elf32l4300.sh: Source elf32b4300.sh, remove duplicates.
- * emulparams/elf64bmip.sh: Source elf32bmipn32.sh, remove duplicates.
- * emulparams/elf64btsmip.sh: Likewise.
- * emulparams/elf64ltsmip.sh: Source elf64btsmip.sh, remove duplicates.
- * emulparams/elf32lppc.sh: Source elf32ppc.sh, remove duplicates.
- * emulparams/elf32ppclinux.sh: Likewise.
- * emulparams/elf32ppcsim.sh: Likewise.
- * emulparams/elf32lppcsim.sh: Source elf32lppc.sh, remove duplicates.
- * emulparams/elf64hppa.sh: Source hppa64linux.sh, remove duplicates.
- * emulparams/h8300helf.sh: Source h8300elf.sh, remove duplicates.
- * emulparams/h8300self.sh: Likewise.
- * emulparams/mn10300.sh: Source mn10200.sh, remove duplicates.
- * emulparams/sh.sh: Comment.
- * emulparams/shl.sh: Source sh.sh, remove duplicates.
- * emulparams/shlelf.sh: Source shelf.sh, remove duplicates.
- * emulparams/shelf_linux.sh: Source shlelf_linux.sh, remove duplicates.
-
-2001-11-21 David Heine <dlheine@tensilica.com>
- Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (map_input_to_output_sections): Replace "break"
- accidentally removed with 2001-08-03 change.
- (lang_gc_sections_1): Likewise.
-
-2001-11-21 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (walk_wild_section): Move sec == NULL case out of loop.
-
-2001-11-20 Angela Marie Thomas <angela@redhat.com>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Use NULL instead
- of false when calling lang_size_sections.
- * emultempl/hppaelf.em (hppaelf_layout_sections_again): Likewise.
-
-2001-11-15 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Only emit this
- function when LDEMUL_FINISH isn't set to the same name. Don't
- call ${LDEMUL_FINISH}.
- (ld_${EMULATION_NAME}_emulation): Call $LDEMUL_FINISH if defined.
- * emultempl/armelf.em (arm_elf_finish): Call
- gld${EMULATION_NAME}_finish.
- * emultempl/hppaelf.em (hppaelf_finish): Rename to
- gld${EMULATION_NAME}_finish. Call bfd_elf32_discard_info and
- hppaelf_layout_sections_again if necessary.
- (need_laying_out): New var.
- (hppaelf_layaout_sections_again): Rename to
- hppaelf_layout_sections_again. Clear need_laying_out.
- (PARSE_AND_LIST_OPTIONS): Format text.
-
-2001-11-14 H.J. Lu <hjl@gnu.org>
-
- * emultempl/armelf.em (arm_elf_finish): Renamed from
- gld${EMULATION_NAME}_finish.
- (LDEMUL_FINISH): Set to arm_elf_finish.
-
-2001-11-14 Daniel Jacobowitz <drow@mvista.com>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_finish): New.
- (struct ld_emulation_xfer_struct): Use it.
-
-2001-11-13 Ross Alexander <ross.alexander@uk.neceur.com>
-
- * emulparams/elf64hppa.sh (OTHER_BSS_END_SYMBOLS): Add
- additional symbols referenced by newer crt0.o files from HP.
-
-2001-11-12 Anthony Green <green@redhat.com>
-
- * emulparams/armelf.sh (DATA_START_SYMBOLS): New symbol.
-
-2001-11-12 Alfred M. Szmidt <ams@kemisten.nu>
-
- * Makefile.am (GENSCRIPTS): Quote ${exec_prefix}.
- * Makefile.in: Regenerate.
-
-2001-11-02 Stephane Carrez <Stephane.Carrez@worldnet.fr>
-
- * ld.texinfo: Use @command for commands, @option for options.
- * Makefile.am (POD2MAN): Use 'GNU Development Tools' for
- the page man title.
- * Makefile.in: Rebuild.
-
-2001-11-04 Chris Demetriou <cgd@broadcom.com>
-
- * configure.tgt (mips*el-*-netbsd*, mips*-*-netbsd*):
- Add support for targets.
-
-2001-11-02 Nick Clifton <nickc@cambridge.redhat.com>
-
- * configure.in (ALL_LINGUAS): Add "fr" and "sv"
- * configure: Regernate.
- * po/fr.po: New file.
- * po/sv.po: New file.
-
-2001-11-01 NIIBE Yutaka <gniibe@m17n.org>
-
- * configure.tgt (sh-*-linux): Set targ_emul, targ_extra_emuls
- as little endian default and to support big endian.
-
-2001-11-01 Chris Demetriou <cgd@broadcom.com>
-
- * ld.texinfo (Options): Document new option, -nostdlib.
- * lexsup.c (OPTION_NOSTDLIB): New definition.
- (ld_options): Add entry for "nostdlib".
- (parse_args): Handle OPTIONS_NOSTDLIB.
- * ldfile.c (ldfile_add_library_path): Don't add directories
- to the search path if they weren't specified on the command line
- and -nostdlib was specified.
- * ld.h (ld_config_type): New member only_cmd_line_lib_dirs.
-
-2001-10-31 Nick Clifton <nickc@cambridge.redhat.com>
-
- * lexsup.c (parse_args): Prevent infinite parsing loop when
- "-rpath.a" is specified on the command line.
- Replace calls to fprintf with calls to einfo.
-
-2001-10-31 John Marshall <jmarshall@acm.org>
-
- * ld.texinfo: A historical requirement that MEMORY and SECTIONS
- appear only once across all the linker scripts involved in a link
- invocation no longer applies. Make the documentation reflect
- that.
-
-2001-10-31 NIIBE Yutaka <gniibe@m17n.org>
-
- * configure.tgt: Supports sh3/sh4/sh3eb/sh4eb-unknown-linux-gnu
- targets.
- (sh-*-linux*): Added targ_extra_libpath.
-
-2001-10-31 David Heine <dlheine@tensilica.com>
-
- * ldlang.c (lang_size_sections): Keep a valid output_offset field
- for padding statements.
-
-2001-10-30 Hans-Peter Nilsson <hp@bitrange.com>
-
- * configure.tgt (mmix-*-*): New target.
- * Makefile.am (ALL_EMULATIONS): Add eelf64mmix.o and emmo.o.
- Add dependencies to match.
- * emulparams/mmo.sh, emulparams/elf64mmix.sh, emultempl/mmo.em,
- emultempl/mmix-elfnmmo.em, emultempl/mmixelf.em,
- scripttempl/mmo.sc: New files.
- * gen-doc.texi: @set MMIX.
- * ld.texinfo: Ditto.
- [MMIX] Add MMIX node.
- * Makefile.in: Regenerate.
-
-2001-10-29 Kazu Hirata <kazu@hxi.com>
-
- * ldlang.c: Fix a comment typo.
-
-2001-10-23 Alan Modra <amodra@bigpond.net.au>
-
- * configure.host: Move alpha*-*-linux-gnu* entry to generic
- entries, and match *-*-linux*.
-
-2001-10-20 Alan Modra <amodra@bigpond.net.au>
-
- * ldgram.y (mri_script_command): Surround processing of INCLUDE
- with ldlex_script, ldlex_popstate.
- (ifile_p1): Likewise.
- * ldlex.l (EOF): Don't BEGIN(SCRIPT). Restore lineno from the
- correct slot.
- (lex_push_file): Save current lineno to lineno_stack. Set lineno
- to 1. Don't BEGIN(SCRIPT).
- (lex_redirect): Similarly.
- * ldmain.c (main): Set yydebug non-zero if YYDEBUG.
-
-2001-10-20 Nick Clifton <nickc@cambridge.redhat.com>
-
- * scripttempl/armcoff.sc: Define __EH_FRAME_BEGIN__ and
- __EH_FRAME_END__ and accept eh frames into data section.
- Add ctor and dtor sections.
-
-2001-10-19 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
-
- * pe-dll.c (autofilter_objectlist): Add gcrt0.o.
- (auto-export): Fix indentation.
-
-2001-10-18 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
-
- * pe-dll.c (autofilter_objectlist): Add startup objects
- for profiling.
- (auto-export): Constify char * p.
- Extract file basename and use strcmp rather than ststr
- for object lookup.
-
-2001-10-18 Chris Demetriou <cgd@broadcom.com>
-
- * ldmain.c (get_emulation): Improve comment about the handling
- of -mipsN options.
-
-2001-10-17 Alan Modra <amodra@bigpond.net.au>
-
- * po/POTFILES.in: Regenerate.
-
-2001-10-16 Vassili Karpov <malc@pulsesoft.com>
-
- * emultempl/elf32.em (gld*_list_options): Remove extra '\t' from
- -z nocopyreloc and -z nocombreloc usage strings.
-
-2001-10-12 Vassili Karpov <malc@pulsesoft.com>
-
- * emultempl/elf32.em (gld*_list_options): Include -z nocopyreloc
- in usage.
-
-2001-10-11 Aleksey Romanov <aromanov@ennovatenetworks.com>
-
- * scripttempl/armaout.sc: Place .bss section after end of aligned
- data section to match behaviour of aout code in constructrion of
- header.
-
-2001-10-11 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
-
- * pe-dll.c (autofilter_entry_type autofilter_liblist: Add
- startup files for mingw32 dlls to list.
-
-2001-10-10 Chris Demetriou <cgd@broadcom.com>
-
- * emultempl/elf32.em: Fix shell 'if' usage for portability.
-
-2001-10-08 Aldy Hernandez <aldyh@redhat.com>
-
- * configure.tgt (targ): Add arm9e-*-elf.
-
-2001-10-05 H.J. Lu <hjl@gnu.org>
-
- * genscripts.sh: Fix a typo in the last change.
-
-2001-10-05 Jakub Jelinek <jakub@redhat.com>
-
- * emultempl/elf32.em (gld_*_list_options): Include -z combreloc and
- -z nocombreloc in usage.
-
-2001-10-03 Jim Blandy <jimb@redhat.com>
-
- * genscripts.sh: Include a comment at the top of each generated
- script, explaining its purpose.
-
-2001-10-03 Vassili Karpov <malc@pulsesoft.com>
-
- * emultempl/elf32.em (parse_args): Handle -z nocopyreloc.
- * NEWS: Mention -z nocopyreloc.
- * ld.texinfo (Options): Describe nocopyreloc.
-
-2001-10-03 Alan Modra <amodra@bigpond.net.au>
-
- * configure: Regenerate.
-
-2001-10-02 Alan Modra <amodra@bigpond.net.au>
-
- * ldver.h (ld_program_version): Remove declaration.
- * lexsup.c (parse_args): Move printing of copyright message..
- * ldver.c (ldversion): .. to here.
- Use BFD_VERSION_STRING in place of BFD_VERSION.
- (ld_program_version): Remove.
- * Makefile.am (Makefile): Depend on bfd/configure.in.
- Run "make dep-am".
- * Makefile.in: Regenerate.
-
-2001-09-30 Hans-Peter Nilsson <hp@bitrange.com>
-
- * Makefile.am: Update dependencies with "make dep-am".
- * Makefile.in: Regenerate.
-
-2001-09-29 John Reiser <jreiser@BitWagon.com>
-
- * ldlang.c (lang_common): Conditionally inhibit Common allocation.
- * lexsup.c: Add --no-define-common commandline option.
- * ldgram.y: Add INHIBIT_COMMON_ALLOCATION script command.
- * ldlex.l: Likewise.
- * ld.h: Add command_line.inhibit_common_definition.
- * ldmain.c (main): Initialize.
- * ld.texinfo: Document.
-
-2001-09-26 Alan Modra <amodra@bigpond.net.au>
-
- * ldmisc.c (USE_STDARG): Remove.
- (info_msg): Define using VPARAMS, VA_OPEN, VA_FIXEDARG, VA_CLOSE.
- (einfo): Likewise.
- (minfo): Likewise.
- (lfinfo): Likewise.
-
- * ldmisc.h: Remove #ifdef ANSI_PROTOTYPES and non-ansi
- declarations. Update copyright.
-
-2001-09-24 Charles Wilson <cwilson@ece.gatech.edu>
-
- * pe-dll.c: Remove obsoleted declaration of
- pe_get_data_import_dll_name.
- (pe_create_import_fixup): Fix thinko.
-
- * ld.texinfo(enable-auto-import): Clarify the explanation.
-
-2001-09-24 Nick Clifton <nickc@cambridge.redhat.com>
-
- * pe-dll.c (pe_create_import_fixup): Revert previous patch.
- * emultemp/pe.em (pe_data_import_dll): Move definition outside of
- DLL_SUPPORT controlled code.
-
-2001-09-24 Charles Wilson <cwilson@ece.gatech.edu>
-
- * emultempl/pe.em(pe_data_import_dll): Make static.
- (pe_get_data_import_dll_name): New accessor function.
- * pe-dll.c(pe_create_import_fixup): call
- pe_get_data_import_dll_name() from pe.em, instead of
- directly accessing pe_data_import_dll variable from pe.em.
-
-2001-09-18 Bruno Haible <haible@clisp.cons.org>
-
- * deffilep.y: Include "safe-ctype.h" instead of <ctype.h>.
- (def_file_add_directive): Use ISSPACE instead of isspace.
- (def_lex): Use ISDIGIT/ISXDIGIT/ISALPHA/ISALNUM instead of
- isdigit/isxdigit/isalpha/isalnum.
- * emultempl/aix.em: Include "safe-ctype.h" instead of <ctype.h>.
- (gld${EMULATION_NAME}_read_file): Use ISSPACE instead of isspace.
- * emultempl/elf32.em: Include "safe-ctype.h" instead of <ctype.h>.
- (gld${EMULATION_NAME}_place_orphan): Use ISALNUM instead of
- isalnum.
- * emultempl/gld960c.em: Include "safe-ctype.h" instead of <ctype.h>.
- (gld960_set_output_arch): Use ISUPPER/TOLOWER instead of
- isupper/tolower.
- * emultempl/sunos.em: Include "safe-ctype.h" instead of <ctype.h>.
- (gld${EMULATION_NAME}_search_dir): Use ISDIGIT instead of isdigit.
- * ldctor.c: Include "safe-ctype.h" instead of <ctype.h>.
- (ctor_prio): Use ISDIGIT instead of isdigit.
- * ldfile.c: Include "safe-ctype.h" instead of <ctype.h>.
- (ldfile_open_file_search): Use ISALPHA instead of isalpha.
- (ldfile_add_arch): Use ISUPPER/TOLOWER instead of
- isupper/tolower.
- * ldlang.c: Include "safe-ctype.h" instead of <ctype.h>.
- (stricpy): Use TOLOWER instead of isupper/tolower.
- (lang_leave_overlay_section): Use ISALNUM instead of isalnum.
- * ldlex.l: Include "safe-ctype.h" instead of <ctype.h>.
- (lex_warn_invalid): Use ISPRINT instead of isprint.
- * ldmain.c: Include "safe-ctype.h" instead of <ctype.h>.
- (main): For gettext, also set the LC_CTYPE locate facet.
- (add_keepsyms_file): Use ISSPACE instead of isspace.
- * lexsup.c: Include "safe-ctype.h" instead of <ctype.h>.
- (is_num, parse_args): Use ISDIGIT instead of isdigit.
- * mpw-elfmips.c: Include "safe-ctype.h" instead of <ctype.h>.
- (gldelf32ebmip_place_orphan): Use ISALNUM instead of isalnum.
- * mpw-eppcmac.c: Include "safe-ctype.h" instead of <ctype.h>.
- (gldppcmacos_read_file): Use ISSPACE instead of isspace.
- * pe-dll.c: Include "safe-ctype.h" instead of <ctype.h>.
- (quoteput): Use ISSPACE instead of isspace.
- (pe_dll_generate_implib, pe_process_import_defs): Use ISALNUM
- instead of isalnum.
-
-2001-09-18 Alan Modra <amodra@bigpond.net.au>
-
- * deffilep.y (def_stash_module): Constify "name" param.
-
- * pe-dll.c: Replace CONST with const throughout.
- (quick_symbol): Constify "n1", "n2", "n3" params.
- (make_singleton_name_thunk): Constify "import" param. Make
- "buffer_len" a size_t.
- (make_import_fixup_entry): Constify "name", "fixup_name",
- "dll_symname" params.
- (pe_get16): Cast args of bfd_seek. Replace bfd_read with bfd_bread.
- (pe_get32): Likewise.
- (pe_implied_import_dll): Likewise.
-
- * emultempl/beos.em (sort_by_file_name): Constify "ra", "rb".
- (sort_by_section_name): Likewise.
-
- * emultempl/pe.em: Move defines for arm_epoc_pe before bfd.h included.
- (make_import_fixup): Cast printf arg, rel->address to long rather
- than int.
- (gld_${EMULATION_NAME}_after_open): Don't compare NULL against int.
-
-2001-09-15 Alan Modra <amodra@bigpond.net.au>
-
- * ldmain.c (main): Rename BufferSize to ld_bufsz because HPUX
- defines BufferSize. Increase buffer size by one.
-
-2001-09-14 Ralf Habacker <Ralf.Habacker@freenet.de>
-
- * pe-dll.c (pe_walk_relocs_of_symbol): Fix memory leak.
-
-2001-09-14 Kevin Lo <kevlo@openbsd.org>
-
- * configure.tgt: Add arm-openbsd target.
-
-2001-09-12 H.J. Lu <hjl@gnu.org>
-
- * Makefile.am (ALL_EMULATIONS): Move eelf64ppc.o and
- eelf64lppc.o to ...
- (ALL_64_EMULATIONS): Here.
- * Makefile.in: Regenerated.
-
-2001-09-12 Paul Sokolovsky <Paul.Sokolovsky@technologist.com>
-
- * emultempl/pe.em(make_import_fixup): change signature to
- take asection as well as arelec; we need this for proper
- error reporting. Only call pe_create_import_fixup() if
- there is no attempt to add a constant addend to the reloc;
- otherwise, report error condition.
- * pe-dll.c(pe_walk_relocs_of_symbol): change signature,
- since final argument is a pointer to make_import_fixup().
- Change call to cb() to match make_import_fixup() signature.
- (make_import_fixup_mark): make buffer_len unsigned.
- * pe-dll.h: change signature of pe_walk_relocs_of_symbol.
-
-2001-09-12 Charles Wilson <cwilson@ece.gatech.edu>
-
- * ld.texinfo: add verbose documentation for auto-import
- direct-addressing workaround, to compliment the terse
- error message.
-
-2001-09-12 Andrew MacLeod <amacleod@redhat.com>
-
- * scripttempl/v850.sc: Add gcc_except_table sections.
-
-2001-09-11 Jeffrey A Law (law@cygnus.com)
-
- * emulparams/h8300helf.sh: Move stack to a much higher memory address.
- * emulparams/h8300self.sh: Similarly.
-
-2001-09-05 Danny Smith <dannysmith@users.souceforge.net>
-
- * ld.texinfo (Options, --stack): Correct default value for stack
- reserve.
-
-2001-09-05 Tom Rix <trix@redhat.com>
-
- * emultempl/aix.em : Handle import file XMC_XO and syscall symbols.
-
-2001-09-03 Andreas Jaeger <aj@suse.de>
-
- * emultempl/beos.em: Declare prototypes for comparions functions,
- adjust definitions.
-
-2001-09-02 Andreas Jaeger <aj@suse.de>
-
- * emultempl/aix.em: Add missing prototype.
- * emultempl/lnk960.em: Likewise.
- * emultempl/vanilla.em: Likewise.
- * emultempl/armcoff.em: Likewise.
- * emultempl/armelf_oabi.em: Likewise.
- * emultempl/beos.em: Likewise.
- * emultempl/gld960c.em: Likewise.
- * emultempl/gld960.em: Likewise.
-
- * emulparams/elf64alpha.sh (PARSE_AND_LIST_PROLOGUE): Add parameter
- for prototype declaration.
-
-2001-08-31 Eric Christopher <echristo@redhat.com>
- Jason Eckhardt <jle@redhat.com>
-
- * ldmain.c (get_emulation): Add support for -mips32 and -mips64.
-
-2001-08-31 Andreas Jaeger <aj@suse.de>
-
- * emultempl/pe.em: Add missing prototypes.
- (gld_${EMULATION_NAME}_after_open): Remove extra args to
- pe_find_data_imports.
- (pr_sym): Add unused attribute.
-
-2001-08-29 Joel Sherrill <joel@OARcorp.com>
-
- * configure.tgt (i[3456]86-*-rtems*, m68*-*-rtems*): Change
- default from coff to elf.
-
-2001-08-29 Jeff Law <law@redhat.com>
-
- * emulparams/h8300helf.sh: Resync with h8300elf.sh. Update
- ARCH specification.
- * emulparams/h8300self.sh: Similarly.
-
-2001-08-28 J"orn Rennecke <amylaar@redhat.com>
-
- * Makefile.am (ALL_EMULATIONS): Add eh8300elf.o, eh8300elf.o and
- eh8300self.o .
- (eh8300elf.c, eh8300helf.c, eh8300self.c): New targets.
- * configure.tgt (h8300-*-elf*): New case.
- * emulparams/h8300elf.sh, emulparams/h8300helf.sh: New files.
- * emulparams/h8300self.sh: New file.
- * Makefile.in: Regenerated.
-
-2001-08-28 Nick Clifton <nickc@cambridge.redhat.com>
-
- * ldmain.c (main): Rename BSIZE to BufferSize to avoid collision
- with macro name.
-
-2001-08-27 Linus Nordberg <linus@swox.com>
- Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am (ALL_EMULATIONS): Add eelf64ppc.o and eelf64lppc.o.
- (eelf64ppc.c, eelf64lppc.c): Add make targets.
- Run "make dep-am"
- * Makefile.in: Regenerate.
- * configure.tgt: Add powerpc64 support. Move pdp11, pjl, pj
- entries to correct alphabetical position.
- * emulparams/elf64ppc.sh: New.
- * emulparams/elf64lppc.sh: New.
-
-2001-08-27 Nick Clifton <nickc@cambridge.redhat.com>
-
- * ldmain.c (main): Declare BSIZE as static.
-
-2001-08-23 Jakub Jelinek <jakub@redhat.com>
-
- * emultempl/elf32.em (place_orphan): Place orphan .rel* sections
- into .rel.dyn resp. .rela.dyn if combreloc.
- (get_script): If .x linker script is equal to .xn, only put it
- once into the binary.
- Add .xc and .xsc scripts.
- (parse_args): Handle -z combreloc and -z nocombreloc.
- * scripttempl/elf.sc (.rela.sbss): Fix a typo.
- For .xc and .xsc scripts put all .rel* or .rela* input sections
- but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn.
- * genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME
- is elf.
- Strip trailing whitespace from script.
- Generate .xc and .xsc scripts if requested.
- * ldmain.c (main): Initialize link_info.combreloc and
- link_info.spare_dynamic_tags.
- * lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define.
- (ld_options): Add --spare-dynamic-tags option.
- (parse_args): Likewise.
- * ld.texinfo: Document -z combreloc and -z nocombreloc.
- * ldint.texinfo: Document .xc and .xsc linker scripts.
- * NEWS: Add notes about -z combreloc and SHF_MERGE.
-
-2001-08-22 H.J. Lu <hjl@gnu.org>
-
- * emulparams/elf32fr30.sh: Add a newline.
-
-2001-08-21 Andreas Jaeger <aj@suse.de>
-
- * deffilep.y: Add missing prototypes.
- * pe-dll.c: Likewise.
-
-2001-08-20 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (insert_pad): Fix typos in last patch.
-
- * ldlang.c: When traversing lang_statement_union_type lists,
- consistently use "header.next" rather than "next".
- * mpw-eppcmac.c: Likewise.
- * emultempl/beos.em: Likewise.
- * emultempl/hppaelf.em: Likewise.
- * emultempl/pe.em: Likewise.
- * ldlang.h (union lang_statement_union): Remove "next" field.
-
- * ldlang.c (insert_pad): Use offsetof macro.
- (lang_size_sections): Always neuter padding statements.
- * emultempl/hppaelf.em (hppaelf_delete_padding_statements): Delete.
-
- * pe-dll.c (pe_dll_fill_sections): Correct type of "relax" param
- passed to lang_size_sections.
- (pe_exe_fill_sections): Likewise.
- * emultempl/pe.em (output_prev_sec_find): Copied from elf32.em.
- (gld_${EMULATION_NAME}_place_orphan): Merge from elf32.em.
-
-2001-08-18 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/aix.em: Formatting fixes.
-
-2001-08-18 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (insert_pad): Make use of an existing pad statement if
- available. Move code calculating alignment, adjusting section
- alignment power, and adjusting dot to ..
- (size_input_section): .. here. Remove unused relax param.
- (lang_size_sections): Change boolean `relax' param to boolean *.
- Adjust call to size_input_section. Make use of insert_pad to
- place pad after the assignment statement. If relaxing, zap
- padding statements.
- (reset_memory_regions): Reset output_bfd section sizes too.
- (relax_again): Move to..
- (lang_process): ..here. Adjust call to lang_size_sections, and
- remove duplicated code.
- * ldlang.h (lang_size_sections): Change `relax' param to boolean *.
-
-2001-08-17 Alan Modra <amodra@bigpond.net.au>
-
- * ld.texinfo: Document that fill values now use the four least
- significant bytes.
- * emulparams/elf32fr30.sh (NOP): Update.
- * emulparams/elf32mcore.sh: Likewise.
- * emulparams/elf64_s390.sh: Likewise.
- * emulparams/elf_i386.sh: Likewise.
- * emulparams/elf_i386_be.sh: Likewise.
- * emulparams/elf_i386_chaos.sh: Likewise.
- * emulparams/elf_i386_ldso.sh: Likewise.
- * emulparams/elf_s390.sh: Likewise.
- * emulparams/elf_x86_64.sh: Likewise.
- * emulparams/i386moss.sh: Likewise.
- * emulparams/i386nw.sh: Likewise.
- * emulparams/m68kelf.sh: Likewise.
- * scripttempl/elf.sc: Update NOP comment.
- * scripttempl/elfi370.sc: Likewise.
- * scripttempl/elfm68hc11.sc: Likewise.
- * scripttempl/elfm68hc12.sc: Likewise.
- * scripttempl/nw.sc: Likewise.
-
-2001-08-15 Tom Rix <trix@redhat.com>
-
- * ldgram.y (saved_script_handle): Initialize to NULL.
- * ldmain.c (main): Change check on saved_script_handle.
-
-2001-08-14 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/elf32.em: Formatting fixes.
- (output_prev_sec_find): Test for bfd_ind_section too; do so by
- looking at sec->owner.
- (output_rel_find): Move function inside LDEMUL_PLACE_ORPHAN test.
- (gld${EMULATION_NAME}_place_orphan): Add a few comments. Remove
- unused code, and reorganize orphan section placement code.
-
- * ldlang.c (wild_doit): Rename to lang_add_section.
- * ldlang.h: Here too.
- * mpw-elfmips.c: And here.
- * emultempl/beos.em: And here.
- * emultempl/elf32.em: And here.
- * emultempl/hppaelf.em: And here.
- * emultempl/pe.em: And here.
-
-2001-08-13 Richard Henderson <rth@redhat.com>
-
- * emultempl/needrelax.em: New file.
- * emulparams/elf64_ia64.sh (EXTRA_EM_FILE): Reference it.
- * Makefile.am (eelf64_ia64.c): Depend on it.
- * Makefile.in: Rebuild.
-
-2001-08-13 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/elf32.em: For SEC_EXCLUDE sections, ensure that
- output_section is set non-NULL.
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Return
- `true' for SEC_EXCLUDE sections so that the generic code doesn't
- needlessly create an output_section_statement. Treat a correctly
- named output_section_statement with NULL bfd_section as compatible.
-
-2001-08-13 Hans-Peter Nilsson <hp@bitrange.com>
-
- * emultempl/generic.em: Support EXTRA_EM_FILE.
- (ld_${EMULATION_NAME}_emulation): Support emulation parameters
- LDEMUL_BEFORE_PARSE, LDEMUL_SYSLIB, LDEMUL_HLL,
- LDEMUL_AFTER_PARSE, LDEMUL_AFTER_OPEN, LDEMUL_AFTER_ALLOCATION,
- LDEMUL_SET_OUTPUT_ARCH, LDEMUL_CHOOSE_TARGET,
- LDEMUL_BEFORE_ALLOCATION, LDEMUL_GET_SCRIPT, LDEMUL_FINISH,
- LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS,
- LDEMUL_OPEN_DYNAMIC_ARCHIVE, LDEMUL_PLACE_ORPHAN,
- LDEMUL_SET_SYMBOLS, LDEMUL_PARSE_ARGS, LDEMUL_UNRECOGNIZED_FILE,
- LDEMUL_LIST_OPTIONS, LDEMUL_RECOGNIZED_FILE,
- LDEMUL_FIND_POTENTIAL_LIBRARIES.
-
-2001-08-12 Richard Henderson <rth@redhat.com>
-
- * scripttempl/elf.sc, scripttempl/elfd30v.sc,
- scripttempl/elfm68hc11.sc, scripttempl/elfm68hc12.sc,
- scripttempl/v850.sc: Keep .jcr data.
-
-2001-08-12 H.J. Lu <hjl@gnu.org>
- Andrew Haley <aph@cambridge.redhat.com>
- Nick Clifton <nickc@redhat.com>
-
- * ldgram.y (had_script): Change name to saved_script_handle.
- Change type to file handle.
- * ld.h (had_script): Rename and retype.
- * ldfile.c (ldfile_open_command_file): Save the file handle
- used in saved_script_handle.
- * lexsup.c (parse_args): Do not allow -c option to alter
- saved_script_handle.
- * ldmain.c (main): Print out the linker script used if
- --verbose is given. Check saved_script_handle to obtain the
- external linker script used, or if NULL, dump the builtin
- script.
- * ld.texinfo: Document that --verbose now dumps the linker
- script used, regardless of whether it was an internal or an
- external script.
-
-2001-08-10 Andreas Jaeger <aj@suse.de>
-
- * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes
- to build warnings.
- * configure: Regenerate.
-
-2001-08-09 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/elf32.em (output_prev_sec_find): Add missing prototype.
-
- * scripttempl/elf.sc: Move non-text .dynamic section before
- .plt/.got/.sdata* group.
- (OTHER_GOT_SECTIONS): Move to immediately after .got.
- (OTHER_SDATA_SECTIONS): Add.
- * emulparams/criself.sh: Use OTHER_SDATA_SECTIONS rather than
- OTHER_GOT_SECTIONS.
- * emulparams/crislinux.sh: Likewise.
- * emulparams/elf32b4300.sh: Likewise.
- * emulparams/elf32bmip.sh: Likewise.
- * emulparams/elf32bmipn32.sh: Likewise.
- * emulparams/elf32bsmip.sh: Likewise.
- * emulparams/elf32btsmip.sh: Likewise.
- * emulparams/elf32ebmip.sh: Likewise.
- * emulparams/elf32elmip.sh: Likewise.
- * emulparams/elf32l4300.sh: Likewise.
- * emulparams/elf32lmip.sh: Likewise.
- * emulparams/elf32lsmip.sh: Likewise.
- * emulparams/elf32ltsmip.sh: Likewise.
- * emulparams/elf64bmip.sh: Likewise.
- * emulparams/elf64btsmip.sh: Likewise.
- * emulparams/elf64ltsmip.sh: Likewise.
-
-2001-08-08 Alan Modra <amodra@bigpond.net.au>
-
- * genscripts.sh: Source the emulparams script before each output
- script is generated so that variables like `RELOCATING' may affect
- variables defined in the emulparams script.
-
-2001-08-04 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/aix.em: ldexp.h,ldlang.h,ldfile.h,ldemul.h go in this
- order.
-
- * emultempl/beos.em (sort_sections): Modify for 2001-08-03 change,
- ie. iterate over wild_statement.section_list.
- (gld${EMULATION_NAME}_place_orphan): Likewise.
-
-2001-08-03 Stephane Carrez <Stephane.Carrez@worldnet.fr>
-
- * scripttempl/elfm68hc12.sc (FINISH_CODE, FINISH_RELOC): New to handle
- .fini[0-4] sections used by _exit
- (CTOR, DTOR): Export ctor/dtor symbols; move them to ROM.
- (*.text,*.data,*.bss): Take into account .text.*, .data.*, .bss.*.
- * scripttempl/elfm68hc11.sc: Likewise.
-
-2001-08-03 H.J. Lu <hjl@gnu.org>
-
- * emultempl/beos.em (init): Add the missing initialization.
-
-2001-08-03 Alan Modra <amodra@bigpond.net.au>
-
- * ld.texinfo (Input Section Basics): Clarify ordering of output
- sections.
- * ldlang.c (callback_t): Add wildcard_list param.
- (walk_wild_section): Remove "section" param. Rewrite for
- lang_wild_statement_type change. Remove unique_section_p test.
- (walk_wild_file): Remove "section" param.
- (walk_wild): Remove "section" and "file" params.
- (lang_gc_wild): Likewise.
- (wild): Likewise. Modify for lang_wild_statement_type change.
- (wild_sort): Likewise. Add "sec" param.
- (gc_section_callback): Likewise.
- (output_section_callback): Likewise. Do unique_section_p test.
- (map_input_to_output_sections): Modify call to wild.
- (lang_gc_sections_1): Likewise.
- (print_wild_statement): Modify for lang_wild_statement_type
- change.
- (lang_add_wild): Replace filename, filenames_sorted param with
- filespec. Replace section_name, sections_sorted,
- exclude_filename_list with section_list.
- * ldlang.h (lang_add_wild): Here too.
- (lang_wild_statement_type): Replace section_name, sections_sorted,
- and exclude_filename_list with section_list.
- * ldgram.y (current_file): Delete.
- (%union): Add wildcard_list.
- (file_NAME_list): Set type to wildcard_list. Build a linked list
- rather than calling lang_add_wild for each entry.
- (input_section_spec_no_keep): Call lang_add_wild here instead.
- * ld.h (struct wildcard_list): Declare.
- * mri.c (mri_draw_tree): Modify to suit new lang_add_wild.
-
-2001-08-02 Charles Wilson <cwilson@ece.gatech.edu>
-
- * ldmain.c (main): initialize link_info.pei386_auto_import
- * pe-dll.c: new tables for auto-export filtering
- (auto_export): change API, pass abfd for contextual filtering.
- Loop thru tables of excluded symbols instead of comparing
- "by hand".
-
-2001-08-02 Paul Sokolovsky <paul.sokolovsky@technologist.com>
-
- * pe-dll.c: new variable pe_dll_enable_extra_debug. New
- static variable current_sec (static struct sec *). Add
- forward declaration for add_bfd_to_link.
- (process_def_file): Don't export undefined symbols. Do not
- export symbols starting with "_imp__". Call auto_export()
- with new API.
- (pe_walk_relocs_of_symbol): New function.
- (generate_reloc): add optional extra debugging
- (pe_dll_generate_def_file): eliminate extraneous initial blank
- line in output
- (make_one): enlarge symtab to make room for __nm__ symbols
- (DATA auto-import support).
- (make_singleton_name_thunk): New function.
- (make_import_fixup_mark): New function.
- (make_import_fixup_entry): New function.
- (pe_create_import_fixup): New function.
- (add_bfd_to_link): Specify that 'name' argument is a CONST
- char *.
- * pe-dll.h: declare new variable pe_dll_extra_pe_debug;
- declare new functions pe_walk_relocs_of_symbol and
- pe_create_import_fixup.
- * emultempl/pe.em: add new options --enable-auto-import,
- --disable-auto-import, and --enable-extra-pe-debug.
- (make_import_fixup): New function.
- (pe_find_data_imports): New function.
- (pr_sym): New function.
- (gld_${EMULATION_NAME}_after_open): Add optional extra pe
- debugging. Call pe_find_data_imports. Mark .idata as DATA, not
- CODE.
-
-2001-08-02 Charles Wilson <cwilson@ece.gatech.edu>
-
- * ld.texinfo: add additional documentation for
- --export-all-symbols. Document --out-implib,
- --enable-auto-image-base, --disable-auto-image-base,
- --dll-search-prefix, --enable-auto-import, and
- --disable-auto-import.
- * ldint.texinfo: Add detailed documentation on auto-import
- implementation.
-
-2001-07-30 Nick Clifton <nickc@cambridge.redhat.com>
-
- * ld.texinfo (Simple Assignments): Fix computation in SECTIONS
- example.
-
-2001-07-24 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am: Update dependencies with "make dep-am".
- * Makefile.in: Regenerate
-
-2001-07-23 Alan Modra <amodra@bigpond.net.au>
-
- * ldcref.c (check_section_sym_xref): New function.
- (check_nocrossrefs): Call it.
- (check_nocrossref): Interate over h->refs here instead of..
- (check_refs): ..here. Pass in the symbol name, section, and bfd
- rather than hash_entry pointers.
- (struct check_refs_info): Keep symbol name rather than hash entry.
- Remove "same".
- (check_reloc_refs): Tweak for above changes in check_refs_info.
- Only report references to section syms when symname is NULL to
- prevent duplicate messages for the same reloc.
-
-2001-07-19 Nick Clifton <nickc@cambridge.redhat.com>
-
- * ldexp.c (exp_print_tree): Use stderr if config.map_file is not
- available. Do not print NULL trees.
- (exp_print_token): Print unknown tokens with values > 126 as
- decimal values not ASCII characters.
-
- * ldlang.c (lang_leave_overlay): If a region is specified assign
- it to all sections inside the overlay unless they have been
- assigned to the own, non-default, memory region.
-
- * README: Add header for consistency with other README files.
-
-2001-07-14 H.J. Lu <hjl@gnu.org>
-
- * emultempl/elf32.em (output_prev_sec_find): Never return
- bfd_abs_section_ptr, bfd_com_section_ptr nor
- bfd_und_section_ptr.
-
-2001-07-14 Nick Clifton <nickc@cambridge.redhat.com>
-
- * Makefile.am (em32relf.c): Change dependency from generic.em to
- elf32.em.
- * Makefile.in: Regenerate.
-
-2001-07-14 matthew green <mrg@eterna.com.au>
-
- * configure.tgt (i386-*-netbsdelf*): New target.
- (i386-*-netbsd*): Set targ_extra_emuls to `elf_i386'
-
-2001-07-13 Jakub Jelinek <jakub@redhat.com>
-
- * emultempl/elf32.em (output_prev_sec_find): New.
- (place_orphan): Use it.
-
-2001-07-11 H.J. Lu <hjl@gnu.org>
-
- * ldmain.c (main): Fix typos in the last change.
-
-2001-07-11 Jakub Jelinek <jakub@redhat.com>
-
- * ldmain.c (main): Disallow -F and -f without -shared.
-
-2001-07-11 Nick Clifton <nickc@cambridge.redhat.com>
-
- * emultempl/pe.em (after_open): Check for the output_bfd not
- having any coff_data structure allocated to it.
-
-2001-07-09 David O'Brien <obrien@FreeBSD.org>
-
- * emultempl/elf32.em: Do not assuming that contents of the buffer
- returned from basename function will remain unchanged accross other
- function calls.
-
-2001-07-03 H.J. Lu <hjl@gnu.org>
-
- * scripttempl/elf.sc (DYNAMIC_PAD): Revert the change made on
- 2001-07-03. It creates dynamic entries even for static binaries.
-
-2001-07-03 Jakub Jelinek <jakub@redhat.com>
-
- * scripttempl/elf.sc (DYNAMIC_PAD): New variable.
- (DYNAMIC): Use it to reserve few dynamic entries for
- post-linking tools.
-
-2001-06-27 Alan Modra <amodra@bigpond.net.au>
-
- * emulparams/hppa64linux.sh: New file.
- * configure.tgt: hppa*64*-*-linux* uses hppa64linux.sh
- * Makefile.am (ALL_64_EMULATIONS): Add ehppa64linux.o
- (ehppa64linux.c): Add rule to make it.
- Run "make dep-am".
- * Makefile.in: Regenerate.
-
-2001-06-21 Hans-Peter Nilsson <hp@axis.com>
-
- * ld.texinfo (Options, -r): Mention restrictions when using
- different object formats.
-
-2001-06-19 Hans-Peter Nilsson <hp@axis.com>
-
- * ldlang.c (lang_check): Emit fatal error if relocatable link
- between different object flavours with relocations in input.
-
-2001-06-19 H.J. Lu <hjl@gnu.org>
-
- * ld.texinfo (-E, --export-dynamic): Mention --version-script.
- (--version-script): Mention the language support.
-
-2001-06-19 H.J. Lu <hjl@gnu.org>
-
- * ldlang.c (lang_check): Revert the change mode on 2001-06-15.
-
-2001-06-18 H.J. Lu <hjl@gnu.org>
-
- * Makefile.am (ld.1): Remove the prefix `$(srcdir)/'.
- (diststuff): Add $(MANS).
- * Makefile.in: Regenerated.
-
- * ld.1: Removed.
-
-2001-06-18 Hans-Peter Nilsson <hp@axis.com>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
- Update for API change in bfd_elf${ELFSIZE}_size_dynamic_sections.
- * mpw-elfmips.c (gldelf32ebmip_before_allocation): Ditto.
- * ld.h (args_type): Remove member export_dynamic. All users
- changed to use struct bfd_link_info member.
-
- * Makefile.am (ecriself.c, ed10velf.c, ei386moss.c): Depend on
- $(srcdir)/emultempl/elf32.em, not $(srcdir)/emultempl/generic.em.
- * Makefile.in: Regenerate.
-
-2001-06-18 H.J. Lu <hjl@gnu.org>
-
- * ldlang.c (init_os): Add the newline to the einfo call.
- (lang_check): Likewise.
- (lang_do_version_exports_section): Likewise.
-
-2001-06-15 H.J. Lu <hjl@gnu.org>
-
- * lexsup.c (parse_args); Save optind to report unrecognized
- option.
-
-2001-06-15 Hans-Peter Nilsson <hp@axis.com>
-
- * ldlang.c (lang_check): Emit fatal error if relocatable link
- between different object flavours.
-
- * lexsup.c (parse_args) <case OPTION_EXPORT_DYNAMIC, case 'E'>:
- Set new link_info member export_dynamic.
- * ldmain.c (main): Initialize new link_info member export_dynamic.
-
-2001-06-12 Nick Clifton <nickc@cambridge.redhat.com>
-
- * ldlang.c (walk_wild): Only call walk_wild_file if
- lookup_name returns something.
- (lookup_name): If load_symbols fails, return NULL.
- (load_symbols): Change to a boolean function.
- (open_input_bfds): If load_symbols fails then do not make the
- executable.
-
-2001-06-08 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (record_bfd_errors): Remove.
-
- * emultempl/aix.em: Fix copyright dates.
-
-2001-06-07 Andreas Jaeger <aj@suse.de>
-
- * elf_x86_64.sh (NONPAGED_TEXT_START_ADDR): Increase.
- (TEXT_START_ADDR): Likewise.
-
-2001-06-06 Martin Schwidefsky <schwidefsky@de.ibm.com>
-
- * configure.host: Set HOSTING_CRT0/HOSTING_LIBS correctly for s/390.
-
-2001-06-05 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
-
- * emultempl/pe.em (init): Reduce default stack reserve to 0x200000.
-
-2001-05-31 H.J. Lu <hjl@gnu.org>
-
- * ldlang.c (open_input_bfds): Don't change the bfd error
- handler whilst loading symbols.
-
-2001-05-28 Nick Clifton <nickc@cambridge.redhat.com>
-
- * configure.tgt: Remove i370-mvs architecture, it is not currently
- supported.
-
-2001-05-25 H.J. Lu <hjl@gnu.org>
-
- * emulparams/ppcmacos.sh: Add SYSCALL_MASK and SYMBOL_MODE_MASK
- like emulparams/aixppc.sh.
-
-2001-05-25 H.J. Lu <hjl@gnu.org>
-
- * emultempl/beos.em (gld${EMULATION_NAME}_before_parse): Move
- setting of output_filename after bfd_scan_arch.
- * emultempl/pe.em: Likewise.
-
-2001-05-25 H.J. Lu <hjl@gnu.org>
-
- * emulparams/aixrs6.sh: Add SYSCALL_MASK and SYMBOL_MODE_MASK
- like emulparams/aixppc.sh.
-
- * emultempl/aix.em (sc): Use ${srcdir}/emultempl/ostring.sed
- instead of ${srcdir}/emultempl/stringify.sed.
-
-2001-05-25 Timothy Wall <twall@oculustech.com>
-
- * emulparams/elf64_aix.sh: Change settings to match IBM linker
- output.
-
-2001-05-25 Alan Modra <amodra@one.net.au>
-
- * configure.host: Replace linuxoldld with linux*oldld.
- * configure.tgt: Likewise.
-
-2001-05-24 H.J. Lu <hjl@gnu.org>
-
- * emultempl/stringify.sed: Removed again.
-
-2001-05-24 H.J. Lu <hjl@gnu.org>
-
- * emultempl/aix.em (OUTPUT_ARCH): Defined.
- (gld${EMULATION_NAME}_before_parse): Initialize
- ldfile_output_architecture, ldfile_output_machine and
- ldfile_output_machine_name from ${OUTPUT_ARCH} if possible.
- * emultempl/beos.em: Likewise.
- * emultempl/elf32.em: Likewise.
- * emultempl/linux.em: Likewise.
- * emultempl/mipsecoff.em: Likewise.
- * emultempl/pe.em: Likewise.
- * emultempl/sunos.em: Likewise.
-
-2001-05-24 Tom Rix <trix@redhat.com>
-
- * emultempl/aix.em : (gld${EMULATION_NAME}_read_file)
- udate import file format.
- (change_symbol_mode) New, same
- (is_syscall) New, same
- * emulparams/aixppc.sh : add SYSCALL_MASK and SYMBOL_MODE_MASK
- * emulparams/aixppc64.sh : same
- * emulparams/aixrs6.sh : same
- * emulparams/ppcmacos.sh : same
- * emultempl/aix.em : use strtoull to parse options
- * Makefile.am : add eaixppc64 emulation for xcoff64
- * Makefile.in : same
- * configure.tgt : same
-
- * scripttempl/aix.sc : default text section offset to 0x10000000
- default data section offset to 0x20000000
- add .sv3264 and .sv64 pseudo sections
- loader and debug sections use the currect section offset.
-
- * emultempl/aix.em : Add xcoff64 support
- Add -binitfini support
- (gld${EMULATION_NAME}_before_parse) -binitfini
- (gld${EMULATION_NAME}_parse_args) same
- (gld${EMULATION_NAME}_before_allocation) format change for special
- sections
-
- * emulparams/aixppc64.sh : New file for xcoff64 support
-
-2001-05-23 Alexandre Oliva <aoliva@redhat.com>
-
- * emultempl/elf32.em (ELF_INTERPRETER_SET_DEFAULT): Use this new
- variable to avoid non-portable shell construct.
-
-2001-05-23 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
-
- * ldmain.c (get_emulation): Add -mips5 command line argument.
-
-2001-05-22 Alexandre Oliva <aoliva@redhat.com>
-
- * emulparams/elf_i386_ldso.sh: New, copied from elf_i386.sh.
- (ELF_INTERPRETER_NAME): Define it.
- * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Use
- it.
- * configure.tgt (targ_emul, targ_extra_emuls)
- [i[3456]86-*-solaris2*, i[3456]86-*-solaris*]: Use elf_i386_ldso
- as primary, elf_i386 as extra.
- * Makefile.am (ALL_EMULATIONS): Added eelf_i386_ldso.o.
- (eelf_i386_ldso.c): New rule.
- * Makefile.in: Rebuilt.
-
-2001-05-22 Nick Clifton <nickc@redhat.com>
-
- * lexsup.c (ld_options): Allow -I to be an alias for
- --dynamic-linker. This is for Solaris compatability.
- * ld.texinfo: Document that -I can be used.
- * ld.1: Regenerate.
-
-2001-05-16 Alan Modra <amodra@one.net.au>
-
- * ldlang.c (wild_doit): Use linker_has_input to reliably determine
- whether an input section is the first one assigned to an output
- section.
- Assorted formatting fixes.
-
-2001-05-14 DJ Delorie <dj@delorie.com>
-
- * Makefile.am (ld.dvi): Search bfd/doc for texinfo files.
- * Makefile.in: Ditto.
-
-2001-05-11 Jakub Jelinek <jakub@redhat.com>
-
- * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Put
- .gnu.linkonce.ia64unw{,i} sections into corresponding .IA_64.unwind*
- output sections.
- * emulparams/elf64_aix.sh (OTHER_READONLY_SECTIONS): Likewise.
-
-2001-05-11 Jakub Jelinek <jakub@redhat.com>
-
- * ldlang.c (lang_process): Call bfd_merge_sections.
-
-2001-05-07 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
-
- * ldgram.y: Fix typo.
-
-2001-05-03 H.J. Lu <hjl@gnu.org>
-
- * emultempl/elf32.em: Include "libiberty.h".
- (gld${EMULATION_NAME}_vercheck): Call basename () to get the
- basename of the bfd filename.
- (gld${EMULATION_NAME}_stat_needed): Likewise.
- (gld${EMULATION_NAME}_try_needed): Likewise.
- (gld${EMULATION_NAME}_open_dynamic_archive): Likewise.
-
-2001-05-02 H.J. Lu <hjl@gnu.org>
-
- * emultempl/pe.em: Include <ctype.h>.
-
-2001-05-02 Johan Rydberg <jrydberg@opencores.org>
-
- * emulparams/elf32openrisc.sh: New file.
-
- * Makefile.am: Add OpenRISC target.
- * Makefile.in: Regenerated.
-
- * configure.tgt: Add openrisc-*-* mapping.
-
-2001-05-02 Nick Clifton <nickc@redhat.com>
-
- * emultempl/aix.em: Replace buystring with xstrdup.
- * emultempl/beos.em: Replace buystring with xstrdup.
-
-2001-05-02 H.J. Lu <hjl@gnu.org>
-
- * ldfile.c: Include "libiberty.h".
- * ldlex.l: Likewise.
-
- * ldmisc.c (buystring): Removed.
- * ldmisc.h: Likewise.
-
- * ldfile.c: Replace buystring with xstrdup.
- * ldlang.c: Likewise.
- * ldlex.l: Likewise.
- * ldmain.c: Likewise.
- * ldmisc.c: Likewise.
- * lexsup.c: Likewise.
- * mpw-eppcmac.c: Likewise.
-
-2001-04-30 Andreas Jaeger <aj@suse.de>
-
- * emulparms/elf_x86_64.sh (MAXPAGESIZE): Fix value.
-
-2001-04-28 Paul Sokolovsky <Paul.Sokolovsky@technologist.com>
-
- * ldlang.c (load_symbols): Give emulation a chance
- to process unrecognized file before fatal error is
- reported, not after.
-
-2001-04-27 Sean McNeil <sean@mcneil.com>
-
- * configure.tgt: Add arm-vxworks target.
- * scripttempl/armcoff.sc: Support .text or .data as a section name
- prefix.
- Define _etext.
-
-2001-04-13 J.T. Conklin <jtc@redback.com>
-
- * ld.texinfo: Document --fatal-warnings.
- * ld.1: Regenerate.
-
- * ldmisc.c (vfinfo): Set flag to inhibit making executable if
- warnings have been turned into errors.
- * lexsup.c (OPTION_WARN_FATAL): Define.
- (ld_options): Entry for --fatal-warnings.
- (parse_args): Handle OPTION_WARN_FATAL.
- * ld.h (ld_config_type): Add fatal_warnings field.
-
-2001-04-13 Jakub Jelinek <jakub@redhat.com>
-
- * ldmain.c (main): Default to discard_sec_merge.
- * lexsup.c (OPTION_DISCARD_NONE): Define.
- (ld_options): Add --discard-none.
- (parse_args): Handle OPTION_DISCARD_NONE.
- * ldlang.c (wild_doit): SEC_MERGE should be set in the output
- section only if SEC_MERGE and SEC_STRINGS flags and entsize of
- all its input sections match.
-
-2001-04-05 Steven J. Hill <sjhill@cotw.com>
-
- * Makefile.am (ALL_EMULATIONS): Add eelf32ltsmip.o.
- (ALL_64_EMULATIONS): Add eelf64btsmip.o and eelf64ltsmip.o.
- (eelf32ltsmip.c): New target.
- (eelf64btsmip.c): Likewise.
- (eelf64ltsmip.c): Likewise.
- * Makefile.in: Regenerated.
-
- * configure.tgt (mips*el-*-linux-gnu): Uses traditional MIPS
- target.
- (mips*-*-linux-gnu*): Likewise.
-
- * emulparams/elf32ltsmip.sh: New. Traditional little endian
- MIPS taget.
- * emulparams/elf64btsmip.sh: New. Traditional 64bit big endian
- target.
- * emulparams/elf64ltsmip.sh: New. Traditional 64bit little
- endian target.
-
-2001-04-05 Hans-Peter Nilsson <hp@axis.com>
-
- * emulparams/criself.sh (EXECUTABLE_SYMBOLS): Cannot provide
- correct value of __Stext here.
- (TEXT_START_SYMBOLS): Define; always define __Stext, to start of
- .startup section.
-
- * emulparams/crislinux.sh: Remove FIXME.
-
-2001-04-02 Alan Modra <alan@linuxcare.com.au>
-
- * emulparams/hppalinux.sh (MAXPAGESIZE): Set to 64k.
- (TEXT_START_ADDR, TARGET_PAGE_SIZE): Likewise.
-
-2001-03-27 Hans-Peter Nilsson <hp@axis.com>
-
- * configure.tgt (cris-*-*): Change default emulation to criself.
- (cris-*-*aout*): New rule.
-
-2001-03-27 Matthew Wilcox <willy@ldl.fc.hp.com>
-
- * emulparams/hppalinux.sh (MAXPAGESIZE): Set to 0x4000.
- (TEXT_START_ADDR, TARGET_PAGE_SIZE): Ditto.
-
-2001-03-26 Andreas Jaeger <aj@suse.de>
-
- * ld.texinfo (Overview): Fix syntax in texi code.
-
-2001-03-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>
-
- * ld.texinfo: Put @c man indications to generate the ld man page.
- When generating man, define all the variables. Define SEEALSO
- and SYNOPSIS. Re-organize some lines to avoid the cross references.
- * Makefile.am (MANCONF, TEXI2POD, POD2MAN): New variables.
- (ld.1): Generate from ld.texinfo.
- * Makefile.in: Regenerate.
-
-2001-03-23 Mark Elbrecht <snowball3@bigfoot.com>
-
- * scripttempl/i386go32.sc: Support the GCC flags '-ffunction-sections'
- and '-fdata-sections'. Set the VMA of STABS sections to zero.
-
-2001-03-17 Ulrich Drepper <drepper@redhat.com>
-
- * emultmpl/elf32.em (gld${EMULATION_NAME}_search_needed): If NAME
- is an absolute path look only for this file and not along the path.
-
-2001-03-17 Ulrich Drepper <drepper@redhat.com>
-
- * emultempl/elf32.em (OPTION_GROUP): New macro.
- Add new option Bgroup to longopts.
- (gld*_parse_args): Handle GROUP_OPTION and recognize -z defs.
- (gld*_list_options): Add -Bgroup and -z defs.
- * ld.1: Document -Bgroup and -z defs.
- * ld.texinfo: Likewise.
-
-2001-03-07 Michael Meissner <meissner@redhat.com>
-
- * scripttempl/elfd10v.sc (.rodata,.rodata1,.data1,.sdata): Deal
- with sections created by -fdata-sections.
- (.dynbss,.bss): Ditto.
-
-2001-03-05 Alan Modra <alan@linuxcare.com.au>
-
- * emultempl/m68kelf.em (m68k_elf_after_allocation): Call
- after_allocation_default, not gld..._before_allocation.
-
-2001-02-27 Alan Modra <alan@linuxcare.com.au>
-
- * configure.in (BFD_VERSION): New.
- (AM_INIT_AUTOMAKE): Use $BFD_VERSION.
- * configure: Regenerate.
- * Makefile.am: Run "make dep-am"
- * Makefile.in: Regenerate.
-
-2001-02-26 Timothy Wall <twall@cygnus.com>
-
- * emulparams/elf64_aix.sh: Add additional read-only sections;
- uncomment lines which are now required.
-
-2001-02-26 H.J. Lu <hjl@gnu.org>
-
- * ldlang.c (open_input_bfds): Set the bfd error handler so
- that problems can be caught whilst loading symbols.
- (record_bfd_errors): New function: Report BFD errors and mark
- the executable output as being invalid.
-
-2001-02-22 Timothy Wall <twall@cygnus.com>
-
- * configure.host: Add configuration for ia64-*-aix*.
- * Makefile.am (ALL_64_EMULATIONS): Add emulation for ia64-*-aix*.
- Add dependencies for eelf64_aix.c.
- * Makefile.in: Regenerate.
- * configure.tgt: Add ia64-*-aix* mapping.
- * emulparams/elf64_aix.sh: Add settings for elf64 on aix5.
- * testsuite/ld-bootstrap/bootstrap.exp: Exclude ia64 flavor from
- AIX-specific test.
-
-2001-02-20 H.J. Lu <hjl@gnu.org>
-
- * ldfile.c (ldfile_open_file): Set entry->search_dirs_flag to
- false if we found the file.
-
-2001-02-18 David O'Brien <obrien@FreeBSD.org>
-
- * configure.tgt: Add FreeBSD/Alpha, FreeBSD/x86-64, FreeBSD/ia64,
- FreeBSD/PowerPC, FreeBSD/arm, and FreeBSD/sparc64 entries.
-
-2001-02-18 lars brinkhoff <lars@nocrew.org>
-
- * Makefile.am: Add PDP-11 target.
- * configure.tgt: Likewise.
- * emulparams/pdp11.sh: New file.
-
-2001-02-17 David O'Brien <obrien@FreeBSD.org>
-
- * configure.host: Add a generic FreeBSD configuration entry such that
- all [modern] FreeBSD systems on all platforms will look the same.
-
-2001-02-14 H.J. Lu <hjl@gnu.org>
-
- * configure.tgt: Remove mention of earmelf_linux26.
-
-2001-02-13 Richard Henderson <rth@redhat.com>
-
- * emulparams/elf64_ia64.sh (OTHER_GOT_SYMBOLS): Remove.
-
-2001-02-13 H.J. Lu <hjl@gnu.org>
-
- * ldexp.h (node_type): Add etree_provided.
- * ldexp.c (exp_fold_tree): Handle etree_provided. Set the node
- type to etree_provided if defined by PROVIDE. Allow updating
- for etree_provided.
- (exp_print_tree): Handle etree_provided.
- * mpw-elfmips.c (gldelf32ebmip_find_exp_assignment): Handle
- etree_provided.
-
-2001-02-09 David Mosberger <davidm@hpl.hp.com>
-
- * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Add
- .IA_64.unwind.* pattern to unwind table section and
- .IA_64.unwind_info* pattern to unwind info section.
-
-2001-02-09 Martin Schwidefsky <schwidefsky@de.ibm.com>
-
- * Makefile.am: Add linux target for S/390.
- * Makefile.in: Likewise.
- * configure.host: Likewise.
- * configure.tgt: Likewise.
- * emulparams/elf64_s390.sh: New file.
- * emulparams/elf_s390.sh: New file.
-
-2001-02-09 Jakub Jelinek <jakub@redhat.com>
-
- * configure.tgt (sparc64-*-linux-gnu*): Add elf32_sparc into
- targ_extra_libpath.
- (sparc-*-linux-gnu*): Add elf64_sparc into targ_extra_libpath.
-
-2001-02-06 Philip Blundell <philb@gnu.org>
-
- * Makefile.am: Remove mention of earmelf_linux26.
- * Makefile.in: Regenerate.
-
-2001-02-04 Philip Blundell <philb@gnu.org>
-
- * emulparams/armelf_linux.sh (TEXT_START_ADDR): Set to 0x8000.
- * emulparams/armelf_linux26.sh: Delete.
- * configure.tgt: Remove mention of armelf_linux26 emulation.
-
-2001-02-01 Nick Clifton <nickc@redhat.com>
-
- * ld.1: Replace occurances of -oformat with --oformat.
-
-2001-01-25 Jim Driftmyer <jdrift@stny.rr.com>
-
- * ldlang.c (lang_leave_overlay): Don't set lma_region when
- load_base is specified.
-
-2001-01-24 Hans-Peter Nilsson <hp@axis.com>
-
- * emultempl/elf32.em: Correct spelling in comments and listed
- options.
-
-2001-01-23 Alan Modra <alan@linuxcare.com.au>
-
- * ldlang.c (lang_leave_overlay): Only set lma_region from the
- default for the first section of a group of overlay sections.
-
-2001-01-22 Alan Modra <alan@linuxcare.com.au>
-
- * Makefile.am (GENSCRIPTS): Pass exec_prefix.
- * Makefile.in: Regenerate.
- * genscripts.sh: Use exec_prefix parameter to specify tool lib.
- Check for null tool_dir.
-
-2001-01-16 Jim Wilson <wilson@redhat.com>
-
- * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Add IA_64.unwind
- and IA_64.unwind.info.
-
-2001-01-16 H.J. Lu <hjl@gnu.org>
-
- * ldlang.c (lang_check): Merge the private data only if the
- input file has contents.
-
-2001-01-14 Alan Modra <alan@linuxcare.com.au>
-
- * emulparams/hppalinux.sh (OUTPUT_FORMAT): Set to elf32-hppa-linux.
-
- * emultempl/hppaelf.em (hppaelf_after_parse): New function,
- enabling search for libmilli. On a relocatable link, make .text
- sections unique.
- (LDEMUL_AFTER_PARSE): Define.
- (hppaelf_finish): Correct spelling of relocatable in comments.
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
- rummage through the script for sections on the unique list.
- Correct length of strncmp for ".note".
- (gld${EMULATION_NAME}_check_needed): Rearrange function.
-
- * ldlang.c (unique_section_list): New var.
- (unique_section_p): New function.
- (walk_wild_section): Don't match sections on unique_section_list.
- (lang_add_unique): New function.
- Correct spelling of relocatable in comments.
-
- * ldlang.h (struct unique_sections): Declare.
- (unique_section_list): Declare.
- (unique_section_p): Declare.
- (lang_add_unique): Declare.
-
- * lexsup.c (ld_options): Allow --unique to take an optional arg.
- (parse_args [OPTION_UNIQUE]): Call lang_add_unique.
-
- * ld.texinfo (--unique): Update.
-
-2001-01-13 Nick Clifton <nickc@redhat.com>
-
- * lexsup.c (parse_args): Remove spurious white space.
-
-2001-01-12 Nick Clifton <nickc@redhat.com>
-
- * lexsup.c (parse_args): Update copyright date.
-
-2001-01-12 Philip Blundell <pb@futuretv.com>
-
- * configure.host: Set HOSTING_LIBS appropriately for ix86-cygwin.
-
-2001-01-10 Kazu Hirata <kazu@hxi.com>
-
- * scripttempl/h8300.sc: Fix formatting. Fix a comment typo.
- * scripttempl/h8300h.sc: Fix formatting.
- * scripttempl/h8300s.sc: Likewise.
- * scripttempl/h8500.sc: Likewise.
- * scripttempl/h8500b.sc: Likewise.
- * scripttempl/h8500c.sc: Likewise.
- * scripttempl/h8500m.sc: Likewise.
- * scripttempl/h8500s.sc: Likewise.
-
-2000-01-07 David O'Brien <obrien@BSDi.com>
-
- * emultempl/elf32.em: Only perform Linux ld hints processing when
- targeting Linux.
-
-2001-01-07 Philip Blundell <philb@gnu.org>
-
- * ld.texinfo (Bug Reporting): Update email address for reports.
-
-2000-12-31 Nick Clifton <nickc@redhat.com>
-
- * lexsup.c (parse_args): Set opterr to 0 and detect unparsed long
- options by checking for a return value of '?' not -1.
-
-2000-12-28 Nick Clifton <nickc@redhat.com>
-
- * lexsup.c (struct ld_option): Add new enum value:
- EXACTLY_TWO_DASHES.
- (ld_options[]): Change -omagic, -output and -oformat options
- to be EXACTLY_TWO_DASHES.
- (OUTPUT_COUNT): Use ARRAY_SIZE.
- (parse_args): Change parameter 'argc' to unsigned.
- Place EXACTLY_TWO_DASHES options into new really_longopts
- array.
- If getopt_long_only fails, try calling getopt_long using the
- really_longopts array.
- (help): Print a double dash for both EXACTLY_TWO_DASHES and
- TWO_DASHES options.
-
- * ldlex.h: Fix prototype of parse_args.
-
- * ld.texinfo: Document that long options starting with 'o'
- must be preceeded by two dashes. Change example of a single
- dashed long option from -oformat to -trace-symbol.
-
-2000-12-26 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
-
- * emultempl/pe.em (OPTION_NO_DEFAULT_EXCLUDES): Define.
- (longopts[]): New --no-default-excludes option.
- (gld_${EMULATION_NAME}_list_options): Document.
- (gld_${EMULATION_NAME}_parse_args): Handle.
-
-2000-12-13 Michael Sokolov <msokolov@ivan.Harhan.ORG>
-
- * ldlang.c (new_stat): Revert the last beautification with "innocent"
- whitespace, it breaks the K&R C preprocessor.
-
-2000-12-11 DJ Delorie <dj@redhat.com>
-
- * ld.texinfo: Add notes about --whole-archive and gcc.
-
-2000-11-18 Fred Fish <fnf@be.com>
-
- * lexsup.c (OPTION_ALLOW_SHLIB_UNDEFINED): Define.
- (ld_options): Entry for --allow-shlib-undefined.
- (parse_args): Handle OPTION_ALLOW_SHLIB_UNDEFINED.
- * ldmain.c (main): Initialize link_info.allow_shlib_undefined
- to false.
- * ld.texinfo: Document new command line switch.
-
-2000-12-12 Geoffrey Keating <geoffk@redhat.com>
-
- * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS):
- .fixup is actually read/write.
- * emulparams/elf32lppc.sh (OTHER_READWRITE_SECTIONS): Likewise.
- * emulparams/elf32ppcsim.sh (OTHER_READWRITE_SECTIONS): Likewise.
- * emulparams/elf32lppcsim.sh (OTHER_READWRITE_SECTIONS): Likewise.
-
-2000-12-11 Jan Hubicka <jh@suse.cz>
-
- * NEWS: Add note about x86_64 architecture.
-
-2000-12-06 Mark Elbrecht <snowball3@bigfoot.com>
-
- * scripttempl/i386go32.sc: Use PROVIDE with _etext, _edata, _end.
- Set DWARF2 sections to a VMA of zero.
-
-2000-12-01 Joel Sherrill <joel@OARcorp.com>
-
- * configure.tgt (arm-*-rtems*, a29k-*rtems*, h8300-*-rtems*):
- New targets.
- (sparc*-*-rtemself*, sparc*-*-rtemsaout*): New targets.
- (sparc*-*-rtems*): Switched from a.out to ELF.
-
-2000-11-30 Jan Hubicka <jh@suse.cz>
-
- * Makefile.am (ALL_EMULATIONS): Add eelf_x86_64.o
- (eelf_x86_64.c): New.
- * Makefile.in: Regenerate.
- * configure.tgt: Add support for x86_64-*-linux-gnu*.
- * emulparams/elf_x86_64.sh: New.
-
-2000-11-30 Hans-Peter Nilsson <hp@axis.com>
-
- * emulparams/crislinux.sh (ENTRY): Change back to _start.
- (TEXT_START_SYMBOLS): Remove conditional setting of __start.
-
- * scripttempl/crisaout.sc: Change all RELOCATING not related to
- merging non-a.out sections into CONSTRUCTING.
-
-2000-11-28 Nick Clifton <nickc@redhat.com>
-
- * ld.1 (COPYING): Mention that the GNU Free Documentation
- License is present in the sources, but not the output, and
- also available from the GNU website.
- (GNU Free Documentation License): Comment out this section.
-
-2000-11-28 David O'Brien <obrien@dragon.nuxi.com>
-
- * emulparams/elf64alpha.sh (ENTRY): Remove leading underscore as ELF
- does not use them.
-
-2000-11-25 David O'Brien <obrien@FreeBSD.org>
-
- * ld.1: Remove old date so it does not give the impression the manpage
- is way out of date.
-
-2000-11-24 Nick Clifton <nickc@redhat.com>
-
- * configure.tgt (xscale-coff): Add target.
- (xscale-elf): Add target.
-
-2000-11-24 Fred Fish <fnf@be.com>
-
- * ldmain.c (main): Remove redundant init of config.make_executable
- to true.
-
-2000-11-15 Richard Henderson <rth@redhat.com>
-
- * emulparams/elf64alpha.sh (MAXPAGESIZE): Typo -- 64k, not 1M.
-
-2000-11-14 Kazu Hirata <kazu@hxi.com>
-
- * scripttempl/h8300.sc: Fix formatting.
- * scripttempl/h8300h.sc: Likewise.
- * scripttempl/h8300s.sc: Likewise.
-
-2000-11-14 Denis Chertykov <denisc@overta.ru>
-
- * scripttempl/elf32avr.sc: Fix bug in .eeprom segment.
-
-2000-11-09 Philip Blundell <pb@futuretv.com>
-
- * emultempl/pe.em: Define ___start_SECNAME and ___stop_SECNAME
- around orphan sections whose names can be represented in C.
-
-2000-11-07 Jim Wilson <wilson@redhat.com>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): New local
- hold_sdata. If SEC_SMALL_DATA set, set place to hold_sdata.
-
-2000-11-06 Nick Clifton <nickc@redhat.com>
-
- * ld.texinfo: Add GNU Free Documentation License.
- * ldint.texinfo: Add GNU Free Documentation License.
- * ld.1: Add GNU Free Documentation License.
-
-2000-11-05 Alan Modra <alan@linuxcare.com.au>
-
- * ldlex.l (yy_create_string_buffer): Init yy_is_our_buffer,
- yy_is_interactive, yy_at_bol, and yy_fill_buffer.
-
- * Makefile.am (DISTCLEANFILES): Add stringify.sed.
- Move 2000-11-02 Makefile.in changes to this file.
- * Makefile.in: Regenerate.
-
-2000-11-03 Nick Clifton <nickc@redhat.com>
-
- * scripttempl/h8300.sc: Use ${CONSTRUCTING...} to enclose
- constructors and destructors.
- * scripttempl/h8300h.sc: Ditto.
- * scripttempl/h8300s.sc: Ditto.
- * scripttempl/h8500.sc: Ditto.
- * scripttempl/h8500b.sc: Ditto.
- * scripttempl/h8500c.sc: Ditto.
- * scripttempl/h8500m.sc: Ditto.
- * scripttempl/h8500s.sc: Ditto.
- * scripttempl/v850.sc: Ditto.
- * scripttempl/w65.sc: Ditto.
- * scripttempl/z8000.sc: Ditto.
-
-2000-11-02 Per Lundberg <plundis@chaosdev.org>
-
- * Makefile.in (e_i386_chaos.c): New rule.
- (ALL_EMULATIONS): Added e_i386_chaos.o.
- * emulparams/elf_i386_chaos.sh: New file.
- * configure.tgt: Recognise i[3456]86-chaosdev-storm-chaos.
-
-2000-10-20 Jakub Jelinek <jakub@redhat.com>
-
- * emulparams/elf64_sparc.sh (TEXT_START_ADDR,
- NONPAGED_TEXT_START_ADDR): Set to 4GB for Solaris targets.
- Fix sed invocation, so that it coped with '/' in Solaris 64bit
- library path suffix.
- Based on patch by Andrew Macleod <amacleod@cygnus.com>.
-
-2000-10-18 Hans-Peter Nilsson <hp@axis.com>
-
- * scripttempl/crisaout.sc (.text, .data): Pad, with ALIGN (32),
- for consecutive sections.
-
-2000-10-17 Chandrakala Chavva <cchavva@redhat.com>
-
- * lexsup.c: New option OPTION_TARGET_HELP. Prints all target specific
- options.
- * ld.texinfo: Added notes about this new option.
-
-2000-10-16 Nick Clifton <nickc@redhat.com>
-
- * emultempl/pe.em (_after_open): Add tests of return values from
- bfd functions. Emit appropriate error messages if necessary.
-
-2000-10-13 Nick Clifton <nickc@redhat.com>
-
- * emultempl/pe.em (_after_open): Delete 'is2' and 'nsyms'
- local variables - they are not used, but leave in the call to
- bfd_canonicalize_symtab.
- (_open_dynamic_archive): Add #ifdef DLL_SUPPORT around use of
- pe_dll_search_prefix.
-
-2000-10-12 Charles Wilson <cwilson@ece.gatech.edu>
-
- * emultempl/pe.em (pe_dll_search_prefix): New variable,
- (longopts): New --dll-search-prefix option.
- (gld_${EMULATION_NAME}_list_options): Document.
- (gld_${EMULATION_NAME}_parse_args): Handle.
- (gld_${EMULATION_NAME}_open_dynamic_archive): When linking
- dynamically, search for a dll named '<prefix><basename>.dll'
- in preference to 'lib<basename>.dll' if --dll-search-prefix
- is specified.
-
-2000-10-12 Alan Modra <alan@linuxcare.com.au>
-
- * ldlang.c (section_already_linked): Set kept_section instead of
- sec->comdat->sec.
-
-2000-10-10 Kazu Hirata <kazu@hxi.com>
-
- * deffile.h: Fix formatting.
- * lexsup.c: Likewise.
- * mri.c: Likewise.
-
-2000-10-09 Paul Sokolovsky <Paul.Sokolovsky@technologist.com>
-
- * pe-dll.c (make_one): Do not generate code thunk for DATA
- exports.
- (process_def_file): deduce DATA flag for auto-export sumbols.
-
-2000-10-09 Kazu Hirata <kazu@hxi.com>
-
- * ld.h: Fix formatting.
- * ldcref.c: Likewise.
- * ldctor.h: Likewise.
- * ldemul.c: Likewise.
- * ldemul.h: Likewise.
- * ldexp.c: Likewise.
- * ldexp.h: Likewise.
- * ldfile.c: Likewise.
- * ldfile.h: Likewise.
- * ldlang.c: Likewise.
- * ldlang.h: Likewise.
- * ldmain.c: Likewise.
- * pe-dll.c: Likewise.
-
- * pe-dll.c: Revert some formatting fixes.
-
-2000-10-08 Kazu Hirata <kazu@hxi.com>
-
- * pe-dll.c: Fix formatting.
-
-2000-10-05 Kazu Hirata <kazu@hxi.com>
-
- * ldlang.c: Fix formatting.
-
-2000-10-03 DJ Delorie <dj@redhat.com>
-
- * pe-dll.c (fill_edata): initialize entire block
- (make_one): fill in correct section.
-
-2000-10-03 Kazu Hirata <kazu@hxi.com>
-
- * ldexp.c: Fix formatting.
-
-2000-10-02 DJ Delorie <dj@redhat.com>
-
- * emultempl/pe.em (gld_*_after_open): detect case where there two
- import libraries for same dll; rename one to ensure proper link
- order.
-
- * pe-dll.c (process_def_file): compare ordinals to -1, not 0; fix
- typo
- (generate_edata): fix typo
-
-2000-09-29 Hans-Peter Nilsson <hp@axis.com>
-
- * scripttempl/crisaout.sc (ENTRY): Now __start.
- (.text): Add default setting for __start.
- Remove CONSTRUCTORS handling.
- (/DISCARD/): Add .gnu.warning.*.
- * emulparams/crislinux.sh (ENTRY): Now __start.
- (TEXT_START_SYMBOLS): New; provide __Stext and __start default.
- * emulparams/criself.sh (OUTPUT_FORMAT): Now elf32-us-cris.
- (ENTRY): Now __start.
- (INITIAL_READONLY_SECTIONS): Add KEEP for .startup.
- (EXECUTABLE_SYMBOLS): Add default setting for __start.
-
-2000-09-29 Kazu Hirata <kazu@hxi.com>
-
- * deffile.h: Fix formatting.
- * ld.h: Likewise.
- * ldcref.c: Likewise.
- * ldctor.c: Likewise.
- * ldctor.h: Likewise.
- * ldemul.c: Likewise.
- * ldemul.h: Likewise.
- * ldexp.c: Likewise.
- * ldexp.h: Likewise.
- * ldfile.c: Likewise.
- * ldfile.h: Likewise.
- * ldlang.c: Likewise.
- * ldlang.h: Likewise.
- * lexsup.c: Likewise.
- * mri.c: Likewise.
- * pe-dll.c: Likewise.
-
-2000-09-28 Paul Sokolovsky <Paul.Sokolovsky@technologist.com>
-
- * pe-dll.c (process_def_file): Uninitialized data wasn't
- exported with --export-all-symbols switch.
-
-2000-09-28 DJ Delorie <dj@redhat.com>
-
- * pe-dll.c (fill_edata): rearrange the data so that ordinals and
- noname work properly.
-
-2000-09-28 Alan Modra <alan@linuxcare.com.au>
-
- * ld.texinfo (HPPA ELF32): New section.
-
- * emultempl/hppaelf.em (group_size): New.
- (hppaelf_finish): Pass group_size to elf32_hppa_size_stubs.
- (PARSE_AND_LIST_PROLOGUE): Add OPTION_STUBGROUP_SIZE.
- (PARSE_AND_LIST_LONGOPTS): Add --stub-group-size. Duplicate
- options to prevent abbreviations matching.
- (PARSE_AND_LIST_OPTIONS): Describe the above. Reformat.
- (PARSE_AND_LIST_ARGS_CASES): Handle it.
-
-2000-09-21 Michael Sokolov <msokolov@ivan.Harhan.ORG>
-
- * emultempl/m68kelf.em: Conditionalise the embedded relocs feature
- on the m68*-*-elf target. Make it support COFF input objects.
-
-2000-09-21 Kazu Hirata <kazu@hxi.com>
-
- * ldmain.c: Fix formatting.
- * ldmisc.c: Likewise.
- * ldver.c: Likewise.
- * ldwrite.c: Likewise.
-
-2000-09-21 Alan Modra <alan@linuxcare.com.au>
-
- * ldwrite.c (clone_section): Silence gcc warnings.
-
-2000-09-20 Alan Modra <alan@linuxcare.com.au>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Handle
- out of memory failure.
-
- * ldwrite.c (ldwrite): Remove unnecessary einfo arg.
- (clone_section): Handle out of memory failures. Rename var to
- avoid c++ reserved word.
-
-2000-09-18 Alan Modra <alan@linuxcare.com.au>
-
- * emultempl/hppaelf.em (hppaelf_add_stub_section): Rename
- stub_name param to stub_sec_name.
- (hppaelf_finish): Modify call to elf32_hppa_size_stubs.
-
-2000-09-10 Michael Sokolov <msokolov@ivan.Harhan.ORG>
-
- * emultempl/m68kelf.em: New file.
- * emulparams/m68kelf.sh (EXTRA_EM_FILE): Use it.
- * Makefile.am (em68kelf.c): Add dependency on m68kelf.em.
- * Makefile.in: Regenerate.
-
-2000-09-15 Alan Modra <alan@linuxcare.com.au>
-
- * emulparams/hppalinux.sh (DATA_START_SYMBOLS): Provide $global$
- only as needed.
-
-2000-09-13 Nick Clifton <nickc@redhat.com>
-
- * ldmain.c (multiple_definition): Disable relaxation if
- multiple symbol definitions are encountered - otherwise the
- linker could abort with an assertion failure.
-
-2000-09-10 Nick Clifton <nickc@redhat.com>
-
- * mri.c: Fix formatting.
-
-2000-09-07 H.J. Lu <hjl@gnu.org>
-
- * configure.in (AC_ISC_POSIX): Put after AC_CANONICAL_SYSTEM.
- * configure: Rebuild.
-
-2000-09-07 H.J. Lu <hjl@gnu.org>
-
- * Makefile.am (lexsup.o): Also depend on $(INCDIR)/demangle.h.
- * Makefile.in: Rebuild.
-
-2000-09-07 Alan Modra <alan@linuxcare.com.au>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Fix
- broken list handling. Create __start_SECNAME and __stop_SECNAME
- when no place-holder. Add some comments. Test both SEC_CODE and
- SEC_READONLY for hold_text to prevent .rodata orphan poisoning.
- Handle case where no output section statement created.
-
-2000-09-07 Niibe Yutaka <gniibe@m17n.org>, Kaz Kojima <kkojima@rr.iij4u.or.jp>, Alexandre Oliva <aoliva@redhat.com>
-
- * configure.tgt (sh-*-linux*): Added.
- * Makefile.am: Added eshelf_linux and eshlelf_linux.
- * Makefile.in: Rebuilt.
- * emulparams/shelf_linux.sh: New file.
- * emulparams/shlelf_linux.sh: New file.
-
-2000-09-06 Alan Modra <alan@linuxcare.com.au>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
- try shuffling sections when the orphan happens to be the place
- holder. Keep count of unique section names generated so we speed
- the search for a new name.
-
-2000-09-06 Alexandre Oliva <aoliva@redhat.com>
-
- * configure: Rebuilt with new libtool.m4.
-
-2000-09-05 Nick Clifton <nickc@redhat.com>
-
- * Makefile.in: Regenerate.
- * aclocal.m4: Regenerate.
- * configure: Regenerate.
- * config.in: Regenerate.
- * po/ld.pot: Regenerate.
-
- * ldint.texinfo: Remove CVS revision marker - it foils local
- comparisons.
-
- * emultempl/ticoff.em: Remove extraneous comma.
-
-2000-09-05 Alan Modra <alan@linuxcare.com.au>
-
- * emultempl/hppaelf.em (hppaelf_add_stub_section): Add SEC_RELOC
- to stub section flags.
- (hppa_for_each_input_file_wrapper): New.
- (hppa_lang_for_each_input_file): New.
- (lang_for_each_input_file): Define to call above.
- (multi_subspace): New.
- (hppaelf_finish): Pass multi_subspace to elf32_hppa_size_stubs.
- (PARSE_AND_LIST_PROLOGUE): Define.
- (PARSE_AND_LIST_LONGOPTS): Define.
- (PARSE_AND_LIST_OPTIONS): Define.
- (PARSE_AND_LIST_ARGS_CASES): Define.
- (hppaelf_finish): Call elf32_hppa_set_gp.
- (hppaelf_set_output_arch): Remove.
- (LDEMUL_SET_OUTPUT_ARCH): Remove.
-
- * emulparams/hppalinux.sh (ELFSIZE): Define.
- (MACHINE): Define.
- (OTHER_READONLY_SECTIONS): Define.
- (DATA_PLT): Define.
- (GENERATE_SHLIB_SCRIPT): Define.
-
- * ldlang.c: Add missing prototypes, and tidy others. Change CONST
- to const throughout. Change `void *' to `PTR' throughout.
- (lang_memory_default): Function is local to file, add `static'.
-
- * Makefile.am (ehppaelf.c): Depend on emultempl/elf32.em.
- (ehppalinux.c): Likewise.
- (earmelf.c): Likewise.
- (earmelf_linux.c): Likewise.
- (earmelf_linux26.c): Likewise.
- * Makefile.in: Regenerate.
-
- * ld.h (ld_config_type): Add unique_orphan_sections.
- * lexsup.c (OPTION_UNIQUE): Define.
- (ld_options): Add "--unique".
- (parse_args): Handle it.
- * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
- search for an existing output section if unique_orphan_sections is
- set. Make use of bfd_get_unique_section_name rather than
- duplicating code here.
- * ld.texinfo: Describe --unique.
-
- * lexsup.c (ld_options): Make split-by-reloc arg optional. Add
- optional arg to split-by-file.
+ * emultempl/sh64elf.em: Likewise.
+
+ 2004-03-25 Alan Modra <amodra@bigpond.net.au>
+ * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Update
+ size_dynamic_sections call.
+
+ 2004-03-20 H.J. Lu <hongjiu.lu@intel.com>
+ * lexsup.c (parse_args): Don't set unresolved_syms_in_objects
+ or unresolved_syms_in_shared_libs for -Bdynamic and -Bstatic.
+
+ 2004-03-18 Alan Modra <amodra@bigpond.net.au>
+ * ld.texinfo: Add --as-needed doco.
+ * ldmain.c (as_needed): New global var.
+ * ldmain.h (as_needed): Declare.
+ * lexsup.c (option_values): Add OPTION_AS_NEEDED and
+ OPTION_NO_AS_NEEDED.
+ (ld_options): Likewise.
(parse_args): Handle them.
- * ld.texinfo: Update description of these options.
- * ldwrite.c (clone_section): Pass in the section name. Replace
- local code with bfd_get_unique_section_name.
- (split_sections): Tidy code and comments. Use a list traversal
- more appropriate to the list construction. Handle cooked section
- sizes. Split when split_by_reloc reached rather than exceeded.
- Track section size and split when split_by_file reached. Fix
- link_order_tail (even though it's not used).
- (ldwrite): Modify condition for calling split_sections to suit
- changed split_by_reloc and split_by_file.
- * ldmain.c (main): Init config.split_by_reloc and
- config.split_by_file to -1.
- * ld.h (ld_config_type): Change split_by_reloc to unsigned.
- Change split_by_file to bfd_size_type.
-
-2000-09-02 Nick Clifton <nickc@redhat.com>
-
- * configure.in: Increase version number to 2.10.91.
- * NEWS: Mention new ability to support removal of duplicate DWARF2
- debug information.
- * configure: Regenerate.
- * aclocal.m4: Regenerate.
- * config.in: Regenerate.
-
-2000-09-02 Daniel Berlin <dberlin@redhat.com>
-
- * scripttempl/elf.sc: Add .gnu.linkonce.wi.* to .debug_info
- sections.
- * scripttempl/elf32avr.sc: Ditto.
- * scripttempl/elfd10v.sc: Ditto.
- * scripttempl/elfd30v.sc: Ditto.
- * scripttempl/elfi370.sc: Ditto.
- * scripttempl/elfm68hc11.sc: Ditto.
- * scripttempl/elfm68hc12.sc: Ditto.
- * scripttempl/elfi386beos.sc: Ditto.
- * scripttempl/v850.sc: Ditto.
-
-2000-08-31 Alexandre Oliva <aoliva@redhat.com>
-
- * acinclude.m4: Include libtool and gettext macros from the
- top level.
- * aclocal.m4, configure: Rebuilt.
-
-2000-08-25 Nick Clifton <nickc@redhat.com>
-
- * ldlang.c (open_output): When choosing the target for a
- particular endianness, do nothing if the target is not
- supported.
-
-2000-08-25 H.J. Lu <hjl@gnu.org>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Don't
- check -rpath nor LD_RUN_PATH for cross link.
- * ld.texinfo: Document the change.
-
-2000-08-24 Hans-Peter Nilsson <hp@axis.com>
-
- * NEWS: Mention support for CRIS.
-
-2000-08-23 H.J. Lu <hjl@gnu.org>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Get
- the current runpath list from bfd_elf_get_runpath_list ()
- before search.
-
-2000-08-22 H.J. Lu <hjl@gnu.org>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Search
- the DT_RPATH/DT_RUNPATH entries for DT_NEEDED after
- LD_LIBRARY_PATH for native linker. Display the needed DSO if
- trace_file_tries is non-zero.
- (gld${EMULATION_NAME}_try_needed): Report the needed DSO found
- if trace_file_tries is non-zero.
-
- * ld.texinfo: Document the usage of DT_RPATH/DT_RUNPATH.
- * NEWS: Mention it.
-
-2000-08-14 Jason Eckhardt <jle@cygnus.com>
-
- * NEWS: Mention i860 support.
-
-2000-08-14 Andreas Schwab <schwab@suse.de>
-
- * scripttempl/elf.sc: Fix last change to use correct comment
- syntax.
-
-2000-08-10 Geoff Keating <geoffk@cygnus.com>
-
- * scripttempl/elf.sc: Add a comment giving the correspondence
- between sections, per-datum sections, and linkonce sections. Make
- the comment true even for .bss, .sdata, .sdata2, .sbss, and
- .sbss2.
-
-2000-08-10 Jason Eckhardt <jle@cygnus.com>
-
- * emulparams/elf32_i860.sh: New file.
- * configure.tgt: Recognize new target i860-stardent-{sysv4*|elf*}.
- * Makefile.am (ALL_EMULATIONS): Add eelf32_i860.o.
- (eelf32_i860.c): New rule.
- * Makefile.in: Regenerate.
-
-2000-08-10 Nick Clifton <nickc@cygnus.com>
-
- * emulparams/mipspe.sh (ENTRY): Add definition.
-
-2000-08-08 Peter Jeremy <peter.jeremy@alcatel.com.au>
-
- * emultempl/elf32.em (_after_close): Refer to -rpath not --rpath
- in error message.
+ * ldlang.h (lang_input_statement_type): Add as_needed field.
+ * ldlang.c (new_afile): Set p->as_needed.
+ * emultempl/elf32.em (gld${EMULATION_NAME}_load_symbols): New function.
+ (gld${EMULATION_NAME}_try_needed): Use bfd_elf_set_dyn_lib_class.
+ (ld_${EMULATION_NAME}_emulation): Set LDEMUL_RECOGNIZED_FILE entry.
+ * ldlang.c (open_input_bfds): Remove useless cast.
+ (lang_do_assignments_1): Likewise.
+ (lang_for_each_input_section): Delete.
-2000-08-08 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+2004-03-23 Alan Modra <amodra@bigpond.net.au>
- * scripttempl/elfm68hc11.sc: Define __bss_size symbol to indicate
- the final size of .bss section.
- * scripttempl/elfm68hc12.sc: Likewise.
+ PR 51.
+ * emultempl/ppc64elf.em (ppc_create_output_section_statements): Set
+ link_info.wrap_char.
-2000-08-04 Alan Modra <alan@linuxcare.com.au>
+2004-03-17 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
- * emultempl/elf32.em (gld_${EMULATION_NAME}_parse_args): Rename to
- gld${EMULATION_NAME}_parse_args for consistency. Combine
- lastoptind and prevoptind vars, and keep track of last optind.
- (gld_${EMULATION_NAME}_list_options): Rename to
- gld${EMULATION_NAME}_list_options.
+ * configure.tgt: Switch sh-*-rtems* to ELF. Add sh-*-rtemscoff*.
-2000-08-03 Rodney Brown <RodneyBrown@pmsc.com>
+2004-03-05 Nathan Sidwell <nathan@codesourcery.com>
- * configure.tgt: Select targ_emul=elf_i386 for Unixware 7
- (i586-sco-sysv5uw7.1.0).
+ * ldlang.c (lang_add_section): Don't force SEC_LOAD on
+ SEC_THREAD_LOCAL.
+ (IGNORE_SECTION): Ignore .tbss sections too.
+ (lang_size_sections_1): .tbss sections do not advance dot.
-2000-07-27 H.J. Lu <hjl@gnu.org>
+2004-02-23 Nathan Sidwell <nathan@codesourcery.com>
- * emulparams/elf64alpha.sh (PARSE_AND_LIST_ARGS): Removed.
- (PARSE_AND_LIST_PROLOGUE): New.
- (PARSE_AND_LIST_LONGOPTS): Likewise.
- (PARSE_AND_LIST_OPTIONS): Likewise.
- (PARSE_AND_LIST_ARGS_CASES): Likewise.
- (PARSE_AND_LIST_EPILOGUE): Likewise.
+ * ldlang.h (struct lang_output_section_state): Change processed
+ field's type.
+ * ldexp.c (check, invalid): Remove.
+ (fold_name): Move valid_p assignments. Create undefined symbol
+ when needed. Directly exampine section's processd flag.
+ * ldlang.c (lang_output_section_statement_lookup): Adjust
+ processed field init.
+ (lang_size_sections_1): Allow LOADADDR when determining section's
+ VMA. Adjust error message. Fold data statement's expr.
+ (lang_size_sections): Correctly increment lang_statement_iteration.
-2000-07-28 Alan Modra <alan@linuxcare.com.au>
+2004-02-23 Alan Modra <amodra@bigpond.net.au>
- * emultempl/armelf.em: Elide functions common to elf32.em,
- ie. most of the file.
- (arm_elf_after_open): New. Do arm specific things then call
- gld${EMULATION_NAME}_after_open.
- (arm_elf_before_allocation): New. Call
- gld${EMULATION_NAME}_before_allocation then do arm specifics.
- (PARSE_AND_LIST_PROLOGUE): Define.
- (PARSE_AND_LIST_SHORTOPTS): Define.
- (PARSE_AND_LIST_LONGOPTS): Define.
- (PARSE_AND_LIST_OPTIONS): Define.
- (PARSE_AND_LIST_ARGS_CASES): Define.
- (LDEMUL_AFTER_OPEN): Define.
- (LDEMUL_BEFORE_ALLOCATION): Define.
- (LDEMUL_BEFORE_PARSE): Define.
- (LDEMUL_FINISH): Define.
+ * ldexp.c (fold_tree): Follow indirect symbols.
- * emultempl/hppaelf.em: Similarly zap most of this file.
- (hppaelf_add_stub_section): Prototype.
- (hppaelf_layaout_sections_again): Prototype.
- (hook_in_stub): Prototype.
- (LDEMUL_SET_OUTPUT_ARCH): Define.
- (LDEMUL_FINISH): Define.
- (LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Define.
+2004-02-20 Nathan Sidwell <nathan@codesourcery.com>
- * emulparams/armelf.sh (TEMPLATE_NAME): Use elf32.
- (EXTRA_EM_FILE): New.
- * emulparams/armelf_linux.sh: Likewise.
- * emulparams/armelf_linux26.sh: Likewise.
- * emulparams/hppalinux.sh: Likewise.
- * emulparams/hppaelf.sh: Likewise.
- (NOP): Define.
+ * ldgram.y (exp): Add two operand ALIGN.
+ * ldexp.c (fold_binary): Add ALIGN_K case.
+ * ld.texinfo (ALIGN): Document two operand version.
- * emultempl/elf32.em: Fix formatting.
- (EXTRA_EM_FILE): Source it.
- (LDEMUL_BEFORE_PARSE, LDEMUL_SYSLIB, LDEMUL_HLL,
- LDEMUL_AFTER_PARSE, LDEMUL_AFTER_OPEN, LDEMUL_AFTER_ALLOCATION,
- LDEMUL_SET_OUTPUT_ARCH, LDEMUL_CHOOSE_TARGET,
- LDEMUL_BEFORE_ALLOCATION, LDEMUL_GET_SCRIPT, LDEMUL_FINISH,
- LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS,
- LDEMUL_OPEN_DYNAMIC_ARCHIVE, LDEMUL_PLACE_ORPHAN,
- LDEMUL_SET_SYMBOLS, LDEMUL_PARSE_ARGS, LDEMUL_UNRECOGNIZED_FILE,
- LDEMUL_LIST_OPTIONS, LDEMUL_RECOGNIZED_FILE,
- LDEMUL_FIND_POTENTIAL_LIBRARIES): New shell vars. Add code to
- allow functions in this file to be overridden.
- (PARSE_AND_LIST_SHORTOPTS): Handle it.
+2004-02-19 Nathan Sidwell <nathan@codesourcery.com>
- * emultempl/m68kcoff.em: Include ldfile.h before ldemul.h.
-
- * emultempl/elf32.em: Reorganize file.
-
-2000-07-27 Ivan Kokshaysky <ink@jurassic.park.msu.ru>
-
- * emulparams/elf64alpha.sh: Implement "-taso" emulation
- specific option to fit 64-bit executable in the lower
- 31-bit address range. This is done by changing start
- address of .interp (the very first section of executable)
- and then setting EF_ALPHA_32BIT elf header flag.
-
-2000-07-21 Michael Sokolov <msokolov@ivan.Harhan.ORG>
-
- * emultempl/m68kcoff.em: New file.
- * emulparams/m68kcoff.sh (TEMPLATE_NAME): Use m68kcoff template.
- * Makefile.am (em68kcoff.c): Depend on m68kcoff.em rather than
- generic.em.
- * Makefile.in: Regenerate.
-
-2000-07-20 H.J. Lu <hjl@gnu.org>
-
- * emultempl/elf32.em (longopts): Duplicate "disable-new-dtags"
- and "disable-new-dtags" to stop getopt from treating -d/-e as
- abbreviations for these options.
-
-2000-07-20 H.J. Lu <hjl@gnu.org>
-
- * ld.texinfo: Add documentation for --disable-new-dtags and
- --enable-new-dtags.
-
- * ldmain.c (main): Initialize link_info.new_dtags to false.
-
- * emultempl/elf32.em (gld_${EMULATION_NAME}_parse_args): Add
- --disable-new-dtags and --enable-new-dtags.
- (gld_${EMULATION_NAME}_list_options): Likewise.
-
-2000-07-05 Kenneth Block <krblock@computer.org>
-
- * lexsup.c: Add optional style to demangle switch
- * ld.texinfo: Document optional style to demangle switch.
-
-2000-07-20 Hans-Peter Nilsson <hp@axis.com>
-
- * Makefile.am (ALL_EMULATIONS): Add ecrisaout.o, ecriself.o,
- ecrislinux.o.
- (ecrisaout.c, ecriself.c, ecrislinux.c): New rules.
- Regenerate dependencies.
- * Makefile.in: Rebuild.
- * configure.tgt (cris-*-*): New target.
- * emulparams/crisaout.sh, emulparams/criself.sh,
- emulparams/crislinux.sh, scripttempl/crisaout.sc: New files.
- * po/POTFILES.in, po/ld.pot: Regenerate.
-
-2000-07-20 H.J. Lu <hjl@gnu.org>
-
- * emultempl/elf32.em (gld_${EMULATION_NAME}_list_options):
- Print out ignored -z options.
-
-2000-07-19 H.J. Lu <hjl@gnu.org>
-
- * emulparams/elf32mcore.sh (PARSE_AND_LIST_ARGS): Removed.
- (PARSE_AND_LIST_PROLOGUE): New.
- (PARSE_AND_LIST_LONGOPTS): Likewise.
- (PARSE_AND_LIST_OPTIONS): Likewise.
- (PARSE_AND_LIST_ARGS_CASES): Likewise.
-
- * ldmain.c (main): Clear link_info.flags and link_info.flags_1.
-
- * lexsup.c (ld_options): Comment out 'z'.
- (parse_args): Likewise.
-
- * emultempl/elf32.em: Include "elf/common.h".
- (gld_${EMULATION_NAME}_parse_args): Defined. Handle some -z
- options.
- (gld_${EMULATION_NAME}_list_options): Likewise.
-
- * ld.texinfo: Add documentation for the recognized -z options.
-
-2000-07-19 H.J. Lu <hjl@gnu.org>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Call
- bfd_elf_set_dt_needed_soname ().
-
-2000-07-18 DJ Delorie <dj@cygnus.com>
-
- * pe-dll.c (pe_dll_id_target): check object target name also
-
-2000-07-18 Hans-Peter Nilsson <hp@axis.com>
-
- * scripttempl/elf.sc (.init): Only do ${INIT_START} and
- ${INIT_END} if relocating.
- (.fini): Likewise ${FINI_START} and ${FINI_END}.
-
-2000-07-16 Charles Wilson <cwilson@ece.gatech.edu>
-
- * emultempl/pe.em (gld_*_open_dynamic_archive): New search
- order for dynamic library '-lfoo' on pei386: libfoo.dll.a,
- foo.dll.a, libfoo.a, libfoo.dll, foo.dll. This fixes compatibility
- errors introduced by the old dynamic lib search order.
-
-2000-07-17 DJ Delorie <dj@cygnus.com>
-
- * pe-dll.c (process_def_file): auto-export data items also
- (pe_process_import_defs): also see if _imp_ form needed
-
-2000-07-12 Charles Wilson <cwilson@ece.gatech.edu>
-
- * pe-dll.c (make_one): fix a typo in the __imp_ name decoration
- for dll import libraries
-
-2000-07-12 Mark Elbrecht <snowball3@bigfoot.com>
-
- * scripttempl/i386go32.sc: Support the g++ attribute init_priority in
- gcc 2.95.2 and later.
-
-2000-07-11 Kazu Hirata <kazu@hxi.com>
-
- * ldfile.c (ldfile_try_open_bfd): Output '\n' after an error
- message.
-
-2000-07-10 Alan Modra <alan@linuxcare.com.au>
-
- * ldemul.h (struct lang_input_statement_struct): Remove forward
- declaration.
- (struct search_dirs): Likewise.
- * ldfile.h (struct lang_input_statement_struct): Likewise.
- Protect file from multiple inclusion.
- * ldlang.h (LANG_FOR_EACH_INPUT_STATEMENT): Move file_chain
- declaration from macro to file scope.
-
- * ldemul.c: ldexp.h,ldlang.h,ldfile.h,ldemul.h go in this order.
- * ldgram.y: Likewise here.
- * ldlang.c: And here.
- * ldmain.c: And here.
- * mpw-elfmips.c: And here.
- * mpw-eppcmac.c: And here.
- * emultempl/aix.em: And here.
- * emultempl/armcoff.em: And here.
- * emultempl/armelf.em: And here.
- * emultempl/armelf_oabi.em: And here.
- * emultempl/beos.em: And here.
- * emultempl/elf32.em: And here.
- * emultempl/hppaelf.em: And here.
- * emultempl/linux.em: And here.
- * emultempl/lnk960.em: And here.
- * emultempl/pe.em: And here.
- * emultempl/sunos.em: And here.
- * mpw-esh.c: And here. Include ldexp.h and ldlang.h too.
- * mpw-idtmips.c: Ditto.
- * emultempl/generic.em: Ditto.
- * emultempl/gld960.em: Ditto.
- * emultempl/gld960c.em: Ditto.
- * emultempl/mipsecoff.em: Ditto.
- * emultempl/ticoff.em: Ditto.
- * emultempl/vanilla.em: Ditto.
-
- * pe-dll.c: Include ldfile.h
- * ldver.c: Include ldexp.h, ldlang.h, ldfile.h
-
- * mpw-elfmips.c: (gldelf32ebmip_before_allocation): Add missing
- arguments to bfd_elf32_size_dynamic_sections call.
- (gldelf32ebmip_place_orphan): Add missing arguments to
- lang_leave_output_section_statement call.
-
-2000-07-10 H.J. Lu <hjl@gnu.org>
-
- * emultempl/pe.em (pe_enable_stdcall_fixup): Protect with
- DLL_SUPPORT.
- (strhash): Likewise.
- (compute_dll_image_base): Likewise.
- (pe_undef_found_sym): Likewise.
- (pe_undef_cdecl_match): Likewise.
- (gld_${EMULATION_NAME}_open_dynamic_archive): Mark the
- argument "arch" with ATTRIBUTE_UNUSED.
-
-2000-07-10 Alan Modra <alan@linuxcare.com.au>
-
- * configure.tgt: Remove extraneous hppa*-*-linux-gnu*.
-
- From Ryan Bradetich <rbradetich@uswest.net>
- * ldwrite.c (SSIZE): Remove to cure macro redefinition warning.
-
-2000-07-09 Alan Modra <alan@linuxcare.com.au>
-
- Changes to create multiple linker stubs, positioned immediately
- before the section where they are required.
- * emultempl/hppaelf.em: Include elf32-hppa.h.
- (stub_sec, file_chain): Delete.
- (hppaelf_create_output_section_statements): Don't make a stub
- section here.
- (hook_stub_info): New struct.
- (hook_in_stub): New function.
- (hppaelf_add_stub_section): New function.
- (hppaelf_finish): Do nothing for relocateable links. Modify the
- call to elf32_hppa_size_stubs. Move code for updating section
- layout from here...
- (hppaelf_layaout_sections_again): ..to here, a new function.
-
- * emultempl/hppaelf.em (hppaelf_delete_padding_statements): Fix
- broken list handling. Pass in a pointer to the list.
- (hppaelf_finish): Update call to hppaelf_delete_padding_statements
- for above changes.
- (hppaelf_before_parse): Prototype.
- (hppaelf_set_output_arch): Prototype.
- (hppaelf_create_output_section_statements): Prototype.
- (hppaelf_delete_padding_statements): Prototype.
- (hppaelf_finish): Prototype.
-
- Merge from elf32.em
- * emultempl/hppaelf.em: Include ctype.h.
- (struct orphan_save): New.
- (gld${EMULATION_NAME}_place_orphan): New.
- (output_rel_find): New.
- (hppaelf_get_script): Update from elf32.em.
- (ld_hppaelf_emulation): Rename to ld_${EMULATION_NAME}_emulation.
- Change emulation_name field to "${EMULATION_NAME}". Add
- gld${EMULATION_NAME}_place_orphan.
-
- * Makefile.am (ALL_EMULATIONS): Reinstate ehppaelf.o, add
- ehppalinux.o, sort it. Regenerate dependencies.
- (ehppalinux.c): Depend on hppaelf.em
- * Makefile.in: Regenerate.
-
- * configure.tgt: targ_emul=hppalinux for hppa*linux
-
- * emulparams/hppalinux.sh: New.
- * emulparams/hppaelf.sh (TARGET_PAGE_SIZE): Write in hex.
-
-2000-07-08 Alan Modra <alan@linuxcare.com.au>
-
- * lexsup.c (parse_args): Copy section name.
-
-2000-07-07 Charles Wilson <cwilson@ece.gatech.edu>
-
- * emultempl/pe.em: institute the following search order for
- dynamic libraries on pei386: libfoo.dll.a, foo.dll.a (import
- libs), libfoo.dll, foo.dll (link direct to dll). Fall back to
- static lib (libfoo.a) if none of the above are found.
-
-2000-07-07 Mumit Khan <khan@xraylith.wisc.edu>
-
- * emultempl/pe.em (pe_enable_auto_image_base): New variable.
- (longopts): New --{enable,disable}-auto-image-base options.
- (gld_${EMULATION_NAME}_list_options): Document.
- (gld_${EMULATION_NAME}_parse): Handle.
- (strhash): New static function.
- (compute_dll_image_base): New static function.
- (gld_${EMULATION_NAME}_set_symbols): Use.
-
-2000-07-05 DJ Delorie <dj@redhat.com>
-
- * MAINTAINERS: new
-
-2000-07-01 Koundinya K <kk@ddeorg.soft.net>
-
- * configure.tgt: Add traditional mips (mips*-*-sysv4*) target.
- * emulparams/elf32btsmip.sh: New file.
- * Makefile.am: Add traditional mips target.
- * Makefile.in: Rebuild.
-
-2000-07-01 H.J. Lu <hjl@gnu.org>
-
- * Makefile.am (EXTRA_ld_new_SOURCES): Set to deffilep.y for
- automake to use YLWRAP.
- * Makefile.in: Rebuild.
-
-2000-07-01 Alan Modra <alan@linuxcare.com.au>
-
- * Makefile.am (DEP): Fix 2000-06-22. grep after running dep.sed
- (CLEANFILES): Add DEPA.
- * Makefile.in: Regenerate.
-
-2000-06-30 Timothy Wall <twall@ppc>
-
- * scripttempl/tic54xcoff.sc: PAGE N is not implemented, so encode
- the page in the upper octet of the address.
-
-2000-06-26 Marek Michalkiewicz <marekm@linux.org.pl>
-
- * emulparams/avrmega161.sh (ARCH): Change to avr:5.
-
-2000-06-24 Alan Modra <alan@linuxcare.com.au>
-
- * NEWS: arm-elf does --gc-sections too.
-
-2000-06-22 Alan Modra <alan@linuxcare.com.au>
-
- * Makefile.am (DEP): grep for leading `/' in DEP1, and fail if we
- find one.
- * Makefile.in: Regenerate.
+ * ldlang.c (map_input_to_output_sections): Initialize sections
+ mentioned in a data statement expression.
+ (lang_do_assignments_1): Add data statement's expression's
+ section's vma.
-2000-06-21 H.J. Lu <hjl@gnu.org>
+2004-02-18 Nathan Sidwell <nathan@codesourcery.com>
- * Makefile.am: Rebuild dependency.
- * Makefile.in: Rebuild.
+ * ldgram.y (statement_anywhere): Add assert rule.
+ * ldlang.c (exp_init_os): Add assert case.
-2000-06-20 H.J. Lu <hjl@gnu.org>
+2004-02-14 Andrew Cagney <cagney@redhat.com>
- * Makefile.am: Rebuild dependency.
- * Makefile.in: Rebuild.
+ * ldmain.c (remove_output): Call bfd_cache_close.
-2000-06-20 Timothy Wall <twall@cygnus.com>
+2004-02-14 Richard Sandiford <rsandifo@redhat.com>
- * scripttempl/tic54xcoff.sc: New.
- * ldlang.c (wild_doit): Propagate SEC_BLOCK flag.
- * gen-doc.texi: Add flag for TI COFF.
- * ld.texinfo: Add documentation for TI COFF handling switches.
- * emultempl/ticoff.em: New. TI COFF handling.
- * configure.tgt: Add tic54x target.
- * Makefile.am: Add tic54x target.
- * Makefile.in: Ditto.
+ * emulparams/elf32bmipn32-defs.sh (OTHER_SECTIONS): Discard
+ .MIPS.content* and .MIPS.events* sections.
-2000-06-20 Alan Modra <alan@linuxcare.com.au>
+2004-02-09 Daniel Jacobowitz <drow@mvista.com>
- * ldmain.c (set_scripts_dir): Correct pointer comparison when
- checking for backslashes.
+ * emulparams/armelf.sh, emulparams/armelf_linux.sh: Move
+ .note.gnu.arm.ident to after allocated sections. Mark its
+ address as 0.
-2000-06-19 Alan Modra <alan@linuxcare.com.au>
+2004-02-09 Daniel Jacobowitz <drow@mvista.com>
- * NEWS: Move entries not in 2.10 above "Changes in version 2.10".
+ * emulparams/armelf_linux.sh (COMMONPAGESIZE): Set to 4KB.
+ * emulparams/elf32bmip.sh (COMMONPAGESIZE): Likewise.
+ * emulparams/elf32bmipn32.sh (COMMONPAGESIZE): Likewise.
+ * emulparams/elf32btsmipn32.sh (COMMONPAGESIZE): Likewise.
+ * emulparams/shlelf_linux.sh (COMMONPAGESIZE): Likewise.
-2000-06-18 Alan Modra <alan@linuxcare.com.au>
+2004-02-05 Nick Clifton <nickc@redhat.com>
- * NEWS: Update list of targets supporting --gc-sections.
+ * emultempl/pe.em (_after_open): Fix typo in previous delta.
- * scripttempl/elf.sc: KEEP .eh_frame contents.
- * scripttempl/elfd30v.sc: Same here.
+2004-02-04 Danny Smith <dannysmith@users.sourceforge.net>
-2000-06-18 Stephane Carrez <stcarrez@worldnet.fr>
+ * emultempl/pe.em (_after_open): Fix thinko in 2003-12-18 patch.
- * Makefile.am (ALL_EMULATIONS): Added new emulation for m68hc12
- and m68hc11 (elf).
- * Makefile.in: Rebuild.
- * configure.tgt: Recognize m68hc12 and m68hc11.
- * scripttempl/elfm68hc12.sc: New file.
- * emulparams/m68hc12elfb: New emulation.
- * emulparams/m68hc12elf: New emulation.
- * emulparams/m68hc11elfb.sh: New file. User configurable emulation
- (includes a memory.x script to define the ROM and RAM banks).
- * scripttempl/elfm68hc11.sc, emulparams/m68hc11elf.sh:
- New configuration files for support of Motorola 68hc11
+2004-01-28 Alan Modra <amodra@bigpond.net.au>
-2000-06-15 Alan Modra <alan@linuxcare.com.au>
+ * genscripts.sh: Fix typo.
- * ldmain.c (main): Only change SEC_READONLY for final link.
+ * genscripts.sh: Apply $LIBPATH_SUFFIX to $tool_lib and $libdir too.
-2000-06-13 H.J. Lu <hjl@gnu.org>
+2004-01-24 Jakub Jelinek <jakub@redhat.com>
- * configure: Regenerate.
+ * emulparams/elf64_ia64.sh: Put .rela.opd into
+ OTHER_GOT_RELOC_SECTIONS instead of OTHER_PLT_RELOC_SECTIONS.
-2000-06-08 David O'Brien <obrien@FreeBSD.org>
+2004-01-20 Danny Smith <dannysmith@users.sourceforge.net>
- * configure.in (VERSION): Update to show this is the CVS mainline.
+ * pe-dll.c (pe_create_import_fixup): Clear WP_TEXT flag.
+ * ld.texinfo (--omagic): Note that writable text section
+ does not conform to published PE-COFF specs.
+ (--enable-auto-import): Likewise.
-2000-06-07 Michael Sokolov <msokolov@ivan.Harhan.ORG>
+2004-01-15 Alan Modra <amodra@bigpond.net.au>
- * emultempl/mipsecoff.em (gld{EMULATION_NAME}_after_open): Require all
- input objects to be ECOFF.
- (check_sections): einfo takes %B, not %P, to print a BFD name.
+ * emulparams/elf32ppc.sh (COMMONPAGESIZE): Define.
-2000-06-05 Michael Matz <matz@ifh.de>
+2004-01-13 Nick Clifton <nickc@redhat.com>
- * ldgram.y (vers_defns): Handle 'extern "C++" { ... }' in
- version scripts.
-
- * ldlex.l (V_IDENTIFIER): Accept `::' in symbols.
-
-2000-05-23 Marek Michalkiewicz <marekm@linux.org.pl>
-
- * emulparams/avr1200.sh (STACK): Define as 0.
- * emulparams/avr23xx.sh (STACK): Define as last internal SRAM address.
- * emulparams/avr4433.sh (STACK): Likewise.
- * emulparams/avr44x4.sh (STACK): Likewise.
- * emulparams/avr85xx.sh (STACK): Likewise.
- * emulparams/avrmega103.sh (STACK): Likewise.
- * emulparams/avrmega161.sh (STACK): Likewise.
- * emulparams/avrmega603.sh (STACK): Likewise.
- * scripttempl/elf32avr.sc (__data_start): Define for gcrt1.
- (__stack): Define from ${STACK} for main().
-
-2000-05-26 Alan Modra <alan@linuxcare.com.au>
-
- * Makefile.am: Update dependencies with "make dep-am"
- * Makefile.in: Regenerate.
-
-2000-05-26 Eli Zaretskii <eliz@is.elta.co.il>
-
- * ldmain.c: Include filenames.h.
- (set_scripts_dir): Support backslashes in program name.
-
-2000-05-22 Igor Shevlyakov <igor@windriver.com>
-
- * ldmain.c (main): When deciding if ".text" section should be
- read-only, don't forget to reset SEC_READONLY because it
- could be already set.
-
-2000-05-22 Thomas de Lellis <tdel@windriver.com>
-
- * ld.1: Add documentation for new command line option:
- --section-start <sectionname>=<sectionorg>
- This is a generic version of -Ttext etc. which accepts
- any section name as a parameter instead of just text/data/
- bss.
- * ld.texinfo: More docs.
- * NEWS: More docs.
- * lexsup.c: (parse_args): Recognize new command line option.
- (ld_options): Add new option.
-
-2000-05-18 H.J. Lu <hjl@gnu.org>
-
- * lexsup.c (parse_args): `i' == `r', not `q'.
-
-2000-05-18 Jeffrey A Law (law@cygnus.com)
-
- * configure.tgt (hppa*64*-*-*): Enable PA64 target.
-
-2000-05-17 S. Bharadwaj Yadavalli <sby@scrugs.lkg.dec.com>
- Rick Gorton <gorton@scrugs.lkg.dec.com>
-
- Add support for '-q' == '--emit-relocs' switch.
- * ldmain.c (main): Default to false.
- * lexsup.c (parse_args): Turn on emitrelocations flag if set.
- * NEWS: Describe the emitrelocations switch.
- * ld.texinfo: Describe the emitrelocations switch.
-
-2000-05-16 Charles Wilson <cwilson@ece.gatech.edu>
-
- * emultempl/pe.em (_open_dynamic_archive): New function: Search
- the library path for "foo.dll" and "libfoo.dll" dynamic libraries
- before searching for 'libfoo.a' in response to a '-Bdynamic -lfoo'
- link options.
-
-2000-05-15 David O'Brien <obrien@FreeBSD.org>
-
- * lexsup.c (parse_args): Update the year in the copyright notice.
-
-2000-05-13 Alan Modra <alan@linuxcare.com.au>
-
- * ld.h (gettext, dgettext, dcgettext, textdomain, bindtextdomain):
- Replace defines with those from intl/libgettext.h to quieten gcc
- warnings.
-
-2000-05-10 H.J. Lu <hjl@gnu.org>
-
- * ldlang.c (open_input_bfds): Don't load the same file within
- a group again if the whole archive has been loaded already.
-
-2000-05-03 Alan Modra <alan@linuxcare.com.au>
-
- From Ulf Carlsson <ulfc@engr.sgi.com> and Andreas Jaeger <aj@suse.de>
- * lexsup.c (set_section_start): Use bfd_scan_vma rather than
- strtoul.
-
-2000-05-01 Jim Wilson <wilson@cygnus.com>
-
- * configure.host (ia64-*-linux-gnu*): Change gcc to ${CC}.
-
- * configure.host: Added HOSTING_CRT0, HOSTING_LIBS for
- host "ia64-*-linux-gnu*".
-
-2000-04-29 Andreas Jaeger <aj@suse.de>
-
- * ld.h: Correctly check GCC version.
-
-2000-04-25 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.am: Add PA64 support. Add missing dependencies for
- PA32 elf support.
+ * ldlang.c (lang_get_regions): Add extra parameter 'have_vma'
+ which if true will prevent the LMA region being used as a
+ replacement for a default VMA region.
+ (lang_leave_output_section_statement): Pass extra parameter.
+ (lang_leave_overlay): Likewise.
+ * ld.texinfo (Output Section LMA): Document that the LMA
+ region can be set to the VMA region if no VMA has been set.
+ * ldlang.h (struct lang_output_section_phdr_list): Create a
+ typedef for this type. Minor formatting fixes.
+
+2004-01-13 Nick Clifton <nickc@redhat.com>
+
+ * ldlang.c (lang_size_sections_1): If dot is advanced, then
+ assume that the section should be allocated.
+
+2004-01-13 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (IGNORE_SECTION): Don't ignore SEC_ALLOC && !SEC_LOAD
+ sections. Do ignore SEC_NEVER_LOAD sections.
+ (lang_size_sections_1): Remove test made redundant with the above.
+
+2004-01-09 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/ppc64elf.em (ppc_before_allocation): Clear cached
+ program_header_size.
+
+2004-01-06 Alexandre Oliva <aoliva@redhat.com>
+
+ 2003-11-28 Alexandre Oliva <aoliva@redhat.com>
+ * emulparams/elf32frvfd.sh (EMBEDDED): Clear.
+ 2003-11-05 Alexandre Oliva <aoliva@redhat.com>
+ * emulparams/elf32frvfd.sh (STACK_ADDR): Unset.
+ (MAXPAGESIZE): Set to 64Kb.
+ (OTHER_READONLY_SECTIONS): Define __ROFIXUP_LIST__ and
+ __ROFIXUP_END__. Don't map .rofixup.got any more.
+ * emulparams/elf32frv.sh (NOP): Set.
+ 2003-10-31 Alexandre Oliva <aoliva@redhat.com>
+ * configure.tgt: Add frv-*-*linux*.
+ 2003-09-30 Alexandre Oliva <aoliva@redhat.com>
+ * Makefile.am (ALL_EMULATIONS): Added eelf32frvfd.o.
+ (eelf32frvfd.c): New.
+ * configure.tgt <frv-*-*>: Added it to targ_extra_emuls.
+ * emulparams/elf32frv.sh: Reverted previous two patches.
+ * emulparams/elf32frvfd.sh: New.
* Makefile.in: Rebuilt.
- * configure.tgt: Add PA64 support (currently disabled).
-
-2000-04-25 Alan Modra <alan@linuxcare.com.au>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_place_section): Delete.
- (output_rel_find): New function.
- (hold_section, hold_use): Delete.
- (hold_text, hold_rodata, hold_data, hold_bss, hold_rel,
- hold_interp): Make local to place_orphan.
- (gld${EMULATION_NAME}_place_orphan): Use lang_output_section_find
- rather than place_section to find possible previous use of orphan.
- Similarly find the place-holder output sections. Use returned
- value from lang_enter_output_section_statement rather than calling
- lang_output_section_statement_lookup.
- * emultempl/armelf.em: Same here.
- * emultempl/pe.em: Similar to above, but no need for output_rel_find.
-
- * ldlang.c (lang_enter_output_section_statement): Return output
- section statement.
- * ldlang.h (lang_enter_output_section_statement): Change
- declaration too.
-
- * ldlang.h (lang_output_section_statement): Export it.
- * ldlang.c (lang_output_section_statement): Ditto.
-
-2000-04-24 Nick Clifton <nickc@cygnus.com>
-
- * ld.texinfo (Output Section Data): Add note that section data
- commands cannot appear outside of section directives.
-
-2000-04-2 Matthew Green <mrg@cygnus.com>
-
- * configure.tgt: Add NetBSD/sparc ELF, and NetBSD/sparc64 support.
-
-2000-04-21 Richard Henderson <rth@cygnus.com>
- David Mosberger <davidm@hpl.hp.com>
-
- * Makefile.am (ALL_64_EMULATIONS): Add eelf64_ia64.o.
- (eelf64_ia64.c): New rule.
- * Makefile.in: Rebuild.
- * configure.tgt (ia64-*-elf*, ia64-*-linux*): New targets.
- * emulparams/elf64_ia64.sh: New file.
-
-2000-04-21 Richard Henderson <rth@cygnus.com>
-
- * scripttempl/elfd30v.sc: Place .gcc_except_table.
-
-2000-04-19 Alan Modra <alan@linuxcare.com.au>
-
- * dep-in.sed: Match space at start of file name, not at end.
-
-2000-04-18 H.J. Lu <hjl@gnu.org>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Call
- lang_leave_output_section_statement () after calling
- lang_enter_output_section_statement ().
- * emultempl/armelf.em: Likewise.
-
-2000-04-18 Alan Modra <alan@linuxcare.com.au>
-
- * emultempl/elf32.em (struct orphan_save): Add section field.
- (gld${EMULATION_NAME}_place_orphan): Use above to keep sections in
- better order, and place first orphan section as we did before the
- 2000-04-12 patch. Ignore ~SEC_ALLOC sections when choosing place.
- Don't call make_bfd_section here, let wild_doit do the job for us.
- Don't build a statement list when we'll only throw it away.
- * emultempl/armelf.em: Ditto.
- * emultempl/pe.em: Similarly.
-
-2000-04-14 Geoff Keating <geoffk@cygnus.com>
-
- * scripttempl/elfppc.sc: Remove.
- * emulparams/elf32ppc.sh: Use elf.sc.
- * emulparams/elf32lppc.sh: Use elf.sc.
- * emulparams/elf32ppclinux.sh: Use elf.sc.
- * emulparams/elf32ppcsim.sh: New file.
- * emulparams/elf32lppcsim.sh: New file.
- * Makefile.am: Update dependencies. Add elf32ppcsim ad elf32lppcsim.
- (ALL_EMULATIONS): Add elf32ppcsim ad elf32lppcsim.
- * Makefile.in: Regenerate.
- * configure.tgt (powerpc-*): Add elf32ppcsim and elf32lppcsim.
-
-2000-04-14 Alan Modra <alan@linuxcare.com.au>
-
- * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Process
- ~SEC_ALLOC sections too. Init start address of debug sections.
- * emultempl/armelf.em (gld${EMULATION_NAME}_place_orphan): Ditto.
- * emultempl/pe.em (gld${EMULATION_NAME}_place_orphan): Ditto.
- Also set all relocateable section start addresses.
-
-2000-04-13 Geoff Keating <geoffk@cygnus.com>
-
- * scripttempl/elf.sc: Add support for .sbss2 and .sdata2 sections.
- Add new BSS_PLT variable for when .plt need not be contained in
- the file. Move _etext so that it is also after .fini, and provide
- both etext and _etext with a leading underscore. Mark the start
- and end of .sbss.
-
-2000-04-12 Alan Modra <alan@linuxcare.com.au>
-
- * emultempl/elf32.em (struct orphan_save): New.
- (hold_text, hold_rodata, hold_data, hold_bss, hold_rel,
- hold_interp): Make them struct orphan_save.
- (gld${EMULATION_NAME}_place_section): Modify for new hold_*.
- (gld${EMULATION_NAME}_place_orphan): Add new orphan sections to
- the end of the relevant section list. Also add associated section
- statements to the end of any previous orphan statements.
- * emultempl/armelf.em: Similarly.
- * emultempl/pe.em: Similarly.
-
-2000-04-11 Alan Modra <alan@linuxcare.com.au>
-
- * ld.texinfo (Simple Example): Remove extraneous paragraph.
-
-2000-04-07 Andrew Cagney <cagney@b1.cygnus.com>
-
- * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add
- --enable-build-warnings option.
- * Makefile.am (AM_CFLAGS, WARN_CFLAGS): Add definitions.
- * Makefile.in, configure: Re-generate.
-
-2000-04-04 Alan Modra <alan@linuxcare.com.au>
-
- * po/ld.pot: Regenerate.
-
- * lexsup.c (help): Restore translated part of bug string.
-
- * Makefile.am (MKDEP): Use gcc -MM rather than mkdep.
- (DEP): Quote when passing vars to sub-make. Add warning message
- to end.
- (DEP1): Rewrite for "gcc -MM".
- (CLEANFILES): Add DEP2.
- Update dependencies.
- * Makefile.in: Regenerate.
-
-2000-04-03 Alan Modra <alan@linuxcare.com.au>
-
- * ld.h: #include "bin-bugs.h"
- * lexsup.c (help): Use REPORT_BUGS_TO.
-
-2000-03-27 Denis Chertykov <denisc@overta.ru>
-
- * configure.tgt (avr-*-*): New target support.
- * Makefile.am: Likewise.
- * scripttempl/elf32avr.sc: New script file.
- * emulparams/avr1200.sh: New file.
- * emulparams/avr23xx.sh: New file.
- * emulparams/avr4433.sh New file.
- * emulparams/avr44x4.sh New file.
- * emulparams/avr85xx.sh New file.
- * emulparams/avrmega103.sh New file.
- * emulparams/avrmega161.sh New file.
- * emulparams/avrmega603.sh New file.
- * Makefile.in: Regenerate.
-
-2000-03-09 Andreas Jaeger <aj@suse.de>
-
- * Makefile.am (check-DEJAGNU): Also unset LANG.
- * Makefile.in: Rebuild.
-
-2000-03-06 Ian Lance Taylor <ian@zembu.com>
-
- * ldfile.c (ldfile_try_open_bfd): Don't crash if we see an empty
- archive.
-
-2000-03-02 H.J. Lu <hjl@gnu.org>
-
- * emulparams/elf32mcore.sh: Include "getopt.h".
-
-2000-03-01 Ian Lance Taylor <ian@zembu.com>
-
- * configure.tgt: Remove *-*-aout, *-*-coff, and *-*-netware.
-
-2000-03-01 H.J. Lu <hjl@gnu.org>
-
- * emulparams/mipspe.sh: Add SUBSYSTEM and INITIAL_SYMBOL_CHAR.
- * emulparams/shpe.sh: Likewise.
-
-2000-03-01 Nick Clifton <nickc@cygnus.com>
-
- * pe-dll.c: Remove unused variables and add ATTRIBUTE_UNUSED
- to unused parameters.
-
- * emultempl/pe.em: Add "#ifdef DLL_SUPPORT" around static
- functions only used by DLL code.
- (_place_orphan): Initialise 'dollar'.
-
-2000-03-01 H.J. Lu <hjl@gnu.org>
-
- * ldmain.c (undefined_symbol): Take one more arg, fatal, to
- indicate if the undefined symbol is a fatal error or not.
- Don't delete the output file if "fatal" is false.
-
-2000-02-29 H.J. Lu <hjl@gnu.org>
-
- * Makefile.am (check-DEJAGNU): Also pass LIBS="$(LIBS)".
- Set LC_COLLATE and LC_ALL to null and export them. It is for
- sort which expects the C locale.
- Add $(LIBS) to all $(HOSTING_LIBS).
- * Makefile.in: Rebuild.
-
-2000-02-29 Alan Modra <alan@spri.levels.unisa.edu.au>
-
- * emultempl/{aix.em, armcoff.em, armelf.em, armelf_oabi.em,
- beos.em, elf32.em, generic.em, gld960.em, gld960c.em, hppaelf.em,
- linux.em, lnk960.em, mipsecoff.em, sunos.em, vanilla.em}
- (ld_emulation_xfer_struct): Add missing NULL initialiser for
- find_potential_libraries.
-
-2000-02-28 Jim Blandy <jimb@redhat.com>
-
- * ldgram.y (exclude_name_list): Don't require a comma to separate
- list entries; the lexer considers commas to be valid part of a
- filename, so in something like `foo, bar' the comma is considered
- part of the first filename, `foo,'.
- * ld.texinfo: Update section on EXCLUDE_FILE lists.
-
-2000-02-27 Loren J. Rittle <ljrittle@acm.org>
-
- * configure.host: Added HOSTING_CRT0, HOSTING_LIBS for
- host "i[3456]86-*-freebsdelf*".
-
-2000-02-27 Mark Elbrecht <snowball3@bigfoot.com>
-
- * scripttempl/i386go32.sc: Move misplaced semicolons.
-
-2000-02-25 Ian Lance Taylor <ian@zembu.com>
-
- * Makefile.am (ALL_EMULATIONS): Remove ehppaelf.o.
- (ALL_64_EMULATIONS): Remove eelf64hppa.o.
- (eelf64hppa.c, ehppaelf.c): Remove targets.
- * Makefile.in: Rebuild.
-
-2000-02-25 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
-
- * configure.tgt (targ_extra_ofiles): Enable elf64_sparc on
- GNU/Linux/sparc, but keep the default as 32.
-
- * configure.tgt: Enable elf64_sparc on Solaris7+/sparc. And make
- it default if sparcv9 or sparc64.
-
-2000-02-24 Nick Clifton <nickc@cygnus.com>
-
- * Makefile.am: Add rules to build emipspe.o and earmpe.o.
- * Makefile.in: Regenerate.
- * configure.tgt: Add targets for arm-wince, sh-pe and mips-pe.
-
- * ldemul.h (ld_emulation_xfer_struct): Add new field:
- find_potential_libraries.
- * ldemul.c (ldemul_find_potential_libraries): New function.
-
- * ldfile.c (ldfile_open_file_search): Allow function to be
- exported.
- (ldfile_open_file): Call ldemul_find_potential_libraries.
- * ldfile.h: Add prototype for ldfile_open_file_search.
-
- * pe-dll.c: Add support for ARM, MIPS and SH targets.
-
- * emulparams/mipspe.sh: New file. Parameters for mips-pe target.
- * emulparams/shpe.sh: New file. Parameters for sh-pe target.
-
- * emultempl/pe.em: Add support for ARM, MIPS and SH DLLs.
- (gld_X_find_potential_libraries): New function. Search for
- libraries called "*.lib".
-
- * scripttempl/pe.sc: Add .pdata section.
-
-2000-02-23 Richard Henderson <rth@cygnus.com>
-
- * scripttempl/elfd10v.sc: Remove dynamic linking hooks.
- Add and use memory regions.
-
-2000-02-23 Linas Vepstas (linas@linas.org)
-
- * emulparams/elf32i370.sh, scripttempl/elfi370.sc: New.
-
- * Makefile.am: Add support for Linux/IBM 370.
- * configure.tgt: Likewise.
-
- * Makefile.in: Regenerate.
-
-2000-02-21 Alan Modra <alan@spri.levels.unisa.edu.au>
-
- * ldlang.c (print_input_section, print_data_statement,
- print_reloc_statement, print_padding_statement, insert_pad,
- size_input_section, lang_check_section_addresses,
- lang_size_sections, lang_do_assignments, lang_set_startof,
- lang_one_common): Change `opb' to unsigned.
- (lang_do_assignments): Also change `size' to unsigned.
-
-2000-02-16 Richard Henderson <rth@cygnus.com>
-
- * scripttempl/elf.sc: Place OTHER_PLT_RELOC_SECTION.
-
-2000-02-16 Timothy Wall <twall@cygnus.com>
-
- * mri.c (mri_draw_tree): Add default LMA region argument to call
- to lang_leave_output_section_statement.
- * ldlang.h: Update prototypes with LMA region arguments.
- * ldlang.c (lang_size_sections): Encapsulate region bounds
- checking in os_check_region call.
- (os_check_region): New function.
- (lang_output_section_statement_lookup): Initialize lma_region.
- (lang_leave_output_section_statement): Add LMA region argument.
- (lang_leave_overlay): Ditto.
- * ldgram.y: Handle LMA region syntax.
- * ld.texinfo (Output Section Description): Describe LMA region usage.
- * emultempl/armelf.em (gld$place_orphan): Add default value for
- lma region in call to lang_leave_output_section_statement.
- * emultempl/elf32.em (gld$place_orphan): Add default value for
- lma region in call to lang_leave_output_section_statement.
- * emultempl/pe.em (gld$place_orphan): Add default value for
- lma region in call to lang_leave_output_section_statement.
-
-
-2000-02-04 Timothy Wall <twall@redhat.com>
-
- * ldlang.c (lang_check_section_addresses): Use bytes instead of
- octets when calculating section end addresses.
-
-2000-02-04 Timothy Wall <twall@redhat.com>
-
- * ldlang.c (lang_size_sections): Fix typo in ALIGN_N invocation.
-
-2000-02-03 Timothy Wall <twall@redhat.com>
-
- * ldexp.c (fold_name): Make SIZEOF operator return byte count, not
- octet count.
- * ldlang.c (print_input_section, print_data_statement,
- print_reloc_statement, print_padding_statement): Print target
- address values and section sizes as bytes, not octets.
- (insert_pad) Calculate padding size in octets, and adjust "dot"
- by bytes.
- (size_input_section) Always adjust "dot" by bytes, not octets.
- (lang_check_section_addresses, lang_do_assignments) Adjust
- "dot" by bytes, not octets. Use the larger of the directive size
- or octets_per_byte for the number of octets actually allocated in
- the output section.
- (lang_set_startof) Make sure STARTOF returns a target address.
- (lang_one_common) Record size changes in octets.
- (lang_abs_symbol_at_end_of) Section end symbol's value is
- recorded in target bytes.
- * ld.texinfo: Updated description of BYTE, SHORT, LONG, etc.
- to be clear about behavior when an octet is smaller than one byte.
-
-2000-01-27 Alan Modra <alan@spri.levels.unisa.edu.au>
-
- * ldcref.c (output_cref): Don't pass message strings to printf
- as format arg.
- Update copyright.
-
- * ldmisc.c (vfinfo): Same here.
- Update copyright.
-
-2000-01-23 Alan Modra <alan@spri.levels.unisa.edu.au>
-
- * emultempl/{armcoff.em,armelf.em,armelf_oabi.em,beos.em,
- generic.em,gld960.em,gld960c.em,hppaelf.em,linux.em,lnk960.em,
- mipsecoff.em,sunos.em,vanilla.em} (ld_emulation_xfer_struct):
- Add missing NULL initialisers, and comments.
-
- * testsuite/ld-srec/sr3.cc (__rethrow): New.
-
-2000-01-21 Nick Clifton <nickc@cygnus.com>
-
- * ldlang.c (lang_size_sections): Fix typo in comment.
-
-2000-01-18 H.J. Lu <hjl@gnu.org>
-
- * ldlang.c (lang_size_sections): Also update the current
- address of a region if the SEC_NEVER_LOAD bit is not set.
-
-2000-01-10 Philip Blundell <pb@futuretv.com>
-
- * configure.tgt (arm*-*-conix*): New target.
-
-2000-01-07 Nick Clifton <nickc@cygnus.com>
-
- * ld.texinfo (Options): Remind users to preceed linker command
- line switches with -Wl, (or whatever is appropriate) if it is
- being invoked by a comnpiler driver program.
- Fix description of the behaviour of the -n command line switch.
-
-2000-01-05 Catherine Moore <clm@cygnus.com>
-
- * ld.h (wildcard_spec): Change exclude_name to exclude_name_list.
- (name_list): New.
- * ld.texinfo (EXCLUDE_FILE): Update documentation.
- * ldgram.y (wildcard_spec): Support a list of excluded_files.
- (exclude_name_list): New.
- ldlang.c (walk_wild_section): Support list of excluded files.
- (print_wild_statement): Likewise.
- (lang_add_wild): Likewise.
- * ldlang.h (lang_wild_statement_type): Likewise.
- * scripttempl/elf.sc (OTHER_EXCLUDE_FILES): Support.
-
-2000-01-04 Mumit Khan <khan@xraylith.wisc.edu>
-
- * pe-dll.c (pe_dll_warn_dup_exports): New variable.
- (process_def_file): Use.
- (pe_dll_compat_implib): New variable.
- (make_one): Use.
-
- * pe-dll.h: Add exports of pe_dll_warn_dup_exports and
- pe_dll_compat_implib.
-
- * emultempl/pe.em (longopts): Add warn-duplicate-exports and
- compat-implib options.
- (gld_${EMULATION_NAME}_list_options): List new options.
- (gld_${EMULATION_NAME}_parse_args): Handle.
-
- * pe-dll.c (pe_dll_generate_implib): Use the correct name for output
- dll.
-
- * deffilep.y (opt_name): Allow "." in name.
-
-For older changes see ChangeLog-9899
+ 2003-09-18 Alexandre Oliva <aoliva@redhat.com>
+ * emulparams/elf32frv.sh (OTHER_READONLY_SECTIONS): Added
+ .rofixup.got to .rofixup.
+ 2003-09-15 Alexandre Oliva <aoliva@redhat.com>
+ * emulparams/elf32frv.sh (MAXPAGESIZE): Make it 256KiB, not 256B.
+ (TEMPLATE_NAME, GENERATE_SHLIB_SCRIPT): Set.
+
+2004-01-05 Jakub Jelinek <jakub@redhat.com>
+
+ * emulparams/elf_s390.sh (NO_SMALL_DATA): Set to yes.
+ * emulparams/elf64_s390.sh (NO_SMALL_DATA): Set to yes.
+
+2004-01-03 Alan Modra <amodra@bigpond.net.au>
+
+ * ldexp.c (align_n): Make static.
+ * ldexp.h (align_n): Delete declaration.
+ * ldlang.h (lang_enter_output_section_statement): Remove
+ block_value param.
+ * ldlang.c (lang_enter_output_section_statement): Likewise.
+ (TO_ADDR, TO_SIZE): Define.
+ (opb_shift): New var.
+ (init_opb): New function.
+ (print_input_section): Call init_opb and use TO_ADDR.
+ (print_data_statement, print_reloc_statement): Likewise.
+ (print_padding_statement): Likewise.
+ (size_input_section): Use TO_SIZE and TO_ADDR, and global opb_shift.
+ (lang_check_section_addresses): Likewise.
+ (lang_size_sections_1): Likewise.
+ (lang_do_assignments_1): Likewise.
+ (lang_set_startof): Likewise.
+ (lang_one_common): Likewise. Combine power_of_two and opb_shift align.
+ (lang_process): Call init_opb.
+ (lang_abs_symbol_at_end_of): Use TO_ADDR and global opb_shift.
+ (lang_enter_overlay_section): Adjust
+ lang_enter_output_section_statement call.
+ * ldgram.y: Likewise.
+ * mri.c (mri_draw_tree): Likewise.
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Likewise.
+ * emultempl/mmo.em (mmo_place_orphan): Likewise.
+ * emultempl/pe.em (gld${EMULATION_NAME}_place_orphan): Likewise.
+
+ * ldfile.c (ldfile_set_output_arch): Add defarch param.
+ * ldfile.h (ldfile_set_output_arch): Ditto.
+ * emultempl/aix.em (gld${EMULATION_NAME}_before_parse): Use
+ ldfile_set_output_arch.
+ * emultempl/beos.em (gld${EMULATION_NAME}_before_parse): Ditto.
+ * emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Ditto.
+ * emultempl/linux.em (gld${EMULATION_NAME}_before_parse): Ditto.
+ * emultempl/mipsecoff.em (gld${EMULATION_NAME}_before_parse): Ditto.
+ * emultempl/pe.em (gld${EMULATION_NAME}_before_parse): Ditto.
+ * emultempl/sunos.em (gld${EMULATION_NAME}_before_parse): Ditto.
+ * ldgram.y: Adjust ldfile_set_output_arch call.
+ * emultempl/armcoff.em (gld${EMULATION_NAME}_before_parse): Ditto.
+ * emultempl/armelf.em (gld${EMULATION_NAME}_before_parse): Ditto.
+ * emultempl/armelf_oabi.em (gld${EMULATION_NAME}_before_parse): Ditto.
+ * emultempl/generic.em (gld${EMULATION_NAME}_before_parse): Ditto.
+ * emultempl/gld960c.em (gld960_set_output_arch): Ditto.
+ * emultempl/m68kcoff.em (gld${EMULATION_NAME}_before_parse): Ditto.
+ * emultempl/ticoff.em (gld${EMULATION_NAME}_before_parse): Ditto.
+
+2004-01-02 Bernardo Innocenti <bernie@develer.com>
+
+ * configure.tgt: Add m68k-uClinux target.
+
+For older changes see ChangeLog-0203
Local Variables:
mode: change-log
diff --git a/contrib/binutils/ld/ChangeLog-0001 b/contrib/binutils/ld/ChangeLog-0001
new file mode 100644
index 0000000..9183afe
--- /dev/null
+++ b/contrib/binutils/ld/ChangeLog-0001
@@ -0,0 +1,3376 @@
+2001-12-21 Tom Rix <trix@redhat.com>
+
+ (gld*_create_output_section_statements): New function.
+ For -binitfini support.
+ * emultempl/aix.em (gld*_before_parse): Fix comment.
+ * emultempl/aix.em (gld*_parse_args): Fix comment.
+
+2001-12-20 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * configure.tgt (mips*-dec-netbsd*): Delete alias for
+ mips*el-*-netbsd*.
+ (sparc64-*-netbsd*): Add elf32_sparc to targ_extra_emuls.
+
+ * configure.tgt (arm-*-netbsdelf*): Add target.
+ (arm-*-netbsd*): Add armelf and armelf_nbsd to targ_extra_emuls.
+ * emulparams/armelf_nbsd.sh: Added.
+ * Makefile.am: Add rules for earmelf_nbsd.
+ * Makefile.in: Regenerate.
+
+2001-12-19 Andreas Jaeger <aj@suse.de>,
+ Susanne Oberhauser <froh@suse.de>
+
+ * configure.host: Add rules for x86_64-*linux-gnu. Change
+ s390x-linux entry to use gcc to report configuration, replace gcc
+ with $CC in s390-linux
+
+2001-12-19 Andreas Jaeger <aj@suse.de>
+
+ * ld.texinfo (VERSION): Fix markup.
+
+2001-12-18 matthew green <mrg@eterna.com.au>
+
+ * Makefile.am (ALL_EMULATIONS): Add m68kelfnbsd.o.
+ (m68kelfnbsd.c): New rule.
+ * Makefile.in: Regenerate.
+ * configure.tgt (m68*-hp-netbsd*): Renamed to ..
+ (m68*-*-netbsd*4k*): .. this.
+ (m68*-*-netbsdelf*): New target.
+ (m68*-*-netbsd*): Also include ELF support.
+ (m68*-*-netbsdaout*): New alias for m68*-*-netbsd*.
+ * emulparams/m68kelfnbsd.sh: New emulation.
+
+2001-12-18 Jakub Jelinek <jakub@redhat.com>
+
+ * ldgram.y (vers_node): Support anonymous version tags.
+ * ldlang.c (lang_register_vers_node): Ensure anonymous version
+ tag is not defined together with non-anonymous versions.
+ * ld.texinfo: Document it.
+
+2001-12-18 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * po/tr.po: New file: Turkish translation.
+ * configure.in (ALL_LINGUAS): Add tr.
+ * configure: Regenerate.
+
+2001-12-17 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * Makefile.am: Add rules for eelf64alpha_nbsd.
+ * Makefile.in: Regenerate.
+ * configure.tgt (alpha*-*-netbsd*): Set
+ targ_emul to elf64alpha_nbsd.
+ * emulparams/elf64alpha_nbsd.sh: Added.
+
+2001-12-17 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Adjust
+ section_tail when fiddling with section list.
+ (gld${EMULATION_NAME}_list_options): Ensure sentences aren't
+ broken into separate strings to make translation easier.
+ * emultempl/mmo.em (mmo_place_orphan): Adjust section_tail when
+ fiddling with section list.
+ * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
+
+2001-12-16 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * scripttempl/mmo.sc: Add .debug_ranges to listed sections.
+
+2001-12-15 Alan Modra <amodra@bigpond.net.au>
+
+ * ldmain.c (main): Initialise link_info.eh_frame_hdr.
+
+2001-12-13 Jakub Jelinek <jakub@redhat.com>
+
+ * emultempl/elf32.em (finish): Supply output_bfd
+ to bfd_elf*_discard_info.
+ (OPTION_EH_FRAME_HDR): Define.
+ (longopts): Add --eh-frame-hdr.
+ (parse_args): Handle it.
+ (list_options): Add --eh-frame-hdr to help.
+ * emultempl/hppaelf.em (finish): Supply output_bfd
+ to bfd_elf*_discard_info.
+ * scripttempl/elf.sc (.eh_frame_hdr): Add.
+
+2001-12-13 Alan Modra <amodra@bigpond.net.au>
+
+ * lexsup.c (parse_args): Don't pass shortopts to second call to
+ getopt functions. Restore optind rather than decrementing before
+ second call. Remove errind as it now duplicates last_optind.
+
+2001-12-11 Christopher Faylor <cgf@redhat.com>
+
+ * emultempl/pe.em (gld_${EMULATION_NAME}_list_options): Fix typo.
+
+2001-12-07 Geoffrey Keating <geoffk@redhat.com>
+ Richard Henderson <rth@redhat.com>
+
+ * Makefile.am: Add support for xstormy16.
+ * configure.tgt: Add support for xstormy16.
+ * Makefile.in: Regenerate.
+ * emulparams/elf32xstormy16.sh: New file.
+ * scripttempl/xstormy16.sc: New file.
+
+2001-10-01 Christopher Faylor <cgf@cygnus.com>
+
+ * Makefile.in (LIB_PATH): Make configurable.
+ (GENSCRIPTS): Set LIB_PATH in environment.
+ * configure.in: Substitute LIB_PATH.
+ * configure: Regenerate.
+ * configure.tgt (*cygwin): Set LIB_PATH for cross build.
+ * configure.host (*cygwin): Add /usr/lib/w32api to NATIVE_LIB_DIRS.
+
+2001-12-07 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * lexsup.c (ld_options): Insert 'PROGRAM' into the text string
+ describing the -N option so that it is easier to translate into
+ foreign languages.
+
+2001-12-05 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * emultempl/pe.em (..._list_options): Replace multiple fprintf
+ statements describing a single option with a single, newline
+ escaped fprintf. This allows better translation into other
+ languages.
+
+ * ldmain.c (add_archive_element): Combine multiple strings
+ into a single string to permit better translation into other
+ languages.
+
+2001-12-05 Tom Rix <trix@redhat.com>
+
+ * Makefile.am: Remove eaixppc64.
+ * Makefile.in: Regenerate.
+
+2001-12-04 Tom Rix <trix@redhat.com>
+
+ * emultempl/aix.em (choose_target): Change default target to
+ OUTPUT_FORMAT for ppcmacos. Add braces to remove compiler
+ warning.
+ (gld*_read_file): Fix typo.
+ (change_symbol_mode): Add prototype.
+ (is_syscall): Same.
+
+ * emulparams/aixppc.sh (SYSCALL_MASK, SYMBOL_MODE_MASK): Delete.
+ * emulparams/aixrs6.sh : Same.
+ * emulparams/ppcmacos.sh : Same.
+ * emulparams/aixppc64.sh : Delete file.
+ * emultempl/aix.em : Formatting changes.
+
+2001-12-04 Hans-Peter Nilsson <hp@axis.com>
+
+ * emulparams/criself.sh (NO_SMALL_DATA): Set, to yes.
+ (OTHER_BSS_END_SYMBOLS): Don't refer to .sbss when setting
+ __Sbss.
+ (OTHER_END_SYMBOLS): Fix formatting.
+ * emulparams/crislinux.sh (NO_SMALL_DATA): Set, to yes.
+ (OTHER_END_SYMBOLS): Fix formatting.
+
+2001-12-04 Alan Modra <amodra@bigpond.net.au>
+
+ * ldexp.c (exp_print_token): Correct "table" entry for RSHIFT.
+
+2001-12-02 Tom Rix <trix@redhat.com>
+
+ * configure.tgt : Remove eaixppc64 emulations.
+ * Makefile.in : Remove eaixppc64.c
+ * ldemul.c (ldemul_choose_target): New parameters argc, argv.
+ (ldemul_default_target): Same.
+ * emultempl/gld960.em (gld960_choose_target): Same.
+ * emultempl/gld960c.em (gld960_choose_target): Same.
+ * scripttempl/aix.sc: Remove OUTPUT_FORMAT.
+ * emultempl/aix.em (is_syscall): syscall_mask now a variable.
+ * emultempl/aix.em (gld*_read_file): symbol_mode_mask now a variable.
+ * emultempl/aix.em (gld*_parse_args): Handle -b32 -b64 emulation.
+ * emultempl/aix.em (choose_target): New function. Handle emulation of
+ -b32 and -b64.
+
+2001-11-27 H.J. Lu <hjl@gnu.org>
+
+ * emulparams/elf_i386.sh (NO_SMALL_DATA): Set to yes.
+ * emulparams/elf_i386_be.sh (NO_SMALL_DATA): Likewise.
+ * emulparams/elf_i386_chaos.sh (NO_SMALL_DATA): Likewise.
+ * emulparams/elf_i386_ldso.sh (NO_SMALL_DATA): Likewise.
+ * emulparams/elf_x86_64.sh (NO_SMALL_DATA): Likewise.
+ * emulparams/m68kelf.sh (NO_SMALL_DATA): Likewise.
+ * emulparams/elf32_sparc.sh (NO_SMALL_DATA): Likewise.
+ * emulparams/elf64_sparc.sh (NO_SMALL_DATA): Likewise.
+
+ * scripttempl/elf.sc (SBSS): New. Define if ${NO_SMALL_DATA}
+ is not empty.
+ (SDATA): Likewise.
+ (REL_SDATA): Likewise.
+ (REL_SBSS): Likewise.
+ (REL_SDATA2): Likewise.
+ (REL_SBSS2): Likewise.
+ (SBSS2): Define if ${NO_SMALL_DATA} is not empty.
+ (SDATA2): Likewise.
+
+2001-11-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * scripttempl/elfm68hc11.sc (CTOR, DTOR): Put constructor and
+ destructor in rom.
+ * scripttempl/elfm68hc12.sc (CTOR, DTOR): Likewise.
+
+2001-11-22 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.in: Regenerated with automake based on automake
+ 1.4-8 in RedHat 7.1.
+
+2001-11-22 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Define.
+ (config.status): Delete rule.
+ Add extra dependencies to cover sourced emulparams files.
+ * Makefile.in: Regenerate.
+
+ * scripttempl/elf.sc: Order <section>, <section>.* and
+ corresponding linkonce sections as seen in input files.
+ Formatting fixes. Zero vma of all sections if not relocating.
+ (STACK): Define and insert if STACK_ADDR defined.
+ (OTHER_RELOCATING_SECTIONS): Delete.
+ (OTHER_END_SYMBOLS): Define.
+ (OTHER_READONLY_SECTIONS): Always insert, not just when relocating.
+ (OTHER_READWRITE_SECTIONS): Likewise.
+ (OTHER_GOT_SECTIONS): Likewise.
+ (OTHER_SDATA_SECTIONS): Likewise.
+ (OTHER_BSS_SECTIONS): Likewise.
+ * scripttempl/elfi370.sc (OTHER_READONLY_SECTIONS): Likewise.
+ (OTHER_READWRITE_SECTIONS): Likewise.
+ * scripttempl/nw.sc (OTHER_READONLY_SECTIONS): Likewise.
+ (OTHER_READWRITE_SECTIONS): Likewise.
+
+ * emulparams/armelf.sh (OTHER_RELOCATING_SECTIONS): Delete.
+ (STACK_ADDR): Define.
+ * emulparams/armelf_oabi.sh: As for armelf.sh.
+ * emulparams/elf32mcore.sh: As for armelf.sh.
+ * emulparams/h8300elf.sh: As for armelf.sh.
+ * emulparams/mn10200.sh: As for armelf.sh.
+ * emulparams/shelf.sh: As for armelf.sh.
+
+ * emulparams/elf32fr30.sh (OTHER_RELOCATING_SECTIONS): Delete.
+ (OTHER_END_SYMBOLS): Define.
+ * emulparams/m32relf.sh: As for elf32fr30.sh.
+ * emulparams/h8300helf.sh: As for elf32fr30.sh.
+ * emulparams/h8300self.sh: As for elf32fr30.sh.
+
+ * emulparams/criself.sh (OTHER_READONLY_SECTIONS): Protect symbol
+ defines with RELOCATING test.
+ (OTHER_SDATA_SECTIONS): Likewise.
+ (OTHER_RELOCATING_SECTIONS): Delete, replacing with..
+ (OTHER_END_SYMBOLS): ..this.
+ * emulparams/crislinux.sh: As for criself.sh.
+
+ * emulparams/elf32bmipn32.sh (OTHER_SDATA_SECTIONS): Zero vma
+ if not relocating.
+ (OTHER_RELOCATING_SECTIONS): Delete, replacing with..
+ (OTHER_SECTIONS): ..this. Zero vma if not relocating. Order
+ normal and linkonce sections as seen in input files.
+ * emulparams/elf32bmip.sh (DATA_ADDR): Don't define if EMBEDDED.
+ (TEXT_DYNAMIC): Likewise.
+ (INITIAL_READONLY_SECTIONS): Zero vma if not relocating.
+ (OTHER_SDATA_SECTIONS): Likewise.
+ * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Likewise.
+ * emulparams/shlelf_linux.sh (OTHER_READWRITE_SECTIONS): Likewise.
+ * emulparams/elf64alpha.sh (OTHER_READONLY_SECTIONS): Likewise.
+ * emulparams/hppalinux.sh (OTHER_READONLY_SECTIONS): Likewise.
+ * emulparams/elf64_aix.sh (OTHER_GOT_SECTIONS): Likewise.
+ (OTHER_PLT_RELOC_SECTIONS): Likewise.
+ (OTHER_READONLY_SECTIONS): Likewise. Order normal and linkonce
+ sections as seen in input files.
+ * emulparams/elf64_ia64.sh: As for emulparams/elf64_aix.sh.
+ * emulparams/hppa64linux.sh (OTHER_READONLY_SECTIONS): Zero vma
+ if not relocating.
+ (OTHER_READWRITE_SECTIONS, OTHER_BSS_SECTIONS): Likewise.
+ (OTHER_BSS_END_SYMBOLS): Merge from elf64hppa.sh.
+ * emulparams/elf64mmix.sh (OTHER_RELOCATING_SECTIONS): Delete.
+ (OTHER_SECTIONS): Instead, use this..
+ (OTHER_END_SYMBOLS): ..and this.
+
+ * emulparams/elf32b4300.sh: Source elf32bmip.sh, remove duplicates.
+ * emulparams/elf32bsmip.sh: Likewise.
+ * emulparams/elf32btsmip.sh: Likewise.
+ * emulparams/elf32ebmip.sh: Likewise.
+ * emulparams/elf32lmip.sh: Likewise.
+ * emulparams/elf32elmip.sh: Source elf32lmip.sh, remove duplicates.
+ * emulparams/elf32lsmip.sh: Likewise.
+ * emulparams/elf32ltsmip.sh: Source elf32btsmip.sh, remove duplicates.
+ * emulparams/elf32l4300.sh: Source elf32b4300.sh, remove duplicates.
+ * emulparams/elf64bmip.sh: Source elf32bmipn32.sh, remove duplicates.
+ * emulparams/elf64btsmip.sh: Likewise.
+ * emulparams/elf64ltsmip.sh: Source elf64btsmip.sh, remove duplicates.
+ * emulparams/elf32lppc.sh: Source elf32ppc.sh, remove duplicates.
+ * emulparams/elf32ppclinux.sh: Likewise.
+ * emulparams/elf32ppcsim.sh: Likewise.
+ * emulparams/elf32lppcsim.sh: Source elf32lppc.sh, remove duplicates.
+ * emulparams/elf64hppa.sh: Source hppa64linux.sh, remove duplicates.
+ * emulparams/h8300helf.sh: Source h8300elf.sh, remove duplicates.
+ * emulparams/h8300self.sh: Likewise.
+ * emulparams/mn10300.sh: Source mn10200.sh, remove duplicates.
+ * emulparams/sh.sh: Comment.
+ * emulparams/shl.sh: Source sh.sh, remove duplicates.
+ * emulparams/shlelf.sh: Source shelf.sh, remove duplicates.
+ * emulparams/shelf_linux.sh: Source shlelf_linux.sh, remove duplicates.
+
+2001-11-21 David Heine <dlheine@tensilica.com>
+ Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (map_input_to_output_sections): Replace "break"
+ accidentally removed with 2001-08-03 change.
+ (lang_gc_sections_1): Likewise.
+
+2001-11-21 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (walk_wild_section): Move sec == NULL case out of loop.
+
+2001-11-20 Angela Marie Thomas <angela@redhat.com>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Use NULL instead
+ of false when calling lang_size_sections.
+ * emultempl/hppaelf.em (hppaelf_layout_sections_again): Likewise.
+
+2001-11-15 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Only emit this
+ function when LDEMUL_FINISH isn't set to the same name. Don't
+ call ${LDEMUL_FINISH}.
+ (ld_${EMULATION_NAME}_emulation): Call $LDEMUL_FINISH if defined.
+ * emultempl/armelf.em (arm_elf_finish): Call
+ gld${EMULATION_NAME}_finish.
+ * emultempl/hppaelf.em (hppaelf_finish): Rename to
+ gld${EMULATION_NAME}_finish. Call bfd_elf32_discard_info and
+ hppaelf_layout_sections_again if necessary.
+ (need_laying_out): New var.
+ (hppaelf_layaout_sections_again): Rename to
+ hppaelf_layout_sections_again. Clear need_laying_out.
+ (PARSE_AND_LIST_OPTIONS): Format text.
+
+2001-11-14 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/armelf.em (arm_elf_finish): Renamed from
+ gld${EMULATION_NAME}_finish.
+ (LDEMUL_FINISH): Set to arm_elf_finish.
+
+2001-11-14 Daniel Jacobowitz <drow@mvista.com>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_finish): New.
+ (struct ld_emulation_xfer_struct): Use it.
+
+2001-11-13 Ross Alexander <ross.alexander@uk.neceur.com>
+
+ * emulparams/elf64hppa.sh (OTHER_BSS_END_SYMBOLS): Add
+ additional symbols referenced by newer crt0.o files from HP.
+
+2001-11-12 Anthony Green <green@redhat.com>
+
+ * emulparams/armelf.sh (DATA_START_SYMBOLS): New symbol.
+
+2001-11-12 Alfred M. Szmidt <ams@kemisten.nu>
+
+ * Makefile.am (GENSCRIPTS): Quote ${exec_prefix}.
+ * Makefile.in: Regenerate.
+
+2001-11-02 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * ld.texinfo: Use @command for commands, @option for options.
+ * Makefile.am (POD2MAN): Use 'GNU Development Tools' for
+ the page man title.
+ * Makefile.in: Rebuild.
+
+2001-11-04 Chris Demetriou <cgd@broadcom.com>
+
+ * configure.tgt (mips*el-*-netbsd*, mips*-*-netbsd*):
+ Add support for targets.
+
+2001-11-02 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * configure.in (ALL_LINGUAS): Add "fr" and "sv"
+ * configure: Regernate.
+ * po/fr.po: New file.
+ * po/sv.po: New file.
+
+2001-11-01 NIIBE Yutaka <gniibe@m17n.org>
+
+ * configure.tgt (sh-*-linux): Set targ_emul, targ_extra_emuls
+ as little endian default and to support big endian.
+
+2001-11-01 Chris Demetriou <cgd@broadcom.com>
+
+ * ld.texinfo (Options): Document new option, -nostdlib.
+ * lexsup.c (OPTION_NOSTDLIB): New definition.
+ (ld_options): Add entry for "nostdlib".
+ (parse_args): Handle OPTIONS_NOSTDLIB.
+ * ldfile.c (ldfile_add_library_path): Don't add directories
+ to the search path if they weren't specified on the command line
+ and -nostdlib was specified.
+ * ld.h (ld_config_type): New member only_cmd_line_lib_dirs.
+
+2001-10-31 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * lexsup.c (parse_args): Prevent infinite parsing loop when
+ "-rpath.a" is specified on the command line.
+ Replace calls to fprintf with calls to einfo.
+
+2001-10-31 John Marshall <jmarshall@acm.org>
+
+ * ld.texinfo: A historical requirement that MEMORY and SECTIONS
+ appear only once across all the linker scripts involved in a link
+ invocation no longer applies. Make the documentation reflect
+ that.
+
+2001-10-31 NIIBE Yutaka <gniibe@m17n.org>
+
+ * configure.tgt: Supports sh3/sh4/sh3eb/sh4eb-unknown-linux-gnu
+ targets.
+ (sh-*-linux*): Added targ_extra_libpath.
+
+2001-10-31 David Heine <dlheine@tensilica.com>
+
+ * ldlang.c (lang_size_sections): Keep a valid output_offset field
+ for padding statements.
+
+2001-10-30 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * configure.tgt (mmix-*-*): New target.
+ * Makefile.am (ALL_EMULATIONS): Add eelf64mmix.o and emmo.o.
+ Add dependencies to match.
+ * emulparams/mmo.sh, emulparams/elf64mmix.sh, emultempl/mmo.em,
+ emultempl/mmix-elfnmmo.em, emultempl/mmixelf.em,
+ scripttempl/mmo.sc: New files.
+ * gen-doc.texi: @set MMIX.
+ * ld.texinfo: Ditto.
+ [MMIX] Add MMIX node.
+ * Makefile.in: Regenerate.
+
+2001-10-29 Kazu Hirata <kazu@hxi.com>
+
+ * ldlang.c: Fix a comment typo.
+
+2001-10-23 Alan Modra <amodra@bigpond.net.au>
+
+ * configure.host: Move alpha*-*-linux-gnu* entry to generic
+ entries, and match *-*-linux*.
+
+2001-10-20 Alan Modra <amodra@bigpond.net.au>
+
+ * ldgram.y (mri_script_command): Surround processing of INCLUDE
+ with ldlex_script, ldlex_popstate.
+ (ifile_p1): Likewise.
+ * ldlex.l (EOF): Don't BEGIN(SCRIPT). Restore lineno from the
+ correct slot.
+ (lex_push_file): Save current lineno to lineno_stack. Set lineno
+ to 1. Don't BEGIN(SCRIPT).
+ (lex_redirect): Similarly.
+ * ldmain.c (main): Set yydebug non-zero if YYDEBUG.
+
+2001-10-20 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * scripttempl/armcoff.sc: Define __EH_FRAME_BEGIN__ and
+ __EH_FRAME_END__ and accept eh frames into data section.
+ Add ctor and dtor sections.
+
+2001-10-19 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
+
+ * pe-dll.c (autofilter_objectlist): Add gcrt0.o.
+ (auto-export): Fix indentation.
+
+2001-10-18 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
+
+ * pe-dll.c (autofilter_objectlist): Add startup objects
+ for profiling.
+ (auto-export): Constify char * p.
+ Extract file basename and use strcmp rather than ststr
+ for object lookup.
+
+2001-10-18 Chris Demetriou <cgd@broadcom.com>
+
+ * ldmain.c (get_emulation): Improve comment about the handling
+ of -mipsN options.
+
+2001-10-17 Alan Modra <amodra@bigpond.net.au>
+
+ * po/POTFILES.in: Regenerate.
+
+2001-10-16 Vassili Karpov <malc@pulsesoft.com>
+
+ * emultempl/elf32.em (gld*_list_options): Remove extra '\t' from
+ -z nocopyreloc and -z nocombreloc usage strings.
+
+2001-10-12 Vassili Karpov <malc@pulsesoft.com>
+
+ * emultempl/elf32.em (gld*_list_options): Include -z nocopyreloc
+ in usage.
+
+2001-10-11 Aleksey Romanov <aromanov@ennovatenetworks.com>
+
+ * scripttempl/armaout.sc: Place .bss section after end of aligned
+ data section to match behaviour of aout code in constructrion of
+ header.
+
+2001-10-11 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
+
+ * pe-dll.c (autofilter_entry_type autofilter_liblist: Add
+ startup files for mingw32 dlls to list.
+
+2001-10-10 Chris Demetriou <cgd@broadcom.com>
+
+ * emultempl/elf32.em: Fix shell 'if' usage for portability.
+
+2001-10-08 Aldy Hernandez <aldyh@redhat.com>
+
+ * configure.tgt (targ): Add arm9e-*-elf.
+
+2001-10-05 H.J. Lu <hjl@gnu.org>
+
+ * genscripts.sh: Fix a typo in the last change.
+
+2001-10-05 Jakub Jelinek <jakub@redhat.com>
+
+ * emultempl/elf32.em (gld_*_list_options): Include -z combreloc and
+ -z nocombreloc in usage.
+
+2001-10-03 Jim Blandy <jimb@redhat.com>
+
+ * genscripts.sh: Include a comment at the top of each generated
+ script, explaining its purpose.
+
+2001-10-03 Vassili Karpov <malc@pulsesoft.com>
+
+ * emultempl/elf32.em (parse_args): Handle -z nocopyreloc.
+ * NEWS: Mention -z nocopyreloc.
+ * ld.texinfo (Options): Describe nocopyreloc.
+
+2001-10-03 Alan Modra <amodra@bigpond.net.au>
+
+ * configure: Regenerate.
+
+2001-10-02 Alan Modra <amodra@bigpond.net.au>
+
+ * ldver.h (ld_program_version): Remove declaration.
+ * lexsup.c (parse_args): Move printing of copyright message..
+ * ldver.c (ldversion): .. to here.
+ Use BFD_VERSION_STRING in place of BFD_VERSION.
+ (ld_program_version): Remove.
+ * Makefile.am (Makefile): Depend on bfd/configure.in.
+ Run "make dep-am".
+ * Makefile.in: Regenerate.
+
+2001-09-30 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * Makefile.am: Update dependencies with "make dep-am".
+ * Makefile.in: Regenerate.
+
+2001-09-29 John Reiser <jreiser@BitWagon.com>
+
+ * ldlang.c (lang_common): Conditionally inhibit Common allocation.
+ * lexsup.c: Add --no-define-common commandline option.
+ * ldgram.y: Add INHIBIT_COMMON_ALLOCATION script command.
+ * ldlex.l: Likewise.
+ * ld.h: Add command_line.inhibit_common_definition.
+ * ldmain.c (main): Initialize.
+ * ld.texinfo: Document.
+
+2001-09-29 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (section_already_linked): Remove assignment to kept_section.
+
+2001-09-26 Alan Modra <amodra@bigpond.net.au>
+
+ * ldmisc.c (USE_STDARG): Remove.
+ (info_msg): Define using VPARAMS, VA_OPEN, VA_FIXEDARG, VA_CLOSE.
+ (einfo): Likewise.
+ (minfo): Likewise.
+ (lfinfo): Likewise.
+
+ * ldmisc.h: Remove #ifdef ANSI_PROTOTYPES and non-ansi
+ declarations. Update copyright.
+
+2001-09-24 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * pe-dll.c: Remove obsoleted declaration of
+ pe_get_data_import_dll_name.
+ (pe_create_import_fixup): Fix thinko.
+
+ * ld.texinfo(enable-auto-import): Clarify the explanation.
+
+2001-09-24 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * pe-dll.c (pe_create_import_fixup): Revert previous patch.
+ * emultemp/pe.em (pe_data_import_dll): Move definition outside of
+ DLL_SUPPORT controlled code.
+
+2001-09-24 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * emultempl/pe.em(pe_data_import_dll): Make static.
+ (pe_get_data_import_dll_name): New accessor function.
+ * pe-dll.c(pe_create_import_fixup): call
+ pe_get_data_import_dll_name() from pe.em, instead of
+ directly accessing pe_data_import_dll variable from pe.em.
+
+2001-09-18 Bruno Haible <haible@clisp.cons.org>
+
+ * deffilep.y: Include "safe-ctype.h" instead of <ctype.h>.
+ (def_file_add_directive): Use ISSPACE instead of isspace.
+ (def_lex): Use ISDIGIT/ISXDIGIT/ISALPHA/ISALNUM instead of
+ isdigit/isxdigit/isalpha/isalnum.
+ * emultempl/aix.em: Include "safe-ctype.h" instead of <ctype.h>.
+ (gld${EMULATION_NAME}_read_file): Use ISSPACE instead of isspace.
+ * emultempl/elf32.em: Include "safe-ctype.h" instead of <ctype.h>.
+ (gld${EMULATION_NAME}_place_orphan): Use ISALNUM instead of
+ isalnum.
+ * emultempl/gld960c.em: Include "safe-ctype.h" instead of <ctype.h>.
+ (gld960_set_output_arch): Use ISUPPER/TOLOWER instead of
+ isupper/tolower.
+ * emultempl/sunos.em: Include "safe-ctype.h" instead of <ctype.h>.
+ (gld${EMULATION_NAME}_search_dir): Use ISDIGIT instead of isdigit.
+ * ldctor.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (ctor_prio): Use ISDIGIT instead of isdigit.
+ * ldfile.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (ldfile_open_file_search): Use ISALPHA instead of isalpha.
+ (ldfile_add_arch): Use ISUPPER/TOLOWER instead of
+ isupper/tolower.
+ * ldlang.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (stricpy): Use TOLOWER instead of isupper/tolower.
+ (lang_leave_overlay_section): Use ISALNUM instead of isalnum.
+ * ldlex.l: Include "safe-ctype.h" instead of <ctype.h>.
+ (lex_warn_invalid): Use ISPRINT instead of isprint.
+ * ldmain.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (main): For gettext, also set the LC_CTYPE locate facet.
+ (add_keepsyms_file): Use ISSPACE instead of isspace.
+ * lexsup.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (is_num, parse_args): Use ISDIGIT instead of isdigit.
+ * mpw-elfmips.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (gldelf32ebmip_place_orphan): Use ISALNUM instead of isalnum.
+ * mpw-eppcmac.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (gldppcmacos_read_file): Use ISSPACE instead of isspace.
+ * pe-dll.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (quoteput): Use ISSPACE instead of isspace.
+ (pe_dll_generate_implib, pe_process_import_defs): Use ISALNUM
+ instead of isalnum.
+
+2001-09-18 Alan Modra <amodra@bigpond.net.au>
+
+ * deffilep.y (def_stash_module): Constify "name" param.
+
+ * pe-dll.c: Replace CONST with const throughout.
+ (quick_symbol): Constify "n1", "n2", "n3" params.
+ (make_singleton_name_thunk): Constify "import" param. Make
+ "buffer_len" a size_t.
+ (make_import_fixup_entry): Constify "name", "fixup_name",
+ "dll_symname" params.
+ (pe_get16): Cast args of bfd_seek. Replace bfd_read with bfd_bread.
+ (pe_get32): Likewise.
+ (pe_implied_import_dll): Likewise.
+
+ * emultempl/beos.em (sort_by_file_name): Constify "ra", "rb".
+ (sort_by_section_name): Likewise.
+
+ * emultempl/pe.em: Move defines for arm_epoc_pe before bfd.h included.
+ (make_import_fixup): Cast printf arg, rel->address to long rather
+ than int.
+ (gld_${EMULATION_NAME}_after_open): Don't compare NULL against int.
+
+2001-09-15 Alan Modra <amodra@bigpond.net.au>
+
+ * ldmain.c (main): Rename BufferSize to ld_bufsz because HPUX
+ defines BufferSize. Increase buffer size by one.
+
+2001-09-14 Ralf Habacker <Ralf.Habacker@freenet.de>
+
+ * pe-dll.c (pe_walk_relocs_of_symbol): Fix memory leak.
+
+2001-09-14 Kevin Lo <kevlo@openbsd.org>
+
+ * configure.tgt: Add arm-openbsd target.
+
+2001-09-12 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.am (ALL_EMULATIONS): Move eelf64ppc.o and
+ eelf64lppc.o to ...
+ (ALL_64_EMULATIONS): Here.
+ * Makefile.in: Regenerated.
+
+2001-09-12 Paul Sokolovsky <Paul.Sokolovsky@technologist.com>
+
+ * emultempl/pe.em(make_import_fixup): change signature to
+ take asection as well as arelec; we need this for proper
+ error reporting. Only call pe_create_import_fixup() if
+ there is no attempt to add a constant addend to the reloc;
+ otherwise, report error condition.
+ * pe-dll.c(pe_walk_relocs_of_symbol): change signature,
+ since final argument is a pointer to make_import_fixup().
+ Change call to cb() to match make_import_fixup() signature.
+ (make_import_fixup_mark): make buffer_len unsigned.
+ * pe-dll.h: change signature of pe_walk_relocs_of_symbol.
+
+2001-09-12 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * ld.texinfo: add verbose documentation for auto-import
+ direct-addressing workaround, to compliment the terse
+ error message.
+
+2001-09-12 Andrew MacLeod <amacleod@redhat.com>
+
+ * scripttempl/v850.sc: Add gcc_except_table sections.
+
+2001-09-11 Jeffrey A Law (law@cygnus.com)
+
+ * emulparams/h8300helf.sh: Move stack to a much higher memory address.
+ * emulparams/h8300self.sh: Similarly.
+
+2001-09-05 Danny Smith <dannysmith@users.souceforge.net>
+
+ * ld.texinfo (Options, --stack): Correct default value for stack
+ reserve.
+
+2001-09-05 Tom Rix <trix@redhat.com>
+
+ * emultempl/aix.em : Handle import file XMC_XO and syscall symbols.
+
+2001-09-03 Andreas Jaeger <aj@suse.de>
+
+ * emultempl/beos.em: Declare prototypes for comparions functions,
+ adjust definitions.
+
+2001-09-02 Andreas Jaeger <aj@suse.de>
+
+ * emultempl/aix.em: Add missing prototype.
+ * emultempl/lnk960.em: Likewise.
+ * emultempl/vanilla.em: Likewise.
+ * emultempl/armcoff.em: Likewise.
+ * emultempl/armelf_oabi.em: Likewise.
+ * emultempl/beos.em: Likewise.
+ * emultempl/gld960c.em: Likewise.
+ * emultempl/gld960.em: Likewise.
+
+ * emulparams/elf64alpha.sh (PARSE_AND_LIST_PROLOGUE): Add parameter
+ for prototype declaration.
+
+2001-08-31 Eric Christopher <echristo@redhat.com>
+ Jason Eckhardt <jle@redhat.com>
+
+ * ldmain.c (get_emulation): Add support for -mips32 and -mips64.
+
+2001-08-31 Andreas Jaeger <aj@suse.de>
+
+ * emultempl/pe.em: Add missing prototypes.
+ (gld_${EMULATION_NAME}_after_open): Remove extra args to
+ pe_find_data_imports.
+ (pr_sym): Add unused attribute.
+
+2001-08-29 Joel Sherrill <joel@OARcorp.com>
+
+ * configure.tgt (i[3456]86-*-rtems*, m68*-*-rtems*): Change
+ default from coff to elf.
+
+2001-08-29 Jeff Law <law@redhat.com>
+
+ * emulparams/h8300helf.sh: Resync with h8300elf.sh. Update
+ ARCH specification.
+ * emulparams/h8300self.sh: Similarly.
+
+2001-08-28 J"orn Rennecke <amylaar@redhat.com>
+
+ * Makefile.am (ALL_EMULATIONS): Add eh8300elf.o, eh8300elf.o and
+ eh8300self.o .
+ (eh8300elf.c, eh8300helf.c, eh8300self.c): New targets.
+ * configure.tgt (h8300-*-elf*): New case.
+ * emulparams/h8300elf.sh, emulparams/h8300helf.sh: New files.
+ * emulparams/h8300self.sh: New file.
+ * Makefile.in: Regenerated.
+
+2001-08-28 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * ldmain.c (main): Rename BSIZE to BufferSize to avoid collision
+ with macro name.
+
+2001-08-27 Linus Nordberg <linus@swox.com>
+ Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.am (ALL_EMULATIONS): Add eelf64ppc.o and eelf64lppc.o.
+ (eelf64ppc.c, eelf64lppc.c): Add make targets.
+ Run "make dep-am"
+ * Makefile.in: Regenerate.
+ * configure.tgt: Add powerpc64 support. Move pdp11, pjl, pj
+ entries to correct alphabetical position.
+ * emulparams/elf64ppc.sh: New.
+ * emulparams/elf64lppc.sh: New.
+
+2001-08-27 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * ldmain.c (main): Declare BSIZE as static.
+
+2001-08-23 Jakub Jelinek <jakub@redhat.com>
+
+ * emultempl/elf32.em (place_orphan): Place orphan .rel* sections
+ into .rel.dyn resp. .rela.dyn if combreloc.
+ (get_script): If .x linker script is equal to .xn, only put it
+ once into the binary.
+ Add .xc and .xsc scripts.
+ (parse_args): Handle -z combreloc and -z nocombreloc.
+ * scripttempl/elf.sc (.rela.sbss): Fix a typo.
+ For .xc and .xsc scripts put all .rel* or .rela* input sections
+ but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn.
+ * genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME
+ is elf.
+ Strip trailing whitespace from script.
+ Generate .xc and .xsc scripts if requested.
+ * ldmain.c (main): Initialize link_info.combreloc and
+ link_info.spare_dynamic_tags.
+ * lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define.
+ (ld_options): Add --spare-dynamic-tags option.
+ (parse_args): Likewise.
+ * ld.texinfo: Document -z combreloc and -z nocombreloc.
+ * ldint.texinfo: Document .xc and .xsc linker scripts.
+ * NEWS: Add notes about -z combreloc and SHF_MERGE.
+
+2001-08-22 H.J. Lu <hjl@gnu.org>
+
+ * emulparams/elf32fr30.sh: Add a newline.
+
+2001-08-21 Andreas Jaeger <aj@suse.de>
+
+ * deffilep.y: Add missing prototypes.
+ * pe-dll.c: Likewise.
+
+2001-08-20 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (insert_pad): Fix typos in last patch.
+
+ * ldlang.c: When traversing lang_statement_union_type lists,
+ consistently use "header.next" rather than "next".
+ * mpw-eppcmac.c: Likewise.
+ * emultempl/beos.em: Likewise.
+ * emultempl/hppaelf.em: Likewise.
+ * emultempl/pe.em: Likewise.
+ * ldlang.h (union lang_statement_union): Remove "next" field.
+
+ * ldlang.c (insert_pad): Use offsetof macro.
+ (lang_size_sections): Always neuter padding statements.
+ * emultempl/hppaelf.em (hppaelf_delete_padding_statements): Delete.
+
+ * pe-dll.c (pe_dll_fill_sections): Correct type of "relax" param
+ passed to lang_size_sections.
+ (pe_exe_fill_sections): Likewise.
+ * emultempl/pe.em (output_prev_sec_find): Copied from elf32.em.
+ (gld_${EMULATION_NAME}_place_orphan): Merge from elf32.em.
+
+2001-08-18 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/aix.em: Formatting fixes.
+
+2001-08-18 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (insert_pad): Make use of an existing pad statement if
+ available. Move code calculating alignment, adjusting section
+ alignment power, and adjusting dot to ..
+ (size_input_section): .. here. Remove unused relax param.
+ (lang_size_sections): Change boolean `relax' param to boolean *.
+ Adjust call to size_input_section. Make use of insert_pad to
+ place pad after the assignment statement. If relaxing, zap
+ padding statements.
+ (reset_memory_regions): Reset output_bfd section sizes too.
+ (relax_again): Move to..
+ (lang_process): ..here. Adjust call to lang_size_sections, and
+ remove duplicated code.
+ * ldlang.h (lang_size_sections): Change `relax' param to boolean *.
+
+2001-08-17 Alan Modra <amodra@bigpond.net.au>
+
+ * ld.texinfo: Document that fill values now use the four least
+ significant bytes.
+ * emulparams/elf32fr30.sh (NOP): Update.
+ * emulparams/elf32mcore.sh: Likewise.
+ * emulparams/elf64_s390.sh: Likewise.
+ * emulparams/elf_i386.sh: Likewise.
+ * emulparams/elf_i386_be.sh: Likewise.
+ * emulparams/elf_i386_chaos.sh: Likewise.
+ * emulparams/elf_i386_ldso.sh: Likewise.
+ * emulparams/elf_s390.sh: Likewise.
+ * emulparams/elf_x86_64.sh: Likewise.
+ * emulparams/i386moss.sh: Likewise.
+ * emulparams/i386nw.sh: Likewise.
+ * emulparams/m68kelf.sh: Likewise.
+ * scripttempl/elf.sc: Update NOP comment.
+ * scripttempl/elfi370.sc: Likewise.
+ * scripttempl/elfm68hc11.sc: Likewise.
+ * scripttempl/elfm68hc12.sc: Likewise.
+ * scripttempl/nw.sc: Likewise.
+
+2001-08-15 Tom Rix <trix@redhat.com>
+
+ * ldgram.y (saved_script_handle): Initialize to NULL.
+ * ldmain.c (main): Change check on saved_script_handle.
+
+2001-08-14 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em: Formatting fixes.
+ (output_prev_sec_find): Test for bfd_ind_section too; do so by
+ looking at sec->owner.
+ (output_rel_find): Move function inside LDEMUL_PLACE_ORPHAN test.
+ (gld${EMULATION_NAME}_place_orphan): Add a few comments. Remove
+ unused code, and reorganize orphan section placement code.
+
+ * ldlang.c (wild_doit): Rename to lang_add_section.
+ * ldlang.h: Here too.
+ * mpw-elfmips.c: And here.
+ * emultempl/beos.em: And here.
+ * emultempl/elf32.em: And here.
+ * emultempl/hppaelf.em: And here.
+ * emultempl/pe.em: And here.
+
+2001-08-13 Richard Henderson <rth@redhat.com>
+
+ * emultempl/needrelax.em: New file.
+ * emulparams/elf64_ia64.sh (EXTRA_EM_FILE): Reference it.
+ * Makefile.am (eelf64_ia64.c): Depend on it.
+ * Makefile.in: Rebuild.
+
+2001-08-13 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em: For SEC_EXCLUDE sections, ensure that
+ output_section is set non-NULL.
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Return
+ `true' for SEC_EXCLUDE sections so that the generic code doesn't
+ needlessly create an output_section_statement. Treat a correctly
+ named output_section_statement with NULL bfd_section as compatible.
+
+2001-08-13 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * emultempl/generic.em: Support EXTRA_EM_FILE.
+ (ld_${EMULATION_NAME}_emulation): Support emulation parameters
+ LDEMUL_BEFORE_PARSE, LDEMUL_SYSLIB, LDEMUL_HLL,
+ LDEMUL_AFTER_PARSE, LDEMUL_AFTER_OPEN, LDEMUL_AFTER_ALLOCATION,
+ LDEMUL_SET_OUTPUT_ARCH, LDEMUL_CHOOSE_TARGET,
+ LDEMUL_BEFORE_ALLOCATION, LDEMUL_GET_SCRIPT, LDEMUL_FINISH,
+ LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS,
+ LDEMUL_OPEN_DYNAMIC_ARCHIVE, LDEMUL_PLACE_ORPHAN,
+ LDEMUL_SET_SYMBOLS, LDEMUL_PARSE_ARGS, LDEMUL_UNRECOGNIZED_FILE,
+ LDEMUL_LIST_OPTIONS, LDEMUL_RECOGNIZED_FILE,
+ LDEMUL_FIND_POTENTIAL_LIBRARIES.
+
+2001-08-12 Richard Henderson <rth@redhat.com>
+
+ * scripttempl/elf.sc, scripttempl/elfd30v.sc,
+ scripttempl/elfm68hc11.sc, scripttempl/elfm68hc12.sc,
+ scripttempl/v850.sc: Keep .jcr data.
+
+2001-08-12 H.J. Lu <hjl@gnu.org>
+ Andrew Haley <aph@cambridge.redhat.com>
+ Nick Clifton <nickc@redhat.com>
+
+ * ldgram.y (had_script): Change name to saved_script_handle.
+ Change type to file handle.
+ * ld.h (had_script): Rename and retype.
+ * ldfile.c (ldfile_open_command_file): Save the file handle
+ used in saved_script_handle.
+ * lexsup.c (parse_args): Do not allow -c option to alter
+ saved_script_handle.
+ * ldmain.c (main): Print out the linker script used if
+ --verbose is given. Check saved_script_handle to obtain the
+ external linker script used, or if NULL, dump the builtin
+ script.
+ * ld.texinfo: Document that --verbose now dumps the linker
+ script used, regardless of whether it was an internal or an
+ external script.
+
+2001-08-10 Andreas Jaeger <aj@suse.de>
+
+ * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes
+ to build warnings.
+ * configure: Regenerate.
+
+2001-08-09 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em (output_prev_sec_find): Add missing prototype.
+
+ * scripttempl/elf.sc: Move non-text .dynamic section before
+ .plt/.got/.sdata* group.
+ (OTHER_GOT_SECTIONS): Move to immediately after .got.
+ (OTHER_SDATA_SECTIONS): Add.
+ * emulparams/criself.sh: Use OTHER_SDATA_SECTIONS rather than
+ OTHER_GOT_SECTIONS.
+ * emulparams/crislinux.sh: Likewise.
+ * emulparams/elf32b4300.sh: Likewise.
+ * emulparams/elf32bmip.sh: Likewise.
+ * emulparams/elf32bmipn32.sh: Likewise.
+ * emulparams/elf32bsmip.sh: Likewise.
+ * emulparams/elf32btsmip.sh: Likewise.
+ * emulparams/elf32ebmip.sh: Likewise.
+ * emulparams/elf32elmip.sh: Likewise.
+ * emulparams/elf32l4300.sh: Likewise.
+ * emulparams/elf32lmip.sh: Likewise.
+ * emulparams/elf32lsmip.sh: Likewise.
+ * emulparams/elf32ltsmip.sh: Likewise.
+ * emulparams/elf64bmip.sh: Likewise.
+ * emulparams/elf64btsmip.sh: Likewise.
+ * emulparams/elf64ltsmip.sh: Likewise.
+
+2001-08-08 Alan Modra <amodra@bigpond.net.au>
+
+ * genscripts.sh: Source the emulparams script before each output
+ script is generated so that variables like `RELOCATING' may affect
+ variables defined in the emulparams script.
+
+2001-08-04 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/aix.em: ldexp.h,ldlang.h,ldfile.h,ldemul.h go in this
+ order.
+
+ * emultempl/beos.em (sort_sections): Modify for 2001-08-03 change,
+ ie. iterate over wild_statement.section_list.
+ (gld${EMULATION_NAME}_place_orphan): Likewise.
+
+2001-08-03 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * scripttempl/elfm68hc12.sc (FINISH_CODE, FINISH_RELOC): New to handle
+ .fini[0-4] sections used by _exit
+ (CTOR, DTOR): Export ctor/dtor symbols; move them to ROM.
+ (*.text,*.data,*.bss): Take into account .text.*, .data.*, .bss.*.
+ * scripttempl/elfm68hc11.sc: Likewise.
+
+2001-08-03 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/beos.em (init): Add the missing initialization.
+
+2001-08-03 Alan Modra <amodra@bigpond.net.au>
+
+ * ld.texinfo (Input Section Basics): Clarify ordering of output
+ sections.
+ * ldlang.c (callback_t): Add wildcard_list param.
+ (walk_wild_section): Remove "section" param. Rewrite for
+ lang_wild_statement_type change. Remove unique_section_p test.
+ (walk_wild_file): Remove "section" param.
+ (walk_wild): Remove "section" and "file" params.
+ (lang_gc_wild): Likewise.
+ (wild): Likewise. Modify for lang_wild_statement_type change.
+ (wild_sort): Likewise. Add "sec" param.
+ (gc_section_callback): Likewise.
+ (output_section_callback): Likewise. Do unique_section_p test.
+ (map_input_to_output_sections): Modify call to wild.
+ (lang_gc_sections_1): Likewise.
+ (print_wild_statement): Modify for lang_wild_statement_type
+ change.
+ (lang_add_wild): Replace filename, filenames_sorted param with
+ filespec. Replace section_name, sections_sorted,
+ exclude_filename_list with section_list.
+ * ldlang.h (lang_add_wild): Here too.
+ (lang_wild_statement_type): Replace section_name, sections_sorted,
+ and exclude_filename_list with section_list.
+ * ldgram.y (current_file): Delete.
+ (%union): Add wildcard_list.
+ (file_NAME_list): Set type to wildcard_list. Build a linked list
+ rather than calling lang_add_wild for each entry.
+ (input_section_spec_no_keep): Call lang_add_wild here instead.
+ * ld.h (struct wildcard_list): Declare.
+ * mri.c (mri_draw_tree): Modify to suit new lang_add_wild.
+
+2001-08-02 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * ldmain.c (main): initialize link_info.pei386_auto_import
+ * pe-dll.c: new tables for auto-export filtering
+ (auto_export): change API, pass abfd for contextual filtering.
+ Loop thru tables of excluded symbols instead of comparing
+ "by hand".
+
+2001-08-02 Paul Sokolovsky <paul.sokolovsky@technologist.com>
+
+ * pe-dll.c: new variable pe_dll_enable_extra_debug. New
+ static variable current_sec (static struct sec *). Add
+ forward declaration for add_bfd_to_link.
+ (process_def_file): Don't export undefined symbols. Do not
+ export symbols starting with "_imp__". Call auto_export()
+ with new API.
+ (pe_walk_relocs_of_symbol): New function.
+ (generate_reloc): add optional extra debugging
+ (pe_dll_generate_def_file): eliminate extraneous initial blank
+ line in output
+ (make_one): enlarge symtab to make room for __nm__ symbols
+ (DATA auto-import support).
+ (make_singleton_name_thunk): New function.
+ (make_import_fixup_mark): New function.
+ (make_import_fixup_entry): New function.
+ (pe_create_import_fixup): New function.
+ (add_bfd_to_link): Specify that 'name' argument is a CONST
+ char *.
+ * pe-dll.h: declare new variable pe_dll_extra_pe_debug;
+ declare new functions pe_walk_relocs_of_symbol and
+ pe_create_import_fixup.
+ * emultempl/pe.em: add new options --enable-auto-import,
+ --disable-auto-import, and --enable-extra-pe-debug.
+ (make_import_fixup): New function.
+ (pe_find_data_imports): New function.
+ (pr_sym): New function.
+ (gld_${EMULATION_NAME}_after_open): Add optional extra pe
+ debugging. Call pe_find_data_imports. Mark .idata as DATA, not
+ CODE.
+
+2001-08-02 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * ld.texinfo: add additional documentation for
+ --export-all-symbols. Document --out-implib,
+ --enable-auto-image-base, --disable-auto-image-base,
+ --dll-search-prefix, --enable-auto-import, and
+ --disable-auto-import.
+ * ldint.texinfo: Add detailed documentation on auto-import
+ implementation.
+
+2001-07-30 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * ld.texinfo (Simple Assignments): Fix computation in SECTIONS
+ example.
+
+2001-07-24 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.am: Update dependencies with "make dep-am".
+ * Makefile.in: Regenerate
+
+2001-07-23 Alan Modra <amodra@bigpond.net.au>
+
+ * ldcref.c (check_section_sym_xref): New function.
+ (check_nocrossrefs): Call it.
+ (check_nocrossref): Interate over h->refs here instead of..
+ (check_refs): ..here. Pass in the symbol name, section, and bfd
+ rather than hash_entry pointers.
+ (struct check_refs_info): Keep symbol name rather than hash entry.
+ Remove "same".
+ (check_reloc_refs): Tweak for above changes in check_refs_info.
+ Only report references to section syms when symname is NULL to
+ prevent duplicate messages for the same reloc.
+
+2001-07-19 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * ldexp.c (exp_print_tree): Use stderr if config.map_file is not
+ available. Do not print NULL trees.
+ (exp_print_token): Print unknown tokens with values > 126 as
+ decimal values not ASCII characters.
+
+ * ldlang.c (lang_leave_overlay): If a region is specified assign
+ it to all sections inside the overlay unless they have been
+ assigned to the own, non-default, memory region.
+
+ * README: Add header for consistency with other README files.
+
+2001-07-14 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/elf32.em (output_prev_sec_find): Never return
+ bfd_abs_section_ptr, bfd_com_section_ptr nor
+ bfd_und_section_ptr.
+
+2001-07-14 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * Makefile.am (em32relf.c): Change dependency from generic.em to
+ elf32.em.
+ * Makefile.in: Regenerate.
+
+2001-07-14 matthew green <mrg@eterna.com.au>
+
+ * configure.tgt (i386-*-netbsdelf*): New target.
+ (i386-*-netbsd*): Set targ_extra_emuls to `elf_i386'
+
+2001-07-13 Jakub Jelinek <jakub@redhat.com>
+
+ * emultempl/elf32.em (output_prev_sec_find): New.
+ (place_orphan): Use it.
+
+2001-07-11 H.J. Lu <hjl@gnu.org>
+
+ * ldmain.c (main): Fix typos in the last change.
+
+2001-07-11 Jakub Jelinek <jakub@redhat.com>
+
+ * ldmain.c (main): Disallow -F and -f without -shared.
+
+2001-07-11 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * emultempl/pe.em (after_open): Check for the output_bfd not
+ having any coff_data structure allocated to it.
+
+2001-07-09 David O'Brien <obrien@FreeBSD.org>
+
+ * emultempl/elf32.em: Do not assuming that contents of the buffer
+ returned from basename function will remain unchanged accross other
+ function calls.
+
+2001-07-03 H.J. Lu <hjl@gnu.org>
+
+ * scripttempl/elf.sc (DYNAMIC_PAD): Revert the change made on
+ 2001-07-03. It creates dynamic entries even for static binaries.
+
+2001-07-03 Jakub Jelinek <jakub@redhat.com>
+
+ * scripttempl/elf.sc (DYNAMIC_PAD): New variable.
+ (DYNAMIC): Use it to reserve few dynamic entries for
+ post-linking tools.
+
+2001-06-27 Alan Modra <amodra@bigpond.net.au>
+
+ * emulparams/hppa64linux.sh: New file.
+ * configure.tgt: hppa*64*-*-linux* uses hppa64linux.sh
+ * Makefile.am (ALL_64_EMULATIONS): Add ehppa64linux.o
+ (ehppa64linux.c): Add rule to make it.
+ Run "make dep-am".
+ * Makefile.in: Regenerate.
+
+2001-06-21 Hans-Peter Nilsson <hp@axis.com>
+
+ * ld.texinfo (Options, -r): Mention restrictions when using
+ different object formats.
+
+2001-06-19 Hans-Peter Nilsson <hp@axis.com>
+
+ * ldlang.c (lang_check): Emit fatal error if relocatable link
+ between different object flavours with relocations in input.
+
+2001-06-19 H.J. Lu <hjl@gnu.org>
+
+ * ld.texinfo (-E, --export-dynamic): Mention --version-script.
+ (--version-script): Mention the language support.
+
+2001-06-19 H.J. Lu <hjl@gnu.org>
+
+ * ldlang.c (lang_check): Revert the change mode on 2001-06-15.
+
+2001-06-18 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.am (ld.1): Remove the prefix `$(srcdir)/'.
+ (diststuff): Add $(MANS).
+ * Makefile.in: Regenerated.
+
+ * ld.1: Removed.
+
+2001-06-18 Hans-Peter Nilsson <hp@axis.com>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
+ Update for API change in bfd_elf${ELFSIZE}_size_dynamic_sections.
+ * mpw-elfmips.c (gldelf32ebmip_before_allocation): Ditto.
+ * ld.h (args_type): Remove member export_dynamic. All users
+ changed to use struct bfd_link_info member.
+
+ * Makefile.am (ecriself.c, ed10velf.c, ei386moss.c): Depend on
+ $(srcdir)/emultempl/elf32.em, not $(srcdir)/emultempl/generic.em.
+ * Makefile.in: Regenerate.
+
+2001-06-18 H.J. Lu <hjl@gnu.org>
+
+ * ldlang.c (init_os): Add the newline to the einfo call.
+ (lang_check): Likewise.
+ (lang_do_version_exports_section): Likewise.
+
+2001-06-15 H.J. Lu <hjl@gnu.org>
+
+ * lexsup.c (parse_args); Save optind to report unrecognized
+ option.
+
+2001-06-15 Hans-Peter Nilsson <hp@axis.com>
+
+ * ldlang.c (lang_check): Emit fatal error if relocatable link
+ between different object flavours.
+
+ * lexsup.c (parse_args) <case OPTION_EXPORT_DYNAMIC, case 'E'>:
+ Set new link_info member export_dynamic.
+ * ldmain.c (main): Initialize new link_info member export_dynamic.
+
+2001-06-12 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * ldlang.c (walk_wild): Only call walk_wild_file if
+ lookup_name returns something.
+ (lookup_name): If load_symbols fails, return NULL.
+ (load_symbols): Change to a boolean function.
+ (open_input_bfds): If load_symbols fails then do not make the
+ executable.
+
+2001-06-08 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (record_bfd_errors): Remove.
+
+ * emultempl/aix.em: Fix copyright dates.
+
+2001-06-07 Andreas Jaeger <aj@suse.de>
+
+ * elf_x86_64.sh (NONPAGED_TEXT_START_ADDR): Increase.
+ (TEXT_START_ADDR): Likewise.
+
+2001-06-06 Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+ * configure.host: Set HOSTING_CRT0/HOSTING_LIBS correctly for s/390.
+
+2001-06-05 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
+
+ * emultempl/pe.em (init): Reduce default stack reserve to 0x200000.
+
+2001-05-31 H.J. Lu <hjl@gnu.org>
+
+ * ldlang.c (open_input_bfds): Don't change the bfd error
+ handler whilst loading symbols.
+
+2001-05-28 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * configure.tgt: Remove i370-mvs architecture, it is not currently
+ supported.
+
+2001-05-25 H.J. Lu <hjl@gnu.org>
+
+ * emulparams/ppcmacos.sh: Add SYSCALL_MASK and SYMBOL_MODE_MASK
+ like emulparams/aixppc.sh.
+
+2001-05-25 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/beos.em (gld${EMULATION_NAME}_before_parse): Move
+ setting of output_filename after bfd_scan_arch.
+ * emultempl/pe.em: Likewise.
+
+2001-05-25 H.J. Lu <hjl@gnu.org>
+
+ * emulparams/aixrs6.sh: Add SYSCALL_MASK and SYMBOL_MODE_MASK
+ like emulparams/aixppc.sh.
+
+ * emultempl/aix.em (sc): Use ${srcdir}/emultempl/ostring.sed
+ instead of ${srcdir}/emultempl/stringify.sed.
+
+2001-05-25 Timothy Wall <twall@oculustech.com>
+
+ * emulparams/elf64_aix.sh: Change settings to match IBM linker
+ output.
+
+2001-05-25 Alan Modra <amodra@one.net.au>
+
+ * configure.host: Replace linuxoldld with linux*oldld.
+ * configure.tgt: Likewise.
+
+2001-05-24 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/stringify.sed: Removed again.
+
+2001-05-24 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/aix.em (OUTPUT_ARCH): Defined.
+ (gld${EMULATION_NAME}_before_parse): Initialize
+ ldfile_output_architecture, ldfile_output_machine and
+ ldfile_output_machine_name from ${OUTPUT_ARCH} if possible.
+ * emultempl/beos.em: Likewise.
+ * emultempl/elf32.em: Likewise.
+ * emultempl/linux.em: Likewise.
+ * emultempl/mipsecoff.em: Likewise.
+ * emultempl/pe.em: Likewise.
+ * emultempl/sunos.em: Likewise.
+
+2001-05-24 Tom Rix <trix@redhat.com>
+
+ * emultempl/aix.em : (gld${EMULATION_NAME}_read_file)
+ udate import file format.
+ (change_symbol_mode) New, same
+ (is_syscall) New, same
+ * emulparams/aixppc.sh : add SYSCALL_MASK and SYMBOL_MODE_MASK
+ * emulparams/aixppc64.sh : same
+ * emulparams/aixrs6.sh : same
+ * emulparams/ppcmacos.sh : same
+ * emultempl/aix.em : use strtoull to parse options
+ * Makefile.am : add eaixppc64 emulation for xcoff64
+ * Makefile.in : same
+ * configure.tgt : same
+
+ * scripttempl/aix.sc : default text section offset to 0x10000000
+ default data section offset to 0x20000000
+ add .sv3264 and .sv64 pseudo sections
+ loader and debug sections use the currect section offset.
+
+ * emultempl/aix.em : Add xcoff64 support
+ Add -binitfini support
+ (gld${EMULATION_NAME}_before_parse) -binitfini
+ (gld${EMULATION_NAME}_parse_args) same
+ (gld${EMULATION_NAME}_before_allocation) format change for special
+ sections
+
+ * emulparams/aixppc64.sh : New file for xcoff64 support
+
+2001-05-23 Alexandre Oliva <aoliva@redhat.com>
+
+ * emultempl/elf32.em (ELF_INTERPRETER_SET_DEFAULT): Use this new
+ variable to avoid non-portable shell construct.
+
+2001-05-23 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+ * ldmain.c (get_emulation): Add -mips5 command line argument.
+
+2001-05-22 Alexandre Oliva <aoliva@redhat.com>
+
+ * emulparams/elf_i386_ldso.sh: New, copied from elf_i386.sh.
+ (ELF_INTERPRETER_NAME): Define it.
+ * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Use
+ it.
+ * configure.tgt (targ_emul, targ_extra_emuls)
+ [i[3456]86-*-solaris2*, i[3456]86-*-solaris*]: Use elf_i386_ldso
+ as primary, elf_i386 as extra.
+ * Makefile.am (ALL_EMULATIONS): Added eelf_i386_ldso.o.
+ (eelf_i386_ldso.c): New rule.
+ * Makefile.in: Rebuilt.
+
+2001-05-22 Nick Clifton <nickc@redhat.com>
+
+ * lexsup.c (ld_options): Allow -I to be an alias for
+ --dynamic-linker. This is for Solaris compatability.
+ * ld.texinfo: Document that -I can be used.
+ * ld.1: Regenerate.
+
+2001-05-16 Alan Modra <amodra@one.net.au>
+
+ * ldlang.c (wild_doit): Use linker_has_input to reliably determine
+ whether an input section is the first one assigned to an output
+ section.
+ Assorted formatting fixes.
+
+2001-05-14 DJ Delorie <dj@delorie.com>
+
+ * Makefile.am (ld.dvi): Search bfd/doc for texinfo files.
+ * Makefile.in: Ditto.
+
+2001-05-11 Jakub Jelinek <jakub@redhat.com>
+
+ * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Put
+ .gnu.linkonce.ia64unw{,i} sections into corresponding .IA_64.unwind*
+ output sections.
+ * emulparams/elf64_aix.sh (OTHER_READONLY_SECTIONS): Likewise.
+
+2001-05-11 Jakub Jelinek <jakub@redhat.com>
+
+ * ldlang.c (lang_process): Call bfd_merge_sections.
+
+2001-05-07 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+ * ldgram.y: Fix typo.
+
+2001-05-03 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/elf32.em: Include "libiberty.h".
+ (gld${EMULATION_NAME}_vercheck): Call basename () to get the
+ basename of the bfd filename.
+ (gld${EMULATION_NAME}_stat_needed): Likewise.
+ (gld${EMULATION_NAME}_try_needed): Likewise.
+ (gld${EMULATION_NAME}_open_dynamic_archive): Likewise.
+
+2001-05-02 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/pe.em: Include <ctype.h>.
+
+2001-05-02 Johan Rydberg <jrydberg@opencores.org>
+
+ * emulparams/elf32openrisc.sh: New file.
+
+ * Makefile.am: Add OpenRISC target.
+ * Makefile.in: Regenerated.
+
+ * configure.tgt: Add openrisc-*-* mapping.
+
+2001-05-02 Nick Clifton <nickc@redhat.com>
+
+ * emultempl/aix.em: Replace buystring with xstrdup.
+ * emultempl/beos.em: Replace buystring with xstrdup.
+
+2001-05-02 H.J. Lu <hjl@gnu.org>
+
+ * ldfile.c: Include "libiberty.h".
+ * ldlex.l: Likewise.
+
+ * ldmisc.c (buystring): Removed.
+ * ldmisc.h: Likewise.
+
+ * ldfile.c: Replace buystring with xstrdup.
+ * ldlang.c: Likewise.
+ * ldlex.l: Likewise.
+ * ldmain.c: Likewise.
+ * ldmisc.c: Likewise.
+ * lexsup.c: Likewise.
+ * mpw-eppcmac.c: Likewise.
+
+2001-04-30 Andreas Jaeger <aj@suse.de>
+
+ * emulparms/elf_x86_64.sh (MAXPAGESIZE): Fix value.
+
+2001-04-28 Paul Sokolovsky <Paul.Sokolovsky@technologist.com>
+
+ * ldlang.c (load_symbols): Give emulation a chance
+ to process unrecognized file before fatal error is
+ reported, not after.
+
+2001-04-27 Sean McNeil <sean@mcneil.com>
+
+ * configure.tgt: Add arm-vxworks target.
+ * scripttempl/armcoff.sc: Support .text or .data as a section name
+ prefix.
+ Define _etext.
+
+2001-04-13 J.T. Conklin <jtc@redback.com>
+
+ * ld.texinfo: Document --fatal-warnings.
+ * ld.1: Regenerate.
+
+ * ldmisc.c (vfinfo): Set flag to inhibit making executable if
+ warnings have been turned into errors.
+ * lexsup.c (OPTION_WARN_FATAL): Define.
+ (ld_options): Entry for --fatal-warnings.
+ (parse_args): Handle OPTION_WARN_FATAL.
+ * ld.h (ld_config_type): Add fatal_warnings field.
+
+2001-04-13 Jakub Jelinek <jakub@redhat.com>
+
+ * ldmain.c (main): Default to discard_sec_merge.
+ * lexsup.c (OPTION_DISCARD_NONE): Define.
+ (ld_options): Add --discard-none.
+ (parse_args): Handle OPTION_DISCARD_NONE.
+ * ldlang.c (wild_doit): SEC_MERGE should be set in the output
+ section only if SEC_MERGE and SEC_STRINGS flags and entsize of
+ all its input sections match.
+
+2001-04-05 Steven J. Hill <sjhill@cotw.com>
+
+ * Makefile.am (ALL_EMULATIONS): Add eelf32ltsmip.o.
+ (ALL_64_EMULATIONS): Add eelf64btsmip.o and eelf64ltsmip.o.
+ (eelf32ltsmip.c): New target.
+ (eelf64btsmip.c): Likewise.
+ (eelf64ltsmip.c): Likewise.
+ * Makefile.in: Regenerated.
+
+ * configure.tgt (mips*el-*-linux-gnu): Uses traditional MIPS
+ target.
+ (mips*-*-linux-gnu*): Likewise.
+
+ * emulparams/elf32ltsmip.sh: New. Traditional little endian
+ MIPS taget.
+ * emulparams/elf64btsmip.sh: New. Traditional 64bit big endian
+ target.
+ * emulparams/elf64ltsmip.sh: New. Traditional 64bit little
+ endian target.
+
+2001-04-05 Hans-Peter Nilsson <hp@axis.com>
+
+ * emulparams/criself.sh (EXECUTABLE_SYMBOLS): Cannot provide
+ correct value of __Stext here.
+ (TEXT_START_SYMBOLS): Define; always define __Stext, to start of
+ .startup section.
+
+ * emulparams/crislinux.sh: Remove FIXME.
+
+2001-04-02 Alan Modra <alan@linuxcare.com.au>
+
+ * emulparams/hppalinux.sh (MAXPAGESIZE): Set to 64k.
+ (TEXT_START_ADDR, TARGET_PAGE_SIZE): Likewise.
+
+2001-03-27 Hans-Peter Nilsson <hp@axis.com>
+
+ * configure.tgt (cris-*-*): Change default emulation to criself.
+ (cris-*-*aout*): New rule.
+
+2001-03-27 Matthew Wilcox <willy@ldl.fc.hp.com>
+
+ * emulparams/hppalinux.sh (MAXPAGESIZE): Set to 0x4000.
+ (TEXT_START_ADDR, TARGET_PAGE_SIZE): Ditto.
+
+2001-03-26 Andreas Jaeger <aj@suse.de>
+
+ * ld.texinfo (Overview): Fix syntax in texi code.
+
+2001-03-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * ld.texinfo: Put @c man indications to generate the ld man page.
+ When generating man, define all the variables. Define SEEALSO
+ and SYNOPSIS. Re-organize some lines to avoid the cross references.
+ * Makefile.am (MANCONF, TEXI2POD, POD2MAN): New variables.
+ (ld.1): Generate from ld.texinfo.
+ * Makefile.in: Regenerate.
+
+2001-03-23 Mark Elbrecht <snowball3@bigfoot.com>
+
+ * scripttempl/i386go32.sc: Support the GCC flags '-ffunction-sections'
+ and '-fdata-sections'. Set the VMA of STABS sections to zero.
+
+2001-03-17 Ulrich Drepper <drepper@redhat.com>
+
+ * emultmpl/elf32.em (gld${EMULATION_NAME}_search_needed): If NAME
+ is an absolute path look only for this file and not along the path.
+
+2001-03-17 Ulrich Drepper <drepper@redhat.com>
+
+ * emultempl/elf32.em (OPTION_GROUP): New macro.
+ Add new option Bgroup to longopts.
+ (gld*_parse_args): Handle GROUP_OPTION and recognize -z defs.
+ (gld*_list_options): Add -Bgroup and -z defs.
+ * ld.1: Document -Bgroup and -z defs.
+ * ld.texinfo: Likewise.
+
+2001-03-07 Michael Meissner <meissner@redhat.com>
+
+ * scripttempl/elfd10v.sc (.rodata,.rodata1,.data1,.sdata): Deal
+ with sections created by -fdata-sections.
+ (.dynbss,.bss): Ditto.
+
+2001-03-05 Alan Modra <alan@linuxcare.com.au>
+
+ * emultempl/m68kelf.em (m68k_elf_after_allocation): Call
+ after_allocation_default, not gld..._before_allocation.
+
+2001-02-27 Alan Modra <alan@linuxcare.com.au>
+
+ * configure.in (BFD_VERSION): New.
+ (AM_INIT_AUTOMAKE): Use $BFD_VERSION.
+ * configure: Regenerate.
+ * Makefile.am: Run "make dep-am"
+ * Makefile.in: Regenerate.
+
+2001-02-26 Timothy Wall <twall@cygnus.com>
+
+ * emulparams/elf64_aix.sh: Add additional read-only sections;
+ uncomment lines which are now required.
+
+2001-02-26 H.J. Lu <hjl@gnu.org>
+
+ * ldlang.c (open_input_bfds): Set the bfd error handler so
+ that problems can be caught whilst loading symbols.
+ (record_bfd_errors): New function: Report BFD errors and mark
+ the executable output as being invalid.
+
+2001-02-22 Timothy Wall <twall@cygnus.com>
+
+ * configure.host: Add configuration for ia64-*-aix*.
+ * Makefile.am (ALL_64_EMULATIONS): Add emulation for ia64-*-aix*.
+ Add dependencies for eelf64_aix.c.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Add ia64-*-aix* mapping.
+ * emulparams/elf64_aix.sh: Add settings for elf64 on aix5.
+
+2001-02-20 H.J. Lu <hjl@gnu.org>
+
+ * ldfile.c (ldfile_open_file): Set entry->search_dirs_flag to
+ false if we found the file.
+
+2001-02-18 David O'Brien <obrien@FreeBSD.org>
+
+ * configure.tgt: Add FreeBSD/Alpha, FreeBSD/x86-64, FreeBSD/ia64,
+ FreeBSD/PowerPC, FreeBSD/arm, and FreeBSD/sparc64 entries.
+
+2001-02-18 lars brinkhoff <lars@nocrew.org>
+
+ * Makefile.am: Add PDP-11 target.
+ * configure.tgt: Likewise.
+ * emulparams/pdp11.sh: New file.
+
+2001-02-17 David O'Brien <obrien@FreeBSD.org>
+
+ * configure.host: Add a generic FreeBSD configuration entry such that
+ all [modern] FreeBSD systems on all platforms will look the same.
+
+2001-02-14 H.J. Lu <hjl@gnu.org>
+
+ * configure.tgt: Remove mention of earmelf_linux26.
+
+2001-02-13 Richard Henderson <rth@redhat.com>
+
+ * emulparams/elf64_ia64.sh (OTHER_GOT_SYMBOLS): Remove.
+
+2001-02-13 H.J. Lu <hjl@gnu.org>
+
+ * ldexp.h (node_type): Add etree_provided.
+ * ldexp.c (exp_fold_tree): Handle etree_provided. Set the node
+ type to etree_provided if defined by PROVIDE. Allow updating
+ for etree_provided.
+ (exp_print_tree): Handle etree_provided.
+ * mpw-elfmips.c (gldelf32ebmip_find_exp_assignment): Handle
+ etree_provided.
+
+2001-02-09 David Mosberger <davidm@hpl.hp.com>
+
+ * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Add
+ .IA_64.unwind.* pattern to unwind table section and
+ .IA_64.unwind_info* pattern to unwind info section.
+
+2001-02-09 Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+ * Makefile.am: Add linux target for S/390.
+ * Makefile.in: Likewise.
+ * configure.host: Likewise.
+ * configure.tgt: Likewise.
+ * emulparams/elf64_s390.sh: New file.
+ * emulparams/elf_s390.sh: New file.
+
+2001-02-09 Jakub Jelinek <jakub@redhat.com>
+
+ * configure.tgt (sparc64-*-linux-gnu*): Add elf32_sparc into
+ targ_extra_libpath.
+ (sparc-*-linux-gnu*): Add elf64_sparc into targ_extra_libpath.
+
+2001-02-06 Philip Blundell <philb@gnu.org>
+
+ * Makefile.am: Remove mention of earmelf_linux26.
+ * Makefile.in: Regenerate.
+
+2001-02-04 Philip Blundell <philb@gnu.org>
+
+ * emulparams/armelf_linux.sh (TEXT_START_ADDR): Set to 0x8000.
+ * emulparams/armelf_linux26.sh: Delete.
+ * configure.tgt: Remove mention of armelf_linux26 emulation.
+
+2001-02-01 Nick Clifton <nickc@redhat.com>
+
+ * ld.1: Replace occurances of -oformat with --oformat.
+
+2001-01-25 Jim Driftmyer <jdrift@stny.rr.com>
+
+ * ldlang.c (lang_leave_overlay): Don't set lma_region when
+ load_base is specified.
+
+2001-01-24 Hans-Peter Nilsson <hp@axis.com>
+
+ * emultempl/elf32.em: Correct spelling in comments and listed
+ options.
+
+2001-01-23 Alan Modra <alan@linuxcare.com.au>
+
+ * ldlang.c (lang_leave_overlay): Only set lma_region from the
+ default for the first section of a group of overlay sections.
+
+2001-01-22 Alan Modra <alan@linuxcare.com.au>
+
+ * Makefile.am (GENSCRIPTS): Pass exec_prefix.
+ * Makefile.in: Regenerate.
+ * genscripts.sh: Use exec_prefix parameter to specify tool lib.
+ Check for null tool_dir.
+
+2001-01-16 Jim Wilson <wilson@redhat.com>
+
+ * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Add IA_64.unwind
+ and IA_64.unwind.info.
+
+2001-01-16 H.J. Lu <hjl@gnu.org>
+
+ * ldlang.c (lang_check): Merge the private data only if the
+ input file has contents.
+
+2001-01-14 Alan Modra <alan@linuxcare.com.au>
+
+ * emulparams/hppalinux.sh (OUTPUT_FORMAT): Set to elf32-hppa-linux.
+
+ * emultempl/hppaelf.em (hppaelf_after_parse): New function,
+ enabling search for libmilli. On a relocatable link, make .text
+ sections unique.
+ (LDEMUL_AFTER_PARSE): Define.
+ (hppaelf_finish): Correct spelling of relocatable in comments.
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
+ rummage through the script for sections on the unique list.
+ Correct length of strncmp for ".note".
+ (gld${EMULATION_NAME}_check_needed): Rearrange function.
+
+ * ldlang.c (unique_section_list): New var.
+ (unique_section_p): New function.
+ (walk_wild_section): Don't match sections on unique_section_list.
+ (lang_add_unique): New function.
+ Correct spelling of relocatable in comments.
+
+ * ldlang.h (struct unique_sections): Declare.
+ (unique_section_list): Declare.
+ (unique_section_p): Declare.
+ (lang_add_unique): Declare.
+
+ * lexsup.c (ld_options): Allow --unique to take an optional arg.
+ (parse_args [OPTION_UNIQUE]): Call lang_add_unique.
+
+ * ld.texinfo (--unique): Update.
+
+2001-01-13 Nick Clifton <nickc@redhat.com>
+
+ * lexsup.c (parse_args): Remove spurious white space.
+
+2001-01-12 Nick Clifton <nickc@redhat.com>
+
+ * lexsup.c (parse_args): Update copyright date.
+
+2001-01-12 Philip Blundell <pb@futuretv.com>
+
+ * configure.host: Set HOSTING_LIBS appropriately for ix86-cygwin.
+
+2001-01-10 Kazu Hirata <kazu@hxi.com>
+
+ * scripttempl/h8300.sc: Fix formatting. Fix a comment typo.
+ * scripttempl/h8300h.sc: Fix formatting.
+ * scripttempl/h8300s.sc: Likewise.
+ * scripttempl/h8500.sc: Likewise.
+ * scripttempl/h8500b.sc: Likewise.
+ * scripttempl/h8500c.sc: Likewise.
+ * scripttempl/h8500m.sc: Likewise.
+ * scripttempl/h8500s.sc: Likewise.
+
+2000-01-07 David O'Brien <obrien@BSDi.com>
+
+ * emultempl/elf32.em: Only perform Linux ld hints processing when
+ targeting Linux.
+
+2001-01-07 Philip Blundell <philb@gnu.org>
+
+ * ld.texinfo (Bug Reporting): Update email address for reports.
+
+2000-12-31 Nick Clifton <nickc@redhat.com>
+
+ * lexsup.c (parse_args): Set opterr to 0 and detect unparsed long
+ options by checking for a return value of '?' not -1.
+
+2000-12-28 Nick Clifton <nickc@redhat.com>
+
+ * lexsup.c (struct ld_option): Add new enum value:
+ EXACTLY_TWO_DASHES.
+ (ld_options[]): Change -omagic, -output and -oformat options
+ to be EXACTLY_TWO_DASHES.
+ (OUTPUT_COUNT): Use ARRAY_SIZE.
+ (parse_args): Change parameter 'argc' to unsigned.
+ Place EXACTLY_TWO_DASHES options into new really_longopts
+ array.
+ If getopt_long_only fails, try calling getopt_long using the
+ really_longopts array.
+ (help): Print a double dash for both EXACTLY_TWO_DASHES and
+ TWO_DASHES options.
+
+ * ldlex.h: Fix prototype of parse_args.
+
+ * ld.texinfo: Document that long options starting with 'o'
+ must be preceeded by two dashes. Change example of a single
+ dashed long option from -oformat to -trace-symbol.
+
+2000-12-26 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
+
+ * emultempl/pe.em (OPTION_NO_DEFAULT_EXCLUDES): Define.
+ (longopts[]): New --no-default-excludes option.
+ (gld_${EMULATION_NAME}_list_options): Document.
+ (gld_${EMULATION_NAME}_parse_args): Handle.
+
+2000-12-13 Michael Sokolov <msokolov@ivan.Harhan.ORG>
+
+ * ldlang.c (new_stat): Revert the last beautification with "innocent"
+ whitespace, it breaks the K&R C preprocessor.
+
+2000-12-11 DJ Delorie <dj@redhat.com>
+
+ * ld.texinfo: Add notes about --whole-archive and gcc.
+
+2000-11-18 Fred Fish <fnf@be.com>
+
+ * lexsup.c (OPTION_ALLOW_SHLIB_UNDEFINED): Define.
+ (ld_options): Entry for --allow-shlib-undefined.
+ (parse_args): Handle OPTION_ALLOW_SHLIB_UNDEFINED.
+ * ldmain.c (main): Initialize link_info.allow_shlib_undefined
+ to false.
+ * ld.texinfo: Document new command line switch.
+
+2000-12-12 Geoffrey Keating <geoffk@redhat.com>
+
+ * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS):
+ .fixup is actually read/write.
+ * emulparams/elf32lppc.sh (OTHER_READWRITE_SECTIONS): Likewise.
+ * emulparams/elf32ppcsim.sh (OTHER_READWRITE_SECTIONS): Likewise.
+ * emulparams/elf32lppcsim.sh (OTHER_READWRITE_SECTIONS): Likewise.
+
+2000-12-11 Jan Hubicka <jh@suse.cz>
+
+ * NEWS: Add note about x86_64 architecture.
+
+2000-12-06 Mark Elbrecht <snowball3@bigfoot.com>
+
+ * scripttempl/i386go32.sc: Use PROVIDE with _etext, _edata, _end.
+ Set DWARF2 sections to a VMA of zero.
+
+2000-12-01 Joel Sherrill <joel@OARcorp.com>
+
+ * configure.tgt (arm-*-rtems*, a29k-*rtems*, h8300-*-rtems*):
+ New targets.
+ (sparc*-*-rtemself*, sparc*-*-rtemsaout*): New targets.
+ (sparc*-*-rtems*): Switched from a.out to ELF.
+
+2000-11-30 Jan Hubicka <jh@suse.cz>
+
+ * Makefile.am (ALL_EMULATIONS): Add eelf_x86_64.o
+ (eelf_x86_64.c): New.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Add support for x86_64-*-linux-gnu*.
+ * emulparams/elf_x86_64.sh: New.
+
+2000-11-30 Hans-Peter Nilsson <hp@axis.com>
+
+ * emulparams/crislinux.sh (ENTRY): Change back to _start.
+ (TEXT_START_SYMBOLS): Remove conditional setting of __start.
+
+ * scripttempl/crisaout.sc: Change all RELOCATING not related to
+ merging non-a.out sections into CONSTRUCTING.
+
+2000-11-28 Nick Clifton <nickc@redhat.com>
+
+ * ld.1 (COPYING): Mention that the GNU Free Documentation
+ License is present in the sources, but not the output, and
+ also available from the GNU website.
+ (GNU Free Documentation License): Comment out this section.
+
+2000-11-28 David O'Brien <obrien@dragon.nuxi.com>
+
+ * emulparams/elf64alpha.sh (ENTRY): Remove leading underscore as ELF
+ does not use them.
+
+2000-11-25 David O'Brien <obrien@FreeBSD.org>
+
+ * ld.1: Remove old date so it does not give the impression the manpage
+ is way out of date.
+
+2000-11-24 Nick Clifton <nickc@redhat.com>
+
+ * configure.tgt (xscale-coff): Add target.
+ (xscale-elf): Add target.
+
+2000-11-24 Fred Fish <fnf@be.com>
+
+ * ldmain.c (main): Remove redundant init of config.make_executable
+ to true.
+
+2000-11-15 Richard Henderson <rth@redhat.com>
+
+ * emulparams/elf64alpha.sh (MAXPAGESIZE): Typo -- 64k, not 1M.
+
+2000-11-14 Kazu Hirata <kazu@hxi.com>
+
+ * scripttempl/h8300.sc: Fix formatting.
+ * scripttempl/h8300h.sc: Likewise.
+ * scripttempl/h8300s.sc: Likewise.
+
+2000-11-14 Denis Chertykov <denisc@overta.ru>
+
+ * scripttempl/elf32avr.sc: Fix bug in .eeprom segment.
+
+2000-11-09 Philip Blundell <pb@futuretv.com>
+
+ * emultempl/pe.em: Define ___start_SECNAME and ___stop_SECNAME
+ around orphan sections whose names can be represented in C.
+
+2000-11-07 Jim Wilson <wilson@redhat.com>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): New local
+ hold_sdata. If SEC_SMALL_DATA set, set place to hold_sdata.
+
+2000-11-06 Nick Clifton <nickc@redhat.com>
+
+ * ld.texinfo: Add GNU Free Documentation License.
+ * ldint.texinfo: Add GNU Free Documentation License.
+ * ld.1: Add GNU Free Documentation License.
+
+2000-11-05 Alan Modra <alan@linuxcare.com.au>
+
+ * ldlex.l (yy_create_string_buffer): Init yy_is_our_buffer,
+ yy_is_interactive, yy_at_bol, and yy_fill_buffer.
+
+ * Makefile.am (DISTCLEANFILES): Add stringify.sed.
+ Move 2000-11-02 Makefile.in changes to this file.
+ * Makefile.in: Regenerate.
+
+2000-11-03 Nick Clifton <nickc@redhat.com>
+
+ * scripttempl/h8300.sc: Use ${CONSTRUCTING...} to enclose
+ constructors and destructors.
+ * scripttempl/h8300h.sc: Ditto.
+ * scripttempl/h8300s.sc: Ditto.
+ * scripttempl/h8500.sc: Ditto.
+ * scripttempl/h8500b.sc: Ditto.
+ * scripttempl/h8500c.sc: Ditto.
+ * scripttempl/h8500m.sc: Ditto.
+ * scripttempl/h8500s.sc: Ditto.
+ * scripttempl/v850.sc: Ditto.
+ * scripttempl/w65.sc: Ditto.
+ * scripttempl/z8000.sc: Ditto.
+
+2000-11-02 Per Lundberg <plundis@chaosdev.org>
+
+ * Makefile.in (e_i386_chaos.c): New rule.
+ (ALL_EMULATIONS): Added e_i386_chaos.o.
+ * emulparams/elf_i386_chaos.sh: New file.
+ * configure.tgt: Recognise i[3456]86-chaosdev-storm-chaos.
+
+2000-10-20 Jakub Jelinek <jakub@redhat.com>
+
+ * emulparams/elf64_sparc.sh (TEXT_START_ADDR,
+ NONPAGED_TEXT_START_ADDR): Set to 4GB for Solaris targets.
+ Fix sed invocation, so that it coped with '/' in Solaris 64bit
+ library path suffix.
+ Based on patch by Andrew Macleod <amacleod@cygnus.com>.
+
+2000-10-18 Hans-Peter Nilsson <hp@axis.com>
+
+ * scripttempl/crisaout.sc (.text, .data): Pad, with ALIGN (32),
+ for consecutive sections.
+
+2000-10-17 Chandrakala Chavva <cchavva@redhat.com>
+
+ * lexsup.c: New option OPTION_TARGET_HELP. Prints all target specific
+ options.
+ * ld.texinfo: Added notes about this new option.
+
+2000-10-16 Nick Clifton <nickc@redhat.com>
+
+ * emultempl/pe.em (_after_open): Add tests of return values from
+ bfd functions. Emit appropriate error messages if necessary.
+
+2000-10-13 Nick Clifton <nickc@redhat.com>
+
+ * emultempl/pe.em (_after_open): Delete 'is2' and 'nsyms'
+ local variables - they are not used, but leave in the call to
+ bfd_canonicalize_symtab.
+ (_open_dynamic_archive): Add #ifdef DLL_SUPPORT around use of
+ pe_dll_search_prefix.
+
+2000-10-12 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * emultempl/pe.em (pe_dll_search_prefix): New variable,
+ (longopts): New --dll-search-prefix option.
+ (gld_${EMULATION_NAME}_list_options): Document.
+ (gld_${EMULATION_NAME}_parse_args): Handle.
+ (gld_${EMULATION_NAME}_open_dynamic_archive): When linking
+ dynamically, search for a dll named '<prefix><basename>.dll'
+ in preference to 'lib<basename>.dll' if --dll-search-prefix
+ is specified.
+
+2000-10-12 Alan Modra <alan@linuxcare.com.au>
+
+ * ldlang.c (section_already_linked): Set kept_section instead of
+ sec->comdat->sec.
+
+2000-10-10 Kazu Hirata <kazu@hxi.com>
+
+ * deffile.h: Fix formatting.
+ * lexsup.c: Likewise.
+ * mri.c: Likewise.
+
+2000-10-09 Paul Sokolovsky <Paul.Sokolovsky@technologist.com>
+
+ * pe-dll.c (make_one): Do not generate code thunk for DATA
+ exports.
+ (process_def_file): deduce DATA flag for auto-export sumbols.
+
+2000-10-09 Kazu Hirata <kazu@hxi.com>
+
+ * ld.h: Fix formatting.
+ * ldcref.c: Likewise.
+ * ldctor.h: Likewise.
+ * ldemul.c: Likewise.
+ * ldemul.h: Likewise.
+ * ldexp.c: Likewise.
+ * ldexp.h: Likewise.
+ * ldfile.c: Likewise.
+ * ldfile.h: Likewise.
+ * ldlang.c: Likewise.
+ * ldlang.h: Likewise.
+ * ldmain.c: Likewise.
+ * pe-dll.c: Likewise.
+
+ * pe-dll.c: Revert some formatting fixes.
+
+2000-10-08 Kazu Hirata <kazu@hxi.com>
+
+ * pe-dll.c: Fix formatting.
+
+2000-10-05 Kazu Hirata <kazu@hxi.com>
+
+ * ldlang.c: Fix formatting.
+
+2000-10-03 DJ Delorie <dj@redhat.com>
+
+ * pe-dll.c (fill_edata): initialize entire block
+ (make_one): fill in correct section.
+
+2000-10-03 Kazu Hirata <kazu@hxi.com>
+
+ * ldexp.c: Fix formatting.
+
+2000-10-02 DJ Delorie <dj@redhat.com>
+
+ * emultempl/pe.em (gld_*_after_open): detect case where there two
+ import libraries for same dll; rename one to ensure proper link
+ order.
+
+ * pe-dll.c (process_def_file): compare ordinals to -1, not 0; fix
+ typo
+ (generate_edata): fix typo
+
+2000-09-29 Hans-Peter Nilsson <hp@axis.com>
+
+ * scripttempl/crisaout.sc (ENTRY): Now __start.
+ (.text): Add default setting for __start.
+ Remove CONSTRUCTORS handling.
+ (/DISCARD/): Add .gnu.warning.*.
+ * emulparams/crislinux.sh (ENTRY): Now __start.
+ (TEXT_START_SYMBOLS): New; provide __Stext and __start default.
+ * emulparams/criself.sh (OUTPUT_FORMAT): Now elf32-us-cris.
+ (ENTRY): Now __start.
+ (INITIAL_READONLY_SECTIONS): Add KEEP for .startup.
+ (EXECUTABLE_SYMBOLS): Add default setting for __start.
+
+2000-09-29 Kazu Hirata <kazu@hxi.com>
+
+ * deffile.h: Fix formatting.
+ * ld.h: Likewise.
+ * ldcref.c: Likewise.
+ * ldctor.c: Likewise.
+ * ldctor.h: Likewise.
+ * ldemul.c: Likewise.
+ * ldemul.h: Likewise.
+ * ldexp.c: Likewise.
+ * ldexp.h: Likewise.
+ * ldfile.c: Likewise.
+ * ldfile.h: Likewise.
+ * ldlang.c: Likewise.
+ * ldlang.h: Likewise.
+ * lexsup.c: Likewise.
+ * mri.c: Likewise.
+ * pe-dll.c: Likewise.
+
+2000-09-28 Paul Sokolovsky <Paul.Sokolovsky@technologist.com>
+
+ * pe-dll.c (process_def_file): Uninitialized data wasn't
+ exported with --export-all-symbols switch.
+
+2000-09-28 DJ Delorie <dj@redhat.com>
+
+ * pe-dll.c (fill_edata): rearrange the data so that ordinals and
+ noname work properly.
+
+2000-09-28 Alan Modra <alan@linuxcare.com.au>
+
+ * ld.texinfo (HPPA ELF32): New section.
+
+ * emultempl/hppaelf.em (group_size): New.
+ (hppaelf_finish): Pass group_size to elf32_hppa_size_stubs.
+ (PARSE_AND_LIST_PROLOGUE): Add OPTION_STUBGROUP_SIZE.
+ (PARSE_AND_LIST_LONGOPTS): Add --stub-group-size. Duplicate
+ options to prevent abbreviations matching.
+ (PARSE_AND_LIST_OPTIONS): Describe the above. Reformat.
+ (PARSE_AND_LIST_ARGS_CASES): Handle it.
+
+2000-09-21 Michael Sokolov <msokolov@ivan.Harhan.ORG>
+
+ * emultempl/m68kelf.em: Conditionalise the embedded relocs feature
+ on the m68*-*-elf target. Make it support COFF input objects.
+
+2000-09-21 Kazu Hirata <kazu@hxi.com>
+
+ * ldmain.c: Fix formatting.
+ * ldmisc.c: Likewise.
+ * ldver.c: Likewise.
+ * ldwrite.c: Likewise.
+
+2000-09-21 Alan Modra <alan@linuxcare.com.au>
+
+ * ldwrite.c (clone_section): Silence gcc warnings.
+
+2000-09-20 Alan Modra <alan@linuxcare.com.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Handle
+ out of memory failure.
+
+ * ldwrite.c (ldwrite): Remove unnecessary einfo arg.
+ (clone_section): Handle out of memory failures. Rename var to
+ avoid c++ reserved word.
+
+2000-09-18 Alan Modra <alan@linuxcare.com.au>
+
+ * emultempl/hppaelf.em (hppaelf_add_stub_section): Rename
+ stub_name param to stub_sec_name.
+ (hppaelf_finish): Modify call to elf32_hppa_size_stubs.
+
+2000-09-10 Michael Sokolov <msokolov@ivan.Harhan.ORG>
+
+ * emultempl/m68kelf.em: New file.
+ * emulparams/m68kelf.sh (EXTRA_EM_FILE): Use it.
+ * Makefile.am (em68kelf.c): Add dependency on m68kelf.em.
+ * Makefile.in: Regenerate.
+
+2000-09-15 Alan Modra <alan@linuxcare.com.au>
+
+ * emulparams/hppalinux.sh (DATA_START_SYMBOLS): Provide $global$
+ only as needed.
+
+2000-09-13 Nick Clifton <nickc@redhat.com>
+
+ * ldmain.c (multiple_definition): Disable relaxation if
+ multiple symbol definitions are encountered - otherwise the
+ linker could abort with an assertion failure.
+
+2000-09-10 Nick Clifton <nickc@redhat.com>
+
+ * mri.c: Fix formatting.
+
+2000-09-07 H.J. Lu <hjl@gnu.org>
+
+ * configure.in (AC_ISC_POSIX): Put after AC_CANONICAL_SYSTEM.
+ * configure: Rebuild.
+
+2000-09-07 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.am (lexsup.o): Also depend on $(INCDIR)/demangle.h.
+ * Makefile.in: Rebuild.
+
+2000-09-07 Alan Modra <alan@linuxcare.com.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Fix
+ broken list handling. Create __start_SECNAME and __stop_SECNAME
+ when no place-holder. Add some comments. Test both SEC_CODE and
+ SEC_READONLY for hold_text to prevent .rodata orphan poisoning.
+ Handle case where no output section statement created.
+
+2000-09-07 Niibe Yutaka <gniibe@m17n.org>, Kaz Kojima <kkojima@rr.iij4u.or.jp>, Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.tgt (sh-*-linux*): Added.
+ * Makefile.am: Added eshelf_linux and eshlelf_linux.
+ * Makefile.in: Rebuilt.
+ * emulparams/shelf_linux.sh: New file.
+ * emulparams/shlelf_linux.sh: New file.
+
+2000-09-06 Alan Modra <alan@linuxcare.com.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
+ try shuffling sections when the orphan happens to be the place
+ holder. Keep count of unique section names generated so we speed
+ the search for a new name.
+
+2000-09-06 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure: Rebuilt with new libtool.m4.
+
+2000-09-05 Nick Clifton <nickc@redhat.com>
+
+ * Makefile.in: Regenerate.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+ * po/ld.pot: Regenerate.
+
+ * ldint.texinfo: Remove CVS revision marker - it foils local
+ comparisons.
+
+ * emultempl/ticoff.em: Remove extraneous comma.
+
+2000-09-05 Alan Modra <alan@linuxcare.com.au>
+
+ * emultempl/hppaelf.em (hppaelf_add_stub_section): Add SEC_RELOC
+ to stub section flags.
+ (hppa_for_each_input_file_wrapper): New.
+ (hppa_lang_for_each_input_file): New.
+ (lang_for_each_input_file): Define to call above.
+ (multi_subspace): New.
+ (hppaelf_finish): Pass multi_subspace to elf32_hppa_size_stubs.
+ (PARSE_AND_LIST_PROLOGUE): Define.
+ (PARSE_AND_LIST_LONGOPTS): Define.
+ (PARSE_AND_LIST_OPTIONS): Define.
+ (PARSE_AND_LIST_ARGS_CASES): Define.
+ (hppaelf_finish): Call elf32_hppa_set_gp.
+ (hppaelf_set_output_arch): Remove.
+ (LDEMUL_SET_OUTPUT_ARCH): Remove.
+
+ * emulparams/hppalinux.sh (ELFSIZE): Define.
+ (MACHINE): Define.
+ (OTHER_READONLY_SECTIONS): Define.
+ (DATA_PLT): Define.
+ (GENERATE_SHLIB_SCRIPT): Define.
+
+ * ldlang.c: Add missing prototypes, and tidy others. Change CONST
+ to const throughout. Change `void *' to `PTR' throughout.
+ (lang_memory_default): Function is local to file, add `static'.
+
+ * Makefile.am (ehppaelf.c): Depend on emultempl/elf32.em.
+ (ehppalinux.c): Likewise.
+ (earmelf.c): Likewise.
+ (earmelf_linux.c): Likewise.
+ (earmelf_linux26.c): Likewise.
+ * Makefile.in: Regenerate.
+
+ * ld.h (ld_config_type): Add unique_orphan_sections.
+ * lexsup.c (OPTION_UNIQUE): Define.
+ (ld_options): Add "--unique".
+ (parse_args): Handle it.
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
+ search for an existing output section if unique_orphan_sections is
+ set. Make use of bfd_get_unique_section_name rather than
+ duplicating code here.
+ * ld.texinfo: Describe --unique.
+
+ * lexsup.c (ld_options): Make split-by-reloc arg optional. Add
+ optional arg to split-by-file.
+ (parse_args): Handle them.
+ * ld.texinfo: Update description of these options.
+ * ldwrite.c (clone_section): Pass in the section name. Replace
+ local code with bfd_get_unique_section_name.
+ (split_sections): Tidy code and comments. Use a list traversal
+ more appropriate to the list construction. Handle cooked section
+ sizes. Split when split_by_reloc reached rather than exceeded.
+ Track section size and split when split_by_file reached. Fix
+ link_order_tail (even though it's not used).
+ (ldwrite): Modify condition for calling split_sections to suit
+ changed split_by_reloc and split_by_file.
+ * ldmain.c (main): Init config.split_by_reloc and
+ config.split_by_file to -1.
+ * ld.h (ld_config_type): Change split_by_reloc to unsigned.
+ Change split_by_file to bfd_size_type.
+
+2000-09-02 Nick Clifton <nickc@redhat.com>
+
+ * configure.in: Increase version number to 2.10.91.
+ * NEWS: Mention new ability to support removal of duplicate DWARF2
+ debug information.
+ * configure: Regenerate.
+ * aclocal.m4: Regenerate.
+ * config.in: Regenerate.
+
+2000-09-02 Daniel Berlin <dberlin@redhat.com>
+
+ * scripttempl/elf.sc: Add .gnu.linkonce.wi.* to .debug_info
+ sections.
+ * scripttempl/elf32avr.sc: Ditto.
+ * scripttempl/elfd10v.sc: Ditto.
+ * scripttempl/elfd30v.sc: Ditto.
+ * scripttempl/elfi370.sc: Ditto.
+ * scripttempl/elfm68hc11.sc: Ditto.
+ * scripttempl/elfm68hc12.sc: Ditto.
+ * scripttempl/elfi386beos.sc: Ditto.
+ * scripttempl/v850.sc: Ditto.
+
+2000-08-31 Alexandre Oliva <aoliva@redhat.com>
+
+ * acinclude.m4: Include libtool and gettext macros from the
+ top level.
+ * aclocal.m4, configure: Rebuilt.
+
+2000-08-25 Nick Clifton <nickc@redhat.com>
+
+ * ldlang.c (open_output): When choosing the target for a
+ particular endianness, do nothing if the target is not
+ supported.
+
+2000-08-25 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Don't
+ check -rpath nor LD_RUN_PATH for cross link.
+ * ld.texinfo: Document the change.
+
+2000-08-24 Hans-Peter Nilsson <hp@axis.com>
+
+ * NEWS: Mention support for CRIS.
+
+2000-08-23 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Get
+ the current runpath list from bfd_elf_get_runpath_list ()
+ before search.
+
+2000-08-22 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Search
+ the DT_RPATH/DT_RUNPATH entries for DT_NEEDED after
+ LD_LIBRARY_PATH for native linker. Display the needed DSO if
+ trace_file_tries is non-zero.
+ (gld${EMULATION_NAME}_try_needed): Report the needed DSO found
+ if trace_file_tries is non-zero.
+
+ * ld.texinfo: Document the usage of DT_RPATH/DT_RUNPATH.
+ * NEWS: Mention it.
+
+2000-08-14 Jason Eckhardt <jle@cygnus.com>
+
+ * NEWS: Mention i860 support.
+
+2000-08-14 Andreas Schwab <schwab@suse.de>
+
+ * scripttempl/elf.sc: Fix last change to use correct comment
+ syntax.
+
+2000-08-10 Geoff Keating <geoffk@cygnus.com>
+
+ * scripttempl/elf.sc: Add a comment giving the correspondence
+ between sections, per-datum sections, and linkonce sections. Make
+ the comment true even for .bss, .sdata, .sdata2, .sbss, and
+ .sbss2.
+
+2000-08-10 Jason Eckhardt <jle@cygnus.com>
+
+ * emulparams/elf32_i860.sh: New file.
+ * configure.tgt: Recognize new target i860-stardent-{sysv4*|elf*}.
+ * Makefile.am (ALL_EMULATIONS): Add eelf32_i860.o.
+ (eelf32_i860.c): New rule.
+ * Makefile.in: Regenerate.
+
+2000-08-10 Nick Clifton <nickc@cygnus.com>
+
+ * emulparams/mipspe.sh (ENTRY): Add definition.
+
+2000-08-08 Peter Jeremy <peter.jeremy@alcatel.com.au>
+
+ * emultempl/elf32.em (_after_close): Refer to -rpath not --rpath
+ in error message.
+
+2000-08-08 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * scripttempl/elfm68hc11.sc: Define __bss_size symbol to indicate
+ the final size of .bss section.
+ * scripttempl/elfm68hc12.sc: Likewise.
+
+2000-08-04 Alan Modra <alan@linuxcare.com.au>
+
+ * emultempl/elf32.em (gld_${EMULATION_NAME}_parse_args): Rename to
+ gld${EMULATION_NAME}_parse_args for consistency. Combine
+ lastoptind and prevoptind vars, and keep track of last optind.
+ (gld_${EMULATION_NAME}_list_options): Rename to
+ gld${EMULATION_NAME}_list_options.
+
+2000-08-03 Rodney Brown <RodneyBrown@pmsc.com>
+
+ * configure.tgt: Select targ_emul=elf_i386 for Unixware 7
+ (i586-sco-sysv5uw7.1.0).
+
+2000-07-27 H.J. Lu <hjl@gnu.org>
+
+ * emulparams/elf64alpha.sh (PARSE_AND_LIST_ARGS): Removed.
+ (PARSE_AND_LIST_PROLOGUE): New.
+ (PARSE_AND_LIST_LONGOPTS): Likewise.
+ (PARSE_AND_LIST_OPTIONS): Likewise.
+ (PARSE_AND_LIST_ARGS_CASES): Likewise.
+ (PARSE_AND_LIST_EPILOGUE): Likewise.
+
+2000-07-28 Alan Modra <alan@linuxcare.com.au>
+
+ * emultempl/armelf.em: Elide functions common to elf32.em,
+ ie. most of the file.
+ (arm_elf_after_open): New. Do arm specific things then call
+ gld${EMULATION_NAME}_after_open.
+ (arm_elf_before_allocation): New. Call
+ gld${EMULATION_NAME}_before_allocation then do arm specifics.
+ (PARSE_AND_LIST_PROLOGUE): Define.
+ (PARSE_AND_LIST_SHORTOPTS): Define.
+ (PARSE_AND_LIST_LONGOPTS): Define.
+ (PARSE_AND_LIST_OPTIONS): Define.
+ (PARSE_AND_LIST_ARGS_CASES): Define.
+ (LDEMUL_AFTER_OPEN): Define.
+ (LDEMUL_BEFORE_ALLOCATION): Define.
+ (LDEMUL_BEFORE_PARSE): Define.
+ (LDEMUL_FINISH): Define.
+
+ * emultempl/hppaelf.em: Similarly zap most of this file.
+ (hppaelf_add_stub_section): Prototype.
+ (hppaelf_layaout_sections_again): Prototype.
+ (hook_in_stub): Prototype.
+ (LDEMUL_SET_OUTPUT_ARCH): Define.
+ (LDEMUL_FINISH): Define.
+ (LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Define.
+
+ * emulparams/armelf.sh (TEMPLATE_NAME): Use elf32.
+ (EXTRA_EM_FILE): New.
+ * emulparams/armelf_linux.sh: Likewise.
+ * emulparams/armelf_linux26.sh: Likewise.
+ * emulparams/hppalinux.sh: Likewise.
+ * emulparams/hppaelf.sh: Likewise.
+ (NOP): Define.
+
+ * emultempl/elf32.em: Fix formatting.
+ (EXTRA_EM_FILE): Source it.
+ (LDEMUL_BEFORE_PARSE, LDEMUL_SYSLIB, LDEMUL_HLL,
+ LDEMUL_AFTER_PARSE, LDEMUL_AFTER_OPEN, LDEMUL_AFTER_ALLOCATION,
+ LDEMUL_SET_OUTPUT_ARCH, LDEMUL_CHOOSE_TARGET,
+ LDEMUL_BEFORE_ALLOCATION, LDEMUL_GET_SCRIPT, LDEMUL_FINISH,
+ LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS,
+ LDEMUL_OPEN_DYNAMIC_ARCHIVE, LDEMUL_PLACE_ORPHAN,
+ LDEMUL_SET_SYMBOLS, LDEMUL_PARSE_ARGS, LDEMUL_UNRECOGNIZED_FILE,
+ LDEMUL_LIST_OPTIONS, LDEMUL_RECOGNIZED_FILE,
+ LDEMUL_FIND_POTENTIAL_LIBRARIES): New shell vars. Add code to
+ allow functions in this file to be overridden.
+ (PARSE_AND_LIST_SHORTOPTS): Handle it.
+
+ * emultempl/m68kcoff.em: Include ldfile.h before ldemul.h.
+
+ * emultempl/elf32.em: Reorganize file.
+
+2000-07-27 Ivan Kokshaysky <ink@jurassic.park.msu.ru>
+
+ * emulparams/elf64alpha.sh: Implement "-taso" emulation
+ specific option to fit 64-bit executable in the lower
+ 31-bit address range. This is done by changing start
+ address of .interp (the very first section of executable)
+ and then setting EF_ALPHA_32BIT elf header flag.
+
+2000-07-21 Michael Sokolov <msokolov@ivan.Harhan.ORG>
+
+ * emultempl/m68kcoff.em: New file.
+ * emulparams/m68kcoff.sh (TEMPLATE_NAME): Use m68kcoff template.
+ * Makefile.am (em68kcoff.c): Depend on m68kcoff.em rather than
+ generic.em.
+ * Makefile.in: Regenerate.
+
+2000-07-20 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/elf32.em (longopts): Duplicate "disable-new-dtags"
+ and "disable-new-dtags" to stop getopt from treating -d/-e as
+ abbreviations for these options.
+
+2000-07-20 H.J. Lu <hjl@gnu.org>
+
+ * ld.texinfo: Add documentation for --disable-new-dtags and
+ --enable-new-dtags.
+
+ * ldmain.c (main): Initialize link_info.new_dtags to false.
+
+ * emultempl/elf32.em (gld_${EMULATION_NAME}_parse_args): Add
+ --disable-new-dtags and --enable-new-dtags.
+ (gld_${EMULATION_NAME}_list_options): Likewise.
+
+2000-07-05 Kenneth Block <krblock@computer.org>
+
+ * lexsup.c: Add optional style to demangle switch
+ * ld.texinfo: Document optional style to demangle switch.
+
+2000-07-20 Hans-Peter Nilsson <hp@axis.com>
+
+ * Makefile.am (ALL_EMULATIONS): Add ecrisaout.o, ecriself.o,
+ ecrislinux.o.
+ (ecrisaout.c, ecriself.c, ecrislinux.c): New rules.
+ Regenerate dependencies.
+ * Makefile.in: Rebuild.
+ * configure.tgt (cris-*-*): New target.
+ * emulparams/crisaout.sh, emulparams/criself.sh,
+ emulparams/crislinux.sh, scripttempl/crisaout.sc: New files.
+ * po/POTFILES.in, po/ld.pot: Regenerate.
+
+2000-07-20 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/elf32.em (gld_${EMULATION_NAME}_list_options):
+ Print out ignored -z options.
+
+2000-07-19 H.J. Lu <hjl@gnu.org>
+
+ * emulparams/elf32mcore.sh (PARSE_AND_LIST_ARGS): Removed.
+ (PARSE_AND_LIST_PROLOGUE): New.
+ (PARSE_AND_LIST_LONGOPTS): Likewise.
+ (PARSE_AND_LIST_OPTIONS): Likewise.
+ (PARSE_AND_LIST_ARGS_CASES): Likewise.
+
+ * ldmain.c (main): Clear link_info.flags and link_info.flags_1.
+
+ * lexsup.c (ld_options): Comment out 'z'.
+ (parse_args): Likewise.
+
+ * emultempl/elf32.em: Include "elf/common.h".
+ (gld_${EMULATION_NAME}_parse_args): Defined. Handle some -z
+ options.
+ (gld_${EMULATION_NAME}_list_options): Likewise.
+
+ * ld.texinfo: Add documentation for the recognized -z options.
+
+2000-07-19 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Call
+ bfd_elf_set_dt_needed_soname ().
+
+2000-07-18 DJ Delorie <dj@cygnus.com>
+
+ * pe-dll.c (pe_dll_id_target): check object target name also
+
+2000-07-18 Hans-Peter Nilsson <hp@axis.com>
+
+ * scripttempl/elf.sc (.init): Only do ${INIT_START} and
+ ${INIT_END} if relocating.
+ (.fini): Likewise ${FINI_START} and ${FINI_END}.
+
+2000-07-16 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * emultempl/pe.em (gld_*_open_dynamic_archive): New search
+ order for dynamic library '-lfoo' on pei386: libfoo.dll.a,
+ foo.dll.a, libfoo.a, libfoo.dll, foo.dll. This fixes compatibility
+ errors introduced by the old dynamic lib search order.
+
+2000-07-17 DJ Delorie <dj@cygnus.com>
+
+ * pe-dll.c (process_def_file): auto-export data items also
+ (pe_process_import_defs): also see if _imp_ form needed
+
+2000-07-12 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * pe-dll.c (make_one): fix a typo in the __imp_ name decoration
+ for dll import libraries
+
+2000-07-12 Mark Elbrecht <snowball3@bigfoot.com>
+
+ * scripttempl/i386go32.sc: Support the g++ attribute init_priority in
+ gcc 2.95.2 and later.
+
+2000-07-11 Kazu Hirata <kazu@hxi.com>
+
+ * ldfile.c (ldfile_try_open_bfd): Output '\n' after an error
+ message.
+
+2000-07-10 Alan Modra <alan@linuxcare.com.au>
+
+ * ldemul.h (struct lang_input_statement_struct): Remove forward
+ declaration.
+ (struct search_dirs): Likewise.
+ * ldfile.h (struct lang_input_statement_struct): Likewise.
+ Protect file from multiple inclusion.
+ * ldlang.h (LANG_FOR_EACH_INPUT_STATEMENT): Move file_chain
+ declaration from macro to file scope.
+
+ * ldemul.c: ldexp.h,ldlang.h,ldfile.h,ldemul.h go in this order.
+ * ldgram.y: Likewise here.
+ * ldlang.c: And here.
+ * ldmain.c: And here.
+ * mpw-elfmips.c: And here.
+ * mpw-eppcmac.c: And here.
+ * emultempl/aix.em: And here.
+ * emultempl/armcoff.em: And here.
+ * emultempl/armelf.em: And here.
+ * emultempl/armelf_oabi.em: And here.
+ * emultempl/beos.em: And here.
+ * emultempl/elf32.em: And here.
+ * emultempl/hppaelf.em: And here.
+ * emultempl/linux.em: And here.
+ * emultempl/lnk960.em: And here.
+ * emultempl/pe.em: And here.
+ * emultempl/sunos.em: And here.
+ * mpw-esh.c: And here. Include ldexp.h and ldlang.h too.
+ * mpw-idtmips.c: Ditto.
+ * emultempl/generic.em: Ditto.
+ * emultempl/gld960.em: Ditto.
+ * emultempl/gld960c.em: Ditto.
+ * emultempl/mipsecoff.em: Ditto.
+ * emultempl/ticoff.em: Ditto.
+ * emultempl/vanilla.em: Ditto.
+
+ * pe-dll.c: Include ldfile.h
+ * ldver.c: Include ldexp.h, ldlang.h, ldfile.h
+
+ * mpw-elfmips.c: (gldelf32ebmip_before_allocation): Add missing
+ arguments to bfd_elf32_size_dynamic_sections call.
+ (gldelf32ebmip_place_orphan): Add missing arguments to
+ lang_leave_output_section_statement call.
+
+2000-07-10 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/pe.em (pe_enable_stdcall_fixup): Protect with
+ DLL_SUPPORT.
+ (strhash): Likewise.
+ (compute_dll_image_base): Likewise.
+ (pe_undef_found_sym): Likewise.
+ (pe_undef_cdecl_match): Likewise.
+ (gld_${EMULATION_NAME}_open_dynamic_archive): Mark the
+ argument "arch" with ATTRIBUTE_UNUSED.
+
+2000-07-10 Alan Modra <alan@linuxcare.com.au>
+
+ * configure.tgt: Remove extraneous hppa*-*-linux-gnu*.
+
+ From Ryan Bradetich <rbradetich@uswest.net>
+ * ldwrite.c (SSIZE): Remove to cure macro redefinition warning.
+
+2000-07-09 Alan Modra <alan@linuxcare.com.au>
+
+ Changes to create multiple linker stubs, positioned immediately
+ before the section where they are required.
+ * emultempl/hppaelf.em: Include elf32-hppa.h.
+ (stub_sec, file_chain): Delete.
+ (hppaelf_create_output_section_statements): Don't make a stub
+ section here.
+ (hook_stub_info): New struct.
+ (hook_in_stub): New function.
+ (hppaelf_add_stub_section): New function.
+ (hppaelf_finish): Do nothing for relocateable links. Modify the
+ call to elf32_hppa_size_stubs. Move code for updating section
+ layout from here...
+ (hppaelf_layaout_sections_again): ..to here, a new function.
+
+ * emultempl/hppaelf.em (hppaelf_delete_padding_statements): Fix
+ broken list handling. Pass in a pointer to the list.
+ (hppaelf_finish): Update call to hppaelf_delete_padding_statements
+ for above changes.
+ (hppaelf_before_parse): Prototype.
+ (hppaelf_set_output_arch): Prototype.
+ (hppaelf_create_output_section_statements): Prototype.
+ (hppaelf_delete_padding_statements): Prototype.
+ (hppaelf_finish): Prototype.
+
+ Merge from elf32.em
+ * emultempl/hppaelf.em: Include ctype.h.
+ (struct orphan_save): New.
+ (gld${EMULATION_NAME}_place_orphan): New.
+ (output_rel_find): New.
+ (hppaelf_get_script): Update from elf32.em.
+ (ld_hppaelf_emulation): Rename to ld_${EMULATION_NAME}_emulation.
+ Change emulation_name field to "${EMULATION_NAME}". Add
+ gld${EMULATION_NAME}_place_orphan.
+
+ * Makefile.am (ALL_EMULATIONS): Reinstate ehppaelf.o, add
+ ehppalinux.o, sort it. Regenerate dependencies.
+ (ehppalinux.c): Depend on hppaelf.em
+ * Makefile.in: Regenerate.
+
+ * configure.tgt: targ_emul=hppalinux for hppa*linux
+
+ * emulparams/hppalinux.sh: New.
+ * emulparams/hppaelf.sh (TARGET_PAGE_SIZE): Write in hex.
+
+2000-07-08 Alan Modra <alan@linuxcare.com.au>
+
+ * lexsup.c (parse_args): Copy section name.
+
+2000-07-07 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * emultempl/pe.em: institute the following search order for
+ dynamic libraries on pei386: libfoo.dll.a, foo.dll.a (import
+ libs), libfoo.dll, foo.dll (link direct to dll). Fall back to
+ static lib (libfoo.a) if none of the above are found.
+
+2000-07-07 Mumit Khan <khan@xraylith.wisc.edu>
+
+ * emultempl/pe.em (pe_enable_auto_image_base): New variable.
+ (longopts): New --{enable,disable}-auto-image-base options.
+ (gld_${EMULATION_NAME}_list_options): Document.
+ (gld_${EMULATION_NAME}_parse): Handle.
+ (strhash): New static function.
+ (compute_dll_image_base): New static function.
+ (gld_${EMULATION_NAME}_set_symbols): Use.
+
+2000-07-05 DJ Delorie <dj@redhat.com>
+
+ * MAINTAINERS: new
+
+2000-07-01 Koundinya K <kk@ddeorg.soft.net>
+
+ * configure.tgt: Add traditional mips (mips*-*-sysv4*) target.
+ * emulparams/elf32btsmip.sh: New file.
+ * Makefile.am: Add traditional mips target.
+ * Makefile.in: Rebuild.
+
+2000-07-01 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.am (EXTRA_ld_new_SOURCES): Set to deffilep.y for
+ automake to use YLWRAP.
+ * Makefile.in: Rebuild.
+
+2000-07-01 Alan Modra <alan@linuxcare.com.au>
+
+ * Makefile.am (DEP): Fix 2000-06-22. grep after running dep.sed
+ (CLEANFILES): Add DEPA.
+ * Makefile.in: Regenerate.
+
+2000-06-30 Timothy Wall <twall@ppc>
+
+ * scripttempl/tic54xcoff.sc: PAGE N is not implemented, so encode
+ the page in the upper octet of the address.
+
+2000-06-26 Marek Michalkiewicz <marekm@linux.org.pl>
+
+ * emulparams/avrmega161.sh (ARCH): Change to avr:5.
+
+2000-06-24 Alan Modra <alan@linuxcare.com.au>
+
+ * NEWS: arm-elf does --gc-sections too.
+
+2000-06-22 Alan Modra <alan@linuxcare.com.au>
+
+ * Makefile.am (DEP): grep for leading `/' in DEP1, and fail if we
+ find one.
+ * Makefile.in: Regenerate.
+
+2000-06-21 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.am: Rebuild dependency.
+ * Makefile.in: Rebuild.
+
+2000-06-20 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.am: Rebuild dependency.
+ * Makefile.in: Rebuild.
+
+2000-06-20 Timothy Wall <twall@cygnus.com>
+
+ * scripttempl/tic54xcoff.sc: New.
+ * ldlang.c (wild_doit): Propagate SEC_BLOCK flag.
+ * gen-doc.texi: Add flag for TI COFF.
+ * ld.texinfo: Add documentation for TI COFF handling switches.
+ * emultempl/ticoff.em: New. TI COFF handling.
+ * configure.tgt: Add tic54x target.
+ * Makefile.am: Add tic54x target.
+ * Makefile.in: Ditto.
+
+2000-06-20 Alan Modra <alan@linuxcare.com.au>
+
+ * ldmain.c (set_scripts_dir): Correct pointer comparison when
+ checking for backslashes.
+
+2000-06-19 Alan Modra <alan@linuxcare.com.au>
+
+ * NEWS: Move entries not in 2.10 above "Changes in version 2.10".
+
+2000-06-18 Alan Modra <alan@linuxcare.com.au>
+
+ * NEWS: Update list of targets supporting --gc-sections.
+
+ * scripttempl/elf.sc: KEEP .eh_frame contents.
+ * scripttempl/elfd30v.sc: Same here.
+
+2000-06-18 Stephane Carrez <stcarrez@worldnet.fr>
+
+ * Makefile.am (ALL_EMULATIONS): Added new emulation for m68hc12
+ and m68hc11 (elf).
+ * Makefile.in: Rebuild.
+ * configure.tgt: Recognize m68hc12 and m68hc11.
+ * scripttempl/elfm68hc12.sc: New file.
+ * emulparams/m68hc12elfb: New emulation.
+ * emulparams/m68hc12elf: New emulation.
+ * emulparams/m68hc11elfb.sh: New file. User configurable emulation
+ (includes a memory.x script to define the ROM and RAM banks).
+ * scripttempl/elfm68hc11.sc, emulparams/m68hc11elf.sh:
+ New configuration files for support of Motorola 68hc11
+
+2000-06-15 Alan Modra <alan@linuxcare.com.au>
+
+ * ldmain.c (main): Only change SEC_READONLY for final link.
+
+2000-06-13 H.J. Lu <hjl@gnu.org>
+
+ * configure: Regenerate.
+
+2000-06-08 David O'Brien <obrien@FreeBSD.org>
+
+ * configure.in (VERSION): Update to show this is the CVS mainline.
+
+2000-06-07 Michael Sokolov <msokolov@ivan.Harhan.ORG>
+
+ * emultempl/mipsecoff.em (gld{EMULATION_NAME}_after_open): Require all
+ input objects to be ECOFF.
+ (check_sections): einfo takes %B, not %P, to print a BFD name.
+
+2000-06-05 Michael Matz <matz@ifh.de>
+
+ * ldgram.y (vers_defns): Handle 'extern "C++" { ... }' in
+ version scripts.
+
+ * ldlex.l (V_IDENTIFIER): Accept `::' in symbols.
+
+2000-05-23 Marek Michalkiewicz <marekm@linux.org.pl>
+
+ * emulparams/avr1200.sh (STACK): Define as 0.
+ * emulparams/avr23xx.sh (STACK): Define as last internal SRAM address.
+ * emulparams/avr4433.sh (STACK): Likewise.
+ * emulparams/avr44x4.sh (STACK): Likewise.
+ * emulparams/avr85xx.sh (STACK): Likewise.
+ * emulparams/avrmega103.sh (STACK): Likewise.
+ * emulparams/avrmega161.sh (STACK): Likewise.
+ * emulparams/avrmega603.sh (STACK): Likewise.
+ * scripttempl/elf32avr.sc (__data_start): Define for gcrt1.
+ (__stack): Define from ${STACK} for main().
+
+2000-05-26 Alan Modra <alan@linuxcare.com.au>
+
+ * Makefile.am: Update dependencies with "make dep-am"
+ * Makefile.in: Regenerate.
+
+2000-05-26 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * ldmain.c: Include filenames.h.
+ (set_scripts_dir): Support backslashes in program name.
+
+2000-05-22 Igor Shevlyakov <igor@windriver.com>
+
+ * ldmain.c (main): When deciding if ".text" section should be
+ read-only, don't forget to reset SEC_READONLY because it
+ could be already set.
+
+2000-05-22 Thomas de Lellis <tdel@windriver.com>
+
+ * ld.1: Add documentation for new command line option:
+ --section-start <sectionname>=<sectionorg>
+ This is a generic version of -Ttext etc. which accepts
+ any section name as a parameter instead of just text/data/
+ bss.
+ * ld.texinfo: More docs.
+ * NEWS: More docs.
+ * lexsup.c: (parse_args): Recognize new command line option.
+ (ld_options): Add new option.
+
+2000-05-18 H.J. Lu <hjl@gnu.org>
+
+ * lexsup.c (parse_args): `i' == `r', not `q'.
+
+2000-05-18 Jeffrey A Law (law@cygnus.com)
+
+ * configure.tgt (hppa*64*-*-*): Enable PA64 target.
+
+2000-05-17 S. Bharadwaj Yadavalli <sby@scrugs.lkg.dec.com>
+ Rick Gorton <gorton@scrugs.lkg.dec.com>
+
+ Add support for '-q' == '--emit-relocs' switch.
+ * ldmain.c (main): Default to false.
+ * lexsup.c (parse_args): Turn on emitrelocations flag if set.
+ * NEWS: Describe the emitrelocations switch.
+ * ld.texinfo: Describe the emitrelocations switch.
+
+2000-05-16 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * emultempl/pe.em (_open_dynamic_archive): New function: Search
+ the library path for "foo.dll" and "libfoo.dll" dynamic libraries
+ before searching for 'libfoo.a' in response to a '-Bdynamic -lfoo'
+ link options.
+
+2000-05-15 David O'Brien <obrien@FreeBSD.org>
+
+ * lexsup.c (parse_args): Update the year in the copyright notice.
+
+2000-05-13 Alan Modra <alan@linuxcare.com.au>
+
+ * ld.h (gettext, dgettext, dcgettext, textdomain, bindtextdomain):
+ Replace defines with those from intl/libgettext.h to quieten gcc
+ warnings.
+
+2000-05-10 H.J. Lu <hjl@gnu.org>
+
+ * ldlang.c (open_input_bfds): Don't load the same file within
+ a group again if the whole archive has been loaded already.
+
+2000-05-03 Alan Modra <alan@linuxcare.com.au>
+
+ From Ulf Carlsson <ulfc@engr.sgi.com> and Andreas Jaeger <aj@suse.de>
+ * lexsup.c (set_section_start): Use bfd_scan_vma rather than
+ strtoul.
+
+2000-05-01 Jim Wilson <wilson@cygnus.com>
+
+ * configure.host (ia64-*-linux-gnu*): Change gcc to ${CC}.
+
+ * configure.host: Added HOSTING_CRT0, HOSTING_LIBS for
+ host "ia64-*-linux-gnu*".
+
+2000-04-29 Andreas Jaeger <aj@suse.de>
+
+ * ld.h: Correctly check GCC version.
+
+2000-04-25 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.am: Add PA64 support. Add missing dependencies for
+ PA32 elf support.
+ * Makefile.in: Rebuilt.
+ * configure.tgt: Add PA64 support (currently disabled).
+
+2000-04-25 Alan Modra <alan@linuxcare.com.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_section): Delete.
+ (output_rel_find): New function.
+ (hold_section, hold_use): Delete.
+ (hold_text, hold_rodata, hold_data, hold_bss, hold_rel,
+ hold_interp): Make local to place_orphan.
+ (gld${EMULATION_NAME}_place_orphan): Use lang_output_section_find
+ rather than place_section to find possible previous use of orphan.
+ Similarly find the place-holder output sections. Use returned
+ value from lang_enter_output_section_statement rather than calling
+ lang_output_section_statement_lookup.
+ * emultempl/armelf.em: Same here.
+ * emultempl/pe.em: Similar to above, but no need for output_rel_find.
+
+ * ldlang.c (lang_enter_output_section_statement): Return output
+ section statement.
+ * ldlang.h (lang_enter_output_section_statement): Change
+ declaration too.
+
+ * ldlang.h (lang_output_section_statement): Export it.
+ * ldlang.c (lang_output_section_statement): Ditto.
+
+2000-04-24 Nick Clifton <nickc@cygnus.com>
+
+ * ld.texinfo (Output Section Data): Add note that section data
+ commands cannot appear outside of section directives.
+
+2000-04-2 Matthew Green <mrg@cygnus.com>
+
+ * configure.tgt: Add NetBSD/sparc ELF, and NetBSD/sparc64 support.
+
+2000-04-21 Richard Henderson <rth@cygnus.com>
+ David Mosberger <davidm@hpl.hp.com>
+
+ * Makefile.am (ALL_64_EMULATIONS): Add eelf64_ia64.o.
+ (eelf64_ia64.c): New rule.
+ * Makefile.in: Rebuild.
+ * configure.tgt (ia64-*-elf*, ia64-*-linux*): New targets.
+ * emulparams/elf64_ia64.sh: New file.
+
+2000-04-21 Richard Henderson <rth@cygnus.com>
+
+ * scripttempl/elfd30v.sc: Place .gcc_except_table.
+
+2000-04-19 Alan Modra <alan@linuxcare.com.au>
+
+ * dep-in.sed: Match space at start of file name, not at end.
+
+2000-04-18 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Call
+ lang_leave_output_section_statement () after calling
+ lang_enter_output_section_statement ().
+ * emultempl/armelf.em: Likewise.
+
+2000-04-18 Alan Modra <alan@linuxcare.com.au>
+
+ * emultempl/elf32.em (struct orphan_save): Add section field.
+ (gld${EMULATION_NAME}_place_orphan): Use above to keep sections in
+ better order, and place first orphan section as we did before the
+ 2000-04-12 patch. Ignore ~SEC_ALLOC sections when choosing place.
+ Don't call make_bfd_section here, let wild_doit do the job for us.
+ Don't build a statement list when we'll only throw it away.
+ * emultempl/armelf.em: Ditto.
+ * emultempl/pe.em: Similarly.
+
+2000-04-14 Geoff Keating <geoffk@cygnus.com>
+
+ * scripttempl/elfppc.sc: Remove.
+ * emulparams/elf32ppc.sh: Use elf.sc.
+ * emulparams/elf32lppc.sh: Use elf.sc.
+ * emulparams/elf32ppclinux.sh: Use elf.sc.
+ * emulparams/elf32ppcsim.sh: New file.
+ * emulparams/elf32lppcsim.sh: New file.
+ * Makefile.am: Update dependencies. Add elf32ppcsim ad elf32lppcsim.
+ (ALL_EMULATIONS): Add elf32ppcsim ad elf32lppcsim.
+ * Makefile.in: Regenerate.
+ * configure.tgt (powerpc-*): Add elf32ppcsim and elf32lppcsim.
+
+2000-04-14 Alan Modra <alan@linuxcare.com.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Process
+ ~SEC_ALLOC sections too. Init start address of debug sections.
+ * emultempl/armelf.em (gld${EMULATION_NAME}_place_orphan): Ditto.
+ * emultempl/pe.em (gld${EMULATION_NAME}_place_orphan): Ditto.
+ Also set all relocateable section start addresses.
+
+2000-04-13 Geoff Keating <geoffk@cygnus.com>
+
+ * scripttempl/elf.sc: Add support for .sbss2 and .sdata2 sections.
+ Add new BSS_PLT variable for when .plt need not be contained in
+ the file. Move _etext so that it is also after .fini, and provide
+ both etext and _etext with a leading underscore. Mark the start
+ and end of .sbss.
+
+2000-04-12 Alan Modra <alan@linuxcare.com.au>
+
+ * emultempl/elf32.em (struct orphan_save): New.
+ (hold_text, hold_rodata, hold_data, hold_bss, hold_rel,
+ hold_interp): Make them struct orphan_save.
+ (gld${EMULATION_NAME}_place_section): Modify for new hold_*.
+ (gld${EMULATION_NAME}_place_orphan): Add new orphan sections to
+ the end of the relevant section list. Also add associated section
+ statements to the end of any previous orphan statements.
+ * emultempl/armelf.em: Similarly.
+ * emultempl/pe.em: Similarly.
+
+2000-04-11 Alan Modra <alan@linuxcare.com.au>
+
+ * ld.texinfo (Simple Example): Remove extraneous paragraph.
+
+2000-04-07 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add
+ --enable-build-warnings option.
+ * Makefile.am (AM_CFLAGS, WARN_CFLAGS): Add definitions.
+ * Makefile.in, configure: Re-generate.
+
+2000-04-04 Alan Modra <alan@linuxcare.com.au>
+
+ * po/ld.pot: Regenerate.
+
+ * lexsup.c (help): Restore translated part of bug string.
+
+ * Makefile.am (MKDEP): Use gcc -MM rather than mkdep.
+ (DEP): Quote when passing vars to sub-make. Add warning message
+ to end.
+ (DEP1): Rewrite for "gcc -MM".
+ (CLEANFILES): Add DEP2.
+ Update dependencies.
+ * Makefile.in: Regenerate.
+
+2000-04-03 Alan Modra <alan@linuxcare.com.au>
+
+ * ld.h: #include "bin-bugs.h"
+ * lexsup.c (help): Use REPORT_BUGS_TO.
+
+2000-03-27 Denis Chertykov <denisc@overta.ru>
+
+ * configure.tgt (avr-*-*): New target support.
+ * Makefile.am: Likewise.
+ * scripttempl/elf32avr.sc: New script file.
+ * emulparams/avr1200.sh: New file.
+ * emulparams/avr23xx.sh: New file.
+ * emulparams/avr4433.sh New file.
+ * emulparams/avr44x4.sh New file.
+ * emulparams/avr85xx.sh New file.
+ * emulparams/avrmega103.sh New file.
+ * emulparams/avrmega161.sh New file.
+ * emulparams/avrmega603.sh New file.
+ * Makefile.in: Regenerate.
+
+2000-03-09 Andreas Jaeger <aj@suse.de>
+
+ * Makefile.am (check-DEJAGNU): Also unset LANG.
+ * Makefile.in: Rebuild.
+
+2000-03-06 Ian Lance Taylor <ian@zembu.com>
+
+ * ldfile.c (ldfile_try_open_bfd): Don't crash if we see an empty
+ archive.
+
+2000-03-02 H.J. Lu <hjl@gnu.org>
+
+ * emulparams/elf32mcore.sh: Include "getopt.h".
+
+2000-03-01 Ian Lance Taylor <ian@zembu.com>
+
+ * configure.tgt: Remove *-*-aout, *-*-coff, and *-*-netware.
+
+2000-03-01 H.J. Lu <hjl@gnu.org>
+
+ * emulparams/mipspe.sh: Add SUBSYSTEM and INITIAL_SYMBOL_CHAR.
+ * emulparams/shpe.sh: Likewise.
+
+2000-03-01 Nick Clifton <nickc@cygnus.com>
+
+ * pe-dll.c: Remove unused variables and add ATTRIBUTE_UNUSED
+ to unused parameters.
+
+ * emultempl/pe.em: Add "#ifdef DLL_SUPPORT" around static
+ functions only used by DLL code.
+ (_place_orphan): Initialise 'dollar'.
+
+2000-03-01 H.J. Lu <hjl@gnu.org>
+
+ * ldmain.c (undefined_symbol): Take one more arg, fatal, to
+ indicate if the undefined symbol is a fatal error or not.
+ Don't delete the output file if "fatal" is false.
+
+2000-02-29 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.am (check-DEJAGNU): Also pass LIBS="$(LIBS)".
+ Set LC_COLLATE and LC_ALL to null and export them. It is for
+ sort which expects the C locale.
+ Add $(LIBS) to all $(HOSTING_LIBS).
+ * Makefile.in: Rebuild.
+
+2000-02-29 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * emultempl/{aix.em, armcoff.em, armelf.em, armelf_oabi.em,
+ beos.em, elf32.em, generic.em, gld960.em, gld960c.em, hppaelf.em,
+ linux.em, lnk960.em, mipsecoff.em, sunos.em, vanilla.em}
+ (ld_emulation_xfer_struct): Add missing NULL initialiser for
+ find_potential_libraries.
+
+2000-02-28 Jim Blandy <jimb@redhat.com>
+
+ * ldgram.y (exclude_name_list): Don't require a comma to separate
+ list entries; the lexer considers commas to be valid part of a
+ filename, so in something like `foo, bar' the comma is considered
+ part of the first filename, `foo,'.
+ * ld.texinfo: Update section on EXCLUDE_FILE lists.
+
+2000-02-27 Loren J. Rittle <ljrittle@acm.org>
+
+ * configure.host: Added HOSTING_CRT0, HOSTING_LIBS for
+ host "i[3456]86-*-freebsdelf*".
+
+2000-02-27 Mark Elbrecht <snowball3@bigfoot.com>
+
+ * scripttempl/i386go32.sc: Move misplaced semicolons.
+
+2000-02-25 Ian Lance Taylor <ian@zembu.com>
+
+ * Makefile.am (ALL_EMULATIONS): Remove ehppaelf.o.
+ (ALL_64_EMULATIONS): Remove eelf64hppa.o.
+ (eelf64hppa.c, ehppaelf.c): Remove targets.
+ * Makefile.in: Rebuild.
+
+2000-02-25 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+
+ * configure.tgt (targ_extra_ofiles): Enable elf64_sparc on
+ GNU/Linux/sparc, but keep the default as 32.
+
+ * configure.tgt: Enable elf64_sparc on Solaris7+/sparc. And make
+ it default if sparcv9 or sparc64.
+
+2000-02-24 Nick Clifton <nickc@cygnus.com>
+
+ * Makefile.am: Add rules to build emipspe.o and earmpe.o.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Add targets for arm-wince, sh-pe and mips-pe.
+
+ * ldemul.h (ld_emulation_xfer_struct): Add new field:
+ find_potential_libraries.
+ * ldemul.c (ldemul_find_potential_libraries): New function.
+
+ * ldfile.c (ldfile_open_file_search): Allow function to be
+ exported.
+ (ldfile_open_file): Call ldemul_find_potential_libraries.
+ * ldfile.h: Add prototype for ldfile_open_file_search.
+
+ * pe-dll.c: Add support for ARM, MIPS and SH targets.
+
+ * emulparams/mipspe.sh: New file. Parameters for mips-pe target.
+ * emulparams/shpe.sh: New file. Parameters for sh-pe target.
+
+ * emultempl/pe.em: Add support for ARM, MIPS and SH DLLs.
+ (gld_X_find_potential_libraries): New function. Search for
+ libraries called "*.lib".
+
+ * scripttempl/pe.sc: Add .pdata section.
+
+2000-02-23 Richard Henderson <rth@cygnus.com>
+
+ * scripttempl/elfd10v.sc: Remove dynamic linking hooks.
+ Add and use memory regions.
+
+2000-02-23 Linas Vepstas (linas@linas.org)
+
+ * emulparams/elf32i370.sh, scripttempl/elfi370.sc: New.
+
+ * Makefile.am: Add support for Linux/IBM 370.
+ * configure.tgt: Likewise.
+
+ * Makefile.in: Regenerate.
+
+2000-02-21 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * ldlang.c (print_input_section, print_data_statement,
+ print_reloc_statement, print_padding_statement, insert_pad,
+ size_input_section, lang_check_section_addresses,
+ lang_size_sections, lang_do_assignments, lang_set_startof,
+ lang_one_common): Change `opb' to unsigned.
+ (lang_do_assignments): Also change `size' to unsigned.
+
+2000-02-16 Richard Henderson <rth@cygnus.com>
+
+ * scripttempl/elf.sc: Place OTHER_PLT_RELOC_SECTION.
+
+2000-02-16 Timothy Wall <twall@cygnus.com>
+
+ * mri.c (mri_draw_tree): Add default LMA region argument to call
+ to lang_leave_output_section_statement.
+ * ldlang.h: Update prototypes with LMA region arguments.
+ * ldlang.c (lang_size_sections): Encapsulate region bounds
+ checking in os_check_region call.
+ (os_check_region): New function.
+ (lang_output_section_statement_lookup): Initialize lma_region.
+ (lang_leave_output_section_statement): Add LMA region argument.
+ (lang_leave_overlay): Ditto.
+ * ldgram.y: Handle LMA region syntax.
+ * ld.texinfo (Output Section Description): Describe LMA region usage.
+ * emultempl/armelf.em (gld$place_orphan): Add default value for
+ lma region in call to lang_leave_output_section_statement.
+ * emultempl/elf32.em (gld$place_orphan): Add default value for
+ lma region in call to lang_leave_output_section_statement.
+ * emultempl/pe.em (gld$place_orphan): Add default value for
+ lma region in call to lang_leave_output_section_statement.
+
+
+2000-02-04 Timothy Wall <twall@redhat.com>
+
+ * ldlang.c (lang_check_section_addresses): Use bytes instead of
+ octets when calculating section end addresses.
+
+2000-02-04 Timothy Wall <twall@redhat.com>
+
+ * ldlang.c (lang_size_sections): Fix typo in ALIGN_N invocation.
+
+2000-02-03 Timothy Wall <twall@redhat.com>
+
+ * ldexp.c (fold_name): Make SIZEOF operator return byte count, not
+ octet count.
+ * ldlang.c (print_input_section, print_data_statement,
+ print_reloc_statement, print_padding_statement): Print target
+ address values and section sizes as bytes, not octets.
+ (insert_pad) Calculate padding size in octets, and adjust "dot"
+ by bytes.
+ (size_input_section) Always adjust "dot" by bytes, not octets.
+ (lang_check_section_addresses, lang_do_assignments) Adjust
+ "dot" by bytes, not octets. Use the larger of the directive size
+ or octets_per_byte for the number of octets actually allocated in
+ the output section.
+ (lang_set_startof) Make sure STARTOF returns a target address.
+ (lang_one_common) Record size changes in octets.
+ (lang_abs_symbol_at_end_of) Section end symbol's value is
+ recorded in target bytes.
+ * ld.texinfo: Updated description of BYTE, SHORT, LONG, etc.
+ to be clear about behavior when an octet is smaller than one byte.
+
+2000-01-27 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * ldcref.c (output_cref): Don't pass message strings to printf
+ as format arg.
+ Update copyright.
+
+ * ldmisc.c (vfinfo): Same here.
+ Update copyright.
+
+2000-01-23 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * emultempl/{armcoff.em,armelf.em,armelf_oabi.em,beos.em,
+ generic.em,gld960.em,gld960c.em,hppaelf.em,linux.em,lnk960.em,
+ mipsecoff.em,sunos.em,vanilla.em} (ld_emulation_xfer_struct):
+ Add missing NULL initialisers, and comments.
+
+2000-01-21 Nick Clifton <nickc@cygnus.com>
+
+ * ldlang.c (lang_size_sections): Fix typo in comment.
+
+2000-01-18 H.J. Lu <hjl@gnu.org>
+
+ * ldlang.c (lang_size_sections): Also update the current
+ address of a region if the SEC_NEVER_LOAD bit is not set.
+
+2000-01-10 Philip Blundell <pb@futuretv.com>
+
+ * configure.tgt (arm*-*-conix*): New target.
+
+2000-01-07 Nick Clifton <nickc@cygnus.com>
+
+ * ld.texinfo (Options): Remind users to preceed linker command
+ line switches with -Wl, (or whatever is appropriate) if it is
+ being invoked by a comnpiler driver program.
+ Fix description of the behaviour of the -n command line switch.
+
+2000-01-05 Catherine Moore <clm@cygnus.com>
+
+ * ld.h (wildcard_spec): Change exclude_name to exclude_name_list.
+ (name_list): New.
+ * ld.texinfo (EXCLUDE_FILE): Update documentation.
+ * ldgram.y (wildcard_spec): Support a list of excluded_files.
+ (exclude_name_list): New.
+ ldlang.c (walk_wild_section): Support list of excluded files.
+ (print_wild_statement): Likewise.
+ (lang_add_wild): Likewise.
+ * ldlang.h (lang_wild_statement_type): Likewise.
+ * scripttempl/elf.sc (OTHER_EXCLUDE_FILES): Support.
+
+2000-01-04 Mumit Khan <khan@xraylith.wisc.edu>
+
+ * pe-dll.c (pe_dll_warn_dup_exports): New variable.
+ (process_def_file): Use.
+ (pe_dll_compat_implib): New variable.
+ (make_one): Use.
+
+ * pe-dll.h: Add exports of pe_dll_warn_dup_exports and
+ pe_dll_compat_implib.
+
+ * emultempl/pe.em (longopts): Add warn-duplicate-exports and
+ compat-implib options.
+ (gld_${EMULATION_NAME}_list_options): List new options.
+ (gld_${EMULATION_NAME}_parse_args): Handle.
+
+ * pe-dll.c (pe_dll_generate_implib): Use the correct name for output
+ dll.
+
+ * deffilep.y (opt_name): Allow "." in name.
+
+For older changes see ChangeLog-9899
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/binutils/ld/ChangeLog-0203 b/contrib/binutils/ld/ChangeLog-0203
new file mode 100644
index 0000000..ee5354d
--- /dev/null
+++ b/contrib/binutils/ld/ChangeLog-0203
@@ -0,0 +1,3580 @@
+2003-12-19 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ Add m32r-linux and PIC support. Add new ABI that uses RELA.
+ * Makefile.am: Added em32rlelf.c, em32relf_linux.c,
+ em32rlelf_linux.c.
+ * Makefile.in: Regenerate.
+ * configure.tgt (m32r*-*-linux*, m32r*le-*-linux*, m32r*le-*-*):Added.
+ * emulparams/m32relf_linux.sh: Added.
+ * emulparams/m32rlelf.sh: Ditto.
+ * emulparams/m32rlelf_linux.sh: Ditto.
+ * NEWS: Mention support m32r Linux.
+
+2003-12-18 Eric Youngdale <eric@mkssoftware.com>
+ Nick Clifton <nickc@redhat.com>
+
+ * emultempl/pe.em (_after_open): When scanning MS import
+ libraries allow for the possible presence of static objects.
+
+2003-12-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ldlang.c (lang_vers_match): Pass "DMGL_PARAMS | DMGL_ANSI" to
+ cplus_demangle.
+
+2003-12-07 Kazu Hirata <kazu@cs.umass.edu>
+
+ * ldemul.c: Convert to ISO-C.
+ * ldver.c: Likewise.
+
+2003-12-06 Kazu Hirata <kazu@cs.umass.edu>
+
+ * lexsup.c (is_num): Remove.
+
+2003-12-05 Dmitry Semyonov <Dmitry.Semyonov@oktet.ru>
+
+ * pe-dll.c (generate_reloc): Remap ARM_26D relocation from 5 to
+ 0. This fixes "bad fixup" error generated by MS linker.
+
+2003-12-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ * emultempl/ia64elf.em (gld${EMULATION_NAME}_after_parse): Set
+ link_info.need_relax_finalize to TRUE.
+
+ * ldlang.c (lang_process): Use link_info.need_relax_finalize
+ instead of link_info.relax_finalizing.
+ * ldmain.c (main): Likewise.
+
+2003-12-04 Dmitry Semyonov <Dmitry.Semyonov@oktet.ru>
+
+ * armpe.sh (RELOCATEABLE_OUTPUT_FORMAT): Define.
+
+2003-12-04 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (lang_do_assignments): Function return is void.
+ * ldlang.h (lang_do_assignments): Ditto.
+ * emultempl/netbsd.em (gld${EMULATION_NAME}_before_parse): Declare.
+ * Makefile.am (ens32knbsd.c): Depend on netbsd.em.
+ * Makefile.in: Regenerate.
+
+2003-12-03 Dave Airlie <airlied@linux.ie>
+
+ * configure.tgt: Add vax-linux-gnu target.
+
+2003-12-03 Dmitry Diky <diwil@mail.ru>
+
+ * scripttempl/elf32msp430.sc (HEAP_SECTION_MSP430): New section for
+ forthcoming devices.
+ (_etext): provide this defenition for all scripts.
+
+2003-12-02 Kazu Hirata <kazu@cs.umass.edu>
+
+ * emultempl/beos.em: Remove ARGSUSED.
+
+2003-12-03 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/pe.em (pe_fixup_stdcalls): Update for renamed
+ bfd_link_hash_entry field "next" -> "und_next".
+ (pe_find_data_imports): Likewise.
+ (gld_${EMULATION_NAME}_after_open): Likewise.
+ * emultempl/sunos.em (before_allocation): Likewise.
+
+2003-12-02 Nick Clifton <nickc@redhat.com>
+
+ * ld.texinfo (Options): --ignore-all is no longer the default
+ behaviour for shared libraries and dynamic executables.
+
+2003-12-02 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.am: Run "make dep-am".
+ * Makefile.in: Regenerate.
+
+2003-12-02 Alan Modra <amodra@bigpond.net.au>
+
+ * ldmain.c (main): Remove mpc860c0 code.
+ * lexsup.c (enum option_values): Delete OPTION_MPC860C0.
+ (ld_options): Delete mpc860c0 entry.
+ (parse_args): Likewise.
+
+2003-12-01 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Test
+ hash table type rather than testing creator flavour.
+ * emultempl/hppaelf.em (hppaelf_create_output_section_statements):
+ Only create stub_file bfd if hash table creator is as expected.
+ (gld${EMULATION_NAME}_finish): Test stub_file.
+
+2003-11-28 Marcel Moolenaar <marcel@xcllnt.net>
+
+ * emulparams/elf64_ia64_fbsd.sh (TEXT_START_ADDR): Define.
+ (DATA_ADDR): Unset.
+
+2003-11-18 James E Wilson <wilson@specifixinc.com>
+
+ * ldlang.c (lang_process): Move lang_reset_memory_regions call after
+ lang_do_assignments call.
+
+ * emulparams/elf64_ia64.sh (OTHER_PLT_RELOC_SECTIONS): Include
+ .rela.opd if -pie.
+
+2003-11-10 Jonathan Wilson <jonwil@tpgi.com.au>
+
+ * scripttempl/pe.sc: Add support for TLS sections.
+
+2003-11-09 Alan Modra <amodra@bigpond.net.au>
+
+ * configure.host (HOSTING_LIBS): Group libgcc and libc with
+ --start-group, --end-group pair.
+ (*-*-netbsd*, am33_2.0-*-linux*): Use the default HOSTING_LIBS.
+ (am33_2.0-*-linux*): Edit default HOSTING_CRT0.
+ (arm*-*-linux-gnu*): Remove extraneous '*' in sed expression.
+ (hppa*64*-*-linux*, hppa*-*-linux*): Remove target specific case.
+
+2003-11-07 Jonathan R. Grant <jg-binutils@jguk.org>
+
+ * ldfile.c (ldfile_open_file): Use "No such file" error message.
+
+2003-11-06 Bruno Rohee <bruno@rohee.com>
+
+ * ls.texinfo: Fix "the the" typo.
+
+2003-11-05 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/pe.em (gld_${EMULATION_NAME}_after_open): Only do
+ pe_dll_extra_pe_debug stuff when DLL_SUPPORT defined.
+ (pr_sym): Move inside #ifdef DLL_SUPPORT.
+
+ * emultempl/ppc64elf.em (gld${EMULATION_NAME}_new_vers_pattern): Zap
+ unused variable.
+
+ * emulparams/elf32_i860.sh (TEXT_START_ADDR): Define.
+
+2003-11-04 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Call
+ _bfd_elf_tls_setup.
+
+2003-10-31 Nick Clifton <nickc@redhat.com>
+
+ * ldlang.c (lookup_name): When looking for a previously loaded
+ file compare the local_sym_name not the filename, as the
+ filename might have been transformed via the search directory
+ path lookup.
+ If the sought-for file has not been found in the input file
+ chain then create a new node with the search_dirs_flag set so
+ that the entire set of directory paths will be scanned for it.
+
+2003-10-30 Andrew Cagney <cagney@redhat.com>
+
+ * emultempl/pe.em, pe-dll.c: Replace "struct symbol_cache_entry"
+ with "struct bfd_symbol".
+
+2003-10-30 Phil Edwards <phil@codesourcery.com>
+
+ * Makefile.am (ALL_EMULATIONS): Add elf32mipswindiss.o.
+ (eelf32mipswindiss.c): New target.
+ * Makefile.in: Regenerated.
+ * emulparams/elf32mipswindiss.sh: New file.
+ * configure.tgt (i[3-7]86-*-vxworks*, arm-*-vxworks, sh-*-vxworks,
+ mips*-*-vxworks*): Use ELF now.
+ (mips*-*-windiss): New stanza, use elf32mipswindiss.
+
+2003-10-27 Stephane Carrez <stcarrez@nerim.fr>
+
+ * scripttempl/elfm68hc12.sc: Define eeprom memory region.
+
+2003-10-25 Kazu Hirata <kazu@cs.umass.edu>
+
+ * ChangeLog-9197: Fix typos.
+ * NEWS: Likewise.
+ * ld.texinfo: Likewise.
+ * ldlang.c: Fix comment typos.
+
+2003-10-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ldlang.c (lang_vers_match): Fix a typo.
+
+2003-10-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ldlang.c (lang_vers_match): Check demangled symbols.
+
+2003-10-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ldlang.c (lang_vers_match): Check "symbol" instead of
+ "wildcard" and "pattern". Fix a typo.
+ (lang_finalize_version_expr_head): Likewise.
+ (lang_register_vers_node): Likewise.
+ (realsymbol): New function.
+ (lang_new_vers_pattern): Set "symbol" and remove "wildcard".
+
+ * ldlex.l (V_IDENTIFIER): Allow '\\'.
+
+2003-10-24 Nick Clifton <nickc@redhat.com>
+
+ * emultempl/m68hc1xelf.em (before_allocation): Add missing second
+ parameter to lang_memory_region_lookup.
+
+2003-10-22 Jakub Jelinek <jakub@redhat.com>
+
+ * ldlang.c: Include hashtab.h.
+ (lang_vers_match_lang_c, lang_vers_match_lang_cplusplus,
+ lang_vers_match_lang_java): Remove.
+ (lang_vers_match): New function.
+ (lang_new_vers_pattern): Initialize wildcard and mask
+ fields, don't initialize match.
+ (lang_new_vers_node): Use xcalloc. Adjust for globals and
+ locals field type changes. Set match field.
+ (version_expr_head_hash, version_expr_head_eq): New functions.
+ (lang_finalize_version_expr_head): New function.
+ (lang_register_vers_node): Call lang_finalize_version_expr_head.
+ Search in hash table if not wildcard when looking for duplicates.
+ * emultempl/ppc64elf.em (new_vers_pattern): Don't bother with
+ duplicate checking. Initialize all fields of dot_entry from entry
+ with the exception of pattern and next.
+
+2003-10-21 Nick Clifton <nickc@redhat.com>
+
+ * ldlang.c (lang_memory_region_lookup): Add second parameter -
+ create - which is true if the region is being created. Issue
+ appropriate warning messages for finding and not finding
+ already created regions.
+ (lang_memory_default): Use DEFAULT_MEMORY_REGION.
+ (lang_leave_overlay_section): Likewise.
+ (lang_size_sections_1): Likewise.
+ Pass second parameter to lang_memory_region_lookup.
+ (lang_get_regions): Likewise.
+ * ldlang.h (DEFAULT_MEMORY_REGION): Define.
+ Update prototype for lang_memory_region_lookup.
+ * ldgram.y: Pass second parameter to lang_memory_region_lookup.
+ Use DEFAULT_MEMORY_REGION instead of "*default".
+
+2003-10-20 Andrew Cagney <cagney@redhat.com>
+
+ * pe-dll.c: Replace "struct sec" with "struct bfd_section".
+
+2003-10-19 Marek Michalkiewicz <marekm@amelek.gda.pl>
+
+ * Makefile.am: Remove old (before GCC 3.3) emulations for AVR
+ target: avr1200, avr23xx, avr4433, avr44x4, avr85xx, avrmega103,
+ avrmega161, avrmega603. Default to avr2.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Likewise.
+ * emulparams/avr1200.sh: Remove.
+ * emulparams/avr23xx.sh: Remove.
+ * emulparams/avr4433.sh: Remove.
+ * emulparams/avr44x4.sh: Remove.
+ * emulparams/avr85xx.sh: Remove.
+ * emulparams/avrmega103.sh: Remove.
+ * emulparams/avrmega161.sh: Remove.
+ * emulparams/avrmega603.sh: Remove.
+ * scripttempl/elf32avr.sc: Remove.
+
+2003-10-19 Andreas Schwab <schwab@suse.de>
+
+ * emultempl/ticoff.em (gld_${EMULATION_NAME}_list_options): Add
+ newline to message.
+
+ * deffilep.y: Remove commas from %token lines.
+
+2003-10-18 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * emultempl/mmix-elfnmmo.em (mmix_before_allocation): Force linker
+ relaxation always; don't exclude relocatable linking. Adjust for
+ _bfd_mmix_prepare_linker_allocated_gregs renamed to
+ _bfd_mmix_before_linker_allocation.
+ (mmix_after_allocation): Adjust for
+ _bfd_mmix_finalize_linker_allocated_gregs renamed to
+ _bfd_mmix_after_linker_allocation.
+ * scripttempl/mmo.sc: Use ADDR (.text), not . - SIZEOF (.text).
+
+ * ldlang.c (lang_size_sections): Last, set _cooked_size for output
+ sections.
+
+2003-10-16 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.am (GENSCRIPTS_EXTRA, GEN_EXTRA_DEPENDS): Remove. Use
+ GENSCRIPTS and GEN_DEPENDS in place of these.
+ * Makefile.in: Regenerate.
+ * genscripts_extra.sh: Delete. Merge extra functionality to..
+ * genscripts.sh: ..here.
+
+ * emulparams/gld960.sh (TEXT_START_ADDR, TARGET_PAGE_SIZE): Define.
+ * emulparams/gld960coff.sh (TEXT_START_ADDR, TARGET_PAGE_SIZE): Ditto.
+ * emulparams/lnk960.sh (TEXT_START_ADDR, TARGET_PAGE_SIZE): Ditto.
+ * emulparams/m88kbcs.sh (TEXT_START_ADDR, TARGET_PAGE_SIZE): Ditto.
+ * emulparams/vanilla.sh (TEXT_START_ADDR, TARGET_PAGE_SIZE): Ditto.
+
+2003-10-16 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/ia64elf.em (gld${EMULATION_NAME}_after_parse): Don't
+ use $EMULATION_NAME to call bfd function.
+
+2003-10-14 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * pe-dll.c (pe_implied_import_dll): Also scan .rdata sections
+ to identify data symbols.
+
+2003-10-13 Richard Sandiford <rsandifo@redhat.com>
+
+ * emulparams/elf32bmipn32-defs.sh (INITIAL_READONLY_SECTIONS): Move
+ definition from elf64btsmip.sh.
+ (TEXT_DYNAMIC): Likewise elf32btsmipn32.sh.
+ * emulparams/elf32btsmipn32.sh (TEXT_DYNAMIC): Remove.
+ * emulparams/elf64btsmip.sh (INITIAL_READONLY_SECTIONS): Remove.
+ * emulparams/elf64bmip.sh (SHLIB_TEXT_START_ADDR): Define.
+ (EXECUTABLE_SYMBOLS): Set __elf_header correctly for shared objects.
+ Define __program_header_table in terms of __elf_header.
+
+2003-10-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ * Makefile.am (eelf64_ia64.c): Also depend on
+ $(srcdir)/emultempl/ia64elf.em.
+ * Makefile.in: Regenerated.
+
+ * emulparams/elf64_ia64.sh (EXTRA_EM_FILE): Set to ia64elf.
+
+ * emultempl/ia64elf.em: New.
+
+2003-10-12 Kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * emulparams/shelf32_nbsd.sh (OTHER_SECTIONS): Redefine.
+
+2003-10-11 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * ld.texinfo (Builtin Functions) <DEFINED>: Say that only symbols
+ defined before the statement using DEFINED yield 1.
+ * ldexp.c (fold_name) <case DEFINED>: In lang_first_phase_enum,
+ call lang_track_definedness on symbol. In subsequent phases, use
+ lang_symbol_definition_iteration and lang_statement_iteration to
+ check whether the symbol was defined before the current statement.
+ (exp_fold_tree) <case etree_assign et al>: Call
+ lang_update_definedness before updating symbol type when setting
+ symbol.
+ * ldlang.c (lang_definedness_table): New variable.
+ (lang_definedness_newfunc, lang_track_definedness)
+ (lang_symbol_definition_iteration, lang_update_definedness): New
+ functions.
+ (lang_init): Initialize lang_definedness_table and
+ lang_statement_iteration.
+ (lang_finish): Destroy bfd_hash_table_free.
+ (lang_size_sections): Increment lang_statement_iteration.
+ (lang_do_assignments_1): New function with former
+ lang_do_assignments contents. Change recursive calls to call this
+ function.
+ (lang_do_assignments): Evacuate contents. Increment
+ lang_statement_iteration, then just call lang_do_assignments_1.
+ * ldlang.h (struct lang_definedness_hash_entry)
+ (lang_statement_iteration, lang_track_definedness)
+ (lang_symbol_definition_iteration, lang_update_definedness):
+ Declare.
+
+2003-10-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ * scripttempl/elf.sc (__executable_start): Provide.
+
+2003-10-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * emulparams/armelf.sh: Define NO_SMALL_DATA.
+ * emulparams/armelf_linux.sh, emulparams/armelf_oabi.sh,
+ emulparams/armnto.sh: Likewise.
+
+2003-10-08 Alexandre Oliva <aoliva@redhat.com>
+
+ * ldlang.c (lang_size_sections_1): Use IGNORE_SECTION to tell
+ whether to skip test for no memory region.
+
+2003-10-08 Nick Clifton <nickc@redhat.com>
+
+ * lexsup.c (parse_args: OPTION_CALL_SHARED): Revise comment
+ describing defaults. Change default to report unresolved symbols
+ in object files as well.
+
+2003-10-08 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * ldexp.c (fold_name) <case DEFINED>: Set section of result to
+ abs_output_section.
+
+2003-10-07 Bob Wilson <bob.wilson@acm.org>
+
+ * emulparams/elf32xtensa.sh (OTHER_READONLY_SECTIONS,
+ OTHER_READWRITE_SECTIONS, OTHER_SECTIONS): Set section addresses to
+ zero for relocatable links.
+
+2003-10-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * configure.host (HOSTING_LIBS): Define for hppa*-*-linux*.
+
+2003-10-07 Nathan Sidwell <nathan@codesourcery.com>
+
+ * ldwrite.c (unsplittable_name): New.
+ (clone_section): Strip existing numeric suffix. Only truncate names
+ for coff targets.
+ (split_sections): Use unsplittable_name.
+
+2003-10-06 Nick Clifton <nickc@redhat.com>
+
+ * lexsup.c (parse_args): Report unresolved symbols in shared
+ libraries when creating a dynamic executable. This is a
+ restoration of the default behaviour for previous versions of
+ the linker.
+
+2003-10-06 Matt Thomas <matt@3am-software.com>
+
+ * emulparams/hppanbsd.sh: Remove OUTPUT_FORMAT.
+ * emulparams/hppaobsd.sh: Add OUTPUT_FORMAT="elf32-hppa".
+
+2003-10-06 Robert Millan <robertmh@gnu.org>
+
+ * configure.tgt: Match GNU/KNetBSD with new knetbsd*-gnu triplet.
+
+2003-10-02 Ivan Warren <ivan@vmfacility.fr>
+
+ * pe-dll.c (make_one): Correct sym def order & pick right sym for
+ .idata$7 reloc.
+
+2003-09-30 Chris Demetriou <cgd@broadcom.com>
+
+ * NEWS: Add an indication of the cutoff for 2.14.
+
+2003-09-30 Chris Demetriou <cgd@broadcom.com>
+
+ * ldmain.c (get_emulation): Ignore "-mips64r2".
+
+2003-09-03 Robert Millan <robertmh@gnu.org>
+
+ * configure.host: Match GNU/KFreeBSD with new kfreebsd*-gnu
+ triplet.
+ * configure.tgt: Likewise.
+
+2003-08-29 Jafa <jafa@silicondust.com>
+
+ * emulparams/elf32ip2k.sh (TEMPLATE_NAME): Define.
+
+2003-08-21 Nick Clifton <nickc@redhat.com>
+
+ * po/tr.po: Updated Turkish translation.
+
+2003-08-20 Nick Clifton <nickc@redhat.com>
+
+ * ldmain.c: Initialise the new fields in bfd_link_info to
+ NOT_YET_SET.
+ * lexsup.c (enum option_values): New enum. Use this to
+ replace the hand coded values for the long switch options.
+ (ld_options): Add 'unresolved-symbols',
+ 'warn-unresolved-symbols' and 'error-unresolved-symbols'.
+ (parse_args): Handle the new switches. Set the values of
+ unresolved_symbols_in_objects and
+ unresolved_symbols_in_shared_libs appropriately. If they were
+ not initialised by the command line, install default values.
+ * emultempl/elf32.em (handle_option): Update OPTION_GROUP and
+ -z defs to use the new fields in bfd_link_info.
+ * ld.texinfo: Document the new switches.
+ * NEWS: Mention this feature.
+
+2003-08-15 Dmitry Diky <diwil@mail.ru>
+
+ * Makefile.am (GENSCRIPTS_EXTRA): New script definition which
+ calls genscripts_extra.sh.
+ Rearrange all msp430 depends using this script.
+ * Makefile.in: Regenerate.
+ * genscripts_extra.sh: New file: Similar to genscripts.sh, except
+ that the script to be run to generate the emulations can be passed
+ as an optional parameter instead of being computed from the
+ emulation name.
+ * emulparams/msp430all.sh: New file: Combine all msp430 subdevice
+ definitions into one file.
+ * emulparams/msp430x*.sh: Removed.
+
+2003-08-15 Nick Clifton <nickc@redhat.com>
+
+ * ld.texinfo (Options): Put keywords for the -z option into a
+ table. Add more text describing what the -z now option does.
+
+2003-08-14 Alan Modra <amodra@bigpond.net.au>
+
+ * dep-in.sed: Remove libintl.h.
+ * Makefile.am (POTFILES.in): Unset LC_COLLATE.
+ * Makefile.in: Regenerate.
+
+2003-08-13 Alan Modra <amodra@bigpond.net.au>
+
+ * genscripts.sh (libpath.exp): Only generate for first emulation.
+ (LIB_PATH): Correct order of paths. Don't add $tool_lib when
+ already present or when LIB_PATH is set to ":".
+
+2003-08-12 Ian Lance Taylor <ian@airs.com>
+
+ * ldmain.c (undefined_symbol): Change parameter name from `fatal'
+ to `error'. If only a warning, put warning in the reported
+ string. Consistently set failure flag when not a warning.
+
+2003-08-08 Dmitry Diky <diwil@mail.ru>
+
+ * Makefile.am: Add xW42 and xE42 parts. Sort MPU list according to
+ gcc order.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Add extra emulations.
+ * emulparams/msp430xE423.sh: New file.
+ * emulparams/msp430xE427.sh: New file.
+ * emulparams/msp430xW425.sh: New file.
+ * emulparams/msp430xE425.sh: New file.
+ * emulparams/msp430xW423.sh: New file.
+ * emulparams/msp430xW427.sh: New file.
+
+2003-08-07 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * emultempl/pe.em (gld_${EMULATION_NAME}_before_parse):
+ Change second (cmdline) arg to lang_add_entry to FALSE.
+ (set_pe_subsystem): Change second arg to lang_add_entry to TRUE.
+
+2003-08-05 Christian Groessler <chris@groessler.org>
+ Jason Eckhardt <jle@rice.edu>
+
+ * configure.tgt: Recognize new target i860-*-coff.
+ * Makefile.am (ALL_EMULATIONS): Add ecoff_i860.o.
+ (ecoff_i860.c): New rule.
+ * emulparams/coff_i860.sh: New file.
+ * scripttempl/i860coff.sc: New file.
+ * Makefile.in: Regenerate.
+
+2003-08-04 Nick Clifton <nickc@redhat.com>
+
+ * emultempl/elf32.em (before_allocation): Prepend "warning: "
+ to messages produced for .gnu.warning.SYMBOL sections.
+
+2003-08-04 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em (output_rel_find): Add "isdyn" param. Put
+ .rel.dyn before other reloc sections. Don't stop looking for reloc
+ sections on finding one that isn't allocated. Match .rel even when
+ placing .rela and vice versa, when setting last_rel and
+ last_rel_alloc for the first time. If no reloc sections in script,
+ prefer allocated section over non-alloc.
+ (gld${EMULATION_NAME}_place_orphan): Handle orphan .rel.dyn.
+
+2003-07-29 Kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * emulparams/shelf.sh (OTHER_SECTIONS): Don't include .stack
+ section for shared library.
+ * emulparams/shelf32.sh (OTHER_SECTIONS): Likewise.
+ * emulparams/shelf64.sh (OTHER_SECTIONS): Likewise.
+
+2003-07-29 Stephane Carrez <stcarrez@nerim.fr>
+
+ * scripttempl/elfm68hc12.sc: Add gcc_except_table.
+ * scripttempl/elfm68hc11.sc: Likewise.
+
+2003-07-28 Alan Modra <amodra@bigpond.net.au>
+
+ * emulparams/elf64ppc.sh (GOT): Fix for shell brace matching.
+
+ * emulparams/elf64ppc.sh (GOT): Don't merge .toc into .got for ld -r.
+
+2003-07-27 Alan Modra <amodra@bigpond.net.au>
+
+ * ld.texinfo: Typo fixes. Document SUBALIGN.
+ * ldgram.y (opt_subalign): Add.
+ * ldlex.l (SUBALIGN): Recognize.
+ * ldlang.c (overlay_subalign): New var.
+ (lang_enter_overlay): Add subalign param.
+ (lang_enter_overlay_section): Pass overlay_subalign to
+ lang_enter_output_section_statement.
+ * ldlang.h (lang_enter_overlay): Update.
+
+2003-07-24 Nick Clifton <nickc@redhat.com>
+
+ * po/fr.po: Updated French translation.
+
+2003-07-23 Stephane Carrez <stcarrez@nerim.fr>
+
+ * scripttempl/elfm68hc11.sc: Keep ctor/dtor sections; Take into
+ account .tramp sections;
+ * scripttempl/elfm68hc12.sc: Likewise.
+
+2003-07-17 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * ld/pe-dll.c: Add libcygwin to autofilter_liblist[]
+
+2003-07-17 Nick Clifton <nickc@redhat.com>
+
+ * po/es.po: New Spanish translation.
+
+2003-07-11 Alan Modra <amodra@bigpond.net.au>
+
+ * po/ld.pot: Regenerate.
+
+2003-07-10 Bob Wilson <bob.wilson@acm.org>
+
+ * emulparams/elf32xtensa.sh (OTHER_READONLY_SECTIONS): Replace .xt.lit
+ with new .got.loc section.
+ (OTHER_READWRITE_SECTIONS): Do not combine linkonce sections for
+ non-relocating links.
+ (OTHER_SECTIONS): Add .xt.lit here. Change it to keep linkonce
+ sections separate for non-relocating links; likewise for .xt.insn.
+
+2003-07-10 Alexandre Oliva <aoliva@redhat.com>
+
+ 2001-08-22 Alexandre Oliva <aoliva@redhat.com>
+ * emulparams/elf32am33lin.sh: Adjust to match kernel parameters.
+ 2001-05-09 Alexandre Oliva <aoliva@redhat.com>
+ * configure.host (am33_2.0-*-linux*): Added.
+ * configure.tgt (am33_2.0-*-linux*): Likewise.
+ * emulparams/elf32am33lin.sh: New.
+ * Makefile.am (eelf32am33lin.c): New rule.
+ * Makefile.in: Rebuilt.
+
+2003-07-09 Alexandre Oliva <aoliva@redhat.com>
+
+ 2001-04-17 Alexandre Oliva <aoliva@redhat.com>
+ * emulparams/mn10300.sh (TEMPLATE_NAME): Define.
+ (GENERATE_SHLIB_SCRIPT): Likewise.
+
+2003-07-10 Alan Modra <amodra@bigpond.net.au>
+
+ * emulparams/elf64ppc.sh (OTHER_GOT_SECTIONS): Don't define.
+ (GOT): Define.
+ * emultempl/ppc64elf.em (stub_added): New static var.
+ (ppc_create_output_section_statements): Call ppc64_elf_init_stub_bfd.
+ (ppc_add_stub_section): Set stub_added.
+ (gld${EMULATION_NAME}_finish): Look for .got rather than .toc. Adjust
+ ppc64_elf_size_stubs call and test for stubs.
+ * scripttempl/elf.sc (GOT): Define and use.
+
+2003-07-08 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_after_allocation):
+ Allow second call from ldemul_finish.
+
+2003-07-04 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * emulparams/shelf32.sh (STACK_ADDR): Don't define.
+ (OTHER_SECTIONS): Include .stack.
+ * emulparams/shelf64.sh (OTHER_SECTIONS): Likewise.
+
+2003-07-02 Jakub Jelinek <jakub@redhat.com>
+
+ * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Don't include
+ .opd if -pie.
+ (OTHER_READWRITE_SECTIONS): Include .opd if -pie.
+ * scripttempl/elf.sc: Use SHLIB_DATA_ADDR instead of DATA_ADDR
+ if -pie.
+
+2003-06-28 Alan Modra <amodra@bigpond.net.au>
+
+ * ld.h: Convert to C90, remove unnecessary prototypes and casts.
+ Replace PTR with void *. Formatting.
+ * ldcref.c: Likewise.
+ * ldctor.c: Likewise.
+ * ldctor.h: Likewise.
+ * ldemul.h: Likewise.
+ * ldexp.c: Likewise.
+ * ldexp.h: Likewise.
+ * ldfile.c: Likewise.
+ * ldfile.h: Likewise.
+ * ldlang.c: Likewise.
+ * ldlang.h: Likewise.
+ * ldlex.h: Likewise.
+ * ldlex.l: Likewise.
+ * ldmain.c: Likewise.
+ * ldmain.h: Likewise.
+ * ldmisc.c: Likewise.
+ * ldmisc.h: Likewise.
+ * ldver.h: Likewise.
+ * ldwrite.c: Likewise.
+ * ldwrite.h: Likewise.
+ * lexsup.c: Likewise.
+ * mri.c: Likewise.
+ * mri.h: Likewise.
+ * pe-dll.c: Likewise.
+ * pe-dll.h: Likewise.
+ * deffilep.y: Likewise.
+ * deffile.h: Likewise. Don't include ansidecl.h.
+ * emulparams/elf32mcore.sh: Remove unnecessary cast.
+ * emultempl/m68kcoff.em: Likewise.
+ * emultempl/m68kelf.em: Likewise.
+ * emultempl/ticoff.em: Remove lang_add_output_format declaration.
+ * sysdep.h: Don't include ansidecl.h.
+ * Makefile.am: Run "make dep-am".
+ * Makefile.in: Regenerate.
+
+2003-06-27 Nick Clifton <nickc@redhat.com>
+
+ * deffilep.y (def_file_add_directive): Cope with NUL seperated
+ directives. Fix reporting of unparseable directives.
+ (def_error): Check for a NULL def_filename.
+
+2003-06-27 Alan Modra <amodra@bigpond.net.au>
+
+ * 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-25 Alan Modra <amodra@bigpond.net.au>
+
+ * ld.texinfo: Correct spelling of "relocatable".
+ * ldctor.c: Likewise.
+ * ldexp.c: Likewise.
+ * ldfile.c: Likewise.
+ * ldint.texinfo: Likewise.
+ * ldlang.c: Likewise.
+ * ldmain.c: Likewise.
+ * ldwrite.c: Likewise.
+ * lexsup.c: Likewise.
+ * emultempl/aix.em: Likewise.
+ * emultempl/alphaelf.em: Likewise.
+ * emultempl/armcoff.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/mmo.em: Likewise.
+ * emultempl/needrelax.em: Likewise.
+ * emultempl/pe.em: Likewise.
+ * emultempl/ppc64elf.em: Likewise.
+ * emultempl/sh64elf.em: Likewise.
+ * emultempl/sunos.em: Likewise.
+ * emultempl/ticoff.em: Likewise.
+ * emultempl/xtensaelf.em: Likewise.
+
+2003-06-24 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/ppc32elf.em: Convert to C90.
+
+2003-06-20 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/ppc64elf.em: Convert to C90 function definitions, remove
+ unnecessary prototypes and casts.
+
+2003-06-19 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Dump out
+ statistics from ppc64_elf_build_stubs.
+
+2003-06-19 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/ppc64elf.em (build_section_lists): Check return status
+ from ppc64_elf_next_input_section.
+
+2003-06-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ldlang.c (section_already_linked): Put back assignment of
+ kept_section.
+
+2003-06-17 Rainer Keuchel <rkeuchel@allgeier.com>
+
+ * pe-dll.c (generate_reloc): Catch and ignore an ARM_26D
+ reloc.
+
+2003-06-17 Loren James Rittle <rittle@latour.rsch.comm.mot.com>
+
+ * configure.host (*-*-freebsd*): Add known path for ld-elf.so.1
+ if not produced by gcc.
+
+2003-06-16 Hans-Peter Nilsson <hp@axis.com>
+
+ * configure.tgt: Add specific case for cris-*-linux-gnu*
+ with crislinux emulation only.
+
+2003-06-13 Robert Millan <zeratul2@wanadoo.es>
+
+ * configure.tgt: Add i386-netbsd-gnu target.
+
+2003-06-12 Richard Sandiford <rsandifo@redhat.com>
+
+ * configure.tgt (mips*-sgi-irix6*): Add the o32 and n64 emulations
+ to $targ_extra_libpath.
+
+2003-06-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ * po/Make-in (DESTDIR): New.
+ (install-data-yes): Support $(DESTDIR).
+ (uninstall): Likewise.
+
+2003-06-10 Doug Evans <dje@sebabeach.org>
+
+ * Makefile.am (ALL_EMULATIONS): Add em32relf.o.
+ * Makefile.in: Regenerate.
+
+2003-06-10 Richard Sandiford <rsandifo@redhat.com>
+
+ * configure.tgt (h8300*): Add h8300sxn emulations.
+ * Makefile.am (ALL_EMULATIONS): Add eh8300sxn.o and eh8300sxnelf.o.
+ (eh8300sxn.c, eh8300sxnelf.c): New rules.
+ * Makefile.in: Regenerate.
+ * emulparams/h8300sxnelf.sh, emulparams/h8300sxn.sh: New files.
+ * scripttempl/h8300sxn.sc: New file.
+
+2003-06-10 Alan Modra <amodra@bigpond.net.au>
+
+ * emulparams/elf64ppc.sh (EXECUTABLE_SYMBOLS, OTHER_BSS_END_SYMBOLS,
+ CTOR_START, CTOR_END, DTOR_START, DTOR_END): Don't define.
+
+2003-06-08 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/ppc64elf.em (emit_stub_syms, toc_section): New vars.
+ (build_toc_list): New function.
+ (gld${EMULATION_NAME}_finish): Call build_toc_list and
+ ppc64_elf_reinit_toc. Adjust ppc64_elf_build_stubs call.
+ (OPTION_STUBSYMS): Define.
+ (PARSE_AND_LIST_LONGOPTS): Add emit-stub-syms.
+ (PARSE_AND_LIST_OPTIONS): Document.
+ (PARSE_AND_LIST_ARGS_CASES): Handle.
+
+2003-06-05 Roland McGrath <roland@redhat.com>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_list_options): Remove
+ extra \t in -z noexecstack line.
+
+2003-05-23 Jakub Jelinek <jakub@redhat.com>
+
+ * ldgram.y (phdr_type): Grok PT_GNU_STACK.
+ * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Add
+ -z execstack and -z noexecstack.
+ (gld${EMULATION_NAME}_list_options): Likewise.
+ * scripttempl/elf.sc: If not -r, discard .note.GNU-stack section.
+
+2003-06-03 Michael Snyder <msnyder@redhat.com>
+ and Bernd Schmidt <bernds@redhat.com>
+ and Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.am: Add new emulations for h8300sx.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Add new emulations.
+ * emulparams/h8300sx.sh: New emulation.
+ * emulparams/h8300sxelf.sh: Ditto.
+ * scripttempl/h8300sx.sc: Ditto.
+
+2003-06-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ldmisc.c: Include "bfdlink.h".
+ (error_handler): Handle LD_DEFINITION_IN_DISCARDED_SECTION
+ and -LD_DEFINITION_IN_DISCARDED_SECTION.
+
+ * Makefile.am: Rebuild dependency.
+ * Makefile.in: Regenerated.
+
+2003-06-03 Kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * emulparams/shlelf_linux.sh (GENERATE_PIE_SCRIPT): Set to yes.
+ * emulparams/shlelf32_linux.sh (GENERATE_PIE_SCRIPT): Likewize.
+
+2003-06-02 Fabrizio Gennari <fabrizio.ge@tiscalinet.it>
+
+ * pe-dll.c (fill_edata): Scan table pe_dll->exports, which is
+ sorted alphabetically, instead of exported_symbols, which is
+ sorted by ordinal.
+
+2003-05-30 Ulrich Drepper <drepper@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * lexsup.c (OPTION_PIE): Define.
+ (ld_options): Add -pie and --pic-executable options.
+ (parse_args): Handle OPTION_PIE.
+ * ldmain.c (main): Initialize link_info.pie and
+ link_info.executable.
+ * genscripts.sh: Generate PIE scripts.
+ * ld.texinfo: Document -pie and --pic-executable options.
+ * emultempl/elf32.em (gld${EMULATION_NAME}_after_open):
+ (gld${EMULATION_NAME}_place_orphan): Likewise.
+ (gld${EMULATION_NAME}_get_script): Include PIE scripts.
+ * scripttempl/elf.sc: In PIE scripts set . the same way as in
+ shared scripts.
+ * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Set to yes.
+ * emulparams/elf64_ia64.sh (GENERATE_PIE_SCRIPT): Likewise.
+ * emulparams/elf32ppc.sh (GENERATE_PIE_SCRIPT): Likewise.
+ * emulparams/elf64ppc.sh (GENERATE_PIE_SCRIPT): Likewise.
+ * emulparams/elf_x86_64.sh (GENERATE_PIE_SCRIPT): Likewise.
+ * emulparams/elf_s390.sh (GENERATE_PIE_SCRIPT): Likewise.
+ * emulparams/elf32_sparc.sh (GENERATE_PIE_SCRIPT): Likewise.
+ * emulparams/elf64_sparc.sh (GENERATE_PIE_SCRIPT): Likewise.
+ * emulparams/elf64alpha.sh (GENERATE_PIE_SCRIPT): Likewise.
+ * emulparams/elf64_s390.sh (GENERATE_PIE_SCRIPT): Likewise.
+ * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Likewise.
+
+2003-05-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * genscripts.sh: Create tmpdir/libpath.exp.
+
+2003-05-30 Nick Clifton <nickc@redhat.com>
+
+ * emultempl/armelf.em (arm_elf_before_allocation): Replace ASSERT
+ with a test for a NULL bfd_for_interworking.
+
+2003-05-29 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * configure.host (*-*-netbsd*): Set HOSTING_CRT0 and HOSTING_LIBS
+ correctly for more recent versions of NetBSD.
+ (alpha*-*-netbsd*): Remove.
+ (i[3-7]86-*-netbsd*): Remove.
+
+2003-05-29 Nick Clifton <nickc@redhat.com>
+
+ * emultempl/pe.em: Include "safe-ctype.h" instead of <ctype.h>.
+
+2003-05-26 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
+
+ * emulparams/elf64btsmip.sh: Set TEXT_START_ADDR to 0x120000000 to
+ trap on pointer crops.
+
+2003-05-21 Marcus Comstedt <marcus@mc.pp.se>
+
+ * configure.tgt: Check for a target triplet of shl-...-netbsdelf
+ as well as shle-...-netbsdelf.
+
+2003-05-16 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * configure.host: Accept i[3-7]86 variants.
+ * configure.tgt: Likewise.
+
+2003-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * emulparams/elf64_ia64.sh: Don't set COMMONPAGESIZE for now.
+
+2003-05-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.am (ALL_EMULATIONS): Add earmelfb.o and earmelfb_linux.o.
+ (earmelfb.c, earmelfb_linux.c): New rules.
+ * Makefile.in: Regenerated.
+ * emulparams/armelfb.sh, emulparams/armelfb_linux.sh: New files.
+ * configure.tgt: Add armeb-elf and arm*b-*-linux-gnu.
+
+2003-05-09 Nick Clifton <nickc@redhat.com>
+
+ * ldlang.c (lang_size_sections_1): Default to generating a
+ fatal error message if a loadable section is not allocated
+ to a memory region when regions are defined.
+
+2003-05-09 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.am (em68hc11elf.c): Correct dependencies.
+ (em68hc11elfb.c, em68hc12elf.c, em68hc12elfb.c): Likewise.
+ * Makefile.in: Regenerate.
+ * emultempl/elf32.em (find_exp_assignment): Adjust for changed
+ bfd_elf_record_link_assignment name.
+
+2003-05-07 Alexandre Oliva <aoliva@redhat.com>
+
+ * ldmain.h (overflow_cutoff_limit): Declare.
+ * ldmain.c (overflow_cutoff_limit): Define, initialized to 10.
+ (reloc_overflow): Limit error messages based on it.
+ * lexsup.c (parse_args) <OPTION_VERBOSE>: Set cutoff to
+ unlimited.
+
+2003-05-05 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlex.l: Accept C style comments in version scripts.
+
+2003-04-28 H.J. Lu <hjl@gnu.org>
+
+ * ldlang.c (lang_process): Add the relax finalize pass.
+
+ * ldmain.c (main): Initialize link_info.relax_finalizing to
+ FALSE.
+
+2003-04-24 Roland McGrath <roland@redhat.com>
+
+ * ldgram.y (phdr_type): Grok PT_TLS and PT_GNU_EH_FRAME names.
+ If a name string is unknown, give an error rather than crashing later.
+
+2003-04-23 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
+
+ * Makefile.am (ALL_EMULATIONS): Add eh8300hn.o, eh8300sn.o,
+ eh8300hnelf.o, eh8300snelf.o and respective rules.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Add h8300hn, h8300sn, h8300hnelf, h8300snelf
+ * emulparams/h8300hn.sh: New
+ * emulparams/h8300sn.sh: New
+ * emulparams/h8300hnelf.sh: New
+ * emulparams/h8300snelf.sh: New
+ * scripttempl/h8300hn.sc: new
+ * scripttempl/h8300sn.sc: new
+
+2003-04-23 H.J. Lu <hjl@gnu.org>
+
+ * ldmain.c (link_callbacks): Initialize error_handler.
+
+ * ldmisc.c (error_handler): New function.
+
+ * ldmisc.h (error_handler): New prototype.
+
+2003-04-21 Stephane Carrez <stcarrez@nerim.fr>
+
+ * emulparams/m68hc11elf.sh: Use m68hc1xelf.em extra.
+ * emulparams/m68hc11elfb.sh: Likewise.
+ * emulparams/m68hc12elf.sh: Likewise.
+ * emulparams/m68hc12elfb.sh: Likewise.
+
+2003-04-19 Stephane Carrez <stcarrez@nerim.fr>
+
+ * emultempl/m68hc1xelf.em: New file to generate far trampolines on
+ 68HC11 and 68HC12.
+ (LDEMUL_BEFORE_ALLOCATION): Override to gather the trampolines to
+ generate.
+ (LDEMUL_FINISH): Override to generate the trampolines after gc and
+ linker relaxation.
+ (LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Override to create the
+ stub file for trampolines.
+ (PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_LONGOPTS): New options
+ --no-trampoline and --bank-window to control the memory bank window.
+
+2003-04-18 H.J. Lu <hjl@gnu.org>
+
+ * ldfile.c (ldfile_add_library_path): Remove the unused
+ variable.
+
+2003-04-18 Andrew Haley <aph@cambridge.redhat.com>
+
+ * scripttempl/xstormy16.sc (__data, __rdata): New.
+
+2003-04-16 Nick Clifton <nickc@redhat.com>
+
+ * scripttempl/xstormy16.sc: Add .jcr section mapping.
+
+2003-04-15 H.J. Lu <hjl@gnu.org>
+
+ From Debian by Jack Howarth <howarth@nitro.med.uc.edu>:
+
+ * ldlex.l: Use YY_CURRENT_BUFFER instead of yy_current_buffer.
+
+2003-04-15 Rohit Kumar Srivastava <rohits@kpitcummins.com>
+
+ * h8-doc.texi: Replace occurrances of 'Hitachi' with 'Renesas'.
+ * ld.texinfo: Likewise.
+
+2003-04-14 Alan Modra <amodra@bigpond.net.au>
+
+ From Prashanth Tamraparni <prashanth_t@in.ibm.com>
+ * scripttempl/elf.sc (CTOR): Handle crtbeginS.o, crtendS.o and
+ other variants of crtbegin.o, crtend.o.
+ (DTOR): Likewise.
+ * scripttempl/crisaout.sc (ctors, dtors): Likewise.
+ * scripttempl/elf_chaos.sc (CTOR, DTOR): Likewise.
+ * scripttempl/elfd10v.sc (CTOR, DTOR): Likewise.
+ * scripttempl/elfd30v.sc (CTOR, DTOR): Likewise.
+ * scripttempl/elfxtensa.sc (CTOR, DTOR): Likewise.
+ * scripttempl/iq2000.sc (CTOR, DTOR): Likewise.
+ * scripttempl/mmo.sc (ctors, dtors): Likewise.
+ * scripttempl/xstormy16.sc (CTOR, DTOR): Likewise.
+
+2003-04-09 Dmitry Diky <diwil@mail.ru>
+
+ * scripttempl/elf32msp430.sc: Add initX, finiX, ctors, dtors
+ sections to respect C++ constructor/destructor. Add ctors/dtors
+ start/stop definitions.
+ * scripttempl/elf32msp430_3.sc: Likewise.
+
+2003-04-06 Nick Clifton <nickc@redhat.com>
+
+ * ld.texinfo (Options): Add a reminder of the target specific
+ nature to the description of the i386 PE specific options, for
+ readers who have not read all the way through the manual.
+
+2003-04-04 Svein E. Seldal <Svein.Seldal@solidas.com>
+
+ * configure.tgt: Fixed bug in list of targ_extra_emuls.
+ * emulparams/tic3xcoff.sh (SCRIPT_NAME): Namespace
+ cleanup. Replace s/c4x/tic4x and s/c3x/tic3x/
+ * emulparams/tic3xcoff_onchip.sh: Ditto
+ * emulparams/tic4xcoff.sh: Ditto
+ * scripttempl/tic4xcoff.sc: Ditto
+
+2003-04-03 Nick Clifton <nickc@redhat.com>
+
+ * NEWS: Mention support for Xtensa architecture.
+
+2003-04-02 Nick Clifton <nickc@redhat.com>
+
+ * pe-dll.c (pe_detail_list): arm-pe targets use underscores.
+
+2003-04-01 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * emultempl/pe.em (gld_${EMULATION_NAME}_after_open):
+ Don't call pe_dll_build_section() if link_info.relocateable.
+ (gld_${EMULATION_NAME}_finish): Don't call pe_dll_fill_sections()
+ if link_info.relocateable.
+
+2003-04-01 Fabrizio Gennari <fabrizio.ge@tiscalinet.it>
+
+ * pe-dll.c (process_def_file): Don't create an export
+ section if there are no exports and we're building an exe
+ (pe_dll_build_sections): Ditto
+ (pe_dll_fill_sections): Conditionalize setting
+ abfd->dll true on info->shared
+ * emultempl/pe.em (gld_${EMULATION_NAME}_after_open):
+ If i386pe or armpe, call pe_dll_build_section()
+ for both exe's and dll's, not just dll's.
+ (gld_${EMULATION_NAME}_finish): For all targets except
+ shpe and mipspe, call pe_dll_fill_sections() for both
+ exe's and dll's, not just dll's.
+
+2003-04-02 Bob Wilson <bob.wilson@acm.org>
+
+ * emulparams/xtensa-config.sh: Remove comment indicating that this is
+ a generated file.
+
+2003-04-01 Bob Wilson <bob.wilson@acm.org>
+
+ * Makefile.am (ALL_EMULATIONS): Add eelf32xtensa.o.
+ (eelf32xtensa.c): New target.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Handle xtensa-*-*.
+ * gen-doc.texi: Set XTENSA variable.
+ * ld.texinfo: Set XTENSA variable. Add new Xtensa node.
+ * emulparams/elf32xtensa.sh: New file.
+ * emulparams/xtensa-config.sh: Likewise.
+ * emultempl/xtensaelf.em: Likewise.
+ * scripttempl/elfxtensa.sc: Likewise.
+
+2003-04-01 Jakub Jelinek <jakub@redhat.com>
+
+ * configure.tgt (powerpc*-*-linux*): Add elf32ppc to ppc64
+ targ_extra_libpath. Add elf64ppc to ppc targ_extra_libpath
+ if --enable-64-bit-bfd.
+
+2003-04-01 Nick Clifton <nickc@redhat.com>
+
+ * emulparams/armelf.sh (OTHER_READONLY_SECTIONS): Change name of
+ note section.
+ * emulparams/armelf_linux.sh (OTHER_READONLY_SECTIONS): Change
+ name of note section.
+
+2003-03-31 Alexandre Oliva <aoliva@redhat.com>
+
+ * ld.texinfo (-Tbss, -Tdata, -Ttext): Document in terms of
+ --section-start.
+
+2003-03-31 David Heine <dlheine@suif.stanford.edu>
+
+ * ldfile.c (ldfile_add_library_path): Always allocate space for
+ the filename.
+ * ldlang.c (lang_register_vers_node): Free the node if it cannot
+ be used.
+ * ldmain.c (set_scripts_dir): Always free the constructed
+ directory name.
+ (add_keepsyms_file): Fix memory leak.
+ * ldmisc.c (vfinfo): Likewise.
+ * lexsup.c (parse_args): Likewise.
+
+2003-03-25 Stan Cox <scox@redhat.com>
+ Nick Clifton <nickc@redhat.com>
+
+ Contribute support for Intel's iWMMXt chip - an ARM variant:
+
+ * emulparams/armelf.sh (OTHER_READONLY_SECTIONS): Define.
+ * emulparams/armelf_linux.sh (OTHER_READONLY_SECTIONS): Define.
+ * scripttempl/armcoff.sc (.data): Ensure 8 byte alignment.
+ (.bss): Likewise.
+
+2003-03-25 Alexandre Oliva <aoliva@redhat.com>
+
+ * ldmain.h (ld_canon_sysroot, ld_canon_sysroot_len): Declare.
+ * ldmain.c (ld_canon_sysroot, ld_canon_sysroot_len): Define.
+ (main): Initialize them.
+ * ldfile.c: Include pathnames.h.
+ (is_sysrooted_pathname): New.
+ (ldfile_add_library_path): Use it.
+ (ldfile_open_file_search): Likewise. Use IS_ABSOLUTE_PATH. Don't
+ search_dirs if given an absolute pathname.
+ (ldfile_open_file): Issue error message for sysrooted
+ absolute pathnames.
+ * Makefile.am: Updated dependencies.
+ * Makefile.in: Rebuild.
+
+2003-03-24 Daniel Néri <dne@mayonnaise.net>
+
+ * ld.texinfo: Rename all occurances of C54X to TIC54X.
+
+2003-03-19 Andreas Schwab <schwab@suse.de>
+
+ * ldfile.c (ldfile_try_open_bfd): Pop lexer start condition after
+ eof.
+
+2003-03-18 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * deffilep.y (opt_base): If no number given, set to default
+ (-1), not 0.
+
+2003-03-13 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * deffilep.y (def_import): Use default extension of "dll"
+ if no extension provided in parsed IMPORT definition.
+
+ * deffilep.y (def_lex): Revert 2003-03-12 change.
+ (dot_name): New id type and rule.
+ (expline): Use instead of ID.
+ (opt_equal_name): Likewise.
+
+2003-03-12 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * deffilep.y (def_lex): Accept '.' as valid non-lead char.
+
+2003-03-07 Christopher Faylor <cgf@redhat.com>
+
+ * configure.tgt: Add NATIVE_LIB_DIRS for cygwin target back after
+ apparent accidental removal on 2003-01-06.
+
+2003-03-04 Dmitry Diky <diwil@mail.ru>
+
+ * Makefile.am: Add new devices x1122 x1132 emulation
+ * configure.tgt: Likewise.
+ * Makefile.in: Regenerate.
+ * emulparams/msp430x1122.sh: New file.
+ * emulparams/msp430x1132.sh: New file.
+
+2003-03-03 Alexandre Oliva <aoliva@redhat.com>
+
+ * ldmain.c (set_scripts_dir): Look for relative to TOOLBINDIR as
+ well.
+
+ * ldfile.h (struct search_dirs): Added sysrooted field.
+ * ldlang.h (struct lang_input_statement_struct): Likewise.
+ * ldfile.c (ldfile_add_library_path): Mark sysrooted paths.
+ (ldfile_open_file_search): Look for sysrooted filename starting
+ with / in ld_sysroot instead of in the current directory. Clear
+ sysrooted flag if it's found in the current directory. Set it
+ from the search directory's sysrooted flag where it is found
+ otherwise.
+ * ldlang.c (ldlang_sysrooted_script): New static variable.
+ (new_afile): Mark search_file_enums as sysrooted if
+ ldlang_sysrooted_script.
+ (load_symbols): Set ldlang_sysrooted_script according to the
+ script's sysrooted field while processing it.
+ * ld.texinfo: Document INPUT behavior in sysroot.
+
+2003-03-02 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * scripttempl/pe.sc: Use PROVIDE with etext, end, _end,
+
+2003-03-03 Alan Modra <amodra@bigpond.net.au>
+
+ * 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-01 Alan Modra <amodra@bigpond.net.au>
+
+ * ldemul.c: Include getopt.h.
+ * emultempl/elf32.em: Include getopt.h earlier.
+ * emultempl/ticoff.em: Likewise.
+
+2003-02-28 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_get_script): Add combreloc
+ support when scripts read from files.
+
+2003-02-28 Alan Modra <amodra@bigpond.net.au>
+
+ * ldemul.c (ldemul_parse_args): Return FALSE by default.
+ * ldemul.h (struct ld_emulation_xfer_struct): Update parse_args
+ comment.
+
+ * ldemul.c (ldemul_add_options, ldemul_handle_option): New functions.
+ (ldemul_parse_args): Return bfd_boolean. Formatting.
+ * ldemul.h (ldemul_add_options, ldemul_handle_option): Declare.
+ (ldemul_parse_args): Adjust.
+ (struct ld_emulation_xfer_struct): Add add_options and handle_option.
+ Return bfd_boolean from parse_args.
+ * lexsup.c (parse_args): Malloc shortopts, longopts and
+ really_longopts. Call ldemul_add_options and ldemul_handle_option.
+ * emultempl/aix.em (gld${EMULATION_NAME}_add_options): Split out from
+ gld${EMULATION_NAME}_parse_args.
+ (gld${EMULATION_NAME}_handle_option): Likewise.
+ (ld_${EMULATION_NAME}_emulation): Adjust initializer.
+ * emultempl/armcoff.em: As for aix.em, but remove parse_args.
+ * emultempl/beos.em: Likewise.
+ * emultempl/pe.em: Likewise.
+ * emultempl/ticoff.em: Likewise.
+ * emultempl/elf32.em: Likewise. Don't duplicate long options either.
+ (gld${EMULATION_NAME}_add_sysroot): Prototype.
+ * emultempl/armelf.em (PARSE_AND_LIST_LONGOPTS): Don't duplicate
+ options.
+ * emultempl/hppaelf.em (PARSE_AND_LIST_LONGOPTS): Likewise.
+ * emultempl/ppc32elf.em (PARSE_AND_LIST_LONGOPTS): Likewise.
+ * emultempl/ppc64elf.em (PARSE_AND_LIST_LONGOPTS): Likewise.
+ * emultempl/armelf_oabi.em (ld_${EMULATION_NAME}_emulation): Adjust
+ initializer.
+ * emultempl/generic.em: Likewise.
+ * emultempl/gld960.em: Likewise.
+ * emultempl/gld960c.em: Likewise.
+ * emultempl/linux.em: Likewise.
+ * emultempl/lnk960.em: Likewise.
+ * emultempl/m68kcoff.em: Likewise.
+ * emultempl/mipsecoff.em: Likewise.
+ * emultempl/sunos.em: Likewise.
+ * emultempl/vanilla.em: Likewise.
+ * emultempl/netbsd.em (gldnetbsd_before_parse): Prototype.
+
+2003-02-25 Alexandre Oliva <aoliva@redhat.com>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_add_sysroot): Fix
+ memory allocation error.
+
+ * Makefile.am (ldmain.o): Define TOOLBINDIR.
+ * Makefile.in: Rebuilt.
+ * ldmain.c (ld_sysroot): Try to set from TOOLBINDIR too.
+
+2003-02-21 Bob Wilson <bob.wilson@acm.org>
+
+ * ldlang.c (lang_size_sections_1): Add CHECK_REGIONS argument and only
+ call os_region_check when it is set.
+ (lang_size_sections): Add CHECK_REGIONS argument and pass it through to
+ lang_size_sections_1.
+ (lang_process): Change lang_size_sections calls to set CHECK_REGIONS
+ only for the last call, not on every relaxation iteration.
+ * ldlang.h (lang_size_sections): Update prototype.
+ * pe-dll.c (pe_dll_fill_sections): Set CHECK_REGIONS argument in calls
+ to lang_size_sections.
+ (pe_exe_fill_sections): Likewise.
+ * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Likewise.
+ * emultempl/hppaelf.em (hppaelf_layout_sections_again): Likewise.
+ * emultempl/ppc64elf.em (ppc_before_allocation): Likewise.
+ (ppc_layout_sections_again): Likewise.
+
+2003-02-21 Bob Wilson <bob.wilson@acm.org>
+
+ * gen-doc.texi: Set ARM and HPPA variables.
+ * ld.texinfo: Fix typos and obvious texinfo mistakes. Make section
+ title capitalization more consistent. Add missing menu entries for
+ machine-specific sections and conditionalize them consistently.
+ Conditionalize text that is irrelevant when SingleFormat is set.
+ Add @group divisions to improve page breaks in long examples.
+ Use @iftex/@ifnottex instead of @iftex/@ifinfo so that HTML output
+ is correct. Remove "FIXME" comment about not using
+ @raisesections/@lowersections. Use @raisesections/@lowersections
+ consistently for machine-specific sections. Change to be more polite
+ about poor bug reports. Replace FDL appendix with include of fdl.texi.
+ Move WIN32 node to match its order in the menus.
+ * fdl.texi: New file.
+
+2003-02-20 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (TARGET_SYSTEM_ROOT): Set default to
+ ${exec_prefix}/${target_alias}/sys-root. Match explicit
+ '${exec_prefix}' (in addition to the expansion thereof) as
+ relocatable.
+ * configure: Rebuilt.
+
+2003-02-20 Phil Edwards <pme@gcc.gnu.org>
+
+ * ldgram.y (vers_defns): Also recurse with 'EXTERN NAME' patterns.
+
+2003-02-20 Harri Porten <porten@kde.org>
+
+ * ldgram.y (vers_defns): Allow optional trailing semicolon in
+ EXTERN NAME block;
+
+2003-02-18 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/ppc32elf.em: New file.
+ * emulparams/elf32ppc.sh (EXTRA_EM_FILE): Define.
+ * Makefile.am (eelf32lppc.c): Depend on emultempl/ppc32elf.em.
+ (eelf32lppcnto.c): Likewise.
+ (eelf32lppcsim.c): Likewise.
+ (eelf32ppcnto.c): Likewise.
+ (eelf32ppc.c): Likewise.
+ (eelf32ppc_fbsd.c): Likewise.
+ (eelf32ppcsim.c): Likewise.
+ (eelf32ppclinux.c): Likewise.
+ * Makefile.in: Regenerate.
+
+2003-02-18 Alan Modra <amodra@bigpond.net.au>
+
+ * ld.texinfo: Remove spaces between @samp and opening brace.
+
+2003-02-18 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/ppc64elf.em (ppc_create_output_section_statements): Check
+ hash creator.
+ (ppc_before_allocation): Don't do optimizations if wrong hash table.
+ (gld${EMULATION_NAME}_finish): Ditto.
+
+2003-02-17 Nick Clifton <nickc@redhat.com>
+
+ * ldmain.c (main) Default allow_shlib_undefined to true.
+ * lexsup.c (ld_options): Add --no-allow-shlib-undefined.
+ (parse_args): Parse the new switch.
+ * ld.texinfo: Document new switch and default behaviour of
+ allowing undefined symbols in shared libraries.
+
+2003-02-11 Dmitry Diky <diwil@mail.ru>
+
+ * scripttempl/elf32msp430.sc: Add new data anchors definitions.
+ * scripttempl/elf32msp430_3.sc: Likewise.
+
+2003-02-11 Uwe Stieber <uwe@wwws.de>
+
+ * configure.tgt: Add support for kaOS as cross build target
+ system.
+
+2003-02-10 John Daivid Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * hppaelf.em (group_size): Change default back to 1.
+
+2003-02-09 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/ppc64elf.em: Add "no-tls-optimize" option and support code.
+
+2003-02-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * hppaelf.em (group_size): Change default to -1.
+
+2003-02-07 Nick Clifton <nickc@redhat.com>
+
+ * emultempl/armelf.em (PARSE_AND_LIST_SHORTOPTS): Remove 'n' short
+ opt.
+ (PARSE_AND_LIST_LONGOPTS): Add duplicate entry for
+ no-pipeline-knowledge. This will prevent the getopt package from
+ thinking that there are any shorter abbreviations for
+ --no-pipeline-knowledge.
+
+2003-02-07 Jakub Jelinek <jakub@redhat.com>
+
+ * genscripts.sh (LIB_PATH): Don't append LIBPATH_SUFFIX to paths
+ which already have it. Avoid duplicates.
+
+2003-02-06 Jakub Jelinek <jakub@redhat.com>
+
+ * emulparams/elf64_s390.sh (LIBPATH_SUFFIX): Set to 64.
+ * emulparams/elf_x86_64.sh (LIBPATH_SUFFIX): Likewise.
+ * emulparams/elf64_sparc.sh (LIBPATH_SUFFIX): Set instead of suffix.
+
+2003-02-05 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/ppc64elf.em (ppc_before_allocation): Size sections then
+ call ppc64_elf_tls_optimize.
+
+2003-02-03 Daniel Jacobowitz <drow@mvista.com>
+
+ * emultempl/elf32.em: Move gld${EMULATION_NAME}_add_sysroot
+ outside of GNU/Linux conditional.
+
+2003-01-28 Ralf Habacker <ralf.habacker@freenet.de>
+
+ * deffilep.y (def_get_module): New function: locate an already
+ added module.
+ * deffile.h (def_get_module): New prototype.
+ * pe-dll.c (pe_implied_import_dll): Add code to prevent importing
+ a dll multiple times.
+
+2003-01-23 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/sh64elf.em: Include elf32-sh64.h.
+ (sh64_elf_${EMULATION_NAME}_before_allocation): Adjust for changed
+ sh64_elf_section_data.
+ (sh64_elf_${EMULATION_NAME}_after_allocation): Likewise.
+
+2003-01-23 Wu Yongwei <adah@netstd.com>
+
+ * ld.texinfo: Remove an extra "i" in --dll-search-prefix.
+ * emultempl/pe.em (gld_${EMULATION_NAME}_list_options): Move a
+ cross-80th-column-margin "an" to the next line.
+
+2003-01-21 Nick Clifton <nickc@redhat.com>
+
+ * emulparams/tic3xcoff-onchip.sh: Rename to ...z
+ * emulparams/tic3xcoff_onchip.sh: ...this.
+ * Makefile.am (etic3xcoff_onchip.c): Fix name of generated C file.
+ * Makefile.in: Regenerate.
+
+2003-01-21 Fabio Alemagna <falemagn@aros.org>
+
+ * configure.tgt: Handle i[3456]86-*-aros*
+
+2003-01-19 Svein E. Seldal <Svein.Seldal@solidas.com>
+
+ * Makefile.am: Added etic3xcoff.o and etic4xcoff_onchip.o
+ * Makefile.in: Regenerate
+ * configure.tgt: Added extra target emulations
+ * emulparams/tic3xcoff.sh: Remove old settings
+ * emulparams/tic4xcoff.sh: Ditto
+ * emulparams/tic3xcoff-onchip.sh: Added new
+ * scripttempl/tic4xcoff.sc: Revise and combine both c3x and c4x
+ * scripttempl/tic3xcoff.sc: Remove
+
+2003-01-17 Andreas Jaeger <aj@suse.de>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_add_sysroot): Do not
+ skip ':'.
+
+2003-01-16 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.in: Regenerate.
+
+2003-01-14 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * ld.texinfo (node WIN32): Some clarifications
+ and formatting fixups.
+
+2003-01-09 Chris Demetriou <cgd@broadcom.com>
+
+ * ldmain.c (get_emulation): Sort -mipsNN checks in the usual
+ order, and handle (ignore) -mips32r2.
+
+2003-01-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * ldmain.c (main): Make sure ld_sysroot is initialized.
+
+2003-01-06 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.am (eelf32iq10.c): Fix tab/whitespace mixup.
+
+ * Makefile.am (ldmain.o): Add @TARGET_SYSTEM_ROOT_DEFINE@.
+ (GENSCRIPTS): Add @use_sysroot@.
+ * Makefile.in: Regenerated.
+ * configure.host: Move setting of NATIVE_LIB_DIRS to...
+ * configure.tgt: ... here. Use ${target} instead of ${host}
+ for NATIVE_LIB_DIRS.
+ * configure.in: Add --with-sysroot.
+ * configure: Regenerated.
+ * genscripts.sh: Accept use_sysroot option. Set new variables
+ NATIVE and USE_LIBPATH. Prepend "=" to directory names if
+ $use_sysroot. Don't search $tool_lib if $use_sysroot.
+ * ldfile.c (ldfile_add_library_path): Handle leading '='.
+ * ldmain.c (TARGET_SYSTEM_ROOT): Define if not defined.
+ (ld_sysroot): New variable.
+ (main): Initialize ld_sysroot.
+ * ldmain.h (ld_sysroot): New extern.
+ * emultempl/elf32.em: Use NATIVE and USE_LIBPATH instead of
+ searching $EMULATION_LIBPATH.
+ (gld${EMULATION_NAME}_add_sysroot): New function.
+ (gld${EMULATION_NAME}_check_ld_so_conf): Use it. Honor ld_sysroot.
+ (gld${EMULATION_NAME}_after_open): Likewise. Only search
+ environment variables if $NATIVE.
+ * ld.texinfo (Options): Mention "=" prefix in the description of -L.
+ * NEWS: Mention --with-sysroot.
+
+ * emulparams/elf32bmipn32-defs.sh: Set NATIVE and LIBPATH_SUFFIX
+ instead of setting LIB_PATH.
+ * emulparams/elf32ppc.sh: Likewise.
+ * emulparams/elf64_s390.sh: Likewise.
+ * emulparams/elf64_sparc.sh: Likewise.
+ * emulparams/elf64ppc.sh: Likewise.
+ * emulparams/elf_x86_64.sh: Likewise.
+
+ * emulparams/elf64_aix.sh: Add "=" prefixes to LIB_PATH.
+ * emulparams/elf64hppa.sh: Add "=" prefixes to LIB_PATH.
+
+2003-01-03 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * pe-dll.c (autofilter_symbollist): Add cygwin_crt0.
+
+2003-01-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.am (ldmain.o): Pass BINDIR.
+ * Makefile.in: Regenerated.
+ * ldmain.c (set_scripts_dir): Use make_relative_prefix for the first
+ search path.
+
+2003-01-02 Ben Elliston <bje@redhat.com>
+
+ * Makefile.am (ALL_EMULATIONS): Add eelf32iq2000.o.
+ (eelf32iq2000.c): New target.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Handle iq2000-*-elf.
+ * emulparams/elf32iq10.sh: New file.
+ * emulparams/elf32iq2000.sh: New file.
+ * scripttempl/iq2000.sc: New file.
+
+2003-01-02 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * pe-dll.c (autofilter_symbollist): Add do_pseudo_reloc
+ and _pei386_runtime_relocator to the exclude list.
+
+2003-01-01 Kazu Hirata <kazu@cs.umass.edu>
+
+ * ldfile.c: Fix comment typos.
+ * ldlang.c: Likewise.
+ * mri.c: Likewise.
+ * pe-dll.c: Likewise.
+
+2003-01-01 Daniel Jacobowitz <drow@mvista.com>
+
+ Suggested by Manfred Hollstein <manfred.h@gmx.net>:
+ * Makefile.am (ld.1): Depend on configdoc.texi
+ and ldver.texi.
+ * Makefile.in: Regenerated.
+
+2002-12-24 Dmitry Diky <diwil@mail.ru>
+
+ * Makefile.am: Add msp430 target.
+ * configure.tgt: Likewise.
+ * Makefile.in: Regenerate.
+ * emulparams/msp430x???.sh: New files. Linker script parameters
+ for various msp430 configurations.
+ * gen-doc.texi: Enable msp430 documenation.
+ * ld.texinfo: Document msp430 sections.
+ * scripttempl/elf32msp430.sc: New file. Linker script for msp430.
+ * scripttempl/elf32msp430_3.sc: New file. Linker script for msp430.
+
+2002-12-30 Ralf Habacker <Ralf.Habacker@freenet.de>
+ Charles Wilson <cwilson@ece.gatech.edu>
+
+ * config.in (HAVE_REALPATH): New entry.
+ (HAVE_SYS_STAT_H, HAVE_SYS_TYPES_H): Removed: obsolete.
+
+2002-12-30 Ralf Habacker <ralf.habacker@freenet.de>
+
+ * ld.texinfo: New win32 topics: 'symbol aliasing' and 'export dll
+ symbols'.
+
+2002-12-23 Alan Modra <amodra@bigpond.net.au>
+
+ * ldmain.c (main): Init "strip_discarded".
+ * lexsup.c (OPTION_STRIP_DISCARDED): Define.
+ (OPTION_NO_STRIP_DISCARDED): Define.
+ (ld_options): Add "strip-discarded" and "no-strip-discarded".
+ (parse_args): Handle them.
+
+2002-12-23 Nick Clifton <nickc@redhat.com>
+
+ * ld.h (struct args_type): Add new field
+ 'accept_unknown_input_architecture'.
+ * ldmain.c (main): Initialise 'accept_unknown_input_architecture'
+ to false.
+ * ldlang.c (lang_check): Pass accept_unknown_input_architecture to
+ bfd_arch_get_compatible.
+ * ldfile.c (ldfile_try_open_bfd): Likewise.
+ * lexsup.c (ld_options): Add new command line switch
+ --accept-unknown-input-architecture and its inverse.
+ (parse_args): Handle --accept-unknown-input-architecture.
+ * ld.texinfo: Document new linker option.
+ * NEWS: Mention new linker option.
+
+2002-12-20 Alan Modra <amodra@bigpond.net.au>
+
+ * ldmain.c (main): Re-order link_info initialization. Init all
+ fields.
+
+2002-12-19 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * ld.texinfo: Clarify and extend the documentation
+ in the Machine Dependent, WIN32 section.
+
+2002-12-18 Ralf Habacker <ralf.habacker@freenet.de>
+
+ * ld.texinfo: Add win32 machine depending section.
+ * gen-doc.texi: Enable win32 machine depending section.
+
+ * configure.host: Add win32 library search path.
+
+2002-12-17 Ralf Habacker <ralf.habacker@freenet.de>
+
+ * emultempl/pe.em (pe_find_data_imports): Don't search for data
+ import when auto-import is disabled.
+
+2002-12-17 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * emultempl/pe.em (..._recognized_file): Use LD_PATHMAX+1 to
+ account for trailing '\0'.
+
+2002-12-17 Nick Clifton <nickc@redhat.com>
+
+ * emultempl/pe.em (longopts): Duplicate entry for --compact-implib
+ so that it is not confused with -c.
+
+2002-12-13 Ralf Habacker <Ralf.Habacker@freenet.de>
+ Charles Wilson <cwilson@ece.gatech.edu>
+
+ * configure.in: Add check for realpath function.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+ * aclocal.m4: Regenerate.
+ * deffile.h: Add .data field to def_file_import
+ structure.
+ * pe-dll.c (pe_proces_import_defs): Use .data field of
+ def_file_import structure to initialize flag_data field of
+ def_file_export structure.
+ (pe_implied_import_dll): New variables exp_funcbase and
+ [data|bss]_[start|end]. Use DLL's internal name to set dll_name,
+ not filename (which may be a symlink). Scan the sections and
+ initialize [data|bss]_[start|end]. When scanning the export
+ table, skip _nm_ symbols, and mark any symbols whose rva indicates
+ that it is in the .bss or .data sections as data.
+ * sysdep.h: Include limits.h and sys/param.h, and define
+ LD_PATHMAX as appropriate. Also define REALPATH as realpath if it
+ exists, NULL otherwise.
+ * emultempl/pe.em (gld_${EMULATION_NAME}_after_open): Call
+ pe_process_import_defs before pe_find_data_imports, so that
+ auto-import will check the virtual implib as well as "real"
+ implibs.
+ (gld_${EMULATION_NAME}_recognized_file): Use REALPATH to follow
+ symlinks to their target; check that the target's extension is
+ .dll before calling pe_implied_import_dll(), not the filename
+ itself (which may be a symlink).
+
+2002-12-10 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em (struct orphan_save): Add os_tail field.
+ (gld${EMULATION_NAME}_place_orphan): Re-order output_section_statement
+ list too.
+
+2002-12-08 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.h: Formatting.
+
+2002-12-07 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (init_os): Ensure sections mentioned in load_base
+ are initialized.
+
+2002-12-05 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Set
+ load_base for orphans that follow a section with load_base set.
+
+2002-12-01 H.J. Lu <hjl@gnu.org>
+
+ * ld.texinfo: Remove the extra `;' in sample version script.
+
+2002-11-30 Alan Modra <amodra@bigpond.net.au>
+
+ * configure.host: Correct dynamic-linker for powerpc64 hosts.
+
+ * Makefile.am (eelf32ppcwindiss.c): Correct dependencies.
+ * Makefile.in: Regenerate.
+
+ * ld.h, ldcref.c, ldctor.c, ldctor.h, ldemul.c, ldemul.h, ldexp.c,
+ ldexp.h, ldfile.c, ldfile.h, ldgram.y, ldlang.c, ldlang.h, ldmain.c,
+ ldmain.h, ldmisc.c, ldwrite.c, lexsup.c, mri.c, pe-dll.c, pe-dll.h,
+ emulparams/elf32b4300.sh, emultempl/aix.em, emultempl/armcoff.em,
+ emultempl/armelf.em, emultempl/armelf_oabi.em, emultempl/beos.em,
+ emultempl/elf32.em, emultempl/generic.em, emultempl/gld960.em,
+ emultempl/gld960c.em, emultempl/hppaelf.em, emultempl/linux.em,
+ emultempl/lnk960.em, emultempl/m68kcoff.em, emultempl/mipsecoff.em,
+ emultempl/mmix-elfnmmo.em, emultempl/mmixelf.em, emultempl/mmo.em,
+ emultempl/needrelax.em, emultempl/pe.em, emultempl/ppc64elf.em,
+ emultempl/sh64elf.em, emultempl/sunos.em, emultempl/ticoff.em: Replace
+ boolean with bfd_boolean, true with TRUE, false with FALSE. Simplify
+ comparisons of bfd_boolean vars with TRUE/FALSE. Formatting.
+
+2002-11-27 David O'Brien <obrien@FreeBSD.org>
+
+ * configure.host: Fix generic FreeBSD configuration entry.
+
+2002-11-27 H.J. Lu <hjl@gnu.org>
+
+ * ld.texinfo: Add the missing `;' to sample version scripts.
+
+2002-11-20 Alan Modra <amodra@bigpond.net.au>
+
+ * emulparams/elf64ppc.sh (SEGMENT_SIZE): Don't define.
+
+2002-11-14 Egor Duda <deo@logos-m.ru>
+
+ * ldmain.c (main): Make runtime relocs disabled by default. Remove
+ assignment which has no effect.
+ * pe-dll.h (pe_create_import_fixup): Change prototype.
+ * pe-dll.c (make_runtime_pseudo_reloc): New function.
+ (pe_create_runtime_relocator_reference): Ditto.
+ (pe_create_import_fixup): Handle relocations with non-zero addends.
+ * emultempl/pe.em: Add options --enable-runtime-pseudo-reloc and
+ --disable-runtime-pseudo-reloc.
+ (make_import_fixup): Handle relocations with non-zero addends. Create
+ an external reference to _pei386_runtime_relocator symbol if at least
+ one pseudo reloc was created.
+ * ld.texinfo: Document --enable-runtime-pseudo-reloc and
+ --disable-runtime-pseudo-reloc options.
+
+2002-11-12 Earl Chew <earl_chew@agilent.com>
+
+ * ldlang.c (lang_add_section): Discard debugging sections that have
+ been marked SEC_EXCLUDE.
+
+2002-11-12 Nick Clifton <nickc@redhat.com>
+
+ * configure.in (ALL_LINGUAS): Add da.
+ * configure: Regenerate.
+ * po/da.po: New Danish translation.
+
+2002-11-12 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/ppc64elf.em (ppc_before_allocation): New function.
+ (LDEMUL_BEFORE_ALLOCATION): Define.
+ (gld${EMULATION_NAME}_finish): Run discard_info for relocatable
+ linking.
+ * emultemp/hppaelf.em ((gld${EMULATION_NAME}_finish): Likewise.
+
+2002-11-11 Christopher Faylor <cgf@redhat.com>
+
+ * configure.tgt (LIB_PATH): Default to searching w32api directory under
+ cygwin.
+
+2002-11-11 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * pe-dll.c (autofilter_liblist): add libmingwex and libgcj to the list
+ of restricted auto-export libs.
+
+2002-11-11 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * pe-dll.c (autofilter_liblist): Generalize library names to catch more
+ creative library naming instances like, e.g., libstdc++-2.a.
+
+2002-11-06 Alexandre Oliva <aoliva@redhat.com>
+
+ * emulparams/elf32btsmipn32.sh (TEXT_DYNAMIC): Define.
+ * emulparams/elf64btsmip.sh (TEXT_DYNAMIC): Likewise.
+
+2002-11-07 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * deffilep.y (def_lex): Handle '@' as first character of an ID.
+ * pe-dll.c (auto-export): Filter on "_imp_" prefix, not "_imp__".
+ (make_one): Don't prefix decorated fastcall symbols with '_'.
+ (pe_process_import_defs): Likewise.
+ * emultempl/pe.em (pe_fixup_stdcalls): Don't fixup fastcall
+ symbols to cdecl names or vise-versa.
+
+2002-10-13 Eric Kohl <ekohl@rz-online.de>
+
+ * pe-dll.c (process_def_file): Handle fastcall symbols when
+ generating undecorated aliases. Don't prefix decorated fastcall
+ symbols with '_'.
+ (fill_exported_offsets): Don't prefix decorated fastcall symbols
+ with '_'.
+
+2002-10-29 Daniel Jacobowitz <drow@mvista.com>
+
+ * emultempl/aix.em: Use include <> for generated headers.
+ * emultempl/beos.em: Likewise.
+ * emultempl/elf32.em: Likewise.
+ * emultempl/pe.em: Likewise.
+ * ldctor.c: Likewise.
+ * ldexp.c: Likewise.
+ * ldfile.c: Likewise.
+ * ldlang.c: Likewise.
+ * ldlex.c: Likewise.
+ * ldlex.l: Likewise.
+ * ldmain.c: Likewise.
+ * ldmisc.c: Likewise.
+ * ldwrite.c: Likewise.
+ * lexsup.c: Likewise.
+ * mri.c: Likewise.
+ * pe-dll.c: Likewise.
+
+2002-10-23 Jakub Jelinek <jakub@redhat.com>
+
+ * emultempl/elf32.em (place_orphan): Don't put non-allocated .rel*
+ sections into .rel{,a}.dyn.
+
+2002-10-23 Nick Clifton <nickc@redhat.com>
+
+ * lexsup.c (OPTION_NO_OMAGIC): Define.
+ (ld_options): Add "no-omagic" option.
+ (parse_args): Parse --no-omagic.
+ * ld.texinfo: Document --no-omagic.
+ * NEWS: Mention new option.
+
+2002-10-21 Danny Smith <dannysmith@users.sourceforeg.net>
+
+ * scripttempl/pe.sc (__RUNTIME_PSEUDO_RELOC_LIST__,
+ __RUNTIME_PSEUDO_RELOC_LIST_END__): Add only when relocating.
+
+2002-10-22 Alexandre Oliva <aoliva@redhat.com>
+
+ * emulparams/elf32bmipn32-defs.sh: Set ELFSIZE according to
+ emulation name. Set LIB_PATH only for native tools, and
+ search the ABI-specific versions of NATIVE_LIB_DIRS before the
+ .../lib variants, not instead of them. Mostly copied from...
+ * emulparams/elf32ppc.sh: ... here. Fixed typo.
+ * emulparams/elf64bmip-defs.sh: Backed out.
+ * emulparams/elf64bmip.sh: Import elf32bmipn32-defs.sh again.
+ * emulparams/elf64btsmip.sh: Likewise.
+ (DATA_ADDR, NONPAGED_TEXT_START_ADDR, SHLIB_TEXT_START_ADDR,
+ TEXT_DYNAMIC): Removed.
+
+2002-10-17 Alexandre Oliva <aoliva@redhat.com>
+
+ * emulparams/elf32bmipn32-defs.sh (LIB_PATH): Set to /usr/lib32.
+ (GENERATE_SHLIB_SCRIPT): Set to yes.
+ (EXECUTABLE_SYMBOLS, WRITABLE_RODATA): Moved to...
+ * emulparams/elf32bmipn32.sh: here.
+ (GENERATE_SHLIB_SCRIPT): Deleted as redundant.
+ * emulparams/elf32btsmipn32.sh: Delete redundant unsets.
+ * emulparams/elf64bmip-defs.sh: New file. Extend
+ elf32bmipn32-defs.sh by overiding ELFSIZE and LIB_PATH.
+ * emulparams/elf64bmip.sh: Bring in definitions from
+ elf64bmip-defs.sh.
+ (ELFSIZE, GENERATE_SHLIB_SCRIPT, LIB_PATH): Delete redundant
+ settings.
+ (WRITABLE_RODATA): Moved from elf32bmipn32-defs.sh.
+ * emulparams/elf64btsmip.sh: Bring in definitions from
+ elf64bmip-defs.sh.
+ (ELFSIZE, GENERATE_SHLIB_SCRIPT): Delete, redundant.
+ (EXECUTABLE_SYMBOLS, WRITABLE_RODATA): Delete redundant unsets.
+
+2002-10-16 Jakub Jelinek <jakub@redhat.com>
+
+ * configure.tgt (s390x-*-linux*): Add elf_s390 emulation.
+ (s390-*-linux*): Add elf64_s390 emulation if want64.
+ * emulparams/elf64_sparc.sh (LIB_PATH): Update to match 2002-05-22
+ genscript.sh changes.
+ * emulparams/elf_x86_64.sh (LIB_PATH): Likewise.
+ * emulparams/elf64_s390.sh (LIB_PATH): Set up native 64 bit dirs.
+
+2002-10-15 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (load_symbols): Revert last change.
+
+2002-10-14 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (load_symbols): Don't call bfd_link_add_symbols when
+ just_syms_flag.
+ (lang_reasonable_defaults): Don't compare against false.
+ (size_input_section): Likewise.
+ (lang_size_sections_1): Likewise.
+ (lang_do_assignments): Likewise.
+ (lang_add_output): Likewise.
+
+ * Makefile.am: Run "make dep-am".
+ * Makefile.in: Regenerate.
+ * ldver.c: #include "bfdver.h".
+
+2002-10-13 Stephane Carrez <stcarrez@nerim.fr>
+
+ * scripttempl/elfm68hc11.sc: Use KEEP for .vectors, .installN,
+ .finiN section.
+ * scripttempl/elfm68hc12.sc: Likewise.
+
+2002-10-11 Alan Modra <amodra@bigpond.net.au>
+
+ * pe-dll.c (make_import_fixup_mark): Avoid type-punned pointer.
+
+ * ldgram.y (memory_spec): Provide empty action.
+ (section <NAME>): Likewise.
+
+2002-10-10 Jakub Jelinek <jakub@redhat.com>
+
+ * ldfile.c (ldfile_try_open_bfd): When searching skip linker scripts if
+ they have OUTPUT_FORMAT not matching actual output format.
+ * ldlang.c (lang_get_output_target): New function.
+ (open_output): Use it.
+ * ldlang.h (lang_get_output_target): New prototype.
+
+2002-10-10 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em (output_rel_find): Prefer .rel script sections
+ when orphan is .rel, .rela when orphan is .rela.
+ (gld${EMULATION_NAME}_place_orphan): Handle combreloc .rel* case
+ first. Remove outsecname var.
+
+2002-10-09 Richard Shann <richard.shann@superh.com>
+ Stephen Clarke <stephen.clarke@superh.com>
+
+ * Makefile.am: Add eshelf32_linux.o and
+ eshlelf32_linux.o, new emulations for sh64 Linux.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Add sh64eb-*-linux* and sh64-*-linux* emulations.
+ * emulparams/shelf32_linux.sh: New file.
+ * emulparams/shlelf32_linux.sh: New file.
+
+2002-10-08 H.J. Lu <hjl@gnu.org>
+
+ * ldlang.c (lang_file_exist): Removed.
+ (new_afile): Revert the last change.
+ * ldlang.h (lang_file_exist): Removed.
+ * lexsup.c (parse_args): Revert the last change.
+
+2002-10-07 Ralf Habacker <Ralf.Habacker@freenet.de>
+
+ * pe-dll.cc (autofilter_symbolprefixlist): Don't re-export
+ auto-import symbols.
+ (make_one): Create _nm_<symbol> for data only.
+
+2002-10-05 Elias Athanasopoulos <eathan@otenet.gr>
+
+ * ldlang.c (lang_file_exist): New function.
+ (new_afile): Abort if the filename to be added matches the linker
+ output filename.
+ * ldlang.h: Add prototype for lang_file_exist.
+ * lexsup.c (parse_args): Abort if the output filename matches
+ one of the input filenames.
+
+2002-10-02 Alan Modra <amodra@bigpond.net.au>
+
+ * emulparams/elf64ppc.sh (MAXPAGESIZE): Set to 0x10000.
+
+2002-09-30 Alan Modra <amodra@bigpond.net.au>
+
+ * scripttempl/elfd30v.sc: Order reloc sections placing .plt last.
+ * scripttempl/elfm68hc11.sc: Likewise.
+ * scripttempl/elfm68hc12.sc: Likewise.
+
+ * emultempl/elf32.em (output_rel_find): Always place orphan loadable
+ reloc sections just before .rel.plt/.rela.plt.
+ (gld${EMULATION_NAME}_place_orphan <.rel>): Remove combreloc code.
+ Only put loadable reloc sections in hold_rel.
+
+2002-09-29 H.J. Lu <hjl@gnu.org>
+
+ * emulparams/elf32ppc.sh (OTHER_GOT_RELOC_SECTIONS): New.
+
+2002-09-25 Daniel Jacobowitz <drow@mvista.com>
+
+ From "Anita Kulkarni" <AnitaK@kpit.com>
+ * scripttempl/sh.sc: Handle .eh_frame* and .gcc_exc*
+ sections.
+
+2002-09-25 Alan Modra <amodra@bigpond.net.au>
+
+ * genscripts.sh (SEGMENT_SIZE): Use MAXPAGESIZE before
+ TARGET_PAGE_SIZE.
+ * scripttempl/elf.sc (DATA_SEGMENT_ALIGN): Incorporate
+ SEGMENT_SIZE alignment.
+ * emulparams/elf64ppc.sh (DATA_ADDR): Delete.
+ (SEGMENT_SIZE): Define.
+
+ * ldexp.c (fold_unary): New. Split out from exp_fold_tree.
+ (fold_binary): Correct abs - non-abs case.
+ (fold_trinary): New. Split out from exp_fold_tree.
+
+2002-09-24 Alan Modra <amodra@bigpond.net.au>
+
+ * emulparams/elf64ppc.sh (DATA_ADDR): Define.
+ * emulparams/elf64_aix.sh (DATA_ADDR): Don't use a fixed address
+ for start of .data, instead align up to 256M boundary.
+ * scripttempl/aix.sc: Likewise.
+
+2002-09-22 Mark Elbrecht <snowball3@softhome.net>
+
+ * scripttempl/i386go32.sc: Handle bss unique sections.
+
+2002-09-21 Alan Modra <amodra@bigpond.net.au>
+
+ * ldmisc.c (vfinfo <%C,%D,%G>): Always output bfd, section and offset.
+
+2002-09-17 Stan Cox <scox@redhat.com>
+
+ * emulparams/elf32bmipn32-defs.sh: New file.
+ * emulparams/elf32bmipn32.sh: Use elf32bmipn32-defs.sh.
+ * emulparams/elf32btsmipn32.sh: Likewise.
+ * emulparams/elf64bmip.sh: Likewise.
+ * emulparams/elf64btsmip.sh: Likewise.
+
+2002-09-16 Bruno Haible <bruno@clisp.org>
+
+ * emulparams/elf_i386_fbsd.sh: Set OUTPUT_FORMAT to
+ elf32-i386-freebsd.
+ * emulparams/elf64alpha_fbsd.sh: Set OUTPUT_FORMAT to
+ elf64-alpha-freebsd.
+
+2002-09-11 Nick Clifton <nickc@redhat.com>
+
+ * NEWS: New TI port supports both C4x and C3x series of DSPs.
+
+ * po/tr.po: Updated Turkish translation.
+
+2002-09-06 Jeffrey A Law (law@redhat.com)
+
+ * configure.tgt (h8300-*-hms*, h8500-*-hms*): Restore.
+
+2002-09-02 Nick Clifton <nickc@redhat.com>
+
+ * scripttempl/v850.sc: Add EXTERN references to __ctbpm __gp and
+ __ep.
+ * emulparams/v850.sh (TEMPLATE_NAME): Define.
+
+2002-08-30 Nick Clifton <nickc@redhat.com>
+
+ * scripttempl/elfd10v.sc (MEMORY): Remove UNIFIED, it is not
+ used. Change INSN to start at 0x01000000 and extend for
+ 256K (ignoring holes). Start the STACK on a word aligned
+ boundary.
+ (.rodata): Start it at the READONLY_START_ADDR.
+
+2002-08-30 Alan Modra <amodra@bigpond.net.au>
+
+ * emulparams/elf32ppc.sh (ARCH): Set to "powerpc:common".
+
+2002-08-28 Svein E. Seldal <Svein.Seldal@solidas.com>
+
+ * Makefile.am: Add etic4xcoff.o in ALL_EMULATIONS list and
+ added makefile targets for this file.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Added tic4x-coff and c4x-coff emulations.
+ * NEWS: Mention new port.
+
+2002-08-28 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
+
+ * emulparams/tic3xcoff.sh: New file.
+ * emulparams/tic4xcoff.sh: New file.
+ * scripttempl/tic3xcoff.sc: New file.
+ * scripttempl/tic4xcoff.sc: New file.
+
+2002-08-28 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Replace strtoll,
+ strtoul and strtoull with bfd_scan_vma.
+ (gld${EMULATION_NAME}_read_file): Likewise.
+
+2002-08-28 Alan Modra <amodra@bigpond.net.au>
+
+ * configure.tgt: Remove h8[35]00-*-hms*. Add h8500-*-rtems*.
+
+2002-08-27 Egor Duda <deo@logos-m.ru>
+
+ * scripttempl/pe.sc: Handle .rdata_runtime_pseudo_reloc sections.
+ Add symbols for application to access them.
+
+2002-08-27 Nick Clifton <nickc@redhat.com>
+
+ * emultempl/armelf.em: Revert this patch, it is not needed.
+
+ 2002-08-22 Adam Nemet <anemet@lnxw.com>
+
+2002-08-20 Dan Kegel <dank@kegel.com>
+
+ * configure.in: added --with-lib-path argument to ld's configure
+ to set LIB_PATH.
+ * NEWS: Document new switch.
+ * README: Mention new switch.
+ * configure: Regenerate.
+ * Makefile.in: Regenerate.
+
+ Based on this patch:
+ 2001-04-25 Christopher Faylor <cgf@cygnus.com>
+
+ * Makefile.in (LIB_PATH): Make configurable.
+ (GENSCRIPTS): Set LIB_PATH in environment.
+ * configure.in: Substitute LIB_PATH.
+
+2002-08-22 Adam Nemet <anemet@lnxw.com>
+
+ * emultempl/armelf.em: Include elf-bfd.h and elf/arm.h.
+ (arm_elf_finish): Set the last bit of DT_INIT and DT_FINI
+ depending on the type of the function.
+ (arm_elf_convert_thumb_symbol_to_address): New function.
+
+2002-08-22 Graeme Peterson <gp@qnx.com>
+
+ * Makefile.am: Add esh{l}elf_nto.o files.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Add support for sh-**-nto* targets.
+ * emulparams/shelf_nto.sh: New file.
+ * emulparams/shlelf_nto.sh: New file.
+
+2002-08-21 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * ldlang.c (offsetof): Define if not defined.
+
+2002-08-14 H.J. Lu <hjl@gnu.org>
+
+ * configure.tgt: Always enable 64bit emulations for 32bit
+ Linux/mips.
+
+2002-08-13 Alan Modra <amodra@bigpond.net.au>
+
+ * emulparams/elf32_dlx.sh (TARGET_PAGE_SIZE): Set to 1.
+ (MAXPAGESIZE): Set to 1.
+
+ * ld.h (ALIGN_N): Delete.
+ * ldexp.h (align_n): Declare.
+ * ldexp.c (align_n): New function.
+ (fold_binary): Use align_n instead of ALIGN_N.
+ (exp_fold_tree): Likewise.
+ * ldlang.c (lang_size_sections_1): Likewise.
+ (lang_one_common): Likewise.
+ * ld.texinfo (ALIGN): Remove power of 2 restriction.
+
+2002-07-31 Graeme Peterson <gp@qnx.com>
+
+ * configure.tgt: Add support for powerpc{le}-*-nto* targets.
+ * Makefile.am: Add eelf32{l}ppcnto.o files.
+ * Makefile.in: Regenerate.
+ * emulparams/elf32lppcnto.sh: New file.
+ * emulparams/elf32ppcnto.sh: New file.
+
+2002-08-07 H.J. Lu <hjl@gnu.org>
+
+ * ld.texinfo: Document --no-undefined-version.
+
+ * ldlang.c (lang_new_vers_pattern): Set the `symver' and
+ `script.' fields to 0.
+
+ * ldmain.c (main): Initialize the allow_undefined_version to
+ true.
+
+ * lexsup.c (OPTION_NO_UNDEFINED_VERSION): New.
+ (ld_options): Add --no-undefined-version.
+ (parse_args): Support OPTION_NO_UNDEFINED_VERSION.
+
+2002-08-07 Nick Clifton <nickc@redhat.com>
+
+ * emultempl/armelf.em (arm_elf_before_allocation): Only search for
+ an interworking bfd if there are input bfds. (107501)
+
+2002-08-06 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/aix.em (gld*_before_parse): Set default arch. Reverts
+ 2002-05-10 change.
+
+2002-08-01 Nick Clifton <nickc@redhat.com>
+
+ * emulparams/armelf.sh: Revert previous delta.
+ * scripttempl/elf.sc: Revert previous delta.
+
+2002-07-31 H.J. Lu <hjl@gnu.org>
+
+ * configure.tgt (powerpc*-*-linux*): Enable elf64ppc for
+ --enable-64-bit-bfd.
+
+2002-07-31 H.J. Lu <hjl@gnu.org>
+
+ * configure.tgt: Enable x86-64 emulation for Linux/i386 if
+ 64bit BFD is selected.
+
+2002-07-31 H.J. Lu <hjl@gnu.org>
+
+ * configure.tgt: Enable 64bit emulations for 32bit Linux/mips
+ if 64bit BFD is selected.
+
+2002-07-31 Ian Dall <ian@sibyl.beware.dropbear.id.au>
+
+ * emultempl/netbsd.em (LDEMUL_BEFORE_PARSE): New file to custom set
+ link_info.common_skip_ar_aymbols.
+ * emulparams/ns32knbsd.sh (EXTRA_EM_FILE): Refer to extra file.
+
+ * ldmain.c (main): Initialize new field
+ link_info.common_skip_ar_aymbols.
+
+2002-07-31 Adam Nemet <anemet@lnxw.com>
+
+ * emulparams/armelf.sh (OTHER_PLT_SECTIONS): New variable. Set it
+ to .plt.thumb.
+ * scripttempl/elf.sc: Comment it. Use the same way as ${PLT} is
+ used.
+
+2002-07-31 Nick Clifton <nickc@redhat.com>
+
+ * NEWS: Retroactively add entry for Lars Brinkhoff's contribution
+ of the PDP-11 and 2.11BSD a.out support.
+
+2002-07-31 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+ * Makefile.am (eelf32btsmipn32.o, eelf32ltsmipn32.o): New emulations
+ for n32 ABI support.
+ * Makefile.in: Regenerate.
+ * configure.tgt (mips64*el-*-linux-gnu*,mips64*-*-linux-gnu*): Add
+ n32 ABI emulations for these 64 bit targets.
+ * emulparams/elf32bmipn32.sh: Expand comment.
+ * emulparams/elf32btsmipn32.sh: New file, for traditional big endian
+ n32 ABI.
+ * emulparams/elf32ltsmipn32.sh: Likewise for little endian.
+
+2002-07-30 Graeme Peterson <gp@qnx.com>
+
+ * configure.tgt: Add support for arm-*-nto target.
+ * Makefile.am: Add earmnto.o file.
+ * Makefile.in: Regenerate.
+ * NEWS: Mention port of ARM support to QNX.
+ * emulparams/armnto.sh: New file.
+
+2002-07-30 Jakub Jelinek <jakub@redhat.com>
+
+ * ldlang.c (lang_add_section): Don't turn .tbss into normal sections
+ for relocatable link.
+ (lang_size_sections_1): Don't make .tbss zero size for relocatable
+ link.
+
+2002-07-26 Bernd Schmidt <bernds@redhat.com>
+
+ * emulparams/elf32frv.sh (OTHER_RELOCATING_SECTIONS): Delete.
+ (STACK_ADDR): New.
+
+2002-07-25 Nick Clifton <nickc@redhat.com>
+
+ * po/sv.po: Updated Swedish translation.
+ * po/es.po: Updated Spanish translation.
+ * po/fr.po: Updated French translation.
+
+2002-07-24 Nick Clifton <nickc@redhat.com>
+
+ * po/sv.po: Updated Swedish translation.
+ * po/es.po: Updated Spanish translation.
+
+2002-07-23 Nick Clifton <nickc@redhat.com>
+
+ * po/fr.po: Updated French translation.
+
+2002-07-20 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
+ bomb on /DISCARD/ input section.
+ * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
+ * emultempl/mmo.em (mmo_place_orphan): Likewise.
+
+2002-07-19 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * emultempl/mmo.em (mmo_place_orphan): Handle case of no .text
+ output section.
+
+2002-07-16 Denis Chertykov <denisc@overta.ru>
+ Nick Clifton <nickc@redhat.com>
+ Frank Ch. Eigler <fche@redhat.com>
+ John Healy <jhealy@redhat.com>
+
+ * configure.tgt: Add support for ip2k-elf.
+ * Makefile.am: Add support for ip2k-elf.
+ * Makefile.in: Regenerate.
+ * emulparams/elf32ip2k.sh: New file.
+ * scripttempl/ip2k.sc: New file
+ * NEWS: Mention support for new port.
+
+2002-07-16 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * NEWS: Add 'Changes in 2.13'.
+
+2002-07-14 H.J. Lu <hjl@gnu.org>
+
+ * ld.texinfo: Document a .symver takes precedence over a
+ version script.
+
+2002-07-12 Alan Modra <amodra@bigpond.net.au>
+
+ * emulparams/elf64ppc.sh (ARCH): Set to powerpc:common64.
+ (COMMONPAGESIZE): Define.
+
+2002-07-09 Alan Modra <amodra@bigpond.net.au>
+
+ * emulparams/hppanbsd.sh: Remark that hppaobsd.sh references this file.
+
+2002-07-09 Federico G. Schwindt <fgsch@olimpo.com.br>
+
+ * configure.tgt: Add support for alpha-*-openbsd*, hppa-*-openbsd*,
+ powerpc-*-openbsd* and sparc64-*-openbsd*.
+ * Makefile.am (ALL_EMULATIONS): Add ehppaobsd.o.
+ * Makefile.in: Regenerate.
+ * emulparams/hppaobsd.sh: New file.
+
+2002-07-05 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (print_wild_statement): Fix output formatting.
+
+2002-07-04 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c: (strip_excluded_output_sections): New function.
+ (lang_process): Call it.
+ (lang_size_sections_1): Revert 2002-06-10 change.
+
+2002-07-03 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.am (check-DEJAGNU): Revert 2002-06-25 change.
+ Run "make dep-am".
+ * Makefile.in: Regenerate.
+
+2002-07-02 Alan Modra <amodra@bigpond.net.au>
+
+ * ldfile.c (ldfile_try_open_bfd): Formatting.
+
+ * ldmisc.c (demangle): Move so that it doesn't intrude between
+ vfinfo comment and body. Add comment.
+
+2002-07-01 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * emulparams/vax.sh (OUTPUT_FORMAT): Use a.out-vax-bsd format.
+
+2002-07-01 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.h (entry_sym): Make it a struct bfd_sym_chain.
+ * ldlang.c (entry_sym): Likewise.
+ (ldlang_undef_chain_list_type): Likewise.
+ (lang_finish): Adjust references to entry_symbol.
+ (lang_add_entry): Likewise.
+ (lang_gc_sections): Use link_info.gc_sym_list.
+ (lang_process): Set link_info.gc_sym_list.
+ * ldlex.l: Include bfdlink.h.
+ * ldmain.c (main): Init link_info.gc_sym_list.
+ * emultempl/aix.em: Adjust references to entry_symbol.
+ * emultempl/armcoff.em: Likewise.
+ * emultempl/armelf.em: Likewise.
+ * emultempl/pe.em: Likewise.
+ * emultempl/ppc64elf.em (ppc_after_open): New function.
+ (LDEMUL_AFTER_OPEN): Define.
+ * emulparams/elf64ppc.sh: KEEP .opd sections.
+
+2002-06-29 Stephane Carrez <stcarrez@nerim.fr>
+
+ * emulparams/m68hc12elfb.sh (EEPROM_MEMORY): Define.
+ * emulparams/m68hc11elfb.sh (EEPROM_MEMORY): Define.
+ * emulparams/m68hc11elf.sh (EEPROM_SIZE): Define.
+ (EEPROM_START_ADDR): Define.
+ (EEPROM_MEMORY): Define.
+ * emulparams/m68hc12elf.sh: Likewise.
+ * scripttempl/elfm68hc11.sc: Handle .eeprom section; handle .softregs
+ section to put soft registers in .page0.
+ * scripttempl/elfm68hc12.sc: Likewise but put soft registers in bss.
+
+2002-06-26 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * emulparams/hppa64linux.sh (OTHER_GOT_RELOC_SECTIONS): Add rela.opd
+ section. Add ${RELOCATING-0}.
+
+2002-06-26 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * emulparams/shelf.sh (STACK_ADDR): Don't define.
+ (OTHER_SECTIONS): Define.
+ * emulparams/shelf_nbsd.sh ((STACK_ADDR): Don't undef.
+ (OTHER_SECTIONS): Undef.
+
+2002-06-26 Alan Modra <amodra@bigpond.net.au>
+
+ * ldmisc.c (demangle): Restore dots stripped from sym name.
+
+2002-06-25 H.J. Lu <hjl@gnu.org>
+
+ * Makefile.am (check-DEJAGNU): Set LC_ALL=C and export it.
+ * Makefile.in: Regenerated.
+
+2002-06-20 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * ld.texinfo (Bug Reporting): Update text to suggest a limit on
+ the size of attached object files, to allow make the object files
+ available via FTP or HTTP and to mention that the mail will be
+ sent to a mailing list.
+
+2002-06-20 Nathanael Nerode <neroden@twcny.rr.com>
+
+ * configure.host (romp): Drop support.
+
+2002-06-18 Chris Demetriou <cgd@broadcom.com>
+
+ * emultempl/mipself.em (mips_elf${ELFSIZE}_check_sections): Check
+ section flags for SEC_DATA, rather than for SEC_CODE being unset.
+
+2002-06-18 Chris Demetriou <cgd@broadcom.com>
+
+ * emultempl/mipself.em (mips_elf${ELFSIZE}_check_sections): Fix
+ format specifier used to print BFD name.
+
+2002-06-18 Dave Brolley <brolley@redhat.com>
+
+ From Catherine Moore, Michael Meissner, Jim Blandy:
+ * emulparams/elf32frv.sh: New file.
+ * configure.tgt: Support frv-*-*.
+ * Makefile.am (ALL_EMULATIONS): Add eelf32frv.o.
+ (eelf32frv.c): New target.
+
+2002-06-17 Tom Rix <trix@redhat.com>
+
+ * emultempl/elf32.em: gld*_get_script: Check for
+ GENERATE_COMBRELOC_SCRIPT.
+ * scripttempl/elfd10v.sc : Fix STACK and INSN.
+ * emulparams/d10velf.sh : Fix TEXT_START_ADDR.
+
+2002-06-13 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * configure.tgt: Add support for sh[1234]*le*-*-elf, sh[1234]*-*-elf.
+
+2002-06-12 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Return
+ false if xvec doesn't match.
+
+2002-06-10 Richard Sandiford <rsandifo@redhat.com>
+
+ * ldlang.c (lang_size_sections_1): Skip removed output sections.
+
+2002-06-08 Alan Modra <amodra@bigpond.net.au>
+
+ * ldexp.c: Replace CONST with const.
+ * ldfile.c: Likewise.
+ * ldfile.h: Likewise.
+ * ldlex.l: Likewise.
+ * mri.c: Likewise.
+ * pe-dll.h: Likewise.
+
+2002-06-07 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/ppc64elf.em (new_vers_pattern): Warning fix.
+
+2002-06-07 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * ldmain.c (main): initialize link_info.pei386_auto_import
+ to -1 == implicit enable.
+ * emultempl/pe.em (gld_${EMULATION_NAME}_before_parse):
+ initialize link_info.pei386_auto_import to -1 == implicit
+ enable.
+ (gld_${EMULATION_NAME}_parse_args): When processing
+ --enable-auto-import and --disable-auto-import options, use
+ '1' and '0' instead of 'true' and 'false'.
+ (pe_find_data_imports): Only issue message about auto-import
+ when the feature is implicitly enabled. Downgrade message to
+ informational instead of warning.
+
+2002-06-07 Alan Modra <amodra@bigpond.net.au>
+
+ * scripttempl/elf.sc (.tbss): Fix mismatched parentheses/braces.
+
+2002-06-06 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * configure.host (hppa*64*-*-hpux11*): Define NATIVE_LIB_DIRS,
+ HOSTING_CRT0 and HOSTING_LIBS.
+
+2002-06-05 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * configure.tgt (shle*-*-elf*, sh64le-*-elf*): New configurations.
+
+2002-06-05 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * emulparams/ns32knbsd.sh (EXECUTABLE_SYMBOLS): Set _DYNAMIC to 0.
+ (NONPAGED_TEXT_START_ADDR): Set to 0x1000.
+
+2002-06-05 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Place
+ SEC_EXCLUDE sections when doing a relocatable link.
+
+2002-06-04 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * Makefile.am (ALL_EMULATIONS): Add eshelf32_nbsd.o,
+ eshlelf32_nbsd.o, eshelf64_nbsd.o, and eshlelf64_nbsd.o.
+ (eshelf32_nbsd.c, eshelf64_nbsd.c, eshlelf32_nbsd.c)
+ (eshlelf64_nbsd.c): New rules.
+ * Makefile.in: Regenerate.
+ * configure.tgt (sh5le-*-netbsd*, sh5-*-netbsd*, sh64le-*-netbsd*)
+ (sh64-*-netbsd*): New targets.
+ * emulparams/shelf32_nbsd.sh: New file.
+ * emulparams/shelf64_nbsd.sh: New file.
+ * emulparams/shlelf32_nbsd.sh: New file.
+ * emulparams/shlelf64_nbsd.sh: New file.
+
+2002-06-04 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (section_already_linked): Call bfd_discard_group. Typo fix.
+
+2002-06-02 Marek Michalkiewicz <marekm@amelek.gda.pl>
+
+ * scripttempl/avr.sc: Changes to support current GCC and avr-libc,
+ C++ constructors/destructors, loosely based on the m68hc11 port.
+
+2002-05-31 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.in: Regenerate.
+ * aclocal.m4: Regenerate.
+ * config.in: Regenerate.
+ * configure: Regenerate.
+
+2002-05-31 Graeme Peterson <gp@qnx.com>
+
+ * Makefile.am (ALL_EMULATIONS): Add ei386nto.o.
+ (ei386nto.c): Add rule.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Add i[3456]86-*-nto-qnx*.
+ * emulparams/i386nto.sh: New file.
+
+2002-05-29 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * NEWS: Add entry for VAX ELF support.
+
+2002-05-29 Matt Thomas <matt@3am-software.com>
+ Jason Thorpe <thorpej@wasabisystems.com>
+
+ * Makefile.am (ALL_EMULATIONS): Add eelf32vax.o and evaxnbsd.o.
+ (eelf32vax.c)
+ (evaxnbsd.c): New rules.
+ * Makefile.in: Regenerate.
+ * configure.tgt (vax-*-netbsdelf*)
+ (vax-*-netbsdaout*)
+ (vax-*-netbsd*): New targets.
+ * emulparams/elf32vax.sh: New file.
+ * emulparams/vaxnbsd.sh: New file.
+
+2002-05-29 Adam Nemet <anemet@lnxw.com>
+
+ * emultempl/armelf.em (arm_elf_after_open): Don't determine
+ bfd_for_interwork, instead add glue sections to each input bfd.
+ (bfd_for_interwork): New global.
+ (arm_elf_set_bfd_for_interworking): New function.
+ (arm_elf_before_allocation): Use it.
+
+2002-05-28 Kuang Hwa Lin <kuang@sbcglobal.net>
+
+ * Makefile.am: Add DLX make target.
+ * configure.tgt: Add DLX configuration.
+ * Makefile.in: Regenerate.
+ * emulparams/elf32_dlx.sh: New file
+ * scripttempl/dlx.sc: New file
+
+2002-05-27 Per Lundberg <per@caleb.dnsalias.org>
+
+ * Makefile.am (eelf_i386_chaos): Use elf_chaos.sc script.
+ * Makefile.in: Regenerate.
+ * emulparams/elf_chaos.sh: Use elf_chaos script.
+ * scripttempl/elf_chaos.sc: New file.
+
+2002-05-27 Richard Sandiford <rsandifo@redhat.com>
+
+ * ldlang.c (lang_size_sections_1): Move check for conflicting load
+ addresses and regions from here...
+ (lang_get_regions): ...to this new function.
+ (lang_leave_output_section_statement): Use lang_get_regions.
+ (lang_leave_overlay): Likewise.
+ * mri.c (mri_draw_tree): Pass null as last argument to
+ lang_leave_output_section_statement.
+ * emultempl/elf32.em (gld*_place_orphan): Likewise.
+ * emultempl/mmo.em (mmo_place_orphan): Likewise.
+ * emultempl/pe.em (gld*_place_orphan): Likewise.
+
+2002-05-26 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * configure.tgt: Use ns32k-*-netbsd* instead of ns32k-pc532-netbsd*.
+
+2002-05-25 Kazu Hirata <kazu@cs.umass.edu>
+
+ * ldemul.c: Fix formatting.
+ * ldfile.c: Likewise.
+ * pe-dll.c: Likewise.
+ * pe-dll.h: Likewise.
+
+2002-05-25 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (lang_process): Formatting, grammar.
+
+ * ldlex.l: Use #include "" instead of <> for local header files.
+
+2002-05-24 TAMURA Kent <kent@netbsd.org>
+
+ * configure.tgt: Add a target for i386-netbsdpe.
+
+2002-05-23 Jakub Jelinek <jakub@redhat.com>
+
+ * scripttempl/elf.sc: Add .rel{,a}.t{bss,data}, .tdata and .tbss.
+ * ldlang.c (lang_add_section): Set SEC_THREAD_LOCAL for
+ output section if necessary. Handle .tbss.
+ (lang_size_sections): Clear _raw_size for .tbss section
+ (it allocates space in PT_TLS segment only).
+ * ldwrite.c (build_link_order): Build link order for .tbss too.
+
+2002-05-23 Alan Modra <amodra@bigpond.net.au>
+
+ * configure.in: Correct spelling of AC_PREREQ.
+
+2002-05-21 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * pe-dll.c (autofilter_liblist): Add more system libs excluded by
+ default.
+ (autofilter_objlist): Add crtbegin.o, crtend.o.
+
+2002-05-21 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * emultempl/pe.em (OPTION_EXCLUDE_LIBS): Add new define.
+ (longopts): Add new option --exclude-libs.
+ (gld_${EMULATION_NAME}_list_options): Give quick help about it.
+ (gld_${EMULATION_NAME}_parse_args): Use it.
+ * pe-dll.h (pe_dll_add_excludes): Add second param to prototype.
+ * pe-dll.c (exclude_list_struct): Add field type to distinguish symbols
+ from whole archives.
+ (pe_dll_add_excludes): Set excludes->type.
+ (auto_export): Add new variable libname and set to archive basename if
+ abfd. Use it when filtering default and user-specified libarary
+ excludes. Let string "ALL" mean all libs when filtering user-specified
+ libs.
+ * ld.texinfo: Document --exclude-libs.
+
+2002-05-22 Alan Modra <amodra@bigpond.net.au>
+
+ * ldemul.c (ldemul_new_vers_pattern): New function.
+ * ldemul.h (ldemul_new_vers_pattern): Declare.
+ (struct ld_emulation_xfer_struct): Add new_vers_pattern.
+ * ldlang.c (lang_new_vers_pattern): Call ldemul_new_vers_pattern.
+ * emultempl/ppc64elf.em (dotsyms): New static var.
+ (gld${EMULATION_NAME}_new_vers_pattern): New function.
+ (LDEMUL_NEW_VERS_PATTERN): Define.
+ (PARSE_AND_LIST_PROLOGUE): Add OPTION_DOTSYMS, OPTION_NO_DOTSYMS.
+ (PARSE_AND_LIST_LONGOPTS): Likewise.
+ (PARSE_AND_LIST_ARGS_CASES): Handle them.
+ * emultempl/aix.em (ld_${EMULATION_NAME}_emulation): Update
+ initialiser.
+ * emultempl/armcoff.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/linux.em: Likewise.
+ * emultempl/lnk960.em: Likewise.
+ * emultempl/m68kcoff.em: Likewise.
+ * emultempl/mipsecoff.em: Likewise.
+ * emultempl/pe.em: Likewise.
+ * emultempl/sunos.em: Likewise.
+ * emultempl/ticoff.em: Likewise.
+ * emultempl/vanilla.em: Likewise.
+
+2002-05-22 Alan Modra <amodra@bigpond.net.au>
+
+ * genscripts.sh (LIB_PATH): For native targets, concatenate $libdir
+ and $NATIVE_LIB_DIRS. Add $tool_lib before other libs.
+ (LIB_SEARCH_DIRS): No need to use "tr".
+ (COMPILE_IN): Only set for native targets.
+ * configure.host (NATIVE_LIB_DIRS): Specify all native search dirs
+ here, rather than adding lib:/usr/lib:/usr/local/lib in genscripts.sh.
+ * configure.tgt (powerpc*): Set tdir_*.
+ (powerpcle*): Correct targ_extra_emuls.
+ * emulparams/elf32ppc.sh (LIB_PATH): Set up native 64 bit dirs.
+ * emulparams/elf64ppc.sh (LIB_PATH): Likewise.
+
+2002-05-22 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/pe.em (set_pe_subsystem): Don't set "cmdline" when
+ calling lang_add_entry.
+
+2002-05-21 H.J. Lu (hjl@gnu.org)
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_parse_args): Handle
+ "-z muldefs".
+ (gld${EMULATION_NAME}_list_options): Add "-z muldefs".
+
+ * ld.texinfo: Updated for --allow-multiple-definition and
+ "-z muldefs".
+
+ * ldmain.c (main): Initialize the allow_multiple_definition
+ field to false.
+
+ * lexsup.c (OPTION_ALLOW_MULTIPLE_DEFINITION): New.
+ (ld_options): Add --allow-multiple-definition.
+ (parse_args): Support OPTION_ALLOW_MULTIPLE_DEFINITION.
+
+2002-05-21 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * Makefile.am (ALL_EMULATIONS): Add earmelfb_nbsd.o.
+ (earmelfb_nbsd.c): New rule.
+ * Makefile.in: Regenerate.
+ * configure.tgt (armeb-*-netbsdelf*): New target.
+ (arm-*-netbsdelf*): Add armelfb_nbsd to targ_extra_emuls.
+ (arm-*-netbsd*): Likewise.
+ * emulparams/armelfb_nbsd.sh: New file.
+
+2002-05-18 Tom Rix <trix@redhat.com>
+
+ * emultempl/aix.em (gld*_parse_args): Add -bnortl and -bnortllib
+ support.
+
+2002-05-17 Marek Michalkiewicz <marekm@amelek.gda.pl>
+
+ * Makefile.am: Add new emulations avr1, avr2, avr3, avr4, avr5.
+ * Makefile.in: Regenerate.
+ * configure.tgt (avr-*-*): Add avr[1-5] to targ_extra_emuls.
+
+2002-05-16 Marek Michalkiewicz <marekm@amelek.gda.pl>
+
+ * emulparams/avr1.sh: New file.
+ * emulparams/avr2.sh: New file.
+ * emulparams/avr3.sh: New file.
+ * emulparams/avr4.sh: New file.
+ * emulparams/avr5.sh: New file.
+ * scripttempl/avr.sc: New file.
+
+2002-05-15 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (section_already_linked): Call bfd_link_just_syms.
+ (lang_place_orphans): Abort if just_syms_flag.
+
+2002-05-10 Tom Rix <trix@redhat.com>
+
+ * emultempl/aix.em: (gld*_set_output_arch): New function. Use
+ architecture and machine information in the output bfd.
+ (gld*_before_parse): Remove old arch and machine code.
+ (choose_target): Rename to gld*_choose_target.
+ (rtld): Change type to int.
+ * ldfile.c (ldfile_try_open_bfd): Disable compatiblity check for
+ objects in XCOFF archives.
+ * ldfile.h: Update copyright date.
+
+2002-05-10 Jakub Jelinek <jakub@redhat.com>
+
+ * ldmain.c (main): Enable -z combreloc by default.
+
+2002-05-07 Federico G. Schwindt <fgsch@olimpo.com.br>
+
+ * Makefile.am: Honour DESTDIR.
+ * Makefile.in: Regenerate.
+
+2002-05-07 Richard Sandiford <rsandifo@redhat.com>
+
+ * ldlang.h (lang_output_section_statement_type): Add update_dot_tree.
+ (lang_enter_overlay): Remove the last two parameters.
+ (lang_leave_overlay): Take them here instead.
+ * ldgram.y (memspec_at_opt): Set $$ to null if no region is given.
+ (section): Pass LMA and crossref flag to lang_leave_overlay rather
+ than lang_enter_overlay.
+ * ldlang.c (lang_memory_region_lookup): Return null for null names.
+ (lang_output_section_statement_lookup): Initialize update_dot_tree.
+ (lang_size_sections_1): Evaluate it.
+ (lang_leave_output_section_statement): Rework LMA lookup.
+ (overlay_lma, overlay_nocrossrefs): Remove.
+ (lang_enter_overlay): Remove LMA and crossref arguments.
+ (lang_enter_overlay_section): Don't set the LMA here.
+ (lang_leave_overlay): Take LMA and crossref arguments. Move the '.'
+ assignment to the last section's update_dot_tree. Unconditionally
+ use the load and run-time regions specified in the OVERLAY statement.
+ Likewise the first section's LMA. Only set the other sections' LMAs
+ when no load region is given.
+
+2002-05-06 Nick Clifton <nickc@redhat.com>
+
+ * po/sv.po: New translation.
+
+2002-05-04 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/hppaelf.em (build_section_lists): New function.
+ (gld${EMULATION_NAME}_finish): Call elf32_hppa_setup_section_lists
+ and build_section_lists.
+
+2002-05-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * ld.h: Fix formatting.
+ * ldexp.c: Likewise.
+ * ldfile.c: Likewise.
+ * ldlang.c: Likewise.
+ * ldmain.c: Likewise.
+ * lexsup.c: Likewise.
+ * pe-dll.c: Likewise.
+
+2002-05-02 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/ppc64elf.em (gld${EMULATION_NAME}_after_allocation):
+ Adjust for ppc64_elf_set_toc change. #include libbfd.h.
+ (build_section_lists): Do output_section tests here.
+
+2002-04-30 Tom Rix <trix@redhat.com>
+
+ * emultempl/aix.em : (gld*_parse_arge): Formatting changes.
+
+2002-05-01 Alan Modra <amodra@bigpond.net.au>
+
+ Long branch stubs, multiple stub sections.
+ * emultempl/ppc64elf.em: Include ldctor.h.
+ (stub_file): New var.
+ (group_size): New var.
+ (ppc_create_output_section_statements): New function.
+ (struct hook_stub_info): New.
+ (hook_in_stub): New function.
+ (ppc_add_stub_section): New function.
+ (ppc_layout_sections_again): New function.
+ (build_section_lists): New function.
+ (gld${EMULATION_NAME}_finish): Rewrite.
+ (real_func): New var.
+ (ppc_for_each_input_file_wrapper): New function.
+ (ppc_lang_for_each_input_file): New function.
+ (lang_for_each_input_file): Define.
+ (PARSE_AND_LIST_PROLOGUE): Define.
+ (PARSE_AND_LIST_LONGOPTS): Define.
+ (PARSE_AND_LIST_OPTIONS): Define.
+ (PARSE_AND_LIST_ARGS_CASES): Define.
+ (LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Define.
+
+2002-04-30 Tom Rix <trix@redhat.com>
+
+ * emultempl/aix.em (gld*_parse_arge, gld*_before_allocation): Add
+ -blibpath, -bnolibpath support.
+
+2002-04-30 Mark Mitchell <mark@codesourcery.com>
+
+ * Makefile.am (ALL_EMULATIONS): Add elf32ppcwindiss.o.
+ (eelf32ppcwindiss.c): New target.
+ * Makefile.in: Regenerated.
+ * configure.tgt: Add support for powerpc-*-windiss.
+ * emulparams/elf32ppcwindiss.sh: New file.
+
+2002-04-30 Richard Sandiford <rsandifo@redhat.com>
+
+ * ldlang.c (print_assignment): Update print_dot for assignments to ".".
+ * ldexp.c (exp_print_token): Add "infix_p" argument.
+ (exp_print_tree): Update accordingly.
+
+2002-04-28 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.am (mpw): New maintainer mode rule to make mpw-*.c files.
+ * Makefile.in: Regenerate.
+ * mpw-elfmips.c: Delete.
+ * mpw-eppcmac.c: Delete.
+ * mpw-esh.c: Delete.
+ * mpw-idtmips.c: Delete.
+
+2002-04-17 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * emulparams/shelf32.sh (MACHINE): Now sh5.
+
+2002-04-17 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+ * ldgram.y: Fix syntax warning.
+
+2002-04-11 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * emultempl/armelf.em (PARSE_AND_LIST_SHORTOPTS): Add 'n' in order
+ to prevent "-n" from being taken as an abbreviation for
+ "--no-pipeline-knowledge".
+
+2002-04-08 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (lang_size_sections_1): Don't complain about
+ SEC_NEVER_LOAD sections having no memory region specified.
+
+ * ld.texinfo (Format Commands <OUTPUT_FORMAT>): Typo fix.
+
+2002-04-07 matthew green <mrg@redhat.com>
+
+ * configure.host (*-*-netbsd*): Add support for NetBSD/ELF.
+
+2002-04-04 Alan Modra <amodra@bigpond.net.au>
+
+ * dep-in.sed: Cope with absolute paths.
+ * Makefile.am (dep.sed): Subst TOPDIR and BFDDIR.
+ Run "make dep-am".
+ * Makefile.in: Regenerate.
+
+2002-04-04 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+ * emulparams/elf64btsmip.sh: n64 replaces .reginfo with .MIPS.options.
+
+2002-04-03 Jakub Jelinek <jakub@redhat.com>
+
+ * ldexp.c (fold_binary) [DATA_SEGMENT_ALIGN]: If common page size
+ is smaller than maximum, round dot up to common page boundary.
+
+2002-03-28 Alan Modra <amodra@bigpond.net.au>
+
+ * configure.host: Set up for generic hosts first, then tweak as
+ necessary in more specific targets.
+ (HOSTING_LIBS): Include libgcc_eh.a if found.
+
+2002-03-23 Andreas Jaeger <aj@suse.de>
+
+ * emulparams/elf_x86_64.sh (COMMONPAGESIZE): Set it.
+
+2002-03-21 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.am: Run "make dep-am".
+ * Makefile.in: Regenerate.
+
+2002-03-21 Albert Chin-A-Young <china@thewrittenword.com>
+
+ * genscripts.sh (LIB_SEARCH_DIRS): Quote path.
+
+2002-03-20 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (ldlang_add_undef): If the output bfd has been opened,
+ add the symbol to the linker hash table immediately.
+ (lang_place_undefineds): Split symbol creation out..
+ (insert_undefined): ..to here.
+
+2002-03-18 David O'Brien <obrien@FreeBSD.org>
+
+ * emultempl/elf32.em: Use lbasename vs. basename to fix problem where
+ the contents of the buffer returned from basename function will are
+ getting overwritten while still being used.
+
+2002-03-18 Jan Hubicka <jh@suse.cz>
+ Andreas Jaeger <aj@suse.de>
+ Andreas Schwab <schwab@suse.de>
+
+ * configure.tgt (x86_64-*-linux-gnu*): Configure i386 as native.
+ * elf_x86_64.sh (ARCH): Set to i386:x86-64
+ set libraries to default to lib64 paths.
+
+2002-03-18 Tom Rix <trix@redhat.com>
+
+ * Makefile.am : Add eaix5ppc and eaix5rs6, AIX 5 support.
+ * configure.tgt : Same.
+ * emulparms/aix5ppc.sh : New file. For eaix5ppc.
+ * emulparms/aix5rs6.sh : New file. For eaix5rs6.
+ * emulparms/aixppc.sh : OUPUT_FORMAT_32BIT and OUTPUT_FORMAT_64BIT
+ emulation parameters for better -b32, -b64 support.
+ * emulparms/aixrs6.sh : Same.
+ * emulparms/ppcmacos.sh : Same.
+ * emultempl/aix.em (choose_target) : Use new emulation parameters
+ OUTPUT_FORMAT_32BIT and OUTPUT_FORMAT_64BIT.
+ * Makefile.in : Regenerate.
+
+2002-03-18 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * po/fr.po: Updated version.
+
+2002-03-18 Alan Modra <amodra@bigpond.net.au>
+
+ * ldmain.c (main): Move .text readonly flag fudges from here..
+ * ldlang.c (lang_process): ..to here.
+
+2002-03-14 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (lang_check): Remove the word size check added in last
+ change. Treat emitrelocations case as for relocatable links.
+
+2002-03-13 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * po/fr.po: Updated version.
+
+2002-03-13 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (lang_check): Do relocatable link checks first, so that
+ warn_mismatch can't override. Check compatible and word size too.
+
+2002-03-07 Daniel Jacobowitz <drow@mvista.com>
+
+ * ld.texinfo: Wrap @menu in @ifnottex, not @ifinfo.
+
+2002-03-05 Jakub Jelinek <jakub@redhat.com>
+
+ * scripttempl/elf.sc: Only use DATA_SEGMENT_END() together with
+ DATA_SEGMENT_ALIGN.
+
+2002-03-04 H.J. Lu <hjl@gnu.org>
+
+ * scripttempl/elf.sc: Put .preinit_array, .init_array and
+ .fini_array in the data segment.
+
+2002-03-04 Alan Modra <amodra@bigpond.net.au>
+
+ * scripttempl/elf.sc: Correct syntax errors in 2002-03-01 commit.
+
+2002-03-01 David Mosberger <davidm@hpl.hp.com>
+
+ * scripttempl/elf.sc (SECTIONS): Add entries for .preinit_array,
+ .init_array, and .fini_array.
+
+2002-02-20 Andreas Schwab <schwab@suse.de>
+
+ * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Don't fold
+ .IA64_unwind* in a relocatable link.
+
+2002-02-20 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * NEWS: Mark 2.12 branch.
+
+2002-02-19 Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+ * emulparams/elf64_s390.sh (ARCH): Change to "s390:64-bit".
+ * emulparams/elf_s390.sh (ARCH): Change to "s390:31-bit".
+
+2002-02-18 Tom Rix <trix@redhat.com>
+
+ * emultempl/aix.em (gld*_parse_args): Add -brtl support.
+ (gld*_before_allocation): Same.
+ (gld*_create_output_section_statements): Generate
+ __rtinit if run time linking. Add librtl.a to the link.
+ (gld*_read_file): Clean.
+
+2002-02-18 Alan Modra <amodra@bigpond.net.au>
+
+ * emulparams/elf64ppc.sh (OTHER_TEXT_SECTIONS): Define.
+
+2002-02-18 David O'Brien <obrien@FreeBSD.org>
+
+ * Makefile.am: Add new files earmelf_fbsd, eelf32ppc_fbsd,
+ eelf_i386_fbsd, eelf64_ia64_fbsd, eelf_x86_64_fbsd, eelf64_sparc_fbsd,
+ and eelf64alpha_fbsd.
+ * Makefile.in: Regenerate.
+ * configure.tgt(sparc64-*-freebsd, ia64-*-freebsd, i[3456]86-*-freebsd,
+ x86_64-*-freebsd, arm-*-freebsd, alpha*-*-freebsd, powerpc-*-freebsd):
+ use a FreeBSD-specific emulation rather than the psABI one.
+ * emulparams/elf_fbsd.sh (ELF_INTERPRETER_NAME): Set appropriate value
+ for all FreeBSD ELF systems.
+ * emulparams/armelf_fbsd.sh: Bridge elf_fbsd.sh and the "native" psABI
+ emulation.
+ * emulparams/elf32ppc_fbsd.sh: Likewise.
+ * emulparams/elf64_ia64_fbsd.sh: Likewise.
+ * emulparams/elf64_sparc_fbsd.sh: Likewise.
+ * emulparams/elf64alpha_fbsd.sh: Likewise.
+ * emulparams/elf_i386_fbsd.sh: Likewise.
+ * emulparams/elf_x86_64_fbsd.sh: Likewise.
+
+2002-02-18 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * po/tr.po: Updated version.
+
+2002-02-18 Alan Modra <amodra@bigpond.net.au>
+
+ * ld.texinfo (Output Section Fill): Fix amateur texinfo.
+ (FILL): Likewise.
+
+2002-02-17 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * emultempl/mmo.em (mmo_after_open): Don't call
+ _bfd_mmix_check_all_relocs when producing ELF output.
+
+2002-02-15 Richard Henderson <rth@redhat.com>
+
+ * emulparams/elf64alpha.sh (NOP): Adjust for big-endian
+ definition. Emit a unop+nop pair.
+
+2002-02-15 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Also check
+ for presence of .MMIX.reg_contents.linker_allocated before early
+ exit.
+
+ * NEWS: Mention support for MMIX.
+
+2002-02-15 Alan Modra <amodra@bigpond.net.au>
+
+ Support arbitrary length fill patterns.
+ * ld.texinfo (Output Section Fill): Describe fill expressions.
+ (FILL): Refer to the above.
+ * ldexp.h (etree_value_type): Add "str" field.
+ (union etree_union): Add "str" to "value" struct.
+ (exp_bigintop): Declare.
+ (exp_get_fill): Declare.
+ * ldexp.c: Include "safe-ctype.h".
+ (exp_intop): Set value.str to NULL.
+ (exp_bigintop): New function.
+ (new_rel): Pass in "str", and set new.str from it.
+ (new_rel_from_section): Set new.str to NULL.
+ (fold_name): Adjust calls to new_rel.
+ (exp_fold_tree): Likewise.
+ (exp_get_fill): New function.
+ * ldgram.y (struct big_int bigint, fill_type *fill): New.
+ (INT): Returns a "bigint". Adjust all code handling INTs.
+ (fill_opt): Returns a "fill".
+ (fill_exp): Split out of fill_opt, use for FILL.
+ * ldlang.h (struct _fill_type): New.
+ (fill_type): Move typedef to ldexp.h.
+ (lang_output_section_statement_type): "fill" is now a pointer.
+ (lang_fill_statement_type): Likewise.
+ (lang_padding_statement_type): Likewise.
+ (lang_add_fill): Now takes a "fill_type *" param.
+ (lang_leave_output_section_statement): Likewise.
+ (lang_do_assignments): Likewise.
+ (lang_size_sections): Likewise.
+ (lang_leave_overlay_section): Likewise.
+ (lang_leave_overlay): Likewise.
+ * ldlang.c: Include ldgram.h after ldexp.h.
+ (lang_output_section_statement_lookup): Adjust for fill_type change.
+ (print_fill_statement): Likewise.
+ (print_padding_statement): Likewise.
+ (insert_pad): Now takes a "fill_type *" arg.
+ (size_input_section): Likewise.
+ (lang_size_sections_1): Likewise.
+ (lang_size_sections): Likewise.
+ (lang_do_assignments): Likewise.
+ (lang_add_fill): Likewise.
+ (lang_leave_output_section_statement): Likewise.
+ (lang_leave_overlay_section): Likewise.
+ (lang_leave_overlay): Likewise.
+ Adjust all callers of the above function.
+ * ldlex.l: Include ldgram.h after ldexp.h. Allow hex numbers
+ starting with "0X" as well as "0x". Return bigint.str for hex
+ numbers starting with "0x" or "0X", zero bigint.str otherwise.
+ Always use base 16 for numbers starting with "$".
+ * ldmain.c: Include ldgram.h after ldexp.h.
+ * ldwrite.c (build_link_order): Use bfd_data_link_order in place
+ of bfd_fill_link_order.
+ * pe-dll.c: Adjust lang_do_assignments calls.
+ * emultempl/elf32.em: Likewise.
+ * emultempl/hppaelf.em: Likewise.
+ * emultempl/ppc64elf.em: Likewise.
+ * emultempl/beos.em: Include ldgram.h after ldexp.h, adjust
+ lang_add_assignment call.
+ * emultempl/pe.em: Likewise.
+
+2002-02-14 Phil Edwards <pme@gcc.gnu.org>
+
+ * ld.texinfo (VERSION scripts): Symbol names are globbing patterns.
+ * ldgram.y (lang_new_vers_regex): Rename to lang_new_vers_pattern;
+ the pattern in question is not a regexp.
+ * ldlang.c: Likewise.
+ * ldlang.h: Likewise.
+ * ldlex.l (V_IDENTIFIER): Allow '[', ']', '-', '!', and '^' also.
+
+2002-02-12 Jakub Jelinek <jakub@redhat.com>
+
+ * ldlex.l (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): New tokens.
+ * ldgram.y (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): New tokens.
+ (exp): Add DATA_SEGMENT_ALIGN (exp, exp) and DATA_SEGMENT_END (exp).
+ * ldexp.c (exp_data_seg): New variable.
+ (exp_print_token): Handle DATA_SEGMENT_ALIGN and DATA_SEGMENT_END.
+ (fold_binary): Handle DATA_SEGMENT_ALIGN.
+ (exp_fold_tree): Handle DATA_SEGMENT_END.
+ Pass allocation_done when recursing instead of hardcoding
+ lang_allocating_phase_enum.
+ * ldexp.h (exp_data_seg): New.
+ * ldlang.c (lang_size_sections_1): Renamed from lang_size_sections.
+ (lang_size_sections): New.
+ * ld.texinfo (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): Document.
+ * scripttempl/elf.sc: Use DATA_SEGMENT_ALIGN and DATA_SEGMENT_END
+ if COMMONPAGESIZE is defined.
+ * emulparams/elf_i386.sh (COMMONPAGESIZE): Set to 4K.
+ * emulparams/elf32_sparc.sh (COMMONPAGESIZE): Set to 8K.
+ * emulparams/elf64_sparc.sh (COMMONPAGESIZE): Set to 8K.
+ * emulparams/elf64alpha.sh (COMMONPAGESIZE): Set to 8K.
+ * emulparams/elf64_ia64.sh (COMMONPAGESIZE): Set to 16K for shared
+ libraries only.
+
+2002-02-11 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.in: Regenerate.
+
+2002-02-10 Daniel Jacobowitz <drow@mvista.com>
+
+ * lexsup.c: Remove strtoul declaration.
+
+2002-02-10 Daniel Jacobowitz <drow@mvista.com>
+
+ * ldmain.c: Add prototype for main ().
+ * lexsup.c: Guard declaration of strtoul with HAVE_STDLIB_H.
+ * emultempl/lnk960.em (lnk960_choose_target): Function should
+ take two arguments.
+
+2002-02-10 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (entry_section): New initialised variable.
+ (lang_finish): Use it.
+ * ldlang.h (entry_section): Declare.
+ * emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Set
+ entry_section to ".opd".
+
+2002-02-09 Chris Demetriou <cgd@broadcom.com>
+
+ * ld.texinfo (Options): Add back in -nostdlib documentation,
+ which had been inadvertently removed.
+
+2002-02-09 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Adjust
+ register section vma to a sane value after emitting error. Make
+ fatal conditions cause program exit when emitting message.
+
+2002-02-08 Ivan Guzvinec <ivang@opencores.org>
+
+ * configure.tgt: Add or32-*-rtems target.
+
+2002-02-08 Alexandre Oliva <aoliva@redhat.com>
+
+ Contribute sh64-elf.
+ 2002-01-24 Alexandre Oliva <aoliva@redhat.com>
+ * emulparams/shelf32.sh (STACK_ADDR): Define as formerly defined
+ in OTHER_RELOCATABLE_SECTIONS.
+ 2002-01-18 Alexandre Oliva <aoliva@redhat.com>
+ * emulparams/shelf32.sh (STACK_ADDR): Define.
+ (OTHER_RELOCATABLE_SECTIONS): Renamed to...
+ (OTHER_SECTIONS): this. Removed stack settings.
+ * emulparams/shelf64.sh (OTHER_RELOCATABLE_SECTIONS): Do not set.
+ (OTHER_SECTIONS): Reset after sourcing shelf32.sh.
+ 2001-03-12 DJ Delorie <dj@redhat.com>
+ * emultempl/sh64elf.em (sh64_elf_$_before_allocation): Disable
+ relaxing if any shmedia or mixed sections are found.
+ 2001-03-07 DJ Delorie <dj@redhat.com>
+ * emultempl/sh64elf.em (sh64_elf_before_allocation): Pass f to
+ einfo. Gracefully decline to output to non-elf formats.
+ 2001-03-06 Hans-Peter Nilsson <hpn@redhat.com>
+ * emulparams/shelf64.sh (OTHER_RELOCATING_SECTIONS) <.stack>:
+ Default to _end aligned to next multiple of 0x40000, plus 0x40000.
+ * emulparams/shelf32.sh: Ditto.
+ 2001-01-14 Hans-Peter Nilsson <hpn@cygnus.com>
+ * emulparams/shelf32.sh (OTHER_RELOCATING_SECTIONS): Tweak
+ comment.
+ 2001-01-10 Ben Elliston <bje@redhat.com>
+ * emulparams/shelf32.sh (OTHER_RELOCATING_SECTIONS): Avoid
+ non-portable shell constructs. From Hans-Peter Nilsson.
+ 2001-01-09 Hans-Peter Nilsson <hpn@cygnus.com>
+ * emulparams/shelf64.sh (EXTRA_EM_FILE): Define empty.
+ * Makefile.am (eshelf64.c, eshlelf64.c, eshlelf32.c): Adjust
+ dependencies to the shell script include chain.
+ * Makefile.in: Regenerate.
+ 2001-01-06 Hans-Peter Nilsson <hpn@cygnus.com>
+ * emultempl/sh64elf.em: Update and tweak comments.
+ (sh64_elf_${EMULATION_NAME}_after_allocation): Always allocate and
+ make a .cranges section SEC_IN_MEMORY.
+ 2000-12-30 Hans-Peter Nilsson <hpn@cygnus.com>
+ * emultempl/sh64elf.em
+ (sh64_elf_${EMULATION_NAME}_before_allocation): Don't stop when
+ .cranges section found to be necessary; continue and set stored
+ section contents flags for sections with non-mixed contents.
+ Use a struct sh64_section_data container and sh64_elf_section_data
+ to store contents-type flags.
+ Remove unused update of "isec".
+ (sh64_elf_${EMULATION_NAME}_after_allocation): Only process
+ sections marked SHF_SH5_ISA32_MIXED. Use sh64_elf_section_data to
+ access contents-type flags. Assert that the associated container
+ is initialized. Use that container, not elf_gp_size, to hold size
+ of linker-generated cranges contents.
+ 2000-12-18 Hans-Peter Nilsson <hpn@cygnus.com>
+ * emultempl/sh64elf.em
+ (sh64_elf_${EMULATION_NAME}_before_allocation): Exit early if
+ there's already a .cranges section. When section flag difference
+ is found, don't NULL-check cranges a second time. Tweak comments.
+ (sh64_elf_${EMULATION_NAME}_after_allocation): Use size after
+ merging, not max size, as size of ld-generated .cranges contents.
+ Don't set ELF section flags in output section. When checking for
+ needed .cranges descriptors, don't use a variable; compare
+ incoming ELF section flags directly to SHF_SH5_ISA32_MIXED. Tweak
+ comments.
+ 2000-12-18 Hans-Peter Nilsson <hpn@cygnus.com>
+ * emultempl/sh64elf.em: New file.
+ * Makefile.am (eshelf32.c, eshlelf32.c): Adjust dependencies.
+ * Makefile.in: Regenerate.
+ * emulparams/shelf32.sh (OUTPUT_FORMAT): Only set if not set.
+ (OTHER_RELOCATING_SECTIONS): Ditto.
+ (EXTRA_EM_FILE): New, set to sh64elf if not set.
+ * emulparams/shlelf32.sh: Stub out all settings except
+ OUTPUT_FORMAT. Source shelf32.sh.
+ * emulparams/shelf64.sh: Similar, but also keep ELF_SIZE and
+ OTHER_RELOCATING_SECTIONS.
+ (OTHER_RELOCATING_SECTIONS): Remove .cranges.
+ * emulparams/shlelf64.sh: Stub out all settings except
+ OUTPUT_FORMAT. Source shelf64.sh.
+ 2000-12-15 Hans-Peter Nilsson <hpn@cygnus.com>
+ * emulparams/shelf64.sh (OTHER_RELOCATING_SECTIONS): Include
+ .cranges section.
+ (DATA_START_SYMBOLS): Define, provide ___data.
+ (OTHER_READONLY_SYMBOLS): Define, provide ___rodata and align to 8
+ for consecutive .data section.
+ (OTHER_GOT_SECTIONS): Define, align to 8 for consecutive .bss
+ section after .data section.
+ * emulparams/shlelf64.sh: Ditto.
+ * emulparams/shelf32.sh: Ditto.
+ (ALIGNMENT): Define to 8.
+ * emulparams/shelf32.sh: Ditto.
+ 2000-12-12 Hans-Peter Nilsson <hpn@cygnus.com>
+ * configure.tgt (sh64-*-elf*): Assign targ_extra_libpath to get
+ built-in linker scripts.
+ 2000-11-30 Hans-Peter Nilsson <hpn@cygnus.com>
+ * emulparams/shlelf64.sh: New.
+ * emulparams/shelf64.sh: New.
+ * configure.tgt (sh64-*-elf*): Add shelf64 and shlelf64 to
+ targ_extra_emuls.
+ * Makefile.am: Add support for shlelf64 and shelf64.
+ * Makefile.in: Regenerate.
+ 2000-11-29 Hans-Peter Nilsson <hpn@cygnus.com>
+ * configure.tgt (sh64-*-elf*): Add shelf as default.
+ Add shlelf to targ_extra_emuls.
+ 2000-11-24 Hans-Peter Nilsson <hpn@cygnus.com>
+ * emulparams/shelf32.sh: New file.
+ * emulparams/shlelf32.sh: New file.
+ * Makefile.am: Add support for shlelf32 and shelf32.
+ * configure.tgt: Map sh64-*-elf* to shlelf32 and shelf32.
+ * Makefile.in: Regenerate.
+
+2002-02-05 Hans-Peter Nilsson <hp@axis.com>
+
+ * ldlang.c (lang_reset_memory_regions): Rename from
+ reset_memory_regions. Change all callers. Make public.
+ * ldlang.h (lang_reset_memory_regions): Prototype.
+ * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Call
+ lang_reset_memory_regions before lang_size_sections.
+ * emultempl/hppaelf.em (hppaelf_layout_sections_again): Likewise.
+ * emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Likewise.
+
+2002-02-04 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Use signed
+ arithmetic when checking for too many global registers.
+
+2002-02-02 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * Makefile.am (ALL_EMULATIONS): Add ehppanbsd.o.
+ (ehppanbsd.c): New rule.
+ * Makefile.in: Regenerate.
+ * configure.tgt (hppa*-*-netbsd*): New target.
+ * emulparams/hppalinux.sh: Add comment to check other files
+ that source this file it is modified, and list which
+ files that do.
+ * emulparams/hppanbsd.sh: New file.
+
+2002-02-01 Geoffrey Keating <geoffk@redhat.com>
+
+ * scripttempl/xstormy16.sc: Don't allocate extra space for the
+ stack.
+
+2002-02-01 Hans-Peter Nilsson <hp@bitrange.com>
+
+ Support on-demand global register allocation from
+ R_MMIX_BASE_PLUS_OFFSET relocs.
+ * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Rename from
+ mmix_set_reg_section_vma. Call
+ _bfd_mmix_finalize_linker_allocated_gregs.
+ (mmix_before_allocation): New function.
+ (LDEMUL_AFTER_ALLOCATION): Set to mmix_after_allocation.
+ (LDEMUL_BEFORE_ALLOCATION): Define to mmix_before_allocation.
+ * scripttempl/mmo.sc (.text): Mark .init, .fini as KEEP.
+ (.MMIX.reg_contents): Add .MMIX.reg_contents.linker_allocated
+ before .MMIX.reg_contents.
+ * emultempl/mmo.em (gldmmo_before_allocation): Define to default.
+ (mmo_after_open): New function.
+ (LDEMUL_AFTER_OPEN): Define to mmo_after_open.
+ * emulparams/elf64mmix.sh (OTHER_SECTIONS): Tweak formatting. Add
+ .MMIX.reg_contents.linker_allocated before .MMIX.reg_contents.
+
+2002-01-31 Ivan Guzvinec <ivang@opencores.org>
+
+ * emulparams/or32.sh: New file.
+ * emulparams/or32elf.sh: New file.
+ * scripttempl/or32.sc: New file.
+ * configure.tgt : Add support for or32.
+ * configure: Regenerate
+ * Makefile.am: Add support for or32.
+ * Makefile.in: Regenerate.
+ * NEWS: Mention support for or32.
+ * po/ld.pot: Regenerate.
+
+2002-01-29 Chris Demetriou <cgd@broadcom.com>
+ Mitch Lichtenberg <mpl@broadcom.com>
+
+ * emulparams/elf32bmip.sh (EXTRA_EM_FILE): Define to be mipself.
+ * emultempl/mipself.em: New file to handle MIPS ELF embedded
+ reloc creation (ld --embedded-relocs).
+
+2002-01-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * configure: Regenerated.
+
+2002-01-26 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * Makefile.am (install): Depend on install-info.
+ * Makefile.in: Regenerate.
+
+2002-01-26 Christian Rose <menthos@menthos.com>
+
+ * ldmain.c (main): Use full sentences to ease translation.
+
+2002-01-26 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * po/fr.po: Updated version.
+
+2002-01-25 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * po/es.po: Updated version.
+
+2002-01-25 Andreas Jaeger <aj@suse.de>
+
+ * ldlex.l (yy_input): Correct error check.
+
+2002-01-25 Alan Modra <amodra@bigpond.net.au>
+
+ * ldmisc.c (demangle): Put back dots when string not demangled.
+
+2002-01-22 Richard Henderson <rth@redhat.com>
+
+ * emulparams/elf64alpha.sh (NOP): Use unop.
+
+2002-01-21 Andreas Jaeger <aj@suse.de>
+
+ * ldlex.l: Use fread instead of read.
+
+2002-01-21 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * configure.tgt (ia64-*-netbsd*): New target.
+
+2002-01-21 H.J. Lu <hjl@gnu.org>
+
+ * emulparams/elf32btsmip.sh (SHLIB_TEXT_START_ADDR): Change to
+ 0.
+ * emulparams/elf64btsmip.sh (SHLIB_TEXT_START_ADDR): Likewise.
+
+2002-01-18 Andreas Jaeger <aj@suse.de>
+
+ * ldver.c (ldversion): Update year.
+
+2002-01-17 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * po/ld.pot: Regenerate.
+
+2002-01-16 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.am (eelf64ppc.c, eelf64lppc.c): Depend on ppc64elf.em.
+ * Makefile.in: Regenerate.
+ * emulparams/elf64ppc.sh (EXTRA_EM_FILE): Define.
+ * emultempl/ppc64elf.em: New file.
+
+2002-01-15 DJ Delorie <dj@redhat.com>
+
+ * scripttempl/pe.sc: Add support for constructor priorities.
+
+2002-01-07 Marek Michalkiewicz <marekm@amelek.gda.pl>
+
+ * emulparams/avr1200.sh (DATA_START): Define as 0x60.
+ * emulparams/avr23xx.sh: Likewise.
+ * emulparams/avr4433.sh: Likewise.
+ * emulparams/avr44x4.sh: Likewise.
+ * emulparams/avr85xx.sh: Likewise.
+ * emulparams/avrmega103.sh: Likewise.
+ * emulparams/avrmega161.sh: Likewise.
+ * emulparams/avrmega603.sh: Likewise.
+ * scripttempl/elf32avr.sc: Use DATA_START instead of 0x60.
+
+2002-01-08 Alexandre Oliva <aoliva@redhat.com>
+
+ * ldlang.c (walk_wild_section): Exclude object file if enclosing
+ archive is excluded.
+
+2002-01-07 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * Makefile.am (ALL_EMULATIONS): Add eshelf_nbsd.o and eshlelf_nbsd.o.
+ (eshelf_nbsd.c): New rule.
+ (eshlelf_nbsd.c): New rule.
+ * Makefile.in: Regenerate.
+ * configure.tgt (sh*le-*-netbsdelf*): New target.
+ (sh*-*-netbsdelf*): New target.
+ * emulparams/shelf.sh: Document that shelf_nbsd.sh sources this file.
+ * emulparams/shelf_nbsd.sh: New emulation.
+ * emulparams/shlelf_nbsd.sh: New emulation.
+
+2002-01-07 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * po/es.po: New file: Spanish translation.
+ * configure.in (ALL_LINGUAS): Add es.
+ * configure: Regenerate.
+
+2002-01-06 John Marshall <jmarshall@acm.org>
+
+ * ld.texinfo: Note that --emit-relocs is currently only
+ implemented for ELF.
+
+2002-01-05 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Make use
+ of bfd_section_list_remove and bfd_section_list_insert macros.
+ * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
+ * emultempl/mmo.em (mmo_place_orphan): Likewise.
+
+2002-01-04 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * configure.tgt (x86_64-*-netbsd*): New target.
+
+For older changes see ChangeLog-0001
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/binutils/ld/ChangeLog-9197 b/contrib/binutils/ld/ChangeLog-9197
index 291326d..9307f33 100644
--- a/contrib/binutils/ld/ChangeLog-9197
+++ b/contrib/binutils/ld/ChangeLog-9197
@@ -7574,7 +7574,7 @@ Tue Oct 8 16:00:57 1991 Per Bothner (bothner at cygnus.com)
* Makefile.in: Add LIB_PATH macro, which if set is used to replace
the SEARCH_DIR commands in the scripts (using ugly sed magic).
This is primarily intended for cross-linking, where you would
- place libaries in a different place than native libraries.
+ place libraries in a different place than native libraries.
Also, emulations made from ldtemplate now use $(srcdir).
* scripttempl/ldglda29k.sc: Change SEARCH_DIR commands to a
conventional form; people can use the Makefile's LIB_PATH to
diff --git a/contrib/binutils/ld/Makefile.am b/contrib/binutils/ld/Makefile.am
index 8247d25..a2f1ac1 100644
--- a/contrib/binutils/ld/Makefile.am
+++ b/contrib/binutils/ld/Makefile.am
@@ -30,8 +30,9 @@ EMUL_EXTRA_OFILES = @EMUL_EXTRA_OFILES@
# (The default is usually /lib:/usr/lib:/usr/local/lib, unless building
# a cross-linker, in which case the default is empty. See genscripts.sh.)
# Otherwise, they are replaced with the ones given in LIB_PATH,
-# which may have the form: LIB_PATH=/lib:/usr/local/lib
-LIB_PATH =
+# which may have the form: LIB_PATH=/lib:/usr/local/lib. This can be set
+# when the linker is configured via the --with-lib-path configure switch.
+LIB_PATH = @LIB_PATH@
BASEDIR = $(srcdir)/..
BFDDIR = $(BASEDIR)/bfd
@@ -117,26 +118,22 @@ ALL_EMULATIONS = \
earmaoutl.o \
earmcoff.o \
earmelf.o \
+ earmelfb.o \
earmelf_fbsd.o \
earmelf_linux.o \
+ earmelfb_linux.o \
earmelf_nbsd.o \
earmelfb_nbsd.o \
earmelf_oabi.o \
+ earmnto.o \
earmnbsd.o \
earmpe.o \
- eavr1200.o \
- eavr23xx.o \
- eavr4433.o \
- eavr44x4.o \
- eavr85xx.o \
- eavrmega103.o \
- eavrmega161.o \
- eavrmega603.o \
- eavr1.o \
eavr2.o \
+ eavr1.o \
eavr3.o \
eavr4.o \
eavr5.o \
+ ecoff_i860.o \
ecoff_sparc.o \
ecrisaout.o \
ecriself.o \
@@ -155,25 +152,34 @@ ALL_EMULATIONS = \
eelf32bmip.o \
eelf32bmipn32.o \
eelf32btsmip.o \
+ eelf32btsmipn32.o \
eelf32ltsmip.o \
+ eelf32ltsmipn32.o \
eelf32ebmip.o \
eelf32elmip.o \
eelf32fr30.o \
eelf32frv.o \
eelf32i370.o \
+ eelf32ip2k.o \
+ eelf32iq2000.o \
+ eelf32iq10.o \
eelf32l4300.o \
eelf32lmip.o \
eelf32lppc.o \
+ eelf32lppcnto.o \
eelf32lppcsim.o \
eelf32mcore.o \
+ eelf32mipswindiss.o \
eelf32openrisc.o \
eelf32ppc.o \
eelf32ppc_fbsd.o \
eelf32ppclinux.o \
+ eelf32ppcnto.o \
eelf32ppcsim.o \
eelf32ppcwindiss.o \
eelf32vax.o \
eelf32xstormy16.o \
+ eelf32xtensa.o \
eelf_i386.o \
eelf_i386_be.o \
eelf_i386_chaos.o \
@@ -186,8 +192,16 @@ ALL_EMULATIONS = \
eh8300h.o \
eh8300s.o \
eh8300elf.o \
+ eh8300hn.o \
+ eh8300sn.o \
+ eh8300sx.o \
eh8300helf.o \
eh8300self.o \
+ eh8300hnelf.o \
+ eh8300snelf.o \
+ eh8300sxelf.o \
+ eh8300sxn.o \
+ eh8300sxnelf.o \
eh8500.o \
eh8500b.o \
eh8500c.o \
@@ -215,6 +229,10 @@ ALL_EMULATIONS = \
ei386pe.o \
ei386pe_posix.o \
elnk960.o \
+ em32relf.o \
+ em32rlelf.o \
+ em32relf_linux.o \
+ em32rlelf_linux.o \
em68hc11elf.o \
em68hc11elfb.o \
em68hc12elf.o \
@@ -238,6 +256,53 @@ ALL_EMULATIONS = \
emipslit.o \
emipslnews.o \
emipspe.o \
+ emsp430x110.o \
+ emsp430x112.o \
+ emsp430x1101.o \
+ emsp430x1111.o \
+ emsp430x1121.o \
+ emsp430x1122.o \
+ emsp430x1132.o \
+ emsp430x122.o \
+ emsp430x123.o \
+ emsp430x1222.o \
+ emsp430x1232.o \
+ emsp430x133.o \
+ emsp430x135.o \
+ emsp430x1331.o \
+ emsp430x1351.o \
+ emsp430x147.o \
+ emsp430x148.o \
+ emsp430x149.o \
+ emsp430x155.o \
+ emsp430x156.o \
+ emsp430x157.o \
+ emsp430x167.o \
+ emsp430x168.o \
+ emsp430x169.o \
+ emsp430x311.o \
+ emsp430x312.o \
+ emsp430x313.o \
+ emsp430x314.o \
+ emsp430x315.o \
+ emsp430x323.o \
+ emsp430x325.o \
+ emsp430x336.o \
+ emsp430x337.o \
+ emsp430x412.o \
+ emsp430x413.o \
+ emsp430xE423.o \
+ emsp430xE425.o \
+ emsp430xE427.o \
+ emsp430xW423.o \
+ emsp430xW425.o \
+ emsp430xW427.o \
+ emsp430x435.o \
+ emsp430x436.o \
+ emsp430x437.o \
+ emsp430x447.o \
+ emsp430x448.o \
+ emsp430x449.o \
enews.o \
ens32knbsd.o \
eor32.o \
@@ -254,6 +319,8 @@ ALL_EMULATIONS = \
esh.o \
eshelf32.o \
eshlelf32.o \
+ eshelf32_linux.o \
+ eshlelf32_linux.o \
eshelf32_nbsd.o \
eshlelf32_nbsd.o \
eshelf.o \
@@ -261,6 +328,8 @@ ALL_EMULATIONS = \
eshlelf_linux.o \
eshelf_nbsd.o \
eshlelf_nbsd.o \
+ eshelf_nto.o \
+ eshlelf_nto.o \
eshl.o \
eshlelf.o \
eshpe.o \
@@ -273,6 +342,9 @@ ALL_EMULATIONS = \
esun4.o \
etic30aout.o \
etic30coff.o \
+ etic3xcoff.o \
+ etic3xcoff_onchip.o \
+ etic4xcoff.o \
etic54xcoff.o \
etic80coff.o \
evanilla.o \
@@ -281,6 +353,7 @@ ALL_EMULATIONS = \
evsta.o \
ew65.o \
ez8001.o \
+ eelf32frvfd.o \
ez8002.o
ALL_64_EMULATIONS = \
@@ -337,11 +410,15 @@ EMULATION_FILES = emultempl/pe.em emultempl/armcoff.em
POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES)
po/POTFILES.in: @MAINT@ Makefile
- for file in $(POTFILES); do echo $$file; done | sort > tmp \
+ for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \
&& mv tmp $(srcdir)/po/POTFILES.in
ldmain.o: ldmain.c config.status
- $(COMPILE) -c -DDEFAULT_EMULATION='"$(EMUL)"' -DSCRIPTDIR='"$(scriptdir)"' -DTARGET='"@target@"' $(srcdir)/ldmain.c
+ $(COMPILE) -c -DDEFAULT_EMULATION='"$(EMUL)"' \
+ -DSCRIPTDIR='"$(scriptdir)"' -DBINDIR='"$(bindir)"' \
+ -DTOOLBINDIR='"$(tooldir)/bin"' \
+ -DTARGET='"@target@"' @TARGET_SYSTEM_ROOT_DEFINE@ \
+ $(srcdir)/ldmain.c
ldemul-list.h: Makefile
(echo "/* This file is automatically generated. DO NOT EDIT! */";\
@@ -363,8 +440,9 @@ stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
# These all start with e so 'make clean' can find them.
-GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
+GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@
GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
+
@TDIRS@
ea29k.c: $(srcdir)/emulparams/a29k.sh \
@@ -392,6 +470,10 @@ earmelf.c: $(srcdir)/emulparams/armelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf "$(tdir_armelf)"
+earmelfb.c: $(srcdir)/emulparams/armelfb.sh $(srcdir)/emulparams/armelf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armelfb "$(tdir_armelfb)"
earmelf_oabi.c: $(srcdir)/emulparams/armelf_oabi.sh \
$(srcdir)/emultempl/armelf_oabi.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf_oabi "$(tdir_armelf)"
@@ -404,6 +486,11 @@ earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf_linux "$(tdir_armelf_linux)"
+earmelfb_linux.c: $(srcdir)/emulparams/armelfb_linux.sh \
+ $(srcdir)/emulparams/armelf_linux.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armelfb_linux "$(tdir_armelfb_linux)"
earmelf_nbsd.c: $(srcdir)/emulparams/armelf_nbsd.sh \
$(srcdir)/emulparams/armelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
@@ -427,64 +514,39 @@ earmcoff.c: $(srcdir)/emulparams/armcoff.sh \
earmnbsd.c: $(srcdir)/emulparams/armnbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} armnbsd "$(tdir_armnbsd)"
+earmnto.c: $(srcdir)/emulparams/armnto.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armnto "$(tdir_armnto)"
earm_epoc_pe.c: $(srcdir)/emulparams/arm_epoc_pe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/epocpe.sc ${GEN_DEPENDS}
${GENSCRIPTS} arm_epoc_pe "$(tdir_armpe)"
earmpe.c: $(srcdir)/emulparams/armpe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
${GENSCRIPTS} armpe "$(tdir_armpe)"
-eavr85xx.c: $(srcdir)/emulparams/avr85xx.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr85xx "$(tdir_avr85xx)"
-eavr1200.c: $(srcdir)/emulparams/avr1200.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr1200 "$(tdir_avr85xx)"
-eavr23xx.c: $(srcdir)/emulparams/avr23xx.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr23xx "$(tdir_avr85xx)"
-eavr44x4.c: $(srcdir)/emulparams/avr44x4.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr44x4 "$(tdir_avr85xx)"
-eavr4433.c: $(srcdir)/emulparams/avr4433.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr4433 "$(tdir_avr85xx)"
-eavrmega603.c: $(srcdir)/emulparams/avrmega603.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avrmega603 "$(tdir_avr85xx)"
-eavrmega103.c: $(srcdir)/emulparams/avrmega103.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avrmega103 "$(tdir_avr85xx)"
-eavrmega161.c: $(srcdir)/emulparams/avrmega161.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avrmega161 "$(tdir_avr85xx)"
-eavr1.c: $(srcdir)/emulparams/avr1.sh \
+eavr2.c: $(srcdir)/emulparams/avr2.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \
${GEN_DEPENDS}
- ${GENSCRIPTS} avr1 "$(tdir_avr85xx)"
-eavr2.c: $(srcdir)/emulparams/avr2.sh \
+ ${GENSCRIPTS} avr2 "$(tdir_avr2)"
+eavr1.c: $(srcdir)/emulparams/avr1.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \
${GEN_DEPENDS}
- ${GENSCRIPTS} avr2 "$(tdir_avr85xx)"
+ ${GENSCRIPTS} avr1 "$(tdir_avr2)"
eavr3.c: $(srcdir)/emulparams/avr3.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \
${GEN_DEPENDS}
- ${GENSCRIPTS} avr3 "$(tdir_avr85xx)"
+ ${GENSCRIPTS} avr3 "$(tdir_avr2)"
eavr4.c: $(srcdir)/emulparams/avr4.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \
${GEN_DEPENDS}
- ${GENSCRIPTS} avr4 "$(tdir_avr85xx)"
+ ${GENSCRIPTS} avr4 "$(tdir_avr2)"
eavr5.c: $(srcdir)/emulparams/avr5.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \
${GEN_DEPENDS}
- ${GENSCRIPTS} avr5 "$(tdir_avr85xx)"
+ ${GENSCRIPTS} avr5 "$(tdir_avr2)"
+ecoff_i860.c: $(srcdir)/emulparams/coff_i860.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i860coff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} coff_i860 "$(tdir_coff_i860)"
ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
${GENSCRIPTS} coff_sparc "$(tdir_coff_sparc)"
@@ -522,9 +584,17 @@ eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32xstormy16 "$(tdir_xstormy16)"
+eelf32am33lin.c: $(srcdir)/emulparams/elf32am33lin.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32am33lin "$(tdir_mn10300)"
eelf32vax.c: $(srcdir)/emulparams/elf32vax.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32vax "$(tdir_elf32vax)"
+eelf32xtensa.c: $(srcdir)/emulparams/elf32xtensa.sh \
+ $(srcdir)/emulparams/xtensa-config.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/xtensaelf.em \
+ $(srcdir)/scripttempl/elfxtensa.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32xtensa "$(tdir_elf32xtensa)"
eelf32fr30.c: $(srcdir)/emulparams/elf32fr30.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32fr30 "$(tdir_fr30)"
@@ -537,6 +607,15 @@ eelf32mcore.c: $(srcdir)/emulparams/elf32mcore.sh \
em32relf.c: $(srcdir)/emulparams/m32relf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} m32relf "$(tdir_m32r)"
+em32rlelf.c: $(srcdir)/emulparams/m32rlelf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m32rlelf "$(tdir_m32rlelf)"
+em32relf_linux.c: $(srcdir)/emulparams/m32relf_linux.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m32relf_linux "$(tdir_m32relf_linux)"
+em32rlelf_linux.c: $(srcdir)/emulparams/m32rlelf_linux.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m32rlelf_linux "$(tdir_m32rlelf_linux)"
eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
@@ -547,73 +626,101 @@ eelf32_i960.c: $(srcdir)/emulparams/elf32_i960.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_i960 "$(tdir_elf32_i960)"
eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
- $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)"
eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/irix.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32bsmip "$(tdir_elf32bsmip)"
eelf32btsmip.c: $(srcdir)/emulparams/elf32btsmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)"
+eelf32btsmipn32.c: $(srcdir)/emulparams/elf32btsmipn32.sh \
+ $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32btsmipn32 "$(tdir_elf32btsmipn32)"
eelf32ltsmip.c: $(srcdir)/emulparams/elf32ltsmip.sh \
$(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ltsmip "$(tdir_elf32ltsmip)"
+eelf32ltsmipn32.c: $(srcdir)/emulparams/elf32ltsmipn32.sh \
+ $(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emultempl/mipself.em \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ltsmipn32 "$(tdir_elf32ltsmipn32)"
eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
$(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \
+ $(srcdir)/emultempl/irix.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32bmipn32 "$(tdir_elf32bmipn32)"
eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \
$(srcdir)/emulparams/elf32b4300.sh $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)"
eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)"
+eelf32mipswindiss.c: $(srcdir)/emulparams/elf32mipswindiss.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32mipswindiss "$(tdir_elf32mipswindiss)"
eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
- $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lppc "$(tdir_elf32lppc)"
+eelf32lppcnto.c: $(srcdir)/emulparams/elf32lppcnto.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32lppcnto "$(tdir_elf32lppcnto)"
eelf32lppcsim.c: $(srcdir)/emulparams/elf32lppcsim.sh \
$(srcdir)/emulparams/elf32lppc.sh $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emultempl/ppc32elf.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lppcsim "$(tdir_elf32lppcsim)"
-eelf32ppcwindiss.c: $(srcdir)/emulparams/elf32ppcwindiss.sh ${GEN_DEPENDS}
+eelf32ppcnto.c: $(srcdir)/emulparams/elf32ppcnto.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ppcnto "$(tdir_elf32ppcnto)"
+eelf32ppcwindiss.c: $(srcdir)/emulparams/elf32ppcwindiss.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppcwindiss "$(tdir_elf32ppcwindiss)"
eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \
$(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lsmip "$(tdir_elf32lsmip)"
eelf32openrisc.c: $(srcdir)/emulparams/elf32openrisc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32openrisc "$(tdir_openrisc)"
-eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
+eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
eelf32ppc_fbsd.c: $(srcdir)/emulparams/elf32ppc_fbsd.sh \
- $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppc_fbsd "$(tdir_elf32ppc_fbsd)"
eelf32ppcsim.c: $(srcdir)/emulparams/elf32ppcsim.sh \
- $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppcsim "$(tdir_elf32ppcsim)"
eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
- $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppclinux "$(tdir_elf32ppclinux)"
eelf64ppc.c: $(srcdir)/emulparams/elf64ppc.sh $(srcdir)/emultempl/ppc64elf.em \
@@ -626,6 +733,15 @@ eelf64lppc.c: $(srcdir)/emulparams/elf64lppc.sh \
eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfi370.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32i370 "$(tdir_elf32i370)"
+eelf32ip2k.c: $(srcdir)/emulparams/elf32ip2k.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/ip2k.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ip2k "$(tdir_ip2k)"
+eelf32iq2000.c: $(srcdir)/emulparams/elf32iq2000.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/iq2000.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32iq2000 "$(tdir_iq2000)"
+eelf32iq10.c: $(srcdir)/emulparams/elf32iq10.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/iq2000.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32iq10 "$(tdir_iq10)"
eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
@@ -645,12 +761,14 @@ eelf64_aix.c: $(srcdir)/emulparams/elf64_aix.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_aix "$(tdir_elf64_aix)"
eelf64_ia64.c: $(srcdir)/emulparams/elf64_ia64.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/ia64elf.em \
+ $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_ia64 "$(tdir_elf64_ia64)"
eelf64_ia64_fbsd.c: $(srcdir)/emulparams/elf64_ia64_fbsd.sh \
$(srcdir)/emulparams/elf64_ia64.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/ia64elf.em \
+ $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_ia64_fbsd "$(tdir_elf64_ia64_fbsd)"
eelf64_s390.c: $(srcdir)/emulparams/elf64_s390.sh \
@@ -664,7 +782,7 @@ eelf64_sparc_fbsd.c: $(srcdir)/emulparams/elf64_sparc_fbsd.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_sparc_fbsd "$(tdir_elf64_sparc_fbsd)"
eelf64bmip.c: $(srcdir)/emulparams/elf64bmip.sh \
- $(srcdir)/emulparams/elf32bmipn32.sh \
+ $(srcdir)/emulparams/elf32bmipn32.sh $(srcdir)/emultempl/irix.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64bmip "$(tdir_elf64bmip)"
eelf64mmix.c: $(srcdir)/emulparams/elf64mmix.sh \
@@ -724,6 +842,18 @@ eh8300h.c: $(srcdir)/emulparams/h8300h.sh \
eh8300s.c: $(srcdir)/emulparams/h8300s.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300s.sc ${GEN_DEPENDS}
${GENSCRIPTS} h8300s "$(tdir_h8300s)"
+eh8300hn.c: $(srcdir)/emulparams/h8300hn.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300hn.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300hn "$(tdir_h8300hn)"
+eh8300sn.c: $(srcdir)/emulparams/h8300sn.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sn.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300sn "$(tdir_h8300sn)"
+eh8300sx.c: $(srcdir)/emulparams/h8300sx.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sx.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300sx "$(tdir_h8300sx)"
+eh8300sxn.c: $(srcdir)/emulparams/h8300sxn.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sxn.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300sxn "$(tdir_h8300sxn)"
eh8300elf.c: $(srcdir)/emulparams/h8300elf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} h8300elf "$(tdir_h8300elf)"
@@ -735,6 +865,22 @@ eh8300self.c: $(srcdir)/emulparams/h8300self.sh \
$(srcdir)/emulparams/h8300elf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} h8300self "$(tdir_h8300self)"
+eh8300hnelf.c: $(srcdir)/emulparams/h8300hnelf.sh \
+ $(srcdir)/emulparams/h8300elf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300hnelf "$(tdir_h8300hnelf)"
+eh8300snelf.c: $(srcdir)/emulparams/h8300snelf.sh \
+ $(srcdir)/emulparams/h8300elf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300snelf "$(tdir_h8300snelf)"
+eh8300sxelf.c: $(srcdir)/emulparams/h8300sxelf.sh \
+ $(srcdir)/emulparams/h8300elf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300sxelf "$(tdir_h8300sxelf)"
+eh8300sxnelf.c: $(srcdir)/emulparams/h8300sxnelf.sh \
+ $(srcdir)/emulparams/h8300elf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300sxnelf "$(tdir_h8300sxnelf)"
eh8500.c: $(srcdir)/emulparams/h8500.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
${GENSCRIPTS} h8500 "$(tdir_h8500)"
@@ -825,16 +971,20 @@ elnk960.c: $(srcdir)/emulparams/lnk960.sh \
$(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
${GENSCRIPTS} lnk960 "$(tdir_lnk960)"
em68hc11elf.c: $(srcdir)/emulparams/m68hc11elf.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc11elf "$(tdir_m68hc11)"
em68hc11elfb.c: $(srcdir)/emulparams/m68hc11elfb.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc11elfb "$(tdir_m68hc11b)"
em68hc12elf.c: $(srcdir)/emulparams/m68hc12elf.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc12elf "$(tdir_m68hc12)"
em68hc12elfb.c: $(srcdir)/emulparams/m68hc12elfb.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc12elfb "$(tdir_m68hc12b)"
em68k4knbsd.c: $(srcdir)/emulparams/m68k4knbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
@@ -903,11 +1053,200 @@ emn10300.c: $(srcdir)/emulparams/mn10300.sh \
emn10200.c: $(srcdir)/emulparams/mn10200.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} mn10200 "$(tdir_mn10200)"
+emsp430x110.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x110 "$(tdir_msp430x110)" msp430all
+emsp430x112.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x112 "$(tdir_msp430x112)" msp430all
+emsp430x1101.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1101 "$(tdir_msp430x1101)" msp430all
+emsp430x1111.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1111 "$(tdir_msp430x1111)" msp430all
+emsp430x1121.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1121 "$(tdir_msp430x1121)" msp430all
+emsp430x1122.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1122 "$(tdir_msp430x1122)" msp430all
+emsp430x1132.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1132 "$(tdir_msp430x1132)" msp430all
+emsp430x122.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x122 "$(tdir_msp430x122)" msp430all
+emsp430x123.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x123 "$(tdir_msp430x123)" msp430all
+emsp430x1222.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1222 "$(tdir_msp430x1222)" msp430all
+emsp430x1232.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1232 "$(tdir_msp430x1232)" msp430all
+emsp430x133.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x133 "$(tdir_msp430x133)" msp430all
+emsp430x135.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x135 "$(tdir_msp430x135)" msp430all
+emsp430x1331.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1331 "$(tdir_msp430x1331)" msp430all
+emsp430x1351.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1351 "$(tdir_msp430x1351)" msp430all
+emsp430x147.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x147 "$(tdir_msp430x147)" msp430all
+emsp430x148.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x148 "$(tdir_msp430x148)" msp430all
+emsp430x149.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x149 "$(tdir_msp430x149)" msp430all
+emsp430x155.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x155 "$(tdir_msp430x155)" msp430all
+emsp430x156.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x156 "$(tdir_msp430x156)" msp430all
+emsp430x157.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x157 "$(tdir_msp430x157)" msp430all
+emsp430x167.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x167 "$(tdir_msp430x167)" msp430all
+emsp430x168.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x168 "$(tdir_msp430x168)" msp430all
+emsp430x169.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x169 "$(tdir_msp430x169)" msp430all
+emsp430x311.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x311 "$(tdir_msp430x311)" msp430all
+emsp430x312.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x312 "$(tdir_msp430x312)" msp430all
+emsp430x313.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x313 "$(tdir_msp430x313)" msp430all
+emsp430x314.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x314 "$(tdir_msp430x314)" msp430all
+emsp430x315.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x315 "$(tdir_msp430x315)" msp430all
+emsp430x323.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x323 "$(tdir_msp430x323)" msp430all
+emsp430x325.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x325 "$(tdir_msp430x325)" msp430all
+emsp430x336.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x336 "$(tdir_msp430x336)" msp430all
+emsp430x337.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x337 "$(tdir_msp430x337)" msp430all
+emsp430x412.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x412 "$(tdir_msp430x412)" msp430all
+emsp430x413.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x413 "$(tdir_msp430x413)" msp430all
+emsp430xE423.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xE423 "$(tdir_msp430xE423)" msp430all
+emsp430xE425.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xE425 "$(tdir_msp430xE425)" msp430all
+emsp430xE427.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xE427 "$(tdir_msp430xE427)" msp430all
+emsp430xW423.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xW423 "$(tdir_msp430xW423)" msp430all
+emsp430xW425.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xW425 "$(tdir_msp430xW425)" msp430all
+emsp430xW427.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xW427 "$(tdir_msp430xW427)" msp430all
+emsp430x435.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x435 "$(tdir_msp430x435)" msp430all
+emsp430x436.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x436 "$(tdir_msp430x436)" msp430all
+emsp430x437.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x437 "$(tdir_msp430x437)" msp430all
+emsp430x447.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x447 "$(tdir_msp430x447)" msp430all
+emsp430x448.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x448 "$(tdir_msp430x448)" msp430all
+emsp430x449.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x449 "$(tdir_msp430x449)" msp430all
enews.c: $(srcdir)/emulparams/news.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} news "$(tdir_news)"
ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/netbsd.em \
+ $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} ns32knbsd "$(tdir_ns32knbsd)"
eor32.c: $(srcdir)/emulparams/or32.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/or32.sc ${GEN_DEPENDS}
@@ -953,6 +1292,12 @@ eshelf32.c: $(srcdir)/emulparams/shelf32.sh \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shelf32 "$(tdir_shelf32)"
+eshelf32_linux.c: $(srcdir)/emulparams/shelf32_linux.sh \
+ $(srcdir)/emulparams/shelf32.sh \
+ $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+ $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} shelf32_linux "$(tdir_shelf32_linux)"
eshelf32_nbsd.c: $(srcdir)/emulparams/shelf32_nbsd.sh \
$(srcdir)/emulparams/shelf32.sh \
$(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
@@ -977,11 +1322,17 @@ eshelf_nbsd.c: $(srcdir)/emulparams/shelf_nbsd.sh \
$(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shelf_nbsd "$(tdir_shelf_nbsd)"
+eshelf_nto.c: $(srcdir)/emulparams/shelf_nto.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} shelf_nto "$(tdir_shelf_nto)"
eshlelf_nbsd.c: $(srcdir)/emulparams/shlelf_nbsd.sh \
$(srcdir)/emulparams/shelf_nbsd.sh \
$(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf_nbsd "$(tdir_shlelf_nbsd)"
+eshlelf_nto.c: $(srcdir)/emulparams/shlelf_nto.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} shlelf_nto "$(tdir_shlelf_nto)"
eshlelf.c: $(srcdir)/emulparams/shlelf.sh \
$(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -991,6 +1342,12 @@ eshlelf32.c: $(srcdir)/emulparams/shlelf32.sh \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf32 "$(tdir_shlelf32)"
+eshlelf32_linux.c: $(srcdir)/emulparams/shlelf32_linux.sh \
+ $(srcdir)/emulparams/shelf32_linux.sh $(srcdir)/emulparams/shelf32.sh \
+ $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+ $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} shlelf32_linux "$(tdir_shlelf32_linux)"
eshlelf32_nbsd.c: $(srcdir)/emulparams/shlelf32_nbsd.sh \
$(srcdir)/emulparams/shelf32_nbsd.sh $(srcdir)/emulparams/shelf32.sh \
$(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
@@ -1040,6 +1397,15 @@ etic30aout.c: $(srcdir)/emulparams/tic30aout.sh \
etic30coff.c: $(srcdir)/emulparams/tic30coff.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30coff.sc ${GEN_DEPENDS}
${GENSCRIPTS} tic30coff "$(tdir_tic30coff)"
+etic3xcoff.c: $(srcdir)/emulparams/tic3xcoff.sh \
+ $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} tic3xcoff "$(tdir_tic4xcoff)"
+etic3xcoff_onchip.c: $(srcdir)/emulparams/tic3xcoff_onchip.sh \
+ $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} tic3xcoff_onchip "$(tdir_tic4xcoff)"
+etic4xcoff.c: $(srcdir)/emulparams/tic4xcoff.sh \
+ $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} tic4xcoff "$(tdir_tic4xcoff)"
etic54xcoff.c: $(srcdir)/emulparams/tic54xcoff.sh \
$(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic54xcoff.sc ${GEN_DEPENDS}
${GENSCRIPTS} tic54xcoff "$(tdir_tic54xcoff)"
@@ -1070,6 +1436,10 @@ ez8001.c: $(srcdir)/emulparams/z8001.sh \
ez8002.c: $(srcdir)/emulparams/z8002.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
${GENSCRIPTS} z8002 "$(tdir_z8002)"
+eelf32frvfd.c: $(srcdir)/emulparams/elf32frvfd.sh \
+ $(srcdir)/emulparams/elf32frv.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32frvfd "$(tdir_frv)"
# We need this for automake to use YLWRAP.
EXTRA_ld_new_SOURCES = deffilep.y
@@ -1186,7 +1556,7 @@ ld.dvi: $(srcdir)/ld.texinfo configdoc.texi ldver.texi
# Build the man page from the texinfo file
# The sed command removes the no-adjust Nroff command so that
# the man output looks standard.
-ld.1: $(srcdir)/ld.texinfo
+ld.1: $(srcdir)/ld.texinfo configdoc.texi ldver.texi
touch $@
-$(TEXI2POD) $(MANCONF) < $(srcdir)/ld.texinfo > ld.pod
-($(POD2MAN) ld.pod | \
@@ -1331,13 +1701,14 @@ ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h ld.h $(INCDIR)/bin-bugs.h \
ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h ldgram.h \
- ldlex.h ldemul.h $(INCDIR)/libiberty.h
+ ldlex.h ldemul.h $(INCDIR)/libiberty.h $(INCDIR)/filenames.h
ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \
$(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldmain.h \
ldexp.h ldlang.h ldgram.h ldlex.h ldmisc.h ldctor.h \
- ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h
+ ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h \
+ $(INCDIR)/hashtab.h
ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h $(INCDIR)/progress.h \
@@ -1345,18 +1716,19 @@ ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
ldmain.h ldmisc.h ldwrite.h ldexp.h ldlang.h ldgram.h \
ldlex.h ldfile.h ldemul.h ldctor.h
ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h $(INCDIR)/demangle.h ld.h $(INCDIR)/bin-bugs.h \
- ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h \
- ldfile.h
+ $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h sysdep.h config.h \
+ $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \
+ ld.h $(INCDIR)/bin-bugs.h ldmisc.h ldexp.h ldlang.h \
+ ldgram.h ldlex.h ldmain.h ldfile.h
ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
- ld.h $(INCDIR)/bin-bugs.h ldver.h ldexp.h ldlang.h \
- ldfile.h ldemul.h ldmain.h
+ $(INCDIR)/symcat.h ../bfd/bfdver.h sysdep.h config.h \
+ $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h ldver.h \
+ ldexp.h ldlang.h ldfile.h ldemul.h ldmain.h
ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h \
- ldexp.h ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h
+ $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \
+ ld.h $(INCDIR)/bin-bugs.h ldexp.h ldlang.h ldwrite.h \
+ ldmisc.h ldgram.h ldmain.h
lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h \
@@ -1381,7 +1753,7 @@ ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \
ldver.h ldlang.h ldfile.h ldemul.h ldmisc.h ldmain.h \
mri.h ldctor.h ldlex.h
-ldlex.o: ldlex.c $(INCDIR)/ansidecl.h ../bfd/bfd.h \
+ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h \
ldmisc.h ldexp.h ldlang.h ldgram.h ldfile.h ldlex.h \
diff --git a/contrib/binutils/ld/Makefile.in b/contrib/binutils/ld/Makefile.in
index f9d9fa4..976d5db 100644
--- a/contrib/binutils/ld/Makefile.in
+++ b/contrib/binutils/ld/Makefile.in
@@ -100,12 +100,15 @@ POSUB = @POSUB@
RANLIB = @RANLIB@
STRINGIFY = @STRINGIFY@
STRIP = @STRIP@
+TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
+TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
bfdincludedir = @bfdincludedir@
bfdlibdir = @bfdlibdir@
l = @l@
+use_sysroot = @use_sysroot@
INTLLIBS = @INTLLIBS@
@@ -136,8 +139,9 @@ EMUL_EXTRA_OFILES = @EMUL_EXTRA_OFILES@
# (The default is usually /lib:/usr/lib:/usr/local/lib, unless building
# a cross-linker, in which case the default is empty. See genscripts.sh.)
# Otherwise, they are replaced with the ones given in LIB_PATH,
-# which may have the form: LIB_PATH=/lib:/usr/local/lib
-LIB_PATH =
+# which may have the form: LIB_PATH=/lib:/usr/local/lib. This can be set
+# when the linker is configured via the --with-lib-path configure switch.
+LIB_PATH = @LIB_PATH@
BASEDIR = $(srcdir)/..
BFDDIR = $(BASEDIR)/bfd
@@ -228,26 +232,22 @@ ALL_EMULATIONS = \
earmaoutl.o \
earmcoff.o \
earmelf.o \
+ earmelfb.o \
earmelf_fbsd.o \
earmelf_linux.o \
+ earmelfb_linux.o \
earmelf_nbsd.o \
earmelfb_nbsd.o \
earmelf_oabi.o \
+ earmnto.o \
earmnbsd.o \
earmpe.o \
- eavr1200.o \
- eavr23xx.o \
- eavr4433.o \
- eavr44x4.o \
- eavr85xx.o \
- eavrmega103.o \
- eavrmega161.o \
- eavrmega603.o \
- eavr1.o \
eavr2.o \
+ eavr1.o \
eavr3.o \
eavr4.o \
eavr5.o \
+ ecoff_i860.o \
ecoff_sparc.o \
ecrisaout.o \
ecriself.o \
@@ -266,25 +266,34 @@ ALL_EMULATIONS = \
eelf32bmip.o \
eelf32bmipn32.o \
eelf32btsmip.o \
+ eelf32btsmipn32.o \
eelf32ltsmip.o \
+ eelf32ltsmipn32.o \
eelf32ebmip.o \
eelf32elmip.o \
eelf32fr30.o \
eelf32frv.o \
eelf32i370.o \
+ eelf32ip2k.o \
+ eelf32iq2000.o \
+ eelf32iq10.o \
eelf32l4300.o \
eelf32lmip.o \
eelf32lppc.o \
+ eelf32lppcnto.o \
eelf32lppcsim.o \
eelf32mcore.o \
+ eelf32mipswindiss.o \
eelf32openrisc.o \
eelf32ppc.o \
eelf32ppc_fbsd.o \
eelf32ppclinux.o \
+ eelf32ppcnto.o \
eelf32ppcsim.o \
eelf32ppcwindiss.o \
eelf32vax.o \
eelf32xstormy16.o \
+ eelf32xtensa.o \
eelf_i386.o \
eelf_i386_be.o \
eelf_i386_chaos.o \
@@ -297,8 +306,16 @@ ALL_EMULATIONS = \
eh8300h.o \
eh8300s.o \
eh8300elf.o \
+ eh8300hn.o \
+ eh8300sn.o \
+ eh8300sx.o \
eh8300helf.o \
eh8300self.o \
+ eh8300hnelf.o \
+ eh8300snelf.o \
+ eh8300sxelf.o \
+ eh8300sxn.o \
+ eh8300sxnelf.o \
eh8500.o \
eh8500b.o \
eh8500c.o \
@@ -326,6 +343,10 @@ ALL_EMULATIONS = \
ei386pe.o \
ei386pe_posix.o \
elnk960.o \
+ em32relf.o \
+ em32rlelf.o \
+ em32relf_linux.o \
+ em32rlelf_linux.o \
em68hc11elf.o \
em68hc11elfb.o \
em68hc12elf.o \
@@ -349,6 +370,53 @@ ALL_EMULATIONS = \
emipslit.o \
emipslnews.o \
emipspe.o \
+ emsp430x110.o \
+ emsp430x112.o \
+ emsp430x1101.o \
+ emsp430x1111.o \
+ emsp430x1121.o \
+ emsp430x1122.o \
+ emsp430x1132.o \
+ emsp430x122.o \
+ emsp430x123.o \
+ emsp430x1222.o \
+ emsp430x1232.o \
+ emsp430x133.o \
+ emsp430x135.o \
+ emsp430x1331.o \
+ emsp430x1351.o \
+ emsp430x147.o \
+ emsp430x148.o \
+ emsp430x149.o \
+ emsp430x155.o \
+ emsp430x156.o \
+ emsp430x157.o \
+ emsp430x167.o \
+ emsp430x168.o \
+ emsp430x169.o \
+ emsp430x311.o \
+ emsp430x312.o \
+ emsp430x313.o \
+ emsp430x314.o \
+ emsp430x315.o \
+ emsp430x323.o \
+ emsp430x325.o \
+ emsp430x336.o \
+ emsp430x337.o \
+ emsp430x412.o \
+ emsp430x413.o \
+ emsp430xE423.o \
+ emsp430xE425.o \
+ emsp430xE427.o \
+ emsp430xW423.o \
+ emsp430xW425.o \
+ emsp430xW427.o \
+ emsp430x435.o \
+ emsp430x436.o \
+ emsp430x437.o \
+ emsp430x447.o \
+ emsp430x448.o \
+ emsp430x449.o \
enews.o \
ens32knbsd.o \
eor32.o \
@@ -365,6 +433,8 @@ ALL_EMULATIONS = \
esh.o \
eshelf32.o \
eshlelf32.o \
+ eshelf32_linux.o \
+ eshlelf32_linux.o \
eshelf32_nbsd.o \
eshlelf32_nbsd.o \
eshelf.o \
@@ -372,6 +442,8 @@ ALL_EMULATIONS = \
eshlelf_linux.o \
eshelf_nbsd.o \
eshlelf_nbsd.o \
+ eshelf_nto.o \
+ eshlelf_nto.o \
eshl.o \
eshlelf.o \
eshpe.o \
@@ -384,6 +456,9 @@ ALL_EMULATIONS = \
esun4.o \
etic30aout.o \
etic30coff.o \
+ etic3xcoff.o \
+ etic3xcoff_onchip.o \
+ etic4xcoff.o \
etic54xcoff.o \
etic80coff.o \
evanilla.o \
@@ -392,6 +467,7 @@ ALL_EMULATIONS = \
evsta.o \
ew65.o \
ez8001.o \
+ eelf32frvfd.o \
ez8002.o
@@ -455,7 +531,7 @@ POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES)
# These all start with e so 'make clean' can find them.
-GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
+GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@
GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
# We need this for automake to use YLWRAP.
@@ -526,7 +602,7 @@ deffilep.c ldgram.c ldlex.c
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
+TAR = gtar
GZIP_ENV = --best
SOURCES = $(ld_new_SOURCES) $(EXTRA_ld_new_SOURCES)
OBJECTS = $(ld_new_OBJECTS)
@@ -1065,11 +1141,15 @@ mostlyclean distclean maintainer-clean
po/POTFILES.in: @MAINT@ Makefile
- for file in $(POTFILES); do echo $$file; done | sort > tmp \
+ for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \
&& mv tmp $(srcdir)/po/POTFILES.in
ldmain.o: ldmain.c config.status
- $(COMPILE) -c -DDEFAULT_EMULATION='"$(EMUL)"' -DSCRIPTDIR='"$(scriptdir)"' -DTARGET='"@target@"' $(srcdir)/ldmain.c
+ $(COMPILE) -c -DDEFAULT_EMULATION='"$(EMUL)"' \
+ -DSCRIPTDIR='"$(scriptdir)"' -DBINDIR='"$(bindir)"' \
+ -DTOOLBINDIR='"$(tooldir)/bin"' \
+ -DTARGET='"@target@"' @TARGET_SYSTEM_ROOT_DEFINE@ \
+ $(srcdir)/ldmain.c
ldemul-list.h: Makefile
(echo "/* This file is automatically generated. DO NOT EDIT! */";\
@@ -1088,6 +1168,7 @@ ldemul-list.h: Makefile
stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
cp ${srcdir}/emultempl/$(STRINGIFY) stringify.sed
+
@TDIRS@
ea29k.c: $(srcdir)/emulparams/a29k.sh \
@@ -1115,6 +1196,10 @@ earmelf.c: $(srcdir)/emulparams/armelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf "$(tdir_armelf)"
+earmelfb.c: $(srcdir)/emulparams/armelfb.sh $(srcdir)/emulparams/armelf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armelfb "$(tdir_armelfb)"
earmelf_oabi.c: $(srcdir)/emulparams/armelf_oabi.sh \
$(srcdir)/emultempl/armelf_oabi.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf_oabi "$(tdir_armelf)"
@@ -1127,6 +1212,11 @@ earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf_linux "$(tdir_armelf_linux)"
+earmelfb_linux.c: $(srcdir)/emulparams/armelfb_linux.sh \
+ $(srcdir)/emulparams/armelf_linux.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armelfb_linux "$(tdir_armelfb_linux)"
earmelf_nbsd.c: $(srcdir)/emulparams/armelf_nbsd.sh \
$(srcdir)/emulparams/armelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
@@ -1150,64 +1240,39 @@ earmcoff.c: $(srcdir)/emulparams/armcoff.sh \
earmnbsd.c: $(srcdir)/emulparams/armnbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} armnbsd "$(tdir_armnbsd)"
+earmnto.c: $(srcdir)/emulparams/armnto.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armnto "$(tdir_armnto)"
earm_epoc_pe.c: $(srcdir)/emulparams/arm_epoc_pe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/epocpe.sc ${GEN_DEPENDS}
${GENSCRIPTS} arm_epoc_pe "$(tdir_armpe)"
earmpe.c: $(srcdir)/emulparams/armpe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
${GENSCRIPTS} armpe "$(tdir_armpe)"
-eavr85xx.c: $(srcdir)/emulparams/avr85xx.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr85xx "$(tdir_avr85xx)"
-eavr1200.c: $(srcdir)/emulparams/avr1200.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr1200 "$(tdir_avr85xx)"
-eavr23xx.c: $(srcdir)/emulparams/avr23xx.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr23xx "$(tdir_avr85xx)"
-eavr44x4.c: $(srcdir)/emulparams/avr44x4.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr44x4 "$(tdir_avr85xx)"
-eavr4433.c: $(srcdir)/emulparams/avr4433.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr4433 "$(tdir_avr85xx)"
-eavrmega603.c: $(srcdir)/emulparams/avrmega603.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avrmega603 "$(tdir_avr85xx)"
-eavrmega103.c: $(srcdir)/emulparams/avrmega103.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avrmega103 "$(tdir_avr85xx)"
-eavrmega161.c: $(srcdir)/emulparams/avrmega161.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avrmega161 "$(tdir_avr85xx)"
-eavr1.c: $(srcdir)/emulparams/avr1.sh \
+eavr2.c: $(srcdir)/emulparams/avr2.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \
${GEN_DEPENDS}
- ${GENSCRIPTS} avr1 "$(tdir_avr85xx)"
-eavr2.c: $(srcdir)/emulparams/avr2.sh \
+ ${GENSCRIPTS} avr2 "$(tdir_avr2)"
+eavr1.c: $(srcdir)/emulparams/avr1.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \
${GEN_DEPENDS}
- ${GENSCRIPTS} avr2 "$(tdir_avr85xx)"
+ ${GENSCRIPTS} avr1 "$(tdir_avr2)"
eavr3.c: $(srcdir)/emulparams/avr3.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \
${GEN_DEPENDS}
- ${GENSCRIPTS} avr3 "$(tdir_avr85xx)"
+ ${GENSCRIPTS} avr3 "$(tdir_avr2)"
eavr4.c: $(srcdir)/emulparams/avr4.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \
${GEN_DEPENDS}
- ${GENSCRIPTS} avr4 "$(tdir_avr85xx)"
+ ${GENSCRIPTS} avr4 "$(tdir_avr2)"
eavr5.c: $(srcdir)/emulparams/avr5.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \
${GEN_DEPENDS}
- ${GENSCRIPTS} avr5 "$(tdir_avr85xx)"
+ ${GENSCRIPTS} avr5 "$(tdir_avr2)"
+ecoff_i860.c: $(srcdir)/emulparams/coff_i860.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i860coff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} coff_i860 "$(tdir_coff_i860)"
ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
${GENSCRIPTS} coff_sparc "$(tdir_coff_sparc)"
@@ -1245,9 +1310,17 @@ eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32xstormy16 "$(tdir_xstormy16)"
+eelf32am33lin.c: $(srcdir)/emulparams/elf32am33lin.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32am33lin "$(tdir_mn10300)"
eelf32vax.c: $(srcdir)/emulparams/elf32vax.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32vax "$(tdir_elf32vax)"
+eelf32xtensa.c: $(srcdir)/emulparams/elf32xtensa.sh \
+ $(srcdir)/emulparams/xtensa-config.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/xtensaelf.em \
+ $(srcdir)/scripttempl/elfxtensa.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32xtensa "$(tdir_elf32xtensa)"
eelf32fr30.c: $(srcdir)/emulparams/elf32fr30.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32fr30 "$(tdir_fr30)"
@@ -1260,6 +1333,15 @@ eelf32mcore.c: $(srcdir)/emulparams/elf32mcore.sh \
em32relf.c: $(srcdir)/emulparams/m32relf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} m32relf "$(tdir_m32r)"
+em32rlelf.c: $(srcdir)/emulparams/m32rlelf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m32rlelf "$(tdir_m32rlelf)"
+em32relf_linux.c: $(srcdir)/emulparams/m32relf_linux.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m32relf_linux "$(tdir_m32relf_linux)"
+em32rlelf_linux.c: $(srcdir)/emulparams/m32rlelf_linux.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} m32rlelf_linux "$(tdir_m32rlelf_linux)"
eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
@@ -1270,73 +1352,101 @@ eelf32_i960.c: $(srcdir)/emulparams/elf32_i960.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_i960 "$(tdir_elf32_i960)"
eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
- $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)"
eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/irix.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32bsmip "$(tdir_elf32bsmip)"
eelf32btsmip.c: $(srcdir)/emulparams/elf32btsmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)"
+eelf32btsmipn32.c: $(srcdir)/emulparams/elf32btsmipn32.sh \
+ $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32btsmipn32 "$(tdir_elf32btsmipn32)"
eelf32ltsmip.c: $(srcdir)/emulparams/elf32ltsmip.sh \
$(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ltsmip "$(tdir_elf32ltsmip)"
+eelf32ltsmipn32.c: $(srcdir)/emulparams/elf32ltsmipn32.sh \
+ $(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emultempl/mipself.em \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ltsmipn32 "$(tdir_elf32ltsmipn32)"
eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
$(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \
+ $(srcdir)/emultempl/irix.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32bmipn32 "$(tdir_elf32bmipn32)"
eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \
$(srcdir)/emulparams/elf32b4300.sh $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)"
eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)"
+eelf32mipswindiss.c: $(srcdir)/emulparams/elf32mipswindiss.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32mipswindiss "$(tdir_elf32mipswindiss)"
eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
- $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lppc "$(tdir_elf32lppc)"
+eelf32lppcnto.c: $(srcdir)/emulparams/elf32lppcnto.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32lppcnto "$(tdir_elf32lppcnto)"
eelf32lppcsim.c: $(srcdir)/emulparams/elf32lppcsim.sh \
$(srcdir)/emulparams/elf32lppc.sh $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emultempl/ppc32elf.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lppcsim "$(tdir_elf32lppcsim)"
-eelf32ppcwindiss.c: $(srcdir)/emulparams/elf32ppcwindiss.sh ${GEN_DEPENDS}
+eelf32ppcnto.c: $(srcdir)/emulparams/elf32ppcnto.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ppcnto "$(tdir_elf32ppcnto)"
+eelf32ppcwindiss.c: $(srcdir)/emulparams/elf32ppcwindiss.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppcwindiss "$(tdir_elf32ppcwindiss)"
eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \
$(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
+ $(srcdir)/emultempl/mipself.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lsmip "$(tdir_elf32lsmip)"
eelf32openrisc.c: $(srcdir)/emulparams/elf32openrisc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32openrisc "$(tdir_openrisc)"
-eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
+eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
eelf32ppc_fbsd.c: $(srcdir)/emulparams/elf32ppc_fbsd.sh \
- $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppc_fbsd "$(tdir_elf32ppc_fbsd)"
eelf32ppcsim.c: $(srcdir)/emulparams/elf32ppcsim.sh \
- $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppcsim "$(tdir_elf32ppcsim)"
eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
- $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppclinux "$(tdir_elf32ppclinux)"
eelf64ppc.c: $(srcdir)/emulparams/elf64ppc.sh $(srcdir)/emultempl/ppc64elf.em \
@@ -1349,6 +1459,15 @@ eelf64lppc.c: $(srcdir)/emulparams/elf64lppc.sh \
eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfi370.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32i370 "$(tdir_elf32i370)"
+eelf32ip2k.c: $(srcdir)/emulparams/elf32ip2k.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/ip2k.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ip2k "$(tdir_ip2k)"
+eelf32iq2000.c: $(srcdir)/emulparams/elf32iq2000.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/iq2000.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32iq2000 "$(tdir_iq2000)"
+eelf32iq10.c: $(srcdir)/emulparams/elf32iq10.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/iq2000.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32iq10 "$(tdir_iq10)"
eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
@@ -1368,12 +1487,14 @@ eelf64_aix.c: $(srcdir)/emulparams/elf64_aix.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_aix "$(tdir_elf64_aix)"
eelf64_ia64.c: $(srcdir)/emulparams/elf64_ia64.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/ia64elf.em \
+ $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_ia64 "$(tdir_elf64_ia64)"
eelf64_ia64_fbsd.c: $(srcdir)/emulparams/elf64_ia64_fbsd.sh \
$(srcdir)/emulparams/elf64_ia64.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/ia64elf.em \
+ $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_ia64_fbsd "$(tdir_elf64_ia64_fbsd)"
eelf64_s390.c: $(srcdir)/emulparams/elf64_s390.sh \
@@ -1387,7 +1508,7 @@ eelf64_sparc_fbsd.c: $(srcdir)/emulparams/elf64_sparc_fbsd.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_sparc_fbsd "$(tdir_elf64_sparc_fbsd)"
eelf64bmip.c: $(srcdir)/emulparams/elf64bmip.sh \
- $(srcdir)/emulparams/elf32bmipn32.sh \
+ $(srcdir)/emulparams/elf32bmipn32.sh $(srcdir)/emultempl/irix.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64bmip "$(tdir_elf64bmip)"
eelf64mmix.c: $(srcdir)/emulparams/elf64mmix.sh \
@@ -1447,6 +1568,18 @@ eh8300h.c: $(srcdir)/emulparams/h8300h.sh \
eh8300s.c: $(srcdir)/emulparams/h8300s.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300s.sc ${GEN_DEPENDS}
${GENSCRIPTS} h8300s "$(tdir_h8300s)"
+eh8300hn.c: $(srcdir)/emulparams/h8300hn.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300hn.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300hn "$(tdir_h8300hn)"
+eh8300sn.c: $(srcdir)/emulparams/h8300sn.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sn.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300sn "$(tdir_h8300sn)"
+eh8300sx.c: $(srcdir)/emulparams/h8300sx.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sx.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300sx "$(tdir_h8300sx)"
+eh8300sxn.c: $(srcdir)/emulparams/h8300sxn.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sxn.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300sxn "$(tdir_h8300sxn)"
eh8300elf.c: $(srcdir)/emulparams/h8300elf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} h8300elf "$(tdir_h8300elf)"
@@ -1458,6 +1591,22 @@ eh8300self.c: $(srcdir)/emulparams/h8300self.sh \
$(srcdir)/emulparams/h8300elf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} h8300self "$(tdir_h8300self)"
+eh8300hnelf.c: $(srcdir)/emulparams/h8300hnelf.sh \
+ $(srcdir)/emulparams/h8300elf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300hnelf "$(tdir_h8300hnelf)"
+eh8300snelf.c: $(srcdir)/emulparams/h8300snelf.sh \
+ $(srcdir)/emulparams/h8300elf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300snelf "$(tdir_h8300snelf)"
+eh8300sxelf.c: $(srcdir)/emulparams/h8300sxelf.sh \
+ $(srcdir)/emulparams/h8300elf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300sxelf "$(tdir_h8300sxelf)"
+eh8300sxnelf.c: $(srcdir)/emulparams/h8300sxnelf.sh \
+ $(srcdir)/emulparams/h8300elf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} h8300sxnelf "$(tdir_h8300sxnelf)"
eh8500.c: $(srcdir)/emulparams/h8500.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
${GENSCRIPTS} h8500 "$(tdir_h8500)"
@@ -1548,16 +1697,20 @@ elnk960.c: $(srcdir)/emulparams/lnk960.sh \
$(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
${GENSCRIPTS} lnk960 "$(tdir_lnk960)"
em68hc11elf.c: $(srcdir)/emulparams/m68hc11elf.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc11elf "$(tdir_m68hc11)"
em68hc11elfb.c: $(srcdir)/emulparams/m68hc11elfb.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc11elfb "$(tdir_m68hc11b)"
em68hc12elf.c: $(srcdir)/emulparams/m68hc12elf.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc12elf "$(tdir_m68hc12)"
em68hc12elfb.c: $(srcdir)/emulparams/m68hc12elfb.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc12elfb "$(tdir_m68hc12b)"
em68k4knbsd.c: $(srcdir)/emulparams/m68k4knbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
@@ -1626,11 +1779,200 @@ emn10300.c: $(srcdir)/emulparams/mn10300.sh \
emn10200.c: $(srcdir)/emulparams/mn10200.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} mn10200 "$(tdir_mn10200)"
+emsp430x110.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x110 "$(tdir_msp430x110)" msp430all
+emsp430x112.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x112 "$(tdir_msp430x112)" msp430all
+emsp430x1101.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1101 "$(tdir_msp430x1101)" msp430all
+emsp430x1111.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1111 "$(tdir_msp430x1111)" msp430all
+emsp430x1121.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1121 "$(tdir_msp430x1121)" msp430all
+emsp430x1122.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1122 "$(tdir_msp430x1122)" msp430all
+emsp430x1132.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1132 "$(tdir_msp430x1132)" msp430all
+emsp430x122.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x122 "$(tdir_msp430x122)" msp430all
+emsp430x123.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x123 "$(tdir_msp430x123)" msp430all
+emsp430x1222.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1222 "$(tdir_msp430x1222)" msp430all
+emsp430x1232.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1232 "$(tdir_msp430x1232)" msp430all
+emsp430x133.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x133 "$(tdir_msp430x133)" msp430all
+emsp430x135.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x135 "$(tdir_msp430x135)" msp430all
+emsp430x1331.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1331 "$(tdir_msp430x1331)" msp430all
+emsp430x1351.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1351 "$(tdir_msp430x1351)" msp430all
+emsp430x147.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x147 "$(tdir_msp430x147)" msp430all
+emsp430x148.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x148 "$(tdir_msp430x148)" msp430all
+emsp430x149.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x149 "$(tdir_msp430x149)" msp430all
+emsp430x155.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x155 "$(tdir_msp430x155)" msp430all
+emsp430x156.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x156 "$(tdir_msp430x156)" msp430all
+emsp430x157.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x157 "$(tdir_msp430x157)" msp430all
+emsp430x167.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x167 "$(tdir_msp430x167)" msp430all
+emsp430x168.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x168 "$(tdir_msp430x168)" msp430all
+emsp430x169.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x169 "$(tdir_msp430x169)" msp430all
+emsp430x311.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x311 "$(tdir_msp430x311)" msp430all
+emsp430x312.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x312 "$(tdir_msp430x312)" msp430all
+emsp430x313.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x313 "$(tdir_msp430x313)" msp430all
+emsp430x314.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x314 "$(tdir_msp430x314)" msp430all
+emsp430x315.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x315 "$(tdir_msp430x315)" msp430all
+emsp430x323.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x323 "$(tdir_msp430x323)" msp430all
+emsp430x325.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x325 "$(tdir_msp430x325)" msp430all
+emsp430x336.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x336 "$(tdir_msp430x336)" msp430all
+emsp430x337.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x337 "$(tdir_msp430x337)" msp430all
+emsp430x412.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x412 "$(tdir_msp430x412)" msp430all
+emsp430x413.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x413 "$(tdir_msp430x413)" msp430all
+emsp430xE423.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xE423 "$(tdir_msp430xE423)" msp430all
+emsp430xE425.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xE425 "$(tdir_msp430xE425)" msp430all
+emsp430xE427.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xE427 "$(tdir_msp430xE427)" msp430all
+emsp430xW423.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xW423 "$(tdir_msp430xW423)" msp430all
+emsp430xW425.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xW425 "$(tdir_msp430xW425)" msp430all
+emsp430xW427.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xW427 "$(tdir_msp430xW427)" msp430all
+emsp430x435.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x435 "$(tdir_msp430x435)" msp430all
+emsp430x436.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x436 "$(tdir_msp430x436)" msp430all
+emsp430x437.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x437 "$(tdir_msp430x437)" msp430all
+emsp430x447.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x447 "$(tdir_msp430x447)" msp430all
+emsp430x448.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x448 "$(tdir_msp430x448)" msp430all
+emsp430x449.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x449 "$(tdir_msp430x449)" msp430all
enews.c: $(srcdir)/emulparams/news.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} news "$(tdir_news)"
ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/netbsd.em \
+ $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} ns32knbsd "$(tdir_ns32knbsd)"
eor32.c: $(srcdir)/emulparams/or32.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/or32.sc ${GEN_DEPENDS}
@@ -1676,6 +2018,12 @@ eshelf32.c: $(srcdir)/emulparams/shelf32.sh \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shelf32 "$(tdir_shelf32)"
+eshelf32_linux.c: $(srcdir)/emulparams/shelf32_linux.sh \
+ $(srcdir)/emulparams/shelf32.sh \
+ $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+ $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} shelf32_linux "$(tdir_shelf32_linux)"
eshelf32_nbsd.c: $(srcdir)/emulparams/shelf32_nbsd.sh \
$(srcdir)/emulparams/shelf32.sh \
$(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
@@ -1700,11 +2048,17 @@ eshelf_nbsd.c: $(srcdir)/emulparams/shelf_nbsd.sh \
$(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shelf_nbsd "$(tdir_shelf_nbsd)"
+eshelf_nto.c: $(srcdir)/emulparams/shelf_nto.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} shelf_nto "$(tdir_shelf_nto)"
eshlelf_nbsd.c: $(srcdir)/emulparams/shlelf_nbsd.sh \
$(srcdir)/emulparams/shelf_nbsd.sh \
$(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf_nbsd "$(tdir_shlelf_nbsd)"
+eshlelf_nto.c: $(srcdir)/emulparams/shlelf_nto.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} shlelf_nto "$(tdir_shlelf_nto)"
eshlelf.c: $(srcdir)/emulparams/shlelf.sh \
$(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -1714,6 +2068,12 @@ eshlelf32.c: $(srcdir)/emulparams/shlelf32.sh \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf32 "$(tdir_shlelf32)"
+eshlelf32_linux.c: $(srcdir)/emulparams/shlelf32_linux.sh \
+ $(srcdir)/emulparams/shelf32_linux.sh $(srcdir)/emulparams/shelf32.sh \
+ $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
+ $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} shlelf32_linux "$(tdir_shlelf32_linux)"
eshlelf32_nbsd.c: $(srcdir)/emulparams/shlelf32_nbsd.sh \
$(srcdir)/emulparams/shelf32_nbsd.sh $(srcdir)/emulparams/shelf32.sh \
$(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
@@ -1763,6 +2123,15 @@ etic30aout.c: $(srcdir)/emulparams/tic30aout.sh \
etic30coff.c: $(srcdir)/emulparams/tic30coff.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30coff.sc ${GEN_DEPENDS}
${GENSCRIPTS} tic30coff "$(tdir_tic30coff)"
+etic3xcoff.c: $(srcdir)/emulparams/tic3xcoff.sh \
+ $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} tic3xcoff "$(tdir_tic4xcoff)"
+etic3xcoff_onchip.c: $(srcdir)/emulparams/tic3xcoff_onchip.sh \
+ $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} tic3xcoff_onchip "$(tdir_tic4xcoff)"
+etic4xcoff.c: $(srcdir)/emulparams/tic4xcoff.sh \
+ $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} tic4xcoff "$(tdir_tic4xcoff)"
etic54xcoff.c: $(srcdir)/emulparams/tic54xcoff.sh \
$(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic54xcoff.sc ${GEN_DEPENDS}
${GENSCRIPTS} tic54xcoff "$(tdir_tic54xcoff)"
@@ -1793,6 +2162,10 @@ ez8001.c: $(srcdir)/emulparams/z8001.sh \
ez8002.c: $(srcdir)/emulparams/z8002.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
${GENSCRIPTS} z8002 "$(tdir_z8002)"
+eelf32frvfd.c: $(srcdir)/emulparams/elf32frvfd.sh \
+ $(srcdir)/emulparams/elf32frv.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32frvfd "$(tdir_frv)"
# The generated emulation files mostly have the same dependencies.
$(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \
@@ -1898,7 +2271,7 @@ ld.dvi: $(srcdir)/ld.texinfo configdoc.texi ldver.texi
# Build the man page from the texinfo file
# The sed command removes the no-adjust Nroff command so that
# the man output looks standard.
-ld.1: $(srcdir)/ld.texinfo
+ld.1: $(srcdir)/ld.texinfo configdoc.texi ldver.texi
touch $@
-$(TEXI2POD) $(MANCONF) < $(srcdir)/ld.texinfo > ld.pod
-($(POD2MAN) ld.pod | \
@@ -2028,13 +2401,14 @@ ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h ld.h $(INCDIR)/bin-bugs.h \
ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h ldgram.h \
- ldlex.h ldemul.h $(INCDIR)/libiberty.h
+ ldlex.h ldemul.h $(INCDIR)/libiberty.h $(INCDIR)/filenames.h
ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \
$(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldmain.h \
ldexp.h ldlang.h ldgram.h ldlex.h ldmisc.h ldctor.h \
- ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h
+ ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h \
+ $(INCDIR)/hashtab.h
ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h $(INCDIR)/progress.h \
@@ -2042,18 +2416,19 @@ ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
ldmain.h ldmisc.h ldwrite.h ldexp.h ldlang.h ldgram.h \
ldlex.h ldfile.h ldemul.h ldctor.h
ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h $(INCDIR)/demangle.h ld.h $(INCDIR)/bin-bugs.h \
- ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h \
- ldfile.h
+ $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h sysdep.h config.h \
+ $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \
+ ld.h $(INCDIR)/bin-bugs.h ldmisc.h ldexp.h ldlang.h \
+ ldgram.h ldlex.h ldmain.h ldfile.h
ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
- ld.h $(INCDIR)/bin-bugs.h ldver.h ldexp.h ldlang.h \
- ldfile.h ldemul.h ldmain.h
+ $(INCDIR)/symcat.h ../bfd/bfdver.h sysdep.h config.h \
+ $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h ldver.h \
+ ldexp.h ldlang.h ldfile.h ldemul.h ldmain.h
ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h \
- ldexp.h ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h
+ $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \
+ ld.h $(INCDIR)/bin-bugs.h ldexp.h ldlang.h ldwrite.h \
+ ldmisc.h ldgram.h ldmain.h
lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h \
@@ -2078,7 +2453,7 @@ ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \
ldver.h ldlang.h ldfile.h ldemul.h ldmisc.h ldmain.h \
mri.h ldctor.h ldlex.h
-ldlex.o: ldlex.c $(INCDIR)/ansidecl.h ../bfd/bfd.h \
+ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h \
ldmisc.h ldexp.h ldlang.h ldgram.h ldfile.h ldlex.h \
diff --git a/contrib/binutils/ld/NEWS b/contrib/binutils/ld/NEWS
index 383bd8c..81512c4 100644
--- a/contrib/binutils/ld/NEWS
+++ b/contrib/binutils/ld/NEWS
@@ -1,4 +1,41 @@
-*- text -*-
+
+* The linker script operator DEFINED() will now yield 1 only for a symbol that
+ is defined before the statement where DEFINED is used.
+
+* The MIPS --embedded-relocs (used to embed relocations into binaries for
+ Embedded-PIC code) is deprecated and will be removed in a future release.
+
+* m32r Linux (ELF) support added by Renesas.
+
+* Improved linker's handling of unresolved symbols. The switch
+ --unresolved-symbols=<method> has been added to tell the linker when it
+ should report them and the switch --warn-unresolved-symbols has been added to
+ make reports be issued as warning messages rather than errors.
+
+Changes in 2.14:
+
+* Added support for Xtensa architecture.
+
+* Added --with-sysroot configure switch to specify a target system root, for
+ linking against a target filesystem image.
+
+* Added --accept-unknown-linker-format to restore old linker behaviour (pre
+ 2.14) of silently accepting and linking in any files in an unknown binary
+ file format.
+
+* Added --no-omagic to undo the effects of the -N option.
+
+* Support for Texas Instruments TMS320C4x and TMS320C3x series of
+ DSP's contributed by Michael Hayes and Svein E. Seldal.
+
+* Added --with-lib-path configure switch to specify default value for
+ LIB_PATH.
+
+* ARM port to QNX operating system added by Graeme Peterson.
+
+* IP2K support added by Denis Chertykov.
+
Changes in 2.13:
* Support for the Fujitsu FRV architecture added by Red Hat. Models for FR400
@@ -52,6 +89,8 @@ Changes in version 2.11:
* Support for CRIS (Axis Communications ETRAX series).
+* Support for PDP-11 and 2.11BSD a.out format, by Lars Brinkhoff.
+
Changes in version 2.10:
* Added AT> to the linker script language to allow load-time allocation of
@@ -75,7 +114,7 @@ Changes in version 2.10:
wildcard file names.
* Added -O option to optimize linker output (as of this writing, this only
-affects ELF shared library generation).
+ affects ELF shared library generation).
* The -e option now accepts a number as well as a symbol name.
@@ -146,7 +185,7 @@ not copied into the output file. This is used by glibc.
* When an ELF section named .gnu.warning.SYMBOL is encountered in an input
file, and the symbol SYMBOL is referenced by some object file, the contents of
the section are displayed as an error message. The section is not copied into
-the output file, unless doing a relocateable or shared link. This is used by
+the output file, unless doing a relocatable or shared link. This is used by
glibc.
* New options -split-by-reloc and -split-by-file.
@@ -169,7 +208,7 @@ Changes in version 2.5:
* The linker now supports linking against SunOS shared libraries. It still can
not link SunOS PIC (Position Independent Code) files, so it can not be used to
-generate shared libaries.
+generate shared libraries.
* The linker now supports linking against ELF shared libraries for the i386
(UnixWare) and SPARC (Solaris). It can also link ELF PIC files, and can be
diff --git a/contrib/binutils/ld/README b/contrib/binutils/ld/README
index 6fef769..a953e42 100644
--- a/contrib/binutils/ld/README
+++ b/contrib/binutils/ld/README
@@ -28,7 +28,8 @@ See ../binutils/README.
If you want to make a cross-linker, you may want to specify
a different search path of -lfoo libraries than the default.
-You can do this by setting the LIB_PATH variable in ./Makefile.
+You can do this by setting the LIB_PATH variable in ./Makefile
+or using the --with-lib-path configure switch.
To build just the linker, make the target all-ld from the top level
directory (one directory above this one).
diff --git a/contrib/binutils/ld/aclocal.m4 b/contrib/binutils/ld/aclocal.m4
index 6111817..7b50bb9 100644
--- a/contrib/binutils/ld/aclocal.m4
+++ b/contrib/binutils/ld/aclocal.m4
@@ -27,6 +27,24 @@ AC_DEFUN([CY_WITH_NLS],)
AC_SUBST(INTLLIBS)
])
+#serial 1
+# This test replaces the one in autoconf.
+# Currently this macro should have the same name as the autoconf macro
+# because gettext's gettext.m4 (distributed in the automake package)
+# still uses it. Otherwise, the use in gettext.m4 makes autoheader
+# give these diagnostics:
+# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
+# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
+
+undefine([AC_ISC_POSIX])
+
+AC_DEFUN([AC_ISC_POSIX],
+ [
+ dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
+ AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
+ ]
+)
+
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
diff --git a/contrib/binutils/ld/config.in b/contrib/binutils/ld/config.in
index 14e50d1..f76bb42 100644
--- a/contrib/binutils/ld/config.in
+++ b/contrib/binutils/ld/config.in
@@ -70,6 +70,9 @@
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
+/* Define if you have the realpath function. */
+#undef HAVE_REALPATH
+
/* Define if you have the sbrk function. */
#undef HAVE_SBRK
@@ -127,12 +130,6 @@
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
-/* Define if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
diff --git a/contrib/binutils/ld/configure b/contrib/binutils/ld/configure
index e1c48d7..410f9c2 100755
--- a/contrib/binutils/ld/configure
+++ b/contrib/binutils/ld/configure
@@ -24,11 +24,15 @@ ac_help="$ac_help
ac_help="$ac_help
--with-pic try to use only PIC/non-PIC objects [default=use both]"
ac_help="$ac_help
+ --with-lib-path=dir1:dir2... set default LIB_PATH"
+ac_help="$ac_help
--enable-targets alternative target configurations"
ac_help="$ac_help
--enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)"
ac_help="$ac_help
- --enable-build-warnings Enable build-time compiler warnings if gcc is used"
+ --with-sysroot[=DIR] Search for usr/lib et al within DIR."
+ac_help="$ac_help
+ --enable-build-warnings enable build-time compiler warnings if gcc is used"
ac_help="$ac_help
--disable-nls do not use Native Language Support"
ac_help="$ac_help
@@ -53,6 +57,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
+sitefile=
srcdir=
target=NONE
verbose=
@@ -167,6 +172,7 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -337,6 +343,11 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -502,12 +513,16 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
fi
+else
+ CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -546,12 +561,12 @@ else
fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:550: checking for Cygwin environment" >&5
+echo "configure:565: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 555 "configure"
+#line 570 "configure"
#include "confdefs.h"
int main() {
@@ -562,7 +577,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -579,19 +594,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:583: checking for mingw32 environment" >&5
+echo "configure:598: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 588 "configure"
+#line 603 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -656,7 +671,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:660: checking host system type" >&5
+echo "configure:675: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -677,7 +692,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:681: checking target system type" >&5
+echo "configure:696: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -695,7 +710,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:699: checking build system type" >&5
+echo "configure:714: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -717,249 +732,49 @@ test "$host_alias" != "$target_alias" &&
NONENONEs,x,x, &&
program_prefix=${target_alias}-
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:724: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="gcc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:754: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_prog_rejected=no
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# -gt 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- set dummy "$ac_dir/$ac_word" "$@"
- shift
- ac_cv_prog_CC="$@"
- fi
-fi
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- if test -z "$CC"; then
- case "`uname -s`" in
- *win32* | *WIN32*)
- # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:805: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
+echo "configure:738: checking for strerror in -lcposix" >&5
+ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="cl"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
- ;;
- esac
- fi
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:837: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-cat > conftest.$ac_ext << EOF
-
-#line 848 "configure"
+ ac_save_LIBS="$LIBS"
+LIBS="-lcposix $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 746 "configure"
#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strerror();
-main(){return(0);}
+int main() {
+strerror()
+; return 0; }
EOF
-if { (eval echo configure:853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- ac_cv_prog_cc_works=yes
- # If we can't run a trivial program, we are probably using a cross compiler.
- if (./conftest; exit) 2>/dev/null; then
- ac_cv_prog_cc_cross=no
- else
- ac_cv_prog_cc_cross=yes
- fi
+if { (eval echo configure:757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
- ac_cv_prog_cc_works=no
-fi
-rm -fr conftest*
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
-fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:879: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:884: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
-else
- ac_cv_prog_gcc=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
-else
- GCC=
-fi
-
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:912: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_cc_g=yes
-else
- ac_cv_prog_cc_g=no
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
+LIBS="$ac_save_LIBS"
fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-
-echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:944: checking for POSIXized ISC" >&5
-if test -d /etc/conf/kconfig.d &&
- grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
-then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ISC=yes # If later tests want to check for ISC.
- cat >> confdefs.h <<\EOF
-#define _POSIX_SOURCE 1
-EOF
-
- if test "$GCC" = yes; then
- CC="$CC -posix"
- else
- CC="$CC -Xp"
- fi
+ LIBS="$LIBS -lcposix"
else
echo "$ac_t""no" 1>&6
- ISC=
fi
+
+
BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
# Find a good install program. We prefer a C program (faster),
@@ -974,7 +789,7 @@ BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:978: checking for a BSD compatible install" >&5
+echo "configure:793: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1027,7 +842,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:1031: checking whether build environment is sane" >&5
+echo "configure:846: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -1084,7 +899,7 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1088: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:903: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1130,7 +945,7 @@ EOF
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1134: checking for working aclocal" >&5
+echo "configure:949: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1143,7 +958,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1147: checking for working autoconf" >&5
+echo "configure:962: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1156,7 +971,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1160: checking for working automake" >&5
+echo "configure:975: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1169,7 +984,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1173: checking for working autoheader" >&5
+echo "configure:988: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1182,7 +997,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1186: checking for working makeinfo" >&5
+echo "configure:1001: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1265,6 +1080,228 @@ else
enable_fast_install=yes
fi
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1087: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1117: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_prog_rejected=no
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1168: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1200: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 1211 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:1216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1242: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:1247: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1275: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+
# Check whether --with-gnu-ld or --without-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
withval="$with_gnu_ld"
@@ -1277,7 +1314,7 @@ ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1281: checking for ld used by GCC" >&5
+echo "configure:1318: checking for ld used by GCC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1307,10 +1344,10 @@ echo "configure:1281: checking for ld used by GCC" >&5
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1311: checking for GNU ld" >&5
+echo "configure:1348: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1314: checking for non-GNU ld" >&5
+echo "configure:1351: checking for non-GNU ld" >&5
fi
if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1345,7 +1382,7 @@ else
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1349: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1386: checking if the linker ($LD) is GNU ld" >&5
if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1362,7 +1399,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:1366: checking for $LD option to reload object files" >&5
+echo "configure:1403: checking for $LD option to reload object files" >&5
if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1374,7 +1411,7 @@ reload_flag=$lt_cv_ld_reload_flag
test -n "$reload_flag" && reload_flag=" $reload_flag"
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1378: checking for BSD-compatible nm" >&5
+echo "configure:1415: checking for BSD-compatible nm" >&5
if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1412,7 +1449,7 @@ NM="$lt_cv_path_NM"
echo "$ac_t""$NM" 1>&6
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1416: checking whether ln -s works" >&5
+echo "configure:1453: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1433,7 +1470,7 @@ else
fi
echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1437: checking how to recognise dependant libraries" >&5
+echo "configure:1474: checking how to recognise dependant libraries" >&5
if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1543,7 +1580,7 @@ irix5* | irix6*)
# This must be Linux ELF.
linux-gnu*)
case $host_cpu in
- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
+ alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* )
lt_cv_deplibs_check_method=pass_all ;;
*)
# glibc up to 2.1.1 does not perform some relocations on ARM
@@ -1606,13 +1643,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:1610: checking for object suffix" >&5
+echo "configure:1647: checking for object suffix" >&5
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftest*
echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:1616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -1632,7 +1669,7 @@ ac_objext=$ac_cv_objext
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1636: checking for executable suffix" >&5
+echo "configure:1673: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1642,10 +1679,10 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:1683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.o | *.obj) ;;
+ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
@@ -1675,7 +1712,7 @@ case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:1679: checking for ${ac_tool_prefix}file" >&5
+echo "configure:1716: checking for ${ac_tool_prefix}file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1737,7 +1774,7 @@ fi
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:1741: checking for file" >&5
+echo "configure:1778: checking for file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1808,7 +1845,7 @@ esac
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1812: checking for $ac_word" >&5
+echo "configure:1849: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1840,7 +1877,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1844: checking for $ac_word" >&5
+echo "configure:1881: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1875,7 +1912,7 @@ fi
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1879: checking for $ac_word" >&5
+echo "configure:1916: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1907,7 +1944,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1911: checking for $ac_word" >&5
+echo "configure:1948: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1974,8 +2011,21 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 1978 "configure"' > conftest.$ac_ext
- if { (eval echo configure:1979: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 2015 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
@@ -1987,6 +2037,7 @@ case $host in
LD="${LD-ld} -64"
;;
esac
+ fi
fi
rm -rf conftest*
;;
@@ -1994,7 +2045,7 @@ case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:1998: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:2049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*ELF-32*)
HPUX_IA64_MODE="32"
@@ -2012,7 +2063,7 @@ ia64-*-hpux*)
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2016: checking whether the C compiler needs -belf" >&5
+echo "configure:2067: checking whether the C compiler needs -belf" >&5
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2025,14 +2076,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 2029 "configure"
+#line 2080 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_cc_needs_belf=yes
else
@@ -2148,6 +2199,12 @@ exec 5>>./config.log
+# Check whether --with-lib-path or --without-lib-path was given.
+if test "${with_lib_path+set}" = set; then
+ withval="$with_lib_path"
+ LIB_PATH=$withval
+fi
+
# Check whether --enable-targets or --disable-targets was given.
if test "${enable_targets+set}" = set; then
enableval="$enable_targets"
@@ -2170,6 +2227,47 @@ else
want64=false
fi
+# Check whether --with-sysroot or --without-sysroot was given.
+if test "${with_sysroot+set}" = set; then
+ withval="$with_sysroot"
+
+ case ${with_sysroot} in
+ yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;;
+ *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
+ esac
+
+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
+ use_sysroot=yes
+
+ if test "x$exec_prefix" = xNONE; then
+ if test "x$prefix" = xNONE; then
+ test_prefix=/usr/local
+ else
+ test_prefix=$prefix
+ fi
+ else
+ test_prefix=$exec_prefix
+ fi
+ case ${TARGET_SYSTEM_ROOT} in
+ "${test_prefix}"|"${test_prefix}/"*|\
+ '${exec_prefix}'|'${exec_prefix}/'*)
+ t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
+ TARGET_SYSTEM_ROOT_DEFINE="$t"
+ ;;
+ esac
+
+else
+
+ use_sysroot=no
+ TARGET_SYSTEM_ROOT=
+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"\"'
+
+fi
+
+
+
+
+
build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
# Check whether --enable-build-warnings or --disable-build-warnings was given.
if test "${enable_build_warnings+set}" = set; then
@@ -2209,7 +2307,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2213: checking for $ac_word" >&5
+echo "configure:2311: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2239,7 +2337,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2243: checking for $ac_word" >&5
+echo "configure:2341: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2290,7 +2388,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2294: checking for $ac_word" >&5
+echo "configure:2392: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2322,7 +2420,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2326: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2424: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2333,12 +2431,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 2337 "configure"
+#line 2435 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:2342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -2364,12 +2462,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2368: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2466: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2373: checking whether we are using GNU C" >&5
+echo "configure:2471: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2378,7 +2476,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2382: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -2397,7 +2495,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2401: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2499: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2440,7 +2538,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:2444: checking for a BSD compatible install" >&5
+echo "configure:2542: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2493,9 +2591,9 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-ALL_LINGUAS="fr sv tr es"
+ALL_LINGUAS="fr sv tr es da"
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2499: checking how to run the C preprocessor" >&5
+echo "configure:2597: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -2510,13 +2608,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 2514 "configure"
+#line 2612 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -2527,13 +2625,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2531 "configure"
+#line 2629 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2635: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -2544,13 +2642,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2548 "configure"
+#line 2646 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2554: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -2577,7 +2675,7 @@ echo "$ac_t""$CPP" 1>&6
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2581: checking for $ac_word" >&5
+echo "configure:2679: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2605,12 +2703,12 @@ else
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2609: checking for ANSI C header files" >&5
+echo "configure:2707: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2614 "configure"
+#line 2712 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2618,7 +2716,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2720: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2635,7 +2733,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2639 "configure"
+#line 2737 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2653,7 +2751,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2657 "configure"
+#line 2755 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2674,7 +2772,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2678 "configure"
+#line 2776 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2685,7 +2783,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2709,12 +2807,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2713: checking for working const" >&5
+echo "configure:2811: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2718 "configure"
+#line 2816 "configure"
#include "confdefs.h"
int main() {
@@ -2763,7 +2861,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:2767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -2784,21 +2882,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2788: checking for inline" >&5
+echo "configure:2886: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 2795 "configure"
+#line 2893 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:2802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -2824,12 +2922,12 @@ EOF
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2828: checking for off_t" >&5
+echo "configure:2926: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2833 "configure"
+#line 2931 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2857,12 +2955,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2861: checking for size_t" >&5
+echo "configure:2959: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2866 "configure"
+#line 2964 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2892,19 +2990,19 @@ fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2896: checking for working alloca.h" >&5
+echo "configure:2994: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2901 "configure"
+#line 2999 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:2908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -2925,12 +3023,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2929: checking for alloca" >&5
+echo "configure:3027: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2934 "configure"
+#line 3032 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -2958,7 +3056,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:2962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -2990,12 +3088,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2994: checking whether alloca needs Cray hooks" >&5
+echo "configure:3092: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2999 "configure"
+#line 3097 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -3020,12 +3118,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3024: checking for $ac_func" >&5
+echo "configure:3122: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3029 "configure"
+#line 3127 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3048,7 +3146,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3075,7 +3173,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:3079: checking stack direction for C alloca" >&5
+echo "configure:3177: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3083,7 +3181,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 3087 "configure"
+#line 3185 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -3102,7 +3200,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:3106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -3123,21 +3221,21 @@ EOF
fi
-for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
+for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3131: checking for $ac_hdr" >&5
+echo "configure:3229: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3136 "configure"
+#line 3234 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3166,12 +3264,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3170: checking for $ac_func" >&5
+echo "configure:3268: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3175 "configure"
+#line 3273 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3194,7 +3292,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3219,7 +3317,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3223: checking for working mmap" >&5
+echo "configure:3321: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3227,7 +3325,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 3231 "configure"
+#line 3329 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3255,24 +3353,11 @@ else
#include <fcntl.h>
#include <sys/mman.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
@@ -3380,7 +3465,7 @@ main()
}
EOF
-if { (eval echo configure:3384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -3408,17 +3493,17 @@ unistd.h values.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3412: checking for $ac_hdr" >&5
+echo "configure:3497: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3417 "configure"
+#line 3502 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3422: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3507: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3448,12 +3533,12 @@ done
__argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3452: checking for $ac_func" >&5
+echo "configure:3537: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3457 "configure"
+#line 3542 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3476,7 +3561,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3505,12 +3590,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3509: checking for $ac_func" >&5
+echo "configure:3594: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3514 "configure"
+#line 3599 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3533,7 +3618,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3567,19 +3652,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3571: checking for LC_MESSAGES" >&5
+echo "configure:3656: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3576 "configure"
+#line 3661 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:3583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
@@ -3600,7 +3685,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3604: checking whether NLS is requested" >&5
+echo "configure:3689: checking whether NLS is requested" >&5
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
@@ -3620,7 +3705,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3624: checking whether included gettext is requested" >&5
+echo "configure:3709: checking whether included gettext is requested" >&5
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
@@ -3639,17 +3724,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:3643: checking for libintl.h" >&5
+echo "configure:3728: checking for libintl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3648 "configure"
+#line 3733 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3666,19 +3751,19 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:3670: checking for gettext in libc" >&5
+echo "configure:3755: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3675 "configure"
+#line 3760 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:3682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libc=yes
else
@@ -3694,7 +3779,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
if test "$gt_cv_func_gettext_libc" != "yes"; then
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:3698: checking for bindtextdomain in -lintl" >&5
+echo "configure:3783: checking for bindtextdomain in -lintl" >&5
ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3702,7 +3787,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3706 "configure"
+#line 3791 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3713,7 +3798,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:3717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -3729,19 +3814,19 @@ fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:3733: checking for gettext in libintl" >&5
+echo "configure:3818: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3738 "configure"
+#line 3823 "configure"
#include "confdefs.h"
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:3745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libintl=yes
else
@@ -3769,7 +3854,7 @@ EOF
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3773: checking for $ac_word" >&5
+echo "configure:3858: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3803,12 +3888,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3807: checking for $ac_func" >&5
+echo "configure:3892: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3812 "configure"
+#line 3897 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3831,7 +3916,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3858,7 +3943,7 @@ done
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3862: checking for $ac_word" >&5
+echo "configure:3947: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3894,7 +3979,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3898: checking for $ac_word" >&5
+echo "configure:3983: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3926,7 +4011,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 3930 "configure"
+#line 4015 "configure"
#include "confdefs.h"
int main() {
@@ -3934,7 +4019,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:3938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -3966,7 +4051,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3970: checking for $ac_word" >&5
+echo "configure:4055: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4000,7 +4085,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4004: checking for $ac_word" >&5
+echo "configure:4089: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4036,7 +4121,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4040: checking for $ac_word" >&5
+echo "configure:4125: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4126,7 +4211,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:4130: checking for catalogs to be installed" >&5
+echo "configure:4215: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
@@ -4154,17 +4239,17 @@ echo "configure:4130: checking for catalogs to be installed" >&5
if test "$CATOBJEXT" = ".cat"; then
ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:4158: checking for linux/version.h" >&5
+echo "configure:4243: checking for linux/version.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4163 "configure"
+#line 4248 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4229,7 +4314,7 @@ fi
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:4233: checking for executable suffix" >&5
+echo "configure:4318: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4239,10 +4324,10 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:4243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:4328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.o | *.obj) ;;
+ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
@@ -4265,7 +4350,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4269: checking for $ac_word" >&5
+echo "configure:4354: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4301,7 +4386,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4305: checking for $ac_word" >&5
+echo "configure:4390: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4334,7 +4419,7 @@ test -n "$LEX" || LEX=""$missing_dir/missing flex""
# Extract the first word of "flex", so it can be a program name with args.
set dummy flex; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4338: checking for $ac_word" >&5
+echo "configure:4423: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4368,7 +4453,7 @@ then
*) ac_lib=l ;;
esac
echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:4372: checking for yywrap in -l$ac_lib" >&5
+echo "configure:4457: checking for yywrap in -l$ac_lib" >&5
ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4376,7 +4461,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$ac_lib $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4380 "configure"
+#line 4465 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4387,7 +4472,7 @@ int main() {
yywrap()
; return 0; }
EOF
-if { (eval echo configure:4391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4410,7 +4495,7 @@ fi
fi
echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-echo "configure:4414: checking lex output file root" >&5
+echo "configure:4499: checking lex output file root" >&5
if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4431,7 +4516,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-echo "configure:4435: checking whether yytext is a pointer" >&5
+echo "configure:4520: checking whether yytext is a pointer" >&5
if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4443,14 +4528,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
ac_save_LIBS="$LIBS"
LIBS="$LIBS $LEXLIB"
cat > conftest.$ac_ext <<EOF
-#line 4447 "configure"
+#line 4532 "configure"
#include "confdefs.h"
`cat $LEX_OUTPUT_ROOT.c`
int main() {
; return 0; }
EOF
-if { (eval echo configure:4454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_prog_lex_yytext_pointer=yes
else
@@ -4473,7 +4558,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:4477: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:4562: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
@@ -4507,17 +4592,17 @@ for ac_hdr in string.h strings.h stdlib.h unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4511: checking for $ac_hdr" >&5
+echo "configure:4596: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4516 "configure"
+#line 4601 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4606: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4543,15 +4628,15 @@ else
fi
done
-for ac_func in sbrk
+for ac_func in sbrk realpath
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4550: checking for $ac_func" >&5
+echo "configure:4635: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4555 "configure"
+#line 4640 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4574,7 +4659,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4603,12 +4688,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:4607: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4692: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4612 "configure"
+#line 4697 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -4616,7 +4701,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:4620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -4641,7 +4726,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:4645: checking for opendir in -ldir" >&5
+echo "configure:4730: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4649,7 +4734,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4653 "configure"
+#line 4738 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4660,7 +4745,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:4664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4682,7 +4767,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4686: checking for opendir in -lx" >&5
+echo "configure:4771: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4690,7 +4775,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4694 "configure"
+#line 4779 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4701,7 +4786,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:4705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4734,12 +4819,12 @@ EOF
esac
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:4738: checking whether strstr must be declared" >&5
+echo "configure:4823: checking whether strstr must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4743 "configure"
+#line 4828 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4760,7 +4845,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:4764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strstr=no
else
@@ -4781,12 +4866,12 @@ EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:4785: checking whether free must be declared" >&5
+echo "configure:4870: checking whether free must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4790 "configure"
+#line 4875 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4807,7 +4892,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:4811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -4828,12 +4913,12 @@ EOF
fi
echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6
-echo "configure:4832: checking whether sbrk must be declared" >&5
+echo "configure:4917: checking whether sbrk must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4837 "configure"
+#line 4922 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4854,7 +4939,7 @@ int main() {
char *(*pfn) = (char *(*)) sbrk
; return 0; }
EOF
-if { (eval echo configure:4858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_sbrk=no
else
@@ -4875,12 +4960,12 @@ EOF
fi
echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:4879: checking whether getenv must be declared" >&5
+echo "configure:4964: checking whether getenv must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4884 "configure"
+#line 4969 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4901,7 +4986,7 @@ int main() {
char *(*pfn) = (char *(*)) getenv
; return 0; }
EOF
-if { (eval echo configure:4905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_getenv=no
else
@@ -4922,12 +5007,12 @@ EOF
fi
echo $ac_n "checking whether environ must be declared""... $ac_c" 1>&6
-echo "configure:4926: checking whether environ must be declared" >&5
+echo "configure:5011: checking whether environ must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_environ'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4931 "configure"
+#line 5016 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4948,7 +5033,7 @@ int main() {
char *(*pfn) = (char *(*)) environ
; return 0; }
EOF
-if { (eval echo configure:4952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5037: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_environ=no
else
@@ -4976,19 +5061,19 @@ fi
# constants, while still supporting pre-ANSI compilers which do not
# support string concatenation.
echo $ac_n "checking whether ANSI C string concatenation works""... $ac_c" 1>&6
-echo "configure:4980: checking whether ANSI C string concatenation works" >&5
+echo "configure:5065: checking whether ANSI C string concatenation works" >&5
if eval "test \"`echo '$''{'ld_cv_string_concatenation'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4985 "configure"
+#line 5070 "configure"
#include "confdefs.h"
int main() {
char *a = "a" "a";
; return 0; }
EOF
-if { (eval echo configure:4992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ld_cv_string_concatenation=yes
else
@@ -5092,6 +5177,7 @@ fi
+
EMULATION_LIBPATH=$all_libpath
@@ -5262,7 +5348,6 @@ s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
-s%@CC@%$CC%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
@@ -5274,12 +5359,16 @@ s%@AUTOMAKE@%$AUTOMAKE%g
s%@AUTOHEADER@%$AUTOHEADER%g
s%@MAKEINFO@%$MAKEINFO%g
s%@SET_MAKE@%$SET_MAKE%g
+s%@CC@%$CC%g
s%@LN_S@%$LN_S%g
s%@OBJEXT@%$OBJEXT%g
s%@EXEEXT@%$EXEEXT%g
s%@RANLIB@%$RANLIB%g
s%@STRIP@%$STRIP%g
s%@LIBTOOL@%$LIBTOOL%g
+s%@use_sysroot@%$use_sysroot%g
+s%@TARGET_SYSTEM_ROOT@%$TARGET_SYSTEM_ROOT%g
+s%@TARGET_SYSTEM_ROOT_DEFINE@%$TARGET_SYSTEM_ROOT_DEFINE%g
s%@WARN_CFLAGS@%$WARN_CFLAGS%g
s%@CPP@%$CPP%g
s%@ALLOCA@%$ALLOCA%g
@@ -5320,6 +5409,7 @@ s%@EMUL@%$EMUL%g
s%@TDIRS@%%g
s%@EMULATION_OFILES@%$EMULATION_OFILES%g
s%@EMUL_EXTRA_OFILES@%$EMUL_EXTRA_OFILES%g
+s%@LIB_PATH@%$LIB_PATH%g
s%@EMULATION_LIBPATH@%$EMULATION_LIBPATH%g
s%@TESTBFDLIB@%$TESTBFDLIB%g
diff --git a/contrib/binutils/ld/configure.host b/contrib/binutils/ld/configure.host
index 436a912..f2e1eb4 100644
--- a/contrib/binutils/ld/configure.host
+++ b/contrib/binutils/ld/configure.host
@@ -7,12 +7,10 @@
# HDEFINES host specific compiler flags
# HOSTING_CRT0 crt0.o file used for bootstrapping
# HOSTING_LIBS libraries used for bootstrapping
-# NATIVE_LIB_DIRS library directories to search on this host
HDEFINES=
HOSTING_CRT0=/lib/crt0.o
-HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libgcc=\`${CC} -print-libgcc-file-name\`; fi; if [ -f ../gcc/libgcc_eh.a ]; then libgcc="$libgcc ../gcc/libgcc_eh.a"; else libgcc_eh=\`${CC} -print-file-name=libgcc_eh.a\`; if [ x"$libgcc_eh" != xlibgcc_eh.a ]; then libgcc="$libgcc $libgcc_eh"; fi; fi; echo $libgcc -lc $libgcc`'
-NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib'
+HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libgcc=\`${CC} -print-libgcc-file-name\`; fi; if [ -f ../gcc/libgcc_eh.a ]; then libgcc="$libgcc ../gcc/libgcc_eh.a"; else libgcc_eh=\`${CC} -print-file-name=libgcc_eh.a\`; if [ x"$libgcc_eh" != xlibgcc_eh.a ]; then libgcc="$libgcc $libgcc_eh"; fi; fi; echo --start-group $libgcc -lc --end-group`'
#
# Generic configurations:
@@ -20,13 +18,8 @@ NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib'
case "${host}" in
-*-*-freebsd*)
- NATIVE_LIB_DIRS='/lib /usr/lib /usr/local/lib'
- # Older versions of gcc do not use a specs file. In those cases,
- # gcc -print-file-name=specs will simply print specs. We create a
- # dummy specs files to handle this.
- echo "-dynamic-linker `${CC} --print-prog-name=ld-elf.so.1`" > specs
- HOSTING_CRT0='-dynamic-linker `${CC} --print-file-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`'
+*-*-freebsd* | *-*-kfreebsd*-gnu)
+ HOSTING_CRT0='-dynamic-linker `[ -f \`${CC} --print-prog-name=ld-elf.so.1\` ] || echo /usr/libexec/``${CC} --print-prog-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`'
HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
;;
@@ -44,6 +37,36 @@ case "${host}" in
HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
;;
+*-*-netbsd*)
+ # Different versions of NetBSD with the ELF object format use different
+ # sets of start/end files.
+ HOSTING_CRT0='-dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o'
+ if [ -f `${CC} --print-file-name=crti.o` ]; then
+ # Support for GCC's crtstuff present.
+ HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crti.o`"
+ if [ -f ../gcc/crtbegin.o ]; then
+ HOSTING_CRT0="$HOSTING_CRT0 ../gcc/crtbegin.o"
+ else
+ HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crtbegin.o`"
+ fi
+ else
+ # Support for GCC's crtstuff not present.
+ HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crtbegin.o`"
+ fi
+ if [ -f `${CC} --print-file-name=crtn.o` ]; then
+ # Support for GCC's crtstuff present.
+ if [ -f ../gcc/crtbegin.o ]; then
+ HOSTING_LIBS="$HOSTING_LIBS ../gcc/crtend.o"
+ else
+ HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtend.o`"
+ fi
+ HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtn.o`"
+ else
+ # Support for GCC's crtstuff not present.
+ HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtend.o`"
+ fi
+ ;;
+
esac
#
@@ -56,48 +79,45 @@ case "${host}" in
# No further tweaking needed
;;
-alpha*-*-netbsd*)
- HOSTING_CRT0=/usr/lib/crt0.o
+am33_2.0-*-linux*)
+ HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"`
;;
arm*-*-linux-gnu*)
- HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux,g"`
+ HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"`
;;
hppa*64*-*-hpux11*)
- NATIVE_LIB_DIRS=/usr/lib/pa20_64
HOSTING_CRT0=/usr/ccs/lib/pa20_64/crt0.o
# Even if CC is not gcc, the tests use gcc.
- HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else if test "$GCC" = yes; then ${CC} --print-libgcc-file-name; else gcc --print-libgcc-file-name; fi fi` -lc /usr/lib/pa20_64/milli.a'
+ HOSTING_LIBS='--start-group `if [ -f ../gcc/libgcc.a ]; then echo ../gcc/libgcc.a; else if test "$GCC" = yes; then ${CC} --print-libgcc-file-name; else gcc --print-libgcc-file-name; fi fi` -lc --end-group /usr/lib/pa20_64/milli.a'
;;
-i[3456]86-*-bsd* | i[34567]86-*-freebsd[12] | i[34567]86-*-freebsd[12]\.* | i[34567]86-*-freebsd*aout* | i[3456]86-*-netbsd*)
+i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[12] | i[3-7]86-*-freebsd[12]\.* | i[3-7]86-*-freebsd*aout*)
HOSTING_CRT0=/usr/lib/crt0.o
;;
-i[3456]86-*-sysv4*)
+i[3-7]86-*-sysv4*)
HOSTING_CRT0='/usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /usr/ccs/lib/crtn.o'
- NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
;;
-i[3456]86-sequent-ptx* | i[3456]86-sequent-sysv*)
+i[3-7]86-sequent-ptx* | i[3-7]86-sequent-sysv*)
HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`'
;;
-i[3456]86-*-sysv*)
+i[3-7]86-*-sysv*)
HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; fi` /lib/crtn.o'
;;
-i[3456]86-*-solaris*)
+i[3-7]86-*-solaris*)
HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else ${CC} -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else ${CC} -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
- NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
;;
-i[3456]86-*-sco* | i[3456]86-*-isc*)
+i[3-7]86-*-sco* | i[3-7]86-*-isc*)
# In some configurations gcc does not use crtbegin.o and crtend.o.
# In that case gcc -print-file-name=crtbegin.o will simply print
# crtbegin.o. We create dummy crtbegin.o and crtend.o files to
@@ -112,19 +132,18 @@ i[3456]86-*-sco* | i[3456]86-*-isc*)
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /lib/crtn.o'
;;
-i[3456]86-*-lynxos*)
+i[3-7]86-*-lynxos*)
HOSTING_CRT0=/lib/init1.o
HOSTING_LIBS="$HOSTING_LIBS"' -lm /lib/initn.o'
;;
-i[3456]86-pc-interix*)
+i[3-7]86-pc-interix*)
HOSTING_CRT0='$$INTERIX_ROOT/usr/lib/crt0.o'
- NATIVE_LIB_DIRS='/usr/local/lib $$INTERIX_ROOT/usr/lib /lib /usr/lib'
HOSTING_LIBS='-L $$X/local_bin -L $$INTERIX_ROOT/usr/lib '"$HOSTING_LIBS"' -lcpsx -lc -lcpsx $$INTERIX_ROOT/usr/lib/psxdll.a $$INTERIX_ROOT/usr/lib/psxdll2.a'
;;
-i[3456]86-*-cygwin*)
- HOSTING_LIBS="$HOSTING_LIBS"' -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`'
+i[3-7]86-*-cygwin*)
+ HOSTING_LIBS="$HOSTING_LIBS"' -lcygwin -L/usr/lib/w32api -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`'
;;
ia64-*-linux-gnu*)
@@ -134,11 +153,6 @@ ia64-*-linux-gnu*)
ia64-*-aix*)
HOSTING_CRT0='-dynamic-linker `egrep "libc.so" \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/libc.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
- NATIVE_LIB_DIRS='/usr/local/lib /usr/lib/ia64l64 /lib /usr/lib'
- ;;
-
-mips*-dec-bsd*)
- HOSTING_CRT0=/usr/lib/crt0.o
;;
mips*-sgi-irix4* | mips*-sgi-irix5*)
@@ -184,6 +198,10 @@ m88*-motorola-sysv3)
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`'
;;
+powerpc64*-*-linux-gnu*)
+ HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld64.so.1,"`
+ ;;
+
powerpc*-*-linux-gnu*)
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"`
;;
@@ -199,7 +217,6 @@ s390-*-linux-gnu*)
sparc*-*-solaris2*)
HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else ${CC} -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else ${CC} -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
- NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
;;
sparc-*-linux-gnu*)
@@ -214,21 +231,17 @@ x86_64-*-linux-gnu*)
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld-linux-x86-64.so.2,"`
;;
-*-*-freebsd*)
+*-*-freebsd* | *-*-kfreebsd*-gnu)
;;
*-*-linux*)
;;
*-*-netbsd*)
- # NetBSD typically does not use the GCC crtstuff, so ignore it.
- HOSTING_CRT0='-dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o /usr/lib/crtbegin.o'
- HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` /usr/lib/crtend.o'
;;
alpha*-*-*)
HOSTING_CRT0=/usr/ccs/lib/crt0.o
- NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
;;
esac
diff --git a/contrib/binutils/ld/configure.in b/contrib/binutils/ld/configure.in
index b89c2a1..4358cbe 100644
--- a/contrib/binutils/ld/configure.in
+++ b/contrib/binutils/ld/configure.in
@@ -13,6 +13,7 @@ AM_INIT_AUTOMAKE(ld, ${BFD_VERSION})
AM_PROG_LIBTOOL
+AC_ARG_WITH(lib-path, [ --with-lib-path=dir1:dir2... set default LIB_PATH],LIB_PATH=$withval)
AC_ARG_ENABLE(targets,
[ --enable-targets alternative target configurations],
[case "${enableval}" in
@@ -29,9 +30,45 @@ AC_ARG_ENABLE(64-bit-bfd,
*) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
esac],[want64=false])dnl
+AC_ARG_WITH(sysroot,
+[ --with-sysroot[=DIR] Search for usr/lib et al within DIR.],
+[
+ case ${with_sysroot} in
+ yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;;
+ *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
+ esac
+
+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
+ use_sysroot=yes
+
+ if test "x$exec_prefix" = xNONE; then
+ if test "x$prefix" = xNONE; then
+ test_prefix=/usr/local
+ else
+ test_prefix=$prefix
+ fi
+ else
+ test_prefix=$exec_prefix
+ fi
+ case ${TARGET_SYSTEM_ROOT} in
+ "${test_prefix}"|"${test_prefix}/"*|\
+ '${exec_prefix}'|'${exec_prefix}/'*)
+ t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
+ TARGET_SYSTEM_ROOT_DEFINE="$t"
+ ;;
+ esac
+], [
+ use_sysroot=no
+ TARGET_SYSTEM_ROOT=
+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"\"'
+])
+AC_SUBST(use_sysroot)
+AC_SUBST(TARGET_SYSTEM_ROOT)
+AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
+
build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
AC_ARG_ENABLE(build-warnings,
-[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
+[ --enable-build-warnings enable build-time compiler warnings if gcc is used],
[case "${enableval}" in
yes) ;;
no) build_warnings="-w";;
@@ -64,7 +101,7 @@ fi
AC_PROG_CC
AC_PROG_INSTALL
-ALL_LINGUAS="fr sv tr es"
+ALL_LINGUAS="fr sv tr es da"
CY_GNU_GETTEXT
AC_EXEEXT
@@ -82,7 +119,7 @@ AC_SUBST(HOSTING_LIBS)
AC_SUBST(NATIVE_LIB_DIRS)
AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
-AC_CHECK_FUNCS(sbrk)
+AC_CHECK_FUNCS(sbrk realpath)
AC_HEADER_DIRENT
BFD_BINARY_FOPEN
@@ -202,6 +239,7 @@ else
fi
AC_SUBST(EMULATION_OFILES)
AC_SUBST(EMUL_EXTRA_OFILES)
+AC_SUBST(LIB_PATH)
EMULATION_LIBPATH=$all_libpath
AC_SUBST(EMULATION_LIBPATH)
diff --git a/contrib/binutils/ld/configure.tgt b/contrib/binutils/ld/configure.tgt
index bcdbb04..9b29291 100644
--- a/contrib/binutils/ld/configure.tgt
+++ b/contrib/binutils/ld/configure.tgt
@@ -9,11 +9,14 @@
# targ_extra_emuls additional linker emulations to provide
# targ_extra_libpath additional linker emulations using LIB_PATH
# targ_extra_ofiles additional objects needed by the emulation
+# NATIVE_LIB_DIRS library directories to search on this host
+# (if we are a native or sysrooted linker)
targ_extra_emuls=
targ_extra_ofiles=
case "${targ}" in
+am33_2.0-*-linux*) targ_emul=elf32am33lin ;;
arm-epoc-pe) targ_emul=arm_epoc_pe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
arm-*-wince) targ_emul=armpe ;
@@ -21,11 +24,12 @@ arm-*-wince) targ_emul=armpe ;
arm-*-pe) targ_emul=armpe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
arc-*-elf*) targ_emul=arcelf ;;
-avr-*-*) targ_emul=avr85xx
- targ_extra_emuls="avr1200 avr23xx avr44x4 avr4433 avrmega603 avrmega103 avrmega161 avr1 avr2 avr3 avr4 avr5" ;;
+avr-*-*) targ_emul=avr2
+ targ_extra_emuls="avr1 avr3 avr4 avr5" ;;
cris-*-*aout*) targ_emul=crisaout
targ_extra_emuls="criself crislinux"
targ_extra_libpath=$targ_extra_emuls ;;
+cris-*-linux-gnu*) targ_emul=crislinux ;;
cris-*-*) targ_emul=criself
targ_extra_emuls="crisaout crislinux"
targ_extra_libpath=$targ_extra_emuls ;;
@@ -44,7 +48,7 @@ sparc*-*-aout) targ_emul=sparcaout ;;
sparc*-*-coff) targ_emul=coff_sparc ;;
sparc*-*-elf) targ_emul=elf32_sparc ;;
sparc*-*-sysv4*) targ_emul=elf32_sparc ;;
-sparc64-*-freebsd* | sparcv9-*-freebsd*)
+sparc64-*-freebsd* | sparcv9-*-freebsd* | sparc64-*-kfreebsd*-gnu | sparcv9-*-kfreebsd*-gnu)
targ_emul=elf64_sparc_fbsd
targ_extra_emuls="elf64_sparc elf32_sparc"
targ_extra_libpath=$targ_extra_emuls
@@ -94,6 +98,7 @@ sparc*-wrs-vxworks*) targ_emul=sparcaout ;;
sparc*-*-rtemsaout*) targ_emul=sparcaout ;;
sparc*-*-rtemself*) targ_emul=elf32_sparc ;;
sparc*-*-rtems*) targ_emul=elf32_sparc ;;
+i860-*-coff) targ_emul=coff_i860 ;;
i860-stardent-sysv4* | i860-stardent-elf*)
targ_emul=elf32_i860 ;;
i960-wrs-vxworks5.0*) targ_emul=gld960 ;;
@@ -104,12 +109,16 @@ i960-intel-nindy) targ_emul=gld960 ;;
i960-*-rtems*) targ_emul=gld960coff ;;
i960-*-elf*) targ_emul=elf32_i960 ;;
ia64-*-elf*) targ_emul=elf64_ia64 ;;
-ia64-*-freebsd*) targ_emul=elf64_ia64_fbsd
+ia64-*-freebsd* | ia64-*-kfreebsd*-gnu)
+ targ_emul=elf64_ia64_fbsd
targ_extra_emuls="elf64_ia64" ;;
ia64-*-netbsd*) targ_emul=elf64_ia64 ;;
ia64-*-linux*) targ_emul=elf64_ia64 ;;
ia64-*-aix*) targ_emul=elf64_aix ;;
-m32r-*-*) targ_emul=m32relf ;;
+m32r*le-*-elf*) targ_emul=m32rlelf ;;
+m32r*-*-elf*) targ_emul=m32relf ;;
+m32r*le-*-linux-gnu*) targ_emul=m32rlelf_linux ;;
+m32r*-*-linux-gnu*) targ_emul=m32relf_linux ;;
m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf
targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
@@ -120,30 +129,34 @@ m68*-ericsson-ose) targ_emul=sun3 ;;
m68*-apple-aux*) targ_emul=m68kaux ;;
*-tandem-none) targ_emul=st2000 ;;
i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
-i[3456]86-*-nto-qnx*) targ_emul=i386nto ;;
-i[3456]86-*-vsta) targ_emul=vsta ;;
-i[3456]86-go32-rtems*) targ_emul=i386go32 ;;
-i[3456]86-*-go32) targ_emul=i386go32 ;;
-i[3456]86-*-msdosdjgpp*) targ_emul=i386go32 ;;
-i[3456]86-*-aix*) targ_emul=i386coff ;;
-i[3456]86-*-sco*) targ_emul=i386coff ;;
-i[3456]86-*-isc*) targ_emul=i386coff ;;
-i[3456]86-*-lynxos*) targ_emul=i386lynx ;;
-i[3456]86-*-coff) targ_emul=i386coff ;;
-i[3456]86-*-rtemscoff*) targ_emul=i386coff ;;
-i[3456]86-*-rtemself*) targ_emul=elf_i386 ;;
-i[3456]86-*-rtems*) targ_emul=elf_i386 ;;
-i[3456]86-*-bsd) targ_emul=i386bsd ;;
-i[3456]86-*-bsd386) targ_emul=i386bsd ;;
-i[3456]86-*-bsdi*) targ_emul=i386bsd ;;
-i[3456]86-*-aout) targ_emul=i386aout ;;
-i[3456]86-*-linux*aout*) targ_emul=i386linux
+i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
+i[3-7]86-*-vsta) targ_emul=vsta ;;
+i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
+i[3-7]86-*-go32) targ_emul=i386go32 ;;
+i[3-7]86-*-msdosdjgpp*) targ_emul=i386go32 ;;
+i[3-7]86-*-aix*) targ_emul=i386coff ;;
+i[3-7]86-*-sco*) targ_emul=i386coff ;;
+i[3-7]86-*-isc*) targ_emul=i386coff ;;
+i[3-7]86-*-lynxos*) targ_emul=i386lynx ;;
+i[3-7]86-*-coff) targ_emul=i386coff ;;
+i[3-7]86-*-rtemscoff*) targ_emul=i386coff ;;
+i[3-7]86-*-rtemself*) targ_emul=elf_i386 ;;
+i[3-7]86-*-rtems*) targ_emul=elf_i386 ;;
+i[3-7]86-*-aros*) targ_emul=elf_i386 ;;
+i[3-7]86-*-bsd) targ_emul=i386bsd ;;
+i[3-7]86-*-bsd386) targ_emul=i386bsd ;;
+i[3-7]86-*-bsdi*) targ_emul=i386bsd ;;
+i[3-7]86-*-aout) targ_emul=i386aout ;;
+i[3-7]86-*-linux*aout*) targ_emul=i386linux
targ_extra_emuls=elf_i386
tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
;;
-i[3456]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
-i[3456]86-*-linux-gnu*) targ_emul=elf_i386
+i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
+i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
targ_extra_emuls=i386linux
+ if test x${want64} = xtrue; then
+ targ_extra_emuls="$targ_extra_emuls elf_x86_64"
+ fi
tdir_i386linux=${targ_alias}aout
;;
x86_64-*-linux-gnu*) targ_emul=elf_x86_64
@@ -152,21 +165,24 @@ x86_64-*-linux-gnu*) targ_emul=elf_x86_64
tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
;;
-i[3456]86-*-sysv[45]*) targ_emul=elf_i386 ;;
-i[3456]86-*-solaris2*) targ_emul=elf_i386_ldso
+i[3-7]86-*-sysv[45]*) targ_emul=elf_i386 ;;
+i[3-7]86-*-solaris2*) targ_emul=elf_i386_ldso
targ_extra_emuls="elf_i386"
;;
-i[3456]86-*-unixware) targ_emul=elf_i386 ;;
-i[3456]86-*-solaris*) targ_emul=elf_i386_ldso
+i[3-7]86-*-unixware) targ_emul=elf_i386 ;;
+i[3-7]86-*-solaris*) targ_emul=elf_i386_ldso
targ_extra_emuls="elf_i386"
;;
-i[3456]86-*-netbsdelf*) targ_emul=elf_i386
+i[3-7]86-*-netbsdelf* | \
+i[3-7]86-*-netbsd*-gnu* | \
+i[3-7]86-*-knetbsd*-gnu)
+ targ_emul=elf_i386
targ_extra_emuls=i386nbsd
;;
-i[3456]86-*-netbsdpe*) targ_emul=i386pe
+i[3-7]86-*-netbsdpe*) targ_emul=i386pe
targ_extra_ofiles="deffilep.o pe-dll.o"
;;
-i[3456]86-*-netbsd*) targ_emul=i386nbsd
+i[3-7]86-*-netbsd*) targ_emul=i386nbsd
targ_extra_emuls=elf_i386
;;
x86_64-*-netbsd*) targ_emul=elf_x86_64
@@ -181,37 +197,41 @@ x86_64-*-netbsd*) targ_emul=elf_x86_64
;;
esac
;;
-i[3456]86-*-netware) targ_emul=i386nw ;;
-i[3456]86-*-elf*) targ_emul=elf_i386 ;;
-i[3456]86-*-freebsdaout* | i[3456]86-*-freebsd[12].* | i[3456]86-*-freebsd[12])
+i[3-7]86-*-netware) targ_emul=i386nw ;;
+i[3-7]86-*-elf*) targ_emul=elf_i386 ;;
+i[3-7]86-*-kaos*) targ_emul=elf_i386 ;;
+i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | i[3-7]86-*-freebsd[12])
targ_emul=i386bsd ;;
-i[3456]86-*-freebsd*) targ_emul=elf_i386_fbsd
+i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
+ targ_emul=elf_i386_fbsd
targ_extra_emuls="elf_i386 i386bsd" ;;
-x86_64-*-freebsd*) targ_emul=elf_x86_64_fbsd
+x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
+ targ_emul=elf_x86_64_fbsd
targ_extra_emuls="elf_i386_fbsd elf_x86_64 elf_i386"
tdir_elf_i386=`echo ${targ_alias} \
| sed -e 's/x86_64/i386/'`
;;
-i[3456]86-*-sysv*) targ_emul=i386coff ;;
-i[3456]86-*-ptx*) targ_emul=i386coff ;;
-i[3456]86-*-mach*) targ_emul=i386mach ;;
-i[3456]86-*-gnu*) targ_emul=elf_i386 ;;
-i[3456]86-*-msdos*) targ_emul=i386msdos; targ_extra_emuls=i386aout ;;
-i[3456]86-*-moss*) targ_emul=i386moss; targ_extra_emuls=i386msdos ;;
-i[3456]86-*-winnt*) targ_emul=i386pe ;
+i[3-7]86-*-sysv*) targ_emul=i386coff ;;
+i[3-7]86-*-ptx*) targ_emul=i386coff ;;
+i[3-7]86-*-mach*) targ_emul=i386mach ;;
+i[3-7]86-*-gnu*) targ_emul=elf_i386 ;;
+i[3-7]86-*-msdos*) targ_emul=i386msdos; targ_extra_emuls=i386aout ;;
+i[3-7]86-*-moss*) targ_emul=i386moss; targ_extra_emuls=i386msdos ;;
+i[3-7]86-*-winnt*) targ_emul=i386pe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-i[3456]86-*-pe) targ_emul=i386pe ;
+i[3-7]86-*-pe) targ_emul=i386pe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-i[3456]86-*-cygwin*) targ_emul=i386pe ;
- targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-i[3456]86-*-mingw32*) targ_emul=i386pe ;
+i[3-7]86-*-cygwin*) targ_emul=i386pe ;
+ targ_extra_ofiles="deffilep.o pe-dll.o"
+ test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api' ;;
+i[3-7]86-*-mingw32*) targ_emul=i386pe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-i[3456]86-*-interix*) targ_emul=i386pe_posix;
+i[3-7]86-*-interix*) targ_emul=i386pe_posix;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-i[3456]86-*-beospe*) targ_emul=i386beos ;;
-i[3456]86-*-beos*) targ_emul=elf_i386_be ;;
-i[3456]86-*-vxworks*) targ_emul=i386aout ;;
-i[3456]86-*-chaos) targ_emul=elf_i386_chaos ;;
+i[3-7]86-*-beospe*) targ_emul=i386beos ;;
+i[3-7]86-*-beos*) targ_emul=elf_i386_be ;;
+i[3-7]86-*-vxworks*) targ_emul=elf_i386 ;;
+i[3-7]86-*-chaos) targ_emul=elf_i386_chaos ;;
m8*-*-*) targ_emul=m88kbcs ;;
a29k-*-udi) targ_emul=sa29200 ;;
a29k-*-ebmon) targ_emul=ebmon29k ;;
@@ -220,8 +240,8 @@ a29k-*-*) targ_emul=a29k ;;
arm-*-aout | armel-*-aout) targ_emul=armaoutl ;;
armeb-*-aout) targ_emul=armaoutb ;;
arm-*-coff) targ_emul=armcoff ;;
-arm-*-vxworks) targ_emul=armcoff ;;
-arm-*-freebsd*) targ_emul=armelf_fbsd
+arm-*-freebsd* | arm-*-kfreebsd*-gnu)
+ targ_emul=armelf_fbsd
targ_extra_emuls="armelf" ;;
armeb-*-netbsdelf*) targ_emul=armelfb_nbsd;
targ_extra_emuls="armelf_nbsd armelf armnbsd" ;;
@@ -229,17 +249,23 @@ arm-*-netbsdelf*) targ_emul=armelf_nbsd;
targ_extra_emuls="armelfb_nbsd armelf armnbsd" ;;
arm-*-netbsd*) targ_emul=armnbsd;
targ_extra_emuls="armelf armelf_nbsd armelfb_nbsd" ;;
+arm-*-nto*) targ_emul=armnto ;;
arm-*-openbsd*) targ_emul=armnbsd ;;
arm-*-rtems*) targ_emul=armelf ;;
-arm-*-elf) targ_emul=armelf ;;
+armeb-*-elf) targ_emul=armelfb ;;
+arm-*-elf | arm-*-vxworks)
+ targ_emul=armelf ;;
+arm-*-kaos*) targ_emul=armelf ;;
arm9e-*-elf) targ_emul=armelf ;;
arm-*-oabi) targ_emul=armelf_oabi ;;
+arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
arm*-*-conix*) targ_emul=armelf ;;
thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
strongarm-*-coff) targ_emul=armcoff ;;
strongarm-*-elf) targ_emul=armelf ;;
+strongarm-*-kaos*) targ_emul=armelf ;;
thumb-*-coff) targ_emul=armcoff ;;
thumb-*-elf) targ_emul=armelf ;;
thumb-*-oabi) targ_emul=armelf_oabi ;;
@@ -250,13 +276,13 @@ thumb-*-pe) targ_emul=armpe ;
xscale-*-coff) targ_emul=armcoff ;;
xscale-*-elf) targ_emul=armelf ;;
h8300-*-hms* | h8300-*-coff* | h8300-*-rtems*)
- targ_emul=h8300; targ_extra_emuls="h8300h h8300s"
+ targ_emul=h8300; targ_extra_emuls="h8300h h8300s h8300hn h8300sn h8300sx h8300sxn"
;;
h8300-*-elf*)
targ_emul=h8300elf;
- targ_extra_emuls="h8300helf h8300self"
+ targ_extra_emuls="h8300helf h8300self h8300hnelf h8300snelf h8300sxelf h8300sxnelf"
;;
-h8500-*-hms* | h8500-*-coff*)
+h8500-*-hms* | h8500-*-coff* | h8500-*-rtems*)
targ_emul=h8500
targ_extra_emuls="h8500s h8500b h8500m h8500c"
;;
@@ -265,6 +291,13 @@ sh-*-linux*)
targ_extra_emuls=shelf_linux
targ_extra_libpath=shelf_linux
;;
+sh64eb-*-linux*) targ_emul=shelf32_linux
+ targ_extra_emuls="shlelf32_linux"
+ ;;
+sh64-*-linux*) targ_emul=shlelf32_linux
+ targ_extra_emuls="shelf32_linux"
+ targ_extra_libpath=shelf32_linux
+ ;;
sh*eb-*-linux*)
targ_emul=shelf_linux
;;
@@ -287,7 +320,7 @@ sh64-*-netbsd*)
targ_emul=shelf64_nbsd
targ_extra_emuls="shlelf64_nbsd shelf32_nbsd shlelf32_nbsd shelf_nbsd shlelf_nbsd"
;;
-sh*le-*-netbsdelf*)
+sh*l*-*-netbsdelf*)
targ_emul=shlelf_nbsd
targ_extra_emuls=shelf_nbsd
;;
@@ -295,17 +328,21 @@ sh*-*-netbsdelf*)
targ_emul=shelf_nbsd
targ_extra_emuls=shlelf_nbsd
;;
-shle*-*-elf* | sh[1234]*le*-*-elf)
+shle*-*-elf* | sh[1234]*le*-*-elf | shle*-*-kaos*)
targ_emul=shlelf
targ_extra_emuls="shelf shl sh"
;;
-sh-*-elf* | sh[1234]*-*-elf | sh-*-rtemself*)
+sh-*-rtemscoff*) targ_emul=sh; targ_extra_emuls=shl ;;
+sh-*-elf* | sh[1234]*-*-elf | sh-*-rtems* | sh-*-kaos* | sh-*-vxworks)
targ_emul=shelf
targ_extra_emuls="shlelf sh shl"
;;
+sh-*-nto*) targ_emul=shelf_nto
+ targ_extra_emuls=shlelf_nto
+ ;;
sh-*-pe) targ_emul=shpe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-sh-*-*|sh-*-rtems*) targ_emul=sh; targ_extra_emuls=shl ;;
+sh-*-*) targ_emul=sh; targ_extra_emuls=shl ;;
sh64le-*-elf*)
targ_emul=shlelf
targ_extra_emuls="shelf shlelf32 shelf32 shlelf64 shelf64"
@@ -331,6 +368,7 @@ m68k-*-linux-gnu*) targ_emul=m68kelf
targ_extra_emuls=m68klinux
tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
;;
+m68k-*-uclinux*) targ_emul=m68kelf ;;
m68*-*-gnu*) targ_emul=m68kelf ;;
m68*-*-lynxos*) targ_emul=m68klynx ;;
m68*-*-netbsd*4k*) targ_emul=m68k4knbsd
@@ -357,6 +395,7 @@ vax-*-netbsdelf*) targ_emul=elf32vax
vax-*-netbsdaout* | vax-*-netbsd*)
targ_emul=vaxnbsd
targ_extra_emuls=elf32vax ;;
+vax-*-linux-gnu*) targ_emul=elf32vax ;;
mips*-*-pe) targ_emul=mipspe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
mips*-dec-ultrix*) targ_emul=mipslit ;;
@@ -364,11 +403,11 @@ mips*-dec-osf*) targ_emul=mipslit ;;
mips*-sgi-irix5*) targ_emul=elf32bsmip ;;
mips*-sgi-irix6*) targ_emul=elf32bmipn32
targ_extra_emuls="elf32bsmip elf64bmip"
+ targ_extra_libpath=$targ_extra_emuls
;;
mips*-sgi-irix*) targ_emul=mipsbig ;;
mips*el-*-ecoff*) targ_emul=mipsidtl ;;
mips*-*-ecoff*) targ_emul=mipsidt ;;
-mips*-dec-bsd*) targ_emul=mipsbsd ;;
mips*el-*-netbsd*) targ_emul=elf32lmip
targ_extra_emuls="elf32bmip"
;;
@@ -387,12 +426,20 @@ mips*-*-elf*) targ_emul=elf32ebmip ;;
mips*el-*-rtems*) targ_emul=elf32elmip ;;
mips*-*-rtems*) targ_emul=elf32ebmip ;;
mips*el-*-vxworks*) targ_emul=elf32elmip ;;
-mips*-*-vxworks*) targ_emul=elf32ebmip ;;
+mips*-*-vxworks*) targ_emul=elf32ebmip
+ targ_extra_emuls="elf32elmip" ;;
+mips*-*-windiss) targ_emul=elf32mipswindiss ;;
+mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+ ;;
+mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+ ;;
mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
- targ_extra_emuls="elf32btsmip elf64ltsmip elf64btsmip"
+ targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
;;
mips*-*-linux-gnu*) targ_emul=elf32btsmip
- targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip"
+ targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
;;
mips*-*-lnews*) targ_emul=mipslnews ;;
mips*-*-sysv4*) targ_emul=elf32btsmip ;;
@@ -401,7 +448,10 @@ mmix-*-*) targ_emul=mmo
;;
mn10200-*-*) targ_emul=mn10200 ;;
mn10300-*-*) targ_emul=mn10300 ;;
-alpha*-*-freebsd*) targ_emul=elf64alpha_fbsd
+msp430-*-*) targ_emul=msp430x110
+ targ_extra_emuls="msp430x112 msp430x1101 msp430x1111 msp430x1121 msp430x1122 msp430x1132 msp430x122 msp430x123 msp430x1222 msp430x1232 msp430x133 msp430x135 msp430x1331 msp430x1351 msp430x147 msp430x148 msp430x149 msp430x155 msp430x156 msp430x157 msp430x167 msp430x168 msp430x169 msp430x311 msp430x312 msp430x313 msp430x314 msp430x315 msp430x323 msp430x325 msp430x336 msp430x337 msp430x412 msp430x413 msp430xE423 msp430xE425 msp430xE427 msp430xW423 msp430xW425 msp430xW427 msp430x435 msp430x436 msp430x437 msp430x447 msp430x448 msp430x449" ;;
+alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ targ_emul=elf64alpha_fbsd
targ_extra_emuls="elf64alpha alpha"
tdir_alpha=`echo ${targ_alias} | sed -e 's/freebsd/freebsdecoff/'`
;;
@@ -422,11 +472,12 @@ ns32k-*-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd ;;
openrisc-*-*) targ_emul=elf32openrisc ;;
or32-*-coff) targ_emul=or32 ;;
or32-*-elf) targ_emul=or32elf ;;
-or32-*-rtems) targ_emul=or32 ;;
+or32-*-rtems*) targ_emul=or32elf ;;
pdp11-*-*) targ_emul=pdp11 ;;
pjl*-*-*) targ_emul=pjlelf ; targ_extra_emuls="elf_i386" ;;
pj*-*-*) targ_emul=pjelf ;;
-powerpc-*-freebsd*) targ_emul=elf32ppc_fbsd;
+powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu)
+ targ_emul=elf32ppc_fbsd;
targ_extra_emuls="elf32ppc elf32ppcsim";
targ_extra_libpath=elf32ppc;
tdir_elf32ppcsim=`echo ${targ_alias} | sed -e 's/ppc/ppcsim/'`
@@ -435,13 +486,18 @@ powerpc*-*-linux*)
case "${targ}" in
*64*) targ_emul=elf64ppc
targ_extra_emuls="elf32ppclinux elf32ppc elf32ppcsim"
- targ_extra_libpath=elf32ppclinux
+ targ_extra_libpath="elf32ppclinux elf32ppc"
tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'`
tdir_elf32ppclinux=$tdir_elf32ppc
tdir_elf32ppcsim=$tdir_elf32ppc ;;
*) targ_emul=elf32ppclinux
targ_extra_emuls="elf32ppc elf32ppcsim"
- targ_extra_libpath=elf32ppc ;;
+ targ_extra_libpath=elf32ppc
+ if test "${want64}" = "true"; then
+ targ_extra_emuls="$targ_extra_emuls elf64ppc"
+ targ_extra_libpath="$targ_extra_libpath elf64ppc"
+ fi
+ ;;
esac ;;
powerpc*le-*-elf* | powerpc*le-*-eabi* | powerpc*le-*-solaris* \
| powerpc*le-*-sysv* | powerpc*le-*-vxworks*)
@@ -454,7 +510,7 @@ powerpc*le-*-elf* | powerpc*le-*-eabi* | powerpc*le-*-solaris* \
targ_extra_emuls="elf32ppcsim" ;;
esac ;;
powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \
- | powerpc*-*-netbsd* | powerpc-*-openbsd* | powerpc*-*-vxworks*)
+ | powerpc*-*-netbsd* | powerpc-*-openbsd* | powerpc*-*-vxworks* | powerpc*-*-kaos*)
case "${targ}" in
*64*) targ_emul=elf64ppc
targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim"
@@ -464,6 +520,8 @@ powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \
*) targ_emul=elf32ppc
targ_extra_emuls="elf32ppclinux elf32ppcsim" ;;
esac ;;
+powerpc-*-nto*) targ_emul=elf32ppcnto ;;
+powerpcle-*-nto*) targ_emul=elf32lppcnto ;;
powerpcle-*-rtems*) targ_emul=elf32leppc ;;
powerpc-*-rtems*) targ_emul=elf32ppc ;;
powerpc-*-macos*) targ_emul=ppcmacos ;;
@@ -479,14 +537,18 @@ rs6000-*-aix5*) targ_emul=aix5rs6 ;;
rs6000-*-aix*) targ_emul=aixrs6 ;;
tic30-*-*aout*) targ_emul=tic30aout ;;
tic30-*-*coff*) targ_emul=tic30coff ;;
+tic4x-*-* | c4x-*-*) targ_emul=tic4xcoff ; targ_extra_emuls="tic3xcoff tic3xcoff_onchip" ;;
tic54x-*-* | c54x*-*-*) targ_emul=tic54xcoff ;;
tic80-*-*) targ_emul=tic80coff ;;
v850-*-*) targ_emul=v850 ;;
v850e-*-*) targ_emul=v850 ;;
v850ea-*-*) targ_emul=v850 ;;
-frv-*-*) targ_emul=elf32frv ;;
+iq2000-*-elf) targ_emul=elf32iq2000 ; targ_extra_emuls="elf32iq10" ;;
+frv-*-*linux*) targ_emul=elf32frvfd ;;
+frv-*-*) targ_emul=elf32frv ; targ_extra_emuls="elf32frvfd" ;;
w65-*-*) targ_emul=w65 ;;
xstormy16-*-*) targ_emul=elf32xstormy16 ;;
+xtensa-*-*) targ_emul=elf32xtensa;;
fr30-*-*) targ_emul=elf32fr30 ;;
mcore-*-pe) targ_emul=mcorepe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
@@ -502,6 +564,7 @@ s390-*-linux*) targ_emul=elf_s390
tdir_elf64_s390=`echo ${targ_alias} | sed -e 's/s390/s390x/'`
fi ;;
*-*-ieee*) targ_emul=vanilla ;;
+ip2k-*-elf) targ_emul=elf32ip2k ;;
*)
echo 2>&1 "*** ld does not support target ${targ}"
@@ -509,3 +572,53 @@ s390-*-linux*) targ_emul=elf_s390
exit 1
esac
+
+NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib'
+case "${target}" in
+
+*-*-freebsd*)
+ NATIVE_LIB_DIRS='/lib /usr/lib /usr/local/lib'
+ ;;
+
+hppa*64*-*-hpux11*)
+ NATIVE_LIB_DIRS=/usr/lib/pa20_64
+ ;;
+
+i[3-7]86-*-sysv4*)
+ NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
+ ;;
+
+i[3-7]86-*-solaris*)
+ NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
+ ;;
+
+i[3-7]86-pc-interix*)
+ NATIVE_LIB_DIRS='/usr/local/lib $$INTERIX_ROOT/usr/lib /lib /usr/lib'
+ ;;
+
+ia64-*-aix*)
+ NATIVE_LIB_DIRS='/usr/local/lib /usr/lib/ia64l64 /lib /usr/lib'
+ ;;
+
+sparc*-*-solaris2*)
+ NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
+ ;;
+
+i[03-9x]86-*-cygwin*)
+ NATIVE_LIB_DIRS='/usr/lib /usr/lib/w32api'
+ ;;
+
+*-*-linux*)
+ ;;
+
+*-*-freebsd*)
+ ;;
+
+*-*-netbsd*)
+ ;;
+
+alpha*-*-*)
+ NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
+ ;;
+
+esac
diff --git a/contrib/binutils/ld/deffile.h b/contrib/binutils/ld/deffile.h
index efd7834..f1e3301 100644
--- a/contrib/binutils/ld/deffile.h
+++ b/contrib/binutils/ld/deffile.h
@@ -1,5 +1,5 @@
/* deffile.h - header for .DEF file parser
- Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
Written by DJ Delorie dj@cygnus.com
This file is part of GLD, the Gnu Linker.
@@ -22,8 +22,6 @@
#ifndef DEFFILE_H
#define DEFFILE_H
-#include "ansidecl.h"
-
/* DEF storage definitions. Note that any ordinal may be zero, and
any pointer may be NULL, if not defined by the DEF file. */
@@ -52,65 +50,54 @@ typedef struct def_file_import {
def_file_module *module; /* always set */
char *name; /* may be NULL; either this or ordinal will be set */
int ordinal; /* may be -1 */
+ int data; /* = 1 if data */
} def_file_import;
typedef struct def_file {
- /* from the NAME or LIBRARY command */
+ /* From the NAME or LIBRARY command. */
char *name;
int is_dll; /* -1 if NAME/LIBRARY not given */
bfd_vma base_address; /* (bfd_vma)(-1) if unspecified */
- /* from the DESCRIPTION command */
+ /* From the DESCRIPTION command. */
char *description;
- /* from the STACK/HEAP command, -1 if unspecified */
+ /* From the STACK/HEAP command, -1 if unspecified. */
int stack_reserve, stack_commit;
int heap_reserve, heap_commit;
- /* from the SECTION/SEGMENT commands */
+ /* From the SECTION/SEGMENT commands. */
int num_section_defs;
def_file_section *section_defs;
- /* from the EXPORTS commands */
+ /* From the EXPORTS commands. */
int num_exports;
def_file_export *exports;
- /* used by imports for module names */
+ /* Used by imports for module names. */
def_file_module *modules;
- /* from the IMPORTS commands */
+ /* From the IMPORTS commands. */
int num_imports;
def_file_import *imports;
- /* from the VERSION command, -1 if not specified */
+ /* From the VERSION command, -1 if not specified. */
int version_major, version_minor;
} def_file;
-extern def_file *def_file_empty PARAMS ((void));
-
-/* add_to may be NULL. If not, this .def is appended to it */
-extern def_file *def_file_parse PARAMS ((const char *_filename,
- def_file * _add_to));
-
-extern void def_file_free PARAMS ((def_file * _def));
-
-extern def_file_export *def_file_add_export PARAMS ((def_file * _def,
- const char *_name,
- const char *_internal_name,
- int _ordinal));
-
-extern def_file_import *def_file_add_import PARAMS ((def_file * _def,
- const char *_name,
- const char *_from,
- int _ordinal,
- const char *_imported_name));
-
-extern void def_file_add_directive PARAMS ((def_file * _def,
- const char *param,
- int len));
-
+extern def_file *def_file_empty (void);
+
+/* The second arg may be NULL. If not, this .def is appended to it. */
+extern def_file *def_file_parse (const char *, def_file *);
+extern void def_file_free (def_file *);
+extern def_file_export *def_file_add_export (def_file *, const char *,
+ const char *, int);
+extern def_file_import *def_file_add_import (def_file *, const char *,
+ const char *, int, const char *);
+extern void def_file_add_directive (def_file *, const char *, int);
+extern def_file_module *def_get_module (def_file *, const char *);
#ifdef DEF_FILE_PRINT
-extern void def_file_print PARAMS ((FILE * _file, def_file * _def));
+extern void def_file_print (FILE *, def_file *);
#endif
#endif /* DEFFILE_H */
diff --git a/contrib/binutils/ld/deffilep.y b/contrib/binutils/ld/deffilep.y
index 51d17f8..80cf548 100644
--- a/contrib/binutils/ld/deffilep.y
+++ b/contrib/binutils/ld/deffilep.y
@@ -1,23 +1,23 @@
%{ /* deffilep.y - parser for .def files */
-/* Copyright 1995, 1997, 1998, 1999, 2000, 2001
+/* Copyright 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
-This file is part of GNU Binutils.
+ This file is part of GNU Binutils.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include "libiberty.h"
@@ -37,7 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
yacc generated parsers in ld. Note that these are only the variables
produced by yacc. If other parser generators (bison, byacc, etc) produce
additional global names that conflict at link time, then those parser
- generators need to be fixed instead of adding those names to this list. */
+ generators need to be fixed instead of adding those names to this list. */
#define yymaxdepth def_maxdepth
#define yyparse def_parse
@@ -66,8 +66,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define yy_yyv def_yyv
#define yyval def_val
#define yylloc def_lloc
-#define yyreds def_reds /* With YYDEBUG defined */
-#define yytoks def_toks /* With YYDEBUG defined */
+#define yyreds def_reds /* With YYDEBUG defined. */
+#define yytoks def_toks /* With YYDEBUG defined. */
#define yylhs def_yylhs
#define yylen def_yylen
#define yydefred def_yydefred
@@ -78,25 +78,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define yytable def_yytable
#define yycheck def_yycheck
-static void def_description PARAMS ((const char *));
-static void def_exports PARAMS ((const char *, const char *, int, int));
-static void def_heapsize PARAMS ((int, int));
-static void def_import
- PARAMS ((const char *, const char *, const char *, const char *, int));
-static void def_library PARAMS ((const char *, int));
-static def_file_module *def_stash_module PARAMS ((def_file *, const char *));
-static void def_name PARAMS ((const char *, int));
-static void def_section PARAMS ((const char *, int));
-static void def_section_alt PARAMS ((const char *, const char *));
-static void def_stacksize PARAMS ((int, int));
-static void def_version PARAMS ((int, int));
-static void def_directive PARAMS ((char *));
-static int def_parse PARAMS ((void));
-static int def_error PARAMS ((const char *));
-static void put_buf PARAMS ((char));
-static int def_getc PARAMS ((void));
-static int def_ungetc PARAMS ((int));
-static int def_lex PARAMS ((void));
+static void def_description (const char *);
+static void def_exports (const char *, const char *, int, int);
+static void def_heapsize (int, int);
+static void def_import (const char *, const char *, const char *, const char *,
+ int);
+static void def_library (const char *, int);
+static void def_name (const char *, int);
+static void def_section (const char *, int);
+static void def_section_alt (const char *, const char *);
+static void def_stacksize (int, int);
+static void def_version (int, int);
+static void def_directive (char *);
+static int def_parse (void);
+static int def_error (const char *);
+static int def_lex (void);
static int lex_forced_token = 0;
static const char *lex_parse_string = 0;
@@ -109,15 +105,15 @@ static const char *lex_parse_string_end = 0;
int number;
};
-%token NAME, LIBRARY, DESCRIPTION, STACKSIZE, HEAPSIZE, CODE, DATAU, DATAL
-%token SECTIONS, EXPORTS, IMPORTS, VERSIONK, BASE, CONSTANTU, CONSTANTL
-%token PRIVATEU, PRIVATEL
+%token NAME LIBRARY DESCRIPTION STACKSIZE HEAPSIZE CODE DATAU DATAL
+%token SECTIONS EXPORTS IMPORTS VERSIONK BASE CONSTANTU CONSTANTL
+%token PRIVATEU PRIVATEL
%token READ WRITE EXECUTE SHARED NONAMEU NONAMEL DIRECTIVE
%token <id> ID
%token <number> NUMBER
%type <number> opt_base opt_ordinal
%type <number> attr attr_list opt_number exp_opt_list exp_opt
-%type <id> opt_name opt_equal_name
+%type <id> opt_name opt_equal_name dot_name
%%
@@ -152,7 +148,7 @@ expline:
/* The opt_comma is necessary to support both the usual
DEF file syntax as well as .drectve syntax which
mandates <expsym>,<expoptlist>. */
- ID opt_equal_name opt_ordinal opt_comma exp_opt_list
+ dot_name opt_equal_name opt_ordinal opt_comma exp_opt_list
{ def_exports ($1, $2, $3, $5); }
;
exp_opt_list:
@@ -219,7 +215,7 @@ attr:
opt_name: ID { $$ = $1; }
| ID '.' ID
{
- char * name = xmalloc (strlen ($1) + 1 + strlen ($3) + 1);
+ char *name = xmalloc (strlen ($1) + 1 + strlen ($3) + 1);
sprintf (name, "%s.%s", $1, $3);
$$ = name;
}
@@ -232,14 +228,22 @@ opt_ordinal:
;
opt_equal_name:
- '=' ID { $$ = $2; }
+ '=' dot_name { $$ = $2; }
| { $$ = 0; }
;
opt_base: BASE '=' NUMBER { $$ = $3;}
- | { $$ = 0;}
+ | { $$ = -1;}
;
+dot_name: ID { $$ = $1; }
+ | dot_name '.' ID
+ {
+ char *name = xmalloc (strlen ($1) + 1 + strlen ($3) + 1);
+ sprintf (name, "%s.%s", $1, $3);
+ $$ = name;
+ }
+ ;
%%
@@ -264,12 +268,12 @@ struct directive
static struct directive *directives = 0;
def_file *
-def_file_empty ()
+def_file_empty (void)
{
- def_file *rv = (def_file *) xmalloc (sizeof (def_file));
+ def_file *rv = xmalloc (sizeof (def_file));
memset (rv, 0, sizeof (def_file));
rv->is_dll = -1;
- rv->base_address = (bfd_vma) (-1);
+ rv->base_address = (bfd_vma) -1;
rv->stack_reserve = rv->stack_commit = -1;
rv->heap_reserve = rv->heap_commit = -1;
rv->version_major = rv->version_minor = -1;
@@ -277,9 +281,7 @@ def_file_empty ()
}
def_file *
-def_file_parse (filename, add_to)
- const char *filename;
- def_file *add_to;
+def_file_parse (const char *filename, def_file *add_to)
{
struct directive *d;
@@ -322,10 +324,10 @@ def_file_parse (filename, add_to)
}
void
-def_file_free (def)
- def_file *def;
+def_file_free (def_file *def)
{
int i;
+
if (!def)
return;
if (def->name)
@@ -383,17 +385,16 @@ def_file_free (def)
#ifdef DEF_FILE_PRINT
void
-def_file_print (file, def)
- FILE *file;
- def_file *def;
+def_file_print (FILE *file, def_file *def)
{
int i;
+
fprintf (file, ">>>> def_file at 0x%08x\n", def);
if (def->name)
fprintf (file, " name: %s\n", def->name ? def->name : "(unspecified)");
if (def->is_dll != -1)
fprintf (file, " is dll: %s\n", def->is_dll ? "yes" : "no");
- if (def->base_address != (bfd_vma) (-1))
+ if (def->base_address != (bfd_vma) -1)
fprintf (file, " base address: 0x%08x\n", def->base_address);
if (def->description)
fprintf (file, " description: `%s'\n", def->description);
@@ -409,6 +410,7 @@ def_file_print (file, def)
if (def->num_section_defs > 0)
{
fprintf (file, " section defs:\n");
+
for (i = 0; i < def->num_section_defs; i++)
{
fprintf (file, " name: `%s', class: `%s', flags:",
@@ -428,6 +430,7 @@ def_file_print (file, def)
if (def->num_exports > 0)
{
fprintf (file, " exports:\n");
+
for (i = 0; i < def->num_exports; i++)
{
fprintf (file, " name: `%s', int: `%s', ordinal: %d, flags:",
@@ -448,6 +451,7 @@ def_file_print (file, def)
if (def->num_imports > 0)
{
fprintf (file, " imports:\n");
+
for (i = 0; i < def->num_imports; i++)
{
fprintf (file, " int: %s, from: `%s', name: `%s', ordinal: %d\n",
@@ -457,28 +461,31 @@ def_file_print (file, def)
def->imports[i].ordinal);
}
}
+
if (def->version_major != -1)
fprintf (file, " version: %d.%d\n", def->version_major, def->version_minor);
+
fprintf (file, "<<<< def_file at 0x%08x\n", def);
}
#endif
def_file_export *
-def_file_add_export (def, external_name, internal_name, ordinal)
- def_file *def;
- const char *external_name;
- const char *internal_name;
- int ordinal;
+def_file_add_export (def_file *def,
+ const char *external_name,
+ const char *internal_name,
+ int ordinal)
{
def_file_export *e;
int max_exports = ROUND_UP(def->num_exports, 32);
+
if (def->num_exports >= max_exports)
{
- max_exports = ROUND_UP(def->num_exports+1, 32);
+ max_exports = ROUND_UP(def->num_exports + 1, 32);
if (def->exports)
- def->exports = (def_file_export *) xrealloc (def->exports, max_exports * sizeof (def_file_export));
+ def->exports = xrealloc (def->exports,
+ max_exports * sizeof (def_file_export));
else
- def->exports = (def_file_export *) xmalloc (max_exports * sizeof (def_file_export));
+ def->exports = xmalloc (max_exports * sizeof (def_file_export));
}
e = def->exports + def->num_exports;
memset (e, 0, sizeof (def_file_export));
@@ -493,16 +500,26 @@ def_file_add_export (def, external_name, internal_name, ordinal)
return e;
}
-static def_file_module *
-def_stash_module (def, name)
- def_file *def;
- const char *name;
+def_file_module *
+def_get_module (def_file *def, const char *name)
{
def_file_module *s;
- for (s=def->modules; s; s=s->next)
+
+ for (s = def->modules; s; s = s->next)
if (strcmp (s->name, name) == 0)
return s;
- s = (def_file_module *) xmalloc (sizeof (def_file_module) + strlen (name));
+
+ return NULL;
+}
+
+static def_file_module *
+def_stash_module (def_file *def, const char *name)
+{
+ def_file_module *s;
+
+ if ((s = def_get_module (def, name)) != NULL)
+ return s;
+ s = xmalloc (sizeof (def_file_module) + strlen (name));
s->next = def->modules;
def->modules = s;
s->user_data = 0;
@@ -511,22 +528,24 @@ def_stash_module (def, name)
}
def_file_import *
-def_file_add_import (def, name, module, ordinal, internal_name)
- def_file *def;
- const char *name;
- const char *module;
- int ordinal;
- const char *internal_name;
+def_file_add_import (def_file *def,
+ const char *name,
+ const char *module,
+ int ordinal,
+ const char *internal_name)
{
def_file_import *i;
- int max_imports = ROUND_UP(def->num_imports, 16);
+ int max_imports = ROUND_UP (def->num_imports, 16);
+
if (def->num_imports >= max_imports)
{
- max_imports = ROUND_UP(def->num_imports+1, 16);
+ max_imports = ROUND_UP (def->num_imports+1, 16);
+
if (def->imports)
- def->imports = (def_file_import *) xrealloc (def->imports, max_imports * sizeof (def_file_import));
+ def->imports = xrealloc (def->imports,
+ max_imports * sizeof (def_file_import));
else
- def->imports = (def_file_import *) xmalloc (max_imports * sizeof (def_file_import));
+ def->imports = xmalloc (max_imports * sizeof (def_file_import));
}
i = def->imports + def->num_imports;
memset (i, 0, sizeof (def_file_import));
@@ -540,6 +559,7 @@ def_file_add_import (def, name, module, ordinal, internal_name)
else
i->internal_name = i->name;
def->num_imports++;
+
return i;
}
@@ -558,29 +578,40 @@ diropts[] =
};
void
-def_file_add_directive (my_def, param, len)
- def_file *my_def;
- const char *param;
- int len;
+def_file_add_directive (def_file *my_def, const char *param, int len)
{
def_file *save_def = def;
const char *pend = param + len;
- const char *tend = param;
+ char * tend = (char *) param;
int i;
def = my_def;
while (param < pend)
{
- while (param < pend && ISSPACE (*param))
+ while (param < pend
+ && (ISSPACE (*param) || *param == '\n' || *param == 0))
param++;
- for (tend = param + 1;
- tend < pend && !(ISSPACE (tend[-1]) && *tend == '-');
- tend++);
+
+ if (param == pend)
+ break;
+
+ /* Scan forward until we encounter any of:
+ - the end of the buffer
+ - the start of a new option
+ - a newline seperating options
+ - a NUL seperating options. */
+ for (tend = (char *) (param + 1);
+ (tend < pend
+ && !(ISSPACE (tend[-1]) && *tend == '-')
+ && *tend != '\n' && *tend != 0);
+ tend++)
+ ;
for (i = 0; diropts[i].param; i++)
{
int len = strlen (diropts[i].param);
+
if (tend - param >= len
&& strncmp (param, diropts[i].param, len) == 0
&& (param[len] == ':' || param[len] == ' '))
@@ -589,17 +620,23 @@ def_file_add_directive (my_def, param, len)
lex_parse_string = param + len + 1;
lex_forced_token = diropts[i].token;
saw_newline = 0;
- def_parse ();
+ if (def_parse ())
+ continue;
break;
}
}
if (!diropts[i].param)
{
+ char saved;
+
+ saved = * tend;
+ * tend = 0;
/* xgettext:c-format */
- einfo (_("Warning: .drectve `%.*s' unrecognized\n"),
- tend - param, param);
+ einfo (_("Warning: .drectve `%s' unrecognized\n"), param);
+ * tend = saved;
}
+
lex_parse_string = 0;
param = tend;
}
@@ -607,14 +644,10 @@ def_file_add_directive (my_def, param, len)
def = save_def;
}
-/*****************************************************************************
- Parser Callbacks
- *****************************************************************************/
+/* Parser Callbacks. */
static void
-def_name (name, base)
- const char *name;
- int base;
+def_name (const char *name, int base)
{
if (def->name)
free (def->name);
@@ -624,9 +657,7 @@ def_name (name, base)
}
static void
-def_library (name, base)
- const char *name;
- int base;
+def_library (const char *name, int base)
{
if (def->name)
free (def->name);
@@ -636,55 +667,52 @@ def_library (name, base)
}
static void
-def_description (text)
- const char *text;
+def_description (const char *text)
{
int len = def->description ? strlen (def->description) : 0;
+
len += strlen (text) + 1;
if (def->description)
{
- def->description = (char *) xrealloc (def->description, len);
+ def->description = xrealloc (def->description, len);
strcat (def->description, text);
}
else
{
- def->description = (char *) xmalloc (len);
+ def->description = xmalloc (len);
strcpy (def->description, text);
}
}
static void
-def_stacksize (reserve, commit)
- int reserve;
- int commit;
+def_stacksize (int reserve, int commit)
{
def->stack_reserve = reserve;
def->stack_commit = commit;
}
static void
-def_heapsize (reserve, commit)
- int reserve;
- int commit;
+def_heapsize (int reserve, int commit)
{
def->heap_reserve = reserve;
def->heap_commit = commit;
}
static void
-def_section (name, attr)
- const char *name;
- int attr;
+def_section (const char *name, int attr)
{
def_file_section *s;
- int max_sections = ROUND_UP(def->num_section_defs, 4);
+ int max_sections = ROUND_UP (def->num_section_defs, 4);
+
if (def->num_section_defs >= max_sections)
{
- max_sections = ROUND_UP(def->num_section_defs+1, 4);
+ max_sections = ROUND_UP (def->num_section_defs+1, 4);
+
if (def->section_defs)
- def->section_defs = (def_file_section *) xrealloc (def->section_defs, max_sections * sizeof (def_file_import));
+ def->section_defs = xrealloc (def->section_defs,
+ max_sections * sizeof (def_file_import));
else
- def->section_defs = (def_file_section *) xmalloc (max_sections * sizeof (def_file_import));
+ def->section_defs = xmalloc (max_sections * sizeof (def_file_import));
}
s = def->section_defs + def->num_section_defs;
memset (s, 0, sizeof (def_file_section));
@@ -702,11 +730,10 @@ def_section (name, attr)
}
static void
-def_section_alt (name, attr)
- const char *name;
- const char *attr;
+def_section_alt (const char *name, const char *attr)
{
int aval = 0;
+
for (; *attr; attr++)
{
switch (*attr)
@@ -733,11 +760,10 @@ def_section_alt (name, attr)
}
static void
-def_exports (external_name, internal_name, ordinal, flags)
- const char *external_name;
- const char *internal_name;
- int ordinal;
- int flags;
+def_exports (const char *external_name,
+ const char *internal_name,
+ int ordinal,
+ int flags)
{
def_file_export *dfe;
@@ -759,21 +785,18 @@ def_exports (external_name, internal_name, ordinal, flags)
}
static void
-def_import (internal_name, module, dllext, name, ordinal)
- const char *internal_name;
- const char *module;
- const char *dllext;
- const char *name;
- int ordinal;
+def_import (const char *internal_name,
+ const char *module,
+ const char *dllext,
+ const char *name,
+ int ordinal)
{
char *buf = 0;
-
- if (dllext != NULL)
- {
- buf = (char *) xmalloc (strlen (module) + strlen (dllext) + 2);
- sprintf (buf, "%s.%s", module, dllext);
- module = buf;
- }
+ const char *ext = dllext ? dllext : "dll";
+
+ buf = xmalloc (strlen (module) + strlen (ext) + 2);
+ sprintf (buf, "%s.%s", module, ext);
+ module = buf;
def_file_add_import (def, name, module, ordinal, internal_name);
if (buf)
@@ -781,19 +804,17 @@ def_import (internal_name, module, dllext, name, ordinal)
}
static void
-def_version (major, minor)
- int major;
- int minor;
+def_version (int major, int minor)
{
def->version_major = major;
def->version_minor = minor;
}
static void
-def_directive (str)
- char *str;
+def_directive (char *str)
{
- struct directive *d = (struct directive *) xmalloc (sizeof (struct directive));
+ struct directive *d = xmalloc (sizeof (struct directive));
+
d->next = directives;
directives = d;
d->name = xstrdup (str);
@@ -801,41 +822,37 @@ def_directive (str)
}
static int
-def_error (err)
- const char *err;
+def_error (const char *err)
{
- einfo ("%P: %s:%d: %s\n", def_filename, linenumber, err);
-
+ einfo ("%P: %s:%d: %s\n",
+ def_filename ? def_filename : "<unknown-file>", linenumber, err);
return 0;
}
-/*****************************************************************************
- Lexical Scanner
- *****************************************************************************/
+/* Lexical Scanner. */
#undef TRACE
#define TRACE 0
-/* Never freed, but always reused as needed, so no real leak */
+/* Never freed, but always reused as needed, so no real leak. */
static char *buffer = 0;
static int buflen = 0;
static int bufptr = 0;
static void
-put_buf (c)
- char c;
+put_buf (char c)
{
if (bufptr == buflen)
{
- buflen += 50; /* overly reasonable, eh? */
+ buflen += 50; /* overly reasonable, eh? */
if (buffer)
- buffer = (char *) xrealloc (buffer, buflen + 1);
+ buffer = xrealloc (buffer, buflen + 1);
else
- buffer = (char *) xmalloc (buflen + 1);
+ buffer = xmalloc (buflen + 1);
}
buffer[bufptr++] = c;
- buffer[bufptr] = 0; /* not optimal, but very convenient */
+ buffer[bufptr] = 0; /* not optimal, but very convenient. */
}
static struct
@@ -874,9 +891,10 @@ tokens[] =
};
static int
-def_getc ()
+def_getc (void)
{
int rv;
+
if (lex_parse_string)
{
if (lex_parse_string >= lex_parse_string_end)
@@ -894,8 +912,7 @@ def_getc ()
}
static int
-def_ungetc (c)
- int c;
+def_ungetc (int c)
{
if (lex_parse_string)
{
@@ -907,7 +924,7 @@ def_ungetc (c)
}
static int
-def_lex ()
+def_lex (void)
{
int c, i, q;
@@ -923,7 +940,7 @@ def_lex ()
c = def_getc ();
- /* trim leading whitespace */
+ /* Trim leading whitespace. */
while (c != EOF && (c == ' ' || c == '\t') && saw_newline)
c = def_getc ();
@@ -946,7 +963,8 @@ def_lex ()
return def_lex ();
return 0;
}
- /* must be something else */
+
+ /* Must be something else. */
saw_newline = 0;
if (ISDIGIT (c))
@@ -966,9 +984,27 @@ def_lex ()
return NUMBER;
}
- if (ISALPHA (c) || strchr ("$:-_?", c))
+ if (ISALPHA (c) || strchr ("$:-_?@", c))
{
bufptr = 0;
+ q = c;
+ put_buf (c);
+ c = def_getc ();
+
+ if (q == '@')
+ {
+ if (ISBLANK (c) ) /* '@' followed by whitespace. */
+ return (q);
+ else if (ISDIGIT (c)) /* '@' followed by digit. */
+ {
+ def_ungetc (c);
+ return (q);
+ }
+#if TRACE
+ printf ("lex: @ returns itself\n");
+#endif
+ }
+
while (c != EOF && (ISALNUM (c) || strchr ("$:-_?/@", c)))
{
put_buf (c);
@@ -976,14 +1012,17 @@ def_lex ()
}
if (c != EOF)
def_ungetc (c);
- for (i = 0; tokens[i].name; i++)
- if (strcmp (tokens[i].name, buffer) == 0)
- {
+ if (ISALPHA (q)) /* Check for tokens. */
+ {
+ for (i = 0; tokens[i].name; i++)
+ if (strcmp (tokens[i].name, buffer) == 0)
+ {
#if TRACE
- printf ("lex: `%s' is a string token\n", buffer);
+ printf ("lex: `%s' is a string token\n", buffer);
#endif
- return tokens[i].token;
- }
+ return tokens[i].token;
+ }
+ }
#if TRACE
printf ("lex: `%s' returns ID\n", buffer);
#endif
@@ -996,6 +1035,7 @@ def_lex ()
q = c;
c = def_getc ();
bufptr = 0;
+
while (c != EOF && c != q)
{
put_buf (c);
@@ -1008,7 +1048,7 @@ def_lex ()
return ID;
}
- if (c == '=' || c == '.' || c == '@' || c == ',')
+ if (c == '=' || c == '.' || c == ',')
{
#if TRACE
printf ("lex: `%c' returns itself\n", c);
diff --git a/contrib/binutils/ld/dep-in.sed b/contrib/binutils/ld/dep-in.sed
index aad7d92..83418e2 100644
--- a/contrib/binutils/ld/dep-in.sed
+++ b/contrib/binutils/ld/dep-in.sed
@@ -8,6 +8,7 @@ s!@BFDDIR@!$(BFDDIR)!g
s!@TOPDIR@/bfd!$(BFDDIR)!g
s!@SRCDIR@/!!g
s! \.\./bfd/hosts/[^ ]*\.h! !g
+s! \.\./intl/libintl\.h!!g
s/\\\n */ /g
diff --git a/contrib/binutils/ld/emulparams/arcelf.sh b/contrib/binutils/ld/emulparams/arcelf.sh
new file mode 100644
index 0000000..b1c9c17
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/arcelf.sh
@@ -0,0 +1,11 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-littlearc"
+LITTLE_OUTPUT_FORMAT="elf32-littlearc"
+BIG_OUTPUT_FORMAT="elf32-bigarc"
+TEXT_START_ADDR=0x0
+MAXPAGESIZE=0x1000
+NONPAGED_TEXT_START_ADDR=0x0
+ARCH=arc
+MACHINE=
+ENTRY=start
+#TEMPLATE_NAME=elf32
diff --git a/contrib/binutils/ld/emulparams/armelf.sh b/contrib/binutils/ld/emulparams/armelf.sh
index 0e8ebc5..35a6d23 100644
--- a/contrib/binutils/ld/emulparams/armelf.sh
+++ b/contrib/binutils/ld/emulparams/armelf.sh
@@ -9,6 +9,7 @@ EXTRA_EM_FILE=armelf
OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
OTHER_BSS_SYMBOLS='__bss_start__ = .;'
OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;'
+OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
DATA_START_SYMBOLS='__data_start = . ;';
@@ -22,3 +23,6 @@ EMBEDDED=yes
# This sets the stack to the top of the simulator memory (2^19 bytes).
STACK_ADDR=0x80000
+
+# ARM does not support .s* sections.
+NO_SMALL_DATA=yes
diff --git a/contrib/binutils/ld/emulparams/armelf_linux.sh b/contrib/binutils/ld/emulparams/armelf_linux.sh
index d04d967..88a2d19 100644
--- a/contrib/binutils/ld/emulparams/armelf_linux.sh
+++ b/contrib/binutils/ld/emulparams/armelf_linux.sh
@@ -4,6 +4,7 @@ OUTPUT_FORMAT="elf32-littlearm"
BIG_OUTPUT_FORMAT="elf32-bigarm"
LITTLE_OUTPUT_FORMAT="elf32-littlearm"
MAXPAGESIZE=0x8000
+COMMONPAGESIZE=0x1000
TEMPLATE_NAME=elf32
EXTRA_EM_FILE=armelf
GENERATE_SHLIB_SCRIPT=yes
@@ -12,5 +13,9 @@ DATA_START_SYMBOLS='__data_start = . ;';
OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
OTHER_BSS_SYMBOLS='__bss_start__ = .;'
OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;'
+OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
TEXT_START_ADDR=0x00008000
+
+# ARM does not support .s* sections.
+NO_SMALL_DATA=yes
diff --git a/contrib/binutils/ld/emulparams/armelf_oabi.sh b/contrib/binutils/ld/emulparams/armelf_oabi.sh
index f1c967d..0c2c1d3 100644
--- a/contrib/binutils/ld/emulparams/armelf_oabi.sh
+++ b/contrib/binutils/ld/emulparams/armelf_oabi.sh
@@ -18,3 +18,6 @@ EMBEDDED=yes
# This sets the stack to the top of the simulator memory (2^19 bytes).
STACK_ADDR=0x80000
+
+# ARM does not support .s* sections.
+NO_SMALL_DATA=yes
diff --git a/contrib/binutils/ld/emulparams/armpe.sh b/contrib/binutils/ld/emulparams/armpe.sh
index 257c9de..aa60536 100644
--- a/contrib/binutils/ld/emulparams/armpe.sh
+++ b/contrib/binutils/ld/emulparams/armpe.sh
@@ -1,8 +1,12 @@
ARCH=arm
SCRIPT_NAME=pe
+
OUTPUT_FORMAT="pei-arm-little"
LITTLE_OUTPUT_FORMAT="pei-arm-little"
BIG_OUTPUT_FORMAT="pei-arm-big"
+
+RELOCATEABLE_OUTPUT_FORMAT="pe-arm-little"
+
TEMPLATE_NAME=pe
ENTRY="_mainCRTStartup"
SUBSYSTEM=PE_DEF_SUBSYSTEM
diff --git a/contrib/binutils/ld/emulparams/elf32_sparc.sh b/contrib/binutils/ld/emulparams/elf32_sparc.sh
index 15a837d..af23252 100644
--- a/contrib/binutils/ld/emulparams/elf32_sparc.sh
+++ b/contrib/binutils/ld/emulparams/elf32_sparc.sh
@@ -10,4 +10,5 @@ MACHINE=
TEMPLATE_NAME=elf32
DATA_PLT=
GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
NO_SMALL_DATA=yes
diff --git a/contrib/binutils/ld/emulparams/elf32b4300.sh b/contrib/binutils/ld/emulparams/elf32b4300.sh
new file mode 100644
index 0000000..d3e4354
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/elf32b4300.sh
@@ -0,0 +1,10 @@
+# If you change this file, please also look at files which source this one:
+# elf32l4300.sh
+
+EMBEDDED=yes
+. ${srcdir}/emulparams/elf32bmip.sh
+TEXT_START_ADDR=0xa0020000
+unset NONPAGED_TEXT_START_ADDR
+unset SHLIB_TEXT_START_ADDR
+EXECUTABLE_SYMBOLS='_DYNAMIC_LINK = 0;'
+DYNAMIC_LINK=FALSE
diff --git a/contrib/binutils/ld/emulparams/elf32bmip.sh b/contrib/binutils/ld/emulparams/elf32bmip.sh
new file mode 100644
index 0000000..94e1c9c
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/elf32bmip.sh
@@ -0,0 +1,37 @@
+# If you change this file, please also look at files which source this one:
+# elf32b4300.sh elf32bsmip.sh elf32btsmip.sh elf32ebmip.sh elf32lmip.sh
+
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-bigmips"
+BIG_OUTPUT_FORMAT="elf32-bigmips"
+LITTLE_OUTPUT_FORMAT="elf32-littlemips"
+TEXT_START_ADDR=0x0400000
+test -n "${EMBEDDED}" || DATA_ADDR=0x10000000
+MAXPAGESIZE=0x40000
+COMMONPAGESIZE=0x1000
+NONPAGED_TEXT_START_ADDR=0x0400000
+SHLIB_TEXT_START_ADDR=0x5ffe0000
+test -n "${EMBEDDED}" || TEXT_DYNAMIC=
+INITIAL_READONLY_SECTIONS="
+ .reginfo ${RELOCATING-0} : { *(.reginfo) }
+"
+OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
+OTHER_GOT_SYMBOLS='
+ _gp = ALIGN(16) + 0x7ff0;
+'
+OTHER_SDATA_SECTIONS="
+ .lit8 ${RELOCATING-0} : { *(.lit8) }
+ .lit4 ${RELOCATING-0} : { *(.lit4) }
+"
+TEXT_START_SYMBOLS='_ftext = . ;'
+DATA_START_SYMBOLS='_fdata = . ;'
+OTHER_BSS_SYMBOLS='_fbss = .;'
+OTHER_SECTIONS='
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+'
+ARCH=mips
+MACHINE=
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=mipself
+GENERATE_SHLIB_SCRIPT=yes
diff --git a/contrib/binutils/ld/emulparams/elf32bmipn32.sh b/contrib/binutils/ld/emulparams/elf32bmipn32.sh
new file mode 100755
index 0000000..a320eb2
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/elf32bmipn32.sh
@@ -0,0 +1,22 @@
+. ${srcdir}/emulparams/elf32bmipn32-defs.sh
+OUTPUT_FORMAT="elf32-nbigmips"
+BIG_OUTPUT_FORMAT="elf32-nbigmips"
+LITTLE_OUTPUT_FORMAT="elf32-nlittlemips"
+SHLIB_TEXT_START_ADDR=0x5ffe0000
+COMMONPAGESIZE=0x1000
+
+# IRIX6 defines these symbols. 0x34 is the size of the ELF header.
+EXECUTABLE_SYMBOLS="
+ __dso_displacement = 0;
+ __elf_header = ${TEXT_START_ADDR};
+ __program_header_table = ${TEXT_START_ADDR} + 0x34;
+"
+
+# There are often dynamic relocations against the .rodata section.
+# Setting DT_TEXTREL in the .dynamic section does not convince the
+# IRIX6 linker to permit relocations against the text segment.
+# Following the IRIX linker, we simply put .rodata in the data
+# segment.
+WRITABLE_RODATA=
+
+EXTRA_EM_FILE=irix
diff --git a/contrib/binutils/ld/emulparams/elf32bsmip.sh b/contrib/binutils/ld/emulparams/elf32bsmip.sh
new file mode 100755
index 0000000..dfe0fe0
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/elf32bsmip.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/elf32bmip.sh
+ENTRY=__start
+EXTRA_EM_FILE=irix
diff --git a/contrib/binutils/ld/emulparams/elf32ebmip.sh b/contrib/binutils/ld/emulparams/elf32ebmip.sh
new file mode 100644
index 0000000..704b43e
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/elf32ebmip.sh
@@ -0,0 +1,2 @@
+EMBEDDED=yes
+. ${srcdir}/emulparams/elf32bmip.sh
diff --git a/contrib/binutils/ld/emulparams/elf32elmip.sh b/contrib/binutils/ld/emulparams/elf32elmip.sh
new file mode 100644
index 0000000..c94e503
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/elf32elmip.sh
@@ -0,0 +1,2 @@
+EMBEDDED=yes
+. ${srcdir}/emulparams/elf32lmip.sh
diff --git a/contrib/binutils/ld/emulparams/elf32l4300.sh b/contrib/binutils/ld/emulparams/elf32l4300.sh
new file mode 100644
index 0000000..865792a
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/elf32l4300.sh
@@ -0,0 +1,4 @@
+. ${srcdir}/emulparams/elf32b4300.sh
+OUTPUT_FORMAT="elf32-littlemips"
+BIG_OUTPUT_FORMAT="elf32-bigmips"
+LITTLE_OUTPUT_FORMAT="elf32-littlemips"
diff --git a/contrib/binutils/ld/emulparams/elf32lmip.sh b/contrib/binutils/ld/emulparams/elf32lmip.sh
new file mode 100644
index 0000000..14d4ded
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/elf32lmip.sh
@@ -0,0 +1,7 @@
+# If you change this file, please also look at files which source this one:
+# elf32elmip.sh elf32lsmip.sh
+
+. ${srcdir}/emulparams/elf32bmip.sh
+OUTPUT_FORMAT="elf32-littlemips"
+BIG_OUTPUT_FORMAT="elf32-bigmips"
+LITTLE_OUTPUT_FORMAT="elf32-littlemips"
diff --git a/contrib/binutils/ld/emulparams/elf32lsmip.sh b/contrib/binutils/ld/emulparams/elf32lsmip.sh
new file mode 100755
index 0000000..62e4f98
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/elf32lsmip.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf32lmip.sh
+ENTRY=__start
diff --git a/contrib/binutils/ld/emulparams/elf32ppc.sh b/contrib/binutils/ld/emulparams/elf32ppc.sh
index 778260b..d95cb786 100644
--- a/contrib/binutils/ld/emulparams/elf32ppc.sh
+++ b/contrib/binutils/ld/emulparams/elf32ppc.sh
@@ -2,12 +2,15 @@
# elf32lppc.sh elf32ppclinux.sh elf32ppcsim.sh
TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=ppc32elf
GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-powerpc"
TEXT_START_ADDR=0x01800000
MAXPAGESIZE=0x10000
-ARCH=powerpc
+COMMONPAGESIZE=0x1000
+ARCH=powerpc:common
MACHINE=
BSS_PLT=
EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);'
@@ -25,18 +28,14 @@ OTHER_GOT_RELOC_SECTIONS="
# Treat a host that matches the target with the possible exception of "64"
# in the name as if it were native.
if test `echo "$host" | sed -e s/64//` = `echo "$target" | sed -e s/64//`; then
- case " $EMULATION_LIBPATH " in
- *" ${EMULATION_NAME} "*)
- LIB_PATH=${libdir}
- for lib in ${NATIVE_LIB_DIRS}; do
- case :${LIB_PATH}: in
- *:${lib}:*) ;;
- *) LIB_PATH=${LIB_PATH}:${lib} ;;
- esac
- done
- # Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first.
- case "$EMULATION_NAME" in
- *64*) LIB_PATH=`echo ${LIB_PATH}: | sed -e s,:,64:,g`$LIB_PATH
- esac
- esac
+ case " $EMULATION_LIBPATH " in
+ *" ${EMULATION_NAME} "*)
+ NATIVE=yes
+ ;;
+ esac
fi
+
+# Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first.
+case "$EMULATION_NAME" in
+ *64*) LIBPATH_SUFFIX=64 ;;
+esac
diff --git a/contrib/binutils/ld/emulparams/elf64_ia64.sh b/contrib/binutils/ld/emulparams/elf64_ia64.sh
index 76f35e4..60c8c4c 100644
--- a/contrib/binutils/ld/emulparams/elf64_ia64.sh
+++ b/contrib/binutils/ld/emulparams/elf64_ia64.sh
@@ -2,24 +2,34 @@
SCRIPT_NAME=elf
ELFSIZE=64
TEMPLATE_NAME=elf32
-EXTRA_EM_FILE=needrelax
+EXTRA_EM_FILE=ia64elf
OUTPUT_FORMAT="elf64-ia64-little"
ARCH=ia64
MACHINE=
MAXPAGESIZE=0x10000
-if test -n "$CREATE_SHLIB"; then
+# FIXME: It interferes with linker relaxation. Disable it until it is
+# fixed.
+if test "0" = "1" -a -n "$CREATE_SHLIB"; then
# Optimize shared libraries for 16K page size
COMMONPAGESIZE=0x4000
fi
TEXT_START_ADDR="0x4000000000000000"
DATA_ADDR="0x6000000000000000 + (. & (${MAXPAGESIZE} - 1))"
GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
NOP=0x00300000010070000002000001000400 # a bundle full of nops
OTHER_GOT_SECTIONS="
.IA_64.pltoff ${RELOCATING-0} : { *(.IA_64.pltoff) }"
OTHER_PLT_RELOC_SECTIONS="
.rela.IA_64.pltoff ${RELOCATING-0} : { *(.rela.IA_64.pltoff) }"
-OTHER_READONLY_SECTIONS="
- .opd ${RELOCATING-0} : { *(.opd) }
+OTHER_READONLY_SECTIONS=
+OTHER_READWRITE_SECTIONS=
+test -z "$CREATE_PIE" && OTHER_READONLY_SECTIONS="
+ .opd ${RELOCATING-0} : { *(.opd) }"
+test -n "$CREATE_PIE" && OTHER_READWRITE_SECTIONS="
+ .opd ${RELOCATING-0} : { *(.opd) }"
+test -n "$CREATE_PIE" && OTHER_GOT_RELOC_SECTIONS="
+ .rela.opd ${RELOCATING-0} : { *(.rela.opd) }"
+OTHER_READONLY_SECTIONS="${OTHER_READONLY_SECTIONS}
.IA_64.unwind_info ${RELOCATING-0} : { *(.IA_64.unwind_info${RELOCATING+* .gnu.linkonce.ia64unwi.*}) }
.IA_64.unwind ${RELOCATING-0} : { *(.IA_64.unwind${RELOCATING+* .gnu.linkonce.ia64unw.*}) }"
diff --git a/contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh b/contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh
index d9c9600..47cde5c 100644
--- a/contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh
+++ b/contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh
@@ -1,2 +1,4 @@
. ${srcdir}/emulparams/elf64_ia64.sh
+TEXT_START_ADDR="0x2000000000000000"
+unset DATA_ADDR
. ${srcdir}/emulparams/elf_fbsd.sh
diff --git a/contrib/binutils/ld/emulparams/elf64_s390.sh b/contrib/binutils/ld/emulparams/elf64_s390.sh
index 236fd17..0c689a9 100644
--- a/contrib/binutils/ld/emulparams/elf64_s390.sh
+++ b/contrib/binutils/ld/emulparams/elf64_s390.sh
@@ -9,6 +9,8 @@ MACHINE=
NOP=0x07070707
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+NO_SMALL_DATA=yes
# Treat a host that matches the target with the possible exception of "x"
# in the name as if it were native.
@@ -16,26 +18,17 @@ if test `echo "$host" | sed -e s/390x/390/` \
= `echo "$target" | sed -e s/390x/390/`; then
case " $EMULATION_LIBPATH " in
*" ${EMULATION_NAME} "*)
- LIB_PATH=${libdir}
- for lib in ${NATIVE_LIB_DIRS}; do
- case :${LIB_PATH}: in
- *:${lib}:*) ;;
- *) LIB_PATH=${LIB_PATH}:${lib} ;;
- esac
- done
-
- case "$target" in
- s390*-linux*)
- suffix=64 ;;
- esac
-
- # Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first
- # on Linux.
- if [ -n "$suffix" ]; then
- case "$EMULATION_NAME" in
- *64*)
- LIB_PATH=`echo ${LIB_PATH}: | sed -e s,:,$suffix:,g`$LIB_PATH ;;
- esac
- fi ;;
+ NATIVE=yes
esac
fi
+
+# Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first
+# on Linux.
+case "$target" in
+ s390*-linux*)
+ case "$EMULATION_NAME" in
+ *64*)
+ LIBPATH_SUFFIX=64 ;;
+ esac
+ ;;
+esac
diff --git a/contrib/binutils/ld/emulparams/elf64_sparc.sh b/contrib/binutils/ld/emulparams/elf64_sparc.sh
index 7a4d2dc..0c0f5d8 100644
--- a/contrib/binutils/ld/emulparams/elf64_sparc.sh
+++ b/contrib/binutils/ld/emulparams/elf64_sparc.sh
@@ -8,6 +8,7 @@ ARCH="sparc:v9"
MACHINE=
DATA_PLT=
GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
NOP=0x01000000
NO_SMALL_DATA=yes
@@ -28,31 +29,23 @@ if test `echo "$host" | sed -e 's/64//;s/v[789]//'` \
= `echo "$target" | sed -e 's/64//;s/v[789]//'`; then
case " $EMULATION_LIBPATH " in
*" ${EMULATION_NAME} "*)
- LIB_PATH=${libdir}
- for lib in ${NATIVE_LIB_DIRS}; do
- case :${LIB_PATH}: in
- *:${lib}:*) ;;
- *) LIB_PATH=${LIB_PATH}:${lib} ;;
- esac
- done
-
- # Linux and Solaris modify the default library search path
- # to first include a 64-bit specific directory. It's put
- # in slightly different places on the two systems.
- case "$target" in
- sparc*-linux*)
- suffix=64 ;;
- sparc*-solaris*)
- suffix=/sparcv9 ;;
- esac
-
- # Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first
- # on Linux and /lib/sparcv9, /usr/lib/sparcv9 etc. on Solaris.
- if [ -n "$suffix" ]; then
- case "$EMULATION_NAME" in
- *64*)
- LIB_PATH=`echo ${LIB_PATH}: | sed -e s,:,$suffix:,g`$LIB_PATH ;;
- esac
- fi ;;
+ NATIVE=yes
+ ;;
esac
fi
+
+# Linux and Solaris modify the default library search path
+# to first include a 64-bit specific directory. It's put
+# in slightly different places on the two systems.
+# Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first
+# on Linux and /lib/sparcv9, /usr/lib/sparcv9 etc. on Solaris.
+case "$EMULATION_NAME" in
+ *64*)
+ case "$target" in
+ sparc*-linux*)
+ LIBPATH_SUFFIX=64 ;;
+ sparc*-solaris*)
+ LIBPATH_SUFFIX=/sparcv9 ;;
+ esac
+ ;;
+esac
diff --git a/contrib/binutils/ld/emulparams/elf64alpha.sh b/contrib/binutils/ld/emulparams/elf64alpha.sh
index 3dd28ef..093c8df 100644
--- a/contrib/binutils/ld/emulparams/elf64alpha.sh
+++ b/contrib/binutils/ld/emulparams/elf64alpha.sh
@@ -2,6 +2,7 @@ ENTRY=_start
SCRIPT_NAME=elf
ELFSIZE=64
TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=alphaelf
OUTPUT_FORMAT="elf64-alpha"
TEXT_START_ADDR="0x120000000"
MAXPAGESIZE=0x10000
@@ -10,6 +11,7 @@ NONPAGED_TEXT_START_ADDR="0x120000000"
ARCH=alpha
MACHINE=
GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
DATA_PLT=
# Note that the number is always big-endian, thus we have to
# reverse the digit string.
@@ -17,54 +19,3 @@ NOP=0x0000fe2f1f04ff47 # unop; nop
OTHER_READONLY_SECTIONS="
.reginfo ${RELOCATING-0} : { *(.reginfo) }"
-
-# This code gets inserted into the generic elf32.sc linker script
-# and allows us to define our own command line switches.
-PARSE_AND_LIST_PROLOGUE='
-#define OPTION_TASO 300
-/* Set the start address as in the Tru64 ld */
-#define ALPHA_TEXT_START_32BIT 0x12000000
-
-static int elf64alpha_32bit = 0;
-
-struct ld_emulation_xfer_struct ld_elf64alpha_emulation;
-static void gld_elf64alpha_finish PARAMS ((void));
-'
-
-PARSE_AND_LIST_LONGOPTS='
- {"taso", no_argument, NULL, OPTION_TASO},
-'
-
-PARSE_AND_LIST_OPTIONS='
- fprintf (file, _(" -taso\t\t\tLoad executable in the lower 31-bit addressable\n"));
- fprintf (file, _("\t\t\t virtual address range\n"));
-'
-
-PARSE_AND_LIST_ARGS_CASES='
- case EOF:
- if (elf64alpha_32bit && !link_info.shared && !link_info.relocateable)
- {
- lang_section_start (".interp",
- exp_binop ('\''+'\'',
- exp_intop (ALPHA_TEXT_START_32BIT),
- exp_nameop (SIZEOF_HEADERS, NULL)));
- ld_elf64alpha_emulation.finish = gld_elf64alpha_finish;
- }
- return 0;
-
- case OPTION_TASO:
- elf64alpha_32bit = 1;
- break;
-'
-
-PARSE_AND_LIST_EPILOGUE='
-#include "elf/internal.h"
-#include "elf/alpha.h"
-#include "elf-bfd.h"
-
-static void
-gld_elf64alpha_finish()
-{
- elf_elfheader (output_bfd)->e_flags |= EF_ALPHA_32BIT;
-}
-'
diff --git a/contrib/binutils/ld/emulparams/elf64bmip.sh b/contrib/binutils/ld/emulparams/elf64bmip.sh
new file mode 100755
index 0000000..a4ce6d4
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/elf64bmip.sh
@@ -0,0 +1,23 @@
+. ${srcdir}/emulparams/elf32bmipn32-defs.sh
+OUTPUT_FORMAT="elf64-bigmips"
+BIG_OUTPUT_FORMAT="elf64-bigmips"
+LITTLE_OUTPUT_FORMAT="elf64-littlemips"
+SHLIB_TEXT_START_ADDR=0x3ffffe0000
+
+# IRIX6 defines these symbols. 0x40 is the size of the ELF header.
+EXECUTABLE_SYMBOLS="
+ __dso_displacement = 0;
+ ${CREATE_SHLIB-${CREATE_PIE-__elf_header = ${TEXT_START_ADDR};}}
+ ${CREATE_SHLIB+__elf_header = ${SHLIB_TEXT_START_ADDR};}
+ ${CREATE_PIE+__elf_header = ${SHLIB_TEXT_START_ADDR};}
+ __program_header_table = __elf_header + 0x40;
+"
+
+# There are often dynamic relocations against the .rodata section.
+# Setting DT_TEXTREL in the .dynamic section does not convince the
+# IRIX6 linker to permit relocations against the text segment.
+# Following the IRIX linker, we simply put .rodata in the data
+# segment.
+WRITABLE_RODATA=
+
+EXTRA_EM_FILE=irix
diff --git a/contrib/binutils/ld/emulparams/elf64ppc.sh b/contrib/binutils/ld/emulparams/elf64ppc.sh
index add6c54..c190b18 100644
--- a/contrib/binutils/ld/emulparams/elf64ppc.sh
+++ b/contrib/binutils/ld/emulparams/elf64ppc.sh
@@ -2,29 +2,31 @@ TEMPLATE_NAME=elf32
EXTRA_EM_FILE=ppc64elf
ELFSIZE=64
GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf64-powerpc"
TEXT_START_ADDR=0x10000000
-#DATA_ADDR="ALIGN (0x10000000) + (. & (${MAXPAGESIZE} - 1))"
+#SEGMENT_SIZE=0x10000000
MAXPAGESIZE=0x10000
COMMONPAGESIZE=0x1000
ARCH=powerpc:common64
MACHINE=
NOP=0x60000000
-EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);'
-OTHER_BSS_END_SYMBOLS='__end = .;'
-CTOR_START='PROVIDE (__CTOR_LIST__ = .); PROVIDE (___CTOR_LIST__ = .);'
-CTOR_END='PROVIDE (__CTOR_END__ = .); PROVIDE (___CTOR_END__ = .);'
-DTOR_START='PROVIDE (__DTOR_LIST__ = .); PROVIDE (___DTOR_LIST__ = .);'
-DTOR_END='PROVIDE (__DTOR_END__ = .); PROVIDE (___DTOR_END__ = .);'
OTHER_TEXT_SECTIONS="*(.sfpr .glink)"
BSS_PLT=
OTHER_BSS_SYMBOLS="
.tocbss ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.tocbss)}"
OTHER_PLT_RELOC_SECTIONS="
.rela.tocbss ${RELOCATING-0} : { *(.rela.tocbss) }"
-OTHER_GOT_SECTIONS="
- .toc ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.toc) }"
+
+if test x${RELOCATING+set} = xset; then
+ GOT="
+ .got ALIGN(8) : { *(.got .toc) }"
+else
+ GOT="
+ .got 0 : { *(.got) }
+ .toc 0 : { *(.toc) }"
+fi
OTHER_GOT_RELOC_SECTIONS="
.rela.toc ${RELOCATING-0} : { *(.rela.toc) }"
OTHER_READWRITE_SECTIONS="
@@ -34,18 +36,14 @@ OTHER_READWRITE_SECTIONS="
# Treat a host that matches the target with the possible exception of "64"
# in the name as if it were native.
if test `echo "$host" | sed -e s/64//` = `echo "$target" | sed -e s/64//`; then
- case " $EMULATION_LIBPATH " in
- *" ${EMULATION_NAME} "*)
- LIB_PATH=${libdir}
- for lib in ${NATIVE_LIB_DIRS}; do
- case :${LIB_PATH}: in
- *:${lib}:*) ;;
- *) LIB_PATH=${LIB_PATH}:${lib} ;;
- esac
- done
- # Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first.
- case "$EMULATION_NAME" in
- *64*) LIB_PATH=`echo ${LIB_PATH}: | sed -e s,:,64:,g`$LIB_PATH
- esac
- esac
+ case " $EMULATION_LIBPATH " in
+ *" ${EMULATION_NAME} "*)
+ NATIVE=yes
+ ;;
+ esac
fi
+
+# Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first.
+case "$EMULATION_NAME" in
+ *64*) LIBPATH_SUFFIX=64 ;;
+esac
diff --git a/contrib/binutils/ld/emulparams/elf_i386.sh b/contrib/binutils/ld/emulparams/elf_i386.sh
index f1b8522..2382286 100644
--- a/contrib/binutils/ld/emulparams/elf_i386.sh
+++ b/contrib/binutils/ld/emulparams/elf_i386.sh
@@ -9,4 +9,5 @@ MACHINE=
NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
NO_SMALL_DATA=yes
diff --git a/contrib/binutils/ld/emulparams/elf_s390.sh b/contrib/binutils/ld/emulparams/elf_s390.sh
index 2804ace..e710673 100644
--- a/contrib/binutils/ld/emulparams/elf_s390.sh
+++ b/contrib/binutils/ld/emulparams/elf_s390.sh
@@ -8,3 +8,5 @@ MACHINE=
NOP=0x07070707
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+NO_SMALL_DATA=yes
diff --git a/contrib/binutils/ld/emulparams/elf_x86_64.sh b/contrib/binutils/ld/emulparams/elf_x86_64.sh
index a428bfc..6d37058 100644
--- a/contrib/binutils/ld/emulparams/elf_x86_64.sh
+++ b/contrib/binutils/ld/emulparams/elf_x86_64.sh
@@ -10,32 +10,22 @@ MACHINE=
NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
NO_SMALL_DATA=yes
if [ "x${host}" = "x${target}" ]; then
case " $EMULATION_LIBPATH " in
*" ${EMULATION_NAME} "*)
- LIB_PATH=${libdir}
- for lib in ${NATIVE_LIB_DIRS}; do
- case :${LIB_PATH}: in
- *:${lib}:*) ;;
- *) LIB_PATH=${LIB_PATH}:${lib} ;;
- esac
- done
-
- # Linux modify the default library search path to first include
- # a 64-bit specific directory.
- case "$target" in
- x86_64*-linux*)
- suffix=64 ;;
- esac
-
- # Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first.
- if [ -n "$suffix" ]; then
- case "$EMULATION_NAME" in
- *64*)
- LIB_PATH=`echo ${LIB_PATH}: | sed -e s,:,$suffix:,g`$LIB_PATH ;;
- esac
- fi ;;
+ NATIVE=yes
esac
fi
+
+# Linux modify the default library search path to first include
+# a 64-bit specific directory.
+case "$target" in
+ x86_64*-linux*)
+ case "$EMULATION_NAME" in
+ *64*) LIBPATH_SUFFIX=64 ;;
+ esac
+ ;;
+esac
diff --git a/contrib/binutils/ld/emulparams/sh.sh b/contrib/binutils/ld/emulparams/sh.sh
new file mode 100644
index 0000000..52d1443
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/sh.sh
@@ -0,0 +1,8 @@
+# If you change this file, please also look at files which source this one:
+# shl.sh
+
+SCRIPT_NAME=sh
+OUTPUT_FORMAT="coff-sh"
+TEXT_START_ADDR=0x8000
+TARGET_PAGE_SIZE=128
+ARCH=sh
diff --git a/contrib/binutils/ld/emulparams/shl.sh b/contrib/binutils/ld/emulparams/shl.sh
new file mode 100644
index 0000000..5fbb165
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/shl.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/sh.sh
+OUTPUT_FORMAT="coff-shl"
diff --git a/contrib/binutils/ld/emulparams/shlelf.sh b/contrib/binutils/ld/emulparams/shlelf.sh
new file mode 100755
index 0000000..e19678b
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/shlelf.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/shelf.sh
+OUTPUT_FORMAT="elf32-shl"
diff --git a/contrib/binutils/ld/emulparams/vanilla.sh b/contrib/binutils/ld/emulparams/vanilla.sh
index d8a3b72..eabb7cd 100644
--- a/contrib/binutils/ld/emulparams/vanilla.sh
+++ b/contrib/binutils/ld/emulparams/vanilla.sh
@@ -1,5 +1,5 @@
SCRIPT_NAME=vanilla
-TEXT_START_ADDR=??
-TARGET_PAGE_SIZE=??
+TEXT_START_ADDR=0
+TARGET_PAGE_SIZE=128
ARCH=unknown
TEMPLATE_NAME=vanilla
diff --git a/contrib/binutils/ld/emulparams/vsta.sh b/contrib/binutils/ld/emulparams/vsta.sh
new file mode 100644
index 0000000..cc6249b
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/vsta.sh
@@ -0,0 +1,8 @@
+SCRIPT_NAME=aout
+OUTPUT_FORMAT="a.out-i386"
+TEXT_START_ADDR=0x1020
+TARGET_PAGE_SIZE=0x1000
+SEGMENT_SIZE=0x400000
+NONPAGED_TEXT_START_ADDR=0x0
+ARCH=i386
+
diff --git a/contrib/binutils/ld/emultempl/alphaelf.em b/contrib/binutils/ld/emultempl/alphaelf.em
new file mode 100644
index 0000000..7e64323
--- /dev/null
+++ b/contrib/binutils/ld/emultempl/alphaelf.em
@@ -0,0 +1,80 @@
+# This shell script emits a C file. -*- C -*-
+# Copyright 2003 Free Software Foundation, Inc.
+#
+# This file is part of GLD, the Gnu Linker.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+# This file is sourced from elf32.em, and defines extra alpha
+# specific routines.
+#
+cat >>e${EMULATION_NAME}.c <<EOF
+
+#include "elf/internal.h"
+#include "elf/alpha.h"
+#include "elf-bfd.h"
+
+static int elf64alpha_32bit = 0;
+
+/* Set the start address as in the Tru64 ld. */
+#define ALPHA_TEXT_START_32BIT 0x12000000
+
+static void
+alpha_after_parse (void)
+{
+ if (elf64alpha_32bit && !link_info.shared && !link_info.relocatable)
+ lang_section_start (".interp",
+ exp_binop ('+',
+ exp_intop (ALPHA_TEXT_START_32BIT),
+ exp_nameop (SIZEOF_HEADERS, NULL)));
+}
+
+static void
+alpha_finish (void)
+{
+ if (elf64alpha_32bit)
+ elf_elfheader (output_bfd)->e_flags |= EF_ALPHA_32BIT;
+
+ gld${EMULATION_NAME}_finish ();
+}
+EOF
+
+# Define some shell vars to insert bits of code into the standard elf
+# parse_args and list_options functions.
+#
+PARSE_AND_LIST_PROLOGUE='
+#define OPTION_TASO 300
+'
+
+PARSE_AND_LIST_LONGOPTS='
+ {"taso", no_argument, NULL, OPTION_TASO},
+'
+
+PARSE_AND_LIST_OPTIONS='
+ fprintf (file, _(" -taso\t\t\tLoad executable in the lower 31-bit addressable\n"));
+ fprintf (file, _("\t\t\t virtual address range\n"));
+'
+
+PARSE_AND_LIST_ARGS_CASES='
+ case OPTION_TASO:
+ elf64alpha_32bit = 1;
+ break;
+'
+
+# Put these extra alpha routines in ld_${EMULATION_NAME}_emulation
+#
+LDEMUL_AFTER_PARSE=alpha_after_parse
+LDEMUL_FINISH=alpha_finish
diff --git a/contrib/binutils/ld/emultempl/armcoff.em b/contrib/binutils/ld/emultempl/armcoff.em
index 0b5e7bc..468c3b0 100644
--- a/contrib/binutils/ld/emultempl/armcoff.em
+++ b/contrib/binutils/ld/emultempl/armcoff.em
@@ -4,8 +4,8 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* emulate the original gld for the given ${EMULATION_NAME}
- Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
+ Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+ 2004 Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
This file is part of GLD, the Gnu Linker.
@@ -40,16 +40,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ldfile.h"
#include "ldemul.h"
-static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
-static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
-static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
-static int gld${EMULATION_NAME}_parse_args PARAMS((int, char **));
-static void gld${EMULATION_NAME}_list_options PARAMS ((FILE *));
-static void gld${EMULATION_NAME}_finish PARAMS ((void));
-static void gld${EMULATION_NAME}_after_open PARAMS ((void));
-
-/* If true, then interworking stubs which support calls to old, non-interworking
- aware ARM code should be generated. */
+/* If TRUE, then interworking stubs which support calls to old,
+ non-interworking aware ARM code should be generated. */
static int support_old_code = 0;
static char * thumb_entry_symbol = NULL;
@@ -57,49 +49,37 @@ static char * thumb_entry_symbol = NULL;
#define OPTION_SUPPORT_OLD_CODE 300
#define OPTION_THUMB_ENTRY 301
-static struct option longopts[] =
+static void
+gld${EMULATION_NAME}_add_options
+ (int ns ATTRIBUTE_UNUSED, char **shortopts ATTRIBUTE_UNUSED, int nl,
+ struct option **longopts, int nrl ATTRIBUTE_UNUSED,
+ struct option **really_longopts ATTRIBUTE_UNUSED)
{
- {"support-old-code", no_argument, NULL, OPTION_SUPPORT_OLD_CODE},
- {"thumb-entry", required_argument, NULL, OPTION_THUMB_ENTRY},
- {NULL, no_argument, NULL, 0}
-};
+ static const struct option xtra_long[] = {
+ {"support-old-code", no_argument, NULL, OPTION_SUPPORT_OLD_CODE},
+ {"thumb-entry", required_argument, NULL, OPTION_THUMB_ENTRY},
+ {NULL, no_argument, NULL, 0}
+ };
+
+ *longopts = xrealloc (*longopts,
+ nl * sizeof (struct option) + sizeof (xtra_long));
+ memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long));
+}
static void
-gld${EMULATION_NAME}_list_options (file)
- FILE * file;
+gld${EMULATION_NAME}_list_options (FILE *file)
{
fprintf (file, _(" --support-old-code Support interworking with old code\n"));
fprintf (file, _(" --thumb-entry=<sym> Set the entry point to be Thumb symbol <sym>\n"));
}
-static int
-gld${EMULATION_NAME}_parse_args (argc, argv)
- int argc;
- char ** argv;
+static bfd_boolean
+gld${EMULATION_NAME}_handle_option (int optc)
{
- int longind;
- int optc;
- int prevoptind = optind;
- int prevopterr = opterr;
- int wanterror;
- static int lastoptind = -1;
-
- if (lastoptind != optind)
- opterr = 0;
-
- wanterror = opterr;
- lastoptind = optind;
-
- optc = getopt_long_only (argc, argv, "-", longopts, & longind);
- opterr = prevopterr;
-
switch (optc)
{
default:
- if (wanterror)
- xexit (1);
- optind = prevoptind;
- return 0;
+ return FALSE;
case OPTION_SUPPORT_OLD_CODE:
support_old_code = 1;
@@ -109,15 +89,15 @@ gld${EMULATION_NAME}_parse_args (argc, argv)
thumb_entry_symbol = optarg;
break;
}
-
- return 1;
+
+ return TRUE;
}
static void
-gld${EMULATION_NAME}_before_parse ()
+gld${EMULATION_NAME}_before_parse (void)
{
#ifndef TARGET_ /* I.e., if not generic. */
- ldfile_set_output_arch ("`echo ${ARCH}`");
+ ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
#endif /* not TARGET_ */
}
@@ -125,7 +105,7 @@ gld${EMULATION_NAME}_before_parse ()
sections, but before any sizes or addresses have been set. */
static void
-gld${EMULATION_NAME}_before_allocation ()
+gld${EMULATION_NAME}_before_allocation (void)
{
/* we should be able to set the size of the interworking stub section */
@@ -148,7 +128,7 @@ gld${EMULATION_NAME}_before_allocation ()
}
static void
-gld${EMULATION_NAME}_after_open ()
+gld${EMULATION_NAME}_after_open (void)
{
if (strstr (bfd_get_target (output_bfd), "arm") == NULL)
{
@@ -159,7 +139,7 @@ gld${EMULATION_NAME}_after_open ()
einfo ("%F%X%P: error: cannot change output format whilst linking ARM binaries\n");
return;
}
-
+
{
LANG_FOR_EACH_INPUT_STATEMENT (is)
{
@@ -170,14 +150,15 @@ gld${EMULATION_NAME}_after_open ()
}
static void
-gld${EMULATION_NAME}_finish PARAMS((void))
+gld${EMULATION_NAME}_finish (void)
{
struct bfd_link_hash_entry * h;
if (thumb_entry_symbol == NULL)
return;
-
- h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, false, false, true);
+
+ h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol,
+ FALSE, FALSE, TRUE);
if (h != (struct bfd_link_hash_entry *) NULL
&& (h->type == bfd_link_hash_defined
@@ -186,21 +167,21 @@ gld${EMULATION_NAME}_finish PARAMS((void))
{
static char buffer[32];
bfd_vma val;
-
+
/* Special procesing is required for a Thumb entry symbol. The
bottom bit of its address must be set. */
val = (h->u.def.value
+ bfd_get_section_vma (output_bfd,
h->u.def.section->output_section)
+ h->u.def.section->output_offset);
-
+
val |= 1;
/* Now convert this value into a string and store it in entry_symbol
- where the lang_finish() function will pick it up. */
+ where the lang_finish() function will pick it up. */
buffer[0] = '0';
buffer[1] = 'x';
-
+
sprintf_vma (buffer + 2, val);
if (entry_symbol.name != NULL && entry_from_cmdline)
@@ -213,8 +194,7 @@ gld${EMULATION_NAME}_finish PARAMS((void))
}
static char *
-gld${EMULATION_NAME}_get_script (isfile)
- int *isfile;
+gld${EMULATION_NAME}_get_script (int *isfile)
EOF
if test -n "$COMPILE_IN"
@@ -225,33 +205,33 @@ then
sc="-f stringify.sed"
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 0;
- if (link_info.relocateable == true && config.build_constructors == true)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
-sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
-echo ' ; else return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
-echo '; }' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
+echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
+echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
+echo ' ; else return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
+echo '; }' >> e${EMULATION_NAME}.c
else
# Scripts read from the filesystem.
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 1;
- if (link_info.relocateable == true && config.build_constructors == true)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable == true)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
@@ -266,7 +246,7 @@ fi
cat >>e${EMULATION_NAME}.c <<EOF
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
{
gld${EMULATION_NAME}_before_parse,
syslib_default,
@@ -285,7 +265,9 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
NULL, /* open dynamic archive */
NULL, /* place orphan */
NULL, /* set symbols */
- gld${EMULATION_NAME}_parse_args,
+ NULL, /* parse_args */
+ gld${EMULATION_NAME}_add_options,
+ gld${EMULATION_NAME}_handle_option,
NULL, /* unrecognised file */
gld${EMULATION_NAME}_list_options,
NULL, /* recognized file */
diff --git a/contrib/binutils/ld/emultempl/armelf.em b/contrib/binutils/ld/emultempl/armelf.em
index 0e65c04..0c051ad 100644
--- a/contrib/binutils/ld/emultempl/armelf.em
+++ b/contrib/binutils/ld/emultempl/armelf.em
@@ -1,5 +1,5 @@
# This shell script emits a C file. -*- C -*-
-# Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2002
+# Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004
# Free Software Foundation, Inc.
#
# This file is part of GLD, the Gnu Linker.
@@ -28,21 +28,18 @@ static int no_pipeline_knowledge = 0;
static char *thumb_entry_symbol = NULL;
static bfd *bfd_for_interwork;
-
static void
-gld${EMULATION_NAME}_before_parse ()
+gld${EMULATION_NAME}_before_parse (void)
{
#ifndef TARGET_ /* I.e., if not generic. */
- ldfile_set_output_arch ("`echo ${ARCH}`");
+ ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
#endif /* not TARGET_ */
- config.dynamic_link = ${DYNAMIC_LINK-true};
- config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
+ config.dynamic_link = ${DYNAMIC_LINK-TRUE};
+ config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
}
-static void arm_elf_after_open PARAMS ((void));
-
static void
-arm_elf_after_open ()
+arm_elf_after_open (void)
{
if (strstr (bfd_get_target (output_bfd), "arm") == NULL)
{
@@ -65,15 +62,11 @@ arm_elf_after_open ()
gld${EMULATION_NAME}_after_open ();
}
-static void arm_elf_set_bfd_for_interworking
- PARAMS ((lang_statement_union_type *));
-
static void
-arm_elf_set_bfd_for_interworking (statement)
- lang_statement_union_type *statement;
+arm_elf_set_bfd_for_interworking (lang_statement_union_type *statement)
{
if (statement->header.type == lang_input_section_enum
- && statement->input_section.ifile->just_syms_flag == false)
+ && !statement->input_section.ifile->just_syms_flag)
{
asection *i = statement->input_section.section;
asection *output_section = i->output_section;
@@ -85,15 +78,13 @@ arm_elf_set_bfd_for_interworking (statement)
&& ! i->owner->output_has_begun)
{
bfd_for_interwork = i->owner;
- bfd_for_interwork->output_has_begun = true;
+ bfd_for_interwork->output_has_begun = TRUE;
}
}
}
-static void arm_elf_before_allocation PARAMS ((void));
-
static void
-arm_elf_before_allocation ()
+arm_elf_before_allocation (void)
{
bfd *tem;
@@ -105,14 +96,18 @@ arm_elf_before_allocation ()
/* The interworking bfd must be the last one in the link. */
bfd_for_interwork = NULL;
for (tem = link_info.input_bfds; tem != NULL; tem = tem->link_next)
- tem->output_has_begun = false;
+ tem->output_has_begun = FALSE;
lang_for_each_statement (arm_elf_set_bfd_for_interworking);
- ASSERT (bfd_for_interwork != NULL);
for (tem = link_info.input_bfds; tem != NULL; tem = tem->link_next)
- tem->output_has_begun = false;
-
- bfd_elf32_arm_get_bfd_for_interworking (bfd_for_interwork, &link_info);
+ tem->output_has_begun = FALSE;
+
+ /* If bfd_for_interwork is NULL, then there are no loadable sections
+ with real contents to be linked, so we are not going to have to
+ create any interworking stubs, so it is OK not to call
+ bfd_elf32_arm_get_bfd_for_interworking. */
+ if (bfd_for_interwork != NULL)
+ bfd_elf32_arm_get_bfd_for_interworking (bfd_for_interwork, &link_info);
}
/* We should be able to set the size of the interworking stub section. */
@@ -134,10 +129,8 @@ arm_elf_before_allocation ()
bfd_elf32_arm_allocate_interworking_sections (& link_info);
}
-static void arm_elf_finish PARAMS ((void));
-
static void
-arm_elf_finish ()
+arm_elf_finish (void)
{
struct bfd_link_hash_entry * h;
@@ -146,9 +139,9 @@ arm_elf_finish ()
if (thumb_entry_symbol == NULL)
return;
-
+
h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol,
- false, false, true);
+ FALSE, FALSE, TRUE);
if (h != (struct bfd_link_hash_entry *) NULL
&& (h->type == bfd_link_hash_defined
@@ -157,21 +150,21 @@ arm_elf_finish ()
{
static char buffer[32];
bfd_vma val;
-
+
/* Special procesing is required for a Thumb entry symbol. The
bottom bit of its address must be set. */
val = (h->u.def.value
+ bfd_get_section_vma (output_bfd,
h->u.def.section->output_section)
+ h->u.def.section->output_offset);
-
+
val |= 1;
/* Now convert this value into a string and store it in entry_symbol
- where the lang_finish() function will pick it up. */
+ where the lang_finish() function will pick it up. */
buffer[0] = '0';
buffer[1] = 'x';
-
+
sprintf_vma (buffer + 2, val);
if (entry_symbol.name != NULL && entry_from_cmdline)
@@ -193,12 +186,7 @@ PARSE_AND_LIST_PROLOGUE='
#define OPTION_THUMB_ENTRY 301
'
-# Note we add 'n' to the short option list in order to prevent
-# getopt_long_only from thinking that -n is a unique abbreviation
-# for --no-pipeline-knowledge. There is no case to handle 'n' here
-# however, so instead it will be passed back to parse_args() in
-# lexsup.c where it will be handled.
-PARSE_AND_LIST_SHORTOPTS=pn
+PARSE_AND_LIST_SHORTOPTS=p
PARSE_AND_LIST_LONGOPTS='
{ "no-pipeline-knowledge", no_argument, NULL, '\'p\''},
diff --git a/contrib/binutils/ld/emultempl/armelf_oabi.em b/contrib/binutils/ld/emultempl/armelf_oabi.em
index aae7ea9..d75c658 100644
--- a/contrib/binutils/ld/emultempl/armelf_oabi.em
+++ b/contrib/binutils/ld/emultempl/armelf_oabi.em
@@ -4,8 +4,8 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* emulate the original gld for the given ${EMULATION_NAME}
- Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+ Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+ 2004 Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
This file is part of GLD, the Gnu Linker.
@@ -47,16 +47,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ldfile.h"
#include "ldemul.h"
-static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
-static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
-static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
-static void gld${EMULATION_NAME}_after_open PARAMS ((void));
-
static void
-gld${EMULATION_NAME}_before_parse ()
+gld${EMULATION_NAME}_before_parse (void)
{
#ifndef TARGET_ /* I.e., if not generic. */
- ldfile_set_output_arch ("`echo ${ARCH}`");
+ ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
#endif /* not TARGET_ */
}
@@ -64,7 +59,7 @@ gld${EMULATION_NAME}_before_parse ()
sections, but before any sizes or addresses have been set. */
static void
-gld${EMULATION_NAME}_before_allocation ()
+gld${EMULATION_NAME}_before_allocation (void)
{
/* we should be able to set the size of the interworking stub section */
@@ -86,7 +81,7 @@ gld${EMULATION_NAME}_before_allocation ()
}
static void
-gld${EMULATION_NAME}_after_open ()
+gld${EMULATION_NAME}_after_open (void)
{
LANG_FOR_EACH_INPUT_STATEMENT (is)
@@ -98,8 +93,7 @@ gld${EMULATION_NAME}_after_open ()
}
static char *
-gld${EMULATION_NAME}_get_script (isfile)
- int *isfile;
+gld${EMULATION_NAME}_get_script (int *isfile)
EOF
if test -n "$COMPILE_IN"
@@ -110,33 +104,33 @@ then
sc="-f stringify.sed"
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 0;
- if (link_info.relocateable == true && config.build_constructors == true)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
-sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
-echo ' ; else return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
-echo '; }' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
+echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
+echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
+echo ' ; else return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
+echo '; }' >> e${EMULATION_NAME}.c
else
# Scripts read from the filesystem.
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 1;
- if (link_info.relocateable == true && config.build_constructors == true)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable == true)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
@@ -151,7 +145,7 @@ fi
cat >>e${EMULATION_NAME}.c <<EOF
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
{
gld${EMULATION_NAME}_before_parse,
syslib_default,
@@ -171,6 +165,8 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
NULL, /* place orphan */
NULL, /* set symbols */
NULL, /* parse args */
+ NULL, /* add_options */
+ NULL, /* handle_option */
NULL, /* unrecognized file */
NULL, /* list options */
NULL, /* recognized file */
diff --git a/contrib/binutils/ld/emultempl/elf32.em b/contrib/binutils/ld/emultempl/elf32.em
index 9bfed6e..92f502d 100644
--- a/contrib/binutils/ld/emultempl/elf32.em
+++ b/contrib/binutils/ld/emultempl/elf32.em
@@ -13,7 +13,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME}
Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002 Free Software Foundation, Inc.
+ 2002, 2003, 2004 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
ELF support by Ian Lance Taylor <ian@cygnus.com>
@@ -39,6 +39,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "libiberty.h"
#include "safe-ctype.h"
+#include "getopt.h"
#include "bfdlink.h"
@@ -52,38 +53,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <ldgram.h>
#include "elf/common.h"
-static void gld${EMULATION_NAME}_before_parse
- PARAMS ((void));
-static void gld${EMULATION_NAME}_vercheck
- PARAMS ((lang_input_statement_type *));
-static void gld${EMULATION_NAME}_stat_needed
- PARAMS ((lang_input_statement_type *));
-static boolean gld${EMULATION_NAME}_try_needed
- PARAMS ((const char *, int));
-static boolean gld${EMULATION_NAME}_search_needed
- PARAMS ((const char *, const char *, int));
-static void gld${EMULATION_NAME}_check_needed
- PARAMS ((lang_input_statement_type *));
-static void gld${EMULATION_NAME}_after_open
- PARAMS ((void));
-static void gld${EMULATION_NAME}_find_exp_assignment
- PARAMS ((etree_type *));
-static void gld${EMULATION_NAME}_find_statement_assignment
- PARAMS ((lang_statement_union_type *));
-static void gld${EMULATION_NAME}_before_allocation
- PARAMS ((void));
-static boolean gld${EMULATION_NAME}_open_dynamic_archive
- PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *));
-static lang_output_section_statement_type *output_rel_find
- PARAMS ((asection *));
-static asection *output_prev_sec_find
- PARAMS ((lang_output_section_statement_type *));
-static boolean gld${EMULATION_NAME}_place_orphan
- PARAMS ((lang_input_statement_type *, asection *));
-static void gld${EMULATION_NAME}_finish
- PARAMS ((void));
-static char *gld${EMULATION_NAME}_get_script
- PARAMS ((int *isfile));
+/* Declare functions used by various EXTRA_EM_FILEs. */
+static void gld${EMULATION_NAME}_before_parse (void);
+static void gld${EMULATION_NAME}_after_open (void);
+static void gld${EMULATION_NAME}_before_allocation (void);
+static bfd_boolean gld${EMULATION_NAME}_place_orphan
+ (lang_input_statement_type *file, asection *s);
+static void gld${EMULATION_NAME}_finish (void);
EOF
@@ -103,24 +79,38 @@ if test x"$LDEMUL_BEFORE_PARSE" != xgld"$EMULATION_NAME"_before_parse; then
cat >>e${EMULATION_NAME}.c <<EOF
static void
-gld${EMULATION_NAME}_before_parse ()
+gld${EMULATION_NAME}_before_parse (void)
{
- const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
- if (arch)
- {
- ldfile_output_architecture = arch->arch;
- ldfile_output_machine = arch->mach;
- ldfile_output_machine_name = arch->printable_name;
- }
- else
- ldfile_output_architecture = bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`;
- config.dynamic_link = ${DYNAMIC_LINK-true};
- config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
+ ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
+ config.dynamic_link = ${DYNAMIC_LINK-TRUE};
+ config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
}
EOF
fi
+if test x"$LDEMUL_RECOGNIZED_FILE" != xgld"${EMULATION_NAME}"_load_symbols; then
+cat >>e${EMULATION_NAME}.c <<EOF
+/* Handle as_needed DT_NEEDED. */
+
+static bfd_boolean
+gld${EMULATION_NAME}_load_symbols (lang_input_statement_type *entry)
+{
+ if (!entry->as_needed
+ || (bfd_get_file_flags (entry->the_bfd) & DYNAMIC) == 0)
+ return FALSE;
+
+ /* Tell the ELF linker that we don't want the output file to have a
+ DT_NEEDED entry for this file, unless it is used to resolve
+ references in a regular object. */
+ bfd_elf_set_dyn_lib_class (entry->the_bfd, DYN_AS_NEEDED);
+
+ /* Continue on with normal load_symbols processing. */
+ return FALSE;
+}
+EOF
+fi
+
cat >>e${EMULATION_NAME}.c <<EOF
/* These variables are required to pass information back and forth
@@ -128,9 +118,9 @@ cat >>e${EMULATION_NAME}.c <<EOF
static struct bfd_link_needed_list *global_needed;
static struct stat global_stat;
-static boolean global_found;
+static bfd_boolean global_found;
static struct bfd_link_needed_list *global_vercheck_needed;
-static boolean global_vercheck_failed;
+static bfd_boolean global_vercheck_failed;
/* On Linux, it's possible to have different versions of the same
@@ -151,8 +141,7 @@ static boolean global_vercheck_failed;
a conflicting version. */
static void
-gld${EMULATION_NAME}_vercheck (s)
- lang_input_statement_type *s;
+gld${EMULATION_NAME}_vercheck (lang_input_statement_type *s)
{
const char *soname;
struct bfd_link_needed_list *l;
@@ -189,11 +178,11 @@ gld${EMULATION_NAME}_vercheck (s)
if (strncmp (soname, l->name, suffix - l->name) == 0)
{
/* Here we know that S is a dynamic object FOO.SO.VER1, and
- the object we are considering needs a dynamic object
- FOO.SO.VER2, and VER1 and VER2 are different. This
- appears to be a version mismatch, so we tell the caller
- to try a different version of this library. */
- global_vercheck_failed = true;
+ the object we are considering needs a dynamic object
+ FOO.SO.VER2, and VER1 and VER2 are different. This
+ appears to be a version mismatch, so we tell the caller
+ to try a different version of this library. */
+ global_vercheck_failed = TRUE;
return;
}
}
@@ -204,8 +193,7 @@ gld${EMULATION_NAME}_vercheck (s)
the file. */
static void
-gld${EMULATION_NAME}_stat_needed (s)
- lang_input_statement_type *s;
+gld${EMULATION_NAME}_stat_needed (lang_input_statement_type *s)
{
struct stat st;
const char *suffix;
@@ -225,7 +213,7 @@ gld${EMULATION_NAME}_stat_needed (s)
if (st.st_dev == global_stat.st_dev
&& st.st_ino == global_stat.st_ino)
{
- global_found = true;
+ global_found = TRUE;
return;
}
@@ -259,33 +247,31 @@ gld${EMULATION_NAME}_stat_needed (s)
named by a DT_NEEDED entry. The FORCE parameter indicates whether
to skip the check for a conflicting version. */
-static boolean
-gld${EMULATION_NAME}_try_needed (name, force)
- const char *name;
- int force;
+static bfd_boolean
+gld${EMULATION_NAME}_try_needed (const char *name, int force)
{
bfd *abfd;
const char *soname;
abfd = bfd_openr (name, bfd_get_target (output_bfd));
if (abfd == NULL)
- return false;
+ return FALSE;
if (! bfd_check_format (abfd, bfd_object))
{
bfd_close (abfd);
- return false;
+ return FALSE;
}
if ((bfd_get_file_flags (abfd) & DYNAMIC) == 0)
{
bfd_close (abfd);
- return false;
+ return FALSE;
}
/* For DT_NEEDED, they have to match. */
if (abfd->xvec != output_bfd->xvec)
{
bfd_close (abfd);
- return false;
+ return FALSE;
}
/* Check whether this object would include any conflicting library
@@ -303,22 +289,22 @@ gld${EMULATION_NAME}_try_needed (name, force)
if (needed != NULL)
{
global_vercheck_needed = needed;
- global_vercheck_failed = false;
+ global_vercheck_failed = FALSE;
lang_for_each_input_file (gld${EMULATION_NAME}_vercheck);
if (global_vercheck_failed)
{
bfd_close (abfd);
- /* Return false to force the caller to move on to try
- another file on the search path. */
- return false;
+ /* Return FALSE to force the caller to move on to try
+ another file on the search path. */
+ return FALSE;
}
/* But wait! It gets much worse. On Linux, if a shared
- library does not use libc at all, we are supposed to skip
- it the first time around in case we encounter a shared
- library later on with the same name which does use the
- version of libc that we want. This is much too horrible
- to use on any system other than Linux. */
+ library does not use libc at all, we are supposed to skip
+ it the first time around in case we encounter a shared
+ library later on with the same name which does use the
+ version of libc that we want. This is much too horrible
+ to use on any system other than Linux. */
EOF
case ${target} in
@@ -333,7 +319,7 @@ case ${target} in
if (l == NULL)
{
bfd_close (abfd);
- return false;
+ return FALSE;
}
}
@@ -363,39 +349,35 @@ cat >>e${EMULATION_NAME}.c <<EOF
if (trace_file_tries)
info_msg (_("found %s at %s\n"), soname, name);
- global_found = false;
+ global_found = FALSE;
lang_for_each_input_file (gld${EMULATION_NAME}_stat_needed);
if (global_found)
{
- /* Return true to indicate that we found the file, even though
- we aren't going to do anything with it. */
- return true;
+ /* Return TRUE to indicate that we found the file, even though
+ we aren't going to do anything with it. */
+ return TRUE;
}
- /* Tell the ELF backend that we don't want the output file to have a
- DT_NEEDED entry for this file. */
- bfd_elf_set_dt_needed_name (abfd, "");
+ /* Specify the soname to use. */
+ bfd_elf_set_dt_needed_name (abfd, soname);
- /* Tell the ELF backend that the output file needs a DT_NEEDED
- entry for this file if it is used to resolve the reference in
- a regular object. */
- bfd_elf_set_dt_needed_soname (abfd, soname);
+ /* Tell the ELF linker that we don't want the output file to have a
+ DT_NEEDED entry for this file, unless it is used to resolve
+ references in a regular object. */
+ bfd_elf_set_dyn_lib_class (abfd, DYN_DT_NEEDED);
/* Add this file into the symbol table. */
if (! bfd_link_add_symbols (abfd, &link_info))
einfo ("%F%B: could not read symbols: %E\n", abfd);
- return true;
+ return TRUE;
}
/* Search for a needed file in a path. */
-static boolean
-gld${EMULATION_NAME}_search_needed (path, name, force)
- const char *path;
- const char *name;
- int force;
+static bfd_boolean
+gld${EMULATION_NAME}_search_needed (const char *path, const char *name, int force)
{
const char *s;
size_t len;
@@ -404,7 +386,7 @@ gld${EMULATION_NAME}_search_needed (path, name, force)
return gld${EMULATION_NAME}_try_needed (name, force);
if (path == NULL || *path == '\0')
- return false;
+ return FALSE;
len = strlen (name);
while (1)
{
@@ -426,7 +408,7 @@ gld${EMULATION_NAME}_search_needed (path, name, force)
strcpy (sset, name);
if (gld${EMULATION_NAME}_try_needed (filename, force))
- return true;
+ return TRUE;
free (filename);
@@ -435,37 +417,72 @@ gld${EMULATION_NAME}_search_needed (path, name, force)
path = s + 1;
}
- return false;
+ return FALSE;
}
EOF
-if [ "x${host}" = "x${target}" ] ; then
- case " ${EMULATION_LIBPATH} " in
- *" ${EMULATION_NAME} "*)
- case ${target} in
- *-*-linux-gnu*)
- cat >>e${EMULATION_NAME}.c <<EOF
+if [ "x${USE_LIBPATH}" = xyes ] ; then
+ cat >>e${EMULATION_NAME}.c <<EOF
+/* Add the sysroot to every entry in a colon-separated path. */
+
+static char *
+gld${EMULATION_NAME}_add_sysroot (const char *path)
+{
+ int len, colons, i;
+ char *ret, *p;
+
+ len = strlen (path);
+ colons = 0;
+ i = 0;
+ while (path[i])
+ if (path[i++] == ':')
+ colons++;
+
+ if (path[i])
+ colons++;
+
+ len = len + (colons + 1) * strlen (ld_sysroot);
+ ret = xmalloc (len + 1);
+ strcpy (ret, ld_sysroot);
+ p = ret + strlen (ret);
+ i = 0;
+ while (path[i])
+ if (path[i] == ':')
+ {
+ *p++ = path[i++];
+ strcpy (p, ld_sysroot);
+ p = p + strlen (p);
+ }
+ else
+ *p++ = path[i++];
+
+ *p = 0;
+ return ret;
+}
+
+EOF
+ case ${target} in
+ *-*-linux-gnu*)
+ cat >>e${EMULATION_NAME}.c <<EOF
/* For a native linker, check the file /etc/ld.so.conf for directories
in which we may find shared libraries. /etc/ld.so.conf is really
only meaningful on Linux. */
-static boolean gld${EMULATION_NAME}_check_ld_so_conf
- PARAMS ((const char *, int));
-
-static boolean
-gld${EMULATION_NAME}_check_ld_so_conf (name, force)
- const char *name;
- int force;
+static bfd_boolean
+gld${EMULATION_NAME}_check_ld_so_conf (const char *name, int force)
{
- static boolean initialized;
+ static bfd_boolean initialized;
static char *ld_so_conf;
if (! initialized)
{
FILE *f;
+ char *tmppath;
- f = fopen ("/etc/ld.so.conf", FOPEN_RT);
+ tmppath = concat (ld_sysroot, "/etc/ld.so.conf", NULL);
+ f = fopen (tmppath, FOPEN_RT);
+ free (tmppath);
if (f != NULL)
{
char *b;
@@ -515,22 +532,28 @@ gld${EMULATION_NAME}_check_ld_so_conf (name, force)
fclose (f);
+ if (b)
+ {
+ char *d = gld${EMULATION_NAME}_add_sysroot (b);
+ free (b);
+ b = d;
+ }
+
ld_so_conf = b;
}
- initialized = true;
+ initialized = TRUE;
}
if (ld_so_conf == NULL)
- return false;
+ return FALSE;
return gld${EMULATION_NAME}_search_needed (ld_so_conf, name, force);
}
EOF
- # Linux
- ;;
- esac
+ # Linux
+ ;;
esac
fi
cat >>e${EMULATION_NAME}.c <<EOF
@@ -538,8 +561,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
/* See if an input file matches a DT_NEEDED entry by name. */
static void
-gld${EMULATION_NAME}_check_needed (s)
- lang_input_statement_type *s;
+gld${EMULATION_NAME}_check_needed (lang_input_statement_type *s)
{
if (global_found)
return;
@@ -550,7 +572,7 @@ gld${EMULATION_NAME}_check_needed (s)
if (strcmp (s->filename, global_needed->name) == 0)
{
- global_found = true;
+ global_found = TRUE;
return;
}
@@ -560,7 +582,7 @@ gld${EMULATION_NAME}_check_needed (s)
if (f != NULL
&& strcmp (f + 1, global_needed->name) == 0)
{
- global_found = true;
+ global_found = TRUE;
return;
}
}
@@ -574,7 +596,7 @@ gld${EMULATION_NAME}_check_needed (s)
if (soname != NULL
&& strcmp (soname, global_needed->name) == 0)
{
- global_found = true;
+ global_found = TRUE;
return;
}
}
@@ -588,12 +610,12 @@ cat >>e${EMULATION_NAME}.c <<EOF
/* This is called after all the input files have been opened. */
static void
-gld${EMULATION_NAME}_after_open ()
+gld${EMULATION_NAME}_after_open (void)
{
struct bfd_link_needed_list *needed, *l;
/* We only need to worry about this when doing a final link. */
- if (link_info.relocateable || link_info.shared)
+ if (link_info.relocatable || !link_info.executable)
return;
/* Get the list of files which appear in DT_NEEDED entries in
@@ -620,7 +642,7 @@ gld${EMULATION_NAME}_after_open ()
/* See if this file was included in the link explicitly. */
global_needed = l;
- global_found = false;
+ global_found = FALSE;
lang_for_each_input_file (gld${EMULATION_NAME}_check_needed);
if (global_found)
continue;
@@ -644,16 +666,12 @@ gld${EMULATION_NAME}_after_open ()
size_t len;
search_dirs_type *search;
EOF
-if [ "x${host}" = "x${target}" ] ; then
- case " ${EMULATION_LIBPATH} " in
- *" ${EMULATION_NAME} "*)
+if [ "x${USE_LIBPATH}" = xyes ] ; then
cat >>e${EMULATION_NAME}.c <<EOF
const char *lib_path;
struct bfd_link_needed_list *rp;
int found;
EOF
- ;;
- esac
fi
cat >>e${EMULATION_NAME}.c <<EOF
@@ -661,13 +679,15 @@ cat >>e${EMULATION_NAME}.c <<EOF
l->name, force))
break;
EOF
-if [ "x${host}" = "x${target}" ] ; then
- case " ${EMULATION_LIBPATH} " in
- *" ${EMULATION_NAME} "*)
+if [ "x${USE_LIBPATH}" = xyes ] ; then
cat >>e${EMULATION_NAME}.c <<EOF
if (gld${EMULATION_NAME}_search_needed (command_line.rpath,
l->name, force))
break;
+EOF
+fi
+if [ "x${NATIVE}" = xyes ] ; then
+cat >>e${EMULATION_NAME}.c <<EOF
if (command_line.rpath_link == NULL
&& command_line.rpath == NULL)
{
@@ -679,22 +699,25 @@ cat >>e${EMULATION_NAME}.c <<EOF
lib_path = (const char *) getenv ("LD_LIBRARY_PATH");
if (gld${EMULATION_NAME}_search_needed (lib_path, l->name, force))
break;
-
+EOF
+fi
+if [ "x${USE_LIBPATH}" = xyes ] ; then
+cat >>e${EMULATION_NAME}.c <<EOF
found = 0;
rp = bfd_elf_get_runpath_list (output_bfd, &link_info);
for (; !found && rp != NULL; rp = rp->next)
{
+ char *tmpname = gld${EMULATION_NAME}_add_sysroot (rp->name);
found = (rp->by == l->by
- && gld${EMULATION_NAME}_search_needed (rp->name,
+ && gld${EMULATION_NAME}_search_needed (tmpname,
l->name,
force));
+ free (tmpname);
}
if (found)
break;
EOF
- ;;
- esac
fi
cat >>e${EMULATION_NAME}.c <<EOF
len = strlen (l->name);
@@ -713,19 +736,15 @@ cat >>e${EMULATION_NAME}.c <<EOF
if (search != NULL)
break;
EOF
-if [ "x${host}" = "x${target}" ] ; then
- case " ${EMULATION_LIBPATH} " in
- *" ${EMULATION_NAME} "*)
- case ${target} in
- *-*-linux-gnu*)
- cat >>e${EMULATION_NAME}.c <<EOF
+if [ "x${USE_LIBPATH}" = xyes ] ; then
+ case ${target} in
+ *-*-linux-gnu*)
+ cat >>e${EMULATION_NAME}.c <<EOF
if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))
break;
EOF
- # Linux
- ;;
- esac
- ;;
+ # Linux
+ ;;
esac
fi
cat >>e${EMULATION_NAME}.c <<EOF
@@ -747,8 +766,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
/* Look through an expression for an assignment statement. */
static void
-gld${EMULATION_NAME}_find_exp_assignment (exp)
- etree_type *exp;
+gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
{
struct bfd_link_hash_entry *h;
@@ -756,7 +774,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp)
{
case etree_provide:
h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst,
- false, false, false);
+ FALSE, FALSE, FALSE);
if (h == NULL)
break;
@@ -772,9 +790,9 @@ gld${EMULATION_NAME}_find_exp_assignment (exp)
case etree_assign:
if (strcmp (exp->assign.dst, ".") != 0)
{
- if (! (bfd_elf${ELFSIZE}_record_link_assignment
+ if (! (bfd_elf_record_link_assignment
(output_bfd, &link_info, exp->assign.dst,
- exp->type.node_class == etree_provide ? true : false)))
+ exp->type.node_class == etree_provide ? TRUE : FALSE)))
einfo ("%P%F: failed to record assignment to %s: %E\n",
exp->assign.dst);
}
@@ -808,8 +826,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp)
symbols which are referred to by dynamic objects. */
static void
-gld${EMULATION_NAME}_find_statement_assignment (s)
- lang_statement_union_type *s;
+gld${EMULATION_NAME}_find_statement_assignment (lang_statement_union_type *s)
{
if (s->header.type == lang_assignment_statement_enum)
gld${EMULATION_NAME}_find_exp_assignment (s->assignment_statement.exp);
@@ -836,11 +853,14 @@ cat >>e${EMULATION_NAME}.c <<EOF
sections, but before any sizes or addresses have been set. */
static void
-gld${EMULATION_NAME}_before_allocation ()
+gld${EMULATION_NAME}_before_allocation (void)
{
const char *rpath;
asection *sinterp;
+ if (link_info.hash->type == bfd_link_elf_hash_table)
+ _bfd_elf_tls_setup (output_bfd, &link_info);
+
/* If we are going to make any variable assignments, we need to let
the ELF backend know about them in case the variables are
referred to by dynamic objects. */
@@ -851,8 +871,8 @@ gld${EMULATION_NAME}_before_allocation ()
rpath = command_line.rpath;
if (rpath == NULL)
rpath = (const char *) getenv ("LD_RUN_PATH");
- if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
- (output_bfd, command_line.soname, rpath,
+ if (! (bfd_elf_size_dynamic_sections
+ (output_bfd, command_line.soname, rpath,
command_line.filter_shlib,
(const char * const *) command_line.auxiliary_filters,
&link_info, &sinterp, lang_elf_version_info)))
@@ -876,8 +896,10 @@ ${ELF_INTERPRETER_SET_DEFAULT}
{
asection *s;
bfd_size_type sz;
+ bfd_size_type prefix_len;
char *msg;
- boolean ret;
+ bfd_boolean ret;
+ const char * gnu_warning_prefix = _("warning: ");
if (is->just_syms_flag)
continue;
@@ -887,11 +909,14 @@ ${ELF_INTERPRETER_SET_DEFAULT}
continue;
sz = bfd_section_size (is->the_bfd, s);
- msg = xmalloc ((size_t) sz + 1);
- if (! bfd_get_section_contents (is->the_bfd, s, msg, (file_ptr) 0, sz))
+ prefix_len = strlen (gnu_warning_prefix);
+ msg = xmalloc ((size_t) (prefix_len + sz + 1));
+ strcpy (msg, gnu_warning_prefix);
+ if (! bfd_get_section_contents (is->the_bfd, s, msg + prefix_len,
+ (file_ptr) 0, sz))
einfo ("%F%B: Can't read contents of section .gnu.warning: %E\n",
is->the_bfd);
- msg[sz] = '\0';
+ msg[prefix_len + sz] = '\0';
ret = link_info.callbacks->warning (&link_info, msg,
(const char *) NULL,
is->the_bfd, (asection *) NULL,
@@ -916,17 +941,15 @@ cat >>e${EMULATION_NAME}.c <<EOF
dynamic libraries have an extension of .so (or .sl on oddball systems
like hpux). */
-static boolean
-gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
- const char *arch;
- search_dirs_type *search;
- lang_input_statement_type *entry;
+static bfd_boolean
+gld${EMULATION_NAME}_open_dynamic_archive
+ (const char *arch, search_dirs_type *search, lang_input_statement_type *entry)
{
const char *filename;
char *string;
if (! entry->is_archive)
- return false;
+ return FALSE;
filename = entry->filename;
@@ -954,7 +977,7 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
if (! ldfile_try_open_bfd (string, entry))
{
free (string);
- return false;
+ return FALSE;
}
entry->filename = string;
@@ -984,7 +1007,7 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
bfd_elf_set_dt_needed_name (entry->the_bfd, filename);
}
- return true;
+ return TRUE;
}
EOF
@@ -996,12 +1019,12 @@ cat >>e${EMULATION_NAME}.c <<EOF
/* A variant of lang_output_section_find. Used by place_orphan. */
static lang_output_section_statement_type *
-output_rel_find (sec)
- asection *sec;
+output_rel_find (asection *sec, int isdyn)
{
lang_statement_union_type *u;
lang_output_section_statement_type *lookup;
lang_output_section_statement_type *last = NULL;
+ lang_output_section_statement_type *last_alloc = NULL;
lang_output_section_statement_type *last_rel = NULL;
lang_output_section_statement_type *last_rel_alloc = NULL;
int rela = sec->name[4] == 'a';
@@ -1011,22 +1034,30 @@ output_rel_find (sec)
lookup = &u->output_section_statement;
if (strncmp (".rel", lookup->name, 4) == 0)
{
- /* Don't place after .rel.plt as doing so results in wrong
- dynamic tags. Also, place allocated reloc sections before
- non-allocated. */
int lookrela = lookup->name[4] == 'a';
- if (strcmp (".plt", lookup->name + 4 + lookrela) == 0
- || (lookup->bfd_section != NULL
- && (lookup->bfd_section->flags & SEC_ALLOC) == 0))
+ /* .rel.dyn must come before all other reloc sections, to suit
+ GNU ld.so. */
+ if (isdyn)
+ break;
+
+ /* Don't place after .rel.plt as doing so results in wrong
+ dynamic tags. */
+ if (strcmp (".plt", lookup->name + 4 + lookrela) == 0)
break;
- last = lookup;
- if (rela == lookrela)
+
+ if (rela == lookrela || last_rel == NULL)
last_rel = lookup;
- if (lookup->bfd_section != NULL
+ if ((rela == lookrela || last_rel_alloc == NULL)
+ && lookup->bfd_section != NULL
&& (lookup->bfd_section->flags & SEC_ALLOC) != 0)
last_rel_alloc = lookup;
}
+
+ last = lookup;
+ if (lookup->bfd_section != NULL
+ && (lookup->bfd_section->flags & SEC_ALLOC) != 0)
+ last_alloc = lookup;
}
if (last_rel_alloc)
@@ -1035,6 +1066,9 @@ output_rel_find (sec)
if (last_rel)
return last_rel;
+ if (last_alloc)
+ return last_alloc;
+
return last;
}
@@ -1042,8 +1076,7 @@ output_rel_find (sec)
Used by place_orphan. */
static asection *
-output_prev_sec_find (os)
- lang_output_section_statement_type *os;
+output_prev_sec_find (lang_output_section_statement_type *os)
{
asection *s = (asection *) NULL;
lang_statement_union_type *u;
@@ -1071,12 +1104,11 @@ struct orphan_save {
lang_output_section_statement_type *os;
asection **section;
lang_statement_union_type **stmt;
+ lang_statement_union_type **os_tail;
};
-static boolean
-gld${EMULATION_NAME}_place_orphan (file, s)
- lang_input_statement_type *file;
- asection *s;
+static bfd_boolean
+gld${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s)
{
static struct orphan_save hold_text;
static struct orphan_save hold_rodata;
@@ -1093,10 +1125,12 @@ gld${EMULATION_NAME}_place_orphan (file, s)
const char *secname;
const char *ps = NULL;
lang_output_section_statement_type *os;
+ lang_statement_union_type **os_tail;
+ etree_type *load_base;
int isdyn = 0;
secname = bfd_get_section_name (s->owner, s);
- if (! link_info.relocateable
+ if (! link_info.relocatable
&& link_info.combreloc
&& (s->flags & SEC_ALLOC)
&& strncmp (secname, ".rel", 4) == 0)
@@ -1121,7 +1155,7 @@ gld${EMULATION_NAME}_place_orphan (file, s)
/* We already have an output section statement with this
name, and its bfd section, if any, has compatible flags. */
lang_add_section (&os->children, s, os, file);
- return true;
+ return TRUE;
}
}
@@ -1130,13 +1164,13 @@ gld${EMULATION_NAME}_place_orphan (file, s)
/* If this is a final link, then always put .gnu.warning.SYMBOL
sections into the .text section to get them out of the way. */
- if (! link_info.shared
- && ! link_info.relocateable
+ if (link_info.executable
+ && ! link_info.relocatable
&& strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0
&& hold_text.os != NULL)
{
lang_add_section (&hold_text.os->children, s, hold_text.os, file);
- return true;
+ return TRUE;
}
/* Decide which segment the section should go in based on the
@@ -1147,11 +1181,11 @@ gld${EMULATION_NAME}_place_orphan (file, s)
#define HAVE_SECTION(hold, name) \
(hold.os != NULL || (hold.os = lang_output_section_find (name)) != NULL)
- if ((s->flags & SEC_EXCLUDE) != 0 && !link_info.relocateable)
+ if ((s->flags & SEC_EXCLUDE) != 0 && !link_info.relocatable)
{
if (s->output_section == NULL)
s->output_section = bfd_abs_section_ptr;
- return true;
+ return TRUE;
}
place = NULL;
@@ -1173,7 +1207,7 @@ gld${EMULATION_NAME}_place_orphan (file, s)
else if (strncmp (secname, ".rel", 4) == 0
&& (s->flags & SEC_LOAD) != 0
&& (hold_rel.os != NULL
- || (hold_rel.os = output_rel_find (s)) != NULL))
+ || (hold_rel.os = output_rel_find (s, isdyn)) != NULL))
place = &hold_rel;
else if ((s->flags & (SEC_CODE | SEC_READONLY)) == SEC_READONLY
&& HAVE_SECTION (hold_rodata, ".rodata"))
@@ -1227,16 +1261,25 @@ gld${EMULATION_NAME}_place_orphan (file, s)
}
}
- if (link_info.relocateable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
+ address = NULL;
+ if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
address = exp_intop ((bfd_vma) 0);
- else
- address = NULL;
+ load_base = NULL;
+ if (place != NULL && place->os->load_base != NULL)
+ {
+ etree_type *lma_from_vma;
+ lma_from_vma = exp_binop ('-', place->os->load_base,
+ exp_nameop (ADDR, place->os->name));
+ load_base = exp_binop ('+', lma_from_vma,
+ exp_nameop (ADDR, secname));
+ }
+
+ os_tail = lang_output_section_statement.tail;
os = lang_enter_output_section_statement (secname, address, 0,
- (bfd_vma) 0,
(etree_type *) NULL,
(etree_type *) NULL,
- (etree_type *) NULL);
+ load_base);
lang_add_section (&os->children, s, os, file);
@@ -1311,11 +1354,15 @@ gld${EMULATION_NAME}_place_orphan (file, s)
read/write section before or amongst the read-only ones. */
if (add.head != NULL)
{
+ lang_statement_union_type *newly_added_os;
+
if (place->stmt == NULL)
{
/* Put the new statement list right at the head. */
*add.tail = place->os->header.next;
place->os->header.next = add.head;
+
+ place->os_tail = &place->os->next;
}
else
{
@@ -1331,10 +1378,25 @@ gld${EMULATION_NAME}_place_orphan (file, s)
/* Save the end of this list. */
place->stmt = add.tail;
+
+ /* Do the same for the list of output section statements. */
+ newly_added_os = *os_tail;
+ *os_tail = NULL;
+ newly_added_os->output_section_statement.next = *place->os_tail;
+ *place->os_tail = newly_added_os;
+ place->os_tail = &newly_added_os->output_section_statement.next;
+
+ /* Fixing the global list pointer here is a little different.
+ We added to the list in lang_enter_output_section_statement,
+ trimmed off the new output_section_statment above when
+ assigning *os_tail = NULL, but possibly added it back in
+ the same place when assigning *place->os_tail. */
+ if (*os_tail == NULL)
+ lang_output_section_statement.tail = os_tail;
}
}
- return true;
+ return TRUE;
}
EOF
fi
@@ -1343,15 +1405,15 @@ if test x"$LDEMUL_FINISH" != xgld"$EMULATION_NAME"_finish; then
cat >>e${EMULATION_NAME}.c <<EOF
static void
-gld${EMULATION_NAME}_finish ()
+gld${EMULATION_NAME}_finish (void)
{
- if (bfd_elf${ELFSIZE}_discard_info (output_bfd, &link_info))
+ if (bfd_elf_discard_info (output_bfd, &link_info))
{
lang_reset_memory_regions ();
/* Resize the sections. */
lang_size_sections (stat_ptr->head, abs_output_section,
- &stat_ptr->head, 0, (bfd_vma) 0, NULL);
+ &stat_ptr->head, 0, (bfd_vma) 0, NULL, TRUE);
/* Redo special stuff. */
ldemul_after_allocation ();
@@ -1368,8 +1430,7 @@ if test x"$LDEMUL_GET_SCRIPT" != xgld"$EMULATION_NAME"_get_script; then
cat >>e${EMULATION_NAME}.c <<EOF
static char *
-gld${EMULATION_NAME}_get_script (isfile)
- int *isfile;
+gld${EMULATION_NAME}_get_script (int *isfile)
EOF
if test -n "$COMPILE_IN"
@@ -1383,33 +1444,41 @@ cat >>e${EMULATION_NAME}.c <<EOF
{
*isfile = 0;
- if (link_info.relocateable == true && config.build_constructors == true)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
-sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
+echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
if cmp -s ldscripts/${EMULATION_NAME}.x ldscripts/${EMULATION_NAME}.xn; then : ; else
-echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
+echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
+fi
+if test -n "$GENERATE_PIE_SCRIPT" ; then
+if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
+echo ' ; else if (link_info.pie && link_info.combreloc) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xdc >> e${EMULATION_NAME}.c
+fi
+echo ' ; else if (link_info.pie) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xd >> e${EMULATION_NAME}.c
fi
if test -n "$GENERATE_SHLIB_SCRIPT" ; then
if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
echo ' ; else if (link_info.shared && link_info.combreloc) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xsc >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xsc >> e${EMULATION_NAME}.c
fi
-echo ' ; else if (link_info.shared) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xs >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.shared) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xs >> e${EMULATION_NAME}.c
fi
if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
-echo ' ; else if (link_info.combreloc) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xc >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.combreloc) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xc >> e${EMULATION_NAME}.c
fi
-echo ' ; else return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
-echo '; }' >> e${EMULATION_NAME}.c
+echo ' ; else return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
+echo '; }' >> e${EMULATION_NAME}.c
else
# Scripts read from the filesystem.
@@ -1418,16 +1487,51 @@ cat >>e${EMULATION_NAME}.c <<EOF
{
*isfile = 1;
- if (link_info.relocateable == true && config.build_constructors == true)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable == true)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
+EOF
+if cmp -s ldscripts/${EMULATION_NAME}.x ldscripts/${EMULATION_NAME}.xn; then :
+else
+cat >>e${EMULATION_NAME}.c <<EOF
else if (!config.magic_demand_paged)
return "ldscripts/${EMULATION_NAME}.xn";
+EOF
+fi
+if test -n "$GENERATE_PIE_SCRIPT" ; then
+if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
+cat >>e${EMULATION_NAME}.c <<EOF
+ else if (link_info.pie && link_info.combreloc)
+ return "ldscripts/${EMULATION_NAME}.xdc";
+EOF
+fi
+cat >>e${EMULATION_NAME}.c <<EOF
+ else if (link_info.pie)
+ return "ldscripts/${EMULATION_NAME}.xd";
+EOF
+fi
+if test -n "$GENERATE_SHLIB_SCRIPT" ; then
+if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
+cat >>e${EMULATION_NAME}.c <<EOF
+ else if (link_info.shared && link_info.combreloc)
+ return "ldscripts/${EMULATION_NAME}.xsc";
+EOF
+fi
+cat >>e${EMULATION_NAME}.c <<EOF
else if (link_info.shared)
return "ldscripts/${EMULATION_NAME}.xs";
+EOF
+fi
+if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
+cat >>e${EMULATION_NAME}.c <<EOF
+ else if (link_info.combreloc)
+ return "ldscripts/${EMULATION_NAME}.xc";
+EOF
+fi
+cat >>e${EMULATION_NAME}.c <<EOF
else
return "ldscripts/${EMULATION_NAME}.x";
}
@@ -1438,8 +1542,6 @@ fi
if test -n "$PARSE_AND_LIST_ARGS_CASES" -o x"$GENERATE_SHLIB_SCRIPT" = xyes; then
-if test x"$LDEMUL_PARSE_ARGS" != xgld"$EMULATION_NAME"_parse_args; then
-
if test -n "$PARSE_AND_LIST_PROLOGUE" ; then
cat >>e${EMULATION_NAME}.c <<EOF
$PARSE_AND_LIST_PROLOGUE
@@ -1448,94 +1550,75 @@ fi
cat >>e${EMULATION_NAME}.c <<EOF
-#include "getopt.h"
-
#define OPTION_DISABLE_NEW_DTAGS (400)
#define OPTION_ENABLE_NEW_DTAGS (OPTION_DISABLE_NEW_DTAGS + 1)
#define OPTION_GROUP (OPTION_ENABLE_NEW_DTAGS + 1)
#define OPTION_EH_FRAME_HDR (OPTION_GROUP + 1)
-static struct option longopts[] =
+static void
+gld${EMULATION_NAME}_add_options
+ (int ns, char **shortopts, int nl, struct option **longopts,
+ int nrl ATTRIBUTE_UNUSED, struct option **really_longopts ATTRIBUTE_UNUSED)
{
+ static const char xtra_short[] = "${PARSE_AND_LIST_SHORTOPTS}z:";
+ static const struct option xtra_long[] = {
EOF
if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
cat >>e${EMULATION_NAME}.c <<EOF
- /* getopt allows abbreviations, so we do this to stop it from
- treating -d/-e as abbreviations for these options. */
- {"disable-new-dtags", no_argument, NULL, OPTION_DISABLE_NEW_DTAGS},
- {"disable-new-dtags", no_argument, NULL, OPTION_DISABLE_NEW_DTAGS},
- {"enable-new-dtags", no_argument, NULL, OPTION_ENABLE_NEW_DTAGS},
- {"enable-new-dtags", no_argument, NULL, OPTION_ENABLE_NEW_DTAGS},
- {"eh-frame-hdr", no_argument, NULL, OPTION_EH_FRAME_HDR},
- {"Bgroup", no_argument, NULL, OPTION_GROUP},
- {"Bgroup", no_argument, NULL, OPTION_GROUP},
+ {"disable-new-dtags", no_argument, NULL, OPTION_DISABLE_NEW_DTAGS},
+ {"enable-new-dtags", no_argument, NULL, OPTION_ENABLE_NEW_DTAGS},
+ {"eh-frame-hdr", no_argument, NULL, OPTION_EH_FRAME_HDR},
+ {"Bgroup", no_argument, NULL, OPTION_GROUP},
EOF
fi
if test -n "$PARSE_AND_LIST_LONGOPTS" ; then
cat >>e${EMULATION_NAME}.c <<EOF
- $PARSE_AND_LIST_LONGOPTS
+ $PARSE_AND_LIST_LONGOPTS
EOF
fi
cat >>e${EMULATION_NAME}.c <<EOF
- {NULL, no_argument, NULL, 0}
-};
-
-
-static int gld${EMULATION_NAME}_parse_args PARAMS ((int, char **));
+ {NULL, no_argument, NULL, 0}
+ };
+
+ *shortopts = (char *) xrealloc (*shortopts, ns + sizeof (xtra_short));
+ memcpy (*shortopts + ns, &xtra_short, sizeof (xtra_short));
+ *longopts = (struct option *)
+ xrealloc (*longopts, nl * sizeof (struct option) + sizeof (xtra_long));
+ memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long));
+}
-static int
-gld${EMULATION_NAME}_parse_args (argc, argv)
- int argc;
- char ** argv;
+static bfd_boolean
+gld${EMULATION_NAME}_handle_option (int optc)
{
- int longind;
- int optc;
- static int prevoptind = -1;
- int prevopterr = opterr;
- int wanterror;
-
- if (prevoptind != optind)
- opterr = 0;
-
- wanterror = opterr;
- prevoptind = optind;
-
- optc = getopt_long_only (argc, argv,
- "-${PARSE_AND_LIST_SHORTOPTS}z:", longopts,
- &longind);
- opterr = prevopterr;
-
switch (optc)
{
default:
- if (wanterror)
- xexit (1);
- optind = prevoptind;
- return 0;
+ return FALSE;
EOF
if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
cat >>e${EMULATION_NAME}.c <<EOF
case OPTION_DISABLE_NEW_DTAGS:
- link_info.new_dtags = false;
+ link_info.new_dtags = FALSE;
break;
case OPTION_ENABLE_NEW_DTAGS:
- link_info.new_dtags = true;
+ link_info.new_dtags = TRUE;
break;
case OPTION_EH_FRAME_HDR:
- link_info.eh_frame_hdr = true;
+ link_info.eh_frame_hdr = TRUE;
break;
case OPTION_GROUP:
link_info.flags_1 |= (bfd_vma) DF_1_GROUP;
/* Groups must be self-contained. */
- link_info.no_undefined = true;
+ link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR;
+ link_info.unresolved_syms_in_shared_libs = RM_GENERATE_ERROR;
break;
case 'z':
@@ -1564,15 +1647,25 @@ cat >>e${EMULATION_NAME}.c <<EOF
link_info.flags_1 |= (bfd_vma) DF_1_ORIGIN;
}
else if (strcmp (optarg, "defs") == 0)
- link_info.no_undefined = true;
+ link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR;
else if (strcmp (optarg, "muldefs") == 0)
- link_info.allow_multiple_definition = true;
+ link_info.allow_multiple_definition = TRUE;
else if (strcmp (optarg, "combreloc") == 0)
- link_info.combreloc = true;
+ link_info.combreloc = TRUE;
else if (strcmp (optarg, "nocombreloc") == 0)
- link_info.combreloc = false;
+ link_info.combreloc = FALSE;
else if (strcmp (optarg, "nocopyreloc") == 0)
- link_info.nocopyreloc = true;
+ link_info.nocopyreloc = TRUE;
+ else if (strcmp (optarg, "execstack") == 0)
+ {
+ link_info.execstack = TRUE;
+ link_info.noexecstack = FALSE;
+ }
+ else if (strcmp (optarg, "noexecstack") == 0)
+ {
+ link_info.noexecstack = TRUE;
+ link_info.execstack = FALSE;
+ }
/* What about the other Solaris -z options? FIXME. */
break;
EOF
@@ -1587,20 +1680,16 @@ fi
cat >>e${EMULATION_NAME}.c <<EOF
}
- return 1;
+ return TRUE;
}
EOF
-fi
if test x"$LDEMUL_LIST_OPTIONS" != xgld"$EMULATION_NAME"_list_options; then
cat >>e${EMULATION_NAME}.c <<EOF
-static void gld${EMULATION_NAME}_list_options PARAMS ((FILE * file));
-
static void
-gld${EMULATION_NAME}_list_options (file)
- FILE * file;
+gld${EMULATION_NAME}_list_options (FILE * file)
{
EOF
@@ -1611,7 +1700,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
fprintf (file, _(" --enable-new-dtags\tEnable new dynamic tags\n"));
fprintf (file, _(" --eh-frame-hdr\tCreate .eh_frame_hdr section\n"));
fprintf (file, _(" -z combreloc\t\tMerge dynamic relocs into one section and sort\n"));
- fprintf (file, _(" -z defs\t\tDisallows undefined symbols\n"));
+ fprintf (file, _(" -z defs\t\tReport unresolved symbols in object files.\n"));
+ fprintf (file, _(" -z execstack\t\tMark executable as requiring executable stack\n"));
fprintf (file, _(" -z initfirst\t\tMark DSO to be initialized first at runtime\n"));
fprintf (file, _(" -z interpose\t\tMark object to interpose all DSOs but executable\n"));
fprintf (file, _(" -z loadfltr\t\tMark object requiring immediate process\n"));
@@ -1622,6 +1712,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
fprintf (file, _(" -z nodelete\t\tMark DSO non-deletable at runtime\n"));
fprintf (file, _(" -z nodlopen\t\tMark DSO not available to dlopen\n"));
fprintf (file, _(" -z nodump\t\tMark DSO not available to dldump\n"));
+ fprintf (file, _(" -z noexecstack\tMark executable as not requiring executable stack\n"));
fprintf (file, _(" -z now\t\tMark object non-lazy runtime binding\n"));
fprintf (file, _(" -z origin\t\tMark object requiring immediate \$ORIGIN processing\n\t\t\t at runtime\n"));
fprintf (file, _(" -z KEYWORD\t\tIgnored for Solaris compatibility\n"));
@@ -1645,11 +1736,10 @@ EOF
fi
fi
else
-if test x"$LDEMUL_PARSE_ARGS" != xgld"$EMULATION_NAME"_parse_args; then
cat >>e${EMULATION_NAME}.c <<EOF
-#define gld${EMULATION_NAME}_parse_args NULL
+#define gld${EMULATION_NAME}_add_options NULL
+#define gld${EMULATION_NAME}_handle_option NULL
EOF
-fi
if test x"$LDEMUL_LIST_OPTIONS" != xgld"$EMULATION_NAME"_list_options; then
cat >>e${EMULATION_NAME}.c <<EOF
#define gld${EMULATION_NAME}_list_options NULL
@@ -1678,10 +1768,12 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
${LDEMUL_OPEN_DYNAMIC_ARCHIVE-gld${EMULATION_NAME}_open_dynamic_archive},
${LDEMUL_PLACE_ORPHAN-gld${EMULATION_NAME}_place_orphan},
${LDEMUL_SET_SYMBOLS-NULL},
- ${LDEMUL_PARSE_ARGS-gld${EMULATION_NAME}_parse_args},
+ ${LDEMUL_PARSE_ARGS-NULL},
+ gld${EMULATION_NAME}_add_options,
+ gld${EMULATION_NAME}_handle_option,
${LDEMUL_UNRECOGNIZED_FILE-NULL},
${LDEMUL_LIST_OPTIONS-gld${EMULATION_NAME}_list_options},
- ${LDEMUL_RECOGNIZED_FILE-NULL},
+ ${LDEMUL_RECOGNIZED_FILE-gld${EMULATION_NAME}_load_symbols},
${LDEMUL_FIND_POTENTIAL_LIBRARIES-NULL},
${LDEMUL_NEW_VERS_PATTERN-NULL}
};
diff --git a/contrib/binutils/ld/emultempl/generic.em b/contrib/binutils/ld/emultempl/generic.em
index 397422c..4d17ca2 100644
--- a/contrib/binutils/ld/emultempl/generic.em
+++ b/contrib/binutils/ld/emultempl/generic.em
@@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* emulate the original gld for the given ${EMULATION_NAME}
- Copyright 1991, 1992, 1994, 1996, 2000, 2001
+ Copyright 1991, 1992, 1994, 1996, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
@@ -39,9 +39,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ldfile.h"
#include "ldemul.h"
-static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
-static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
-
EOF
# Import any needed special functions and/or overrides.
@@ -54,10 +51,10 @@ if test x"$LDEMUL_BEFORE_PARSE" != xgld"$EMULATION_NAME"_before_parse; then
cat >>e${EMULATION_NAME}.c <<EOF
static void
-gld${EMULATION_NAME}_before_parse()
+gld${EMULATION_NAME}_before_parse (void)
{
#ifndef TARGET_ /* I.e., if not generic. */
- ldfile_set_output_arch ("`echo ${ARCH}`");
+ ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
#endif /* not TARGET_ */
}
@@ -68,8 +65,7 @@ if test x"$LDEMUL_GET_SCRIPT" != xgld"$EMULATION_NAME"_get_script; then
cat >>e${EMULATION_NAME}.c <<EOF
static char *
-gld${EMULATION_NAME}_get_script(isfile)
- int *isfile;
+gld${EMULATION_NAME}_get_script (int *isfile)
EOF
if test -n "$COMPILE_IN"
@@ -80,33 +76,33 @@ then
sc="-f stringify.sed"
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 0;
- if (link_info.relocateable == true && config.build_constructors == true)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
-sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
-echo ' ; else return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
-echo '; }' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
+echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
+echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
+echo ' ; else return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
+echo '; }' >> e${EMULATION_NAME}.c
else
# Scripts read from the filesystem.
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 1;
- if (link_info.relocateable == true && config.build_constructors == true)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable == true)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
@@ -121,7 +117,7 @@ fi
cat >>e${EMULATION_NAME}.c <<EOF
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
{
${LDEMUL_BEFORE_PARSE-gld${EMULATION_NAME}_before_parse},
${LDEMUL_SYSLIB-syslib_default},
@@ -141,6 +137,8 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
${LDEMUL_PLACE_ORPHAN-NULL},
${LDEMUL_SET_SYMBOLS-NULL},
${LDEMUL_PARSE_ARGS-NULL},
+ NULL, /* add_options */
+ NULL, /* handle_option */
${LDEMUL_UNRECOGNIZED_FILE-NULL},
${LDEMUL_LIST_OPTIONS-NULL},
${LDEMUL_RECOGNIZED_FILE-NULL},
diff --git a/contrib/binutils/ld/emultempl/ia64elf.em b/contrib/binutils/ld/emultempl/ia64elf.em
new file mode 100644
index 0000000..eee467b
--- /dev/null
+++ b/contrib/binutils/ld/emultempl/ia64elf.em
@@ -0,0 +1,62 @@
+# This shell script emits a C file. -*- C -*-
+# Copyright 2003 Free Software Foundation, Inc.
+#
+# This file is part of GLD, the Gnu Linker.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+# This file is sourced from elf32.em, and defines extra ia64-elf
+# specific routines.
+#
+# Define some shell vars to insert bits of code into the standard elf
+# parse_args and list_options functions.
+#
+cat >>e${EMULATION_NAME}.c <<EOF
+
+/* None zero if generating binary for Intel Itanium processor. */
+static int itanium = 0;
+
+static void
+gld${EMULATION_NAME}_after_parse (void)
+{
+ link_info.need_relax_finalize = TRUE;
+ bfd_elf${ELFSIZE}_ia64_after_parse (itanium);
+}
+
+EOF
+
+PARSE_AND_LIST_PROLOGUE='
+#define OPTION_ITANIUM 300
+'
+
+PARSE_AND_LIST_LONGOPTS='
+ { "itanium", no_argument, NULL, OPTION_ITANIUM},
+'
+
+PARSE_AND_LIST_OPTIONS='
+ fprintf (file, _("\
+ --itanium Generate code for Intel Itanium processor\n"
+ ));
+'
+
+PARSE_AND_LIST_ARGS_CASES='
+ case OPTION_ITANIUM:
+ itanium = 1;
+ break;
+'
+
+LDEMUL_AFTER_PARSE=gld${EMULATION_NAME}_after_parse
+. ${srcdir}/emultempl/needrelax.em
diff --git a/contrib/binutils/ld/emultempl/linux.em b/contrib/binutils/ld/emultempl/linux.em
index fda490b..d041b68 100644
--- a/contrib/binutils/ld/emultempl/linux.em
+++ b/contrib/binutils/ld/emultempl/linux.em
@@ -1,6 +1,6 @@
# This shell script emits a C file. -*- C -*-
# It does some substitutions.
-if [ -z "$MACHINE" ]; then
+if [ -z "$MACHINE" ]; then
OUTPUT_ARCH=${ARCH}
else
OUTPUT_ARCH=${ARCH}:${MACHINE}
@@ -9,7 +9,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* Linux a.out emulation code for ${EMULATION_NAME}
- Copyright 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000
+ Copyright 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
Linux support by Eric Youngdale <ericy@cais.cais.com>
@@ -44,45 +44,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ldfile.h"
#include "ldemul.h"
-static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
-static boolean gld${EMULATION_NAME}_open_dynamic_archive
- PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *));
-static void gld${EMULATION_NAME}_find_address_statement
- PARAMS ((lang_statement_union_type *));
-static void gld${EMULATION_NAME}_create_output_section_statements
- PARAMS ((void));
-static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
-static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
-
static void
-gld${EMULATION_NAME}_before_parse()
+gld${EMULATION_NAME}_before_parse (void)
{
- const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
- if (arch)
- {
- ldfile_output_architecture = arch->arch;
- ldfile_output_machine = arch->mach;
- ldfile_output_machine_name = arch->printable_name;
- }
- else
- ldfile_output_architecture = bfd_arch_${ARCH};
- config.dynamic_link = true;
- config.has_shared = true;
+ ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
+ config.dynamic_link = TRUE;
+ config.has_shared = TRUE;
}
/* Try to open a dynamic archive. This is where we know that Linux
dynamic libraries have an extension of .sa. */
-static boolean
-gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
- const char *arch;
- search_dirs_type *search;
- lang_input_statement_type *entry;
+static bfd_boolean
+gld${EMULATION_NAME}_open_dynamic_archive
+ (const char *arch, search_dirs_type *search, lang_input_statement_type *entry)
{
char *string;
if (! entry->is_archive)
- return false;
+ return FALSE;
string = (char *) xmalloc (strlen (search->name)
+ strlen (entry->filename)
@@ -94,12 +74,12 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
if (! ldfile_try_open_bfd (string, entry))
{
free (string);
- return false;
+ return FALSE;
}
entry->filename = string;
- return true;
+ return TRUE;
}
/* This is called by the create_output_section_statements routine via
@@ -110,8 +90,7 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
Linux tools. */
static void
-gld${EMULATION_NAME}_find_address_statement (s)
- lang_statement_union_type *s;
+gld${EMULATION_NAME}_find_address_statement (lang_statement_union_type *s)
{
if (s->header.type == lang_address_statement_enum
&& strcmp (s->address_statement.section_name, ".text") == 0)
@@ -124,7 +103,7 @@ gld${EMULATION_NAME}_find_address_statement (s)
/* This is called before opening the input BFD's. */
static void
-gld${EMULATION_NAME}_create_output_section_statements ()
+gld${EMULATION_NAME}_create_output_section_statements (void)
{
lang_for_each_statement (gld${EMULATION_NAME}_find_address_statement);
}
@@ -133,9 +112,9 @@ gld${EMULATION_NAME}_create_output_section_statements ()
sections, but before any sizes or addresses have been set. */
static void
-gld${EMULATION_NAME}_before_allocation ()
+gld${EMULATION_NAME}_before_allocation (void)
{
- if (link_info.relocateable)
+ if (link_info.relocatable)
return;
/* Let the backend work out the sizes of any sections required by
@@ -145,8 +124,7 @@ gld${EMULATION_NAME}_before_allocation ()
}
static char *
-gld${EMULATION_NAME}_get_script(isfile)
- int *isfile;
+gld${EMULATION_NAME}_get_script (int *isfile)
EOF
if test -n "$COMPILE_IN"
@@ -157,33 +135,33 @@ then
sc="-f stringify.sed"
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 0;
- if (link_info.relocateable == true && config.build_constructors == true)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
-sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
-echo ' ; else return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
-echo '; }' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
+echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
+echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
+echo ' ; else return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
+echo '; }' >> e${EMULATION_NAME}.c
else
# Scripts read from the filesystem.
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 1;
- if (link_info.relocateable == true && config.build_constructors == true)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable == true)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
@@ -198,7 +176,7 @@ fi
cat >>e${EMULATION_NAME}.c <<EOF
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
{
gld${EMULATION_NAME}_before_parse,
syslib_default,
@@ -218,6 +196,8 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
NULL, /* place orphan */
NULL, /* set symbols */
NULL, /* parse args */
+ NULL, /* add_options */
+ NULL, /* handle_option */
NULL, /* unrecognized file */
NULL, /* list options */
NULL, /* recognized file */
diff --git a/contrib/binutils/ld/emultempl/needrelax.em b/contrib/binutils/ld/emultempl/needrelax.em
index 9bb96c2..65e622b 100644
--- a/contrib/binutils/ld/emultempl/needrelax.em
+++ b/contrib/binutils/ld/emultempl/needrelax.em
@@ -1,5 +1,5 @@
# This shell script emits a C file. -*- C -*-
-# Copyright (C) 2001 Free Software Foundation, Inc.
+# Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GLD, the Gnu Linker.
#
@@ -25,16 +25,14 @@ LDEMUL_BEFORE_ALLOCATION=need_relax_${EMULATION_NAME}_before_allocation
cat >>e${EMULATION_NAME}.c <<EOF
-static void need_relax_${EMULATION_NAME}_before_allocation PARAMS ((void));
-
static void
-need_relax_${EMULATION_NAME}_before_allocation ()
+need_relax_${EMULATION_NAME}_before_allocation (void)
{
/* Call main function; we're just extending it. */
gld${EMULATION_NAME}_before_allocation ();
/* Force -relax on if not doing a relocatable link. */
- if (! link_info.relocateable)
- command_line.relax = true;
+ if (! link_info.relocatable)
+ command_line.relax = TRUE;
}
EOF
diff --git a/contrib/binutils/ld/emultempl/netbsd.em b/contrib/binutils/ld/emultempl/netbsd.em
new file mode 100644
index 0000000..43715e4
--- /dev/null
+++ b/contrib/binutils/ld/emultempl/netbsd.em
@@ -0,0 +1,13 @@
+LDEMUL_BEFORE_PARSE=gldnetbsd_before_parse
+
+cat >>e${EMULATION_NAME}.c <<EOF
+static void
+gld${EMULATION_NAME}_before_parse (void);
+
+static void
+gldnetbsd_before_parse (void)
+{
+ gld${EMULATION_NAME}_before_parse ();
+ link_info.common_skip_ar_aymbols = bfd_link_common_skip_text;
+}
+EOF
diff --git a/contrib/binutils/ld/emultempl/pe.em b/contrib/binutils/ld/emultempl/pe.em
index 474b984..7d6c2e8 100644
--- a/contrib/binutils/ld/emultempl/pe.em
+++ b/contrib/binutils/ld/emultempl/pe.em
@@ -9,22 +9,22 @@ rm -f e${EMULATION_NAME}.c
(echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
cat >>e${EMULATION_NAME}.c <<EOF
/* This file is part of GLD, the Gnu Linker.
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* For WINDOWS_NT */
/* The original file generated returned different default scripts depending
@@ -68,8 +68,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "deffile.h"
#include "pe-dll.h"
-
-#include <ctype.h>
+#include "safe-ctype.h"
/* Permit the emulation parameters to override the default section
alignment by setting OVERRIDE_SECTION_ALIGNMENT. FIXME: This makes
@@ -104,42 +103,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define PE_DEF_FILE_ALIGNMENT 0x00000200
#endif
-static void gld_${EMULATION_NAME}_set_symbols PARAMS ((void));
-static void gld_${EMULATION_NAME}_after_open PARAMS ((void));
-static void gld_${EMULATION_NAME}_before_parse PARAMS ((void));
-static void gld_${EMULATION_NAME}_after_parse PARAMS ((void));
-static void gld_${EMULATION_NAME}_before_allocation PARAMS ((void));
-static asection *output_prev_sec_find
- PARAMS ((lang_output_section_statement_type *));
-static boolean gld_${EMULATION_NAME}_place_orphan
- PARAMS ((lang_input_statement_type *, asection *));
-static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *));
-static int gld_${EMULATION_NAME}_parse_args PARAMS ((int, char **));
-static void gld_${EMULATION_NAME}_finish PARAMS ((void));
-static boolean gld_${EMULATION_NAME}_open_dynamic_archive
- PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *));
-static void gld_${EMULATION_NAME}_list_options PARAMS ((FILE *));
-static void set_pe_name PARAMS ((char *, long));
-static void set_pe_subsystem PARAMS ((void));
-static void set_pe_value PARAMS ((char *));
-static void set_pe_stack_heap PARAMS ((char *, char *));
-
-#ifdef DLL_SUPPORT
-static boolean pe_undef_cdecl_match
- PARAMS ((struct bfd_link_hash_entry *, PTR));
-static void pe_fixup_stdcalls PARAMS ((void));
-static int make_import_fixup PARAMS ((arelent *, asection *));
-static void pe_find_data_imports PARAMS ((void));
-#endif
-
-static boolean pr_sym PARAMS ((struct bfd_hash_entry *, PTR string));
-static boolean gld_${EMULATION_NAME}_unrecognized_file
- PARAMS ((lang_input_statement_type *));
-static boolean gld_${EMULATION_NAME}_recognized_file
- PARAMS ((lang_input_statement_type *));
-static int gld_${EMULATION_NAME}_find_potential_libraries
- PARAMS ((char *, lang_input_statement_type *));
-
static struct internal_extra_pe_aouthdr pe;
static int dll;
@@ -148,7 +111,7 @@ static char * thumb_entry_symbol = NULL;
static lang_assignment_statement_type *image_base_statement = 0;
#ifdef DLL_SUPPORT
-static int pe_enable_stdcall_fixup = -1; /* 0=disable 1=enable */
+static int pe_enable_stdcall_fixup = -1; /* 0=disable 1=enable. */
static char *pe_out_def_filename = NULL;
static char *pe_implib_filename = NULL;
static int pe_enable_auto_image_base = 0;
@@ -158,28 +121,21 @@ static char *pe_dll_search_prefix = NULL;
extern const char *output_filename;
static void
-gld_${EMULATION_NAME}_before_parse()
+gld_${EMULATION_NAME}_before_parse (void)
{
- const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
- if (arch)
- {
- ldfile_output_architecture = arch->arch;
- ldfile_output_machine = arch->mach;
- ldfile_output_machine_name = arch->printable_name;
- }
- else
- ldfile_output_architecture = bfd_arch_${ARCH};
+ ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
output_filename = "${EXECUTABLE_NAME:-a.exe}";
#ifdef DLL_SUPPORT
- config.dynamic_link = true;
+ config.dynamic_link = TRUE;
config.has_shared = 1;
link_info.pei386_auto_import = -1;
+ link_info.pei386_runtime_pseudo_reloc = FALSE;
#if (PE_DEF_SUBSYSTEM == 9) || (PE_DEF_SUBSYSTEM == 2)
#if defined TARGET_IS_mipspe || defined TARGET_IS_armpe
- lang_add_entry ("WinMainCRTStartup", 1);
+ lang_add_entry ("WinMainCRTStartup", FALSE);
#else
- lang_add_entry ("_WinMainCRTStartup", 1);
+ lang_add_entry ("_WinMainCRTStartup", FALSE);
#endif
#endif
#endif
@@ -187,7 +143,7 @@ gld_${EMULATION_NAME}_before_parse()
/* PE format extra command line options. */
-/* Used for setting flags in the PE header. */
+/* Used for setting flags in the PE header. */
#define OPTION_BASE_FILE (300 + 1)
#define OPTION_DLL (OPTION_BASE_FILE + 1)
#define OPTION_FILE_ALIGNMENT (OPTION_DLL + 1)
@@ -199,8 +155,8 @@ gld_${EMULATION_NAME}_before_parse()
#define OPTION_MINOR_OS_VERSION (OPTION_MINOR_IMAGE_VERSION + 1)
#define OPTION_MINOR_SUBSYSTEM_VERSION (OPTION_MINOR_OS_VERSION + 1)
#define OPTION_SECTION_ALIGNMENT (OPTION_MINOR_SUBSYSTEM_VERSION + 1)
-#define OPTION_STACK (OPTION_SECTION_ALIGNMENT + 1)
-#define OPTION_SUBSYSTEM (OPTION_STACK + 1)
+#define OPTION_STACK (OPTION_SECTION_ALIGNMENT + 1)
+#define OPTION_SUBSYSTEM (OPTION_STACK + 1)
#define OPTION_HEAP (OPTION_SUBSYSTEM + 1)
#define OPTION_SUPPORT_OLD_CODE (OPTION_HEAP + 1)
#define OPTION_OUT_DEF (OPTION_SUPPORT_OLD_CODE + 1)
@@ -222,54 +178,73 @@ gld_${EMULATION_NAME}_before_parse()
#define OPTION_DLL_DISABLE_AUTO_IMPORT (OPTION_DLL_ENABLE_AUTO_IMPORT + 1)
#define OPTION_ENABLE_EXTRA_PE_DEBUG (OPTION_DLL_DISABLE_AUTO_IMPORT + 1)
#define OPTION_EXCLUDE_LIBS (OPTION_ENABLE_EXTRA_PE_DEBUG + 1)
+#define OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC \
+ (OPTION_EXCLUDE_LIBS + 1)
+#define OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC \
+ (OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC + 1)
-static struct option longopts[] = {
- /* PE options */
- {"base-file", required_argument, NULL, OPTION_BASE_FILE},
- {"dll", no_argument, NULL, OPTION_DLL},
- {"file-alignment", required_argument, NULL, OPTION_FILE_ALIGNMENT},
- {"heap", required_argument, NULL, OPTION_HEAP},
- {"image-base", required_argument, NULL, OPTION_IMAGE_BASE},
- {"major-image-version", required_argument, NULL, OPTION_MAJOR_IMAGE_VERSION},
- {"major-os-version", required_argument, NULL, OPTION_MAJOR_OS_VERSION},
- {"major-subsystem-version", required_argument, NULL, OPTION_MAJOR_SUBSYSTEM_VERSION},
- {"minor-image-version", required_argument, NULL, OPTION_MINOR_IMAGE_VERSION},
- {"minor-os-version", required_argument, NULL, OPTION_MINOR_OS_VERSION},
- {"minor-subsystem-version", required_argument, NULL, OPTION_MINOR_SUBSYSTEM_VERSION},
- {"section-alignment", required_argument, NULL, OPTION_SECTION_ALIGNMENT},
- {"stack", required_argument, NULL, OPTION_STACK},
- {"subsystem", required_argument, NULL, OPTION_SUBSYSTEM},
- {"support-old-code", no_argument, NULL, OPTION_SUPPORT_OLD_CODE},
- {"thumb-entry", required_argument, NULL, OPTION_THUMB_ENTRY},
+static void
+gld${EMULATION_NAME}_add_options
+ (int ns ATTRIBUTE_UNUSED, char **shortopts ATTRIBUTE_UNUSED, int nl,
+ struct option **longopts, int nrl ATTRIBUTE_UNUSED,
+ struct option **really_longopts ATTRIBUTE_UNUSED)
+{
+ static const struct option xtra_long[] = {
+ /* PE options */
+ {"base-file", required_argument, NULL, OPTION_BASE_FILE},
+ {"dll", no_argument, NULL, OPTION_DLL},
+ {"file-alignment", required_argument, NULL, OPTION_FILE_ALIGNMENT},
+ {"heap", required_argument, NULL, OPTION_HEAP},
+ {"image-base", required_argument, NULL, OPTION_IMAGE_BASE},
+ {"major-image-version", required_argument, NULL, OPTION_MAJOR_IMAGE_VERSION},
+ {"major-os-version", required_argument, NULL, OPTION_MAJOR_OS_VERSION},
+ {"major-subsystem-version", required_argument, NULL, OPTION_MAJOR_SUBSYSTEM_VERSION},
+ {"minor-image-version", required_argument, NULL, OPTION_MINOR_IMAGE_VERSION},
+ {"minor-os-version", required_argument, NULL, OPTION_MINOR_OS_VERSION},
+ {"minor-subsystem-version", required_argument, NULL, OPTION_MINOR_SUBSYSTEM_VERSION},
+ {"section-alignment", required_argument, NULL, OPTION_SECTION_ALIGNMENT},
+ {"stack", required_argument, NULL, OPTION_STACK},
+ {"subsystem", required_argument, NULL, OPTION_SUBSYSTEM},
+ {"support-old-code", no_argument, NULL, OPTION_SUPPORT_OLD_CODE},
+ {"thumb-entry", required_argument, NULL, OPTION_THUMB_ENTRY},
#ifdef DLL_SUPPORT
- /* getopt allows abbreviations, so we do this to stop it from treating -o
- as an abbreviation for this option */
- {"output-def", required_argument, NULL, OPTION_OUT_DEF},
- {"output-def", required_argument, NULL, OPTION_OUT_DEF},
- {"export-all-symbols", no_argument, NULL, OPTION_EXPORT_ALL},
- {"exclude-symbols", required_argument, NULL, OPTION_EXCLUDE_SYMBOLS},
- {"exclude-libs", required_argument, NULL, OPTION_EXCLUDE_LIBS},
- {"kill-at", no_argument, NULL, OPTION_KILL_ATS},
- {"add-stdcall-alias", no_argument, NULL, OPTION_STDCALL_ALIASES},
- {"enable-stdcall-fixup", no_argument, NULL, OPTION_ENABLE_STDCALL_FIXUP},
- {"disable-stdcall-fixup", no_argument, NULL, OPTION_DISABLE_STDCALL_FIXUP},
- {"out-implib", required_argument, NULL, OPTION_IMPLIB_FILENAME},
- {"warn-duplicate-exports", no_argument, NULL, OPTION_WARN_DUPLICATE_EXPORTS},
- {"compat-implib", no_argument, NULL, OPTION_IMP_COMPAT},
- {"enable-auto-image-base", no_argument, NULL, OPTION_ENABLE_AUTO_IMAGE_BASE},
- {"disable-auto-image-base", no_argument, NULL, OPTION_DISABLE_AUTO_IMAGE_BASE},
- {"dll-search-prefix", required_argument, NULL, OPTION_DLL_SEARCH_PREFIX},
- {"no-default-excludes", no_argument, NULL, OPTION_NO_DEFAULT_EXCLUDES},
- {"enable-auto-import", no_argument, NULL, OPTION_DLL_ENABLE_AUTO_IMPORT},
- {"disable-auto-import", no_argument, NULL, OPTION_DLL_DISABLE_AUTO_IMPORT},
- {"enable-extra-pe-debug", no_argument, NULL, OPTION_ENABLE_EXTRA_PE_DEBUG},
+ /* getopt allows abbreviations, so we do this to stop it from treating -o
+ as an abbreviation for this option */
+ {"output-def", required_argument, NULL, OPTION_OUT_DEF},
+ {"output-def", required_argument, NULL, OPTION_OUT_DEF},
+ {"export-all-symbols", no_argument, NULL, OPTION_EXPORT_ALL},
+ {"exclude-symbols", required_argument, NULL, OPTION_EXCLUDE_SYMBOLS},
+ {"exclude-libs", required_argument, NULL, OPTION_EXCLUDE_LIBS},
+ {"kill-at", no_argument, NULL, OPTION_KILL_ATS},
+ {"add-stdcall-alias", no_argument, NULL, OPTION_STDCALL_ALIASES},
+ {"enable-stdcall-fixup", no_argument, NULL, OPTION_ENABLE_STDCALL_FIXUP},
+ {"disable-stdcall-fixup", no_argument, NULL, OPTION_DISABLE_STDCALL_FIXUP},
+ {"out-implib", required_argument, NULL, OPTION_IMPLIB_FILENAME},
+ {"warn-duplicate-exports", no_argument, NULL, OPTION_WARN_DUPLICATE_EXPORTS},
+ /* getopt() allows abbreviations, so we do this to stop it from
+ treating -c as an abbreviation for these --compat-implib. */
+ {"compat-implib", no_argument, NULL, OPTION_IMP_COMPAT},
+ {"compat-implib", no_argument, NULL, OPTION_IMP_COMPAT},
+ {"enable-auto-image-base", no_argument, NULL, OPTION_ENABLE_AUTO_IMAGE_BASE},
+ {"disable-auto-image-base", no_argument, NULL, OPTION_DISABLE_AUTO_IMAGE_BASE},
+ {"dll-search-prefix", required_argument, NULL, OPTION_DLL_SEARCH_PREFIX},
+ {"no-default-excludes", no_argument, NULL, OPTION_NO_DEFAULT_EXCLUDES},
+ {"enable-auto-import", no_argument, NULL, OPTION_DLL_ENABLE_AUTO_IMPORT},
+ {"disable-auto-import", no_argument, NULL, OPTION_DLL_DISABLE_AUTO_IMPORT},
+ {"enable-extra-pe-debug", no_argument, NULL, OPTION_ENABLE_EXTRA_PE_DEBUG},
+ {"enable-runtime-pseudo-reloc", no_argument, NULL, OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC},
+ {"disable-runtime-pseudo-reloc", no_argument, NULL, OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC},
#endif
- {NULL, no_argument, NULL, 0}
-};
+ {NULL, no_argument, NULL, 0}
+ };
+ *longopts = (struct option *)
+ xrealloc (*longopts, nl * sizeof (struct option) + sizeof (xtra_long));
+ memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long));
+}
/* PE/WIN32; added routines to get the subsystem type, heap and/or stack
- parameters which may be input from the command line */
+ parameters which may be input from the command line. */
typedef struct
{
@@ -310,9 +285,9 @@ static definfo init[] =
{ NULL, 0, 0, NULL, 0 }
};
+
static void
-gld_${EMULATION_NAME}_list_options (file)
- FILE * file;
+gld_${EMULATION_NAME}_list_options (FILE *file)
{
fprintf (file, _(" --base_file <basefile> Generate a base file for relocatable DLLs\n"));
fprintf (file, _(" --dll Set image base to the default for DLLs\n"));
@@ -335,7 +310,7 @@ gld_${EMULATION_NAME}_list_options (file)
fprintf (file, _(" --disable-stdcall-fixup Don't link _sym to _sym@nn\n"));
fprintf (file, _(" --enable-stdcall-fixup Link _sym to _sym@nn without warnings\n"));
fprintf (file, _(" --exclude-symbols sym,sym,... Exclude symbols from automatic export\n"));
- fprintf (file, _(" --exclude-libs lib,lib,... Exclude libraries from automatic export\n"));
+ fprintf (file, _(" --exclude-libs lib,lib,... Exclude libraries from automatic export\n"));
fprintf (file, _(" --export-all-symbols Automatically export all globals to DLL\n"));
fprintf (file, _(" --kill-at Remove @nn from exported symbols\n"));
fprintf (file, _(" --out-implib <file> Generate import library\n"));
@@ -346,24 +321,29 @@ gld_${EMULATION_NAME}_list_options (file)
fprintf (file, _(" --enable-auto-image-base Automatically choose image base for DLLs\n\
unless user specifies one\n"));
fprintf (file, _(" --disable-auto-image-base Do not auto-choose image base. (default)\n"));
- fprintf (file, _(" --dll-search-prefix=<string> When linking dynamically to a dll without an\n\
- importlib, use <string><basename>.dll \n\
+ fprintf (file, _(" --dll-search-prefix=<string> When linking dynamically to a dll without\n\
+ an importlib, use <string><basename>.dll\n\
in preference to lib<basename>.dll \n"));
- fprintf (file, _(" --enable-auto-import Do sophistcated linking of _sym to \n\
+ fprintf (file, _(" --enable-auto-import Do sophistcated linking of _sym to\n\
__imp_sym for DATA references\n"));
fprintf (file, _(" --disable-auto-import Do not auto-import DATA items from DLLs\n"));
+ fprintf (file, _(" --enable-runtime-pseudo-reloc Work around auto-import limitations by\n\
+ adding pseudo-relocations resolved at\n\
+ runtime.\n"));
+ fprintf (file, _(" --disable-runtime-pseudo-reloc Do not add runtime pseudo-relocations for\n\
+ auto-imported DATA.\n"));
fprintf (file, _(" --enable-extra-pe-debug Enable verbose debug output when building\n\
or linking to DLLs (esp. auto-import)\n"));
#endif
}
+
static void
-set_pe_name (name, val)
- char *name;
- long val;
+set_pe_name (char *name, long val)
{
int i;
- /* Find the name and set it. */
+
+ /* Find the name and set it. */
for (i = 0; init[i].ptr; i++)
{
if (strcmp (name, init[i].symbol) == 0)
@@ -373,12 +353,12 @@ set_pe_name (name, val)
return;
}
}
- abort();
+ abort ();
}
static void
-set_pe_subsystem ()
+set_pe_subsystem (void)
{
const char *sver;
int len;
@@ -451,7 +431,7 @@ set_pe_subsystem ()
entry = alc_entry;
}
- lang_add_entry (entry, 0);
+ lang_add_entry (entry, TRUE);
return;
}
@@ -461,11 +441,8 @@ set_pe_subsystem ()
}
-
static void
-set_pe_value (name)
- char *name;
-
+set_pe_value (char *name)
{
char *end;
@@ -477,10 +454,9 @@ set_pe_value (name)
optarg = end;
}
+
static void
-set_pe_stack_heap (resname, comname)
- char *resname;
- char *comname;
+set_pe_stack_heap (char *resname, char *comname)
{
set_pe_value (resname);
@@ -494,38 +470,16 @@ set_pe_stack_heap (resname, comname)
}
-
-static int
-gld_${EMULATION_NAME}_parse_args(argc, argv)
- int argc;
- char **argv;
+static bfd_boolean
+gld${EMULATION_NAME}_handle_option (int optc)
{
- int longind;
- int optc;
- int prevoptind = optind;
- int prevopterr = opterr;
- int wanterror;
- static int lastoptind = -1;
-
- if (lastoptind != optind)
- opterr = 0;
- wanterror = opterr;
-
- lastoptind = optind;
-
- optc = getopt_long_only (argc, argv, "-", longopts, &longind);
- opterr = prevopterr;
-
switch (optc)
{
default:
- if (wanterror)
- xexit (1);
- optind = prevoptind;
- return 0;
+ return FALSE;
case OPTION_BASE_FILE:
- link_info.base_file = (PTR) fopen (optarg, FOPEN_WB);
+ link_info.base_file = fopen (optarg, FOPEN_WB);
if (link_info.base_file == NULL)
{
/* xgettext:c-format */
@@ -535,7 +489,7 @@ gld_${EMULATION_NAME}_parse_args(argc, argv)
}
break;
- /* PE options */
+ /* PE options. */
case OPTION_HEAP:
set_pe_stack_heap ("__size_of_heap_reserve__", "__size_of_heap_commit__");
break;
@@ -622,7 +576,7 @@ gld_${EMULATION_NAME}_parse_args(argc, argv)
pe_enable_auto_image_base = 0;
break;
case OPTION_DLL_SEARCH_PREFIX:
- pe_dll_search_prefix = xstrdup( optarg );
+ pe_dll_search_prefix = xstrdup (optarg);
break;
case OPTION_NO_DEFAULT_EXCLUDES:
pe_dll_do_default_excludes = 0;
@@ -633,12 +587,18 @@ gld_${EMULATION_NAME}_parse_args(argc, argv)
case OPTION_DLL_DISABLE_AUTO_IMPORT:
link_info.pei386_auto_import = 0;
break;
+ case OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC:
+ link_info.pei386_runtime_pseudo_reloc = 1;
+ break;
+ case OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC:
+ link_info.pei386_runtime_pseudo_reloc = 0;
+ break;
case OPTION_ENABLE_EXTRA_PE_DEBUG:
pe_dll_extra_pe_debug = 1;
break;
#endif
}
- return 1;
+ return TRUE;
}
@@ -666,7 +626,8 @@ strhash (const char *str)
return hash;
}
-/* Use the output file to create a image base for relocatable DLLs. */
+/* Use the output file to create a image base for relocatable DLLs. */
+
static unsigned long
compute_dll_image_base (const char *ofile)
{
@@ -679,16 +640,16 @@ compute_dll_image_base (const char *ofile)
read. */
static void
-gld_${EMULATION_NAME}_set_symbols ()
+gld_${EMULATION_NAME}_set_symbols (void)
{
/* Run through and invent symbols for all the
- names and insert the defaults. */
+ names and insert the defaults. */
int j;
lang_statement_list_type *save;
if (!init[IMAGEBASEOFF].inited)
{
- if (link_info.relocateable)
+ if (link_info.relocatable)
init[IMAGEBASEOFF].value = 0;
else if (init[DLLOFF].value || link_info.shared)
#ifdef DLL_SUPPORT
@@ -701,11 +662,11 @@ gld_${EMULATION_NAME}_set_symbols ()
init[IMAGEBASEOFF].value = NT_EXE_IMAGE_BASE;
}
- /* Don't do any symbol assignments if this is a relocateable link. */
- if (link_info.relocateable)
+ /* Don't do any symbol assignments if this is a relocatable link. */
+ if (link_info.relocatable)
return;
- /* Glue the assignments into the abs section */
+ /* Glue the assignments into the abs section. */
save = stat_ptr;
stat_ptr = &(abs_output_section->children);
@@ -716,20 +677,20 @@ gld_${EMULATION_NAME}_set_symbols ()
lang_assignment_statement_type *rv;
rv = lang_add_assignment (exp_assop ('=', init[j].symbol,
exp_intop (val)));
- if (init[j].size == sizeof(short))
- *(short *)init[j].ptr = val;
- else if (init[j].size == sizeof(int))
- *(int *)init[j].ptr = val;
- else if (init[j].size == sizeof(long))
- *(long *)init[j].ptr = val;
+ if (init[j].size == sizeof (short))
+ *(short *) init[j].ptr = val;
+ else if (init[j].size == sizeof (int))
+ *(int *) init[j].ptr = val;
+ else if (init[j].size == sizeof (long))
+ *(long *) init[j].ptr = val;
/* This might be a long long or other special type. */
- else if (init[j].size == sizeof(bfd_vma))
- *(bfd_vma *)init[j].ptr = val;
- else abort();
+ else if (init[j].size == sizeof (bfd_vma))
+ *(bfd_vma *) init[j].ptr = val;
+ else abort ();
if (j == IMAGEBASEOFF)
image_base_statement = rv;
}
- /* Restore the pointer. */
+ /* Restore the pointer. */
stat_ptr = save;
if (pe.FileAlignment >
@@ -743,7 +704,7 @@ gld_${EMULATION_NAME}_set_symbols ()
have been read. */
static void
-gld_${EMULATION_NAME}_after_parse ()
+gld_${EMULATION_NAME}_after_parse (void)
{
/* The Windows libraries are designed for the linker to treat the
entry point as an undefined symbol. Otherwise, the .obj that
@@ -758,7 +719,7 @@ gld_${EMULATION_NAME}_after_parse ()
opened, so registering the symbol as undefined will make a
difference. */
- if (! link_info.relocateable && entry_symbol.name != NULL)
+ if (! link_info.relocatable && entry_symbol.name != NULL)
ldlang_add_undef (entry_symbol.name);
}
@@ -772,222 +733,212 @@ char * pe_data_import_dll;
#ifdef DLL_SUPPORT
static struct bfd_link_hash_entry *pe_undef_found_sym;
-static boolean
-pe_undef_cdecl_match (h, string)
- struct bfd_link_hash_entry *h;
- PTR string;
+static bfd_boolean
+pe_undef_cdecl_match (struct bfd_link_hash_entry *h, void *inf)
{
int sl;
- sl = strlen (string); /* silence compiler warning */
+ char *string = inf;
+
+ sl = strlen (string);
if (h->type == bfd_link_hash_defined
&& strncmp (h->root.string, string, sl) == 0
&& h->root.string[sl] == '@')
{
pe_undef_found_sym = h;
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
static void
-pe_fixup_stdcalls ()
+pe_fixup_stdcalls (void)
{
static int gave_warning_message = 0;
struct bfd_link_hash_entry *undef, *sym;
- char *at;
+
if (pe_dll_extra_pe_debug)
- {
- printf ("%s\n", __FUNCTION__);
- }
+ printf ("%s\n", __FUNCTION__);
- for (undef = link_info.hash->undefs; undef; undef=undef->next)
+ for (undef = link_info.hash->undefs; undef; undef=undef->und_next)
if (undef->type == bfd_link_hash_undefined)
- {
- at = strchr (undef->root.string, '@');
- if (at)
{
- /* The symbol is a stdcall symbol, so let's look for a cdecl
- symbol with the same name and resolve to that */
- char *cname = xstrdup (undef->root.string);
- at = strchr (cname, '@');
- *at = 0;
- sym = bfd_link_hash_lookup (link_info.hash, cname, 0, 0, 1);
- if (sym && sym->type == bfd_link_hash_defined)
- {
- undef->type = bfd_link_hash_defined;
- undef->u.def.value = sym->u.def.value;
- undef->u.def.section = sym->u.def.section;
- if (pe_enable_stdcall_fixup == -1)
- {
- einfo (_("Warning: resolving %s by linking to %s\n"),
- undef->root.string, cname);
- if (! gave_warning_message)
- {
- gave_warning_message = 1;
- einfo(_("Use --enable-stdcall-fixup to disable these warnings\n"));
- einfo(_("Use --disable-stdcall-fixup to disable these fixups\n"));
- }
- }
- }
- }
- else
- {
- /* The symbol is a cdecl symbol, so we look for stdcall
- symbols - which means scanning the whole symbol table */
- pe_undef_found_sym = 0;
- bfd_link_hash_traverse (link_info.hash, pe_undef_cdecl_match,
- (PTR) undef->root.string);
- sym = pe_undef_found_sym;
- if (sym)
- {
- undef->type = bfd_link_hash_defined;
- undef->u.def.value = sym->u.def.value;
- undef->u.def.section = sym->u.def.section;
- if (pe_enable_stdcall_fixup == -1)
- {
- einfo (_("Warning: resolving %s by linking to %s\n"),
- undef->root.string, sym->root.string);
- if (! gave_warning_message)
- {
- gave_warning_message = 1;
- einfo(_("Use --enable-stdcall-fixup to disable these warnings\n"));
- einfo(_("Use --disable-stdcall-fixup to disable these fixups\n"));
- }
- }
- }
+ char* at = strchr (undef->root.string, '@');
+ int lead_at = (*undef->root.string == '@');
+ /* For now, don't try to fixup fastcall symbols. */
+
+ if (at && !lead_at)
+ {
+ /* The symbol is a stdcall symbol, so let's look for a
+ cdecl symbol with the same name and resolve to that. */
+ char *cname = xstrdup (undef->root.string /* + lead_at */);
+ at = strchr (cname, '@');
+ *at = 0;
+ sym = bfd_link_hash_lookup (link_info.hash, cname, 0, 0, 1);
+
+ if (sym && sym->type == bfd_link_hash_defined)
+ {
+ undef->type = bfd_link_hash_defined;
+ undef->u.def.value = sym->u.def.value;
+ undef->u.def.section = sym->u.def.section;
+
+ if (pe_enable_stdcall_fixup == -1)
+ {
+ einfo (_("Warning: resolving %s by linking to %s\n"),
+ undef->root.string, cname);
+ if (! gave_warning_message)
+ {
+ gave_warning_message = 1;
+ einfo (_("Use --enable-stdcall-fixup to disable these warnings\n"));
+ einfo (_("Use --disable-stdcall-fixup to disable these fixups\n"));
+ }
+ }
+ }
+ }
+ else
+ {
+ /* The symbol is a cdecl symbol, so we look for stdcall
+ symbols - which means scanning the whole symbol table. */
+ pe_undef_found_sym = 0;
+ bfd_link_hash_traverse (link_info.hash, pe_undef_cdecl_match,
+ (char *) undef->root.string);
+ sym = pe_undef_found_sym;
+ if (sym)
+ {
+ undef->type = bfd_link_hash_defined;
+ undef->u.def.value = sym->u.def.value;
+ undef->u.def.section = sym->u.def.section;
+
+ if (pe_enable_stdcall_fixup == -1)
+ {
+ einfo (_("Warning: resolving %s by linking to %s\n"),
+ undef->root.string, sym->root.string);
+ if (! gave_warning_message)
+ {
+ gave_warning_message = 1;
+ einfo (_("Use --enable-stdcall-fixup to disable these warnings\n"));
+ einfo (_("Use --disable-stdcall-fixup to disable these fixups\n"));
+ }
+ }
+ }
+ }
}
- }
}
static int
-make_import_fixup (rel, s)
- arelent *rel;
- asection *s;
+make_import_fixup (arelent *rel, asection *s)
{
- struct symbol_cache_entry *sym = *rel->sym_ptr_ptr;
+ struct bfd_symbol *sym = *rel->sym_ptr_ptr;
+ int addend = 0;
if (pe_dll_extra_pe_debug)
- {
- printf ("arelent: %s@%#lx: add=%li\n", sym->name,
- (long) rel->address, (long) rel->addend);
- }
+ printf ("arelent: %s@%#lx: add=%li\n", sym->name,
+ (long) rel->address, (long) rel->addend);
- {
- int addend = 0;
- if (!bfd_get_section_contents(s->owner, s, &addend, rel->address, sizeof(addend)))
- {
- einfo (_("%C: Cannot get section contents - auto-import exception\n"),
- s->owner, s, rel->address);
- }
+ if (! bfd_get_section_contents (s->owner, s, &addend, rel->address, sizeof (addend)))
+ einfo (_("%C: Cannot get section contents - auto-import exception\n"),
+ s->owner, s, rel->address);
- if (addend == 0)
- pe_create_import_fixup (rel);
- else
- {
- einfo (_("%C: variable '%T' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.\n"),
- s->owner, s, rel->address, sym->name);
- einfo ("%X");
- }
- }
+ pe_create_import_fixup (rel, s, addend);
return 1;
}
static void
-pe_find_data_imports ()
+pe_find_data_imports (void)
{
struct bfd_link_hash_entry *undef, *sym;
- for (undef = link_info.hash->undefs; undef; undef=undef->next)
+
+ if (link_info.pei386_auto_import == 0)
+ return;
+
+ for (undef = link_info.hash->undefs; undef; undef=undef->und_next)
{
if (undef->type == bfd_link_hash_undefined)
{
- /* C++ symbols are *long* */
+ /* C++ symbols are *long*. */
char buf[4096];
- if (pe_dll_extra_pe_debug)
- {
- printf ("%s:%s\n", __FUNCTION__, undef->root.string);
- }
+
+ if (pe_dll_extra_pe_debug)
+ printf ("%s:%s\n", __FUNCTION__, undef->root.string);
+
sprintf (buf, "__imp_%s", undef->root.string);
sym = bfd_link_hash_lookup (link_info.hash, buf, 0, 0, 1);
+
if (sym && sym->type == bfd_link_hash_defined)
{
- if (link_info.pei386_auto_import == -1)
- info_msg (_("Info: resolving %s by linking to %s (auto-import)\n"),
- undef->root.string, buf);
- {
- bfd *b = sym->u.def.section->owner;
- asymbol **symbols;
- int nsyms, symsize, i;
-
- symsize = bfd_get_symtab_upper_bound (b);
- symbols = (asymbol **) xmalloc (symsize);
- nsyms = bfd_canonicalize_symtab (b, symbols);
-
- for (i = 0; i < nsyms; i++)
- {
- if (memcmp(symbols[i]->name, "__head_",
- sizeof ("__head_") - 1))
- continue;
- if (pe_dll_extra_pe_debug)
- {
- printf ("->%s\n", symbols[i]->name);
- }
- pe_data_import_dll = (char*) (symbols[i]->name +
- sizeof ("__head_") - 1);
- break;
- }
- }
-
- pe_walk_relocs_of_symbol (&link_info, undef->root.string,
- make_import_fixup);
-
- /* let's differentiate it somehow from defined */
- undef->type = bfd_link_hash_defweak;
- /* we replace original name with __imp_ prefixed, this
- 1) may trash memory 2) leads to duplicate symbol generation.
- Still, IMHO it's better than having name poluted. */
- undef->root.string = sym->root.string;
- undef->u.def.value = sym->u.def.value;
- undef->u.def.section = sym->u.def.section;
+ bfd *b = sym->u.def.section->owner;
+ asymbol **symbols;
+ int nsyms, symsize, i;
+
+ if (link_info.pei386_auto_import == -1)
+ info_msg (_("Info: resolving %s by linking to %s (auto-import)\n"),
+ undef->root.string, buf);
+
+ symsize = bfd_get_symtab_upper_bound (b);
+ symbols = (asymbol **) xmalloc (symsize);
+ nsyms = bfd_canonicalize_symtab (b, symbols);
+
+ for (i = 0; i < nsyms; i++)
+ {
+ if (memcmp (symbols[i]->name, "__head_",
+ sizeof ("__head_") - 1))
+ continue;
+
+ if (pe_dll_extra_pe_debug)
+ printf ("->%s\n", symbols[i]->name);
+
+ pe_data_import_dll = (char*) (symbols[i]->name +
+ sizeof ("__head_") - 1);
+ break;
+ }
+
+ pe_walk_relocs_of_symbol (&link_info, undef->root.string,
+ make_import_fixup);
+
+ /* Let's differentiate it somehow from defined. */
+ undef->type = bfd_link_hash_defweak;
+ /* We replace original name with __imp_ prefixed, this
+ 1) may trash memory 2) leads to duplicate symbol generation.
+ Still, IMHO it's better than having name poluted. */
+ undef->root.string = sym->root.string;
+ undef->u.def.value = sym->u.def.value;
+ undef->u.def.section = sym->u.def.section;
}
}
}
}
-#endif /* DLL_SUPPORT */
-static boolean
-pr_sym (h, string)
- struct bfd_hash_entry *h;
- PTR string ATTRIBUTE_UNUSED;
+static bfd_boolean
+pr_sym (struct bfd_hash_entry *h, void *inf ATTRIBUTE_UNUSED)
{
if (pe_dll_extra_pe_debug)
- {
- printf("+%s\n",h->string);
- }
- return true;
+ printf ("+%s\n", h->string);
+
+ return TRUE;
}
+#endif /* DLL_SUPPORT */
static void
-gld_${EMULATION_NAME}_after_open ()
+gld_${EMULATION_NAME}_after_open (void)
{
-
+#ifdef DLL_SUPPORT
if (pe_dll_extra_pe_debug)
{
bfd *a;
struct bfd_link_hash_entry *sym;
+
printf ("%s()\n", __FUNCTION__);
- for (sym = link_info.hash->undefs; sym; sym=sym->next)
+ for (sym = link_info.hash->undefs; sym; sym=sym->und_next)
printf ("-%s\n", sym->root.string);
- bfd_hash_traverse (&link_info.hash->table, pr_sym,NULL);
+ bfd_hash_traverse (&link_info.hash->table, pr_sym, NULL);
for (a = link_info.input_bfds; a; a = a->link_next)
- {
- printf("*%s\n",a->filename);
- }
+ printf ("*%s\n",a->filename);
}
+#endif
/* Pass the wacky PE command line options into the output bfd.
FIXME: This should be done via a function, rather than by
@@ -1003,10 +954,15 @@ gld_${EMULATION_NAME}_after_open ()
if (pe_enable_stdcall_fixup) /* -1=warn or 1=disable */
pe_fixup_stdcalls ();
+ pe_process_import_defs (output_bfd, & link_info);
+
pe_find_data_imports ();
- pe_process_import_defs(output_bfd, &link_info);
+#if ! (defined (TARGET_IS_i386pe) || defined (TARGET_IS_armpe))
if (link_info.shared)
+#else
+ if (!link_info.relocatable)
+#endif
pe_dll_build_sections (output_bfd, &link_info);
#ifndef TARGET_IS_i386pe
@@ -1046,7 +1002,7 @@ gld_${EMULATION_NAME}_after_open ()
head/tail objects, causing an improper import table. We detect
those cases and rename the "other" import libraries to match
the one the head/tail come from, so that the linker will sort
- things nicely and produce a valid import table. */
+ things nicely and produce a valid import table. */
LANG_FOR_EACH_INPUT_STATEMENT (is)
{
@@ -1105,7 +1061,7 @@ gld_${EMULATION_NAME}_after_open ()
for (i = 0; i < nrelocs; i++)
{
- struct symbol_cache_entry *s;
+ struct bfd_symbol *s;
struct bfd_link_hash_entry * blhe;
bfd *other_bfd;
char *n;
@@ -1118,7 +1074,7 @@ gld_${EMULATION_NAME}_after_open ()
/* Thunk section with reloc to another bfd. */
blhe = bfd_link_hash_lookup (link_info.hash,
s->name,
- false, false, true);
+ FALSE, FALSE, TRUE);
if (blhe == NULL
|| blhe->type != bfd_link_hash_defined)
@@ -1151,6 +1107,7 @@ gld_${EMULATION_NAME}_after_open ()
int is_ms_arch = 0;
bfd *cur_arch = 0;
lang_input_statement_type *is2;
+ lang_input_statement_type *is3;
/* Careful - this is a shell script. Watch those dollar signs! */
/* Microsoft import libraries have every member named the same,
@@ -1165,21 +1122,59 @@ gld_${EMULATION_NAME}_after_open ()
{
if (is->the_bfd->my_archive)
{
+ char *pnt;
bfd *arch = is->the_bfd->my_archive;
+
if (cur_arch != arch)
{
cur_arch = arch;
is_ms_arch = 1;
- for (is2 = is;
- is2 && is2->the_bfd->my_archive == arch;
- is2 = (lang_input_statement_type *)is2->next)
+
+ for (is3 = is;
+ is3 && is3->the_bfd->my_archive == arch;
+ is3 = (lang_input_statement_type *) is3->next)
+ {
+ /* A MS dynamic import library can also contain static
+ members, so look for the first element with a .dll
+ extension, and use that for the remainder of the
+ comparisons. */
+ pnt = strrchr (is3->the_bfd->filename, '.');
+ if (pnt != NULL && strcmp (pnt, ".dll") == 0)
+ break;
+ }
+
+ if (is3 == NULL)
+ is_ms_arch = 0;
+ else
{
- if (strcmp (is->the_bfd->filename, is2->the_bfd->filename))
- is_ms_arch = 0;
+ /* OK, found one. Now look to see if the remaining
+ (dynamic import) members use the same name. */
+ for (is2 = is;
+ is2 && is2->the_bfd->my_archive == arch;
+ is2 = (lang_input_statement_type *) is2->next)
+ {
+ /* Skip static members, ie anything with a .obj
+ extension. */
+ pnt = strrchr (is2->the_bfd->filename, '.');
+ if (pnt != NULL && strcmp (pnt, ".obj") == 0)
+ continue;
+
+ if (strcmp (is3->the_bfd->filename,
+ is2->the_bfd->filename))
+ {
+ is_ms_arch = 0;
+ break;
+ }
+ }
}
}
- if (is_ms_arch)
+ /* This fragment might have come from an .obj file in a Microsoft
+ import, and not an actual import record. If this is the case,
+ then leave the filename alone. */
+ pnt = strrchr (is->the_bfd->filename, '.');
+
+ if (is_ms_arch && (strcmp (pnt, ".dll") == 0))
{
int idata2 = 0, reloc_count=0;
asection *sec;
@@ -1213,10 +1208,10 @@ gld_${EMULATION_NAME}_after_open ()
}
static void
-gld_${EMULATION_NAME}_before_allocation()
+gld_${EMULATION_NAME}_before_allocation (void)
{
#ifdef TARGET_IS_ppcpe
- /* Here we rummage through the found bfds to collect toc information */
+ /* Here we rummage through the found bfds to collect toc information. */
{
LANG_FOR_EACH_INPUT_STATEMENT (is)
{
@@ -1228,7 +1223,7 @@ gld_${EMULATION_NAME}_before_allocation()
}
}
- /* We have seen it all. Allocate it, and carry on */
+ /* We have seen it all. Allocate it, and carry on. */
ppc_allocate_toc_section (&link_info);
#endif /* TARGET_IS_ppcpe */
@@ -1238,7 +1233,7 @@ gld_${EMULATION_NAME}_before_allocation()
Here we rummage through the found bfds to collect glue
information. FIXME: should this be based on a command line
- option? krk@cygnus.com */
+ option? krk@cygnus.com. */
{
LANG_FOR_EACH_INPUT_STATEMENT (is)
{
@@ -1252,114 +1247,118 @@ gld_${EMULATION_NAME}_before_allocation()
}
}
- /* We have seen it all. Allocate it, and carry on */
+ /* We have seen it all. Allocate it, and carry on. */
bfd_arm_pe_allocate_interworking_sections (& link_info);
#endif /* TARGET_IS_armpe */
}
#ifdef DLL_SUPPORT
/* This is called when an input file isn't recognized as a BFD. We
- check here for .DEF files and pull them in automatically. */
+ check here for .DEF files and pull them in automatically. */
static int
-saw_option(char *option)
+saw_option (char *option)
{
int i;
- for (i=0; init[i].ptr; i++)
+
+ for (i = 0; init[i].ptr; i++)
if (strcmp (init[i].symbol, option) == 0)
return init[i].inited;
return 0;
}
#endif /* DLL_SUPPORT */
-static boolean
-gld_${EMULATION_NAME}_unrecognized_file(entry)
- lang_input_statement_type *entry ATTRIBUTE_UNUSED;
+static bfd_boolean
+gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
{
#ifdef DLL_SUPPORT
const char *ext = entry->filename + strlen (entry->filename) - 4;
if (strcmp (ext, ".def") == 0 || strcmp (ext, ".DEF") == 0)
- {
- if (pe_def_file == 0)
- pe_def_file = def_file_empty ();
- def_file_parse (entry->filename, pe_def_file);
- if (pe_def_file)
{
- int i, buflen=0, len;
- char *buf;
- for (i=0; i<pe_def_file->num_exports; i++)
- {
- len = strlen(pe_def_file->exports[i].internal_name);
- if (buflen < len+2)
- buflen = len+2;
- }
- buf = (char *) xmalloc (buflen);
- for (i=0; i<pe_def_file->num_exports; i++)
+ if (pe_def_file == 0)
+ pe_def_file = def_file_empty ();
+
+ def_file_parse (entry->filename, pe_def_file);
+
+ if (pe_def_file)
{
- struct bfd_link_hash_entry *h;
- sprintf(buf, "_%s", pe_def_file->exports[i].internal_name);
+ int i, buflen=0, len;
+ char *buf;
- h = bfd_link_hash_lookup (link_info.hash, buf, true, true, true);
- if (h == (struct bfd_link_hash_entry *) NULL)
- einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n"));
- if (h->type == bfd_link_hash_new)
+ for (i = 0; i < pe_def_file->num_exports; i++)
{
- h->type = bfd_link_hash_undefined;
- h->u.undef.abfd = NULL;
- bfd_link_add_undef (link_info.hash, h);
+ len = strlen (pe_def_file->exports[i].internal_name);
+ if (buflen < len + 2)
+ buflen = len + 2;
}
- }
- free (buf);
- /* def_file_print (stdout, pe_def_file); */
- if (pe_def_file->is_dll == 1)
- link_info.shared = 1;
+ buf = (char *) xmalloc (buflen);
- if (pe_def_file->base_address != (bfd_vma)(-1))
- {
- pe.ImageBase =
- pe_data (output_bfd)->pe_opthdr.ImageBase =
- init[IMAGEBASEOFF].value = pe_def_file->base_address;
- init[IMAGEBASEOFF].inited = 1;
- if (image_base_statement)
- image_base_statement->exp =
- exp_assop ('=', "__image_base__", exp_intop (pe.ImageBase));
- }
+ for (i = 0; i < pe_def_file->num_exports; i++)
+ {
+ struct bfd_link_hash_entry *h;
+
+ sprintf (buf, "_%s", pe_def_file->exports[i].internal_name);
+
+ h = bfd_link_hash_lookup (link_info.hash, buf, TRUE, TRUE, TRUE);
+ if (h == (struct bfd_link_hash_entry *) NULL)
+ einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n"));
+ if (h->type == bfd_link_hash_new)
+ {
+ h->type = bfd_link_hash_undefined;
+ h->u.undef.abfd = NULL;
+ bfd_link_add_undef (link_info.hash, h);
+ }
+ }
+ free (buf);
+
+ /* def_file_print (stdout, pe_def_file); */
+ if (pe_def_file->is_dll == 1)
+ link_info.shared = 1;
+
+ if (pe_def_file->base_address != (bfd_vma)(-1))
+ {
+ pe.ImageBase =
+ pe_data (output_bfd)->pe_opthdr.ImageBase =
+ init[IMAGEBASEOFF].value = pe_def_file->base_address;
+ init[IMAGEBASEOFF].inited = 1;
+ if (image_base_statement)
+ image_base_statement->exp =
+ exp_assop ('=', "__image_base__", exp_intop (pe.ImageBase));
+ }
#if 0
- /* Not sure if these *should* be set */
- if (pe_def_file->version_major != -1)
- {
- pe.MajorImageVersion = pe_def_file->version_major;
- pe.MinorImageVersion = pe_def_file->version_minor;
- }
+ /* Not sure if these *should* be set. */
+ if (pe_def_file->version_major != -1)
+ {
+ pe.MajorImageVersion = pe_def_file->version_major;
+ pe.MinorImageVersion = pe_def_file->version_minor;
+ }
#endif
- if (pe_def_file->stack_reserve != -1
- && ! saw_option ("__size_of_stack_reserve__"))
- {
- pe.SizeOfStackReserve = pe_def_file->stack_reserve;
- if (pe_def_file->stack_commit != -1)
- pe.SizeOfStackCommit = pe_def_file->stack_commit;
- }
- if (pe_def_file->heap_reserve != -1
- && ! saw_option ("__size_of_heap_reserve__"))
- {
- pe.SizeOfHeapReserve = pe_def_file->heap_reserve;
- if (pe_def_file->heap_commit != -1)
- pe.SizeOfHeapCommit = pe_def_file->heap_commit;
- }
- return true;
+ if (pe_def_file->stack_reserve != -1
+ && ! saw_option ("__size_of_stack_reserve__"))
+ {
+ pe.SizeOfStackReserve = pe_def_file->stack_reserve;
+ if (pe_def_file->stack_commit != -1)
+ pe.SizeOfStackCommit = pe_def_file->stack_commit;
+ }
+ if (pe_def_file->heap_reserve != -1
+ && ! saw_option ("__size_of_heap_reserve__"))
+ {
+ pe.SizeOfHeapReserve = pe_def_file->heap_reserve;
+ if (pe_def_file->heap_commit != -1)
+ pe.SizeOfHeapCommit = pe_def_file->heap_commit;
+ }
+ return TRUE;
+ }
}
- }
#endif
- return false;
-
+ return FALSE;
}
-static boolean
-gld_${EMULATION_NAME}_recognized_file(entry)
- lang_input_statement_type *entry ATTRIBUTE_UNUSED;
+static bfd_boolean
+gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
{
#ifdef DLL_SUPPORT
#ifdef TARGET_IS_i386pe
@@ -1376,23 +1375,31 @@ gld_${EMULATION_NAME}_recognized_file(entry)
#endif
if (bfd_get_format (entry->the_bfd) == bfd_object)
{
- const char *ext = entry->filename + strlen (entry->filename) - 4;
+ char fbuf[LD_PATHMAX + 1];
+ const char *ext;
+
+ if (REALPATH (entry->filename, fbuf) == NULL)
+ strncpy (fbuf, entry->filename, sizeof (fbuf));
+
+ ext = fbuf + strlen (fbuf) - 4;
+
if (strcmp (ext, ".dll") == 0 || strcmp (ext, ".DLL") == 0)
- return pe_implied_import_dll (entry->filename);
+ return pe_implied_import_dll (fbuf);
}
#endif
- return false;
+ return FALSE;
}
static void
-gld_${EMULATION_NAME}_finish ()
+gld_${EMULATION_NAME}_finish (void)
{
#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe)
struct bfd_link_hash_entry * h;
if (thumb_entry_symbol != NULL)
{
- h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, false, false, true);
+ h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol,
+ FALSE, FALSE, TRUE);
if (h != (struct bfd_link_hash_entry *) NULL
&& (h->type == bfd_link_hash_defined
@@ -1429,7 +1436,11 @@ gld_${EMULATION_NAME}_finish ()
#endif /* defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe) */
#ifdef DLL_SUPPORT
- if (link_info.shared)
+ if (link_info.shared
+#if !defined(TARGET_IS_shpe) && !defined(TARGET_IS_mipspe)
+ || (!link_info.relocatable && pe_def_file->num_exports != 0)
+#endif
+ )
{
pe_dll_fill_sections (output_bfd, &link_info);
if (pe_implib_filename)
@@ -1447,9 +1458,10 @@ gld_${EMULATION_NAME}_finish ()
pe_dll_generate_def_file (pe_out_def_filename);
#endif /* DLL_SUPPORT */
- /* I don't know where .idata gets set as code, but it shouldn't be */
+ /* I don't know where .idata gets set as code, but it shouldn't be. */
{
asection *asec = bfd_get_section_by_name (output_bfd, ".idata");
+
if (asec)
{
asec->flags &= ~SEC_CODE;
@@ -1463,8 +1475,7 @@ gld_${EMULATION_NAME}_finish ()
Used by place_orphan. */
static asection *
-output_prev_sec_find (os)
- lang_output_section_statement_type *os;
+output_prev_sec_find (lang_output_section_statement_type *os)
{
asection *s = (asection *) NULL;
lang_statement_union_type *u;
@@ -1505,11 +1516,8 @@ struct orphan_save
lang_statement_union_type **stmt;
};
-/*ARGSUSED*/
-static boolean
-gld_${EMULATION_NAME}_place_orphan (file, s)
- lang_input_statement_type *file;
- asection *s;
+static bfd_boolean
+gld_${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s)
{
const char *secname;
char *hold_section_name;
@@ -1521,9 +1529,8 @@ gld_${EMULATION_NAME}_place_orphan (file, s)
secname = bfd_get_section_name (s->owner, s);
/* Look through the script to see where to place this section. */
-
hold_section_name = xstrdup (secname);
- if (!link_info.relocateable)
+ if (!link_info.relocatable)
{
dollar = strchr (hold_section_name, '$');
if (dollar != NULL)
@@ -1614,7 +1621,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s)
/* If the name of the section is representable in C, then create
symbols to mark the start and the end of the section. */
for (ps = outsecname; *ps != '\0'; ps++)
- if (! isalnum ((unsigned char) *ps) && *ps != '_')
+ if (! ISALNUM ((unsigned char) *ps) && *ps != '_')
break;
if (*ps == '\0')
{
@@ -1629,7 +1636,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s)
}
}
- if (link_info.relocateable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
+ if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
address = exp_intop ((bfd_vma) 0);
else
{
@@ -1640,7 +1647,6 @@ gld_${EMULATION_NAME}_place_orphan (file, s)
}
os = lang_enter_output_section_statement (outsecname, address, 0,
- (bfd_vma) 0,
(etree_type *) NULL,
(etree_type *) NULL,
(etree_type *) NULL);
@@ -1655,8 +1661,8 @@ gld_${EMULATION_NAME}_place_orphan (file, s)
{
char *symname;
- /* lang_leave_ouput_section_statement resets stat_ptr. Put
- stat_ptr back where we want it. */
+ /* lang_leave_ouput_section_statement resets stat_ptr.
+ Put stat_ptr back where we want it. */
if (place != NULL)
stat_ptr = &add;
@@ -1748,12 +1754,11 @@ gld_${EMULATION_NAME}_place_orphan (file, s)
if (dollar != NULL)
{
- boolean found_dollar;
+ bfd_boolean found_dollar;
/* The section name has a '$'. Sort it with the other '$'
sections. */
-
- found_dollar = false;
+ found_dollar = FALSE;
for ( ; *pl != NULL; pl = &(*pl)->header.next)
{
lang_input_section_type *ls;
@@ -1772,7 +1777,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s)
}
else
{
- found_dollar = true;
+ found_dollar = TRUE;
if (strcmp (secname, lname) < 0)
break;
}
@@ -1788,20 +1793,19 @@ gld_${EMULATION_NAME}_place_orphan (file, s)
free (hold_section_name);
- return true;
+ return TRUE;
}
-static boolean
-gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
- const char * arch ATTRIBUTE_UNUSED;
- search_dirs_type * search;
- lang_input_statement_type * entry;
+static bfd_boolean
+gld_${EMULATION_NAME}_open_dynamic_archive
+ (const char *arch ATTRIBUTE_UNUSED, search_dirs_type *search,
+ lang_input_statement_type *entry)
{
const char * filename;
char * string;
if (! entry->is_archive)
- return false;
+ return FALSE;
filename = entry->filename;
@@ -1813,65 +1817,63 @@ gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
#endif
+ 1);
- /* Try "libfoo.dll.a" first (preferred explicit import library for dll's */
+ /* Try "libfoo.dll.a" first (preferred explicit import library for dll's. */
sprintf (string, "%s/lib%s.dll.a", search->name, filename);
if (! ldfile_try_open_bfd (string, entry))
{
- /* Try "foo.dll.a" next (alternate explicit import library for dll's */
+ /* Try "foo.dll.a" next (alternate explicit import library for dll's. */
sprintf (string, "%s/%s.dll.a", search->name, filename);
if (! ldfile_try_open_bfd (string, entry))
{
-/*
- Try libfoo.a next. Normally, this would be interpreted as a static
- library, but it *could* be an import library. For backwards compatibility,
- libfoo.a needs to ==precede== libfoo.dll and foo.dll in the search,
- or sometimes errors occur when building legacy packages.
-
- Putting libfoo.a here means that in a failure case (i.e. the library
- -lfoo is not found) we will search for libfoo.a twice before
- giving up -- once here, and once when searching for a "static" lib.
- for a "static" lib.
-*/
+ /* Try libfoo.a next. Normally, this would be interpreted as a static
+ library, but it *could* be an import library. For backwards compatibility,
+ libfoo.a needs to ==precede== libfoo.dll and foo.dll in the search,
+ or sometimes errors occur when building legacy packages.
+
+ Putting libfoo.a here means that in a failure case (i.e. the library
+ -lfoo is not found) we will search for libfoo.a twice before
+ giving up -- once here, and once when searching for a "static" lib.
+ for a "static" lib. */
/* Try "libfoo.a" (import lib, or static lib, but must
- take precedence over dll's) */
+ take precedence over dll's). */
sprintf (string, "%s/lib%s.a", search->name, filename);
if (! ldfile_try_open_bfd (string, entry))
{
#ifdef DLL_SUPPORT
if (pe_dll_search_prefix)
{
- /* Try "<prefix>foo.dll" (preferred dll name, if specified) */
+ /* Try "<prefix>foo.dll" (preferred dll name, if specified). */
sprintf (string, "%s/%s%s.dll", search->name, pe_dll_search_prefix, filename);
if (! ldfile_try_open_bfd (string, entry))
{
- /* Try "libfoo.dll" (default preferred dll name) */
+ /* Try "libfoo.dll" (default preferred dll name). */
sprintf (string, "%s/lib%s.dll", search->name, filename);
if (! ldfile_try_open_bfd (string, entry))
{
- /* Finally, try "foo.dll" (alternate dll name) */
+ /* Finally, try "foo.dll" (alternate dll name). */
sprintf (string, "%s/%s.dll", search->name, filename);
if (! ldfile_try_open_bfd (string, entry))
{
free (string);
- return false;
+ return FALSE;
}
}
}
}
- else /* pe_dll_search_prefix not specified */
+ else /* pe_dll_search_prefix not specified. */
#endif
{
- /* Try "libfoo.dll" (preferred dll name) */
+ /* Try "libfoo.dll" (preferred dll name). */
sprintf (string, "%s/lib%s.dll", search->name, filename);
if (! ldfile_try_open_bfd (string, entry))
{
- /* Finally, try "foo.dll" (alternate dll name) */
+ /* Finally, try "foo.dll" (alternate dll name). */
sprintf (string, "%s/%s.dll", search->name, filename);
if (! ldfile_try_open_bfd (string, entry))
{
free (string);
- return false;
+ return FALSE;
}
}
}
@@ -1881,20 +1883,18 @@ gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
entry->filename = string;
- return true;
+ return TRUE;
}
static int
-gld_${EMULATION_NAME}_find_potential_libraries (name, entry)
- char * name;
- lang_input_statement_type * entry;
+gld_${EMULATION_NAME}_find_potential_libraries
+ (char *name, lang_input_statement_type *entry)
{
return ldfile_open_file_search (name, entry, "", ".lib");
}
static char *
-gld_${EMULATION_NAME}_get_script(isfile)
- int *isfile;
+gld_${EMULATION_NAME}_get_script (int *isfile)
EOF
# Scripts compiled in.
# sed commands to quote an ld script as a C string.
@@ -1904,19 +1904,19 @@ cat >>e${EMULATION_NAME}.c <<EOF
{
*isfile = 0;
- if (link_info.relocateable == true && config.build_constructors == true)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
-sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
-echo ' ; else return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
-echo '; }' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
+echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
+echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
+echo ' ; else return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
+echo '; }' >> e${EMULATION_NAME}.c
cat >>e${EMULATION_NAME}.c <<EOF
@@ -1935,16 +1935,18 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
gld_${EMULATION_NAME}_get_script,
"${EMULATION_NAME}",
"${OUTPUT_FORMAT}",
- gld_${EMULATION_NAME}_finish, /* finish */
- NULL, /* create output section statements */
+ gld_${EMULATION_NAME}_finish,
+ NULL, /* Create output section statements. */
gld_${EMULATION_NAME}_open_dynamic_archive,
gld_${EMULATION_NAME}_place_orphan,
gld_${EMULATION_NAME}_set_symbols,
- gld_${EMULATION_NAME}_parse_args,
+ NULL, /* parse_args */
+ gld${EMULATION_NAME}_add_options,
+ gld${EMULATION_NAME}_handle_option,
gld_${EMULATION_NAME}_unrecognized_file,
gld_${EMULATION_NAME}_list_options,
gld_${EMULATION_NAME}_recognized_file,
gld_${EMULATION_NAME}_find_potential_libraries,
- NULL /* new_vers_pattern */
+ NULL /* new_vers_pattern. */
};
EOF
diff --git a/contrib/binutils/ld/emultempl/ppc64elf.em b/contrib/binutils/ld/emultempl/ppc64elf.em
index cf6918e..4f408a9 100644
--- a/contrib/binutils/ld/emultempl/ppc64elf.em
+++ b/contrib/binutils/ld/emultempl/ppc64elf.em
@@ -1,5 +1,5 @@
# This shell script emits a C file. -*- C -*-
-# Copyright 2002 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
#
# This file is part of GLD, the Gnu Linker.
#
@@ -25,10 +25,12 @@ cat >>e${EMULATION_NAME}.c <<EOF
#include "ldctor.h"
#include "libbfd.h"
+#include "elf-bfd.h"
#include "elf64-ppc.h"
/* Fake input file for stubs. */
static lang_input_statement_type *stub_file;
+static int stub_added = 0;
/* Whether we need to call ppc_layout_sections_again. */
static int need_laying_out = 0;
@@ -41,21 +43,30 @@ static bfd_signed_vma group_size = 1;
/* Whether to add ".foo" entries for each "foo" in a version script. */
static int dotsyms = 1;
-static void ppc_create_output_section_statements PARAMS ((void));
-static void ppc_after_open PARAMS ((void));
-static asection *ppc_add_stub_section PARAMS ((const char *, asection *));
-static void ppc_layout_sections_again PARAMS ((void));
-static void gld${EMULATION_NAME}_after_allocation PARAMS ((void));
-static void build_section_lists PARAMS ((lang_statement_union_type *));
-static struct bfd_elf_version_expr *gld${EMULATION_NAME}_new_vers_pattern
- PARAMS ((struct bfd_elf_version_expr *));
+/* Whether to run tls optimization. */
+static int notlsopt = 0;
+
+/* Whether to emit symbols for stubs. */
+static int emit_stub_syms = 0;
+
+static asection *toc_section = 0;
+
/* This is called before the input files are opened. We create a new
fake input file to hold the stub sections. */
static void
-ppc_create_output_section_statements ()
+ppc_create_output_section_statements (void)
{
+ extern const bfd_target bfd_elf64_powerpc_vec;
+ extern const bfd_target bfd_elf64_powerpcle_vec;
+
+ if (link_info.hash->creator != &bfd_elf64_powerpc_vec
+ && link_info.hash->creator != &bfd_elf64_powerpcle_vec)
+ return;
+
+ link_info.wrap_char = '.';
+
stub_file = lang_add_input_file ("linker stubs",
lang_input_file_is_fake_enum,
NULL);
@@ -70,10 +81,11 @@ ppc_create_output_section_statements ()
}
ldlang_add_file (stub_file);
+ ppc64_elf_init_stub_bfd (stub_file->the_bfd, &link_info);
}
static void
-ppc_after_open ()
+ppc_after_open (void)
{
if (!ppc64_elf_mark_entry_syms (&link_info))
{
@@ -84,6 +96,39 @@ ppc_after_open ()
gld${EMULATION_NAME}_after_open ();
}
+static void
+ppc_before_allocation (void)
+{
+ if (stub_file != NULL)
+ {
+ if (!ppc64_elf_edit_opd (output_bfd, &link_info))
+ {
+ einfo ("%X%P: can not edit opd %E\n");
+ return;
+ }
+
+ if (ppc64_elf_tls_setup (output_bfd, &link_info) && !notlsopt)
+ {
+ /* Size the sections. This is premature, but we want to know the
+ TLS segment layout so that certain optimizations can be done. */
+ lang_size_sections (stat_ptr->head, abs_output_section,
+ &stat_ptr->head, 0, 0, NULL, TRUE);
+
+ if (!ppc64_elf_tls_optimize (output_bfd, &link_info))
+ {
+ einfo ("%X%P: TLS problem %E\n");
+ return;
+ }
+
+ /* We must not cache anything from the preliminary sizing. */
+ elf_tdata (output_bfd)->program_header_size = 0;
+ lang_reset_memory_regions ();
+ }
+ }
+
+ gld${EMULATION_NAME}_before_allocation ();
+}
+
struct hook_stub_info
{
lang_statement_list_type add;
@@ -92,16 +137,11 @@ struct hook_stub_info
/* Traverse the linker tree to find the spot where the stub goes. */
-static boolean hook_in_stub
- PARAMS ((struct hook_stub_info *, lang_statement_union_type **));
-
-static boolean
-hook_in_stub (info, lp)
- struct hook_stub_info *info;
- lang_statement_union_type **lp;
+static bfd_boolean
+hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp)
{
lang_statement_union_type *l;
- boolean ret;
+ bfd_boolean ret;
for (; (l = *lp) != NULL; lp = &l->header.next)
{
@@ -139,7 +179,7 @@ hook_in_stub (info, lp)
before its associated input section. */
*lp = info->add.head;
*(info->add.tail) = l;
- return true;
+ return TRUE;
}
break;
@@ -160,7 +200,7 @@ hook_in_stub (info, lp)
break;
}
}
- return false;
+ return FALSE;
}
@@ -170,9 +210,7 @@ hook_in_stub (info, lp)
immediately before INPUT_SECTION. */
static asection *
-ppc_add_stub_section (stub_sec_name, input_section)
- const char *stub_sec_name;
- asection *input_section;
+ppc_add_stub_section (const char *stub_sec_name, asection *input_section)
{
asection *stub_sec;
flagword flags;
@@ -201,6 +239,7 @@ ppc_add_stub_section (stub_sec_name, input_section)
if (info.add.head == NULL)
goto err_ret;
+ stub_added = 1;
if (hook_in_stub (&info, &os->children.head))
return stub_sec;
@@ -213,7 +252,7 @@ ppc_add_stub_section (stub_sec_name, input_section)
/* Another call-back for ppc64_elf_size_stubs. */
static void
-ppc_layout_sections_again ()
+ppc_layout_sections_again (void)
{
/* If we have changed sizes of the stub sections, then we need
to recalculate all the section offsets. This may mean we need to
@@ -224,38 +263,47 @@ ppc_layout_sections_again ()
/* Resize the sections. */
lang_size_sections (stat_ptr->head, abs_output_section,
- &stat_ptr->head, 0, (bfd_vma) 0, NULL);
+ &stat_ptr->head, 0, 0, NULL, TRUE);
/* Recalculate TOC base. */
ldemul_after_allocation ();
/* Do the assignments again. */
- lang_do_assignments (stat_ptr->head, abs_output_section,
- (fill_type *) 0, (bfd_vma) 0);
+ lang_do_assignments (stat_ptr->head, abs_output_section, NULL, 0);
}
/* Call the back-end function to set TOC base after we have placed all
the sections. */
static void
-gld${EMULATION_NAME}_after_allocation ()
+gld${EMULATION_NAME}_after_allocation (void)
{
- if (!link_info.relocateable)
+ if (!link_info.relocatable)
_bfd_set_gp_value (output_bfd, ppc64_elf_toc (output_bfd));
}
static void
-build_section_lists (statement)
- lang_statement_union_type *statement;
+build_toc_list (lang_statement_union_type *statement)
+{
+ if (statement->header.type == lang_input_section_enum
+ && !statement->input_section.ifile->just_syms_flag
+ && statement->input_section.section->output_section == toc_section)
+ ppc64_elf_next_toc_section (&link_info, statement->input_section.section);
+}
+
+
+static void
+build_section_lists (lang_statement_union_type *statement)
{
if (statement->header.type == lang_input_section_enum
&& !statement->input_section.ifile->just_syms_flag
&& statement->input_section.section->output_section != NULL
&& statement->input_section.section->output_section->owner == output_bfd)
{
- ppc64_elf_next_input_section (&link_info,
- statement->input_section.section);
+ if (!ppc64_elf_next_input_section (&link_info,
+ statement->input_section.section))
+ einfo ("%X%P: can not size stub section: %E\n");
}
}
@@ -263,58 +311,75 @@ build_section_lists (statement)
/* Final emulation specific call. */
static void
-gld${EMULATION_NAME}_finish ()
+gld${EMULATION_NAME}_finish (void)
{
- int ret;
-
/* e_entry on PowerPC64 points to the function descriptor for
_start. If _start is missing, default to the first function
descriptor in the .opd section. */
entry_section = ".opd";
- /* If generating a relocatable output file, then we don't have any
- stubs. */
- if (link_info.relocateable)
- return;
-
- /* bfd_elf64_discard_info just plays with debugging sections,
+ /* bfd_elf_discard_info just plays with debugging sections,
ie. doesn't affect any code, so we can delay resizing the
sections. It's likely we'll resize everything in the process of
adding stubs. */
- if (bfd_elf${ELFSIZE}_discard_info (output_bfd, &link_info))
+ if (bfd_elf_discard_info (output_bfd, &link_info))
need_laying_out = 1;
- ret = ppc64_elf_setup_section_lists (output_bfd, &link_info);
- if (ret != 0)
+ /* If generating a relocatable output file, then we don't have any
+ stubs. */
+ if (stub_file != NULL && !link_info.relocatable)
{
- if (ret < 0)
+ int ret = ppc64_elf_setup_section_lists (output_bfd, &link_info);
+ if (ret != 0)
{
- einfo ("%X%P: can not size stub section: %E\n");
- return;
- }
+ if (ret < 0)
+ {
+ einfo ("%X%P: can not size stub section: %E\n");
+ return;
+ }
- lang_for_each_statement (build_section_lists);
+ toc_section = bfd_get_section_by_name (output_bfd, ".got");
+ if (toc_section != NULL)
+ lang_for_each_statement (build_toc_list);
- /* Call into the BFD backend to do the real work. */
- if (!ppc64_elf_size_stubs (output_bfd,
- stub_file->the_bfd,
- &link_info,
- group_size,
- &ppc_add_stub_section,
- &ppc_layout_sections_again))
- {
- einfo ("%X%P: can not size stub section: %E\n");
- return;
+ ppc64_elf_reinit_toc (output_bfd, &link_info);
+
+ lang_for_each_statement (build_section_lists);
+
+ /* Call into the BFD backend to do the real work. */
+ if (!ppc64_elf_size_stubs (output_bfd,
+ &link_info,
+ group_size,
+ &ppc_add_stub_section,
+ &ppc_layout_sections_again))
+ {
+ einfo ("%X%P: can not size stub section: %E\n");
+ return;
+ }
}
}
if (need_laying_out)
ppc_layout_sections_again ();
- if (stub_file->the_bfd->sections != NULL)
+ if (stub_added)
{
- if (!ppc64_elf_build_stubs (&link_info))
+ char *msg = NULL;
+ char *line, *endline;
+
+ if (!ppc64_elf_build_stubs (emit_stub_syms, &link_info,
+ config.stats ? &msg : NULL))
einfo ("%X%P: can not build stubs: %E\n");
+
+ for (line = msg; line != NULL; line = endline)
+ {
+ endline = strchr (line, '\n');
+ if (endline != NULL)
+ *endline++ = '\0';
+ fprintf (stderr, "%s: %s\n", program_name, line);
+ }
+ if (msg != NULL)
+ free (msg);
}
}
@@ -337,55 +402,24 @@ gld${EMULATION_NAME}_finish ()
exported. Lack of an exported function code sym may cause a
definition to be pulled in from a static library. */
-struct bfd_elf_version_expr *
-gld${EMULATION_NAME}_new_vers_pattern (entry)
- struct bfd_elf_version_expr *entry;
+static struct bfd_elf_version_expr *
+gld${EMULATION_NAME}_new_vers_pattern (struct bfd_elf_version_expr *entry)
{
struct bfd_elf_version_expr *dot_entry;
- struct bfd_elf_version_expr *next;
unsigned int len;
char *dot_pat;
- if (!dotsyms || entry->pattern[0] == '*')
+ if (!dotsyms || entry->pattern[0] == '*' || entry->pattern[0] == '.')
return entry;
- /* Is the script adding ".foo" explicitly? */
- if (entry->pattern[0] == '.')
- {
- /* We may have added this pattern automatically. Don't add it
- again. Quadratic behaviour here is acceptable as the list
- may be traversed for each input bfd symbol. */
- for (next = entry->next; next != NULL; next = next->next)
- {
- if (strcmp (next->pattern, entry->pattern) == 0
- && next->match == entry->match)
- {
- next = entry->next;
- free ((char *) entry->pattern);
- free (entry);
- return next;
- }
- }
- return entry;
- }
-
- /* Don't add ".foo" if the script has already done so. */
- for (next = entry->next; next != NULL; next = next->next)
- {
- if (next->pattern[0] == '.'
- && strcmp (next->pattern + 1, entry->pattern) == 0
- && next->match == entry->match)
- return entry;
- }
-
- dot_entry = (struct bfd_elf_version_expr *) xmalloc (sizeof *dot_entry);
+ dot_entry = xmalloc (sizeof *dot_entry);
+ *dot_entry = *entry;
dot_entry->next = entry;
len = strlen (entry->pattern) + 2;
dot_pat = xmalloc (len);
dot_pat[0] = '.';
memcpy (dot_pat + 1, entry->pattern, len - 1);
dot_entry->pattern = dot_pat;
- dot_entry->match = entry->match;
return dot_entry;
}
@@ -393,23 +427,16 @@ gld${EMULATION_NAME}_new_vers_pattern (entry)
/* Avoid processing the fake stub_file in vercheck, stat_needed and
check_needed routines. */
-static void ppc_for_each_input_file_wrapper
- PARAMS ((lang_input_statement_type *));
-static void ppc_lang_for_each_input_file
- PARAMS ((void (*) (lang_input_statement_type *)));
+static void (*real_func) (lang_input_statement_type *);
-static void (*real_func) PARAMS ((lang_input_statement_type *));
-
-static void ppc_for_each_input_file_wrapper (l)
- lang_input_statement_type *l;
+static void ppc_for_each_input_file_wrapper (lang_input_statement_type *l)
{
if (l != stub_file)
(*real_func) (l);
}
static void
-ppc_lang_for_each_input_file (func)
- void (*func) PARAMS ((lang_input_statement_type *));
+ppc_lang_for_each_input_file (void (*func) (lang_input_statement_type *))
{
real_func = func;
lang_for_each_input_file (&ppc_for_each_input_file_wrapper);
@@ -424,19 +451,18 @@ EOF
#
PARSE_AND_LIST_PROLOGUE='
#define OPTION_STUBGROUP_SIZE 301
-#define OPTION_DOTSYMS (OPTION_STUBGROUP_SIZE + 1)
+#define OPTION_STUBSYMS (OPTION_STUBGROUP_SIZE + 1)
+#define OPTION_DOTSYMS (OPTION_STUBSYMS + 1)
#define OPTION_NO_DOTSYMS (OPTION_DOTSYMS + 1)
+#define OPTION_NO_TLS_OPT (OPTION_NO_DOTSYMS + 1)
'
-# The options are repeated below so that no abbreviations are allowed.
-# Otherwise -s matches stub-group-size
PARSE_AND_LIST_LONGOPTS='
{ "stub-group-size", required_argument, NULL, OPTION_STUBGROUP_SIZE },
- { "stub-group-size", required_argument, NULL, OPTION_STUBGROUP_SIZE },
+ { "emit-stub-syms", no_argument, NULL, OPTION_STUBSYMS },
{ "dotsyms", no_argument, NULL, OPTION_DOTSYMS },
- { "dotsyms", no_argument, NULL, OPTION_DOTSYMS },
- { "no-dotsyms", no_argument, NULL, OPTION_NO_DOTSYMS },
{ "no-dotsyms", no_argument, NULL, OPTION_NO_DOTSYMS },
+ { "no-tls-optimize", no_argument, NULL, OPTION_NO_TLS_OPT },
'
PARSE_AND_LIST_OPTIONS='
@@ -450,6 +476,9 @@ PARSE_AND_LIST_OPTIONS='
the linker should choose suitable defaults.\n"
));
fprintf (file, _("\
+ --emit-stub-syms Label linker stubs with a symbol.\n"
+ ));
+ fprintf (file, _("\
--dotsyms For every version pattern \"foo\" in a version script,\n\
add \".foo\" so that function code symbols are\n\
treated the same as function descriptor symbols.\n\
@@ -458,6 +487,9 @@ PARSE_AND_LIST_OPTIONS='
fprintf (file, _("\
--no-dotsyms Don'\''t do anything special in version scripts.\n"
));
+ fprintf (file, _("\
+ --no-tls-optimize Don'\''t try to optimize TLS accesses.\n"
+ ));
'
PARSE_AND_LIST_ARGS_CASES='
@@ -470,22 +502,27 @@ PARSE_AND_LIST_ARGS_CASES='
}
break;
+ case OPTION_STUBSYMS:
+ emit_stub_syms = 1;
+ break;
+
case OPTION_DOTSYMS:
- {
- dotsyms = 1;
- }
+ dotsyms = 1;
break;
case OPTION_NO_DOTSYMS:
- {
- dotsyms = 0;
- }
+ dotsyms = 0;
+ break;
+
+ case OPTION_NO_TLS_OPT:
+ notlsopt = 1;
break;
'
# Put these extra ppc64elf routines in ld_${EMULATION_NAME}_emulation
#
LDEMUL_AFTER_OPEN=ppc_after_open
+LDEMUL_BEFORE_ALLOCATION=ppc_before_allocation
LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation
LDEMUL_FINISH=gld${EMULATION_NAME}_finish
LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=ppc_create_output_section_statements
diff --git a/contrib/binutils/ld/emultempl/sunos.em b/contrib/binutils/ld/emultempl/sunos.em
index 64e5ea5..358bc9a 100644
--- a/contrib/binutils/ld/emultempl/sunos.em
+++ b/contrib/binutils/ld/emultempl/sunos.em
@@ -1,6 +1,6 @@
# This shell script emits a C file. -*- C -*-
# It does some substitutions.
-if [ -z "$MACHINE" ]; then
+if [ -z "$MACHINE" ]; then
OUTPUT_ARCH=${ARCH}
else
OUTPUT_ARCH=${ARCH}:${MACHINE}
@@ -9,8 +9,8 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* SunOS emulation code for ${EMULATION_NAME}
- Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
- Free Software Foundation, Inc.
+ Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
+ 2003, 2004 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
SunOS shared library support by Ian Lance Taylor <ian@cygnus.com>
@@ -61,45 +61,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# endif
#endif
-static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
-static void gld${EMULATION_NAME}_set_symbols PARAMS ((void));
-static void gld${EMULATION_NAME}_create_output_section_statements
- PARAMS ((void));
static void gld${EMULATION_NAME}_find_so
- PARAMS ((lang_input_statement_type *));
+ (lang_input_statement_type *);
static char *gld${EMULATION_NAME}_search_dir
- PARAMS ((const char *, const char *, boolean *));
-static void gld${EMULATION_NAME}_after_open PARAMS ((void));
+ (const char *, const char *, bfd_boolean *);
static void gld${EMULATION_NAME}_check_needed
- PARAMS ((lang_input_statement_type *));
-static boolean gld${EMULATION_NAME}_search_needed
- PARAMS ((const char *, const char *));
-static boolean gld${EMULATION_NAME}_try_needed
- PARAMS ((const char *, const char *));
-static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
+ (lang_input_statement_type *);
+static bfd_boolean gld${EMULATION_NAME}_search_needed
+ (const char *, const char *);
+static bfd_boolean gld${EMULATION_NAME}_try_needed
+ (const char *, const char *);
static void gld${EMULATION_NAME}_find_assignment
- PARAMS ((lang_statement_union_type *));
-static void gld${EMULATION_NAME}_find_exp_assignment PARAMS ((etree_type *));
+ (lang_statement_union_type *);
+static void gld${EMULATION_NAME}_find_exp_assignment
+ (etree_type *);
static void gld${EMULATION_NAME}_count_need
- PARAMS ((lang_input_statement_type *));
+ (lang_input_statement_type *);
static void gld${EMULATION_NAME}_set_need
- PARAMS ((lang_input_statement_type *));
-static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
+ (lang_input_statement_type *);
static void
-gld${EMULATION_NAME}_before_parse()
+gld${EMULATION_NAME}_before_parse (void)
{
- const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
- if (arch)
- {
- ldfile_output_architecture = arch->arch;
- ldfile_output_machine = arch->mach;
- ldfile_output_machine_name = arch->printable_name;
- }
- else
- ldfile_output_architecture = bfd_arch_${ARCH};
- config.dynamic_link = true;
- config.has_shared = true;
+ ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
+ config.dynamic_link = TRUE;
+ config.has_shared = TRUE;
}
/* This is called after the command line arguments have been parsed,
@@ -108,7 +94,7 @@ gld${EMULATION_NAME}_before_parse()
list. */
static void
-gld${EMULATION_NAME}_set_symbols ()
+gld${EMULATION_NAME}_set_symbols (void)
{
EOF
if [ "x${host}" = "x${target}" ] ; then
@@ -131,7 +117,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
if (c != NULL)
*c++ = '\0';
if (*l != '\0')
- ldfile_add_library_path (l, false);
+ ldfile_add_library_path (l, FALSE);
if (c == NULL)
break;
l = c;
@@ -154,7 +140,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
search it after including the .so file. */
static void
-gld${EMULATION_NAME}_create_output_section_statements ()
+gld${EMULATION_NAME}_create_output_section_statements (void)
{
lang_for_each_input_file (gld${EMULATION_NAME}_find_so);
}
@@ -162,8 +148,7 @@ gld${EMULATION_NAME}_create_output_section_statements ()
/* Search the directory for a .so file for each library search. */
static void
-gld${EMULATION_NAME}_find_so (inp)
- lang_input_statement_type *inp;
+gld${EMULATION_NAME}_find_so (lang_input_statement_type *inp)
{
search_dirs_type *search;
char *found = NULL;
@@ -179,7 +164,7 @@ gld${EMULATION_NAME}_find_so (inp)
for (search = search_head; search != NULL; search = search->next)
{
- boolean found_static;
+ bfd_boolean found_static;
found = gld${EMULATION_NAME}_search_dir (search->name, inp->filename,
&found_static);
@@ -202,7 +187,7 @@ gld${EMULATION_NAME}_find_so (inp)
/* Turn off the search_dirs_flag to prevent ldfile_open_file from
searching for this file again. */
- inp->search_dirs_flag = false;
+ inp->search_dirs_flag = FALSE;
free (found);
@@ -234,10 +219,8 @@ gld${EMULATION_NAME}_find_so (inp)
/* Search a directory for a .so file. */
static char *
-gld${EMULATION_NAME}_search_dir (dirname, filename, found_static)
- const char *dirname;
- const char *filename;
- boolean *found_static;
+gld${EMULATION_NAME}_search_dir
+ (const char *dirname, const char *filename, bfd_boolean *found_static)
{
int force_maj, force_min;
const char *dot;
@@ -252,7 +235,7 @@ gld${EMULATION_NAME}_search_dir (dirname, filename, found_static)
int statval;
struct stat st;
- *found_static = false;
+ *found_static = FALSE;
force_maj = -1;
force_min = -1;
@@ -284,7 +267,7 @@ gld${EMULATION_NAME}_search_dir (dirname, filename, found_static)
if (dir == NULL)
return NULL;
dirnamelen = strlen (dirname);
-
+
while ((entry = readdir (dir)) != NULL)
{
const char *s;
@@ -297,14 +280,14 @@ gld${EMULATION_NAME}_search_dir (dirname, filename, found_static)
if (dot == NULL
&& strcmp (entry->d_name + 3 + len, ".a") == 0)
{
- *found_static = true;
+ *found_static = TRUE;
continue;
}
/* We accept libfoo.so without a version number, even though the
- native linker does not. This is more convenient for packages
- which just generate .so files for shared libraries, as on ELF
- systems. */
+ native linker does not. This is more convenient for packages
+ which just generate .so files for shared libraries, as on ELF
+ systems. */
if (strncmp (entry->d_name + 3 + len, ".so", 3) != 0)
continue;
if (entry->d_name[6 + len] == '\0')
@@ -373,17 +356,17 @@ gld${EMULATION_NAME}_search_dir (dirname, filename, found_static)
between after_open and check_needed. */
static struct bfd_link_needed_list *global_needed;
-static boolean global_found;
+static bfd_boolean global_found;
/* This is called after all the input files have been opened. */
static void
-gld${EMULATION_NAME}_after_open ()
+gld${EMULATION_NAME}_after_open (void)
{
struct bfd_link_needed_list *needed, *l;
/* We only need to worry about this when doing a final link. */
- if (link_info.relocateable || link_info.shared)
+ if (link_info.relocatable || link_info.shared)
return;
/* Get the list of files which appear in ld_need entries in dynamic
@@ -412,7 +395,7 @@ gld${EMULATION_NAME}_after_open ()
/* See if this file was included in the link explicitly. */
global_needed = l;
- global_found = false;
+ global_found = FALSE;
lang_for_each_input_file (gld${EMULATION_NAME}_check_needed);
if (global_found)
continue;
@@ -513,15 +496,13 @@ cat >>e${EMULATION_NAME}.c <<EOF
/* Search for a needed file in a path. */
-static boolean
-gld${EMULATION_NAME}_search_needed (path, name)
- const char *path;
- const char *name;
+static bfd_boolean
+gld${EMULATION_NAME}_search_needed (const char *path, const char *name)
{
const char *s;
if (path == NULL || *path == '\0')
- return false;
+ return FALSE;
while (1)
{
const char *dir;
@@ -542,7 +523,7 @@ gld${EMULATION_NAME}_search_needed (path, name)
}
if (gld${EMULATION_NAME}_try_needed (dir, name))
- return true;
+ return TRUE;
if (dircopy != NULL)
free (dircopy);
@@ -552,41 +533,39 @@ gld${EMULATION_NAME}_search_needed (path, name)
path = s + 1;
}
- return false;
+ return FALSE;
}
/* This function is called for each possible directory for a needed
dynamic object. */
-static boolean
-gld${EMULATION_NAME}_try_needed (dir, name)
- const char *dir;
- const char *name;
+static bfd_boolean
+gld${EMULATION_NAME}_try_needed (const char *dir, const char *name)
{
char *file;
char *alc;
- boolean ignore;
+ bfd_boolean ignore;
bfd *abfd;
file = gld${EMULATION_NAME}_search_dir (dir, name, &ignore);
if (file == NULL)
- return false;
+ return FALSE;
alc = (char *) xmalloc (strlen (dir) + strlen (file) + 2);
sprintf (alc, "%s/%s", dir, file);
free (file);
abfd = bfd_openr (alc, bfd_get_target (output_bfd));
if (abfd == NULL)
- return false;
+ return FALSE;
if (! bfd_check_format (abfd, bfd_object))
{
(void) bfd_close (abfd);
- return false;
+ return FALSE;
}
if ((bfd_get_file_flags (abfd) & DYNAMIC) == 0)
{
(void) bfd_close (abfd);
- return false;
+ return FALSE;
}
/* We've found the needed dynamic object. */
@@ -595,7 +574,7 @@ gld${EMULATION_NAME}_try_needed (dir, name)
if (! bfd_link_add_symbols (abfd, &link_info))
einfo ("%F%B: could not read symbols: %E\n", abfd);
- return true;
+ return TRUE;
}
/* See if we have already included a needed object in the link. This
@@ -603,15 +582,14 @@ gld${EMULATION_NAME}_try_needed (dir, name)
dynamic object more than once. */
static void
-gld${EMULATION_NAME}_check_needed (s)
- lang_input_statement_type *s;
+gld${EMULATION_NAME}_check_needed (lang_input_statement_type *s)
{
if (s->filename == NULL)
return;
if (strncmp (global_needed->name, "-l", 2) != 0)
{
if (strcmp (s->filename, global_needed->name) == 0)
- global_found = true;
+ global_found = TRUE;
}
else
{
@@ -651,7 +629,7 @@ gld${EMULATION_NAME}_check_needed (s)
|| (smin != lmin && smin != -1 && lmin != -1))
return;
- global_found = true;
+ global_found = TRUE;
}
}
@@ -659,7 +637,7 @@ gld${EMULATION_NAME}_check_needed (s)
to lang_for_each_statement. Ick. */
static const char *find_assign;
-static boolean found_assign;
+static bfd_boolean found_assign;
/* We need to use static variables to pass information around the call
to lang_for_each_input_file. Ick. */
@@ -679,7 +657,7 @@ static bfd_byte *need_pnames;
sections, but before any sizes or addresses have been set. */
static void
-gld${EMULATION_NAME}_before_allocation ()
+gld${EMULATION_NAME}_before_allocation (void)
{
struct bfd_link_hash_entry *hdyn = NULL;
asection *sneed;
@@ -689,11 +667,11 @@ gld${EMULATION_NAME}_before_allocation ()
/* The SunOS native linker creates a shared library whenever there
are any undefined symbols in a link, unless -e is used. This is
pretty weird, but we are compatible. */
- if (! link_info.shared && ! link_info.relocateable && ! entry_from_cmdline)
+ if (! link_info.shared && ! link_info.relocatable && ! entry_from_cmdline)
{
struct bfd_link_hash_entry *h;
-
- for (h = link_info.hash->undefs; h != NULL; h = h->next)
+
+ for (h = link_info.hash->undefs; h != NULL; h = h->und_next)
{
if (h->type == bfd_link_hash_undefined
&& h->u.undef.abfd != NULL
@@ -702,11 +680,11 @@ gld${EMULATION_NAME}_before_allocation ()
&& strcmp (h->root.string, "__GLOBAL_OFFSET_TABLE_") != 0)
{
find_assign = h->root.string;
- found_assign = false;
+ found_assign = FALSE;
lang_for_each_statement (gld${EMULATION_NAME}_find_assignment);
if (! found_assign)
{
- link_info.shared = true;
+ link_info.shared = TRUE;
break;
}
}
@@ -718,7 +696,7 @@ gld${EMULATION_NAME}_before_allocation ()
lang_output_section_statement_type *os;
/* Set the .text section to start at 0x20, not 0x2020. FIXME:
- This is too magical. */
+ This is too magical. */
os = lang_output_section_statement_lookup (".text");
if (os->addr_tree == NULL)
os->addr_tree = exp_intop (0x20);
@@ -730,10 +708,10 @@ gld${EMULATION_NAME}_before_allocation ()
one. We need to create the symbol before calling
size_dynamic_sections, although we can't set the value until
afterward. */
- if (! link_info.relocateable)
+ if (! link_info.relocatable)
{
- hdyn = bfd_link_hash_lookup (link_info.hash, "__DYNAMIC", true, false,
- false);
+ hdyn = bfd_link_hash_lookup (link_info.hash, "__DYNAMIC", TRUE, FALSE,
+ FALSE);
if (hdyn == NULL)
einfo ("%P%F: bfd_link_hash_lookup: %E\n");
if (! bfd_sunos_record_link_assignment (output_bfd, &link_info,
@@ -823,7 +801,7 @@ gld${EMULATION_NAME}_before_allocation ()
/* We must assign a value to __DYNAMIC. It should be zero if we are
not doing a dynamic link, or the start of the .dynamic section if
we are doing one. */
- if (! link_info.relocateable)
+ if (! link_info.relocatable)
{
hdyn->type = bfd_link_hash_defined;
hdyn->u.def.value = 0;
@@ -842,8 +820,7 @@ gld${EMULATION_NAME}_before_allocation ()
symbols which are referred to by dynamic objects. */
static void
-gld${EMULATION_NAME}_find_assignment (s)
- lang_statement_union_type *s;
+gld${EMULATION_NAME}_find_assignment (lang_statement_union_type *s)
{
if (s->header.type == lang_assignment_statement_enum
&& (find_assign == NULL || ! found_assign))
@@ -853,8 +830,7 @@ gld${EMULATION_NAME}_find_assignment (s)
/* Look through an expression for an assignment statement. */
static void
-gld${EMULATION_NAME}_find_exp_assignment (exp)
- etree_type *exp;
+gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
{
switch (exp->type.node_class)
{
@@ -862,7 +838,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp)
if (find_assign != NULL)
{
if (strcmp (find_assign, exp->assign.dst) == 0)
- found_assign = true;
+ found_assign = TRUE;
return;
}
@@ -902,8 +878,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp)
for more information. */
static void
-gld${EMULATION_NAME}_count_need (inp)
- lang_input_statement_type *inp;
+gld${EMULATION_NAME}_count_need (lang_input_statement_type *inp)
{
if (inp->the_bfd != NULL
&& (inp->the_bfd->flags & DYNAMIC) != 0)
@@ -924,8 +899,7 @@ gld${EMULATION_NAME}_count_need (inp)
/* Fill in the contents of the .need section. */
static void
-gld${EMULATION_NAME}_set_need (inp)
- lang_input_statement_type *inp;
+gld${EMULATION_NAME}_set_need (lang_input_statement_type *inp)
{
if (inp->the_bfd != NULL
&& (inp->the_bfd->flags & DYNAMIC) != 0)
@@ -974,8 +948,7 @@ gld${EMULATION_NAME}_set_need (inp)
}
static char *
-gld${EMULATION_NAME}_get_script(isfile)
- int *isfile;
+gld${EMULATION_NAME}_get_script (int *isfile)
EOF
if test -n "$COMPILE_IN"
@@ -986,14 +959,14 @@ then
sc="-f stringify.sed"
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 0;
- if (link_info.relocateable == true && config.build_constructors == true)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
@@ -1007,12 +980,12 @@ else
# Scripts read from the filesystem.
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 1;
- if (link_info.relocateable == true && config.build_constructors == true)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable == true)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
@@ -1027,7 +1000,7 @@ fi
cat >>e${EMULATION_NAME}.c <<EOF
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
{
gld${EMULATION_NAME}_before_parse,
syslib_default,
@@ -1047,6 +1020,8 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
NULL, /* place orphan */
gld${EMULATION_NAME}_set_symbols,
NULL, /* parse args */
+ NULL, /* add_options */
+ NULL, /* handle_option */
NULL, /* unrecognized file */
NULL, /* list options */
NULL, /* recognized file */
diff --git a/contrib/binutils/ld/emultempl/ticoff.em b/contrib/binutils/ld/emultempl/ticoff.em
index eb10317..8f86b04 100644
--- a/contrib/binutils/ld/emultempl/ticoff.em
+++ b/contrib/binutils/ld/emultempl/ticoff.em
@@ -3,7 +3,7 @@
(echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
cat >>e${EMULATION_NAME}.c <<EOF
/* This file is part of GLD, the Gnu Linker.
- Copyright 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,110 +20,87 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* For TI COFF */
-/* Need to determine load and run pages for output sections */
-
+/* Need to determine load and run pages for output sections */
+
#define TARGET_IS_${EMULATION_NAME}
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"
+#include "getopt.h"
#include "ld.h"
#include "ldmain.h"
#include "ldmisc.h"
-
#include "ldexp.h"
#include "ldlang.h"
#include "ldfile.h"
#include "ldemul.h"
-#include "getopt.h"
-
static int coff_version;
-static void gld_${EMULATION_NAME}_before_parse PARAMS ((void));
-static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *));
-static int gld_${EMULATION_NAME}_parse_args PARAMS ((int, char **));
-static void gld_${EMULATION_NAME}_list_options PARAMS ((FILE *));
-
/* TI COFF extra command line options */
#define OPTION_COFF_FORMAT (300 + 1)
-static struct option longopts[] =
+static void
+gld${EMULATION_NAME}_add_options
+ (int ns ATTRIBUTE_UNUSED, char **shortopts ATTRIBUTE_UNUSED, int nl,
+ struct option **longopts, int nrl ATTRIBUTE_UNUSED,
+ struct option **really_longopts ATTRIBUTE_UNUSED)
{
- /* TI COFF options */
- {"format", required_argument, NULL, OPTION_COFF_FORMAT },
- {NULL, no_argument, NULL, 0}
-};
+ static const struct option xtra_long[] = {
+ /* TI COFF options */
+ {"format", required_argument, NULL, OPTION_COFF_FORMAT },
+ {NULL, no_argument, NULL, 0}
+ };
+
+ *longopts = (struct option *)
+ xrealloc (*longopts, nl * sizeof (struct option) + sizeof (xtra_long));
+ memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long));
+}
static void
-gld_${EMULATION_NAME}_list_options (file)
- FILE * file;
+gld_${EMULATION_NAME}_list_options (FILE * file)
{
- fprintf (file, _(" --format 0|1|2 Specify which COFF version to use"));
-}
+ fprintf (file, _(" --format 0|1|2 Specify which COFF version to use\n"));
+}
-static int
-gld_${EMULATION_NAME}_parse_args(argc, argv)
- int argc;
- char **argv;
+static bfd_boolean
+gld${EMULATION_NAME}_handle_option (int optc)
{
- int longind;
- int optc;
- int prevoptind = optind;
- int prevopterr = opterr;
- int wanterror;
- static int lastoptind = -1;
-
- if (lastoptind != optind)
- opterr = 0;
- wanterror = opterr;
-
- lastoptind = optind;
-
- optc = getopt_long_only (argc, argv, "-", longopts, &longind);
- opterr = prevopterr;
-
switch (optc)
{
default:
- if (wanterror)
- xexit (1);
- optind = prevoptind;
- return 0;
+ return FALSE;
case OPTION_COFF_FORMAT:
if ((*optarg == '0' || *optarg == '1' || *optarg == '2')
&& optarg[1] == '\0')
{
- extern void lang_add_output_format
- PARAMS ((const char *, const char *, const char *, int));
static char buf[] = "coffX-${OUTPUT_FORMAT_TEMPLATE}";
coff_version = *optarg - '0';
buf[4] = *optarg;
- lang_add_output_format (buf, NULL, NULL, 0);
+ lang_add_output_format (buf, NULL, NULL, 0);
}
else
{
einfo (_("%P%F: invalid COFF format version %s\n"), optarg);
-
}
break;
}
- return 1;
+ return FALSE;
}
static void
-gld_${EMULATION_NAME}_before_parse()
+gld_${EMULATION_NAME}_before_parse(void)
{
#ifndef TARGET_ /* I.e., if not generic. */
- ldfile_set_output_arch ("`echo ${ARCH}`");
+ ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
#endif /* not TARGET_ */
}
static char *
-gld_${EMULATION_NAME}_get_script (isfile)
- int *isfile;
+gld_${EMULATION_NAME}_get_script (int *isfile)
EOF
if test -n "$COMPILE_IN"
then
@@ -136,11 +113,11 @@ s/$/\\n\\/
$s/$/n"/
'
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 0;
- if (link_info.relocateable == true && config.build_constructors == true)
+ if (link_info.relocatable && config.build_constructors)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`;
- else if (link_info.relocateable == true)
+ else if (link_info.relocatable)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xr`;
else if (!config.text_read_only)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xbn`;
@@ -155,12 +132,12 @@ else
# Scripts read from the filesystem.
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 1;
- if (link_info.relocateable == true && config.build_constructors == true)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable == true)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
@@ -174,7 +151,7 @@ EOF
fi
cat >>e${EMULATION_NAME}.c <<EOF
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
{
gld_${EMULATION_NAME}_before_parse,
syslib_default,
@@ -193,7 +170,9 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
NULL, /* open dynamic archive */
NULL, /* place orphan */
NULL, /* set_symbols */
- gld_${EMULATION_NAME}_parse_args,
+ NULL, /* parse_args */
+ gld${EMULATION_NAME}_add_options,
+ gld${EMULATION_NAME}_handle_option,
NULL, /* unrecognized_file */
gld_${EMULATION_NAME}_list_options,
NULL, /* recognized file */
diff --git a/contrib/binutils/ld/emultempl/vanilla.em b/contrib/binutils/ld/emultempl/vanilla.em
index 4c38207..2141083 100644
--- a/contrib/binutils/ld/emultempl/vanilla.em
+++ b/contrib/binutils/ld/emultempl/vanilla.em
@@ -2,7 +2,8 @@
# It does some substitutions.
cat >e${EMULATION_NAME}.c <<EOF
/* A vanilla emulation with no defaults
- Copyright 1991, 1992, 1994, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1994, 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
This file is part of GLD, the Gnu Linker.
@@ -34,17 +35,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ldfile.h"
#include "ldemul.h"
-static void vanilla_before_parse PARAMS ((void));
-static void vanilla_set_output_arch PARAMS ((void));
-static char *vanilla_get_script PARAMS ((int *));
-
-
-static void vanilla_before_parse()
+static void vanilla_before_parse (void)
{
}
static void
-vanilla_set_output_arch()
+vanilla_set_output_arch (void)
{
/* Set the output architecture and machine if possible */
unsigned long machine = 0;
@@ -52,14 +48,13 @@ vanilla_set_output_arch()
}
static char *
-vanilla_get_script(isfile)
- int *isfile;
+vanilla_get_script (int *isfile)
{
*isfile = 0;
return "";
}
-struct ld_emulation_xfer_struct ld_vanilla_emulation =
+struct ld_emulation_xfer_struct ld_vanilla_emulation =
{
vanilla_before_parse,
syslib_default,
@@ -79,6 +74,8 @@ struct ld_emulation_xfer_struct ld_vanilla_emulation =
NULL, /* place orphan */
NULL, /* set symbols */
NULL, /* parse args */
+ NULL, /* add_options */
+ NULL, /* handle_option */
NULL, /* unrecognized file */
NULL, /* list options */
NULL, /* recognized file */
diff --git a/contrib/binutils/ld/fdl.texi b/contrib/binutils/ld/fdl.texi
new file mode 100644
index 0000000..c6409a3
--- /dev/null
+++ b/contrib/binutils/ld/fdl.texi
@@ -0,0 +1,367 @@
+@c -*-texinfo-*-
+@node GNU Free Documentation License
+@appendix GNU Free Documentation License
+@center Version 1.1, March 2000
+
+@display
+Copyright (C) 2000, Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@end display
+@sp 1
+@enumerate 0
+@item
+PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+written document ``free'' in the sense of freedom: to assure everyone
+the effective freedom to copy and redistribute it, with or without
+modifying it, either commercially or noncommercially. Secondarily,
+this License preserves for the author and publisher a way to get
+credit for their work, while not being considered responsible for
+modifications made by others.
+
+This License is a kind of ``copyleft'', which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+@sp 1
+@item
+APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work that contains a
+notice placed by the copyright holder saying it can be distributed
+under the terms of this License. The ``Document'', below, refers to any
+such manual or work. Any member of the public is a licensee, and is
+addressed as ``you.''
+
+A ``Modified Version'' of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A ``Secondary Section'' is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject. (For example, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The ``Invariant Sections'' are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.
+
+The ``Cover Texts'' are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.
+
+A ``Transparent'' copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, whose contents can be viewed and edited directly and
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup has been designed to thwart or discourage
+subsequent modification by readers is not Transparent. A copy that is
+not ``Transparent'' is called ``Opaque.''
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML designed for human modification. Opaque formats include
+PostScript, PDF, proprietary formats that can be read and edited only
+by proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML produced by some word processors for output
+purposes only.
+
+The ``Title Page'' means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, ``Title Page'' means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+@sp 1
+@item
+VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+@sp 1
+@item
+COPYING IN QUANTITY
+
+If you publish printed copies of the Document numbering more than 100,
+and the Document's license notice requires Cover Texts, you must enclose
+the copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a publicly-accessible computer-network location containing a complete
+Transparent copy of the Document, free of added material, which the
+general network-using public has access to download anonymously at no
+charge using public-standard network protocols. If you use the latter
+option, you must take reasonably prudent steps, when you begin
+distribution of Opaque copies in quantity, to ensure that this
+Transparent copy will remain thus accessible at the stated location
+until at least one year after the last time you distribute an Opaque
+copy (directly or through your agents or retailers) of that edition to
+the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+@sp 1
+@item
+MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+ from that of the Document, and from those of previous versions
+ (which should, if there were any, be listed in the History section
+ of the Document). You may use the same title as a previous version
+ if the original publisher of that version gives permission.@*
+B. List on the Title Page, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the Modified
+ Version, together with at least five of the principal authors of the
+ Document (all of its principal authors, if it has less than five).@*
+C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.@*
+D. Preserve all the copyright notices of the Document.@*
+E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.@*
+F. Include, immediately after the copyright notices, a license notice
+ giving the public permission to use the Modified Version under the
+ terms of this License, in the form shown in the Addendum below.@*
+G. Preserve in that license notice the full lists of Invariant Sections
+ and required Cover Texts given in the Document's license notice.@*
+H. Include an unaltered copy of this License.@*
+I. Preserve the section entitled ``History'', and its title, and add to
+ it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page. If
+ there is no section entitled ``History'' in the Document, create one
+ stating the title, year, authors, and publisher of the Document as
+ given on its Title Page, then add an item describing the Modified
+ Version as stated in the previous sentence.@*
+J. Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and likewise
+ the network locations given in the Document for previous versions
+ it was based on. These may be placed in the ``History'' section.
+ You may omit a network location for a work that was published at
+ least four years before the Document itself, or if the original
+ publisher of the version it refers to gives permission.@*
+K. In any section entitled ``Acknowledgements'' or ``Dedications'',
+ preserve the section's title, and preserve in the section all the
+ substance and tone of each of the contributor acknowledgements
+ and/or dedications given therein.@*
+L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section titles.@*
+M. Delete any section entitled ``Endorsements.'' Such a section
+ may not be included in the Modified Version.@*
+N. Do not retitle any existing section as ``Endorsements''
+ or to conflict in title with any Invariant Section.@*
+@sp 1
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section entitled ``Endorsements'', provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+@sp 1
+@item
+COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections entitled ``History''
+in the various original documents, forming one section entitled
+``History''; likewise combine any sections entitled ``Acknowledgements'',
+and any sections entitled ``Dedications.'' You must delete all sections
+entitled ``Endorsements.''
+@sp 1
+@item
+COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+@sp 1
+@item
+AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, does not as a whole count as a Modified Version
+of the Document, provided no compilation copyright is claimed for the
+compilation. Such a compilation is called an ``aggregate'', and this
+License does not apply to the other self-contained works thus compiled
+with the Document, on account of their being thus compiled, if they
+are not themselves derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one quarter
+of the entire aggregate, the Document's Cover Texts may be placed on
+covers that surround only the Document within the aggregate.
+Otherwise they must appear on covers around the whole aggregate.
+@sp 1
+@item
+TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License provided that you also include the
+original English version of this License. In case of a disagreement
+between the translation and the original English version of this
+License, the original English version will prevail.
+@sp 1
+@item
+TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License. Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License. However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+@sp 1
+@item
+FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License ``or any later version'' applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+
+@end enumerate
+
+@unnumberedsec ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+@smallexample
+@group
+Copyright (C) @var{year} @var{your name}.
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1
+or any later version published by the Free Software Foundation;
+with the Invariant Sections being @var{list their titles}, with the
+Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
+A copy of the license is included in the section entitled "GNU
+Free Documentation License."
+@end group
+@end smallexample
+
+If you have no Invariant Sections, write ``with no Invariant Sections''
+instead of saying which ones are invariant. If you have no
+Front-Cover Texts, write ``no Front-Cover Texts'' instead of
+``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
diff --git a/contrib/binutils/ld/gen-doc.texi b/contrib/binutils/ld/gen-doc.texi
index c0ebac7..5add195 100644
--- a/contrib/binutils/ld/gen-doc.texi
+++ b/contrib/binutils/ld/gen-doc.texi
@@ -5,8 +5,13 @@
@c 2. Specific target machines
@set H8300
@set I960
+@set ARM
+@set HPPA
@set MMIX
+@set MSP430
@set TICOFF
+@set WIN32
+@set XTENSA
@c 3. Properties of this configuration
@clear SingleFormat
diff --git a/contrib/binutils/ld/genscripts.sh b/contrib/binutils/ld/genscripts.sh
index 36e0a9d..0168203 100755
--- a/contrib/binutils/ld/genscripts.sh
+++ b/contrib/binutils/ld/genscripts.sh
@@ -1,15 +1,61 @@
#!/bin/sh
# genscripts.sh - generate the ld-emulation-target specific files
#
-# Usage: genscripts.sh srcdir libdir exec_prefix \
-# host target target_alias default_emulation \
-# native_lib_dirs this_emulation tool_dir
+# Usage: genscripts_extra.sh \
+# srcdir \
+# libdir \
+# exec_prefix \
+# host \
+# target \
+# target_alias \
+# default_emulation \
+# native_lib_dirs \
+# use_sysroot \
+# this_emulation \
+# optional:
+# tool_dir \
+# customizer_script
#
# Sample usage:
-# genscripts.sh /djm/ld-devo/devo/ld /usr/local/lib /usr/local \
-# sparc-sun-sunos4.1.3 sparc-sun-sunos4.1.3 sparc-sun-sunos4.1.3 sun4 \
-# "" sun3 sparc-sun-sunos4.1.3
-# produces sun3.x sun3.xbn sun3.xn sun3.xr sun3.xu em_sun3.c
+#
+# genscripts_extra.sh \
+# /sources/ld \
+# /usr/local/lib \
+# /usr/local \
+# sparc-sun-sunos4.1.3 \
+# sparc-sun-sunos4.1.3 \
+# sparc-sun-sunos4.1.3 \
+# sun4 \
+# "" \
+# no \
+# sun3 \
+# sparc-sun-sunos4.1.3 \
+# sparc.sh
+#
+# produces the linker scripts:
+#
+# sun3.x [default linker script]
+# sun3.xbn [used when the linker is invoked with "-N"]
+# sun3.xn [used when the linker is invoked with "-n"]
+# sun3.xr [used when the linker is invoked with "-r"]
+# sun3.xu [used when the linker is invoked with "-Ur"]
+# and maybe:
+# sun3.xc [used when the linker is invoked with "-z combreloc"]
+# sun3.xsc [used when the linker is invoked with "--shared"]
+# sun3.xdc [used when the linker is invoked with "-pie"]
+#
+# It also produced the C source file:
+#
+# em_sun3.c
+#
+# which is then compiled into the linker.
+#
+# The linker scripts are created by running the shell script
+# /sources/ld/emulparams/sparc.sh to set the value of ${SCRIPT_NAME}
+# (and any other variables it wants to). ${SCRIPT_NAME} is then
+# invoked with a variable called ${LD_FLAG} to tell it which version
+# of the linker script to create.
+
srcdir=$1
libdir=$2
@@ -19,17 +65,26 @@ target=$5
target_alias=$6
EMULATION_LIBPATH=$7
NATIVE_LIB_DIRS=$8
-EMULATION_NAME=$9
+use_sysroot=$9
shift 9
-# Can't use ${1:-$target_alias} here due to an Ultrix shell bug.
-if [ "x$1" = "x" ] ; then
+EMULATION_NAME=$1
+TOOL_LIB=$2
+CUSTOMIZER_SCRIPT=$3
+
+# Can't use ${TOOL_LIB:-$target_alias} here due to an Ultrix shell bug.
+if [ "x${TOOL_LIB}" = "x" ] ; then
tool_lib=${exec_prefix}/${target_alias}/lib
else
- tool_lib=${exec_prefix}/$1/lib
+ tool_lib=${exec_prefix}/${TOOL_LIB}/lib
+fi
+
+if [ "x${CUSTOMIZER_SCRIPT}" = "x" ] ; then
+ CUSTOMIZER_SCRIPT=${EMULATION_NAME}
fi
+CUSTOMIZER_SCRIPT="${srcdir}/emulparams/${CUSTOMIZER_SCRIPT}.sh"
# Include the emulation-specific parameters:
-. ${srcdir}/emulparams/${EMULATION_NAME}.sh
+. ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
if test -d ldscripts; then
true
@@ -37,34 +92,113 @@ else
mkdir ldscripts
fi
+# Set some flags for the emultempl scripts. USE_LIBPATH will
+# be set for any libpath-using emulation; NATIVE will be set for a
+# libpath-using emulation where ${host} = ${target}. NATIVE
+# may already have been set by the emulparams file, but that's OK
+# (it'll just get set to "yes" twice).
+
+case " $EMULATION_LIBPATH " in
+ *" ${EMULATION_NAME} "*)
+ if [ "x${host}" = "x${target}" ] ; then
+ NATIVE=yes
+ USE_LIBPATH=yes
+ elif [ "x${use_sysroot}" = "xyes" ] ; then
+ USE_LIBPATH=yes
+ fi
+ ;;
+esac
+
+# If the emulparams file sets NATIVE, make sure USE_LIBPATH is set also.
+if test "x$NATIVE" = "xyes" ; then
+ USE_LIBPATH=yes
+fi
+
# Set the library search path, for libraries named by -lfoo.
# If LIB_PATH is defined (e.g., by Makefile) and non-empty, it is used.
# Otherwise, the default is set here.
#
# The format is the usual list of colon-separated directories.
# To force a logically empty LIB_PATH, do LIBPATH=":".
+#
+# If we are using a sysroot, prefix library paths with "=" to indicate this.
+#
+# If the emulparams file set LIBPATH_SUFFIX, prepend an extra copy of
+# the library path with the suffix applied.
-if [ "x${LIB_PATH}" = "x" ] ; then
- if [ "x${host}" = "x${target}" ] ; then
- case " $EMULATION_LIBPATH " in
- *" ${EMULATION_NAME} "*)
- # Native, and default or emulation requesting LIB_PATH.
- LIB_PATH=${libdir}
- for lib in ${NATIVE_LIB_DIRS}; do
- case :${LIB_PATH}: in
- *:${lib}:*) ;;
- *) LIB_PATH=${LIB_PATH}:${lib} ;;
- esac
- done
+if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then
+ LIB_PATH2=
+
+ libs=${NATIVE_LIB_DIRS}
+ if [ "x${use_sysroot}" != "xyes" ] ; then
+ case " ${libs} " in
+ *" ${libdir} "*) ;;
+ *) libs="${libdir} ${libs}" ;;
+ esac
+ case " ${libs} " in
+ *" ${tool_lib} "*) ;;
+ *) libs="${tool_lib} ${libs}" ;;
esac
fi
+
+ for lib in ${libs}; do
+ # The "=" is harmless if we aren't using a sysroot, but also needless.
+ if [ "x${use_sysroot}" = "xyes" ] ; then
+ lib="=${lib}"
+ fi
+ addsuffix=
+ case "${LIBPATH_SUFFIX}:${lib}" in
+ :*) ;;
+ *:*${LIBPATH_SUFFIX}) ;;
+ *) addsuffix=yes ;;
+ esac
+ if test -n "$addsuffix"; then
+ case :${LIB_PATH}: in
+ *:${lib}${LIBPATH_SUFFIX}:*) ;;
+ ::) LIB_PATH=${lib}${LIBPATH_SUFFIX} ;;
+ *) LIB_PATH=${LIB_PATH}:${lib}${LIBPATH_SUFFIX} ;;
+ esac
+ case :${LIB_PATH}:${LIB_PATH2}: in
+ *:${lib}:*) ;;
+ *::) LIB_PATH2=${lib} ;;
+ *) LIB_PATH2=${LIB_PATH2}:${lib} ;;
+ esac
+ else
+ case :${LIB_PATH2}: in
+ *:${lib}:*) ;;
+ ::) LIB_PATH2=${lib} ;;
+ *) LIB_PATH2=${LIB_PATH2}:${lib} ;;
+ esac
+ fi
+ done
+
+ case :${LIB_PATH}:${LIB_PATH2}: in
+ *:: | ::*) LIB_PATH=${LIB_PATH}${LIB_PATH2} ;;
+ *) LIB_PATH=${LIB_PATH}:${LIB_PATH2} ;;
+ esac
fi
-# Always search $(tooldir)/lib, aka /usr/local/TARGET/lib.
-LIB_PATH=${tool_lib}:${LIB_PATH}
+# Always search $(tooldir)/lib, aka /usr/local/TARGET/lib, except for
+# sysrooted configurations and when LIBPATH=":".
+if [ "x${use_sysroot}" != "xyes" ] ; then
+ case :${LIB_PATH}: in
+ ::: | *:${tool_lib}:*) ;;
+ ::) LIB_PATH=${tool_lib} ;;
+ *) LIB_PATH=${tool_lib}:${LIB_PATH} ;;
+ esac
+fi
LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'`
+# We need it for testsuite.
+case " $EMULATION_LIBPATH " in
+ *" ${EMULATION_NAME} "*)
+ test -d tmpdir || mkdir tmpdir
+ test -f tmpdir/libpath.exp || \
+ echo "set libpath \"${LIB_PATH}\"" | sed -e 's/:/ /g' > tmpdir/libpath.exp
+ ;;
+esac
+
# Generate 5 or 6 script files from a master script template in
# ${srcdir}/scripttempl/${SCRIPT_NAME}.sh. Which one of the 5 or 6
# script files is actually used depends on command line options given
@@ -90,10 +224,10 @@ if [ "x$SCRIPT_NAME" = "xelf" ]; then
GENERATE_COMBRELOC_SCRIPT=yes
fi
-SEGMENT_SIZE=${SEGMENT_SIZE-${TARGET_PAGE_SIZE}}
+SEGMENT_SIZE=${SEGMENT_SIZE-${MAXPAGESIZE-${TARGET_PAGE_SIZE}}}
# Determine DATA_ALIGNMENT for the 5 variants, using
-# values specified in the emulparams/<emulation>.sh file or default.
+# values specified in the emulparams/<script_to_run>.sh file or default.
DATA_ALIGNMENT_="${DATA_ALIGNMENT_-${DATA_ALIGNMENT-ALIGN(${SEGMENT_SIZE})}}"
DATA_ALIGNMENT_n="${DATA_ALIGNMENT_n-${DATA_ALIGNMENT_}}"
@@ -105,7 +239,7 @@ LD_FLAG=r
DATA_ALIGNMENT=${DATA_ALIGNMENT_r}
DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})"
( echo "/* Script for ld -r: link without relocation */"
- . ${srcdir}/emulparams/${EMULATION_NAME}.sh
+ . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xr
@@ -113,7 +247,7 @@ LD_FLAG=u
DATA_ALIGNMENT=${DATA_ALIGNMENT_u}
CONSTRUCTING=" "
( echo "/* Script for ld -Ur: link w/out relocation, do create constructors */"
- . ${srcdir}/emulparams/${EMULATION_NAME}.sh
+ . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xu
@@ -121,7 +255,7 @@ LD_FLAG=
DATA_ALIGNMENT=${DATA_ALIGNMENT_}
RELOCATING=" "
( echo "/* Default linker script, for normal executables */"
- . ${srcdir}/emulparams/${EMULATION_NAME}.sh
+ . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.x
@@ -129,14 +263,14 @@ LD_FLAG=n
DATA_ALIGNMENT=${DATA_ALIGNMENT_n}
TEXT_START_ADDR=${NONPAGED_TEXT_START_ADDR-${TEXT_START_ADDR}}
( echo "/* Script for -n: mix text and data on same page */"
- . ${srcdir}/emulparams/${EMULATION_NAME}.sh
+ . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xn
LD_FLAG=N
DATA_ALIGNMENT=${DATA_ALIGNMENT_N}
( echo "/* Script for -N: mix text and data on same page; don't align data */"
- . ${srcdir}/emulparams/${EMULATION_NAME}.sh
+ . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xbn
@@ -145,7 +279,7 @@ if test -n "$GENERATE_COMBRELOC_SCRIPT"; then
LD_FLAG=c
COMBRELOC=ldscripts/${EMULATION_NAME}.xc.tmp
( echo "/* Script for -z combreloc: combine and sort reloc sections */"
- . ${srcdir}/emulparams/${EMULATION_NAME}.sh
+ . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xc
rm -f ${COMBRELOC}
@@ -159,7 +293,7 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then
# Note that TEXT_START_ADDR is set to NONPAGED_TEXT_START_ADDR.
(
echo "/* Script for ld --shared: link shared library */"
- . ${srcdir}/emulparams/${EMULATION_NAME}.sh
+ . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xs
if test -n "$GENERATE_COMBRELOC_SCRIPT"; then
@@ -167,12 +301,37 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then
DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}}
COMBRELOC=ldscripts/${EMULATION_NAME}.xc.tmp
( echo "/* Script for --shared -z combreloc: shared library, combine & sort relocs */"
- . ${srcdir}/emulparams/${EMULATION_NAME}.sh
+ . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsc
rm -f ${COMBRELOC}
COMBRELOC=
fi
+ unset CREATE_SHLIB
+fi
+
+if test -n "$GENERATE_PIE_SCRIPT"; then
+ LD_FLAG=pie
+ DATA_ALIGNMENT=${DATA_ALIGNMENT_s-${DATA_ALIGNMENT_}}
+ CREATE_PIE=" "
+ # Note that TEXT_START_ADDR is set to NONPAGED_TEXT_START_ADDR.
+ (
+ echo "/* Script for ld -pie: link position independent executable */"
+ . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xd
+ if test -n "$GENERATE_COMBRELOC_SCRIPT"; then
+ LD_FLAG=cpie
+ DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}}
+ COMBRELOC=ldscripts/${EMULATION_NAME}.xc.tmp
+ ( echo "/* Script for -pie -z combreloc: position independent executable, combine & sort relocs */"
+ . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdc
+ rm -f ${COMBRELOC}
+ COMBRELOC=
+ fi
+ unset CREATE_PIE
fi
case " $EMULATION_LIBPATH " in
diff --git a/contrib/binutils/ld/h8-doc.texi b/contrib/binutils/ld/h8-doc.texi
index f3c62a1..bbb1fd9 100644
--- a/contrib/binutils/ld/h8-doc.texi
+++ b/contrib/binutils/ld/h8-doc.texi
@@ -4,7 +4,7 @@
@c 2. Specific target machines
@set H8300
-@set Hitachi
+@set Renesas
@clear I960
@c 3. Properties of this configuration
diff --git a/contrib/binutils/ld/ld.1 b/contrib/binutils/ld/ld.1
index 9d7a53e..87ee202 100644
--- a/contrib/binutils/ld/ld.1
+++ b/contrib/binutils/ld/ld.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
+.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -128,7 +128,7 @@
.\" ========================================================================
.\"
.IX Title "LD 1"
-.TH LD 1 "2002-10-30" "binutils-2.13" "GNU Development Tools"
+.TH LD 1 "2004-05-17" "binutils-2.15" "GNU Development Tools"
.SH "NAME"
ld \- Using LD, the GNU linker
.SH "SYNOPSIS"
@@ -202,7 +202,7 @@ and the script command language. If \fIno\fR binary input files at all
are specified, the linker does not produce any output, and issues the
message \fBNo input files\fR.
.PP
-If the linker can not recognize the format of an object file, it will
+If the linker cannot recognize the format of an object file, it will
assume that it is a linker script. A script specified in this way
augments the main linker script used for the link (either the default
linker script or the one specified by using \fB\-T\fR). This feature
@@ -219,7 +219,7 @@ option that requires them.
.PP
For options whose names are multiple letters, either one dash or two can
precede the option name; for example, \fB\-trace\-symbol\fR and
-\&\fB\-\-trace\-symbol\fR are equivalent. Note \- there is one exception to
+\&\fB\-\-trace\-symbol\fR are equivalent. Note\-\-\-there is one exception to
this rule. Multiple letter options that start with a lower case 'o' can
only be preceeded by two dashes. This is to reduce confusion with the
\&\fB\-o\fR option. So for example \fB\-omagic\fR sets the output file
@@ -233,8 +233,8 @@ immediately following the option that requires them. For example,
Unique abbreviations of the names of multiple-letter options are
accepted.
.PP
-Note \- if the linker is being invoked indirectly, via a compiler driver
-(eg \fBgcc\fR) then all the linker command line options should be
+Note\-\-\-if the linker is being invoked indirectly, via a compiler driver
+(e.g. \fBgcc\fR) then all the linker command line options should be
prefixed by \fB\-Wl,\fR (or whatever is appropriate for the particular
compiler driver) like this:
.PP
@@ -406,11 +406,13 @@ used to select a subset of the symbols provided by the object
.Sp
Some older linkers used the \fB\-F\fR option throughout a compilation
toolchain for specifying object-file format for both input and output
-object files. The \s-1GNU\s0 linker uses other mechanisms for this
-purpose: the \fB\-b\fR, \fB\-\-format\fR, \fB\-\-oformat\fR options, the
+object files.
+The \s-1GNU\s0 linker uses other mechanisms for this purpose: the
+\&\fB\-b\fR, \fB\-\-format\fR, \fB\-\-oformat\fR options, the
\&\f(CW\*(C`TARGET\*(C'\fR command in linker scripts, and the \f(CW\*(C`GNUTARGET\*(C'\fR
-environment variable. The \s-1GNU\s0 linker will ignore the \fB\-F\fR
-option when not creating an \s-1ELF\s0 shared object.
+environment variable.
+The \s-1GNU\s0 linker will ignore the \fB\-F\fR option when not
+creating an \s-1ELF\s0 shared object.
.IP "\fB\-fini\fR \fIname\fR" 4
.IX Item "-fini name"
When creating an \s-1ELF\s0 executable or shared object, call \s-1NAME\s0 when the
@@ -497,6 +499,9 @@ on the command line are searched before the default directories. All
\&\fB\-L\fR options apply to all \fB\-l\fR options, regardless of the
order in which the options appear.
.Sp
+If \fIsearchdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
+by the \fIsysroot prefix\fR, a path specified when the linker is configured.
+.Sp
The default set of paths searched (without being specified with
\&\fB\-L\fR) depends on which emulation mode \fBld\fR is using, and in
some cases also on how it was configured.
@@ -523,11 +528,11 @@ configured.
Print a link map to the standard output. A link map provides
information about the link, including the following:
.RS 4
-.IP "\(bu" 4
+.IP "*" 4
Where object files and symbols are mapped into memory.
-.IP "\(bu" 4
+.IP "*" 4
How common symbols are allocated.
-.IP "\(bu" 4
+.IP "*" 4
All archive members included in the link, with a mention of the symbol
which caused the archive member to be brought in.
.RE
@@ -548,8 +553,17 @@ Turn off page alignment of sections, and mark the output as
.IX Item "--omagic"
.PD
Set the text and data sections to be readable and writable. Also, do
-not page-align the data segment. If the output format supports Unix
-style magic numbers, mark the output as \f(CW\*(C`OMAGIC\*(C'\fR.
+not page-align the data segment, and disable linking against shared
+libraries. If the output format supports Unix style magic numbers,
+mark the output as \f(CW\*(C`OMAGIC\*(C'\fR. Note: Although a writable text section
+is allowed for PE-COFF targets, it does not conform to the format
+specification published by Microsoft.
+.IP "\fB\-\-no\-omagic\fR" 4
+.IX Item "--no-omagic"
+This option negates most of the effects of the \fB\-N\fR option. It
+sets the text section to be read\-only, and forces the data segment to
+be page\-aligned. Note \- this option does not enable linking against
+shared libraries. Use \fB\-Bdynamic\fR for this.
.IP "\fB\-o\fR \fIoutput\fR" 4
.IX Item "-o output"
.PD 0
@@ -579,8 +593,8 @@ This option is currently only supported on \s-1ELF\s0 platforms.
.IP "\fB\-r\fR" 4
.IX Item "-r"
.PD 0
-.IP "\fB\-\-relocateable\fR" 4
-.IX Item "--relocateable"
+.IP "\fB\-\-relocatable\fR" 4
+.IX Item "--relocatable"
.PD
Generate relocatable output\-\-\-i.e., generate an output file that can in
turn serve as input to \fBld\fR. This is often called \fIpartial
@@ -719,29 +733,69 @@ Add \fIpath\fR to the default library search path. This option exists
for Solaris compatibility.
.IP "\fB\-z\fR \fIkeyword\fR" 4
.IX Item "-z keyword"
-The recognized keywords are \f(CW\*(C`initfirst\*(C'\fR, \f(CW\*(C`interpose\*(C'\fR,
-\&\f(CW\*(C`loadfltr\*(C'\fR, \f(CW\*(C`nodefaultlib\*(C'\fR, \f(CW\*(C`nodelete\*(C'\fR, \f(CW\*(C`nodlopen\*(C'\fR,
-\&\f(CW\*(C`nodump\*(C'\fR, \f(CW\*(C`now\*(C'\fR, \f(CW\*(C`origin\*(C'\fR, \f(CW\*(C`combreloc\*(C'\fR, \f(CW\*(C`nocombreloc\*(C'\fR
-and \f(CW\*(C`nocopyreloc\*(C'\fR.
-The other keywords are
-ignored for Solaris compatibility. \f(CW\*(C`initfirst\*(C'\fR marks the object
-to be initialized first at runtime before any other objects.
-\&\f(CW\*(C`interpose\*(C'\fR marks the object that its symbol table interposes
-before all symbols but the primary executable. \f(CW\*(C`loadfltr\*(C'\fR marks
-the object that its filtees be processed immediately at runtime.
-\&\f(CW\*(C`nodefaultlib\*(C'\fR marks the object that the search for dependencies
-of this object will ignore any default library search paths.
-\&\f(CW\*(C`nodelete\*(C'\fR marks the object shouldn't be unloaded at runtime.
-\&\f(CW\*(C`nodlopen\*(C'\fR marks the object not available to \f(CW\*(C`dlopen\*(C'\fR.
-\&\f(CW\*(C`nodump\*(C'\fR marks the object can not be dumped by \f(CW\*(C`dldump\*(C'\fR.
-\&\f(CW\*(C`now\*(C'\fR marks the object with the non-lazy runtime binding.
-\&\f(CW\*(C`origin\*(C'\fR marks the object may contain \f(CW$ORIGIN\fR.
-\&\f(CW\*(C`defs\*(C'\fR disallows undefined symbols.
-\&\f(CW\*(C`muldefs\*(C'\fR allows multiple definitions.
-\&\f(CW\*(C`combreloc\*(C'\fR combines multiple reloc sections and sorts them
-to make dynamic symbol lookup caching possible.
-\&\f(CW\*(C`nocombreloc\*(C'\fR disables multiple reloc sections combining.
-\&\f(CW\*(C`nocopyreloc\*(C'\fR disables production of copy relocs.
+The recognized keywords are:
+.RS 4
+.IP "\fBcombreloc\fR" 4
+.IX Item "combreloc"
+Combines multiple reloc sections and sorts them to make dynamic symbol
+lookup caching possible.
+.IP "\fBdefs\fR" 4
+.IX Item "defs"
+Disallows undefined symbols in object files. Undefined symbols in
+shared libraries are still allowed.
+.IP "\fBinitfirst\fR" 4
+.IX Item "initfirst"
+This option is only meaningful when building a shared object.
+It marks the object so that its runtime initialization will occur
+before the runtime initialization of any other objects brought into
+the process at the same time. Similarly the runtime finalization of
+the object will occur after the runtime finalization of any other
+objects.
+.IP "\fBinterpose\fR" 4
+.IX Item "interpose"
+Marks the object that its symbol table interposes before all symbols
+but the primary executable.
+.IP "\fBloadfltr\fR" 4
+.IX Item "loadfltr"
+Marks the object that its filters be processed immediately at
+runtime.
+.IP "\fBmuldefs\fR" 4
+.IX Item "muldefs"
+Allows multiple definitions.
+.IP "\fBnocombreloc\fR" 4
+.IX Item "nocombreloc"
+Disables multiple reloc sections combining.
+.IP "\fBnocopyreloc\fR" 4
+.IX Item "nocopyreloc"
+Disables production of copy relocs.
+.IP "\fBnodefaultlib\fR" 4
+.IX Item "nodefaultlib"
+Marks the object that the search for dependencies of this object will
+ignore any default library search paths.
+.IP "\fBnodelete\fR" 4
+.IX Item "nodelete"
+Marks the object shouldn't be unloaded at runtime.
+.IP "\fBnodlopen\fR" 4
+.IX Item "nodlopen"
+Marks the object not available to \f(CW\*(C`dlopen\*(C'\fR.
+.IP "\fBnodump\fR" 4
+.IX Item "nodump"
+Marks the object can not be dumped by \f(CW\*(C`dldump\*(C'\fR.
+.IP "\fBnow\fR" 4
+.IX Item "now"
+When generating an executable or shared library, mark it to tell the
+dynamic linker to resolve all symbols when the program is started, or
+when the shared library is linked to using dlopen, instead of
+deferring function call resolution to the point when the function is
+first called.
+.IP "\fBorigin\fR" 4
+.IX Item "origin"
+Marks the object may contain \f(CW$ORIGIN\fR.
+.RE
+.RS 4
+.Sp
+Other keywords are ignored for Solaris compatibility.
+.RE
.IP "\fB\-(\fR \fIarchives\fR \fB\-)\fR" 4
.IX Item "-( archives -)"
.PD 0
@@ -763,6 +817,32 @@ resolved.
Using this option has a significant performance cost. It is best to use
it only when there are unavoidable circular references between two or
more archives.
+.IP "\fB\-\-accept\-unknown\-input\-arch\fR" 4
+.IX Item "--accept-unknown-input-arch"
+.PD 0
+.IP "\fB\-\-no\-accept\-unknown\-input\-arch\fR" 4
+.IX Item "--no-accept-unknown-input-arch"
+.PD
+Tells the linker to accept input files whose architecture cannot be
+recognised. The assumption is that the user knows what they are doing
+and deliberately wants to link in these unknown input files. This was
+the default behaviour of the linker, before release 2.14. The default
+behaviour from release 2.14 onwards is to reject such input files, and
+so the \fB\-\-accept\-unknown\-input\-arch\fR option has been added to
+restore the old behaviour.
+.IP "\fB\-\-as\-needed\fR" 4
+.IX Item "--as-needed"
+.PD 0
+.IP "\fB\-\-no\-as\-needed\fR" 4
+.IX Item "--no-as-needed"
+.PD
+This option affects \s-1ELF\s0 \s-1DT_NEEDED\s0 tags for dynamic libraries mentioned
+on the command line after the \fB\-\-as\-needed\fR option. Normally,
+the linker will add a \s-1DT_NEEDED\s0 tag for each dynamic library mentioned
+on the command line, regardless of whether the library is actually
+needed. \fB\-\-as\-needed\fR causes \s-1DT_NEEDED\s0 tags to only be emitted
+for libraries that satisfy some reference from regular objects.
+\&\fB\-\-no\-as\-needed\fR restores the default behaviour.
.IP "\fB\-assert\fR \fIkeyword\fR" 4
.IX Item "-assert keyword"
This option is ignored for SunOS compatibility.
@@ -785,8 +865,8 @@ multiple times on the command line: it affects library searching for
Set the \f(CW\*(C`DF_1_GROUP\*(C'\fR flag in the \f(CW\*(C`DT_FLAGS_1\*(C'\fR entry in the dynamic
section. This causes the runtime linker to handle lookups in this
object and its dependencies to be performed only inside the group.
-\&\fB\-\-no\-undefined\fR is implied. This option is only meaningful on \s-1ELF\s0
-platforms which support shared libraries.
+\&\fB\-\-unresolved\-symbols=report\-all\fR is implied. This option is
+only meaningful on \s-1ELF\s0 platforms which support shared libraries.
.IP "\fB\-Bstatic\fR" 4
.IX Item "-Bstatic"
.PD 0
@@ -801,7 +881,8 @@ Do not link against shared libraries. This is only meaningful on
platforms for which shared libraries are supported. The different
variants of this option are for compatibility with various systems. You
may use this option multiple times on the command line: it affects
-library searching for \fB\-l\fR options which follow it.
+library searching for \fB\-l\fR options which follow it. This
+option also implies \fB\-\-unresolved\-symbols=report\-all\fR.
.IP "\fB\-Bsymbolic\fR" 4
.IX Item "-Bsymbolic"
When creating a shared library, bind references to global symbols to the
@@ -934,9 +1015,11 @@ while linking a large executable.
.IP "\fB\-z defs\fR" 4
.IX Item "-z defs"
.PD
-Normally when creating a non-symbolic shared library, undefined symbols
-are allowed and left to be resolved by the runtime loader. These options
-disallows such undefined symbols.
+Report unresolved symbol references from regular object files. This
+is done even if the linker is creating a non-symbolic shared library.
+The switch \fB\-\-[no\-]allow\-shlib\-undefined\fR controls the
+behaviour for reporting unresolved references found in shared
+libraries being linked in.
.IP "\fB\-\-allow\-multiple\-definition\fR" 4
.IX Item "--allow-multiple-definition"
.PD 0
@@ -948,16 +1031,25 @@ report a fatal error. These options allow multiple definitions and the
first definition will be used.
.IP "\fB\-\-allow\-shlib\-undefined\fR" 4
.IX Item "--allow-shlib-undefined"
-Allow undefined symbols in shared objects even when \-\-no\-undefined is
-set. The net result will be that undefined symbols in regular objects
-will still trigger an error, but undefined symbols in shared objects
-will be ignored. The implementation of no_undefined makes the
-assumption that the runtime linker will choke on undefined symbols.
-However there is at least one system (BeOS) where undefined symbols in
-shared libraries is normal since the kernel patches them at load time to
-select which function is most appropriate for the current architecture.
-I.E. dynamically select an appropriate memset function. Apparently it
-is also normal for \s-1HPPA\s0 shared libraries to have undefined symbols.
+.PD 0
+.IP "\fB\-\-no\-allow\-shlib\-undefined\fR" 4
+.IX Item "--no-allow-shlib-undefined"
+.PD
+Allows (the default) or disallows undefined symbols in shared libraries.
+This switch is similar to \fB\-\-no\-undefined\fR except that it
+determines the behaviour when the undefined symbols are in a
+shared library rather than a regular object file. It does not affect
+how undefined symbols in regular object files are handled.
+.Sp
+The reason that \fB\-\-allow\-shlib\-undefined\fR is the default is that
+the shared library being specified at link time may not be the same as
+the one that is available at load time, so the symbols might actually be
+resolvable at load time. Plus there are some systems, (eg BeOS) where
+undefined symbols in shared libraries is normal. (The kernel patches
+them at load time to select which function is most appropriate
+for the current architecture. This is used for example to dynamically
+select an appropriate memset function). Apparently it is also normal
+for \s-1HPPA\s0 shared libraries to have undefined symbols.
.IP "\fB\-\-no\-undefined\-version\fR" 4
.IX Item "--no-undefined-version"
Normally when a symbol has an undefined version, the linker will ignore
@@ -1000,6 +1092,18 @@ name of a particular format supported by the \s-1BFD\s0 libraries. (You can
list the available binary formats with \fBobjdump \-i\fR.) The script
command \f(CW\*(C`OUTPUT_FORMAT\*(C'\fR can also specify the output format, but
this option overrides it.
+.IP "\fB\-pie\fR" 4
+.IX Item "-pie"
+.PD 0
+.IP "\fB\-\-pic\-executable\fR" 4
+.IX Item "--pic-executable"
+.PD
+Create a position independent executable. This is currently only supported on
+\&\s-1ELF\s0 platforms. Position independent executables are similar to shared
+libraries in that they are relocated by the dynamic linker to the virtual
+address the \s-1OS\s0 chooses for them (which can vary between invocations). Like
+normal dynamically linked executables they can be executed and symbols
+defined in the executable cannot be overridden by shared libraries.
.IP "\fB\-qmagic\fR" 4
.IX Item "-qmagic"
This option is ignored for Linux compatibility.
@@ -1186,11 +1290,40 @@ sign (``\fB=\fR''), and \fIorg\fR.
.IP "\fB\-Ttext\fR \fIorg\fR" 4
.IX Item "-Ttext org"
.PD
-Use \fIorg\fR as the starting address for\-\-\-respectively\-\-\-the
-\&\f(CW\*(C`bss\*(C'\fR, \f(CW\*(C`data\*(C'\fR, or the \f(CW\*(C`text\*(C'\fR segment of the output file.
-\&\fIorg\fR must be a single hexadecimal integer;
-for compatibility with other linkers, you may omit the leading
-\&\fB0x\fR usually associated with hexadecimal values.
+Same as \-\-section\-start, with \f(CW\*(C`.bss\*(C'\fR, \f(CW\*(C`.data\*(C'\fR or
+\&\f(CW\*(C`.text\*(C'\fR as the \fIsectionname\fR.
+.IP "\fB\-\-unresolved\-symbols=\fR\fImethod\fR" 4
+.IX Item "--unresolved-symbols=method"
+Determine how to handle unresolved symbols. There are four possible
+values for \fBmethod\fR:
+.RS 4
+.IP "\fBignore-all\fR" 4
+.IX Item "ignore-all"
+Do not report any unresolved symbols.
+.IP "\fBreport-all\fR" 4
+.IX Item "report-all"
+Report all unresolved symbols. This is the default.
+.IP "\fBignore-in-object-files\fR" 4
+.IX Item "ignore-in-object-files"
+Report unresolved symbols that are contained in shared libraries, but
+ignore them if they come from regular object files.
+.IP "\fBignore-in-shared-libs\fR" 4
+.IX Item "ignore-in-shared-libs"
+Report unresolved symbols that come from regular object files, but
+ignore them if they come from shared libraries. This can be useful
+when creating a dynamic binary and it is known that all the shared
+libraries that it should be referencing are included on the linker's
+command line.
+.RE
+.RS 4
+.Sp
+The behaviour for shared libraries on their own can also be controlled
+by the \fB\-\-[no\-]allow\-shlib\-undefined\fR option.
+.Sp
+Normally the linker will generate an error message for each reported
+unresolved symbol but the option \fB\-\-warn\-unresolved\-symbols\fR
+can change this to a warning.
+.RE
.IP "\fB\-\-dll\-verbose\fR" 4
.IX Item "--dll-verbose"
.PD 0
@@ -1204,15 +1337,15 @@ the linker script being used by the linker.
.IX Item "--version-script=version-scriptfile"
Specify the name of a version script to the linker. This is typically
used when creating shared libraries to specify additional information
-about the version heirarchy for the library being created. This option
+about the version hierarchy for the library being created. This option
is only meaningful on \s-1ELF\s0 platforms which support shared libraries.
.IP "\fB\-\-warn\-common\fR" 4
.IX Item "--warn-common"
Warn when a common symbol is combined with another common symbol or with
-a symbol definition. Unix linkers allow this somewhat sloppy practice,
+a symbol definition. Unix linkers allow this somewhat sloppy practise,
but linkers on some other operating systems do not. This option allows
you to find potential problems from combining global symbols.
-Unfortunately, some C libraries use this practice, so you may get some
+Unfortunately, some C libraries use this practise, so you may get some
warnings about symbols in the libraries as well as in your programs.
.Sp
There are three kinds of global symbols, illustrated here by C examples:
@@ -1319,6 +1452,15 @@ alignment. Typically, the alignment will be set by an input section.
The address will only be changed if it not explicitly specified; that
is, if the \f(CW\*(C`SECTIONS\*(C'\fR command does not specify a start address for
the section.
+.IP "\fB\-\-warn\-unresolved\-symbols\fR" 4
+.IX Item "--warn-unresolved-symbols"
+If the linker is going to report an unresolved symbol (see the option
+\&\fB\-\-unresolved\-symbols\fR) it will normally generate an error.
+This option makes it generate a warning instead.
+.IP "\fB\-\-error\-unresolved\-symbols\fR" 4
+.IX Item "--error-unresolved-symbols"
+This restores the linker's default behaviour of generating errors when
+it is reporting unresolved symbols.
.IP "\fB\-\-whole\-archive\fR" 4
.IX Item "--whole-archive"
For each archive mentioned on the command line after the
@@ -1349,9 +1491,9 @@ Here is a trivial example:
.Sp
.Vb 6
\& void *
-\& __wrap_malloc (int c)
+\& __wrap_malloc (size_t c)
\& {
-\& printf ("malloc called with %ld\en", c);
+\& printf ("malloc called with %zu\en", c);
\& return __real_malloc (c);
\& }
.Ve
@@ -1396,16 +1538,19 @@ values by either a space or an equals sign.
.IX Item "--add-stdcall-alias"
If given, symbols with a stdcall suffix (@\fInn\fR) will be exported
as-is and also with the suffix stripped.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-base\-file\fR \fIfile\fR" 4
.IX Item "--base-file file"
Use \fIfile\fR as the name of a file in which to save the base
addresses of all the relocations needed for generating DLLs with
\&\fIdlltool\fR.
+[This is an i386 \s-1PE\s0 specific option]
.IP "\fB\-\-dll\fR" 4
.IX Item "--dll"
Create a \s-1DLL\s0 instead of a regular executable. You may also use
\&\fB\-shared\fR or specify a \f(CW\*(C`LIBRARY\*(C'\fR in a given \f(CW\*(C`.def\*(C'\fR
file.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-enable\-stdcall\-fixup\fR" 4
.IX Item "--enable-stdcall-fixup"
.PD 0
@@ -1413,7 +1558,7 @@ file.
.IX Item "--disable-stdcall-fixup"
.PD
If the link finds a symbol that it cannot resolve, it will attempt to
-do \*(L"fuzzy linking\*(R" by looking for another defined symbol that differs
+do ``fuzzy linking'' by looking for another defined symbol that differs
only in the format of the symbol name (cdecl vs stdcall) and will
resolve that symbol by linking to the match. For example, the
undefined symbol \f(CW\*(C`_foo\*(C'\fR might be linked to the function
@@ -1425,6 +1570,7 @@ to be usable. If you specify \fB\-\-enable\-stdcall\-fixup\fR, this
feature is fully enabled and warnings are not printed. If you specify
\&\fB\-\-disable\-stdcall\-fixup\fR, this feature is disabled and such
mismatches are considered to be errors.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-export\-all\-symbols\fR" 4
.IX Item "--export-all-symbols"
If given, all global symbols in the objects used to build a \s-1DLL\s0 will
@@ -1449,10 +1595,12 @@ These cygwin-excludes are: \f(CW\*(C`_cygwin_dll_entry@12\*(C'\fR,
\&\f(CW\*(C`_fmode\*(C'\fR, \f(CW\*(C`_impure_ptr\*(C'\fR, \f(CW\*(C`cygwin_attach_dll\*(C'\fR,
\&\f(CW\*(C`cygwin_premain0\*(C'\fR, \f(CW\*(C`cygwin_premain1\*(C'\fR, \f(CW\*(C`cygwin_premain2\*(C'\fR,
\&\f(CW\*(C`cygwin_premain3\*(C'\fR, and \f(CW\*(C`environ\*(C'\fR.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-exclude\-symbols\fR \fIsymbol\fR\fB,\fR\fIsymbol\fR\fB,...\fR" 4
.IX Item "--exclude-symbols symbol,symbol,..."
Specifies a list of symbols which should not be automatically
exported. The symbol names may be delimited by commas or colons.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-exclude\-libs\fR \fIlib\fR\fB,\fR\fIlib\fR\fB,...\fR" 4
.IX Item "--exclude-libs lib,lib,..."
Specifies a list of archive libraries from which symbols should not be automatically
@@ -1460,11 +1608,13 @@ exported. The library names may be delimited by commas or colons. Specifying
\&\f(CW\*(C`\-\-exclude\-libs ALL\*(C'\fR excludes symbols in all archive libraries from
automatic export. Symbols explicitly listed in a .def file are still exported,
regardless of this option.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-file\-alignment\fR" 4
.IX Item "--file-alignment"
Specify the file alignment. Sections in the file will always begin at
file offsets which are multiples of this number. This defaults to
512.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-heap\fR \fIreserve\fR" 4
.IX Item "--heap reserve"
.PD 0
@@ -1474,6 +1624,7 @@ file offsets which are multiples of this number. This defaults to
Specify the amount of memory to reserve (and optionally commit) to be
used as heap for this program. The default is 1Mb reserved, 4K
committed.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-image\-base\fR \fIvalue\fR" 4
.IX Item "--image-base value"
Use \fIvalue\fR as the base address of your program or dll. This is
@@ -1482,28 +1633,36 @@ is loaded. To reduce the need to relocate and improve performance of
your dlls, each should have a unique base address and not overlap any
other dlls. The default is 0x400000 for executables, and 0x10000000
for dlls.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-kill\-at\fR" 4
.IX Item "--kill-at"
If given, the stdcall suffixes (@\fInn\fR) will be stripped from
symbols before they are exported.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-major\-image\-version\fR \fIvalue\fR" 4
.IX Item "--major-image-version value"
-Sets the major number of the \*(L"image version\*(R". Defaults to 1.
+Sets the major number of the ``image version''. Defaults to 1.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-major\-os\-version\fR \fIvalue\fR" 4
.IX Item "--major-os-version value"
-Sets the major number of the \*(L"os version\*(R". Defaults to 4.
+Sets the major number of the ``os version''. Defaults to 4.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-major\-subsystem\-version\fR \fIvalue\fR" 4
.IX Item "--major-subsystem-version value"
-Sets the major number of the \*(L"subsystem version\*(R". Defaults to 4.
+Sets the major number of the ``subsystem version''. Defaults to 4.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-minor\-image\-version\fR \fIvalue\fR" 4
.IX Item "--minor-image-version value"
-Sets the minor number of the \*(L"image version\*(R". Defaults to 0.
+Sets the minor number of the ``image version''. Defaults to 0.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-minor\-os\-version\fR \fIvalue\fR" 4
.IX Item "--minor-os-version value"
-Sets the minor number of the \*(L"os version\*(R". Defaults to 0.
+Sets the minor number of the ``os version''. Defaults to 0.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-minor\-subsystem\-version\fR \fIvalue\fR" 4
.IX Item "--minor-subsystem-version value"
-Sets the minor number of the \*(L"subsystem version\*(R". Defaults to 0.
+Sets the minor number of the ``subsystem version''. Defaults to 0.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-output\-def\fR \fIfile\fR" 4
.IX Item "--output-def file"
The linker will create the file \fIfile\fR which will contain a \s-1DEF\s0
@@ -1511,14 +1670,16 @@ file corresponding to the \s-1DLL\s0 the linker is generating. This \s-1DEF\s0
(which should be called \f(CW\*(C`*.def\*(C'\fR) may be used to create an import
library with \f(CW\*(C`dlltool\*(C'\fR or may be used as a reference to
automatically or implicitly exported symbols.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-out\-implib\fR \fIfile\fR" 4
.IX Item "--out-implib file"
The linker will create the file \fIfile\fR which will contain an
import lib corresponding to the \s-1DLL\s0 the linker is generating. This
import lib (which should be called \f(CW\*(C`*.dll.a\*(C'\fR or \f(CW\*(C`*.a\*(C'\fR
-may be used to link clients against the generated \s-1DLL\s0; this behavior
+may be used to link clients against the generated \s-1DLL\s0; this behaviour
makes it possible to skip a separate \f(CW\*(C`dlltool\*(C'\fR import library
creation step.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-enable\-auto\-image\-base\fR" 4
.IX Item "--enable-auto-image-base"
Automatically choose the image base for DLLs, unless one is specified
@@ -1526,25 +1687,33 @@ using the \f(CW\*(C`\-\-image\-base\*(C'\fR argument. By using a hash generated
from the dllname to create unique image bases for each \s-1DLL\s0, in-memory
collisions and relocations which can delay program execution are
avoided.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-disable\-auto\-image\-base\fR" 4
.IX Item "--disable-auto-image-base"
Do not automatically generate a unique image base. If there is no
user-specified image base (\f(CW\*(C`\-\-image\-base\*(C'\fR) then use the platform
default.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-dll\-search\-prefix\fR \fIstring\fR" 4
.IX Item "--dll-search-prefix string"
-When linking dynamically to a dll without an import library, i
+When linking dynamically to a dll without an import library,
search for \f(CW\*(C`<string><basename>.dll\*(C'\fR in preference to
-\&\f(CW\*(C`lib<basename>.dll\*(C'\fR. This behavior allows easy distinction
+\&\f(CW\*(C`lib<basename>.dll\*(C'\fR. This behaviour allows easy distinction
between DLLs built for the various \*(L"subplatforms\*(R": native, cygwin,
uwin, pw, etc. For instance, cygwin DLLs typically use
\&\f(CW\*(C`\-\-dll\-search\-prefix=cyg\*(C'\fR.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-enable\-auto\-import\fR" 4
.IX Item "--enable-auto-import"
Do sophisticated linking of \f(CW\*(C`_symbol\*(C'\fR to \f(CW\*(C`_\|_imp_\|_symbol\*(C'\fR for
\&\s-1DATA\s0 imports from DLLs, and create the necessary thunking symbols when
-building the DLLs with those \s-1DATA\s0 exports. This generally will 'just
-work' \*(-- but sometimes you may see this message:
+building the import libraries with those \s-1DATA\s0 exports. Note: Use of the
+\&'auto\-import' extension will cause the text section of the image file
+to be made writable. This does not conform to the PE-COFF format
+specification published by Microsoft.
+.Sp
+Using 'auto\-import' generally will 'just work' \*(-- but sometimes you may
+see this message:
.Sp
"variable '<var>' can't be auto\-imported. Please read the
documentation for ld's \f(CW\*(C`\-\-enable\-auto\-import\*(C'\fR for details."
@@ -1562,7 +1731,11 @@ the warning, and exit.
There are several ways to address this difficulty, regardless of the
data type of the exported variable:
.Sp
-One solution is to force one of the 'constants' to be a variable \*(--
+One way is to use \-\-enable\-runtime\-pseudo\-reloc switch. This leaves the task
+of adjusting references in your client code for runtime environment, so
+this method works only when runtime environment supports this feature.
+.Sp
+A second solution is to force one of the 'constants' to be a variable \*(--
that is, unknown and un-optimizable at compile time. For arrays,
there are two possibilities: a) make the indexee (the array's address)
a variable, or b) make the 'constant' index a variable. Thus:
@@ -1598,9 +1771,9 @@ or
\& { volatile long long * local_ll=&extern_ll; *local_ll }
.Ve
.Sp
-A second method of dealing with this difficulty is to abandon
+A third method of dealing with this difficulty is to abandon
\&'auto\-import' for the offending symbol and mark it with
-\&\f(CW\*(C`_\|_declspec(dllimport)\*(C'\fR. However, in practice that
+\&\f(CW\*(C`_\|_declspec(dllimport)\*(C'\fR. However, in practise that
requires using compile-time #defines to indicate whether you are
building a \s-1DLL\s0, building client code that will link to the \s-1DLL\s0, or
merely building/linking to a static library. In making the choice
@@ -1652,21 +1825,37 @@ Solution 2:
\& }
.Ve
.Sp
-A third way to avoid this problem is to re-code your
+A fourth way to avoid this problem is to re-code your
library to use a functional interface rather than a data interface
for the offending variables (e.g. \fIset_foo()\fR and \fIget_foo()\fR accessor
functions).
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-disable\-auto\-import\fR" 4
.IX Item "--disable-auto-import"
-Do not attempt to do sophisticalted linking of \f(CW\*(C`_symbol\*(C'\fR to
+Do not attempt to do sophisticated linking of \f(CW\*(C`_symbol\*(C'\fR to
\&\f(CW\*(C`_\|_imp_\|_symbol\*(C'\fR for \s-1DATA\s0 imports from DLLs.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-enable\-runtime\-pseudo\-reloc\fR" 4
+.IX Item "--enable-runtime-pseudo-reloc"
+If your code contains expressions described in \-\-enable\-auto\-import section,
+that is, \s-1DATA\s0 imports from \s-1DLL\s0 with non-zero offset, this switch will create
+a vector of 'runtime pseudo relocations' which can be used by runtime
+environment to adjust references to such data in your client code.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-disable\-runtime\-pseudo\-reloc\fR" 4
+.IX Item "--disable-runtime-pseudo-reloc"
+Do not create pseudo relocations for non-zero offset \s-1DATA\s0 imports from
+DLLs. This is the default.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-enable\-extra\-pe\-debug\fR" 4
.IX Item "--enable-extra-pe-debug"
Show additional debug info related to auto-import symbol thunking.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-section\-alignment\fR" 4
.IX Item "--section-alignment"
Sets the section alignment. Sections in memory will always begin at
addresses which are a multiple of this number. Defaults to 0x1000.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-stack\fR \fIreserve\fR" 4
.IX Item "--stack reserve"
.PD 0
@@ -1676,6 +1865,7 @@ addresses which are a multiple of this number. Defaults to 0x1000.
Specify the amount of memory to reserve (and optionally commit) to be
used as stack for this program. The default is 2Mb reserved, 4K
committed.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-subsystem\fR \fIwhich\fR" 4
.IX Item "--subsystem which"
.PD 0
@@ -1688,10 +1878,12 @@ Specifies the subsystem under which your program will execute. The
legal values for \fIwhich\fR are \f(CW\*(C`native\*(C'\fR, \f(CW\*(C`windows\*(C'\fR,
\&\f(CW\*(C`console\*(C'\fR, and \f(CW\*(C`posix\*(C'\fR. You may optionally set the
subsystem version also.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.SH "ENVIRONMENT"
.IX Header "ENVIRONMENT"
-You can change the behavior of \fBld\fR with the environment variables
-\&\f(CW\*(C`GNUTARGET\*(C'\fR, \f(CW\*(C`LDEMULATION\*(C'\fR, and \f(CW\*(C`COLLECT_NO_DEMANGLE\*(C'\fR.
+You can change the behaviour of \fBld\fR with the environment variables
+\&\f(CW\*(C`GNUTARGET\*(C'\fR,
+\&\f(CW\*(C`LDEMULATION\*(C'\fR and \f(CW\*(C`COLLECT_NO_DEMANGLE\*(C'\fR.
.PP
\&\f(CW\*(C`GNUTARGET\*(C'\fR determines the input-file object format if you don't
use \fB\-b\fR (or its synonym \fB\-\-format\fR). Its value should be one
@@ -1726,11 +1918,12 @@ the Info entries for \fIbinutils\fR and
\&\fIld\fR.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
-Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc.
+Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001,
+2002, 2003, 2004 Free Software Foundation, Inc.
.PP
Permission is granted to copy, distribute and/or modify this document
under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
-section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
+section entitled ``\s-1GNU\s0 Free Documentation License''.
diff --git a/contrib/binutils/ld/ld.h b/contrib/binutils/ld/ld.h
index 438e00d..dde4cfe 100644
--- a/contrib/binutils/ld/ld.h
+++ b/contrib/binutils/ld/ld.h
@@ -70,7 +70,7 @@ name_list;
struct wildcard_spec {
const char *name;
struct name_list *exclude_name_list;
- boolean sorted;
+ bfd_boolean sorted;
};
struct wildcard_list {
@@ -93,11 +93,11 @@ typedef struct user_section_struct {
typedef struct {
/* 1 => assign space to common symbols even if `relocatable_output'. */
- boolean force_common_definition;
+ bfd_boolean force_common_definition;
/* 1 => do not assign addresses to common symbols. */
- boolean inhibit_common_definition;
- boolean relax;
+ bfd_boolean inhibit_common_definition;
+ bfd_boolean relax;
/* Name of runtime interpreter to invoke. */
char *interpreter;
@@ -115,22 +115,22 @@ typedef struct {
/* Big or little endian as set on command line. */
enum { ENDIAN_UNSET = 0, ENDIAN_BIG, ENDIAN_LITTLE } endian;
- /* If true, build MIPS embedded PIC relocation tables in the output
+ /* If TRUE, build MIPS embedded PIC relocation tables in the output
file. */
- boolean embedded_relocs;
+ bfd_boolean embedded_relocs;
- /* If true, force generation of a file with a .exe file. */
- boolean force_exe_suffix;
+ /* If TRUE, force generation of a file with a .exe file. */
+ bfd_boolean force_exe_suffix;
- /* If true, generate a cross reference report. */
- boolean cref;
+ /* If TRUE, generate a cross reference report. */
+ bfd_boolean cref;
- /* If true (which is the default), warn about mismatched input
+ /* If TRUE (which is the default), warn about mismatched input
files. */
- boolean warn_mismatch;
+ bfd_boolean warn_mismatch;
/* Remove unreferenced sections? */
- boolean gc_sections;
+ bfd_boolean gc_sections;
/* Name of shared object whose symbol table should be filtered with
this shared object. From the --filter option. */
@@ -144,9 +144,15 @@ typedef struct {
.exports sections. */
char *version_exports_section;
- /* If true (the default) check section addresses, once compute,
+ /* If TRUE (the default) check section addresses, once compute,
fpor overlaps. */
- boolean check_section_addresses;
+ bfd_boolean check_section_addresses;
+
+ /* If TRUE allow the linking of input files in an unknown architecture
+ assuming that the user knows what they are doing. This was the old
+ behaviour of the linker. The new default behaviour is to reject such
+ input files. */
+ bfd_boolean accept_unknown_input_arch;
} args_type;
@@ -156,60 +162,60 @@ typedef int token_code_type;
typedef struct {
bfd_size_type specified_data_size;
- boolean magic_demand_paged;
- boolean make_executable;
+ bfd_boolean magic_demand_paged;
+ bfd_boolean make_executable;
- /* If true, doing a dynamic link. */
- boolean dynamic_link;
+ /* If TRUE, doing a dynamic link. */
+ bfd_boolean dynamic_link;
- /* If true, -shared is supported. */
+ /* If TRUE, -shared is supported. */
/* ??? A better way to do this is perhaps to define this in the
ld_emulation_xfer_struct since this is really a target dependent
parameter. */
- boolean has_shared;
+ bfd_boolean has_shared;
- /* If true, build constructors. */
- boolean build_constructors;
+ /* If TRUE, build constructors. */
+ bfd_boolean build_constructors;
- /* If true, warn about any constructors. */
- boolean warn_constructors;
+ /* If TRUE, warn about any constructors. */
+ bfd_boolean warn_constructors;
- /* If true, warn about merging common symbols with others. */
- boolean warn_common;
+ /* If TRUE, warn about merging common symbols with others. */
+ bfd_boolean warn_common;
- /* If true, only warn once about a particular undefined symbol. */
- boolean warn_once;
+ /* If TRUE, only warn once about a particular undefined symbol. */
+ bfd_boolean warn_once;
- /* If true, warn if multiple global-pointers are needed (Alpha
+ /* If TRUE, warn if multiple global-pointers are needed (Alpha
only). */
- boolean warn_multiple_gp;
+ bfd_boolean warn_multiple_gp;
- /* If true, warn if the starting address of an output section
+ /* If TRUE, warn if the starting address of an output section
changes due to the alignment of an input section. */
- boolean warn_section_align;
+ bfd_boolean warn_section_align;
- /* If true, warning messages are fatal */
- boolean fatal_warnings;
+ /* If TRUE, warning messages are fatal */
+ bfd_boolean fatal_warnings;
- boolean sort_common;
+ bfd_boolean sort_common;
- boolean text_read_only;
+ bfd_boolean text_read_only;
char *map_filename;
FILE *map_file;
- boolean stats;
+ bfd_boolean stats;
/* If set, orphan input sections will be mapped to separate output
sections. */
- boolean unique_orphan_sections;
+ bfd_boolean unique_orphan_sections;
unsigned int split_by_reloc;
bfd_size_type split_by_file;
/* If set, only search library directories explicitly selected
on the command line. */
- boolean only_cmd_line_lib_dirs;
+ bfd_boolean only_cmd_line_lib_dirs;
} ld_config_type;
extern ld_config_type config;
@@ -221,23 +227,20 @@ typedef enum {
} lang_phase_type;
extern FILE * saved_script_handle;
-extern boolean force_make_executable;
+extern bfd_boolean force_make_executable;
/* Non-zero if we are processing a --defsym from the command line. */
extern int parsing_defsym;
-extern int yyparse PARAMS ((void));
-
-extern void add_cref PARAMS ((const char *, bfd *, asection *, bfd_vma));
-extern void output_cref PARAMS ((FILE *));
-extern void check_nocrossrefs PARAMS ((void));
-
-extern void ld_abort PARAMS ((const char *, int, const char *))
- ATTRIBUTE_NORETURN;
+extern int yyparse (void);
+extern void add_cref (const char *, bfd *, asection *, bfd_vma);
+extern void output_cref (FILE *);
+extern void check_nocrossrefs (void);
+extern void ld_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
/* If gcc >= 2.6, we can give a function name, too. */
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
-#define __PRETTY_FUNCTION__ ((char*) NULL)
+#define __PRETTY_FUNCTION__ NULL
#endif
#undef abort
diff --git a/contrib/binutils/ld/ld.texinfo b/contrib/binutils/ld/ld.texinfo
index 789e894..4310c12 100644
--- a/contrib/binutils/ld/ld.texinfo
+++ b/contrib/binutils/ld/ld.texinfo
@@ -1,7 +1,7 @@
\input texinfo
@setfilename ld.info
@c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-@c 2001, 2002 Free Software Foundation, Inc.
+@c 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
@syncodeindex ky cp
@include configdoc.texi
@c (configdoc.texi is generated by the Makefile)
@@ -36,13 +36,16 @@
@set MCORE
@set MIPS
@set MMIX
+@set MSP430
@set PDP11
@set PJ
@set SH
@set SPARC
-@set C54X
+@set TIC54X
@set V850
@set VAX
+@set WIN32
+@set XTENSA
@end ifset
@c man end
@@ -58,7 +61,7 @@ END-INFO-DIR-ENTRY
This file documents the @sc{gnu} linker LD version @value{VERSION}.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000,
-2001, 2002 Free Software Foundation, Inc.
+2001, 2002, 2003, 2004 Free Software Foundation, Inc.
@ignore
@@ -67,7 +70,7 @@ under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
-section entitled "GNU Free Documentation License".
+section entitled ``GNU Free Documentation License''.
Permission is granted to process this file through Tex and print the
results, provided the printed document carries copying permission
@@ -102,14 +105,15 @@ notice identical to this one except for the removal of this paragraph
@vskip 0pt plus 1filll
@c man begin COPYRIGHT
-Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001,
+2002, 2003, 2004 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
-section entitled "GNU Free Documentation License".
+section entitled ``GNU Free Documentation License''.
@c man end
@end titlepage
@@ -123,7 +127,7 @@ This file documents the @sc{gnu} linker ld version @value{VERSION}.
This document is distributed under the terms of the GNU Free
Documentation License. A copy of the license is included in the
-section entitled "GNU Free Documentation License".
+section entitled ``GNU Free Documentation License''.
@menu
* Overview:: Overview
@@ -136,15 +140,27 @@ section entitled "GNU Free Documentation License".
@ifset H8300
* H8/300:: ld and the H8/300
@end ifset
-@ifset Hitachi
-* Hitachi:: ld and other Hitachi micros
+@ifset Renesas
+* Renesas:: ld and other Renesas micros
@end ifset
@ifset I960
* i960:: ld and the Intel 960 family
@end ifset
+@ifset ARM
+* ARM:: ld and the ARM family
+@end ifset
+@ifset HPPA
+* HPPA ELF32:: ld and HPPA 32-bit ELF
+@end ifset
@ifset TICOFF
* TI COFF:: ld and the TI COFF
@end ifset
+@ifset WIN32
+* Win32:: ld and WIN32 (cygwin/mingw)
+@end ifset
+@ifset XTENSA
+* Xtensa:: ld and Xtensa Processors
+@end ifset
@end ifclear
@ifclear SingleFormat
* BFD:: BFD
@@ -274,7 +290,7 @@ and the script command language. If @emph{no} binary input files at all
are specified, the linker does not produce any output, and issues the
message @samp{No input files}.
-If the linker can not recognize the format of an object file, it will
+If the linker cannot recognize the format of an object file, it will
assume that it is a linker script. A script specified in this way
augments the main linker script used for the link (either the default
linker script or the one specified by using @samp{-T}). This feature
@@ -292,7 +308,7 @@ option that requires them.
For options whose names are multiple letters, either one dash or two can
precede the option name; for example, @samp{-trace-symbol} and
-@samp{--trace-symbol} are equivalent. Note - there is one exception to
+@samp{--trace-symbol} are equivalent. Note---there is one exception to
this rule. Multiple letter options that start with a lower case 'o' can
only be preceeded by two dashes. This is to reduce confusion with the
@samp{-o} option. So for example @samp{-omagic} sets the output file
@@ -306,8 +322,8 @@ immediately following the option that requires them. For example,
Unique abbreviations of the names of multiple-letter options are
accepted.
-Note - if the linker is being invoked indirectly, via a compiler driver
-(eg @samp{gcc}) then all the linker command line options should be
+Note---if the linker is being invoked indirectly, via a compiler driver
+(e.g. @samp{gcc}) then all the linker command line options should be
prefixed by @samp{-Wl,} (or whatever is appropriate for the particular
compiler driver) like this:
@@ -452,6 +468,7 @@ You can also use the version script to control what symbols should
be added to the dynamic symbol table if the output format supports it.
See the description of @samp{--version-script} in @ref{VERSION}.
+@ifclear SingleFormat
@cindex big-endian objects
@cindex endianness
@kindex -EB
@@ -462,6 +479,7 @@ Link big-endian objects. This affects the default output format.
@kindex -EL
@item -EL
Link little-endian objects. This affects the default output format.
+@end ifclear
@kindex -f
@kindex --auxiliary
@@ -504,11 +522,15 @@ used to select a subset of the symbols provided by the object
Some older linkers used the @option{-F} option throughout a compilation
toolchain for specifying object-file format for both input and output
-object files. The @sc{gnu} linker uses other mechanisms for this
-purpose: the @option{-b}, @option{--format}, @option{--oformat} options, the
+object files.
+@ifclear SingleFormat
+The @sc{gnu} linker uses other mechanisms for this purpose: the
+@option{-b}, @option{--format}, @option{--oformat} options, the
@code{TARGET} command in linker scripts, and the @code{GNUTARGET}
-environment variable. The @sc{gnu} linker will ignore the @option{-F}
-option when not creating an ELF shared object.
+environment variable.
+@end ifclear
+The @sc{gnu} linker will ignore the @option{-F} option when not
+creating an ELF shared object.
@cindex finalization function
@kindex -fini
@@ -604,6 +626,9 @@ on the command line are searched before the default directories. All
@option{-L} options apply to all @option{-l} options, regardless of the
order in which the options appear.
+If @var{searchdir} begins with @code{=}, then the @code{=} will be replaced
+by the @dfn{sysroot prefix}, a path specified when the linker is configured.
+
@ifset UsesEnvVars
The default set of paths searched (without being specified with
@samp{-L}) depends on which emulation mode @command{ld} is using, and in
@@ -660,8 +685,19 @@ Turn off page alignment of sections, and mark the output as
@item -N
@itemx --omagic
Set the text and data sections to be readable and writable. Also, do
-not page-align the data segment. If the output format supports Unix
-style magic numbers, mark the output as @code{OMAGIC}.
+not page-align the data segment, and disable linking against shared
+libraries. If the output format supports Unix style magic numbers,
+mark the output as @code{OMAGIC}. Note: Although a writable text section
+is allowed for PE-COFF targets, it does not conform to the format
+specification published by Microsoft.
+
+@kindex --no-omagic
+@cindex OMAGIC
+@item --no-omagic
+This option negates most of the effects of the @option{-N} option. It
+sets the text section to be read-only, and forces the data segment to
+be page-aligned. Note - this option does not enable linking against
+shared libraries. Use @option{-Bdynamic} for this.
@kindex -o @var{output}
@kindex --output=@var{output}
@@ -694,9 +730,9 @@ This option is currently only supported on ELF platforms.
@cindex partial link
@cindex relocatable output
@kindex -r
-@kindex --relocateable
+@kindex --relocatable
@item -r
-@itemx --relocateable
+@itemx --relocatable
Generate relocatable output---i.e., generate an output file that can in
turn serve as input to @command{ld}. This is often called @dfn{partial
linking}. As a side effect, in environments that support standard Unix
@@ -841,29 +877,68 @@ for Solaris compatibility.
@kindex -z @var{keyword}
@item -z @var{keyword}
-The recognized keywords are @code{initfirst}, @code{interpose},
-@code{loadfltr}, @code{nodefaultlib}, @code{nodelete}, @code{nodlopen},
-@code{nodump}, @code{now}, @code{origin}, @code{combreloc}, @code{nocombreloc}
-and @code{nocopyreloc}.
-The other keywords are
-ignored for Solaris compatibility. @code{initfirst} marks the object
-to be initialized first at runtime before any other objects.
-@code{interpose} marks the object that its symbol table interposes
-before all symbols but the primary executable. @code{loadfltr} marks
-the object that its filtees be processed immediately at runtime.
-@code{nodefaultlib} marks the object that the search for dependencies
-of this object will ignore any default library search paths.
-@code{nodelete} marks the object shouldn't be unloaded at runtime.
-@code{nodlopen} marks the object not available to @code{dlopen}.
-@code{nodump} marks the object can not be dumped by @code{dldump}.
-@code{now} marks the object with the non-lazy runtime binding.
-@code{origin} marks the object may contain $ORIGIN.
-@code{defs} disallows undefined symbols.
-@code{muldefs} allows multiple definitions.
-@code{combreloc} combines multiple reloc sections and sorts them
-to make dynamic symbol lookup caching possible.
-@code{nocombreloc} disables multiple reloc sections combining.
-@code{nocopyreloc} disables production of copy relocs.
+The recognized keywords are:
+@table @samp
+
+@item combreloc
+Combines multiple reloc sections and sorts them to make dynamic symbol
+lookup caching possible.
+
+@item defs
+Disallows undefined symbols in object files. Undefined symbols in
+shared libraries are still allowed.
+
+@item initfirst
+This option is only meaningful when building a shared object.
+It marks the object so that its runtime initialization will occur
+before the runtime initialization of any other objects brought into
+the process at the same time. Similarly the runtime finalization of
+the object will occur after the runtime finalization of any other
+objects.
+
+@item interpose
+Marks the object that its symbol table interposes before all symbols
+but the primary executable.
+
+@item loadfltr
+Marks the object that its filters be processed immediately at
+runtime.
+
+@item muldefs
+Allows multiple definitions.
+
+@item nocombreloc
+Disables multiple reloc sections combining.
+
+@item nocopyreloc
+Disables production of copy relocs.
+
+@item nodefaultlib
+Marks the object that the search for dependencies of this object will
+ignore any default library search paths.
+
+@item nodelete
+Marks the object shouldn't be unloaded at runtime.
+
+@item nodlopen
+Marks the object not available to @code{dlopen}.
+
+@item nodump
+Marks the object can not be dumped by @code{dldump}.
+
+@item now
+When generating an executable or shared library, mark it to tell the
+dynamic linker to resolve all symbols when the program is started, or
+when the shared library is linked to using dlopen, instead of
+deferring function call resolution to the point when the function is
+first called.
+
+@item origin
+Marks the object may contain $ORIGIN.
+
+@end table
+
+Other keywords are ignored for Solaris compatibility.
@kindex -(
@cindex groups of archives
@@ -885,6 +960,30 @@ Using this option has a significant performance cost. It is best to use
it only when there are unavoidable circular references between two or
more archives.
+@kindex --accept-unknown-input-arch
+@kindex --no-accept-unknown-input-arch
+@item --accept-unknown-input-arch
+@itemx --no-accept-unknown-input-arch
+Tells the linker to accept input files whose architecture cannot be
+recognised. The assumption is that the user knows what they are doing
+and deliberately wants to link in these unknown input files. This was
+the default behaviour of the linker, before release 2.14. The default
+behaviour from release 2.14 onwards is to reject such input files, and
+so the @samp{--accept-unknown-input-arch} option has been added to
+restore the old behaviour.
+
+@kindex --as-needed
+@kindex --no-as-needed
+@item --as-needed
+@itemx --no-as-needed
+This option affects ELF DT_NEEDED tags for dynamic libraries mentioned
+on the command line after the @option{--as-needed} option. Normally,
+the linker will add a DT_NEEDED tag for each dynamic library mentioned
+on the command line, regardless of whether the library is actually
+needed. @option{--as-needed} causes DT_NEEDED tags to only be emitted
+for libraries that satisfy some reference from regular objects.
+@option{--no-as-needed} restores the default behaviour.
+
@kindex -assert @var{keyword}
@item -assert @var{keyword}
This option is ignored for SunOS compatibility.
@@ -907,8 +1006,8 @@ multiple times on the command line: it affects library searching for
Set the @code{DF_1_GROUP} flag in the @code{DT_FLAGS_1} entry in the dynamic
section. This causes the runtime linker to handle lookups in this
object and its dependencies to be performed only inside the group.
-@option{--no-undefined} is implied. This option is only meaningful on ELF
-platforms which support shared libraries.
+@option{--unresolved-symbols=report-all} is implied. This option is
+only meaningful on ELF platforms which support shared libraries.
@kindex -Bstatic
@kindex -dn
@@ -922,7 +1021,8 @@ Do not link against shared libraries. This is only meaningful on
platforms for which shared libraries are supported. The different
variants of this option are for compatibility with various systems. You
may use this option multiple times on the command line: it affects
-library searching for @option{-l} options which follow it.
+library searching for @option{-l} options which follow it. This
+option also implies @option{--unresolved-symbols=report-all}.
@kindex -Bsymbolic
@item -Bsymbolic
@@ -941,7 +1041,7 @@ been assigned to see if there any overlaps. Normally the linker will
perform this check, and if it finds any overlaps it will produce
suitable error messages. The linker does know about, and does make
allowances for sections in overlays. The default behaviour can be
-restored by using the command line switch @samp{--check-sections}.
+restored by using the command line switch @option{--check-sections}.
@cindex cross reference table
@kindex --cref
@@ -1062,7 +1162,7 @@ Print a summary of all target specific options on the standard output and exit.
@kindex -Map
@item -Map @var{mapfile}
Print a link map to the file @var{mapfile}. See the description of the
-@samp{-M} option, above.
+@option{-M} option, above.
@cindex memory usage
@kindex --no-keep-memory
@@ -1077,9 +1177,11 @@ while linking a large executable.
@kindex -z defs
@item --no-undefined
@itemx -z defs
-Normally when creating a non-symbolic shared library, undefined symbols
-are allowed and left to be resolved by the runtime loader. These options
-disallows such undefined symbols.
+Report unresolved symbol references from regular object files. This
+is done even if the linker is creating a non-symbolic shared library.
+The switch @option{--[no-]allow-shlib-undefined} controls the
+behaviour for reporting unresolved references found in shared
+libraries being linked in.
@kindex --allow-multiple-definition
@kindex -z muldefs
@@ -1090,17 +1192,24 @@ report a fatal error. These options allow multiple definitions and the
first definition will be used.
@kindex --allow-shlib-undefined
+@kindex --no-allow-shlib-undefined
@item --allow-shlib-undefined
-Allow undefined symbols in shared objects even when --no-undefined is
-set. The net result will be that undefined symbols in regular objects
-will still trigger an error, but undefined symbols in shared objects
-will be ignored. The implementation of no_undefined makes the
-assumption that the runtime linker will choke on undefined symbols.
-However there is at least one system (BeOS) where undefined symbols in
-shared libraries is normal since the kernel patches them at load time to
-select which function is most appropriate for the current architecture.
-I.E. dynamically select an appropriate memset function. Apparently it
-is also normal for HPPA shared libraries to have undefined symbols.
+@itemx --no-allow-shlib-undefined
+Allows (the default) or disallows undefined symbols in shared libraries.
+This switch is similar to @option{--no-undefined} except that it
+determines the behaviour when the undefined symbols are in a
+shared library rather than a regular object file. It does not affect
+how undefined symbols in regular object files are handled.
+
+The reason that @option{--allow-shlib-undefined} is the default is that
+the shared library being specified at link time may not be the same as
+the one that is available at load time, so the symbols might actually be
+resolvable at load time. Plus there are some systems, (eg BeOS) where
+undefined symbols in shared libraries is normal. (The kernel patches
+them at load time to select which function is most appropriate
+for the current architecture. This is used for example to dynamically
+select an appropriate memset function). Apparently it is also normal
+for HPPA shared libraries to have undefined symbols.
@kindex --no-undefined-version
@item --no-undefined-version
@@ -1153,6 +1262,18 @@ command @code{OUTPUT_FORMAT} can also specify the output format, but
this option overrides it. @xref{BFD}.
@end ifclear
+@kindex -pie
+@kindex --pic-executable
+@item -pie
+@itemx --pic-executable
+@cindex position independent executables
+Create a position independent executable. This is currently only supported on
+ELF platforms. Position independent executables are similar to shared
+libraries in that they are relocated by the dynamic linker to the virtual
+address the OS chooses for them (which can vary between invocations). Like
+normal dynamically linked executables they can be executed and symbols
+defined in the executable cannot be overridden by shared libraries.
+
@kindex -qmagic
@item -qmagic
This option is ignored for Linux compatibility.
@@ -1175,7 +1296,9 @@ This option is only supported on a few targets.
@ifset I960
@xref{i960,, @command{ld} and the Intel 960 family}.
@end ifset
-
+@ifset XTENSA
+@xref{Xtensa,, @command{ld} and Xtensa Processors}.
+@end ifset
On some platforms, the @samp{--relax} option performs global
optimizations that become possible when the linker resolves addressing
@@ -1375,11 +1498,39 @@ sign (``@key{=}''), and @var{org}.
@item -Tbss @var{org}
@itemx -Tdata @var{org}
@itemx -Ttext @var{org}
-Use @var{org} as the starting address for---respectively---the
-@code{bss}, @code{data}, or the @code{text} segment of the output file.
-@var{org} must be a single hexadecimal integer;
-for compatibility with other linkers, you may omit the leading
-@samp{0x} usually associated with hexadecimal values.
+Same as --section-start, with @code{.bss}, @code{.data} or
+@code{.text} as the @var{sectionname}.
+
+@kindex --unresolved-symbols
+@item --unresolved-symbols=@var{method}
+Determine how to handle unresolved symbols. There are four possible
+values for @samp{method}:
+
+@table @samp
+@item ignore-all
+Do not report any unresolved symbols.
+
+@item report-all
+Report all unresolved symbols. This is the default.
+
+@item ignore-in-object-files
+Report unresolved symbols that are contained in shared libraries, but
+ignore them if they come from regular object files.
+
+@item ignore-in-shared-libs
+Report unresolved symbols that come from regular object files, but
+ignore them if they come from shared libraries. This can be useful
+when creating a dynamic binary and it is known that all the shared
+libraries that it should be referencing are included on the linker's
+command line.
+@end table
+
+The behaviour for shared libraries on their own can also be controlled
+by the @option{--[no-]allow-shlib-undefined} option.
+
+Normally the linker will generate an error message for each reported
+unresolved symbol but the option @option{--warn-unresolved-symbols}
+can change this to a warning.
@kindex --verbose
@cindex verbose
@@ -1394,7 +1545,7 @@ the linker script being used by the linker.
@itemx --version-script=@var{version-scriptfile}
Specify the name of a version script to the linker. This is typically
used when creating shared libraries to specify additional information
-about the version heirarchy for the library being created. This option
+about the version hierarchy for the library being created. This option
is only meaningful on ELF platforms which support shared libraries.
@xref{VERSION}.
@@ -1403,10 +1554,10 @@ is only meaningful on ELF platforms which support shared libraries.
@cindex combining symbols, warnings on
@item --warn-common
Warn when a common symbol is combined with another common symbol or with
-a symbol definition. Unix linkers allow this somewhat sloppy practice,
+a symbol definition. Unix linkers allow this somewhat sloppy practise,
but linkers on some other operating systems do not. This option allows
you to find potential problems from combining global symbols.
-Unfortunately, some C libraries use this practice, so you may get some
+Unfortunately, some C libraries use this practise, so you may get some
warnings about symbols in the libraries as well as in your programs.
There are three kinds of global symbols, illustrated here by C examples:
@@ -1520,6 +1671,17 @@ The address will only be changed if it not explicitly specified; that
is, if the @code{SECTIONS} command does not specify a start address for
the section (@pxref{SECTIONS}).
+@kindex --warn-unresolved-symbols
+@item --warn-unresolved-symbols
+If the linker is going to report an unresolved symbol (see the option
+@option{--unresolved-symbols}) it will normally generate an error.
+This option makes it generate a warning instead.
+
+@kindex --error-unresolved-symbols
+@item --error-unresolved-symbols
+This restores the linker's default behaviour of generating errors when
+it is reporting unresolved symbols.
+
@kindex --whole-archive
@cindex including an entire archive
@item --whole-archive
@@ -1552,9 +1714,9 @@ Here is a trivial example:
@smallexample
void *
-__wrap_malloc (int c)
+__wrap_malloc (size_t c)
@{
- printf ("malloc called with %ld\n", c);
+ printf ("malloc called with %zu\n", c);
return __real_malloc (c);
@}
@end smallexample
@@ -1585,7 +1747,7 @@ those options are only available for ELF systems.
@c man end
-@subsection Options specific to i386 PE targets
+@subsection Options Specific to i386 PE Targets
@c man begin OPTIONS
@@ -1609,25 +1771,28 @@ values by either a space or an equals sign.
@item --add-stdcall-alias
If given, symbols with a stdcall suffix (@@@var{nn}) will be exported
as-is and also with the suffix stripped.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --base-file
@item --base-file @var{file}
Use @var{file} as the name of a file in which to save the base
addresses of all the relocations needed for generating DLLs with
@file{dlltool}.
+[This is an i386 PE specific option]
@kindex --dll
@item --dll
Create a DLL instead of a regular executable. You may also use
@option{-shared} or specify a @code{LIBRARY} in a given @code{.def}
file.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --enable-stdcall-fixup
@kindex --disable-stdcall-fixup
@item --enable-stdcall-fixup
@itemx --disable-stdcall-fixup
If the link finds a symbol that it cannot resolve, it will attempt to
-do "fuzzy linking" by looking for another defined symbol that differs
+do ``fuzzy linking'' by looking for another defined symbol that differs
only in the format of the symbol name (cdecl vs stdcall) and will
resolve that symbol by linking to the match. For example, the
undefined symbol @code{_foo} might be linked to the function
@@ -1639,6 +1804,7 @@ to be usable. If you specify @option{--enable-stdcall-fixup}, this
feature is fully enabled and warnings are not printed. If you specify
@option{--disable-stdcall-fixup}, this feature is disabled and such
mismatches are considered to be errors.
+[This option is specific to the i386 PE targeted port of the linker]
@cindex DLLs, creating
@kindex --export-all-symbols
@@ -1665,11 +1831,13 @@ These cygwin-excludes are: @code{_cygwin_dll_entry@@12},
@code{_fmode}, @code{_impure_ptr}, @code{cygwin_attach_dll},
@code{cygwin_premain0}, @code{cygwin_premain1}, @code{cygwin_premain2},
@code{cygwin_premain3}, and @code{environ}.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --exclude-symbols
@item --exclude-symbols @var{symbol},@var{symbol},...
Specifies a list of symbols which should not be automatically
exported. The symbol names may be delimited by commas or colons.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --exclude-libs
@item --exclude-libs @var{lib},@var{lib},...
@@ -1678,12 +1846,14 @@ exported. The library names may be delimited by commas or colons. Specifying
@code{--exclude-libs ALL} excludes symbols in all archive libraries from
automatic export. Symbols explicitly listed in a .def file are still exported,
regardless of this option.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --file-alignment
@item --file-alignment
Specify the file alignment. Sections in the file will always begin at
file offsets which are multiples of this number. This defaults to
512.
+[This option is specific to the i386 PE targeted port of the linker]
@cindex heap size
@kindex --heap
@@ -1692,6 +1862,7 @@ file offsets which are multiples of this number. This defaults to
Specify the amount of memory to reserve (and optionally commit) to be
used as heap for this program. The default is 1Mb reserved, 4K
committed.
+[This option is specific to the i386 PE targeted port of the linker]
@cindex image base
@kindex --image-base
@@ -1702,35 +1873,43 @@ is loaded. To reduce the need to relocate and improve performance of
your dlls, each should have a unique base address and not overlap any
other dlls. The default is 0x400000 for executables, and 0x10000000
for dlls.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --kill-at
@item --kill-at
If given, the stdcall suffixes (@@@var{nn}) will be stripped from
symbols before they are exported.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --major-image-version
@item --major-image-version @var{value}
-Sets the major number of the "image version". Defaults to 1.
+Sets the major number of the ``image version''. Defaults to 1.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --major-os-version
@item --major-os-version @var{value}
-Sets the major number of the "os version". Defaults to 4.
+Sets the major number of the ``os version''. Defaults to 4.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --major-subsystem-version
@item --major-subsystem-version @var{value}
-Sets the major number of the "subsystem version". Defaults to 4.
+Sets the major number of the ``subsystem version''. Defaults to 4.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --minor-image-version
@item --minor-image-version @var{value}
-Sets the minor number of the "image version". Defaults to 0.
+Sets the minor number of the ``image version''. Defaults to 0.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --minor-os-version
@item --minor-os-version @var{value}
-Sets the minor number of the "os version". Defaults to 0.
+Sets the minor number of the ``os version''. Defaults to 0.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --minor-subsystem-version
@item --minor-subsystem-version @var{value}
-Sets the minor number of the "subsystem version". Defaults to 0.
+Sets the minor number of the ``subsystem version''. Defaults to 0.
+[This option is specific to the i386 PE targeted port of the linker]
@cindex DEF files, creating
@cindex DLLs, creating
@@ -1741,6 +1920,7 @@ file corresponding to the DLL the linker is generating. This DEF file
(which should be called @code{*.def}) may be used to create an import
library with @code{dlltool} or may be used as a reference to
automatically or implicitly exported symbols.
+[This option is specific to the i386 PE targeted port of the linker]
@cindex DLLs, creating
@kindex --out-implib
@@ -1748,9 +1928,10 @@ automatically or implicitly exported symbols.
The linker will create the file @var{file} which will contain an
import lib corresponding to the DLL the linker is generating. This
import lib (which should be called @code{*.dll.a} or @code{*.a}
-may be used to link clients against the generated DLL; this behavior
+may be used to link clients against the generated DLL; this behaviour
makes it possible to skip a separate @code{dlltool} import library
creation step.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --enable-auto-image-base
@item --enable-auto-image-base
@@ -1759,29 +1940,37 @@ using the @code{--image-base} argument. By using a hash generated
from the dllname to create unique image bases for each DLL, in-memory
collisions and relocations which can delay program execution are
avoided.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --disable-auto-image-base
@item --disable-auto-image-base
Do not automatically generate a unique image base. If there is no
user-specified image base (@code{--image-base}) then use the platform
default.
+[This option is specific to the i386 PE targeted port of the linker]
@cindex DLLs, linking to
@kindex --dll-search-prefix
@item --dll-search-prefix @var{string}
-When linking dynamically to a dll without an import library, i
+When linking dynamically to a dll without an import library,
search for @code{<string><basename>.dll} in preference to
-@code{lib<basename>.dll}. This behavior allows easy distinction
+@code{lib<basename>.dll}. This behaviour allows easy distinction
between DLLs built for the various "subplatforms": native, cygwin,
uwin, pw, etc. For instance, cygwin DLLs typically use
@code{--dll-search-prefix=cyg}.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --enable-auto-import
@item --enable-auto-import
Do sophisticated linking of @code{_symbol} to @code{__imp__symbol} for
DATA imports from DLLs, and create the necessary thunking symbols when
-building the DLLs with those DATA exports. This generally will 'just
-work' -- but sometimes you may see this message:
+building the import libraries with those DATA exports. Note: Use of the
+'auto-import' extension will cause the text section of the image file
+to be made writable. This does not conform to the PE-COFF format
+specification published by Microsoft.
+
+Using 'auto-import' generally will 'just work' -- but sometimes you may
+see this message:
"variable '<var>' can't be auto-imported. Please read the
documentation for ld's @code{--enable-auto-import} for details."
@@ -1799,7 +1988,11 @@ the warning, and exit.
There are several ways to address this difficulty, regardless of the
data type of the exported variable:
-One solution is to force one of the 'constants' to be a variable --
+One way is to use --enable-runtime-pseudo-reloc switch. This leaves the task
+of adjusting references in your client code for runtime environment, so
+this method works only when runtime environment supports this feature.
+
+A second solution is to force one of the 'constants' to be a variable --
that is, unknown and un-optimizable at compile time. For arrays,
there are two possibilities: a) make the indexee (the array's address)
a variable, or b) make the 'constant' index a variable. Thus:
@@ -1835,9 +2028,9 @@ extern_ll -->
@{ volatile long long * local_ll=&extern_ll; *local_ll @}
@end example
-A second method of dealing with this difficulty is to abandon
+A third method of dealing with this difficulty is to abandon
'auto-import' for the offending symbol and mark it with
-@code{__declspec(dllimport)}. However, in practice that
+@code{__declspec(dllimport)}. However, in practise that
requires using compile-time #defines to indicate whether you are
building a DLL, building client code that will link to the DLL, or
merely building/linking to a static library. In making the choice
@@ -1886,24 +2079,42 @@ void main(int argc, char **argv)@{
@}
@end example
-A third way to avoid this problem is to re-code your
+A fourth way to avoid this problem is to re-code your
library to use a functional interface rather than a data interface
for the offending variables (e.g. set_foo() and get_foo() accessor
functions).
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --disable-auto-import
@item --disable-auto-import
-Do not attempt to do sophisticalted linking of @code{_symbol} to
+Do not attempt to do sophisticated linking of @code{_symbol} to
@code{__imp__symbol} for DATA imports from DLLs.
+[This option is specific to the i386 PE targeted port of the linker]
+
+@kindex --enable-runtime-pseudo-reloc
+@item --enable-runtime-pseudo-reloc
+If your code contains expressions described in --enable-auto-import section,
+that is, DATA imports from DLL with non-zero offset, this switch will create
+a vector of 'runtime pseudo relocations' which can be used by runtime
+environment to adjust references to such data in your client code.
+[This option is specific to the i386 PE targeted port of the linker]
+
+@kindex --disable-runtime-pseudo-reloc
+@item --disable-runtime-pseudo-reloc
+Do not create pseudo relocations for non-zero offset DATA imports from
+DLLs. This is the default.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --enable-extra-pe-debug
@item --enable-extra-pe-debug
Show additional debug info related to auto-import symbol thunking.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --section-alignment
@item --section-alignment
Sets the section alignment. Sections in memory will always begin at
addresses which are a multiple of this number. Defaults to 0x1000.
+[This option is specific to the i386 PE targeted port of the linker]
@cindex stack size
@kindex --stack
@@ -1912,6 +2123,7 @@ addresses which are a multiple of this number. Defaults to 0x1000.
Specify the amount of memory to reserve (and optionally commit) to be
used as stack for this program. The default is 2Mb reserved, 4K
committed.
+[This option is specific to the i386 PE targeted port of the linker]
@kindex --subsystem
@item --subsystem @var{which}
@@ -1921,6 +2133,7 @@ Specifies the subsystem under which your program will execute. The
legal values for @var{which} are @code{native}, @code{windows},
@code{console}, and @code{posix}. You may optionally set the
subsystem version also.
+[This option is specific to the i386 PE targeted port of the linker]
@end table
@@ -1932,9 +2145,13 @@ subsystem version also.
@c man begin ENVIRONMENT
-You can change the behavior of @command{ld} with the environment variables
-@code{GNUTARGET}, @code{LDEMULATION}, and @code{COLLECT_NO_DEMANGLE}.
+You can change the behaviour of @command{ld} with the environment variables
+@ifclear SingleFormat
+@code{GNUTARGET},
+@end ifclear
+@code{LDEMULATION} and @code{COLLECT_NO_DEMANGLE}.
+@ifclear SingleFormat
@kindex GNUTARGET
@cindex default input format
@code{GNUTARGET} determines the input-file object format if you don't
@@ -1948,6 +2165,7 @@ there is no method of ensuring that the magic number used to specify
object-file formats is unique. However, the configuration procedure for
BFD on each system places the conventional format for that system first
in the search-list, so ambiguities are resolved in favor of convention.
+@end ifclear
@kindex LDEMULATION
@cindex default emulation
@@ -2174,7 +2392,7 @@ In this section we describe the simple linker script commands.
@end menu
@node Entry Point
-@subsection Setting the entry point
+@subsection Setting the Entry Point
@kindex ENTRY(@var{symbol})
@cindex start of execution
@cindex first instruction
@@ -2203,7 +2421,7 @@ The address @code{0}.
@end itemize
@node File Commands
-@subsection Commands dealing with files
+@subsection Commands Dealing with Files
@cindex linker script file commands
Several linker script commands deal with files.
@@ -2232,10 +2450,13 @@ then you can put @samp{INPUT (subr.o)} in your linker script.
In fact, if you like, you can list all of your input files in the linker
script, and then invoke the linker with nothing but a @samp{-T} option.
-The linker will first try to open the file in the current directory. If
-it is not found, the linker will search through the archive library
-search path. See the description of @samp{-L} in @ref{Options,,Command
-Line Options}.
+In case a @dfn{sysroot prefix} is configured, and the filename starts
+with the @samp{/} character, and the script being processed was
+located inside the @dfn{sysroot prefix}, the filename will be looked
+for in the @dfn{sysroot prefix}. Otherwise, the linker will try to
+open the file in the current directory. If it is not found, the
+linker will search through the archive library search path. See the
+description of @samp{-L} in @ref{Options,,Command Line Options}.
If you use @samp{INPUT (-l@var{file})}, @command{ld} will transform the
name to @code{lib@var{file}.a}, as with the command line argument
@@ -2290,7 +2511,7 @@ first file.
@ifclear SingleFormat
@node Format Commands
-@subsection Commands dealing with object file formats
+@subsection Commands Dealing with Object File Formats
A couple of linker script commands deal with object file formats.
@table @code
@@ -2337,7 +2558,7 @@ command is also used to set the format for the output file. @xref{BFD}.
@end ifclear
@node Miscellaneous Commands
-@subsection Other linker script commands
+@subsection Other Linker Script Commands
There are a few other linker scripts commands.
@table @code
@@ -2504,7 +2725,7 @@ If the program references @samp{etext} but does not define it, the
linker will use the definition in the linker script.
@node SECTIONS
-@section SECTIONS command
+@section SECTIONS Command
@kindex SECTIONS
The @code{SECTIONS} command tells the linker how to map input sections
into output sections, and how to place the output sections in memory.
@@ -2561,11 +2782,12 @@ in the first input file. The first section will be at address zero.
@end menu
@node Output Section Description
-@subsection Output section description
+@subsection Output Section Description
The full description of an output section looks like this:
@smallexample
@group
-@var{section} [@var{address}] [(@var{type})] : [AT(@var{lma})]
+@var{section} [@var{address}] [(@var{type})] :
+ [AT(@var{lma})] [SUBALIGN(@var{subsection_align})]
@{
@var{output-section-command}
@var{output-section-command}
@@ -2594,7 +2816,7 @@ a special output section keyword (@pxref{Output Section Keywords})
@end itemize
@node Output Section Name
-@subsection Output section name
+@subsection Output Section Name
@cindex name, section
@cindex section name
The name of the output section is @var{section}. @var{section} must
@@ -2612,7 +2834,7 @@ The output section name @samp{/DISCARD/} is special; @ref{Output Section
Discarding}.
@node Output Section Address
-@subsection Output section address
+@subsection Output Section Description
@cindex address, section
@cindex section address
The @var{address} is an expression for the VMA (the virtual memory
@@ -2659,7 +2881,7 @@ Specifying @var{address} for a section will change the value of the
location counter.
@node Input Section
-@subsection Input section description
+@subsection Input Section Description
@cindex input sections
@cindex mapping input sections to output sections
The most common output section command is an input section description.
@@ -2678,7 +2900,7 @@ map the input files into your memory layout.
@end menu
@node Input Section Basics
-@subsubsection Input section basics
+@subsubsection Input Section Basics
@cindex input section basics
An input section description consists of a file name optionally followed
by a list of section names in parentheses.
@@ -2739,7 +2961,7 @@ though it appeared on the command line. Note that this differs from an
the archive search path.
@node Input Section Wildcards
-@subsubsection Input section wildcard patterns
+@subsubsection Input Section Wildcard Patterns
@cindex input section wildcards
@cindex wildcard file name patterns
@cindex file name wildcard patterns
@@ -2816,7 +3038,7 @@ SECTIONS @{
@end smallexample
@node Input Section Common
-@subsubsection Input section for common symbols
+@subsubsection Input Section for Common Symbols
@cindex common symbol placement
@cindex uninitialized data placement
A special notation is needed for common symbols, because in many object
@@ -2852,7 +3074,7 @@ notation is now considered obsolete. It is equivalent to
@samp{*(COMMON)}.
@node Input Section Keep
-@subsubsection Input section and garbage collection
+@subsubsection Input Section and Garbage Collection
@cindex KEEP
@cindex garbage collection
When link-time garbage collection is in use (@samp{--gc-sections}),
@@ -2862,7 +3084,7 @@ with @code{KEEP()}, as in @code{KEEP(*(.init))} or
@code{KEEP(SORT(*)(.ctors))}.
@node Input Section Example
-@subsubsection Input section example
+@subsubsection Input Section Example
The following example is a complete linker script. It tells the linker
to read all of the sections from file @file{all.o} and place them at the
start of output section @samp{outputa} which starts at location
@@ -2881,11 +3103,15 @@ SECTIONS @{
all.o
foo.o (.input1)
@}
+@end group
+@group
outputb :
@{
foo.o (.input2)
foo1.o (.input1)
@}
+@end group
+@group
outputc :
@{
*(.input1)
@@ -2896,7 +3122,7 @@ SECTIONS @{
@end smallexample
@node Output Section Data
-@subsection Output section data
+@subsection Output Section Data
@cindex data
@cindex section data
@cindex output section data
@@ -2936,7 +3162,7 @@ When the object file format does not have an explicit endianness, as is
true of, for example, S-records, the value will be stored in the
endianness of the first input object file.
-Note - these commands only work inside a section description and not
+Note---these commands only work inside a section description and not
between them, so the following will produce an error from the linker:
@smallexample
SECTIONS @{@ .text : @{@ *(.text) @}@ LONG(1) .data : @{@ *(.data) @}@ @}@
@@ -2973,7 +3199,7 @@ precedence. @xref{Output Section Fill}, for details on the fill
expression.
@node Output Section Keywords
-@subsection Output section keywords
+@subsection Output Section Keywords
There are a couple of keywords which can appear as output section
commands.
@@ -3052,7 +3278,7 @@ scripts.
@end table
@node Output Section Discarding
-@subsection Output section discarding
+@subsection Output Section Discarding
@cindex discarding sections
@cindex sections, discarding
@cindex removing sections
@@ -3076,13 +3302,14 @@ input sections. Any input sections which are assigned to an output
section named @samp{/DISCARD/} are not included in the output file.
@node Output Section Attributes
-@subsection Output section attributes
+@subsection Output Section Attributes
@cindex output section attributes
We showed above that the full description of an output section looked
like this:
@smallexample
@group
-@var{section} [@var{address}] [(@var{type})] : [AT(@var{lma})]
+@var{section} [@var{address}] [(@var{type})] :
+ [AT(@var{lma})] [SUBALIGN(@var{subsection_align})]
@{
@var{output-section-command}
@var{output-section-command}
@@ -3097,13 +3324,14 @@ remaining section attributes.
@menu
* Output Section Type:: Output section type
* Output Section LMA:: Output section LMA
+* Forced Input Alignment:: Forced Input Alignment
* Output Section Region:: Output section region
* Output Section Phdr:: Output section phdr
* Output Section Fill:: Output section fill
@end menu
@node Output Section Type
-@subsubsection Output section type
+@subsubsection Output Section Type
Each output section may have a type. The type is a keyword in
parentheses. The following types are defined:
@@ -3140,7 +3368,7 @@ SECTIONS @{
@end smallexample
@node Output Section LMA
-@subsubsection Output section LMA
+@subsubsection Output Section LMA
@kindex AT>@var{lma_region}
@kindex AT(@var{lma})
@cindex load address
@@ -3153,8 +3381,13 @@ Address}).
The linker will normally set the LMA equal to the VMA. You can change
that by using the @code{AT} keyword. The expression @var{lma} that
follows the @code{AT} keyword specifies the load address of the
-section. Alternatively, with @samp{AT>@var{lma_region}} expression,
-you may specify a memory region for the section's load address. @xref{MEMORY}.
+section.
+
+Alternatively, with @samp{AT>@var{lma_region}} expression, you may
+specify a memory region for the section's load address. @xref{MEMORY}.
+Note that if the section has not had a VMA assigned to it then the
+linker will use the @var{lma_region} as the VMA region as well.
+@xref{Output Section Region}.
@cindex ROM initialized data
@cindex initialized data in ROM
@@ -3204,8 +3437,17 @@ for (dst = &_bstart; dst< &_bend; dst++)
@end group
@end smallexample
+@node Forced Input Alignment
+@subsubsection Forced Input Alignment
+@kindex SUBALIGN(@var{subsection_align})
+@cindex forcing input section alignment
+@cindex input section alignment
+You can force input section alignment within an output section by using
+SUBALIGN. The value specified overrides any alignment given by input
+sections, whether larger or smaller.
+
@node Output Section Region
-@subsubsection Output section region
+@subsubsection Output Section Region
@kindex >@var{region}
@cindex section, assigning to memory region
@cindex memory regions and sections
@@ -3221,7 +3463,7 @@ SECTIONS @{ ROM : @{ *(.text) @} >rom @}
@end smallexample
@node Output Section Phdr
-@subsubsection Output section phdr
+@subsubsection Output Section Phdr
@kindex :@var{phdr}
@cindex section, assigning to program header
@cindex program headers and sections
@@ -3241,7 +3483,7 @@ SECTIONS @{ .text : @{ *(.text) @} :text @}
@end smallexample
@node Output Section Fill
-@subsubsection Output section fill
+@subsubsection Output Section Fill
@kindex =@var{fillexp}
@cindex section fill pattern
@cindex fill pattern, entire section
@@ -3269,7 +3511,7 @@ SECTIONS @{ .text : @{ *(.text) @} =0x90909090 @}
@end smallexample
@node Overlay Description
-@subsection Overlay description
+@subsection Overlay Description
@kindex OVERLAY
@cindex overlays
An overlay description provides an easy way to describe sections which
@@ -3383,7 +3625,7 @@ example could have been written identically as follows.
@end smallexample
@node MEMORY
-@section MEMORY command
+@section MEMORY Command
@kindex MEMORY
@cindex memory regions
@cindex regions of memory
@@ -3718,7 +3960,7 @@ and @samp{bar2} are bound to the version node @samp{VERS_2.0}.
When the linker finds a symbol defined in a library which is not
specifically bound to a version node, it will effectively bind it to an
unspecified base version of the library. You can bind all otherwise
-unspecified symbols to a given version node by using @samp{global: *}
+unspecified symbols to a given version node by using @samp{global: *;}
somewhere in the version script.
The names of the version nodes have no specific meaning other than what
@@ -3732,7 +3974,7 @@ symbols, only selects which symbols will be globally visible out and which
won't.
@smallexample
-@{ global: foo; bar; local: *; @}
+@{ global: foo; bar; local: *; @};
@end smallexample
When you link an application against a shared library that has versioned
@@ -3801,7 +4043,7 @@ you would effectively have multiple definitions of the same symbol.
If you wish to bind a reference to a specific version of the symbol
within the shared library, you can use the aliases of convenience
-(i.e. @samp{old_foo}), or you can use the @samp{.symver} directive to
+(i.e., @samp{old_foo}), or you can use the @samp{.symver} directive to
specifically bind to an external version of the function in question.
You can also specify the language in the version script:
@@ -3857,20 +4099,20 @@ hexadecimal. The linker considers other integers to be decimal.
In addition, you can use the suffixes @code{K} and @code{M} to scale a
constant by
@c TEXI2ROFF-KILL
-@ifinfo
+@ifnottex
@c END TEXI2ROFF-KILL
@code{1024} or @code{1024*1024}
@c TEXI2ROFF-KILL
-@end ifinfo
+@end ifnottex
@tex
${\rm 1024}$ or ${\rm 1024}^2$
@end tex
@c END TEXI2ROFF-KILL
respectively. For example, the following all refer to the same quantity:
@smallexample
- _fourk_1 = 4K;
- _fourk_2 = 4096;
- _fourk_3 = 0x1000;
+_fourk_1 = 4K;
+_fourk_2 = 4096;
+_fourk_3 = 0x1000;
@end smallexample
@node Symbols
@@ -3885,8 +4127,8 @@ Unquoted symbol names must not conflict with any keywords. You can
specify a symbol which contains odd characters or has the same name as a
keyword by surrounding the symbol name in double quotes:
@smallexample
- "SECTION" = 9;
- "with a space" = "also with a space" + 10;
+"SECTION" = 9;
+"with a space" = "also with a space" + 10;
@end smallexample
Since symbols can contain many non-alphabetic characters, it is safest
@@ -3934,7 +4176,7 @@ specifies what data to write in the gaps (@pxref{Output Section Fill}).
@cindex dot inside sections
Note: @code{.} actually refers to the byte offset from the start of the
current containing object. Normally this is the @code{SECTIONS}
-statement, whoes start address is 0, hence @code{.} can be used as an
+statement, whose start address is 0, hence @code{.} can be used as an
absolute address. If @code{.} is used inside a section description
however, it refers to the byte offset from the start of that section,
not an absolute address. Thus in a script like this:
@@ -3973,7 +4215,7 @@ the @samp{.data} output section itself.
The linker recognizes the standard C set of arithmetic operators, with
the standard bindings and precedence levels:
@c TEXI2ROFF-KILL
-@ifinfo
+@ifnottex
@c END TEXI2ROFF-KILL
@smallexample
precedence associativity Operators Notes
@@ -3995,7 +4237,7 @@ Notes:
(1) Prefix operators
(2) @xref{Assignments}.
@c TEXI2ROFF-KILL
-@end ifinfo
+@end ifnottex
@tex
\vskip \baselineskip
%"lispnarrowing" is the extra indent used generally for smallexample
@@ -4153,17 +4395,25 @@ SECTIONS @{ @dots{}
@end group
@end smallexample
-@item ALIGN(@var{exp})
-@kindex ALIGN(@var{exp})
+@item ALIGN(@var{align})
+@itemx ALIGN(@var{exp},@var{align})
+@kindex ALIGN(@var{align})
+@kindex ALIGN(@var{exp},@var{align})
@cindex round up location counter
@cindex align location counter
-Return the location counter (@code{.}) aligned to the next @var{exp}
-boundary.
-@code{ALIGN} doesn't change the value of the location counter---it just
-does arithmetic on it. Here is an example which aligns the output
-@code{.data} section to the next @code{0x2000} byte boundary after the
-preceding section and sets a variable within the section to the next
-@code{0x8000} boundary after the input sections:
+@cindex round up expression
+@cindex align expression
+Return the location counter (@code{.}) or arbitrary expression aligned
+to the next @var{align} boundary. The single operand @code{ALIGN}
+doesn't change the value of the location counter---it just does
+arithmetic on it. The two operand @code{ALIGN} allows an arbitrary
+expression to be aligned upwards (@code{ALIGN(@var{align})} is
+equivalent to @code{ALIGN(., @var{align})}).
+
+Here is an example which aligns the output @code{.data} section to the
+next @code{0x2000} byte boundary after the preceding section and sets a
+variable within the section to the next @code{0x8000} boundary after the
+input sections:
@smallexample
@group
SECTIONS @{ @dots{}
@@ -4231,7 +4481,8 @@ evaluation purposes.
@kindex DEFINED(@var{symbol})
@cindex symbol defaults
Return 1 if @var{symbol} is in the linker global symbol table and is
-defined, otherwise return 0. You can use this function to provide
+defined before the statement using DEFINED in the script, otherwise
+return 0. You can use this function to provide
default values for symbols. For example, the following script fragment
shows how to set a global symbol @samp{begin} to the first location in
the @samp{.text} section---but if a symbol called @samp{begin} already
@@ -4345,21 +4596,36 @@ sections describe them. Machines where @command{ld} has no additional
functionality are not listed.
@menu
-* H8/300:: @code{ld} and the H8/300
-* i960:: @code{ld} and the Intel 960 family
-* ARM:: @code{ld} and the ARM family
-* HPPA ELF32:: @code{ld} and HPPA 32-bit ELF
+@ifset H8300
+* H8/300:: @command{ld} and the H8/300
+@end ifset
+@ifset I960
+* i960:: @command{ld} and the Intel 960 family
+@end ifset
+@ifset ARM
+* ARM:: @command{ld} and the ARM family
+@end ifset
+@ifset HPPA
+* HPPA ELF32:: @command{ld} and HPPA 32-bit ELF
+@end ifset
@ifset MMIX
-* MMIX:: @code{ld} and MMIX
+* MMIX:: @command{ld} and MMIX
+@end ifset
+@ifset MSP430
+* MSP430:: @command{ld} and MSP430
@end ifset
@ifset TICOFF
* TI COFF:: @command{ld} and TI COFF
@end ifset
+@ifset WIN32
+* WIN32:: @command{ld} and WIN32 (cygwin/mingw)
+@end ifset
+@ifset XTENSA
+* Xtensa:: @command{ld} and Xtensa Processors
+@end ifset
@end menu
@end ifset
-@c FIXME! This could use @raisesections/@lowersections, but there seems to be a conflict
-@c between those and node-defaulting.
@ifset H8300
@ifclear GENERIC
@raisesections
@@ -4397,15 +4663,15 @@ top page of memory).
@end ifset
@ifclear GENERIC
-@ifset Hitachi
+@ifset Renesas
@c This stuff is pointless to say unless you're especially concerned
-@c with Hitachi chips; don't enable it for generic case, please.
-@node Hitachi
-@chapter @command{ld} and other Hitachi chips
+@c with Renesas chips; don't enable it for generic case, please.
+@node Renesas
+@chapter @command{ld} and Other Renesas Chips
-@command{ld} also supports the H8/300H, the H8/500, and the Hitachi SH. No
-special features, commands, or command-line options are required for
-these chips.
+@command{ld} also supports the Renesas (formerly Hitachi) H8/300H,
+H8/500, and SH chips. No special features, commands, or command-line
+options are required for these chips.
@end ifset
@end ifclear
@@ -4415,7 +4681,7 @@ these chips.
@end ifclear
@node i960
-@section @command{ld} and the Intel 960 family
+@section @command{ld} and the Intel 960 Family
@cindex i960 support
@@ -4466,12 +4732,13 @@ not itself call any subroutines).
@end ifclear
@end ifset
+@ifset ARM
@ifclear GENERIC
@raisesections
@end ifclear
@node ARM
-@section @command{ld}'s support for interworking between ARM and Thumb code
+@section @command{ld}'s Support for Interworking Between ARM and Thumb Code
@cindex ARM interworking support
@kindex --support-old-code
@@ -4495,8 +4762,18 @@ But it also sets the bottom bit of the address, so that it can be
branched to using a BX instruction, and the program will start
executing in Thumb mode straight away.
+@ifclear GENERIC
+@lowersections
+@end ifclear
+@end ifset
+
+@ifset HPPA
+@ifclear GENERIC
+@raisesections
+@end ifclear
+
@node HPPA ELF32
-@section @command{ld} and HPPA 32-bit ELF support
+@section @command{ld} and HPPA 32-bit ELF Support
@cindex HPPA multiple sub-space stubs
@kindex --multi-subspace
When generating a shared library, @command{ld} will by default generate
@@ -4527,10 +4804,19 @@ single input section larger than the group size specified will of course
create a larger group (of one section). If input sections are too
large, it may not be possible for a branch to reach its stub.
+@ifclear GENERIC
+@lowersections
+@end ifclear
+@end ifset
+
@ifset MMIX
+@ifclear GENERIC
+@raisesections
+@end ifclear
+
@node MMIX
@section @code{ld} and MMIX
-For MMIX, there is choice of generating @code{ELF} object files or
+For MMIX, there is a choice of generating @code{ELF} object files or
@code{mmo} object files when linking. The simulator @code{mmix}
understands the @code{mmo} format. The binutils @code{objcopy} utility
can translate between the two formats.
@@ -4551,11 +4837,60 @@ script uses these to set the default start address of a section.
Initial and trailing multiples of zero-valued 32-bit words in a section,
are left out from an mmo file.
+
+@ifclear GENERIC
+@lowersections
+@end ifclear
+@end ifset
+
+@ifset MSP430
+@ifclear GENERIC
+@raisesections
+@end ifclear
+
+@node MSP430
+@section @code{ld} and MSP430
+For the MSP430 it is possible to select the MPU architecture. The flag @samp{-m [mpu type]}
+will select an appropriate linker script for selected MPU type. (To get a list of known MPUs
+just pass @samp{-m help} option to the linker).
+
+@cindex MSP430 extra sections
+The linker will recognize some extra sections which are MSP430 specific:
+
+@table @code
+@item @samp{.vectors}
+Defines a portion of ROM where interrupt vectors located.
+
+@item @samp{.bootloader}
+Defines the bootloader portion of the ROM (if applicable). Any code
+in this section will be uploaded to the MPU.
+
+@item @samp{.infomem}
+Defines an information memory section (if applicable). Any code in
+this section will be uploaded to the MPU.
+
+@item @samp{.infomemnobits}
+This is the same as the @samp{.infomem} section except that any code
+in this section will not be uploaded to the MPU.
+
+@item @samp{.noinit}
+Denotes a portion of RAM located above @samp{.bss} section.
+
+The last two sections are used by gcc.
+@end table
+
+@ifclear GENERIC
+@lowersections
+@end ifclear
@end ifset
@ifset TICOFF
+@ifclear GENERIC
+@raisesections
+@end ifclear
+
@node TI COFF
-@section @command{ld}'s support for various TI COFF versions
+@section @command{ld}'s Support for Various TI COFF Versions
@cindex TI COFF versions
@kindex --format=@var{version}
The @samp{--format} switch allows selection of one of the various
@@ -4563,11 +4898,427 @@ TI COFF versions. The latest of this writing is 2; versions 0 and 1 are
also supported. The TI COFF versions also vary in header byte-order
format; @command{ld} will read any version or byte order, but the output
header format depends on the default specified by the specific target.
+
+@ifclear GENERIC
+@lowersections
+@end ifclear
@end ifset
+@ifset WIN32
+@ifclear GENERIC
+@raisesections
+@end ifclear
+
+@node WIN32
+@section @command{ld} and WIN32 (cygwin/mingw)
+
+This section describes some of the win32 specific @command{ld} issues.
+See @ref{Options,,Command Line Options} for detailed decription of the
+command line options mentioned here.
+
+@table @emph
+@cindex import libraries
+@item import libraries
+The standard Windows linker creates and uses so-called import
+libraries, which contains information for linking to dll's. They are
+regular static archives and are handled as any other static
+archive. The cygwin and mingw ports of @command{ld} have specific
+support for creating such libraries provided with the
+@samp{--out-implib} command line option.
+
+@item exporting DLL symbols
+@cindex exporting DLL symbols
+The cygwin/mingw @command{ld} has several ways to export symbols for dll's.
+
+@table @emph
+@item using auto-export functionality
+@cindex using auto-export functionality
+By default @command{ld} exports symbols with the auto-export functionality,
+which is controlled by the following command line options:
+
+@itemize
+@item --export-all-symbols [This is the default]
+@item --exclude-symbols
+@item --exclude-libs
+@end itemize
+
+If, however, @samp{--export-all-symbols} is not given explicitly on the
+command line, then the default auto-export behavior will be @emph{disabled}
+if either of the following are true:
+
+@itemize
+@item A DEF file is used.
+@item Any symbol in any object file was marked with the __declspec(dllexport) attribute.
+@end itemize
+
+@item using a DEF file
+@cindex using a DEF file
+Another way of exporting symbols is using a DEF file. A DEF file is
+an ASCII file containing definitions of symbols which should be
+exported when a dll is created. Usually it is named @samp{<dll
+name>.def} and is added as any other object file to the linker's
+command line. The file's name must end in @samp{.def} or @samp{.DEF}.
+
+@example
+gcc -o <output> <objectfiles> <dll name>.def
+@end example
+
+Using a DEF file turns off the normal auto-export behavior, unless the
+@samp{--export-all-symbols} option is also used.
+
+Here is an example of a DEF file for a shared library called @samp{xyz.dll}:
+
+@example
+LIBRARY "xyz.dll" BASE=0x10000000
+
+EXPORTS
+foo
+bar
+_bar = bar
+@end example
+
+This example defines a base address and three symbols. The third
+symbol is an alias for the second. For the complete format
+specification see ld/deffilep.y in the binutils sources.
+
+@cindex creating a DEF file
+While linking a shared dll, @command{ld} is able to create a DEF file
+with the @samp{--output-def <file>} command line option.
+
+@item Using decorations
+@cindex Using decorations
+Another way of marking symbols for export is to modify the source code
+itself, so that when building the DLL each symbol to be exported is
+declared as:
+
+@example
+__declspec(dllexport) int a_variable
+__declspec(dllexport) void a_function(int with_args)
+@end example
+
+All such symbols will be exported from the DLL. If, however,
+any of the object files in the DLL contain symbols decorated in
+this way, then the normal auto-export behavior is disabled, unless
+the @samp{--export-all-symbols} option is also used.
+
+Note that object files that wish to access these symbols must @emph{not}
+decorate them with dllexport. Instead, they should use dllimport,
+instead:
+
+@example
+__declspec(dllimport) int a_variable
+__declspec(dllimport) void a_function(int with_args)
+@end example
+
+This complicates the structure of library header files, because
+when included by the library itself the header must declare the
+variables and functions as dllexport, but when included by client
+code the header must declare them as dllimport. There are a number
+of idioms that are typically used to do this; often client code can
+omit the __declspec() declaration completely. See
+@samp{--enable-auto-import} and @samp{automatic data imports} for more
+imformation.
+@end table
+
+@cindex automatic data imports
+@item automatic data imports
+The standard Windows dll format supports data imports from dlls only
+by adding special decorations (dllimport/dllexport), which let the
+compiler produce specific assembler instructions to deal with this
+issue. This increases the effort necessary to port existing Un*x
+code to these platforms, especially for large
+c++ libraries and applications. The auto-import feature, which was
+initially provided by Paul Sokolovsky, allows one to omit the
+decorations to archieve a behavior that conforms to that on POSIX/Un*x
+platforms. This feature is enabled with the @samp{--enable-auto-import}
+command-line option, although it is enabled by default on cygwin/mingw.
+The @samp{--enable-auto-import} option itself now serves mainly to
+suppress any warnings that are ordinarily emitted when linked objects
+trigger the feature's use.
+
+auto-import of variables does not always work flawlessly without
+additional assistance. Sometimes, you will see this message
+
+"variable '<var>' can't be auto-imported. Please read the
+documentation for ld's @code{--enable-auto-import} for details."
+
+The @samp{--enable-auto-import} documentation explains why this error
+occurs, and several methods that can be used to overcome this difficulty.
+One of these methods is the @emph{runtime pseudo-relocs} feature, described
+below.
+
+@cindex runtime pseudo-relocation
+For complex variables imported from DLLs (such as structs or classes),
+object files typically contain a base address for the variable and an
+offset (@emph{addend}) within the variable--to specify a particular
+field or public member, for instance. Unfortunately, the runtime loader used
+in win32 environments is incapable of fixing these references at runtime
+without the additional information supplied by dllimport/dllexport decorations.
+The standard auto-import feature described above is unable to resolve these
+references.
+
+The @samp{--enable-runtime-pseudo-relocs} switch allows these references to
+be resolved without error, while leaving the task of adjusting the references
+themselves (with their non-zero addends) to specialized code provided by the
+runtime environment. Recent versions of the cygwin and mingw environments and
+compilers provide this runtime support; older versions do not. However, the
+support is only necessary on the developer's platform; the compiled result will
+run without error on an older system.
+
+@samp{--enable-runtime-pseudo-relocs} is not the default; it must be explicitly
+enabled as needed.
+
+@cindex direct linking to a dll
+@item direct linking to a dll
+The cygwin/mingw ports of @command{ld} support the direct linking,
+including data symbols, to a dll without the usage of any import
+libraries. This is much faster and uses much less memory than does the
+traditional import library method, expecially when linking large
+libraries or applications. When @command{ld} creates an import lib, each
+function or variable exported from the dll is stored in its own bfd, even
+though a single bfd could contain many exports. The overhead involved in
+storing, loading, and processing so many bfd's is quite large, and explains the
+tremendous time, memory, and storage needed to link against particularly
+large or complex libraries when using import libs.
+
+Linking directly to a dll uses no extra command-line switches other than
+@samp{-L} and @samp{-l}, because @command{ld} already searches for a number
+of names to match each library. All that is needed from the developer's
+perspective is an understanding of this search, in order to force ld to
+select the dll instead of an import library.
+
+
+For instance, when ld is called with the argument @samp{-lxxx} it will attempt
+to find, in the first directory of its search path,
+
+@example
+libxxx.dll.a
+xxx.dll.a
+libxxx.a
+cygxxx.dll (*)
+libxxx.dll
+xxx.dll
+@end example
+
+before moving on to the next directory in the search path.
+
+(*) Actually, this is not @samp{cygxxx.dll} but in fact is @samp{<prefix>xxx.dll},
+where @samp{<prefix>} is set by the @command{ld} option
+@samp{--dll-search-prefix=<prefix>}. In the case of cygwin, the standard gcc spec
+file includes @samp{--dll-search-prefix=cyg}, so in effect we actually search for
+@samp{cygxxx.dll}.
+
+Other win32-based unix environments, such as mingw or pw32, may use other
+@samp{<prefix>}es, although at present only cygwin makes use of this feature. It
+was originally intended to help avoid name conflicts among dll's built for the
+various win32/un*x environments, so that (for example) two versions of a zlib dll
+could coexist on the same machine.
+
+The generic cygwin/mingw path layout uses a @samp{bin} directory for
+applications and dll's and a @samp{lib} directory for the import
+libraries (using cygwin nomenclature):
+
+@example
+bin/
+ cygxxx.dll
+lib/
+ libxxx.dll.a (in case of dll's)
+ libxxx.a (in case of static archive)
+@end example
+
+Linking directly to a dll without using the import library can be
+done two ways:
+
+1. Use the dll directly by adding the @samp{bin} path to the link line
+@example
+gcc -Wl,-verbose -o a.exe -L../bin/ -lxxx
+@end example
+
+However, as the dll's often have version numbers appended to their names
+(@samp{cygncurses-5.dll}) this will often fail, unless one specifies
+@samp{-L../bin -lncurses-5} to include the version. Import libs are generally
+not versioned, and do not have this difficulty.
+
+2. Create a symbolic link from the dll to a file in the @samp{lib}
+directory according to the above mentioned search pattern. This
+should be used to avoid unwanted changes in the tools needed for
+making the app/dll.
+
+@example
+ln -s bin/cygxxx.dll lib/[cyg|lib|]xxx.dll[.a]
+@end example
+
+Then you can link without any make environment changes.
+
+@example
+gcc -Wl,-verbose -o a.exe -L../lib/ -lxxx
+@end example
+
+This technique also avoids the version number problems, because the following is
+perfectly legal
+
+@example
+bin/
+ cygxxx-5.dll
+lib/
+ libxxx.dll.a -> ../bin/cygxxx-5.dll
+@end example
+
+Linking directly to a dll without using an import lib will work
+even when auto-import features are exercised, and even when
+@samp{--enable-runtime-pseudo-relocs} is used.
+
+Given the improvements in speed and memory usage, one might justifiably
+wonder why import libraries are used at all. There are two reasons:
+
+1. Until recently, the link-directly-to-dll functionality did @emph{not}
+work with auto-imported data.
+
+2. Sometimes it is necessary to include pure static objects within the
+import library (which otherwise contains only bfd's for indirection
+symbols that point to the exports of a dll). Again, the import lib
+for the cygwin kernel makes use of this ability, and it is not
+possible to do this without an import lib.
+
+So, import libs are not going away. But the ability to replace
+true import libs with a simple symbolic link to (or a copy of)
+a dll, in most cases, is a useful addition to the suite of tools
+binutils makes available to the win32 developer. Given the
+massive improvements in memory requirements during linking, storage
+requirements, and linking speed, we expect that many developers
+will soon begin to use this feature whenever possible.
+
+@item symbol aliasing
+@table @emph
+@item adding additional names
+Sometimes, it is useful to export symbols with additional names.
+A symbol @samp{foo} will be exported as @samp{foo}, but it can also be
+exported as @samp{_foo} by using special directives in the DEF file
+when creating the dll. This will affect also the optional created
+import library. Consider the following DEF file:
+
+@example
+LIBRARY "xyz.dll" BASE=0x61000000
+
+EXPORTS
+foo
+_foo = foo
+@end example
+
+The line @samp{_foo = foo} maps the symbol @samp{foo} to @samp{_foo}.
+
+Another method for creating a symbol alias is to create it in the
+source code using the "weak" attribute:
+
+@example
+void foo () @{ /* Do something. */; @}
+void _foo () __attribute__ ((weak, alias ("foo")));
+@end example
+
+See the gcc manual for more information about attributes and weak
+symbols.
+
+@item renaming symbols
+Sometimes it is useful to rename exports. For instance, the cygwin
+kernel does this regularly. A symbol @samp{_foo} can be exported as
+@samp{foo} but not as @samp{_foo} by using special directives in the
+DEF file. (This will also affect the import library, if it is
+created). In the following example:
+
+@example
+LIBRARY "xyz.dll" BASE=0x61000000
+
+EXPORTS
+_foo = foo
+@end example
+
+The line @samp{_foo = foo} maps the exported symbol @samp{foo} to
+@samp{_foo}.
+@end table
+
+Note: using a DEF file disables the default auto-export behavior,
+unless the @samp{--export-all-symbols} command line option is used.
+If, however, you are trying to rename symbols, then you should list
+@emph{all} desired exports in the DEF file, including the symbols
+that are not being renamed, and do @emph{not} use the
+@samp{--export-all-symbols} option. If you list only the
+renamed symbols in the DEF file, and use @samp{--export-all-symbols}
+to handle the other symbols, then the both the new names @emph{and}
+the original names for the renamed symbols will be exported.
+In effect, you'd be aliasing those symbols, not renaming them,
+which is probably not what you wanted.
+@end table
+
@ifclear GENERIC
@lowersections
@end ifclear
+@end ifset
+
+@ifset XTENSA
+@ifclear GENERIC
+@raisesections
+@end ifclear
+
+@node Xtensa
+@section @code{ld} and Xtensa Processors
+
+@cindex Xtensa processors
+The default @command{ld} behavior for Xtensa processors is to interpret
+@code{SECTIONS} commands so that lists of explicitly named sections in a
+specification with a wildcard file will be interleaved when necessary to
+keep literal pools within the range of PC-relative load offsets. For
+example, with the command:
+
+@smallexample
+SECTIONS
+@{
+ .text : @{
+ *(.literal .text)
+ @}
+@}
+@end smallexample
+
+@noindent
+@command{ld} may interleave some of the @code{.literal}
+and @code{.text} sections from different object files to ensure that the
+literal pools are within the range of PC-relative load offsets. A valid
+interleaving might place the @code{.literal} sections from an initial
+group of files followed by the @code{.text} sections of that group of
+files. Then, the @code{.literal} sections from the rest of the files
+and the @code{.text} sections from the rest of the files would follow.
+The non-interleaved order can still be specified as:
+
+@smallexample
+SECTIONS
+@{
+ .text : @{
+ *(.literal) *(.text)
+ @}
+@}
+@end smallexample
+
+@cindex @code{--relax} on Xtensa
+@cindex relaxing on Xtensa
+@kindex --no-relax
+The Xtensa version of @command{ld} enables the @option{--relax} option by
+default to attempt to reduce space in the output image by combining
+literals with identical values. It also provides the
+@option{--no-relax} option to disable this optimization. When enabled,
+the relaxation algorithm ensures that a literal will only be merged with
+another literal when the new merged literal location is within the
+offset range of all of its uses.
+
+The relaxation mechanism will also attempt to optimize
+assembler-generated ``longcall'' sequences of
+@code{L32R}/@code{CALLX@var{n}} when the target is known to fit into a
+@code{CALL@var{n}} instruction encoding. The current optimization
+converts the sequence into @code{NOP}/@code{CALL@var{n}} and removes the
+literal referenced by the @code{L32R} instruction.
+
+@ifclear GENERIC
+@lowersections
+@end ifclear
+@end ifset
@ifclear SingleFormat
@node BFD
@@ -4607,7 +5358,7 @@ conversion and during output. @xref{BFD information loss}.
@end menu
@node BFD outline
-@section How it works: an outline of BFD
+@section How It Works: An Outline of BFD
@cindex opening object files
@include bfdsumm.texi
@end ifclear
@@ -4634,7 +5385,7 @@ information that enables us to fix the bug.
@end menu
@node Bug Criteria
-@section Have you found a bug?
+@section Have You Found a Bug?
@cindex bug criteria
If you are not sure whether you have found a bug, here are some guidelines:
@@ -4663,7 +5414,7 @@ improvement of @command{ld} are welcome in any case.
@end itemize
@node Bug Reporting
-@section How to report bugs
+@section How to Report Bugs
@cindex bug reports
@cindex @command{ld} bugs, reporting
@@ -4698,9 +5449,9 @@ the bug if it is new to us. Therefore, always write your bug reports
on the assumption that the bug has not been reported previously.
Sometimes people give a few sketchy facts and ask, ``Does this ring a
-bell?'' Those bug reports are useless, and we urge everyone to
-@emph{refuse to respond to them} except to chide the sender to report
-bugs properly.
+bell?'' This cannot help us fix a bug, so it is basically useless. We
+respond by asking for enough details to enable us to investigate.
+You might as well expedite matters by sending them to begin with.
To enable us to fix the bug, you should include all these things:
@@ -4959,369 +5710,7 @@ If you have more than one @code{SECT} statement for the same
@var{secname}, only the @emph{first} sets the start address.
@end table
-@node GNU Free Documentation License
-@appendix GNU Free Documentation License
-@cindex GNU Free Documentation License
-
- GNU Free Documentation License
-
- Version 1.1, March 2000
-
- Copyright (C) 2000 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
-0. PREAMBLE
-
-The purpose of this License is to make a manual, textbook, or other
-written document "free" in the sense of freedom: to assure everyone
-the effective freedom to copy and redistribute it, with or without
-modifying it, either commercially or noncommercially. Secondarily,
-this License preserves for the author and publisher a way to get
-credit for their work, while not being considered responsible for
-modifications made by others.
-
-This License is a kind of "copyleft", which means that derivative
-works of the document must themselves be free in the same sense. It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does. But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book. We recommend this License
-principally for works whose purpose is instruction or reference.
-
-
-1. APPLICABILITY AND DEFINITIONS
-
-This License applies to any manual or other work that contains a
-notice placed by the copyright holder saying it can be distributed
-under the terms of this License. The "Document", below, refers to any
-such manual or work. Any member of the public is a licensee, and is
-addressed as "you".
-
-A "Modified Version" of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A "Secondary Section" is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall subject
-(or to related matters) and contains nothing that could fall directly
-within that overall subject. (For example, if the Document is in part a
-textbook of mathematics, a Secondary Section may not explain any
-mathematics.) The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
-them.
-
-The "Invariant Sections" are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License.
-
-The "Cover Texts" are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License.
-
-A "Transparent" copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, whose contents can be viewed and edited directly and
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters. A copy made in an otherwise Transparent file
-format whose markup has been designed to thwart or discourage
-subsequent modification by readers is not Transparent. A copy that is
-not "Transparent" is called "Opaque".
-
-Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
-or XML using a publicly available DTD, and standard-conforming simple
-HTML designed for human modification. Opaque formats include
-PostScript, PDF, proprietary formats that can be read and edited only
-by proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML produced by some word processors for output
-purposes only.
-
-The "Title Page" means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page. For works in
-formats which do not have any title page as such, "Title Page" means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
-
-
-2. VERBATIM COPYING
-
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no other
-conditions whatsoever to those of this License. You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute. However, you may accept
-compensation in exchange for copies. If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
-
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
-
-
-3. COPYING IN QUANTITY
-
-If you publish printed copies of the Document numbering more than 100,
-and the Document's license notice requires Cover Texts, you must enclose
-the copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover. Both covers must also clearly and legibly identify
-you as the publisher of these copies. The front cover must present
-the full title with all words of the title equally prominent and
-visible. You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a publicly-accessible computer-network location containing a complete
-Transparent copy of the Document, free of added material, which the
-general network-using public has access to download anonymously at no
-charge using public-standard network protocols. If you use the latter
-option, you must take reasonably prudent steps, when you begin
-distribution of Opaque copies in quantity, to ensure that this
-Transparent copy will remain thus accessible at the stated location
-until at least one year after the last time you distribute an Opaque
-copy (directly or through your agents or retailers) of that edition to
-the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to give
-them a chance to provide you with an updated version of the Document.
-
-
-4. MODIFICATIONS
-
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it. In addition, you must do these things in the Modified Version:
-
-A. Use in the Title Page (and on the covers, if any) a title distinct
- from that of the Document, and from those of previous versions
- (which should, if there were any, be listed in the History section
- of the Document). You may use the same title as a previous version
- if the original publisher of that version gives permission.
-B. List on the Title Page, as authors, one or more persons or entities
- responsible for authorship of the modifications in the Modified
- Version, together with at least five of the principal authors of the
- Document (all of its principal authors, if it has less than five).
-C. State on the Title page the name of the publisher of the
- Modified Version, as the publisher.
-D. Preserve all the copyright notices of the Document.
-E. Add an appropriate copyright notice for your modifications
- adjacent to the other copyright notices.
-F. Include, immediately after the copyright notices, a license notice
- giving the public permission to use the Modified Version under the
- terms of this License, in the form shown in the Addendum below.
-G. Preserve in that license notice the full lists of Invariant Sections
- and required Cover Texts given in the Document's license notice.
-H. Include an unaltered copy of this License.
-I. Preserve the section entitled "History", and its title, and add to
- it an item stating at least the title, year, new authors, and
- publisher of the Modified Version as given on the Title Page. If
- there is no section entitled "History" in the Document, create one
- stating the title, year, authors, and publisher of the Document as
- given on its Title Page, then add an item describing the Modified
- Version as stated in the previous sentence.
-J. Preserve the network location, if any, given in the Document for
- public access to a Transparent copy of the Document, and likewise
- the network locations given in the Document for previous versions
- it was based on. These may be placed in the "History" section.
- You may omit a network location for a work that was published at
- least four years before the Document itself, or if the original
- publisher of the version it refers to gives permission.
-K. In any section entitled "Acknowledgements" or "Dedications",
- preserve the section's title, and preserve in the section all the
- substance and tone of each of the contributor acknowledgements
- and/or dedications given therein.
-L. Preserve all the Invariant Sections of the Document,
- unaltered in their text and in their titles. Section numbers
- or the equivalent are not considered part of the section titles.
-M. Delete any section entitled "Endorsements". Such a section
- may not be included in the Modified Version.
-N. Do not retitle any existing section as "Endorsements"
- or to conflict in title with any Invariant Section.
-
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant. To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section entitled "Endorsements", provided it contains
-nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version. Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity. If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
-
-
-5. COMBINING DOCUMENTS
-
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy. If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
-Invariant Sections in the license notice of the combined work.
-
-In the combination, you must combine any sections entitled "History"
-in the various original documents, forming one section entitled
-"History"; likewise combine any sections entitled "Acknowledgements",
-and any sections entitled "Dedications". You must delete all sections
-entitled "Endorsements."
-
-
-6. COLLECTIONS OF DOCUMENTS
-
-You may make a collection consisting of the Document and other documents
-released under this License, and replace the individual copies of this
-License in the various documents with a single copy that is included in
-the collection, provided that you follow the rules of this License for
-verbatim copying of each of the documents in all other respects.
-
-You may extract a single document from such a collection, and distribute
-it individually under this License, provided you insert a copy of this
-License into the extracted document, and follow this License in all
-other respects regarding verbatim copying of that document.
-
-
-7. AGGREGATION WITH INDEPENDENT WORKS
-
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, does not as a whole count as a Modified Version
-of the Document, provided no compilation copyright is claimed for the
-compilation. Such a compilation is called an "aggregate", and this
-License does not apply to the other self-contained works thus compiled
-with the Document, on account of their being thus compiled, if they
-are not themselves derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one quarter
-of the entire aggregate, the Document's Cover Texts may be placed on
-covers that surround only the Document within the aggregate.
-Otherwise they must appear on covers around the whole aggregate.
-
-
-8. TRANSLATION
-
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections. You may include a
-translation of this License provided that you also include the
-original English version of this License. In case of a disagreement
-between the translation and the original English version of this
-License, the original English version will prevail.
-
-
-9. TERMINATION
-
-You may not copy, modify, sublicense, or distribute the Document except
-as expressly provided for under this License. Any other attempt to
-copy, modify, sublicense or distribute the Document is void, and will
-automatically terminate your rights under this License. However,
-parties who have received copies, or rights, from you under this
-License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-
-10. FUTURE REVISIONS OF THIS LICENSE
-
-The Free Software Foundation may publish new, revised versions
-of the GNU Free Documentation License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns. See
-http://www.gnu.org/copyleft/.
-
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License "or any later version" applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation. If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation.
-
-
-ADDENDUM: How to use this License for your documents
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
-
-@smallexample
- Copyright (c) YEAR YOUR NAME.
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.1
- or any later version published by the Free Software Foundation;
- with the Invariant Sections being LIST THEIR TITLES, with the
- Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
- A copy of the license is included in the section entitled "GNU
- Free Documentation License".
-@end smallexample
-
-If you have no Invariant Sections, write "with no Invariant Sections"
-instead of saying which ones are invariant. If you have no
-Front-Cover Texts, write "no Front-Cover Texts" instead of
-"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.
+@include fdl.texi
@node Index
@unnumbered Index
diff --git a/contrib/binutils/ld/ldcref.c b/contrib/binutils/ld/ldcref.c
index c6ea18b..3094735 100644
--- a/contrib/binutils/ld/ldcref.c
+++ b/contrib/binutils/ld/ldcref.c
@@ -1,5 +1,6 @@
/* ldcref.c -- output a cross reference table
- Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 2000, 2002, 2003
+ Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>
This file is part of GLD, the Gnu Linker.
@@ -65,18 +66,14 @@ struct cref_hash_table {
struct bfd_hash_table root;
};
-/* Local functions. */
+/* Forward declarations. */
-static struct bfd_hash_entry *cref_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-static boolean cref_fill_array PARAMS ((struct cref_hash_entry *, PTR));
-static int cref_sort_array PARAMS ((const PTR, const PTR));
-static void output_one_cref PARAMS ((FILE *, struct cref_hash_entry *));
-static boolean check_nocrossref PARAMS ((struct cref_hash_entry *, PTR));
-static void check_section_sym_xref PARAMS ((lang_input_statement_type *));
-static void check_refs
- PARAMS ((const char *, asection *, bfd *, struct lang_nocrossrefs *));
-static void check_reloc_refs PARAMS ((bfd *, asection *, PTR));
+static void output_one_cref (FILE *, struct cref_hash_entry *);
+static void check_section_sym_xref (lang_input_statement_type *);
+static bfd_boolean check_nocrossref (struct cref_hash_entry *, void *);
+static void check_refs (const char *, asection *, bfd *,
+ struct lang_nocrossrefs *);
+static void check_reloc_refs (bfd *, asection *, void *);
/* Look up an entry in the cref hash table. */
@@ -89,7 +86,7 @@ static void check_reloc_refs PARAMS ((bfd *, asection *, PTR));
#define cref_hash_traverse(table, func, info) \
(bfd_hash_traverse \
(&(table)->root, \
- (boolean (*) PARAMS ((struct bfd_hash_entry *, PTR))) (func), \
+ (bfd_boolean (*) (struct bfd_hash_entry *, void *)) (func), \
(info)))
/* The cref hash table. */
@@ -98,7 +95,7 @@ static struct cref_hash_table cref_table;
/* Whether the cref hash table has been initialized. */
-static boolean cref_initialized;
+static bfd_boolean cref_initialized;
/* The number of symbols seen so far. */
@@ -107,10 +104,9 @@ static size_t cref_symcount;
/* Create an entry in a cref hash table. */
static struct bfd_hash_entry *
-cref_hash_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
+cref_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
{
struct cref_hash_entry *ret = (struct cref_hash_entry *) entry;
@@ -120,7 +116,7 @@ cref_hash_newfunc (entry, table, string)
ret = ((struct cref_hash_entry *)
bfd_hash_allocate (table, sizeof (struct cref_hash_entry)));
if (ret == NULL)
- return (struct bfd_hash_entry *) ret;
+ return NULL;
/* Call the allocation method of the superclass. */
ret = ((struct cref_hash_entry *)
@@ -132,22 +128,21 @@ cref_hash_newfunc (entry, table, string)
ret->refs = NULL;
/* Keep a count of the number of entries created in the hash
- table. */
+ table. */
++cref_symcount;
}
- return (struct bfd_hash_entry *) ret;
+ return &ret->root;
}
/* Add a symbol to the cref hash table. This is called for every
symbol that is seen during the link. */
void
-add_cref (name, abfd, section, value)
- const char *name;
- bfd *abfd;
- asection *section;
- bfd_vma value ATTRIBUTE_UNUSED;
+add_cref (const char *name,
+ bfd *abfd,
+ asection *section,
+ bfd_vma value ATTRIBUTE_UNUSED)
{
struct cref_hash_entry *h;
struct cref_ref *r;
@@ -156,10 +151,10 @@ add_cref (name, abfd, section, value)
{
if (! bfd_hash_table_init (&cref_table.root, cref_hash_newfunc))
einfo (_("%X%P: bfd_hash_table_init of cref table failed: %E\n"));
- cref_initialized = true;
+ cref_initialized = TRUE;
}
- h = cref_hash_lookup (&cref_table, name, true, false);
+ h = cref_hash_lookup (&cref_table, name, TRUE, FALSE);
if (h == NULL)
einfo (_("%X%P: cref_hash_lookup failed: %E\n"));
@@ -169,33 +164,31 @@ add_cref (name, abfd, section, value)
if (r == NULL)
{
- r = (struct cref_ref *) xmalloc (sizeof *r);
+ r = xmalloc (sizeof *r);
r->next = h->refs;
h->refs = r;
r->abfd = abfd;
- r->def = false;
- r->common = false;
- r->undef = false;
+ r->def = FALSE;
+ r->common = FALSE;
+ r->undef = FALSE;
}
if (bfd_is_und_section (section))
- r->undef = true;
+ r->undef = TRUE;
else if (bfd_is_com_section (section))
- r->common = true;
+ r->common = TRUE;
else
- r->def = true;
+ r->def = TRUE;
}
/* Copy the addresses of the hash table entries into an array. This
is called via cref_hash_traverse. We also fill in the demangled
name. */
-static boolean
-cref_fill_array (h, data)
- struct cref_hash_entry *h;
- PTR data;
+static bfd_boolean
+cref_fill_array (struct cref_hash_entry *h, void *data)
{
- struct cref_hash_entry ***pph = (struct cref_hash_entry ***) data;
+ struct cref_hash_entry ***pph = data;
ASSERT (h->demangled == NULL);
h->demangled = demangle (h->root.string);
@@ -204,18 +197,16 @@ cref_fill_array (h, data)
++*pph;
- return true;
+ return TRUE;
}
/* Sort an array of cref hash table entries by name. */
static int
-cref_sort_array (a1, a2)
- const PTR a1;
- const PTR a2;
+cref_sort_array (const void *a1, const void *a2)
{
- const struct cref_hash_entry **p1 = (const struct cref_hash_entry **) a1;
- const struct cref_hash_entry **p2 = (const struct cref_hash_entry **) a2;
+ const struct cref_hash_entry * const *p1 = a1;
+ const struct cref_hash_entry * const *p2 = a2;
return strcmp ((*p1)->demangled, (*p2)->demangled);
}
@@ -225,8 +216,7 @@ cref_sort_array (a1, a2)
#define FILECOL (50)
void
-output_cref (fp)
- FILE *fp;
+output_cref (FILE *fp)
{
int len;
struct cref_hash_entry **csyms, **csym_fill, **csym, **csym_end;
@@ -249,8 +239,7 @@ output_cref (fp)
return;
}
- csyms = ((struct cref_hash_entry **)
- xmalloc (cref_symcount * sizeof (*csyms)));
+ csyms = xmalloc (cref_symcount * sizeof (*csyms));
csym_fill = csyms;
cref_hash_traverse (&cref_table, cref_fill_array, &csym_fill);
@@ -266,16 +255,14 @@ output_cref (fp)
/* Output one entry in the cross reference table. */
static void
-output_one_cref (fp, h)
- FILE *fp;
- struct cref_hash_entry *h;
+output_one_cref (FILE *fp, struct cref_hash_entry *h)
{
int len;
struct bfd_link_hash_entry *hl;
struct cref_ref *r;
- hl = bfd_link_hash_lookup (link_info.hash, h->root.string, false,
- false, true);
+ hl = bfd_link_hash_lookup (link_info.hash, h->root.string, FALSE,
+ FALSE, TRUE);
if (hl == NULL)
einfo ("%P: symbol `%T' missing from main hash table\n",
h->root.string);
@@ -336,12 +323,12 @@ output_one_cref (fp, h)
/* Check for prohibited cross references. */
void
-check_nocrossrefs ()
+check_nocrossrefs (void)
{
if (! cref_initialized)
return;
- cref_hash_traverse (&cref_table, check_nocrossref, (PTR) NULL);
+ cref_hash_traverse (&cref_table, check_nocrossref, NULL);
lang_for_each_file (check_section_sym_xref);
}
@@ -349,8 +336,7 @@ check_nocrossrefs ()
/* Checks for prohibited cross references to section symbols. */
static void
-check_section_sym_xref (statement)
- lang_input_statement_type *statement;
+check_section_sym_xref (lang_input_statement_type *statement)
{
bfd *abfd;
asection *sec;
@@ -381,10 +367,8 @@ check_section_sym_xref (statement)
/* Check one symbol to see if it is a prohibited cross reference. */
-static boolean
-check_nocrossref (h, ignore)
- struct cref_hash_entry *h;
- PTR ignore ATTRIBUTE_UNUSED;
+static bfd_boolean
+check_nocrossref (struct cref_hash_entry *h, void *ignore ATTRIBUTE_UNUSED)
{
struct bfd_link_hash_entry *hl;
asection *defsec;
@@ -393,22 +377,22 @@ check_nocrossref (h, ignore)
struct lang_nocrossref *ncr;
struct cref_ref *ref;
- hl = bfd_link_hash_lookup (link_info.hash, h->root.string, false,
- false, true);
+ hl = bfd_link_hash_lookup (link_info.hash, h->root.string, FALSE,
+ FALSE, TRUE);
if (hl == NULL)
{
einfo (_("%P: symbol `%T' missing from main hash table\n"),
h->root.string);
- return true;
+ return TRUE;
}
if (hl->type != bfd_link_hash_defined
&& hl->type != bfd_link_hash_defweak)
- return true;
+ return TRUE;
defsec = hl->u.def.section->output_section;
if (defsec == NULL)
- return true;
+ return TRUE;
defsecname = bfd_get_section_name (defsec->owner, defsec);
for (ncrs = nocrossref_list; ncrs != NULL; ncrs = ncrs->next)
@@ -417,7 +401,7 @@ check_nocrossref (h, ignore)
for (ref = h->refs; ref != NULL; ref = ref->next)
check_refs (hl->root.string, hl->u.def.section, ref->abfd, ncrs);
- return true;
+ return TRUE;
}
/* The struct is used to pass information from check_refs to
@@ -436,11 +420,10 @@ struct check_refs_info {
prohibited sections. */
static void
-check_refs (name, sec, abfd, ncrs)
- const char *name;
- asection *sec;
- bfd *abfd;
- struct lang_nocrossrefs *ncrs;
+check_refs (const char *name,
+ asection *sec,
+ bfd *abfd,
+ struct lang_nocrossrefs *ncrs)
{
lang_input_statement_type *li;
asymbol **asymbols;
@@ -452,7 +435,7 @@ check_refs (name, sec, abfd, ncrs)
the BFD in which the symbol is defined, since even a single
BFD might contain a prohibited cross reference. */
- li = (lang_input_statement_type *) abfd->usrdata;
+ li = abfd->usrdata;
if (li != NULL && li->asymbols != NULL)
asymbols = li->asymbols;
else
@@ -463,7 +446,7 @@ check_refs (name, sec, abfd, ncrs)
symsize = bfd_get_symtab_upper_bound (abfd);
if (symsize < 0)
einfo (_("%B%F: could not read symbols; %E\n"), abfd);
- asymbols = (asymbol **) xmalloc (symsize);
+ asymbols = xmalloc (symsize);
symbol_count = bfd_canonicalize_symtab (abfd, asymbols);
if (symbol_count < 0)
einfo (_("%B%F: could not read symbols: %E\n"), abfd);
@@ -478,7 +461,7 @@ check_refs (name, sec, abfd, ncrs)
info.defsec = sec;
info.ncrs = ncrs;
info.asymbols = asymbols;
- bfd_map_over_sections (abfd, check_reloc_refs, (PTR) &info);
+ bfd_map_over_sections (abfd, check_reloc_refs, &info);
if (li == NULL)
free (asymbols);
@@ -491,12 +474,9 @@ check_refs (name, sec, abfd, ncrs)
INFO->SYM_NAME, then we report a prohibited cross reference error. */
static void
-check_reloc_refs (abfd, sec, iarg)
- bfd *abfd;
- asection *sec;
- PTR iarg;
+check_reloc_refs (bfd *abfd, asection *sec, void *iarg)
{
- struct check_refs_info *info = (struct check_refs_info *) iarg;
+ struct check_refs_info *info = iarg;
asection *outsec;
const char *outsecname;
asection *outdefsec;
@@ -538,7 +518,7 @@ check_reloc_refs (abfd, sec, iarg)
if (relsize == 0)
return;
- relpp = (arelent **) xmalloc (relsize);
+ relpp = xmalloc (relsize);
relcount = bfd_canonicalize_reloc (abfd, sec, relpp, info->asymbols);
if (relcount < 0)
einfo (_("%B%F: could not read relocs: %E\n"), abfd);
@@ -557,9 +537,9 @@ check_reloc_refs (abfd, sec, iarg)
&& bfd_get_section (*q->sym_ptr_ptr) == info->defsec)))
{
/* We found a reloc for the symbol. The symbol is defined
- in OUTSECNAME. This reloc is from a section which is
- mapped into a section from which references to OUTSECNAME
- are prohibited. We must report an error. */
+ in OUTSECNAME. This reloc is from a section which is
+ mapped into a section from which references to OUTSECNAME
+ are prohibited. We must report an error. */
einfo (_("%X%C: prohibited cross reference from %s to `%T' in %s\n"),
abfd, sec, q->address, outsecname,
bfd_asymbol_name (*q->sym_ptr_ptr), outdefsecname);
diff --git a/contrib/binutils/ld/ldctor.c b/contrib/binutils/ld/ldctor.c
index aa6a05b..34d5e52 100644
--- a/contrib/binutils/ld/ldctor.c
+++ b/contrib/binutils/ld/ldctor.c
@@ -1,6 +1,6 @@
/* ldctor.c -- constructor support routines
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ 2002, 2003 Free Software Foundation, Inc.
By Steve Chamberlain <sac@cygnus.com>
This file is part of GLD, the Gnu Linker.
@@ -33,9 +33,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ldmain.h"
#include "ldctor.h"
-static int ctor_prio PARAMS ((const char *));
-static int ctor_cmp PARAMS ((const PTR, const PTR));
-
/* The list of statements needed to handle constructors. These are
invoked by the command CONSTRUCTORS in the linker script. */
lang_statement_list_type constructor_list;
@@ -43,7 +40,7 @@ lang_statement_list_type constructor_list;
/* Whether the constructors should be sorted. Note that this is
global for the entire link; we assume that there is only a single
CONSTRUCTORS command in the linker script. */
-boolean constructors_sorted;
+bfd_boolean constructors_sorted;
/* The sets we have seen. */
struct set_info *sets;
@@ -56,24 +53,23 @@ struct set_info *sets;
function will construct the sets. */
void
-ldctor_add_set_entry (h, reloc, name, section, value)
- struct bfd_link_hash_entry *h;
- bfd_reloc_code_real_type reloc;
- const char *name;
- asection *section;
- bfd_vma value;
+ldctor_add_set_entry (struct bfd_link_hash_entry *h,
+ bfd_reloc_code_real_type reloc,
+ const char *name,
+ asection *section,
+ bfd_vma value)
{
struct set_info *p;
struct set_element *e;
struct set_element **epp;
- for (p = sets; p != (struct set_info *) NULL; p = p->next)
+ for (p = sets; p != NULL; p = p->next)
if (p->h == h)
break;
- if (p == (struct set_info *) NULL)
+ if (p == NULL)
{
- p = (struct set_info *) xmalloc (sizeof (struct set_info));
+ p = xmalloc (sizeof (struct set_info));
p->next = sets;
sets = p;
p->h = h;
@@ -109,7 +105,7 @@ ldctor_add_set_entry (h, reloc, name, section, value)
}
}
- e = (struct set_element *) xmalloc (sizeof (struct set_element));
+ e = xmalloc (sizeof (struct set_element));
e->next = NULL;
e->name = name;
e->section = section;
@@ -126,8 +122,7 @@ ldctor_add_set_entry (h, reloc, name, section, value)
symbol name. */
static int
-ctor_prio (name)
- const char *name;
+ctor_prio (const char *name)
{
/* The name will look something like _GLOBAL_$I$65535$test02__Fv.
There might be extra leading underscores, and the $ characters
@@ -155,12 +150,10 @@ ctor_prio (name)
is called via qsort. */
static int
-ctor_cmp (p1, p2)
- const PTR p1;
- const PTR p2;
+ctor_cmp (const void *p1, const void *p2)
{
- const struct set_element **pe1 = (const struct set_element **) p1;
- const struct set_element **pe2 = (const struct set_element **) p2;
+ const struct set_element * const *pe1 = p1;
+ const struct set_element * const *pe2 = p2;
const char *n1;
const char *n2;
int prio1;
@@ -202,18 +195,18 @@ ctor_cmp (p1, p2)
themselves into constructor_list. */
void
-ldctor_build_sets ()
+ldctor_build_sets (void)
{
- static boolean called;
+ static bfd_boolean called;
lang_statement_list_type *old;
- boolean header_printed;
+ bfd_boolean header_printed;
struct set_info *p;
/* The emulation code may call us directly, but we only want to do
this once. */
if (called)
return;
- called = true;
+ called = TRUE;
if (constructors_sorted)
{
@@ -230,7 +223,7 @@ ldctor_build_sets ()
for (e = p->elements; e != NULL; e = e->next)
++c;
- array = (struct set_element **) xmalloc (c * sizeof *array);
+ array = xmalloc (c * sizeof *array);
i = 0;
for (e = p->elements; e != NULL; e = e->next)
@@ -256,8 +249,8 @@ ldctor_build_sets ()
lang_list_init (stat_ptr);
- header_printed = false;
- for (p = sets; p != (struct set_info *) NULL; p = p->next)
+ header_printed = FALSE;
+ for (p = sets; p != NULL; p = p->next)
{
struct set_element *e;
reloc_howto_type *howto;
@@ -278,12 +271,12 @@ ldctor_build_sets ()
.long elementN
.long 0
except that we use the right size instead of .long. When
- generating relocateable output, we generate relocs instead of
+ generating relocatable output, we generate relocs instead of
addresses. */
howto = bfd_reloc_type_lookup (output_bfd, p->reloc);
- if (howto == (reloc_howto_type *) NULL)
+ if (howto == NULL)
{
- if (link_info.relocateable)
+ if (link_info.relocatable)
{
einfo (_("%P%X: %s does not support reloc %s for set %s\n"),
bfd_get_target (output_bfd),
@@ -292,7 +285,7 @@ ldctor_build_sets ()
continue;
}
- /* If this is not a relocateable link, all we need is the
+ /* If this is not a relocatable link, all we need is the
size, which we can get from the input BFD. */
if (p->elements->section->owner != NULL)
howto = bfd_reloc_type_lookup (p->elements->section->owner,
@@ -331,9 +324,9 @@ ldctor_build_sets ()
exp_intop (reloc_size))));
lang_add_assignment (exp_assop ('=', p->h->root.string,
exp_nameop (NAME, ".")));
- lang_add_data (size, exp_intop ((bfd_vma) p->count));
+ lang_add_data (size, exp_intop (p->count));
- for (e = p->elements; e != (struct set_element *) NULL; e = e->next)
+ for (e = p->elements; e != NULL; e = e->next)
{
if (config.map_file != NULL)
{
@@ -342,7 +335,7 @@ ldctor_build_sets ()
if (! header_printed)
{
minfo (_("\nSet Symbol\n\n"));
- header_printed = true;
+ header_printed = TRUE;
}
minfo ("%s", p->h->root.string);
@@ -369,7 +362,7 @@ ldctor_build_sets ()
if (! bfd_is_abs_section (e->section))
e->section->flags |= SEC_KEEP;
- if (link_info.relocateable)
+ if (link_info.relocatable)
lang_add_reloc (p->reloc, howto, e->section, e->name,
exp_intop (e->value));
else
diff --git a/contrib/binutils/ld/ldctor.h b/contrib/binutils/ld/ldctor.h
index 7d8c848..436df6c0 100644
--- a/contrib/binutils/ld/ldctor.h
+++ b/contrib/binutils/ld/ldctor.h
@@ -1,5 +1,5 @@
/* ldctor.h - linker constructor support
- Copyright 1991, 1992, 1993, 1994, 1995, 1998, 2000
+ Copyright 1991, 1992, 1993, 1994, 1995, 1998, 2000, 2002, 2003
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -28,7 +28,7 @@ extern lang_statement_list_type constructor_list;
/* Whether the constructors should be sorted. Note that this is
global for the entire link; we assume that there is only a single
CONSTRUCTORS command in the linker script. */
-extern boolean constructors_sorted;
+extern bfd_boolean constructors_sorted;
/* We keep a list of these structures for each set we build. */
@@ -51,9 +51,10 @@ struct set_element {
extern struct set_info *sets;
-extern void ldctor_add_set_entry PARAMS ((struct bfd_link_hash_entry *,
- bfd_reloc_code_real_type,
- const char *, asection *, bfd_vma));
-extern void ldctor_build_sets PARAMS ((void));
+extern void ldctor_add_set_entry
+ (struct bfd_link_hash_entry *, bfd_reloc_code_real_type, const char *,
+ asection *, bfd_vma);
+extern void ldctor_build_sets
+ (void);
#endif
diff --git a/contrib/binutils/ld/ldemul.c b/contrib/binutils/ld/ldemul.c
index c90673b..760c55d 100644
--- a/contrib/binutils/ld/ldemul.c
+++ b/contrib/binutils/ld/ldemul.c
@@ -1,5 +1,5 @@
/* ldemul.c -- clearing house for ld emulation states
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2003
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -21,6 +21,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "bfd.h"
#include "sysdep.h"
+#include "getopt.h"
#include "ld.h"
#include "ldmisc.h"
@@ -34,144 +35,147 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
ld_emulation_xfer_type *ld_emulation;
void
-ldemul_hll (name)
- char *name;
+ldemul_hll (char *name)
{
ld_emulation->hll (name);
}
void
-ldemul_syslib (name)
- char *name;
+ldemul_syslib (char *name)
{
ld_emulation->syslib (name);
}
void
-ldemul_after_parse ()
+ldemul_after_parse (void)
{
ld_emulation->after_parse ();
}
void
-ldemul_before_parse ()
+ldemul_before_parse (void)
{
ld_emulation->before_parse ();
}
void
-ldemul_after_open ()
+ldemul_after_open (void)
{
ld_emulation->after_open ();
}
void
-ldemul_after_allocation ()
+ldemul_after_allocation (void)
{
ld_emulation->after_allocation ();
}
void
-ldemul_before_allocation ()
+ldemul_before_allocation (void)
{
if (ld_emulation->before_allocation)
ld_emulation->before_allocation ();
}
void
-ldemul_set_output_arch ()
+ldemul_set_output_arch (void)
{
ld_emulation->set_output_arch ();
}
void
-ldemul_finish ()
+ldemul_finish (void)
{
if (ld_emulation->finish)
ld_emulation->finish ();
}
void
-ldemul_set_symbols ()
+ldemul_set_symbols (void)
{
if (ld_emulation->set_symbols)
ld_emulation->set_symbols ();
}
void
-ldemul_create_output_section_statements ()
+ldemul_create_output_section_statements (void)
{
if (ld_emulation->create_output_section_statements)
ld_emulation->create_output_section_statements ();
}
char *
-ldemul_get_script (isfile)
- int *isfile;
+ldemul_get_script (int *isfile)
{
return ld_emulation->get_script (isfile);
}
-boolean
-ldemul_open_dynamic_archive (arch, search, entry)
- const char *arch;
- search_dirs_type *search;
- lang_input_statement_type *entry;
+bfd_boolean
+ldemul_open_dynamic_archive (const char *arch, search_dirs_type *search,
+ lang_input_statement_type *entry)
{
if (ld_emulation->open_dynamic_archive)
return (*ld_emulation->open_dynamic_archive) (arch, search, entry);
- return false;
+ return FALSE;
}
-boolean
-ldemul_place_orphan (file, s)
- lang_input_statement_type *file;
- asection *s;
+bfd_boolean
+ldemul_place_orphan (lang_input_statement_type *file, asection *s)
{
if (ld_emulation->place_orphan)
return (*ld_emulation->place_orphan) (file, s);
- return false;
+ return FALSE;
}
-int
-ldemul_parse_args (argc, argv)
- int argc;
- char **argv;
+void
+ldemul_add_options (int ns, char **shortopts, int nl,
+ struct option **longopts, int nrl,
+ struct option **really_longopts)
+{
+ if (ld_emulation->add_options)
+ (*ld_emulation->add_options) (ns, shortopts, nl, longopts,
+ nrl, really_longopts);
+}
+
+bfd_boolean
+ldemul_handle_option (int optc)
+{
+ if (ld_emulation->handle_option)
+ return (*ld_emulation->handle_option) (optc);
+ return FALSE;
+}
+
+bfd_boolean
+ldemul_parse_args (int argc, char **argv)
{
/* Try and use the emulation parser if there is one. */
if (ld_emulation->parse_args)
- {
- return ld_emulation->parse_args (argc, argv);
- }
- return 0;
+ return (*ld_emulation->parse_args) (argc, argv);
+ return FALSE;
}
/* Let the emulation code handle an unrecognized file. */
-boolean
-ldemul_unrecognized_file (entry)
- lang_input_statement_type *entry;
+bfd_boolean
+ldemul_unrecognized_file (lang_input_statement_type *entry)
{
if (ld_emulation->unrecognized_file)
return (*ld_emulation->unrecognized_file) (entry);
- return false;
+ return FALSE;
}
/* Let the emulation code handle a recognized file. */
-boolean
-ldemul_recognized_file (entry)
- lang_input_statement_type *entry;
+bfd_boolean
+ldemul_recognized_file (lang_input_statement_type *entry)
{
if (ld_emulation->recognized_file)
return (*ld_emulation->recognized_file) (entry);
- return false;
+ return FALSE;
}
char *
-ldemul_choose_target (argc, argv)
- int argc;
- char **argv;
+ldemul_choose_target (int argc, char **argv)
{
return ld_emulation->choose_target (argc, argv);
}
@@ -180,9 +184,7 @@ ldemul_choose_target (argc, argv)
/* The default choose_target function. */
char *
-ldemul_default_target (argc, argv)
- int argc ATTRIBUTE_UNUSED;
- char **argv ATTRIBUTE_UNUSED;
+ldemul_default_target (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
{
char *from_outside = getenv (TARGET_ENVIRON);
if (from_outside != (char *) NULL)
@@ -191,27 +193,27 @@ ldemul_default_target (argc, argv)
}
void
-after_parse_default ()
+after_parse_default (void)
{
}
void
-after_open_default ()
+after_open_default (void)
{
}
void
-after_allocation_default ()
+after_allocation_default (void)
{
}
void
-before_allocation_default ()
+before_allocation_default (void)
{
}
void
-set_output_arch_default ()
+set_output_arch_default (void)
{
/* Set the output architecture and machine if possible. */
bfd_set_arch_mach (output_bfd,
@@ -219,15 +221,13 @@ set_output_arch_default ()
}
void
-syslib_default (ignore)
- char *ignore ATTRIBUTE_UNUSED;
+syslib_default (char *ignore ATTRIBUTE_UNUSED)
{
info_msg (_("%S SYSLIB ignored\n"));
}
void
-hll_default (ignore)
- char *ignore ATTRIBUTE_UNUSED;
+hll_default (char *ignore ATTRIBUTE_UNUSED)
{
info_msg (_("%S HLL ignored\n"));
}
@@ -235,8 +235,7 @@ hll_default (ignore)
ld_emulation_xfer_type *ld_emulations[] = { EMULATION_LIST };
void
-ldemul_choose_mode (target)
- char *target;
+ldemul_choose_mode (char *target)
{
ld_emulation_xfer_type **eptr = ld_emulations;
/* Ignore "gld" prefix. */
@@ -257,16 +256,15 @@ ldemul_choose_mode (target)
}
void
-ldemul_list_emulations (f)
- FILE *f;
+ldemul_list_emulations (FILE *f)
{
ld_emulation_xfer_type **eptr = ld_emulations;
- boolean first = true;
+ bfd_boolean first = TRUE;
for (; *eptr; eptr++)
{
if (first)
- first = false;
+ first = FALSE;
else
fprintf (f, " ");
fprintf (f, "%s", (*eptr)->emulation_name);
@@ -274,8 +272,7 @@ ldemul_list_emulations (f)
}
void
-ldemul_list_emulation_options (f)
- FILE *f;
+ldemul_list_emulation_options (FILE *f)
{
ld_emulation_xfer_type **eptr;
int options_found = 0;
@@ -299,9 +296,7 @@ ldemul_list_emulation_options (f)
}
int
-ldemul_find_potential_libraries (name, entry)
- char *name;
- lang_input_statement_type *entry;
+ldemul_find_potential_libraries (char *name, lang_input_statement_type *entry)
{
if (ld_emulation->find_potential_libraries)
return ld_emulation->find_potential_libraries (name, entry);
@@ -310,8 +305,7 @@ ldemul_find_potential_libraries (name, entry)
}
struct bfd_elf_version_expr *
-ldemul_new_vers_pattern (entry)
- struct bfd_elf_version_expr *entry;
+ldemul_new_vers_pattern (struct bfd_elf_version_expr *entry)
{
if (ld_emulation->new_vers_pattern)
entry = (*ld_emulation->new_vers_pattern) (entry);
diff --git a/contrib/binutils/ld/ldemul.h b/contrib/binutils/ld/ldemul.h
index 3e27500..8feef67 100644
--- a/contrib/binutils/ld/ldemul.h
+++ b/contrib/binutils/ld/ldemul.h
@@ -1,5 +1,5 @@
/* ld-emul.h - Linker emulation header file
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2003
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -17,76 +17,104 @@
#ifndef LDEMUL_H
#define LDEMUL_H
-extern void ldemul_hll PARAMS ((char *));
-extern void ldemul_syslib PARAMS ((char *));
-extern void ldemul_after_parse PARAMS ((void));
-extern void ldemul_before_parse PARAMS ((void));
-extern void ldemul_after_open PARAMS ((void));
-extern void ldemul_after_allocation PARAMS ((void));
-extern void ldemul_before_allocation PARAMS ((void));
-extern void ldemul_set_output_arch PARAMS ((void));
-extern char *ldemul_choose_target PARAMS ((int, char**));
-extern void ldemul_choose_mode PARAMS ((char *));
-extern void ldemul_list_emulations PARAMS ((FILE *));
-extern void ldemul_list_emulation_options PARAMS ((FILE *));
-extern char *ldemul_get_script PARAMS ((int *isfile));
-extern void ldemul_finish PARAMS ((void));
-extern void ldemul_set_symbols PARAMS ((void));
-extern void ldemul_create_output_section_statements PARAMS ((void));
-extern boolean ldemul_place_orphan
- PARAMS ((struct lang_input_statement_struct *, asection *));
-extern int ldemul_parse_args PARAMS ((int, char **));
-extern boolean ldemul_unrecognized_file
- PARAMS ((struct lang_input_statement_struct *));
-extern boolean ldemul_recognized_file
- PARAMS ((struct lang_input_statement_struct *));
-extern boolean ldemul_open_dynamic_archive
- PARAMS ((const char *, struct search_dirs *,
- struct lang_input_statement_struct *));
-extern char *ldemul_default_target PARAMS ((int, char**));
-extern void after_parse_default PARAMS ((void));
-extern void after_open_default PARAMS ((void));
-extern void after_allocation_default PARAMS ((void));
-extern void before_allocation_default PARAMS ((void));
-extern void set_output_arch_default PARAMS ((void));
-extern void syslib_default PARAMS ((char*));
-extern void hll_default PARAMS ((char*));
+extern void ldemul_hll
+ (char *);
+extern void ldemul_syslib
+ (char *);
+extern void ldemul_after_parse
+ (void);
+extern void ldemul_before_parse
+ (void);
+extern void ldemul_after_open
+ (void);
+extern void ldemul_after_allocation
+ (void);
+extern void ldemul_before_allocation
+ (void);
+extern void ldemul_set_output_arch
+ (void);
+extern char *ldemul_choose_target
+ (int, char**);
+extern void ldemul_choose_mode
+ (char *);
+extern void ldemul_list_emulations
+ (FILE *);
+extern void ldemul_list_emulation_options
+ (FILE *);
+extern char *ldemul_get_script
+ (int *isfile);
+extern void ldemul_finish
+ (void);
+extern void ldemul_set_symbols
+ (void);
+extern void ldemul_create_output_section_statements
+ (void);
+extern bfd_boolean ldemul_place_orphan
+ (struct lang_input_statement_struct *, asection *);
+extern bfd_boolean ldemul_parse_args
+ (int, char **);
+extern void ldemul_add_options
+ (int, char **, int, struct option **, int, struct option **);
+extern bfd_boolean ldemul_handle_option
+ (int);
+extern bfd_boolean ldemul_unrecognized_file
+ (struct lang_input_statement_struct *);
+extern bfd_boolean ldemul_recognized_file
+ (struct lang_input_statement_struct *);
+extern bfd_boolean ldemul_open_dynamic_archive
+ (const char *, struct search_dirs *, struct lang_input_statement_struct *);
+extern char *ldemul_default_target
+ (int, char**);
+extern void after_parse_default
+ (void);
+extern void after_open_default
+ (void);
+extern void after_allocation_default
+ (void);
+extern void before_allocation_default
+ (void);
+extern void set_output_arch_default
+ (void);
+extern void syslib_default
+ (char*);
+extern void hll_default
+ (char*);
extern int ldemul_find_potential_libraries
- PARAMS ((char *, struct lang_input_statement_struct *));
+ (char *, struct lang_input_statement_struct *);
extern struct bfd_elf_version_expr *ldemul_new_vers_pattern
- PARAMS ((struct bfd_elf_version_expr *));
+ (struct bfd_elf_version_expr *);
typedef struct ld_emulation_xfer_struct {
/* Run before parsing the command line and script file.
Set the architecture, maybe other things. */
- void (*before_parse) PARAMS ((void));
+ void (*before_parse) (void);
/* Handle the SYSLIB (low level library) script command. */
- void (*syslib) PARAMS ((char *));
+ void (*syslib) (char *);
/* Handle the HLL (high level library) script command. */
- void (*hll) PARAMS ((char *));
+ void (*hll) (char *);
/* Run after parsing the command line and script file. */
- void (*after_parse) PARAMS ((void));
+ void (*after_parse) (void);
/* Run after opening all input files, and loading the symbols. */
- void (*after_open) PARAMS ((void));
+ void (*after_open) (void);
/* Run after allocating output sections. */
- void (*after_allocation) PARAMS ( (void));
+ void (*after_allocation) (void);
/* Set the output architecture and machine if possible. */
- void (*set_output_arch) PARAMS ((void));
+ void (*set_output_arch) (void);
/* Decide which target name to use. */
- char * (*choose_target) PARAMS ((int, char**));
+ char * (*choose_target) (int, char**);
/* Run before allocating output sections. */
- void (*before_allocation) PARAMS ((void));
+ void (*before_allocation) (void);
/* Return the appropriate linker script. */
- char * (*get_script) PARAMS ((int *isfile));
+ char * (*get_script) (int *isfile);
/* The name of this emulation. */
char *emulation_name;
@@ -95,56 +123,65 @@ typedef struct ld_emulation_xfer_struct {
char *target_name;
/* Run after assigning values from the script. */
- void (*finish) PARAMS ((void));
+ void (*finish) (void);
/* Create any output sections needed by the target. */
- void (*create_output_section_statements) PARAMS ((void));
+ void (*create_output_section_statements) (void);
/* Try to open a dynamic library. ARCH is an architecture name, and
is normally the empty string. ENTRY is the lang_input_statement
that should be opened. */
- boolean (*open_dynamic_archive)
- PARAMS ((const char *arch, struct search_dirs *,
- struct lang_input_statement_struct *entry));
+ bfd_boolean (*open_dynamic_archive)
+ (const char *arch, struct search_dirs *,
+ struct lang_input_statement_struct *entry);
- /* Place an orphan section. Return true if it was placed, false if
+ /* Place an orphan section. Return TRUE if it was placed, FALSE if
the default action should be taken. This field may be NULL, in
which case the default action will always be taken. */
- boolean (*place_orphan)
- PARAMS ((struct lang_input_statement_struct *, asection *));
+ bfd_boolean (*place_orphan)
+ (struct lang_input_statement_struct *, asection *);
/* Run after assigning parsing with the args, but before
reading the script. Used to initialize symbols used in the script. */
- void (*set_symbols) PARAMS ((void));
+ void (*set_symbols) (void);
- /* Run to parse args which the base linker doesn't
- understand. Return non zero on sucess. */
- int (*parse_args) PARAMS ((int, char **));
+ /* Parse args which the base linker doesn't understand.
+ Return TRUE if the arg needs no further processing. */
+ bfd_boolean (*parse_args) (int, char **);
+
+ /* Hook to add options to parameters passed by the base linker to
+ getopt_long and getopt_long_only calls. */
+ void (*add_options)
+ (int, char **, int, struct option **, int, struct option **);
+
+ /* Companion to the above to handle an option. Returns TRUE if it is
+ one of our options. */
+ bfd_boolean (*handle_option) (int);
/* Run to handle files which are not recognized as object files or
- archives. Return true if the file was handled. */
- boolean (*unrecognized_file)
- PARAMS ((struct lang_input_statement_struct *));
+ archives. Return TRUE if the file was handled. */
+ bfd_boolean (*unrecognized_file)
+ (struct lang_input_statement_struct *);
/* Run to list the command line options which parse_args handles. */
- void (* list_options) PARAMS ((FILE *));
+ void (* list_options) (FILE *);
/* Run to specially handle files which *are* recognized as object
- files or archives. Return true if the file was handled. */
- boolean (*recognized_file)
- PARAMS ((struct lang_input_statement_struct *));
+ files or archives. Return TRUE if the file was handled. */
+ bfd_boolean (*recognized_file)
+ (struct lang_input_statement_struct *);
/* Called when looking for libraries in a directory specified
via a linker command line option or linker script option.
Files that match the pattern "lib*.a" have already been scanned.
(For VMS files matching ":lib*.a" have also been scanned). */
int (* find_potential_libraries)
- PARAMS ((char *, struct lang_input_statement_struct *));
+ (char *, struct lang_input_statement_struct *);
/* Called when adding a new version pattern. PowerPC64-ELF uses
this hook to add a pattern matching ".foo" for every "foo". */
struct bfd_elf_version_expr * (*new_vers_pattern)
- PARAMS ((struct bfd_elf_version_expr *));
+ (struct bfd_elf_version_expr *);
} ld_emulation_xfer_type;
diff --git a/contrib/binutils/ld/ldexp.c b/contrib/binutils/ld/ldexp.c
index e88e322..4d9a857 100644
--- a/contrib/binutils/ld/ldexp.c
+++ b/contrib/binutils/ld/ldexp.c
@@ -1,6 +1,6 @@
/* This module handles expression trees.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002
+ 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
@@ -41,49 +41,18 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "libiberty.h"
#include "safe-ctype.h"
-static void exp_print_token PARAMS ((token_code_type code, int infix_p));
-static void make_abs PARAMS ((etree_value_type *ptr));
-static etree_value_type new_abs PARAMS ((bfd_vma value));
-static void check PARAMS ((lang_output_section_statement_type *os,
- const char *name, const char *op));
-static etree_value_type new_rel
- PARAMS ((bfd_vma, char *, lang_output_section_statement_type *section));
-static etree_value_type new_rel_from_section
- PARAMS ((bfd_vma value, lang_output_section_statement_type *section));
-static etree_value_type fold_unary
- PARAMS ((etree_type *tree,
- lang_output_section_statement_type *current_section,
- lang_phase_type allocation_done,
- bfd_vma dot, bfd_vma *dotp));
-static etree_value_type fold_binary
- PARAMS ((etree_type *tree,
- lang_output_section_statement_type *current_section,
- lang_phase_type allocation_done,
- bfd_vma dot, bfd_vma *dotp));
-static etree_value_type fold_trinary
- PARAMS ((etree_type *tree,
- lang_output_section_statement_type *current_section,
- lang_phase_type allocation_done,
- bfd_vma dot, bfd_vma *dotp));
-static etree_value_type fold_name
- PARAMS ((etree_type *tree,
- lang_output_section_statement_type *current_section,
- lang_phase_type allocation_done,
- bfd_vma dot));
static etree_value_type exp_fold_tree_no_dot
- PARAMS ((etree_type *tree,
- lang_output_section_statement_type *current_section,
- lang_phase_type allocation_done));
+ (etree_type *, lang_output_section_statement_type *, lang_phase_type);
+static bfd_vma align_n
+ (bfd_vma, bfd_vma);
struct exp_data_seg exp_data_seg;
/* Print the string representation of the given token. Surround it
- with spaces if INFIX_P is true. */
+ with spaces if INFIX_P is TRUE. */
static void
-exp_print_token (code, infix_p)
- token_code_type code;
- int infix_p;
+exp_print_token (token_code_type code, int infix_p)
{
static const struct
{
@@ -130,7 +99,7 @@ exp_print_token (code, infix_p)
{ ADDR, "ADDR" },
{ LOADADDR, "LOADADDR" },
{ MAX_K, "MAX_K" },
- { REL, "relocateable" },
+ { REL, "relocatable" },
{ DATA_SEGMENT_ALIGN, "DATA_SEGMENT_ALIGN" },
{ DATA_SEGMENT_END, "DATA_SEGMENT_END" }
};
@@ -155,8 +124,7 @@ exp_print_token (code, infix_p)
}
static void
-make_abs (ptr)
- etree_value_type *ptr;
+make_abs (etree_value_type *ptr)
{
asection *s = ptr->section->bfd_section;
ptr->value += s->vma;
@@ -164,33 +132,19 @@ make_abs (ptr)
}
static etree_value_type
-new_abs (value)
- bfd_vma value;
+new_abs (bfd_vma value)
{
etree_value_type new;
- new.valid_p = true;
+ new.valid_p = TRUE;
new.section = abs_output_section;
new.value = value;
return new;
}
-static void
-check (os, name, op)
- lang_output_section_statement_type *os;
- const char *name;
- const char *op;
-{
- if (os == NULL)
- einfo (_("%F%P: %s uses undefined section %s\n"), op, name);
- if (! os->processed)
- einfo (_("%F%P: %s forward reference of section %s\n"), op, name);
-}
-
etree_type *
-exp_intop (value)
- bfd_vma value;
+exp_intop (bfd_vma value)
{
- etree_type *new = (etree_type *) stat_alloc (sizeof (new->value));
+ etree_type *new = stat_alloc (sizeof (new->value));
new->type.node_code = INT;
new->value.value = value;
new->value.str = NULL;
@@ -199,11 +153,9 @@ exp_intop (value)
}
etree_type *
-exp_bigintop (value, str)
- bfd_vma value;
- char *str;
+exp_bigintop (bfd_vma value, char *str)
{
- etree_type *new = (etree_type *) stat_alloc (sizeof (new->value));
+ etree_type *new = stat_alloc (sizeof (new->value));
new->type.node_code = INT;
new->value.value = value;
new->value.str = str;
@@ -211,14 +163,12 @@ exp_bigintop (value, str)
return new;
}
-/* Build an expression representing an unnamed relocateable value. */
+/* Build an expression representing an unnamed relocatable value. */
etree_type *
-exp_relop (section, value)
- asection *section;
- bfd_vma value;
+exp_relop (asection *section, bfd_vma value)
{
- etree_type *new = (etree_type *) stat_alloc (sizeof (new->rel));
+ etree_type *new = stat_alloc (sizeof (new->rel));
new->type.node_code = REL;
new->type.node_class = etree_rel;
new->rel.section = section;
@@ -227,13 +177,12 @@ exp_relop (section, value)
}
static etree_value_type
-new_rel (value, str, section)
- bfd_vma value;
- char *str;
- lang_output_section_statement_type *section;
+new_rel (bfd_vma value,
+ char *str,
+ lang_output_section_statement_type *section)
{
etree_value_type new;
- new.valid_p = true;
+ new.valid_p = TRUE;
new.value = value;
new.str = str;
new.section = section;
@@ -241,12 +190,11 @@ new_rel (value, str, section)
}
static etree_value_type
-new_rel_from_section (value, section)
- bfd_vma value;
- lang_output_section_statement_type *section;
+new_rel_from_section (bfd_vma value,
+ lang_output_section_statement_type *section)
{
etree_value_type new;
- new.valid_p = true;
+ new.valid_p = TRUE;
new.value = value;
new.str = NULL;
new.section = section;
@@ -257,12 +205,11 @@ new_rel_from_section (value, section)
}
static etree_value_type
-fold_unary (tree, current_section, allocation_done, dot, dotp)
- etree_type *tree;
- lang_output_section_statement_type *current_section;
- lang_phase_type allocation_done;
- bfd_vma dot;
- bfd_vma *dotp;
+fold_unary (etree_type *tree,
+ lang_output_section_statement_type *current_section,
+ lang_phase_type allocation_done,
+ bfd_vma dot,
+ bfd_vma *dotp)
{
etree_value_type result;
@@ -278,7 +225,7 @@ fold_unary (tree, current_section, allocation_done, dot, dotp)
result = new_rel_from_section (align_n (dot, result.value),
current_section);
else
- result.valid_p = false;
+ result.valid_p = FALSE;
break;
case ABSOLUTE:
@@ -288,7 +235,7 @@ fold_unary (tree, current_section, allocation_done, dot, dotp)
result.section = abs_output_section;
}
else
- result.valid_p = false;
+ result.valid_p = FALSE;
break;
case '~':
@@ -314,7 +261,7 @@ fold_unary (tree, current_section, allocation_done, dot, dotp)
result.value = align_n (dot, result.value);
}
else
- result.valid_p = false;
+ result.valid_p = FALSE;
break;
case DATA_SEGMENT_END:
@@ -331,7 +278,7 @@ fold_unary (tree, current_section, allocation_done, dot, dotp)
}
}
else
- result.valid_p = false;
+ result.valid_p = FALSE;
break;
default:
@@ -344,12 +291,11 @@ fold_unary (tree, current_section, allocation_done, dot, dotp)
}
static etree_value_type
-fold_binary (tree, current_section, allocation_done, dot, dotp)
- etree_type *tree;
- lang_output_section_statement_type *current_section;
- lang_phase_type allocation_done;
- bfd_vma dot;
- bfd_vma *dotp;
+fold_binary (etree_type *tree,
+ lang_output_section_statement_type *current_section,
+ lang_phase_type allocation_done,
+ bfd_vma dot,
+ bfd_vma *dotp)
{
etree_value_type result;
@@ -437,6 +383,10 @@ fold_binary (tree, current_section, allocation_done, dot, dotp)
result = other;
break;
+ case ALIGN_K:
+ result.value = align_n (result.value, other.value);
+ break;
+
case DATA_SEGMENT_ALIGN:
if (allocation_done != lang_first_phase_enum
&& current_section == abs_output_section
@@ -462,7 +412,7 @@ fold_binary (tree, current_section, allocation_done, dot, dotp)
& (maxpage - other.value);
}
else
- result.valid_p = false;
+ result.valid_p = FALSE;
break;
default:
@@ -471,7 +421,7 @@ fold_binary (tree, current_section, allocation_done, dot, dotp)
}
else
{
- result.valid_p = false;
+ result.valid_p = FALSE;
}
}
@@ -479,12 +429,11 @@ fold_binary (tree, current_section, allocation_done, dot, dotp)
}
static etree_value_type
-fold_trinary (tree, current_section, allocation_done, dot, dotp)
- etree_type *tree;
- lang_output_section_statement_type *current_section;
- lang_phase_type allocation_done;
- bfd_vma dot;
- bfd_vma *dotp;
+fold_trinary (etree_type *tree,
+ lang_output_section_statement_type *current_section,
+ lang_phase_type allocation_done,
+ bfd_vma dot,
+ bfd_vma *dotp)
{
etree_value_type result;
@@ -500,63 +449,50 @@ fold_trinary (tree, current_section, allocation_done, dot, dotp)
return result;
}
-etree_value_type
-invalid ()
-{
- etree_value_type new;
- new.valid_p = false;
- return new;
-}
-
static etree_value_type
-fold_name (tree, current_section, allocation_done, dot)
- etree_type *tree;
- lang_output_section_statement_type *current_section;
- lang_phase_type allocation_done;
- bfd_vma dot;
+fold_name (etree_type *tree,
+ lang_output_section_statement_type *current_section,
+ lang_phase_type allocation_done,
+ bfd_vma dot)
{
etree_value_type result;
+ result.valid_p = FALSE;
+
switch (tree->type.node_code)
{
case SIZEOF_HEADERS:
if (allocation_done != lang_first_phase_enum)
- {
- result = new_abs ((bfd_vma)
- bfd_sizeof_headers (output_bfd,
- link_info.relocateable));
- }
- else
- {
- result.valid_p = false;
- }
+ result = new_abs (bfd_sizeof_headers (output_bfd,
+ link_info.relocatable));
break;
case DEFINED:
if (allocation_done == lang_first_phase_enum)
- result.valid_p = false;
+ lang_track_definedness (tree->name.name);
else
{
struct bfd_link_hash_entry *h;
+ int def_iteration
+ = lang_symbol_definition_iteration (tree->name.name);
h = bfd_wrapped_link_hash_lookup (output_bfd, &link_info,
tree->name.name,
- false, false, true);
- result.value = (h != (struct bfd_link_hash_entry *) NULL
+ FALSE, FALSE, TRUE);
+ result.value = (h != NULL
&& (h->type == bfd_link_hash_defined
|| h->type == bfd_link_hash_defweak
- || h->type == bfd_link_hash_common));
- result.section = 0;
- result.valid_p = true;
+ || h->type == bfd_link_hash_common)
+ && (def_iteration == lang_statement_iteration
+ || def_iteration == -1));
+ result.section = abs_output_section;
+ result.valid_p = TRUE;
}
break;
case NAME:
- result.valid_p = false;
if (tree->name.name[0] == '.' && tree->name.name[1] == 0)
{
if (allocation_done != lang_first_phase_enum)
result = new_rel_from_section (dot, current_section);
- else
- result = invalid ();
}
else if (allocation_done != lang_first_phase_enum)
{
@@ -564,10 +500,11 @@ fold_name (tree, current_section, allocation_done, dot)
h = bfd_wrapped_link_hash_lookup (output_bfd, &link_info,
tree->name.name,
- false, false, true);
- if (h != NULL
- && (h->type == bfd_link_hash_defined
- || h->type == bfd_link_hash_defweak))
+ TRUE, FALSE, TRUE);
+ if (!h)
+ einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n"));
+ else if (h->type == bfd_link_hash_defined
+ || h->type == bfd_link_hash_defweak)
{
if (bfd_is_abs_section (h->u.def.section))
result = new_abs (h->u.def.value);
@@ -600,6 +537,12 @@ fold_name (tree, current_section, allocation_done, dot)
else if (allocation_done == lang_final_phase_enum)
einfo (_("%F%S: undefined symbol `%s' referenced in expression\n"),
tree->name.name);
+ else if (h->type == bfd_link_hash_new)
+ {
+ h->type = bfd_link_hash_undefined;
+ h->u.undef.abfd = NULL;
+ bfd_link_add_undef (link_info.hash, h);
+ }
}
break;
@@ -609,11 +552,9 @@ fold_name (tree, current_section, allocation_done, dot)
lang_output_section_statement_type *os;
os = lang_output_section_find (tree->name.name);
- check (os, tree->name.name, "ADDR");
- result = new_rel (0, NULL, os);
+ if (os && os->processed > 0)
+ result = new_rel (0, NULL, os);
}
- else
- result = invalid ();
break;
case LOADADDR:
@@ -622,16 +563,16 @@ fold_name (tree, current_section, allocation_done, dot)
lang_output_section_statement_type *os;
os = lang_output_section_find (tree->name.name);
- check (os, tree->name.name, "LOADADDR");
- if (os->load_base == NULL)
- result = new_rel (0, NULL, os);
- else
- result = exp_fold_tree_no_dot (os->load_base,
- abs_output_section,
- allocation_done);
+ if (os && os->processed != 0)
+ {
+ if (os->load_base == NULL)
+ result = new_rel (0, NULL, os);
+ else
+ result = exp_fold_tree_no_dot (os->load_base,
+ abs_output_section,
+ allocation_done);
+ }
}
- else
- result = invalid ();
break;
case SIZEOF:
@@ -641,11 +582,9 @@ fold_name (tree, current_section, allocation_done, dot)
lang_output_section_statement_type *os;
os = lang_output_section_find (tree->name.name);
- check (os, tree->name.name, "SIZEOF");
- result = new_abs (os->bfd_section->_raw_size / opb);
+ if (os && os->processed > 0)
+ result = new_abs (os->bfd_section->_raw_size / opb);
}
- else
- result = invalid ();
break;
default:
@@ -657,18 +596,17 @@ fold_name (tree, current_section, allocation_done, dot)
}
etree_value_type
-exp_fold_tree (tree, current_section, allocation_done, dot, dotp)
- etree_type *tree;
- lang_output_section_statement_type *current_section;
- lang_phase_type allocation_done;
- bfd_vma dot;
- bfd_vma *dotp;
+exp_fold_tree (etree_type *tree,
+ lang_output_section_statement_type *current_section,
+ lang_phase_type allocation_done,
+ bfd_vma dot,
+ bfd_vma *dotp)
{
etree_value_type result;
if (tree == NULL)
{
- result.valid_p = false;
+ result.valid_p = FALSE;
return result;
}
@@ -680,7 +618,7 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp)
case etree_rel:
if (allocation_done != lang_final_phase_enum)
- result.valid_p = false;
+ result.valid_p = FALSE;
else
result = new_rel ((tree->rel.value
+ tree->rel.section->output_section->vma
@@ -761,22 +699,23 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp)
dot, dotp);
if (result.valid_p)
{
- boolean create;
+ bfd_boolean create;
struct bfd_link_hash_entry *h;
if (tree->type.node_class == etree_assign)
- create = true;
+ create = TRUE;
else
- create = false;
+ create = FALSE;
h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst,
- create, false, false);
- if (h == (struct bfd_link_hash_entry *) NULL)
+ create, FALSE, TRUE);
+ if (h == NULL)
{
- if (tree->type.node_class == etree_assign)
+ if (create)
einfo (_("%P%F:%s: hash creation failed\n"),
tree->assign.dst);
}
else if (tree->type.node_class == etree_provide
+ && h->type != bfd_link_hash_new
&& h->type != bfd_link_hash_undefined
&& h->type != bfd_link_hash_common)
{
@@ -787,6 +726,7 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp)
{
/* FIXME: Should we worry if the symbol is already
defined? */
+ lang_update_definedness (tree->assign.dst, h);
h->type = bfd_link_hash_defined;
h->u.def.value = result.value;
h->u.def.section = result.section->bfd_section;
@@ -810,20 +750,15 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp)
}
static etree_value_type
-exp_fold_tree_no_dot (tree, current_section, allocation_done)
- etree_type *tree;
- lang_output_section_statement_type *current_section;
- lang_phase_type allocation_done;
+exp_fold_tree_no_dot (etree_type *tree,
+ lang_output_section_statement_type *current_section,
+ lang_phase_type allocation_done)
{
- return exp_fold_tree (tree, current_section, allocation_done,
- (bfd_vma) 0, (bfd_vma *) NULL);
+ return exp_fold_tree (tree, current_section, allocation_done, 0, NULL);
}
etree_type *
-exp_binop (code, lhs, rhs)
- int code;
- etree_type *lhs;
- etree_type *rhs;
+exp_binop (int code, etree_type *lhs, etree_type *rhs)
{
etree_type value, *new;
etree_value_type r;
@@ -839,17 +774,13 @@ exp_binop (code, lhs, rhs)
{
return exp_intop (r.value);
}
- new = (etree_type *) stat_alloc (sizeof (new->binary));
- memcpy ((char *) new, (char *) &value, sizeof (new->binary));
+ new = stat_alloc (sizeof (new->binary));
+ memcpy (new, &value, sizeof (new->binary));
return new;
}
etree_type *
-exp_trinop (code, cond, lhs, rhs)
- int code;
- etree_type *cond;
- etree_type *lhs;
- etree_type *rhs;
+exp_trinop (int code, etree_type *cond, etree_type *lhs, etree_type *rhs)
{
etree_type value, *new;
etree_value_type r;
@@ -858,21 +789,17 @@ exp_trinop (code, cond, lhs, rhs)
value.trinary.cond = cond;
value.trinary.rhs = rhs;
value.type.node_class = etree_trinary;
- r = exp_fold_tree_no_dot (&value,
- (lang_output_section_statement_type *) NULL,
- lang_first_phase_enum);
+ r = exp_fold_tree_no_dot (&value, NULL, lang_first_phase_enum);
if (r.valid_p)
return exp_intop (r.value);
- new = (etree_type *) stat_alloc (sizeof (new->trinary));
- memcpy ((char *) new, (char *) &value, sizeof (new->trinary));
+ new = stat_alloc (sizeof (new->trinary));
+ memcpy (new, &value, sizeof (new->trinary));
return new;
}
etree_type *
-exp_unop (code, child)
- int code;
- etree_type *child;
+exp_unop (int code, etree_type *child)
{
etree_type value, *new;
@@ -885,15 +812,13 @@ exp_unop (code, child)
if (r.valid_p)
return exp_intop (r.value);
- new = (etree_type *) stat_alloc (sizeof (new->unary));
- memcpy ((char *) new, (char *) &value, sizeof (new->unary));
+ new = stat_alloc (sizeof (new->unary));
+ memcpy (new, &value, sizeof (new->unary));
return new;
}
etree_type *
-exp_nameop (code, name)
- int code;
- const char *name;
+exp_nameop (int code, const char *name)
{
etree_type value, *new;
etree_value_type r;
@@ -901,23 +826,18 @@ exp_nameop (code, name)
value.name.name = name;
value.name.type.node_class = etree_name;
- r = exp_fold_tree_no_dot (&value,
- (lang_output_section_statement_type *) NULL,
- lang_first_phase_enum);
+ r = exp_fold_tree_no_dot (&value, NULL, lang_first_phase_enum);
if (r.valid_p)
return exp_intop (r.value);
- new = (etree_type *) stat_alloc (sizeof (new->name));
- memcpy ((char *) new, (char *) &value, sizeof (new->name));
+ new = stat_alloc (sizeof (new->name));
+ memcpy (new, &value, sizeof (new->name));
return new;
}
etree_type *
-exp_assop (code, dst, src)
- int code;
- const char *dst;
- etree_type *src;
+exp_assop (int code, const char *dst, etree_type *src)
{
etree_type value, *new;
@@ -931,21 +851,19 @@ exp_assop (code, dst, src)
if (exp_fold_tree_no_dot (&value, &result))
return exp_intop (result);
#endif
- new = (etree_type *) stat_alloc (sizeof (new->assign));
- memcpy ((char *) new, (char *) &value, sizeof (new->assign));
+ new = stat_alloc (sizeof (new->assign));
+ memcpy (new, &value, sizeof (new->assign));
return new;
}
/* Handle PROVIDE. */
etree_type *
-exp_provide (dst, src)
- const char *dst;
- etree_type *src;
+exp_provide (const char *dst, etree_type *src)
{
etree_type *n;
- n = (etree_type *) stat_alloc (sizeof (n->assign));
+ n = stat_alloc (sizeof (n->assign));
n->assign.type.node_code = '=';
n->assign.type.node_class = etree_provide;
n->assign.src = src;
@@ -956,13 +874,11 @@ exp_provide (dst, src)
/* Handle ASSERT. */
etree_type *
-exp_assert (exp, message)
- etree_type *exp;
- const char *message;
+exp_assert (etree_type *exp, const char *message)
{
etree_type *n;
- n = (etree_type *) stat_alloc (sizeof (n->assert_s));
+ n = stat_alloc (sizeof (n->assert_s));
n->assert_s.type.node_code = '!';
n->assert_s.type.node_class = etree_assert;
n->assert_s.child = exp;
@@ -971,8 +887,7 @@ exp_assert (exp, message)
}
void
-exp_print_tree (tree)
- etree_type *tree;
+exp_print_tree (etree_type *tree)
{
if (config.map_file == NULL)
config.map_file = stderr;
@@ -995,14 +910,14 @@ exp_print_tree (tree)
return;
case etree_assign:
#if 0
- if (tree->assign.dst->sdefs != (asymbol *) NULL)
+ if (tree->assign.dst->sdefs != NULL)
fprintf (config.map_file, "%s (%x) ", tree->assign.dst->name,
tree->assign.dst->sdefs->value);
else
fprintf (config.map_file, "%s (UNDEFINED)", tree->assign.dst->name);
#endif
fprintf (config.map_file, "%s", tree->assign.dst);
- exp_print_token (tree->type.node_code, true);
+ exp_print_token (tree->type.node_code, TRUE);
exp_print_tree (tree->assign.src);
break;
case etree_provide:
@@ -1014,7 +929,7 @@ exp_print_tree (tree)
case etree_binary:
fprintf (config.map_file, "(");
exp_print_tree (tree->binary.lhs);
- exp_print_token (tree->type.node_code, true);
+ exp_print_token (tree->type.node_code, TRUE);
exp_print_tree (tree->binary.rhs);
fprintf (config.map_file, ")");
break;
@@ -1026,7 +941,7 @@ exp_print_tree (tree)
exp_print_tree (tree->trinary.rhs);
break;
case etree_unary:
- exp_print_token (tree->unary.type.node_code, false);
+ exp_print_token (tree->unary.type.node_code, FALSE);
if (tree->unary.child)
{
fprintf (config.map_file, " (");
@@ -1051,7 +966,7 @@ exp_print_tree (tree)
}
else
{
- exp_print_token (tree->type.node_code, false);
+ exp_print_token (tree->type.node_code, FALSE);
if (tree->name.name)
fprintf (config.map_file, " (%s)", tree->name.name);
}
@@ -1063,11 +978,10 @@ exp_print_tree (tree)
}
bfd_vma
-exp_get_vma (tree, def, name, allocation_done)
- etree_type *tree;
- bfd_vma def;
- char *name;
- lang_phase_type allocation_done;
+exp_get_vma (etree_type *tree,
+ bfd_vma def,
+ char *name,
+ lang_phase_type allocation_done)
{
etree_value_type r;
@@ -1083,21 +997,19 @@ exp_get_vma (tree, def, name, allocation_done)
}
int
-exp_get_value_int (tree, def, name, allocation_done)
- etree_type *tree;
- int def;
- char *name;
- lang_phase_type allocation_done;
+exp_get_value_int (etree_type *tree,
+ int def,
+ char *name,
+ lang_phase_type allocation_done)
{
- return (int) exp_get_vma (tree, (bfd_vma) def, name, allocation_done);
+ return exp_get_vma (tree, def, name, allocation_done);
}
fill_type *
-exp_get_fill (tree, def, name, allocation_done)
- etree_type *tree;
- fill_type *def;
- char *name;
- lang_phase_type allocation_done;
+exp_get_fill (etree_type *tree,
+ fill_type *def,
+ char *name,
+ lang_phase_type allocation_done)
{
fill_type *fill;
etree_value_type r;
@@ -1115,7 +1027,7 @@ exp_get_fill (tree, def, name, allocation_done)
{
unsigned char *dst;
unsigned char *s;
- fill = (fill_type *) xmalloc ((len + 1) / 2 + sizeof (*fill) - 1);
+ fill = xmalloc ((len + 1) / 2 + sizeof (*fill) - 1);
fill->size = (len + 1) / 2;
dst = fill->data;
s = r.str;
@@ -1140,7 +1052,7 @@ exp_get_fill (tree, def, name, allocation_done)
}
else
{
- fill = (fill_type *) xmalloc (4 + sizeof (*fill) - 1);
+ fill = xmalloc (4 + sizeof (*fill) - 1);
val = r.value;
fill->data[0] = (val >> 24) & 0xff;
fill->data[1] = (val >> 16) & 0xff;
@@ -1152,11 +1064,10 @@ exp_get_fill (tree, def, name, allocation_done)
}
bfd_vma
-exp_get_abs_int (tree, def, name, allocation_done)
- etree_type *tree;
- int def ATTRIBUTE_UNUSED;
- char *name;
- lang_phase_type allocation_done;
+exp_get_abs_int (etree_type *tree,
+ int def ATTRIBUTE_UNUSED,
+ char *name,
+ lang_phase_type allocation_done)
{
etree_value_type res;
res = exp_fold_tree_no_dot (tree, abs_output_section, allocation_done);
@@ -1169,9 +1080,8 @@ exp_get_abs_int (tree, def, name, allocation_done)
return res.value;
}
-bfd_vma align_n (value, align)
- bfd_vma value;
- bfd_vma align;
+static bfd_vma
+align_n (bfd_vma value, bfd_vma align)
{
if (align <= 1)
return value;
diff --git a/contrib/binutils/ld/ldexp.h b/contrib/binutils/ld/ldexp.h
index 3f3508e..99e7073 100644
--- a/contrib/binutils/ld/ldexp.h
+++ b/contrib/binutils/ld/ldexp.h
@@ -1,6 +1,6 @@
/* ldexp.h -
- Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002,
+ 2003, 2004 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -27,23 +27,25 @@ typedef struct {
bfd_vma value;
char *str;
struct lang_output_section_statement_struct *section;
- boolean valid_p;
+ bfd_boolean valid_p;
} etree_value_type;
typedef struct {
int node_code;
- enum { etree_binary,
- etree_trinary,
- etree_unary,
- etree_name,
- etree_assign,
- etree_provide,
- etree_provided,
- etree_undef,
- etree_unspec,
- etree_value,
- etree_assert,
- etree_rel } node_class;
+ enum {
+ etree_binary,
+ etree_trinary,
+ etree_unary,
+ etree_name,
+ etree_assign,
+ etree_provide,
+ etree_provided,
+ etree_undef,
+ etree_unspec,
+ etree_value,
+ etree_assert,
+ etree_rel
+ } node_class;
} node_type;
typedef union etree_union {
@@ -101,27 +103,40 @@ extern struct exp_data_seg {
typedef struct _fill_type fill_type;
-etree_type *exp_intop PARAMS ((bfd_vma));
-etree_type *exp_bigintop PARAMS ((bfd_vma, char *));
-etree_type *exp_relop PARAMS ((asection *, bfd_vma));
-etree_value_type invalid PARAMS ((void));
-etree_value_type exp_fold_tree PARAMS ((etree_type *, struct
- lang_output_section_statement_struct *,
- lang_phase_type,
- bfd_vma, bfd_vma *));
-etree_type *exp_binop PARAMS ((int, etree_type *, etree_type *));
-etree_type *exp_trinop PARAMS ((int,etree_type *, etree_type *, etree_type *));
-etree_type *exp_unop PARAMS ((int, etree_type *));
-etree_type *exp_nameop PARAMS ((int, const char *));
-etree_type *exp_assop PARAMS ((int, const char *, etree_type *));
-etree_type *exp_provide PARAMS ((const char *, etree_type *));
-etree_type *exp_assert PARAMS ((etree_type *, const char *));
-void exp_print_tree PARAMS ((etree_type *));
-bfd_vma exp_get_vma PARAMS ((etree_type *, bfd_vma, char *, lang_phase_type));
-int exp_get_value_int PARAMS ((etree_type *, int, char *, lang_phase_type));
-fill_type *exp_get_fill PARAMS ((etree_type *, fill_type *, char *,
- lang_phase_type));
-bfd_vma exp_get_abs_int PARAMS ((etree_type *, int, char *, lang_phase_type));
-bfd_vma align_n PARAMS ((bfd_vma, bfd_vma));
+etree_type *exp_intop
+ (bfd_vma);
+etree_type *exp_bigintop
+ (bfd_vma, char *);
+etree_type *exp_relop
+ (asection *, bfd_vma);
+etree_value_type invalid
+ (void);
+etree_value_type exp_fold_tree
+ (etree_type *, struct lang_output_section_statement_struct *,
+ lang_phase_type, bfd_vma, bfd_vma *);
+etree_type *exp_binop
+ (int, etree_type *, etree_type *);
+etree_type *exp_trinop
+ (int,etree_type *, etree_type *, etree_type *);
+etree_type *exp_unop
+ (int, etree_type *);
+etree_type *exp_nameop
+ (int, const char *);
+etree_type *exp_assop
+ (int, const char *, etree_type *);
+etree_type *exp_provide
+ (const char *, etree_type *);
+etree_type *exp_assert
+ (etree_type *, const char *);
+void exp_print_tree
+ (etree_type *);
+bfd_vma exp_get_vma
+ (etree_type *, bfd_vma, char *, lang_phase_type);
+int exp_get_value_int
+ (etree_type *, int, char *, lang_phase_type);
+fill_type *exp_get_fill
+ (etree_type *, fill_type *, char *, lang_phase_type);
+bfd_vma exp_get_abs_int
+ (etree_type *, int, char *, lang_phase_type);
#endif
diff --git a/contrib/binutils/ld/ldfile.c b/contrib/binutils/ld/ldfile.c
index d706eec..a6f0d60 100644
--- a/contrib/binutils/ld/ldfile.c
+++ b/contrib/binutils/ld/ldfile.c
@@ -1,23 +1,23 @@
/* Linker file opening and searching.
- Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002,
+ 2003, 2004 Free Software Foundation, Inc.
-This file is part of GLD, the Gnu Linker.
+ This file is part of GLD, the Gnu Linker.
-GLD is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+ GLD is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
-GLD is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ GLD is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with GLD; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with GLD; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
/* ldfile.c: look after all the file stuff. */
@@ -35,67 +35,106 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ldlex.h"
#include "ldemul.h"
#include "libiberty.h"
+#include "filenames.h"
-const char *ldfile_input_filename;
-boolean ldfile_assumed_script = false;
-const char *ldfile_output_machine_name = "";
+const char * ldfile_input_filename;
+bfd_boolean ldfile_assumed_script = FALSE;
+const char * ldfile_output_machine_name = "";
unsigned long ldfile_output_machine;
enum bfd_architecture ldfile_output_architecture;
-search_dirs_type *search_head;
+search_dirs_type * search_head;
#ifndef MPW
#ifdef VMS
-char *slash = "";
+char * slash = "";
#else
#if defined (_WIN32) && ! defined (__CYGWIN32__)
-char *slash = "\\";
+char * slash = "\\";
#else
-char *slash = "/";
+char * slash = "/";
#endif
#endif
#else /* MPW */
/* The MPW path char is a colon. */
-char *slash = ":";
+char * slash = ":";
#endif /* MPW */
-/* LOCAL */
-
-static search_dirs_type **search_tail_ptr = &search_head;
-
-typedef struct search_arch {
+typedef struct search_arch
+{
char *name;
struct search_arch *next;
} search_arch_type;
+static search_dirs_type **search_tail_ptr = &search_head;
static search_arch_type *search_arch_head;
static search_arch_type **search_arch_tail_ptr = &search_arch_head;
-static FILE *try_open PARAMS ((const char *name, const char *exten));
+/* Test whether a pathname, after canonicalization, is the same or a
+ sub-directory of the sysroot directory. */
+
+static bfd_boolean
+is_sysrooted_pathname (const char *name, bfd_boolean notsame)
+{
+ char * realname = ld_canon_sysroot ? lrealpath (name) : NULL;
+ int len;
+ bfd_boolean result;
+
+ if (! realname)
+ return FALSE;
+
+ len = strlen (realname);
+
+ if (((! notsame && len == ld_canon_sysroot_len)
+ || (len >= ld_canon_sysroot_len
+ && IS_DIR_SEPARATOR (realname[ld_canon_sysroot_len])
+ && (realname[ld_canon_sysroot_len] = '\0') == '\0'))
+ && FILENAME_CMP (ld_canon_sysroot, realname) == 0)
+ result = TRUE;
+ else
+ result = FALSE;
+
+ if (realname)
+ free (realname);
+
+ return result;
+}
+
+/* Adds NAME to the library search path.
+ Makes a copy of NAME using xmalloc(). */
void
-ldfile_add_library_path (name, cmdline)
- const char *name;
- boolean cmdline;
+ldfile_add_library_path (const char *name, bfd_boolean cmdline)
{
search_dirs_type *new;
if (!cmdline && config.only_cmd_line_lib_dirs)
return;
- new = (search_dirs_type *) xmalloc (sizeof (search_dirs_type));
+ new = xmalloc (sizeof (search_dirs_type));
new->next = NULL;
- new->name = name;
new->cmdline = cmdline;
*search_tail_ptr = new;
search_tail_ptr = &new->next;
+
+ /* If a directory is marked as honoring sysroot, prepend the sysroot path
+ now. */
+ if (name[0] == '=')
+ {
+ new->name = concat (ld_sysroot, name + 1, NULL);
+ new->sysrooted = TRUE;
+ }
+ else
+ {
+ new->name = xstrdup (name);
+ new->sysrooted = is_sysrooted_pathname (name, FALSE);
+ }
}
/* Try to open a BFD for a lang_input_statement. */
-boolean
-ldfile_try_open_bfd (attempt, entry)
- const char *attempt;
- lang_input_statement_type *entry;
+bfd_boolean
+ldfile_try_open_bfd (const char *attempt,
+ lang_input_statement_type *entry)
{
entry->the_bfd = bfd_openr (attempt, entry->target);
@@ -111,7 +150,7 @@ ldfile_try_open_bfd (attempt, entry)
{
if (bfd_get_error () == bfd_error_invalid_target)
einfo (_("%F%P: invalid BFD target `%s'\n"), entry->target);
- return false;
+ return FALSE;
}
/* If we are searching for this file, see if the architecture is
@@ -142,8 +181,8 @@ ldfile_try_open_bfd (attempt, entry)
/* Try to interpret the file as a linker script. */
ldfile_open_command_file (attempt);
-
- ldfile_assumed_script = true;
+
+ ldfile_assumed_script = TRUE;
parser_input = input_selected;
ldlex_both ();
token = INPUT_SCRIPT;
@@ -207,10 +246,11 @@ ldfile_try_open_bfd (attempt, entry)
if (yylval.bigint.str)
free (yylval.bigint.str);
break;
- }
+ }
token = yylex ();
}
- ldfile_assumed_script = false;
+ ldlex_popstate ();
+ ldfile_assumed_script = FALSE;
fclose (yyin);
yyin = NULL;
if (skip)
@@ -219,14 +259,15 @@ ldfile_try_open_bfd (attempt, entry)
attempt, entry->local_sym_name);
bfd_close (entry->the_bfd);
entry->the_bfd = NULL;
- return false;
+ return FALSE;
}
}
- return true;
+ return TRUE;
}
- if ((bfd_arch_get_compatible (check, output_bfd) == NULL)
- /* XCOFF archives can have 32 and 64 bit objects */
+ if ((bfd_arch_get_compatible (check, output_bfd,
+ command_line.accept_unknown_input_arch) == NULL)
+ /* XCOFF archives can have 32 and 64 bit objects. */
&& ! (bfd_get_flavour (check) == bfd_target_xcoff_flavour
&& bfd_get_flavour (output_bfd) == bfd_target_xcoff_flavour
&& bfd_check_format (entry->the_bfd, bfd_archive)))
@@ -235,23 +276,22 @@ ldfile_try_open_bfd (attempt, entry)
attempt, entry->local_sym_name);
bfd_close (entry->the_bfd);
entry->the_bfd = NULL;
- return false;
+ return FALSE;
}
}
}
- return true;
+ return TRUE;
}
/* Search for and open the file specified by ENTRY. If it is an
archive, use ARCH, LIB and SUFFIX to modify the file name. */
-boolean
-ldfile_open_file_search (arch, entry, lib, suffix)
- const char *arch;
- lang_input_statement_type *entry;
- const char *lib;
- const char *suffix;
+bfd_boolean
+ldfile_open_file_search (const char *arch,
+ lang_input_statement_type *entry,
+ const char *lib,
+ const char *suffix)
{
search_dirs_type *search;
@@ -259,61 +299,72 @@ ldfile_open_file_search (arch, entry, lib, suffix)
directory first. */
if (! entry->is_archive)
{
- if (ldfile_try_open_bfd (entry->filename, entry))
- return true;
+ if (entry->sysrooted && IS_ABSOLUTE_PATH (entry->filename))
+ {
+ char *name = concat (ld_sysroot, entry->filename,
+ (const char *) NULL);
+ if (ldfile_try_open_bfd (name, entry))
+ {
+ entry->filename = name;
+ return TRUE;
+ }
+ free (name);
+ }
+ else if (ldfile_try_open_bfd (entry->filename, entry))
+ {
+ entry->sysrooted = IS_ABSOLUTE_PATH (entry->filename)
+ && is_sysrooted_pathname (entry->filename, TRUE);
+ return TRUE;
+ }
+
+ if (IS_ABSOLUTE_PATH (entry->filename))
+ return FALSE;
}
- for (search = search_head;
- search != (search_dirs_type *) NULL;
- search = search->next)
+ for (search = search_head; search != NULL; search = search->next)
{
char *string;
- if (entry->dynamic && ! link_info.relocateable)
+ if (entry->dynamic && ! link_info.relocatable)
{
if (ldemul_open_dynamic_archive (arch, search, entry))
- return true;
+ {
+ entry->sysrooted = search->sysrooted;
+ return TRUE;
+ }
}
- string = (char *) xmalloc (strlen (search->name)
- + strlen (slash)
- + strlen (lib)
- + strlen (entry->filename)
- + strlen (arch)
- + strlen (suffix)
- + 1);
+ string = xmalloc (strlen (search->name)
+ + strlen (slash)
+ + strlen (lib)
+ + strlen (entry->filename)
+ + strlen (arch)
+ + strlen (suffix)
+ + 1);
if (entry->is_archive)
sprintf (string, "%s%s%s%s%s%s", search->name, slash,
lib, entry->filename, arch, suffix);
- else if (entry->filename[0] == '/' || entry->filename[0] == '.'
-#if defined (__MSDOS__) || defined (_WIN32)
- || entry->filename[0] == '\\'
- || (ISALPHA (entry->filename[0])
- && entry->filename[1] == ':')
-#endif
- )
- strcpy (string, entry->filename);
else
sprintf (string, "%s%s%s", search->name, slash, entry->filename);
if (ldfile_try_open_bfd (string, entry))
{
entry->filename = string;
- return true;
+ entry->sysrooted = search->sysrooted;
+ return TRUE;
}
free (string);
}
- return false;
+ return FALSE;
}
/* Open the input file specified by ENTRY. */
void
-ldfile_open_file (entry)
- lang_input_statement_type *entry;
+ldfile_open_file (lang_input_statement_type *entry)
{
if (entry->the_bfd != NULL)
return;
@@ -323,20 +374,18 @@ ldfile_open_file (entry)
if (ldfile_try_open_bfd (entry->filename, entry))
return;
if (strcmp (entry->filename, entry->local_sym_name) != 0)
- einfo (_("%F%P: cannot open %s for %s: %E\n"),
+ einfo (_("%F%P: %s (%s): No such file: %E\n"),
entry->filename, entry->local_sym_name);
else
- einfo (_("%F%P: cannot open %s: %E\n"), entry->local_sym_name);
+ einfo (_("%F%P: %s: No such file: %E\n"), entry->local_sym_name);
}
else
{
search_arch_type *arch;
- boolean found = false;
+ bfd_boolean found = FALSE;
/* Try to open <filename><suffix> or lib<filename><suffix>.a */
- for (arch = search_arch_head;
- arch != (search_arch_type *) NULL;
- arch = arch->next)
+ for (arch = search_arch_head; arch != NULL; arch = arch->next)
{
found = ldfile_open_file_search (arch->name, entry, "lib", ".a");
if (found)
@@ -354,7 +403,12 @@ ldfile_open_file (entry)
/* If we have found the file, we don't need to search directories
again. */
if (found)
- entry->search_dirs_flag = false;
+ entry->search_dirs_flag = FALSE;
+ else if (entry->sysrooted
+ && ld_sysroot
+ && IS_ABSOLUTE_PATH (entry->local_sym_name))
+ einfo (_("%F%P: cannot find %s inside %s\n"),
+ entry->local_sym_name, ld_sysroot);
else
einfo (_("%F%P: cannot find %s\n"), entry->local_sym_name);
}
@@ -363,9 +417,7 @@ ldfile_open_file (entry)
/* Try to open NAME; if that fails, try NAME with EXTEN appended to it. */
static FILE *
-try_open (name, exten)
- const char *name;
- const char *exten;
+try_open (const char *name, const char *exten)
{
FILE *result;
char buff[1000];
@@ -401,12 +453,10 @@ try_open (name, exten)
}
/* Try to open NAME; if that fails, look for it in any directories
- specified with -L, without and with EXTEND apppended. */
+ specified with -L, without and with EXTEND appended. */
FILE *
-ldfile_find_command_file (name, extend)
- const char *name;
- const char *extend;
+ldfile_find_command_file (const char *name, const char *extend)
{
search_dirs_type *search;
FILE *result;
@@ -414,12 +464,10 @@ ldfile_find_command_file (name, extend)
/* First try raw name. */
result = try_open (name, "");
- if (result == (FILE *) NULL)
+ if (result == NULL)
{
/* Try now prefixes. */
- for (search = search_head;
- search != (search_dirs_type *) NULL;
- search = search->next)
+ for (search = search_head; search != NULL; search = search->next)
{
sprintf (buffer, "%s%s%s", search->name, slash, name);
@@ -433,13 +481,12 @@ ldfile_find_command_file (name, extend)
}
void
-ldfile_open_command_file (name)
- const char *name;
+ldfile_open_command_file (const char *name)
{
FILE *ldlex_input_stack;
ldlex_input_stack = ldfile_find_command_file (name, "");
- if (ldlex_input_stack == (FILE *) NULL)
+ if (ldlex_input_stack == NULL)
{
bfd_set_error (bfd_error_system_call);
einfo (_("%P%F: cannot open linker script file %s: %E\n"), name);
@@ -455,8 +502,7 @@ ldfile_open_command_file (name)
#ifdef GNU960
static char *
-gnu960_map_archname (name)
- char *name;
+gnu960_map_archname (char *name)
{
struct tabentry { char *cmd_switch; char *arch; };
static struct tabentry arch_tab[] =
@@ -486,11 +532,9 @@ gnu960_map_archname (name)
}
void
-ldfile_add_arch (name)
- char *name;
+ldfile_add_arch (char *name)
{
- search_arch_type *new =
- (search_arch_type *) xmalloc ((bfd_size_type) (sizeof (search_arch_type)));
+ search_arch_type *new = xmalloc (sizeof (search_arch_type));
if (*name != '\0')
{
@@ -503,7 +547,7 @@ ldfile_add_arch (name)
ldfile_output_machine_name = name;
}
- new->next = (search_arch_type *) NULL;
+ new->next = NULL;
new->name = gnu960_map_archname (name);
*search_arch_tail_ptr = new;
search_arch_tail_ptr = &new->next;
@@ -512,17 +556,15 @@ ldfile_add_arch (name)
#else /* not GNU960 */
void
-ldfile_add_arch (in_name)
- const char *in_name;
+ldfile_add_arch (const char *in_name)
{
char *name = xstrdup (in_name);
- search_arch_type *new =
- (search_arch_type *) xmalloc (sizeof (search_arch_type));
+ search_arch_type *new = xmalloc (sizeof (search_arch_type));
ldfile_output_machine_name = in_name;
new->name = name;
- new->next = (search_arch_type *) NULL;
+ new->next = NULL;
while (*name)
{
*name = TOLOWER (*name);
@@ -537,8 +579,7 @@ ldfile_add_arch (in_name)
/* Set the output architecture. */
void
-ldfile_set_output_arch (string)
- const char *string;
+ldfile_set_output_arch (const char *string, enum bfd_architecture defarch)
{
const bfd_arch_info_type *arch = bfd_scan_arch (string);
@@ -548,8 +589,8 @@ ldfile_set_output_arch (string)
ldfile_output_machine = arch->mach;
ldfile_output_machine_name = arch->printable_name;
}
+ else if (defarch != bfd_arch_unknown)
+ ldfile_output_architecture = defarch;
else
- {
- einfo (_("%P%F: cannot represent machine `%s'\n"), string);
- }
+ einfo (_("%P%F: cannot represent machine `%s'\n"), string);
}
diff --git a/contrib/binutils/ld/ldfile.h b/contrib/binutils/ld/ldfile.h
index 11a4232..6d5f09d 100644
--- a/contrib/binutils/ld/ldfile.h
+++ b/contrib/binutils/ld/ldfile.h
@@ -1,12 +1,12 @@
/* ldfile.h -
- Copyright 1991, 1992, 1993, 1994, 1995, 2000, 2002
+ Copyright 1991, 1992, 1993, 1994, 1995, 2000, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
GLD is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 1, or (at your option)
+ the Free Software Foundation; either version 2, or (at your option)
any later version.
GLD is distributed in the hope that it will be useful,
@@ -16,13 +16,14 @@
You should have received a copy of the GNU General Public License
along with GLD; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#ifndef LDFILE_H
#define LDFILE_H
extern const char *ldfile_input_filename;
-extern boolean ldfile_assumed_script;
+extern bfd_boolean ldfile_assumed_script;
extern unsigned long ldfile_output_machine;
extern enum bfd_architecture ldfile_output_architecture;
extern const char *ldfile_output_machine_name;
@@ -35,23 +36,30 @@ typedef struct search_dirs {
struct search_dirs *next;
/* Name of directory. */
const char *name;
- /* true if this is from the command line. */
- boolean cmdline;
+ /* TRUE if this is from the command line. */
+ bfd_boolean cmdline;
+ /* true if this is from within the sys-root. */
+ bfd_boolean sysrooted;
} search_dirs_type;
extern search_dirs_type *search_head;
-extern void ldfile_add_arch PARAMS ((const char *));
-extern void ldfile_add_library_path PARAMS ((const char *, boolean cmdline));
-extern void ldfile_open_command_file PARAMS ((const char *name));
-extern void ldfile_open_file PARAMS ((struct lang_input_statement_struct *));
-extern boolean ldfile_try_open_bfd
- PARAMS ((const char *, struct lang_input_statement_struct *));
+extern void ldfile_add_arch
+ (const char *);
+extern void ldfile_add_library_path
+ (const char *, bfd_boolean cmdline);
+extern void ldfile_open_command_file
+ (const char *name);
+extern void ldfile_open_file
+ (struct lang_input_statement_struct *);
+extern bfd_boolean ldfile_try_open_bfd
+ (const char *, struct lang_input_statement_struct *);
extern FILE *ldfile_find_command_file
- PARAMS ((const char *name, const char *extend));
-extern void ldfile_set_output_arch PARAMS ((const char *));
-extern boolean ldfile_open_file_search
- PARAMS ((const char *arch, struct lang_input_statement_struct *,
- const char *lib, const char *suffix));
+ (const char *name, const char *extend);
+extern void ldfile_set_output_arch
+ (const char *, enum bfd_architecture);
+extern bfd_boolean ldfile_open_file_search
+ (const char *arch, struct lang_input_statement_struct *,
+ const char *lib, const char *suffix);
#endif
diff --git a/contrib/binutils/ld/ldgram.y b/contrib/binutils/ld/ldgram.y
index d2533c2..6c46c85 100644
--- a/contrib/binutils/ld/ldgram.y
+++ b/contrib/binutils/ld/ldgram.y
@@ -1,6 +1,6 @@
/* A YACC grammar to parse a superset of the AT&T linker scripting language.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002 Free Software Foundation, Inc.
+ 2001, 2002, 2003 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
This file is part of GNU ld.
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"
-#include "ld.h"
+#include "ld.h"
#include "ldexp.h"
#include "ldver.h"
#include "ldlang.h"
@@ -49,13 +49,13 @@ static enum section_type sectype;
lang_memory_region_type *region;
-boolean ldgram_want_filename = true;
-FILE * saved_script_handle = NULL;
-boolean force_make_executable = false;
+bfd_boolean ldgram_want_filename = TRUE;
+FILE *saved_script_handle = NULL;
+bfd_boolean force_make_executable = FALSE;
-boolean ldgram_in_script = false;
-boolean ldgram_had_equals = false;
-boolean ldgram_had_keep = false;
+bfd_boolean ldgram_in_script = FALSE;
+bfd_boolean ldgram_had_equals = FALSE;
+bfd_boolean ldgram_had_keep = FALSE;
char *ldgram_vers_current_lang = NULL;
#define ERROR_NAME_MAX 20
@@ -81,8 +81,8 @@ static int error_index;
union etree_union *etree;
struct phdr_info
{
- boolean filehdr;
- boolean phdrs;
+ bfd_boolean filehdr;
+ bfd_boolean phdrs;
union etree_union *at;
union etree_union *flags;
} phdr;
@@ -94,7 +94,7 @@ static int error_index;
}
%type <etree> exp opt_exp_with_type mustbe_exp opt_at phdr_type phdr_val
-%type <etree> opt_exp_without_type
+%type <etree> opt_exp_without_type opt_subalign
%type <fill> fill_opt fill_exp
%type <name_list> exclude_name_list
%type <wildcard_list> file_NAME_list
@@ -102,7 +102,7 @@ static int error_index;
%type <name> memspec_at_opt
%type <cname> wildcard_name
%type <wildcard> wildcard_spec
-%token <bigint> INT
+%token <bigint> INT
%token <name> NAME LNAME
%type <integer> length
%type <phdr> phdr_qualifiers
@@ -110,7 +110,7 @@ static int error_index;
%type <section_phdr> phdr_opt
%type <integer> opt_nocrossrefs
-%right <token> PLUSEQ MINUSEQ MULTEQ DIVEQ '=' LSHIFTEQ RSHIFTEQ ANDEQ OREQ
+%right <token> PLUSEQ MINUSEQ MULTEQ DIVEQ '=' LSHIFTEQ RSHIFTEQ ANDEQ OREQ
%right <token> '?' ':'
%left <token> OROR
%left <token> ANDAND
@@ -125,7 +125,7 @@ static int error_index;
%left <token> '*' '/' '%'
%right UNARY
-%token END
+%token END
%left <token> '('
%token <token> ALIGN_K BLOCK BIND QUAD SQUAD LONG SHORT BYTE
%token SECTIONS PHDRS SORT DATA_SEGMENT_ALIGN DATA_SEGMENT_END
@@ -142,7 +142,7 @@ static int error_index;
%token STARTUP HLL SYSLIB FLOAT NOFLOAT NOCROSSREFS
%token ORIGIN FILL
%token LENGTH CREATE_OBJECT_SYMBOLS INPUT GROUP OUTPUT CONSTRUCTORS
-%token ALIGNMOD AT PROVIDE
+%token ALIGNMOD AT SUBALIGN PROVIDE
%type <token> assign_op atype attributes_opt
%type <name> filename
%token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD ASSERT_K
@@ -158,7 +158,7 @@ static int error_index;
%%
-file:
+file:
INPUT_SCRIPT script_file
| INPUT_MRI_SCRIPT mri_script_file
| INPUT_VERSION_SCRIPT version_script_file
@@ -178,7 +178,7 @@ defsym_expr:
}
;
-/* SYNTAX WITHIN AN MRI SCRIPT FILE */
+/* SYNTAX WITHIN AN MRI SCRIPT FILE */
mri_script_file:
{
ldlex_mri_script ();
@@ -198,7 +198,7 @@ mri_script_lines:
;
mri_script_command:
- CHIP exp
+ CHIP exp
| CHIP exp ',' exp
| NAME {
einfo(_("%P%F: unrecognised keyword in MRI style script '%s'\n"),$1);
@@ -207,12 +207,12 @@ mri_script_command:
config.map_filename = "-";
}
| ORDER ordernamelist
- | ENDWORD
+ | ENDWORD
| PUBLIC NAME '=' exp
{ mri_public($2, $4); }
| PUBLIC NAME ',' exp
{ mri_public($2, $4); }
- | PUBLIC NAME exp
+ | PUBLIC NAME exp
{ mri_public($2, $3); }
| FORMAT NAME
{ mri_format($2); }
@@ -232,8 +232,8 @@ mri_script_command:
{ mri_alignmod($2,$4); }
| ABSOLUTE mri_abs_name_list
| LOAD mri_load_name_list
- | NAMEWORD NAME
- { mri_name($2); }
+ | NAMEWORD NAME
+ { mri_name($2); }
| ALIAS NAME ',' NAME
{ mri_alias($2,$4,0);}
| ALIAS NAME ',' INT
@@ -249,7 +249,7 @@ mri_script_command:
mri_script_lines END
{ ldlex_popstate (); }
| START NAME
- { lang_add_entry ($2, false); }
+ { lang_add_entry ($2, FALSE); }
|
;
@@ -319,7 +319,7 @@ ifile_p1:
| TARGET_K '(' NAME ')'
{ lang_add_target($3); }
| SEARCH_DIR '(' filename ')'
- { ldfile_add_library_path ($3, false); }
+ { ldfile_add_library_path ($3, FALSE); }
| OUTPUT '(' filename ')'
{ lang_add_output($3, 1); }
| OUTPUT_FORMAT '(' NAME ')'
@@ -328,11 +328,11 @@ ifile_p1:
| OUTPUT_FORMAT '(' NAME ',' NAME ',' NAME ')'
{ lang_add_output_format ($3, $5, $7, 1); }
| OUTPUT_ARCH '(' NAME ')'
- { ldfile_set_output_arch($3); }
+ { ldfile_set_output_arch ($3, bfd_arch_unknown); }
| FORCE_COMMON_ALLOCATION
- { command_line.force_common_definition = true ; }
+ { command_line.force_common_definition = TRUE ; }
| INHIBIT_COMMON_ALLOCATION
- { command_line.inhibit_common_definition = true ; }
+ { command_line.inhibit_common_definition = TRUE ; }
| INPUT '(' input_list ')'
| GROUP
{ lang_enter_group (); }
@@ -340,7 +340,7 @@ ifile_p1:
{ lang_leave_group (); }
| MAP '(' filename ')'
{ lang_add_map($3); }
- | INCLUDE filename
+ | INCLUDE filename
{ ldlex_script (); ldfile_open_command_file($2); }
ifile_list END
{ ldlex_popstate (); }
@@ -384,8 +384,11 @@ sec_or_group_p1:
statement_anywhere:
ENTRY '(' NAME ')'
- { lang_add_entry ($3, false); }
+ { lang_add_entry ($3, FALSE); }
| assignment end
+ | ASSERT_K {ldlex_expression ();} '(' exp ',' NAME ')'
+ { ldlex_popstate ();
+ lang_add_assignment (exp_assert ($4, $6)); }
;
/* The '*' and '?' cases are there because the lexer returns them as
@@ -409,25 +412,25 @@ wildcard_spec:
wildcard_name
{
$$.name = $1;
- $$.sorted = false;
+ $$.sorted = FALSE;
$$.exclude_name_list = NULL;
}
| EXCLUDE_FILE '(' exclude_name_list ')' wildcard_name
{
$$.name = $5;
- $$.sorted = false;
+ $$.sorted = FALSE;
$$.exclude_name_list = $3;
}
| SORT '(' wildcard_name ')'
{
$$.name = $3;
- $$.sorted = true;
+ $$.sorted = TRUE;
$$.exclude_name_list = NULL;
}
| SORT '(' EXCLUDE_FILE '(' exclude_name_list ')' wildcard_name ')'
{
$$.name = $7;
- $$.sorted = true;
+ $$.sorted = TRUE;
$$.exclude_name_list = $5;
}
;
@@ -439,7 +442,7 @@ exclude_name_list:
tmp = (struct name_list *) xmalloc (sizeof *tmp);
tmp->name = $2;
tmp->next = $1;
- $$ = tmp;
+ $$ = tmp;
}
|
wildcard_name
@@ -478,7 +481,7 @@ input_section_spec_no_keep:
struct wildcard_spec tmp;
tmp.name = $1;
tmp.exclude_name_list = NULL;
- tmp.sorted = false;
+ tmp.sorted = FALSE;
lang_add_wild (&tmp, NULL, ldgram_had_keep);
}
| '[' file_NAME_list ']'
@@ -494,26 +497,26 @@ input_section_spec_no_keep:
input_section_spec:
input_section_spec_no_keep
| KEEP '('
- { ldgram_had_keep = true; }
+ { ldgram_had_keep = TRUE; }
input_section_spec_no_keep ')'
- { ldgram_had_keep = false; }
+ { ldgram_had_keep = FALSE; }
;
statement:
assignment end
| CREATE_OBJECT_SYMBOLS
{
- lang_add_attribute(lang_object_symbols_statement_enum);
+ lang_add_attribute(lang_object_symbols_statement_enum);
}
| ';'
| CONSTRUCTORS
{
-
- lang_add_attribute(lang_constructors_statement_enum);
+
+ lang_add_attribute(lang_constructors_statement_enum);
}
| SORT '(' CONSTRUCTORS ')'
{
- constructors_sorted = true;
+ constructors_sorted = TRUE;
lang_add_attribute (lang_constructors_statement_enum);
}
| input_section_spec
@@ -521,7 +524,7 @@ statement:
{
lang_add_data ((int) $1, $3);
}
-
+
| FILL '(' fill_exp ')'
{
lang_add_fill ($3);
@@ -532,7 +535,7 @@ statement_list:
statement_list statement
| statement
;
-
+
statement_list_opt:
/* empty */
| statement_list
@@ -627,7 +630,7 @@ memory_spec_list:
memory_spec: NAME
- { region = lang_memory_region_lookup($1); }
+ { region = lang_memory_region_lookup ($1, TRUE); }
attributes_opt ':'
origin_spec opt_comma length_spec
{}
@@ -697,11 +700,11 @@ low_level_library:
floating_point_support:
FLOAT
- { lang_float(true); }
+ { lang_float(TRUE); }
| NOFLOAT
- { lang_float(false); }
+ { lang_float(FALSE); }
;
-
+
nocrossref_list:
/* empty */
{
@@ -801,6 +804,8 @@ exp :
{ $$ = exp_unop(ABSOLUTE, $3); }
| ALIGN_K '(' exp ')'
{ $$ = exp_unop(ALIGN_K,$3); }
+ | ALIGN_K '(' exp ',' exp ')'
+ { $$ = exp_binop(ALIGN_K,$3,$5); }
| DATA_SEGMENT_ALIGN '(' exp ',' exp ')'
{ $$ = exp_binop (DATA_SEGMENT_ALIGN, $3, $5); }
| DATA_SEGMENT_END '(' exp ')'
@@ -828,31 +833,37 @@ opt_at:
| { $$ = 0; }
;
+opt_subalign:
+ SUBALIGN '(' exp ')' { $$ = $3; }
+ | { $$ = 0; }
+ ;
+
section: NAME { ldlex_expression(); }
- opt_exp_with_type
- opt_at { ldlex_popstate (); ldlex_script (); }
+ opt_exp_with_type
+ opt_at
+ opt_subalign { ldlex_popstate (); ldlex_script (); }
'{'
{
lang_enter_output_section_statement($1, $3,
sectype,
- 0, 0, 0, $4);
+ 0, $5, $4);
}
- statement_list_opt
+ statement_list_opt
'}' { ldlex_popstate (); ldlex_expression (); }
memspec_opt memspec_at_opt phdr_opt fill_opt
{
ldlex_popstate ();
- lang_leave_output_section_statement ($14, $11, $13, $12);
+ lang_leave_output_section_statement ($15, $12, $14, $13);
}
opt_comma
{}
| OVERLAY
{ ldlex_expression (); }
- opt_exp_without_type opt_nocrossrefs opt_at
+ opt_exp_without_type opt_nocrossrefs opt_at opt_subalign
{ ldlex_popstate (); ldlex_script (); }
- '{'
+ '{'
{
- lang_enter_overlay ($3);
+ lang_enter_overlay ($3, $6);
}
overlay_section
'}'
@@ -861,7 +872,7 @@ section: NAME { ldlex_expression(); }
{
ldlex_popstate ();
lang_leave_overlay ($5, (int) $4,
- $15, $12, $14, $13);
+ $16, $13, $15, $14);
}
opt_comma
| /* The GROUP case is just enough to support the gcc
@@ -918,7 +929,7 @@ opt_nocrossrefs:
memspec_opt:
'>' NAME
{ $$ = $2; }
- | { $$ = "*default*"; }
+ | { $$ = DEFAULT_MEMORY_REGION; }
;
phdr_opt:
@@ -933,7 +944,7 @@ phdr_opt:
n = ((struct lang_output_section_phdr_list *)
xmalloc (sizeof *n));
n->name = $3;
- n->used = false;
+ n->used = FALSE;
n->next = $1;
$$ = n;
}
@@ -990,7 +1001,7 @@ phdr_type:
{
"PT_NULL", "PT_LOAD", "PT_DYNAMIC",
"PT_INTERP", "PT_NOTE", "PT_SHLIB",
- "PT_PHDR"
+ "PT_PHDR", "PT_TLS"
};
s = $1->name.name;
@@ -1002,6 +1013,20 @@ phdr_type:
$$ = exp_intop (i);
break;
}
+ if (i == sizeof phdr_types / sizeof phdr_types[0])
+ {
+ if (strcmp (s, "PT_GNU_EH_FRAME") == 0)
+ $$ = exp_intop (0x6474e550);
+ else if (strcmp (s, "PT_GNU_STACK") == 0)
+ $$ = exp_intop (0x6474e551);
+ else
+ {
+ einfo (_("\
+%X%P:%S: unknown phdr type `%s' (try integer literal)\n"),
+ s);
+ $$ = exp_intop (0);
+ }
+ }
}
}
;
@@ -1015,9 +1040,9 @@ phdr_qualifiers:
{
$$ = $3;
if (strcmp ($1, "FILEHDR") == 0 && $2 == NULL)
- $$.filehdr = true;
+ $$.filehdr = TRUE;
else if (strcmp ($1, "PHDRS") == 0 && $2 == NULL)
- $$.phdrs = true;
+ $$.phdrs = TRUE;
else if (strcmp ($1, "FLAGS") == 0 && $2 != NULL)
$$.flags = $2;
else
@@ -1130,23 +1155,38 @@ vers_defns:
{
$$ = lang_new_vers_pattern ($1, $3, ldgram_vers_current_lang);
}
+ | vers_defns ';' EXTERN NAME '{'
+ {
+ $<name>$ = ldgram_vers_current_lang;
+ ldgram_vers_current_lang = $4;
+ }
+ vers_defns opt_semicolon '}'
+ {
+ $$ = $7;
+ ldgram_vers_current_lang = $<name>6;
+ }
| EXTERN NAME '{'
{
$<name>$ = ldgram_vers_current_lang;
ldgram_vers_current_lang = $2;
}
- vers_defns '}'
+ vers_defns opt_semicolon '}'
{
$$ = $5;
ldgram_vers_current_lang = $<name>4;
}
;
+opt_semicolon:
+ /* empty */
+ | ';'
+ ;
+
%%
void
-yyerror(arg)
+yyerror(arg)
const char *arg;
-{
+{
if (ldfile_assumed_script)
einfo (_("%P:%s: file format not recognized; treating as linker script\n"),
ldfile_input_filename);
diff --git a/contrib/binutils/ld/ldint.texinfo b/contrib/binutils/ld/ldint.texinfo
index 489750a..5486764 100644
--- a/contrib/binutils/ld/ldint.texinfo
+++ b/contrib/binutils/ld/ldint.texinfo
@@ -1,6 +1,6 @@
\input texinfo
@setfilename ldint.info
-@c Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+@c Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003
@c Free Software Foundation, Inc.
@ifinfo
@@ -334,7 +334,7 @@ be run when doing a final relocation, they should be enclosed within a
variable substitution based on @code{RELOCATING}. For example, on many
targets special symbols such as @code{_end} should be defined when doing
a final link. Naturally, those symbols should not be defined when doing
-a relocateable link using @code{-r}. The @file{scripttempl} script
+a relocatable link using @code{-r}. The @file{scripttempl} script
could use a construct like this to define those symbols:
@smallexample
$@{RELOCATING+ _end = .;@}
diff --git a/contrib/binutils/ld/ldlang.c b/contrib/binutils/ld/ldlang.c
index 0eb06b2..0c08601 100644
--- a/contrib/binutils/ld/ldlang.c
+++ b/contrib/binutils/ld/ldlang.c
@@ -1,24 +1,24 @@
/* Linker command language support.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002
+ 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
-This file is part of GLD, the Gnu Linker.
+ This file is part of GLD, the Gnu Linker.
-GLD is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+ GLD is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
-GLD is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ GLD is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with GLD; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with GLD; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -39,174 +39,72 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ldemul.h"
#include "fnmatch.h"
#include "demangle.h"
+#include "hashtab.h"
-/* FORWARDS */
-static lang_statement_union_type *new_statement
- PARAMS ((enum statement_enum, size_t, lang_statement_list_type *));
+#ifndef offsetof
+#define offsetof(TYPE, MEMBER) ((size_t) & (((TYPE*) 0)->MEMBER))
+#endif
-/* LOCALS */
+/* Locals variables. */
static struct obstack stat_obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
static const char *startup_file;
static lang_statement_list_type input_file_chain;
-static boolean placed_commons = false;
+static bfd_boolean placed_commons = FALSE;
static lang_output_section_statement_type *default_common_section;
-static boolean map_option_f;
+static bfd_boolean map_option_f;
static bfd_vma print_dot;
static lang_input_statement_type *first_file;
static const char *current_target;
static const char *output_target;
static lang_statement_list_type statement_list;
static struct lang_phdr *lang_phdr_list;
-
-static void lang_for_each_statement_worker
- PARAMS ((void (*) (lang_statement_union_type *),
- lang_statement_union_type *));
-static lang_input_statement_type *new_afile
- PARAMS ((const char *, lang_input_file_enum_type, const char *, boolean));
-static lang_memory_region_type *lang_memory_default PARAMS ((asection *));
-static void lang_map_flags PARAMS ((flagword));
-static void init_os PARAMS ((lang_output_section_statement_type *));
-static void exp_init_os PARAMS ((etree_type *));
-static void section_already_linked PARAMS ((bfd *, asection *, PTR));
-static struct bfd_hash_entry *already_linked_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-static void already_linked_table_init PARAMS ((void));
-static void already_linked_table_free PARAMS ((void));
-static boolean wildcardp PARAMS ((const char *));
-static lang_statement_union_type *wild_sort
- PARAMS ((lang_wild_statement_type *, struct wildcard_list *,
- lang_input_statement_type *, asection *));
-static void output_section_callback
- PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *,
- lang_input_statement_type *, PTR));
-static lang_input_statement_type *lookup_name PARAMS ((const char *));
-static boolean load_symbols
- PARAMS ((lang_input_statement_type *, lang_statement_list_type *));
-static void wild
- PARAMS ((lang_wild_statement_type *,
- const char *, lang_output_section_statement_type *));
-static bfd *open_output PARAMS ((const char *));
-static void ldlang_open_output PARAMS ((lang_statement_union_type *));
-static void open_input_bfds PARAMS ((lang_statement_union_type *, boolean));
-static void lang_reasonable_defaults PARAMS ((void));
-static void insert_undefined PARAMS ((const char *));
-static void lang_place_undefineds PARAMS ((void));
-static void map_input_to_output_sections
- PARAMS ((lang_statement_union_type *, const char *,
- lang_output_section_statement_type *));
-static void strip_excluded_output_sections PARAMS ((void));
-static void print_output_section_statement
- PARAMS ((lang_output_section_statement_type *));
-static void print_assignment
- PARAMS ((lang_assignment_statement_type *,
- lang_output_section_statement_type *));
-static void print_input_statement PARAMS ((lang_input_statement_type *));
-static boolean print_one_symbol PARAMS ((struct bfd_link_hash_entry *, PTR));
-static void print_input_section PARAMS ((lang_input_section_type *));
-static void print_fill_statement PARAMS ((lang_fill_statement_type *));
-static void print_data_statement PARAMS ((lang_data_statement_type *));
-static void print_address_statement PARAMS ((lang_address_statement_type *));
-static void print_reloc_statement PARAMS ((lang_reloc_statement_type *));
-static void print_padding_statement PARAMS ((lang_padding_statement_type *));
-static void print_wild_statement
- PARAMS ((lang_wild_statement_type *, lang_output_section_statement_type *));
-static void print_group
- PARAMS ((lang_group_statement_type *, lang_output_section_statement_type *));
-static void print_statement
- PARAMS ((lang_statement_union_type *, lang_output_section_statement_type *));
-static void print_statement_list
- PARAMS ((lang_statement_union_type *, lang_output_section_statement_type *));
-static void print_statements PARAMS ((void));
-static void insert_pad
- PARAMS ((lang_statement_union_type **, fill_type *,
- unsigned int, asection *, bfd_vma));
-static bfd_vma size_input_section
- PARAMS ((lang_statement_union_type **, lang_output_section_statement_type *,
- fill_type *, bfd_vma));
-static void lang_finish PARAMS ((void));
-static void ignore_bfd_errors PARAMS ((const char *, ...));
-static void lang_check PARAMS ((void));
-static void lang_common PARAMS ((void));
-static boolean lang_one_common PARAMS ((struct bfd_link_hash_entry *, PTR));
-static void lang_place_orphans PARAMS ((void));
-static int topower PARAMS ((int));
-static void lang_set_startof PARAMS ((void));
-static void gc_section_callback
- PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *,
- lang_input_statement_type *, PTR));
-static void lang_get_regions PARAMS ((struct memory_region_struct **,
- struct memory_region_struct **,
- const char *, const char *, int));
-static void lang_record_phdrs PARAMS ((void));
-static void lang_gc_wild PARAMS ((lang_wild_statement_type *));
-static void lang_gc_sections_1 PARAMS ((lang_statement_union_type *));
-static void lang_gc_sections PARAMS ((void));
-static int lang_vers_match_lang_c
- PARAMS ((struct bfd_elf_version_expr *, const char *));
-static int lang_vers_match_lang_cplusplus
- PARAMS ((struct bfd_elf_version_expr *, const char *));
-static int lang_vers_match_lang_java
- PARAMS ((struct bfd_elf_version_expr *, const char *));
-static void lang_do_version_exports_section PARAMS ((void));
-static void lang_check_section_addresses PARAMS ((void));
-static void os_region_check
- PARAMS ((lang_output_section_statement_type *,
- struct memory_region_struct *, etree_type *, bfd_vma));
-static bfd_vma lang_size_sections_1
- PARAMS ((lang_statement_union_type *, lang_output_section_statement_type *,
- lang_statement_union_type **, fill_type *, bfd_vma, boolean *));
-
-typedef void (*callback_t) PARAMS ((lang_wild_statement_type *,
- struct wildcard_list *,
- asection *,
- lang_input_statement_type *,
- PTR));
-static void walk_wild
- PARAMS ((lang_wild_statement_type *, callback_t, PTR));
-static void walk_wild_section
- PARAMS ((lang_wild_statement_type *, lang_input_statement_type *,
- callback_t, PTR));
-static void walk_wild_file
- PARAMS ((lang_wild_statement_type *, lang_input_statement_type *,
- callback_t, PTR));
-
-static int get_target PARAMS ((const bfd_target *, PTR));
-static void stricpy PARAMS ((char *, char *));
-static void strcut PARAMS ((char *, char *));
-static int name_compare PARAMS ((char *, char *));
-static int closest_target_match PARAMS ((const bfd_target *, PTR));
-static char * get_first_input_target PARAMS ((void));
-
-/* EXPORTS */
+static struct bfd_hash_table lang_definedness_table;
+
+/* Forward declarations. */
+static void exp_init_os (etree_type *);
+static bfd_boolean wildcardp (const char *);
+static lang_input_statement_type *lookup_name (const char *);
+static bfd_boolean load_symbols (lang_input_statement_type *,
+ lang_statement_list_type *);
+static struct bfd_hash_entry *lang_definedness_newfunc
+ (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
+static void insert_undefined (const char *);
+static void print_statement (lang_statement_union_type *,
+ lang_output_section_statement_type *);
+static void print_statement_list (lang_statement_union_type *,
+ lang_output_section_statement_type *);
+static void print_statements (void);
+static bfd_boolean lang_one_common (struct bfd_link_hash_entry *, void *);
+static void lang_record_phdrs (void);
+static void lang_do_version_exports_section (void);
+
+typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
+ asection *, lang_input_statement_type *, void *);
+
+/* Exported variables. */
lang_output_section_statement_type *abs_output_section;
lang_statement_list_type lang_output_section_statement;
lang_statement_list_type *stat_ptr = &statement_list;
lang_statement_list_type file_chain = { NULL, NULL };
struct bfd_sym_chain entry_symbol = { NULL, NULL };
const char *entry_section = ".text";
-boolean entry_from_cmdline;
-boolean lang_has_input_file = false;
-boolean had_output_filename = false;
-boolean lang_float_flag = false;
-boolean delete_output_file_on_failure = false;
+bfd_boolean entry_from_cmdline;
+bfd_boolean lang_has_input_file = FALSE;
+bfd_boolean had_output_filename = FALSE;
+bfd_boolean lang_float_flag = FALSE;
+bfd_boolean delete_output_file_on_failure = FALSE;
struct lang_nocrossrefs *nocrossref_list;
struct unique_sections *unique_section_list;
+static bfd_boolean ldlang_sysrooted_script = FALSE;
+int lang_statement_iteration = 0;
etree_type *base; /* Relocation base - or null */
-#if defined (__STDC__) || defined (ALMOST_STDC)
-#define cat(a,b) a##b
-#else
-#define cat(a,b) a/**/b
-#endif
-
-/* Don't beautify the line below with "innocent" whitespace, it breaks
- the K&R C preprocessor! */
#define new_stat(x, y) \
- (cat (x,_type)*) new_statement (cat (x,_enum), sizeof (cat (x,_type)), y)
+ (x##_type *) new_statement (x##_enum, sizeof (x##_type), y)
#define outside_section_address(q) \
((q)->output_offset + (q)->output_section->vma)
@@ -216,16 +114,14 @@ etree_type *base; /* Relocation base - or null */
#define SECTION_NAME_MAP_LENGTH (16)
-PTR
-stat_alloc (size)
- size_t size;
+void *
+stat_alloc (size_t size)
{
return obstack_alloc (&stat_obstack, size);
}
-boolean
-unique_section_p (secnam)
- const char *secnam;
+bfd_boolean
+unique_section_p (const char *secnam)
{
struct unique_sections *unam;
@@ -234,20 +130,19 @@ unique_section_p (secnam)
? fnmatch (unam->name, secnam, 0) == 0
: strcmp (unam->name, secnam) == 0)
{
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
/* Generic traversal routines for finding matching sections. */
static void
-walk_wild_section (ptr, file, callback, data)
- lang_wild_statement_type *ptr;
- lang_input_statement_type *file;
- callback_t callback;
- PTR data;
+walk_wild_section (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ callback_t callback,
+ void *data)
{
asection *s;
@@ -264,7 +159,7 @@ walk_wild_section (ptr, file, callback, data)
while (sec != NULL)
{
- boolean skip = false;
+ bfd_boolean skip = FALSE;
struct name_list *list_tmp;
/* Don't process sections from files which were
@@ -318,11 +213,10 @@ walk_wild_section (ptr, file, callback, data)
/* Handle a wild statement for a single file F. */
static void
-walk_wild_file (s, f, callback, data)
- lang_wild_statement_type *s;
- lang_input_statement_type *f;
- callback_t callback;
- PTR data;
+walk_wild_file (lang_wild_statement_type *s,
+ lang_input_statement_type *f,
+ callback_t callback,
+ void *data)
{
if (f->the_bfd == NULL
|| ! bfd_check_format (f->the_bfd, bfd_archive))
@@ -333,7 +227,7 @@ walk_wild_file (s, f, callback, data)
/* This is an archive file. We must map each member of the
archive separately. */
- member = bfd_openr_next_archived_file (f->the_bfd, (bfd *) NULL);
+ member = bfd_openr_next_archived_file (f->the_bfd, NULL);
while (member != NULL)
{
/* When lookup_name is called, it will call the add_symbols
@@ -343,9 +237,7 @@ walk_wild_file (s, f, callback, data)
lang_input_statement. */
if (member->usrdata != NULL)
{
- walk_wild_section (s,
- (lang_input_statement_type *) member->usrdata,
- callback, data);
+ walk_wild_section (s, member->usrdata, callback, data);
}
member = bfd_openr_next_archived_file (f->the_bfd, member);
@@ -354,10 +246,7 @@ walk_wild_file (s, f, callback, data)
}
static void
-walk_wild (s, callback, data)
- lang_wild_statement_type *s;
- callback_t callback;
- PTR data;
+walk_wild (lang_wild_statement_type *s, callback_t callback, void *data)
{
const char *file_spec = s->filename;
@@ -392,11 +281,10 @@ walk_wild (s, callback, data)
function for each node. */
static void
-lang_for_each_statement_worker (func, s)
- void (*func) PARAMS ((lang_statement_union_type *));
- lang_statement_union_type *s;
+lang_for_each_statement_worker (void (*func) (lang_statement_union_type *),
+ lang_statement_union_type *s)
{
- for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
+ for (; s != NULL; s = s->header.next)
{
func (s);
@@ -439,8 +327,7 @@ lang_for_each_statement_worker (func, s)
}
void
-lang_for_each_statement (func)
- void (*func) PARAMS ((lang_statement_union_type *));
+lang_for_each_statement (void (*func) (lang_statement_union_type *))
{
lang_for_each_statement_worker (func, statement_list.head);
}
@@ -448,26 +335,24 @@ lang_for_each_statement (func)
/*----------------------------------------------------------------------*/
void
-lang_list_init (list)
- lang_statement_list_type *list;
+lang_list_init (lang_statement_list_type *list)
{
- list->head = (lang_statement_union_type *) NULL;
+ list->head = NULL;
list->tail = &list->head;
}
/* Build a new statement node for the parse tree. */
static lang_statement_union_type *
-new_statement (type, size, list)
- enum statement_enum type;
- size_t size;
- lang_statement_list_type *list;
+new_statement (enum statement_enum type,
+ size_t size,
+ lang_statement_list_type *list)
{
- lang_statement_union_type *new = (lang_statement_union_type *)
- stat_alloc (size);
+ lang_statement_union_type *new;
+ new = stat_alloc (size);
new->header.type = type;
- new->header.next = (lang_statement_union_type *) NULL;
+ new->header.next = NULL;
lang_statement_append (list, new, &new->header.next);
return new;
}
@@ -477,16 +362,15 @@ new_statement (type, size, list)
or prefix it with a -l etc.
We can be supplied with requests for input files more than once;
- they may, for example be split over serveral lines like foo.o(.text)
+ they may, for example be split over several lines like foo.o(.text)
foo.o(.data) etc, so when asked for a file we check that we haven't
got it already so we don't duplicate the bfd. */
static lang_input_statement_type *
-new_afile (name, file_type, target, add_to_list)
- const char *name;
- lang_input_file_enum_type file_type;
- const char *target;
- boolean add_to_list;
+new_afile (const char *name,
+ lang_input_file_enum_type file_type,
+ const char *target,
+ bfd_boolean add_to_list)
{
lang_input_statement_type *p;
@@ -494,74 +378,76 @@ new_afile (name, file_type, target, add_to_list)
p = new_stat (lang_input_statement, stat_ptr);
else
{
- p = ((lang_input_statement_type *)
- stat_alloc (sizeof (lang_input_statement_type)));
+ p = stat_alloc (sizeof (lang_input_statement_type));
p->header.next = NULL;
}
- lang_has_input_file = true;
+ lang_has_input_file = TRUE;
p->target = target;
+ p->sysrooted = FALSE;
switch (file_type)
{
case lang_input_file_is_symbols_only_enum:
p->filename = name;
- p->is_archive = false;
- p->real = true;
+ p->is_archive = FALSE;
+ p->real = TRUE;
p->local_sym_name = name;
- p->just_syms_flag = true;
- p->search_dirs_flag = false;
+ p->just_syms_flag = TRUE;
+ p->search_dirs_flag = FALSE;
break;
case lang_input_file_is_fake_enum:
p->filename = name;
- p->is_archive = false;
- p->real = false;
+ p->is_archive = FALSE;
+ p->real = FALSE;
p->local_sym_name = name;
- p->just_syms_flag = false;
- p->search_dirs_flag = false;
+ p->just_syms_flag = FALSE;
+ p->search_dirs_flag = FALSE;
break;
case lang_input_file_is_l_enum:
- p->is_archive = true;
+ p->is_archive = TRUE;
p->filename = name;
- p->real = true;
- p->local_sym_name = concat ("-l", name, (const char *) NULL);
- p->just_syms_flag = false;
- p->search_dirs_flag = true;
+ p->real = TRUE;
+ p->local_sym_name = concat ("-l", name, NULL);
+ p->just_syms_flag = FALSE;
+ p->search_dirs_flag = TRUE;
break;
case lang_input_file_is_marker_enum:
p->filename = name;
- p->is_archive = false;
- p->real = false;
+ p->is_archive = FALSE;
+ p->real = FALSE;
p->local_sym_name = name;
- p->just_syms_flag = false;
- p->search_dirs_flag = true;
+ p->just_syms_flag = FALSE;
+ p->search_dirs_flag = TRUE;
break;
case lang_input_file_is_search_file_enum:
+ p->sysrooted = ldlang_sysrooted_script;
p->filename = name;
- p->is_archive = false;
- p->real = true;
+ p->is_archive = FALSE;
+ p->real = TRUE;
p->local_sym_name = name;
- p->just_syms_flag = false;
- p->search_dirs_flag = true;
+ p->just_syms_flag = FALSE;
+ p->search_dirs_flag = TRUE;
break;
case lang_input_file_is_file_enum:
p->filename = name;
- p->is_archive = false;
- p->real = true;
+ p->is_archive = FALSE;
+ p->real = TRUE;
p->local_sym_name = name;
- p->just_syms_flag = false;
- p->search_dirs_flag = false;
+ p->just_syms_flag = FALSE;
+ p->search_dirs_flag = FALSE;
break;
default:
FAIL ();
}
- p->the_bfd = (bfd *) NULL;
- p->asymbols = (asymbol **) NULL;
- p->next_real_file = (lang_statement_union_type *) NULL;
- p->next = (lang_statement_union_type *) NULL;
+ p->the_bfd = NULL;
+ p->asymbols = NULL;
+ p->next_real_file = NULL;
+ p->next = NULL;
p->symbol_count = 0;
p->dynamic = config.dynamic_link;
+ p->as_needed = as_needed;
p->whole_archive = whole_archive;
- p->loaded = false;
+ p->loaded = FALSE;
lang_statement_append (&input_file_chain,
(lang_statement_union_type *) p,
&p->next_real_file);
@@ -569,19 +455,18 @@ new_afile (name, file_type, target, add_to_list)
}
lang_input_statement_type *
-lang_add_input_file (name, file_type, target)
- const char *name;
- lang_input_file_enum_type file_type;
- const char *target;
+lang_add_input_file (const char *name,
+ lang_input_file_enum_type file_type,
+ const char *target)
{
- lang_has_input_file = true;
- return new_afile (name, file_type, target, true);
+ lang_has_input_file = TRUE;
+ return new_afile (name, file_type, target, TRUE);
}
/* Build enough state so that the parser can build its tree. */
void
-lang_init ()
+lang_init (void)
{
obstack_begin (&stat_obstack, 1000);
@@ -592,14 +477,25 @@ lang_init ()
lang_list_init (&input_file_chain);
lang_list_init (&lang_output_section_statement);
lang_list_init (&file_chain);
- first_file = lang_add_input_file ((char *) NULL,
- lang_input_file_is_marker_enum,
- (char *) NULL);
+ first_file = lang_add_input_file (NULL, lang_input_file_is_marker_enum,
+ NULL);
abs_output_section =
lang_output_section_statement_lookup (BFD_ABS_SECTION_NAME);
abs_output_section->bfd_section = bfd_abs_section_ptr;
+ /* The value "3" is ad-hoc, somewhat related to the expected number of
+ DEFINED expressions in a linker script. For most default linker
+ scripts, there are none. Why a hash table then? Well, it's somewhat
+ simpler to re-use working machinery than using a linked list in terms
+ of code-complexity here in ld, besides the initialization which just
+ looks like other code here. */
+ if (bfd_hash_table_init_n (&lang_definedness_table,
+ lang_definedness_newfunc, 3) != TRUE)
+ einfo (_("%P%F: out of memory during initialization"));
+
+ /* Callers of exp_fold_tree need to increment this. */
+ lang_statement_iteration = 0;
}
/*----------------------------------------------------------------------
@@ -610,30 +506,34 @@ lang_init ()
We maintain a list of all the regions here.
If no regions are specified in the script, then the default is used
- which is created when looked up to be the entire data space. */
+ which is created when looked up to be the entire data space.
+
+ If create is true we are creating a region inside a MEMORY block.
+ In this case it is probably an error to create a region that has
+ already been created. If we are not inside a MEMORY block it is
+ dubious to use an undeclared region name (except DEFAULT_MEMORY_REGION)
+ and so we issue a warning. */
static lang_memory_region_type *lang_memory_region_list;
static lang_memory_region_type **lang_memory_region_list_tail = &lang_memory_region_list;
lang_memory_region_type *
-lang_memory_region_lookup (name)
- const char *const name;
+lang_memory_region_lookup (const char *const name, bfd_boolean create)
{
lang_memory_region_type *p;
+ lang_memory_region_type *new;
/* NAME is NULL for LMA memspecs if no region was specified. */
if (name == NULL)
return NULL;
- for (p = lang_memory_region_list;
- p != (lang_memory_region_type *) NULL;
- p = p->next)
- {
- if (strcmp (p->name, name) == 0)
- {
- return p;
- }
- }
+ for (p = lang_memory_region_list; p != NULL; p = p->next)
+ if (strcmp (p->name, name) == 0)
+ {
+ if (create)
+ einfo (_("%P:%S: warning: redeclaration of memory region '%s'\n"), name);
+ return p;
+ }
#if 0
/* This code used to always use the first region in the list as the
@@ -642,38 +542,35 @@ lang_memory_region_lookup (name)
NOLOAD sections to work reasonably without requiring a region.
People should specify what region they mean, if they really want
a region. */
- if (strcmp (name, "*default*") == 0)
+ if (strcmp (name, DEFAULT_MEMORY_REGION) == 0)
{
- if (lang_memory_region_list != (lang_memory_region_type *) NULL)
- {
- return lang_memory_region_list;
- }
+ if (lang_memory_region_list != NULL)
+ return lang_memory_region_list;
}
#endif
- {
- lang_memory_region_type *new =
- (lang_memory_region_type *) stat_alloc (sizeof (lang_memory_region_type));
+ if (!create && strcmp (name, DEFAULT_MEMORY_REGION))
+ einfo (_("%P:%S: warning: memory region %s not declared\n"), name);
- new->name = xstrdup (name);
- new->next = (lang_memory_region_type *) NULL;
+ new = stat_alloc (sizeof (lang_memory_region_type));
+
+ new->name = xstrdup (name);
+ new->next = NULL;
- *lang_memory_region_list_tail = new;
- lang_memory_region_list_tail = &new->next;
- new->origin = 0;
- new->flags = 0;
- new->not_flags = 0;
- new->length = ~(bfd_size_type) 0;
- new->current = 0;
- new->had_full_message = false;
+ *lang_memory_region_list_tail = new;
+ lang_memory_region_list_tail = &new->next;
+ new->origin = 0;
+ new->flags = 0;
+ new->not_flags = 0;
+ new->length = ~(bfd_size_type) 0;
+ new->current = 0;
+ new->had_full_message = FALSE;
- return new;
- }
+ return new;
}
static lang_memory_region_type *
-lang_memory_default (section)
- asection *section;
+lang_memory_default (asection *section)
{
lang_memory_region_type *p;
@@ -683,9 +580,7 @@ lang_memory_default (section)
if ((sec_flags & (SEC_ALLOC | SEC_READONLY | SEC_CODE)) == SEC_ALLOC)
sec_flags |= SEC_DATA;
- for (p = lang_memory_region_list;
- p != (lang_memory_region_type *) NULL;
- p = p->next)
+ for (p = lang_memory_region_list; p != NULL; p = p->next)
{
if ((p->flags & sec_flags) != 0
&& (p->not_flags & sec_flags) == 0)
@@ -693,59 +588,51 @@ lang_memory_default (section)
return p;
}
}
- return lang_memory_region_lookup ("*default*");
+ return lang_memory_region_lookup (DEFAULT_MEMORY_REGION, FALSE);
}
lang_output_section_statement_type *
-lang_output_section_find (name)
- const char *const name;
+lang_output_section_find (const char *const name)
{
lang_statement_union_type *u;
lang_output_section_statement_type *lookup;
- for (u = lang_output_section_statement.head;
- u != (lang_statement_union_type *) NULL;
- u = lookup->next)
+ for (u = lang_output_section_statement.head; u != NULL; u = lookup->next)
{
lookup = &u->output_section_statement;
if (strcmp (name, lookup->name) == 0)
- {
- return lookup;
- }
+ return lookup;
}
- return (lang_output_section_statement_type *) NULL;
+ return NULL;
}
lang_output_section_statement_type *
-lang_output_section_statement_lookup (name)
- const char *const name;
+lang_output_section_statement_lookup (const char *const name)
{
lang_output_section_statement_type *lookup;
lookup = lang_output_section_find (name);
- if (lookup == (lang_output_section_statement_type *) NULL)
+ if (lookup == NULL)
{
-
- lookup = (lang_output_section_statement_type *)
- new_stat (lang_output_section_statement, stat_ptr);
- lookup->region = (lang_memory_region_type *) NULL;
- lookup->lma_region = (lang_memory_region_type *) NULL;
- lookup->fill = (fill_type *) 0;
+ lookup = new_stat (lang_output_section_statement, stat_ptr);
+ lookup->region = NULL;
+ lookup->lma_region = NULL;
+ lookup->fill = 0;
lookup->block_value = 1;
lookup->name = name;
- lookup->next = (lang_statement_union_type *) NULL;
- lookup->bfd_section = (asection *) NULL;
- lookup->processed = false;
+ lookup->next = NULL;
+ lookup->bfd_section = NULL;
+ lookup->processed = 0;
lookup->sectype = normal_section;
- lookup->addr_tree = (etree_type *) NULL;
+ lookup->addr_tree = NULL;
lang_list_init (&lookup->children);
- lookup->memspec = (const char *) NULL;
+ lookup->memspec = NULL;
lookup->flags = 0;
lookup->subsection_alignment = -1;
lookup->section_alignment = -1;
- lookup->load_base = (union etree_union *) NULL;
+ lookup->load_base = NULL;
lookup->update_dot_tree = NULL;
lookup->phdrs = NULL;
@@ -757,8 +644,7 @@ lang_output_section_statement_lookup (name)
}
static void
-lang_map_flags (flag)
- flagword flag;
+lang_map_flags (flagword flag)
{
if (flag & SEC_ALLOC)
minfo ("a");
@@ -777,7 +663,7 @@ lang_map_flags (flag)
}
void
-lang_map ()
+lang_map (void)
{
lang_memory_region_type *m;
@@ -785,9 +671,7 @@ lang_map ()
fprintf (config.map_file, "%-16s %-18s %-18s %s\n",
_("Name"), _("Origin"), _("Length"), _("Attributes"));
- for (m = lang_memory_region_list;
- m != (lang_memory_region_type *) NULL;
- m = m->next)
+ for (m = lang_memory_region_list; m != NULL; m = m->next)
{
char buf[100];
int len;
@@ -833,8 +717,7 @@ lang_map ()
/* Initialize an output section. */
static void
-init_os (s)
- lang_output_section_statement_type *s;
+init_os (lang_output_section_statement_type *s)
{
section_userdata_type *new;
@@ -844,13 +727,12 @@ init_os (s)
if (strcmp (s->name, DISCARD_SECTION_NAME) == 0)
einfo (_("%P%F: Illegal use of `%s' section\n"), DISCARD_SECTION_NAME);
- new = ((section_userdata_type *)
- stat_alloc (sizeof (section_userdata_type)));
+ new = stat_alloc (sizeof (section_userdata_type));
s->bfd_section = bfd_get_section_by_name (output_bfd, s->name);
- if (s->bfd_section == (asection *) NULL)
+ if (s->bfd_section == NULL)
s->bfd_section = bfd_make_section (output_bfd, s->name);
- if (s->bfd_section == (asection *) NULL)
+ if (s->bfd_section == NULL)
{
einfo (_("%P%F: output format %s cannot represent section called %s\n"),
output_bfd->xvec->name, s->name);
@@ -860,20 +742,22 @@ init_os (s)
/* We initialize an output sections output offset to minus its own
vma to allow us to output a section through itself. */
s->bfd_section->output_offset = 0;
- get_userdata (s->bfd_section) = (PTR) new;
+ get_userdata (s->bfd_section) = new;
/* If there is a base address, make sure that any sections it might
mention are initialized. */
if (s->addr_tree != NULL)
exp_init_os (s->addr_tree);
+
+ if (s->load_base != NULL)
+ exp_init_os (s->load_base);
}
/* Make sure that all output sections mentioned in an expression are
initialized. */
static void
-exp_init_os (exp)
- etree_type *exp;
+exp_init_os (etree_type *exp)
{
switch (exp->type.node_class)
{
@@ -892,6 +776,10 @@ exp_init_os (exp)
exp_init_os (exp->trinary.rhs);
break;
+ case etree_assert:
+ exp_init_os (exp->assert_s.child);
+ break;
+
case etree_unary:
exp_init_os (exp->unary.child);
break;
@@ -948,12 +836,9 @@ struct already_linked
static struct bfd_hash_table already_linked_table;
static void
-section_already_linked (abfd, sec, data)
- bfd *abfd;
- asection *sec;
- PTR data;
+section_already_linked (bfd *abfd, asection *sec, void *data)
{
- lang_input_statement_type *entry = (lang_input_statement_type *) data;
+ lang_input_statement_type *entry = data;
flagword flags;
const char *name;
struct already_linked *l;
@@ -993,7 +878,7 @@ section_already_linked (abfd, sec, data)
already_linked_list =
((struct already_linked_hash_entry *)
- bfd_hash_lookup (&already_linked_table, name, true, false));
+ bfd_hash_lookup (&already_linked_table, name, TRUE, FALSE));
for (l = already_linked_list->entry; l != NULL; l = l->next)
{
@@ -1037,8 +922,11 @@ section_already_linked (abfd, sec, data)
/* Set the output_section field so that lang_add_section
does not create a lang_input_section structure for this
- section. */
+ section. Since there might be a symbol in the section
+ being discarded, we must retain a pointer to the section
+ which we are really going to use. */
sec->output_section = bfd_abs_section_ptr;
+ sec->kept_section = l->sec;
if (flags & SEC_GROUP)
bfd_discard_group (abfd, sec);
@@ -1050,8 +938,7 @@ section_already_linked (abfd, sec, data)
/* This is the first section with this name. Record it. Allocate
the memory from the same obstack as the hash table is kept in. */
- l = ((struct already_linked *)
- bfd_hash_allocate (&already_linked_table, sizeof *l));
+ l = bfd_hash_allocate (&already_linked_table, sizeof *l);
l->sec = sec;
l->next = already_linked_list->entry;
@@ -1062,21 +949,20 @@ section_already_linked (abfd, sec, data)
initialize the table, fill in an entry and remove the table. */
static struct bfd_hash_entry *
-already_linked_newfunc (entry, table, string)
- struct bfd_hash_entry *entry ATTRIBUTE_UNUSED;
- struct bfd_hash_table *table;
- const char *string ATTRIBUTE_UNUSED;
+already_linked_newfunc (struct bfd_hash_entry *entry ATTRIBUTE_UNUSED,
+ struct bfd_hash_table *table,
+ const char *string ATTRIBUTE_UNUSED)
{
struct already_linked_hash_entry *ret =
bfd_hash_allocate (table, sizeof (struct already_linked_hash_entry));
ret->entry = NULL;
- return (struct bfd_hash_entry *) ret;
+ return &ret->root;
}
static void
-already_linked_table_init ()
+already_linked_table_init (void)
{
if (! bfd_hash_table_init_n (&already_linked_table,
already_linked_newfunc,
@@ -1085,7 +971,7 @@ already_linked_table_init ()
}
static void
-already_linked_table_free ()
+already_linked_table_free (void)
{
bfd_hash_table_free (&already_linked_table);
}
@@ -1096,15 +982,14 @@ already_linked_table_free ()
explicit actions, like foo.o(.text), bar.o(.text) and
foo.o(.text, .data). */
-/* Return true if the PATTERN argument is a wildcard pattern.
+/* Return TRUE if the PATTERN argument is a wildcard pattern.
Although backslashes are treated specially if a pattern contains
wildcards, we do not consider the mere presence of a backslash to
be enough to cause the pattern to be treated as a wildcard.
That lets us handle DOS filenames more naturally. */
-static boolean
-wildcardp (pattern)
- const char *pattern;
+static bfd_boolean
+wildcardp (const char *pattern)
{
const char *s;
@@ -1112,8 +997,8 @@ wildcardp (pattern)
if (*s == '?'
|| *s == '*'
|| *s == '[')
- return true;
- return false;
+ return TRUE;
+ return FALSE;
}
/* Add SECTION to the output section OUTPUT. Do this by creating a
@@ -1121,35 +1006,35 @@ wildcardp (pattern)
input file which holds SECTION. */
void
-lang_add_section (ptr, section, output, file)
- lang_statement_list_type *ptr;
- asection *section;
- lang_output_section_statement_type *output;
- lang_input_statement_type *file;
+lang_add_section (lang_statement_list_type *ptr,
+ asection *section,
+ lang_output_section_statement_type *output,
+ lang_input_statement_type *file)
{
flagword flags;
- boolean discard;
+ bfd_boolean discard;
flags = bfd_get_section_flags (section->owner, section);
- discard = false;
+ discard = FALSE;
- /* If we are doing a final link, discard sections marked with
- SEC_EXCLUDE. */
- if (! link_info.relocateable
- && (flags & SEC_EXCLUDE) != 0)
- discard = true;
+ /* Discard sections marked with SEC_EXCLUDE if we are doing a final
+ link. Discard debugging sections marked with SEC_EXCLUDE on a
+ relocatable link too. */
+ if ((flags & SEC_EXCLUDE) != 0
+ && ((flags & SEC_DEBUGGING) != 0 || !link_info.relocatable))
+ discard = TRUE;
/* Discard input sections which are assigned to a section named
DISCARD_SECTION_NAME. */
if (strcmp (output->name, DISCARD_SECTION_NAME) == 0)
- discard = true;
+ discard = TRUE;
/* Discard debugging sections if we are stripping debugging
information. */
if ((link_info.strip == strip_debugger || link_info.strip == strip_all)
&& (flags & SEC_DEBUGGING) != 0)
- discard = true;
+ discard = TRUE;
if (discard)
{
@@ -1163,7 +1048,7 @@ lang_add_section (ptr, section, output, file)
if (section->output_section == NULL)
{
- boolean first;
+ bfd_boolean first;
lang_input_section_type *new;
flagword flags;
@@ -1196,7 +1081,7 @@ lang_add_section (ptr, section, output, file)
format targets, .text$foo sections go into .text and it's odd
to see .text with SEC_LINK_ONCE set. */
- if (! link_info.relocateable)
+ if (! link_info.relocatable)
flags &= ~ (SEC_LINK_ONCE | SEC_LINK_DUPLICATES);
/* If this is not the first input section, and the SEC_READONLY
@@ -1217,10 +1102,6 @@ lang_add_section (ptr, section, output, file)
flags &= ~ (SEC_MERGE | SEC_STRINGS);
}
- /* For now make .tbss normal section. */
- if ((flags & SEC_THREAD_LOCAL) && ! link_info.relocateable)
- flags |= SEC_LOAD;
-
section->output_section->flags |= flags;
if (flags & SEC_MERGE)
@@ -1254,7 +1135,7 @@ lang_add_section (ptr, section, output, file)
if (section->alignment_power > output->bfd_section->alignment_power)
output->bfd_section->alignment_power = section->alignment_power;
- /* If supplied an aligment, then force it. */
+ /* If supplied an alignment, then force it. */
if (output->section_alignment != -1)
output->bfd_section->alignment_power = output->section_alignment;
@@ -1273,11 +1154,10 @@ lang_add_section (ptr, section, output, file)
new section should just go at the end of the current list. */
static lang_statement_union_type *
-wild_sort (wild, sec, file, section)
- lang_wild_statement_type *wild;
- struct wildcard_list *sec;
- lang_input_statement_type *file;
- asection *section;
+wild_sort (lang_wild_statement_type *wild,
+ struct wildcard_list *sec,
+ lang_input_statement_type *file,
+ asection *section)
{
const char *section_name;
lang_statement_union_type *l;
@@ -1300,7 +1180,7 @@ wild_sort (wild, sec, file, section)
if (wild->filenames_sorted)
{
const char *fn, *ln;
- boolean fa, la;
+ bfd_boolean fa, la;
int i;
/* The PE support for the .idata section as generated by
@@ -1312,24 +1192,24 @@ wild_sort (wild, sec, file, section)
&& bfd_my_archive (file->the_bfd) != NULL)
{
fn = bfd_get_filename (bfd_my_archive (file->the_bfd));
- fa = true;
+ fa = TRUE;
}
else
{
fn = file->filename;
- fa = false;
+ fa = FALSE;
}
if (ls->ifile->the_bfd != NULL
&& bfd_my_archive (ls->ifile->the_bfd) != NULL)
{
ln = bfd_get_filename (bfd_my_archive (ls->ifile->the_bfd));
- la = true;
+ la = TRUE;
}
else
{
ln = ls->ifile->filename;
- la = false;
+ la = FALSE;
}
i = strcmp (fn, ln);
@@ -1373,12 +1253,11 @@ wild_sort (wild, sec, file, section)
NULL, in which case it is a wild card. */
static void
-output_section_callback (ptr, sec, section, file, output)
- lang_wild_statement_type *ptr;
- struct wildcard_list *sec;
- asection *section;
- lang_input_statement_type *file;
- PTR output;
+output_section_callback (lang_wild_statement_type *ptr,
+ struct wildcard_list *sec,
+ asection *section,
+ lang_input_statement_type *file,
+ void *output)
{
lang_statement_union_type *before;
@@ -1434,36 +1313,40 @@ output_section_callback (ptr, sec, section, file, output)
already and had its symbols read. If not then we'll read it. */
static lang_input_statement_type *
-lookup_name (name)
- const char *name;
+lookup_name (const char *name)
{
lang_input_statement_type *search;
for (search = (lang_input_statement_type *) input_file_chain.head;
- search != (lang_input_statement_type *) NULL;
+ search != NULL;
search = (lang_input_statement_type *) search->next_real_file)
{
- if (search->filename == (char *) NULL && name == (char *) NULL)
+ /* Use the local_sym_name as the name of the file that has
+ already been loaded as filename might have been transformed
+ via the search directory lookup mechanism. */
+ const char * filename = search->local_sym_name;
+
+ if (filename == NULL && name == NULL)
return search;
- if (search->filename != (char *) NULL
- && name != (char *) NULL
- && strcmp (search->filename, name) == 0)
+ if (filename != NULL
+ && name != NULL
+ && strcmp (filename, name) == 0)
break;
}
- if (search == (lang_input_statement_type *) NULL)
- search = new_afile (name, lang_input_file_is_file_enum, default_target,
- false);
+ if (search == NULL)
+ search = new_afile (name, lang_input_file_is_search_file_enum, default_target,
+ FALSE);
/* If we have already added this file, or this file is not real
(FIXME: can that ever actually happen?) or the name is NULL
(FIXME: can that ever actually happen?) don't add this file. */
if (search->loaded
|| ! search->real
- || search->filename == (const char *) NULL)
+ || search->filename == NULL)
return search;
- if (! load_symbols (search, (lang_statement_list_type *) NULL))
+ if (! load_symbols (search, NULL))
return NULL;
return search;
@@ -1471,15 +1354,14 @@ lookup_name (name)
/* Get the symbols for an input file. */
-static boolean
-load_symbols (entry, place)
- lang_input_statement_type *entry;
- lang_statement_list_type *place;
+static bfd_boolean
+load_symbols (lang_input_statement_type *entry,
+ lang_statement_list_type *place)
{
char **matching;
if (entry->loaded)
- return true;
+ return TRUE;
ldfile_open_file (entry);
@@ -1488,13 +1370,14 @@ load_symbols (entry, place)
{
bfd_error_type err;
lang_statement_list_type *hold;
- boolean bad_load = true;
+ bfd_boolean bad_load = TRUE;
+ bfd_boolean save_ldlang_sysrooted_script;
err = bfd_get_error ();
/* See if the emulation has some special knowledge. */
if (ldemul_unrecognized_file (entry))
- return true;
+ return TRUE;
if (err == bfd_error_file_ambiguously_recognized)
{
@@ -1510,7 +1393,7 @@ load_symbols (entry, place)
|| place == NULL)
einfo (_("%F%B: file not recognized: %E\n"), entry->the_bfd);
else
- bad_load = false;
+ bad_load = FALSE;
bfd_close (entry->the_bfd);
entry->the_bfd = NULL;
@@ -1520,19 +1403,22 @@ load_symbols (entry, place)
hold = stat_ptr;
stat_ptr = place;
+ save_ldlang_sysrooted_script = ldlang_sysrooted_script;
+ ldlang_sysrooted_script = entry->sysrooted;
- ldfile_assumed_script = true;
+ ldfile_assumed_script = TRUE;
parser_input = input_script;
yyparse ();
- ldfile_assumed_script = false;
+ ldfile_assumed_script = FALSE;
+ ldlang_sysrooted_script = save_ldlang_sysrooted_script;
stat_ptr = hold;
return ! bad_load;
}
if (ldemul_recognized_file (entry))
- return true;
+ return TRUE;
/* We don't call ldlang_add_file for an archive. Instead, the
add_symbols entry point will call ldlang_add_file, via the
@@ -1553,7 +1439,7 @@ load_symbols (entry, place)
if (entry->whole_archive)
{
bfd *member = NULL;
- boolean loaded = true;
+ bfd_boolean loaded = TRUE;
for (;;)
{
@@ -1566,7 +1452,7 @@ load_symbols (entry, place)
{
einfo (_("%F%B: member %B in archive is not an object\n"),
entry->the_bfd, member);
- loaded = false;
+ loaded = FALSE;
}
if (! ((*link_info.callbacks->add_archive_element)
@@ -1576,7 +1462,7 @@ load_symbols (entry, place)
if (! bfd_link_add_symbols (member, &link_info))
{
einfo (_("%F%B: could not read symbols: %E\n"), member);
- loaded = false;
+ loaded = FALSE;
}
}
@@ -1587,7 +1473,7 @@ load_symbols (entry, place)
}
if (bfd_link_add_symbols (entry->the_bfd, &link_info))
- entry->loaded = true;
+ entry->loaded = TRUE;
else
einfo (_("%F%B: could not read symbols: %E\n"), entry->the_bfd);
@@ -1601,14 +1487,13 @@ load_symbols (entry, place)
the output section. */
static void
-wild (s, target, output)
- lang_wild_statement_type *s;
- const char *target ATTRIBUTE_UNUSED;
- lang_output_section_statement_type *output;
+wild (lang_wild_statement_type *s,
+ const char *target ATTRIBUTE_UNUSED,
+ lang_output_section_statement_type *output)
{
struct wildcard_list *sec;
- walk_wild (s, output_section_callback, (PTR) output);
+ walk_wild (s, output_section_callback, output);
for (sec = s->section_list; sec != NULL; sec = sec->next)
{
@@ -1623,14 +1508,12 @@ wild (s, target, output)
}
}
-/* Return true iff target is the sought target. */
+/* Return TRUE iff target is the sought target. */
static int
-get_target (target, data)
- const bfd_target *target;
- PTR data;
+get_target (const bfd_target *target, void *data)
{
- const char *sought = (const char *) data;
+ const char *sought = data;
return strcmp (target->name, sought) == 0;
}
@@ -1638,9 +1521,7 @@ get_target (target, data)
/* Like strcpy() but convert to lower case as well. */
static void
-stricpy (dest, src)
- char *dest;
- char *src;
+stricpy (char *dest, char *src)
{
char c;
@@ -1650,13 +1531,11 @@ stricpy (dest, src)
*dest = 0;
}
-/* Remove the first occurance of needle (if any) in haystack
+/* Remove the first occurrence of needle (if any) in haystack
from haystack. */
static void
-strcut (haystack, needle)
- char *haystack;
- char *needle;
+strcut (char *haystack, char *needle)
{
haystack = strstr (haystack, needle);
@@ -1675,9 +1554,7 @@ strcut (haystack, needle)
Return a value indicating how "similar" they are. */
static int
-name_compare (first, second)
- char *first;
- char *second;
+name_compare (char *first, char *second)
{
char *copy1;
char *copy2;
@@ -1690,7 +1567,7 @@ name_compare (first, second)
stricpy (copy1, first);
stricpy (copy2, second);
- /* Remove and endian strings from the name. */
+ /* Remove size and endian strings from the name. */
strcut (copy1, "big");
strcut (copy1, "little");
strcut (copy2, "big");
@@ -1720,11 +1597,9 @@ static const bfd_target *winner;
match to the original output target. */
static int
-closest_target_match (target, data)
- const bfd_target *target;
- PTR data;
+closest_target_match (const bfd_target *target, void *data)
{
- const bfd_target *original = (const bfd_target *) data;
+ const bfd_target *original = data;
if (command_line.endian == ENDIAN_BIG
&& target->byteorder != BFD_ENDIAN_BIG)
@@ -1758,7 +1633,7 @@ closest_target_match (target, data)
/* Return the BFD target format of the first input file. */
static char *
-get_first_input_target ()
+get_first_input_target (void)
{
char *target = NULL;
@@ -1784,12 +1659,12 @@ get_first_input_target ()
}
const char *
-lang_get_output_target ()
+lang_get_output_target (void)
{
const char *target;
/* Has the user told us which output format to use? */
- if (output_target != (char *) NULL)
+ if (output_target != NULL)
return output_target;
/* No - has the current target been set to something other than
@@ -1809,8 +1684,7 @@ lang_get_output_target ()
/* Open the output file. */
static bfd *
-open_output (name)
- const char *name;
+open_output (const char *name)
{
bfd *output;
@@ -1824,7 +1698,7 @@ open_output (name)
enum bfd_endian desired_endian;
/* Get the chosen target. */
- target = bfd_search_for_target (get_target, (PTR) output_target);
+ target = bfd_search_for_target (get_target, (void *) output_target);
/* If the target is not supported, we cannot do anything. */
if (target != NULL)
@@ -1850,8 +1724,8 @@ open_output (name)
/* Try to find a target as similar as possible to
the default target, but which has the desired
endian characteristic. */
- (void) bfd_search_for_target (closest_target_match,
- (PTR) target);
+ bfd_search_for_target (closest_target_match,
+ (void *) target);
/* Oh dear - we could not find any targets that
satisfy our requirements. */
@@ -1866,7 +1740,7 @@ open_output (name)
output = bfd_openw (name, output_target);
- if (output == (bfd *) NULL)
+ if (output == NULL)
{
if (bfd_get_error () == bfd_error_invalid_target)
einfo (_("%P%F: target %s not found\n"), output_target);
@@ -1874,7 +1748,7 @@ open_output (name)
einfo (_("%P%F: cannot open output file %s: %E\n"), name);
}
- delete_output_file_on_failure = true;
+ delete_output_file_on_failure = TRUE;
#if 0
output->flags |= D_PAGED;
@@ -1888,7 +1762,7 @@ open_output (name)
einfo (_("%P%F:%s: can not set architecture: %E\n"), name);
link_info.hash = bfd_link_hash_table_create (output);
- if (link_info.hash == (struct bfd_link_hash_table *) NULL)
+ if (link_info.hash == NULL)
einfo (_("%P%F: can not create link hash table: %E\n"));
bfd_set_gp_size (output, g_switch_value);
@@ -1896,16 +1770,15 @@ open_output (name)
}
static void
-ldlang_open_output (statement)
- lang_statement_union_type *statement;
+ldlang_open_output (lang_statement_union_type *statement)
{
switch (statement->header.type)
{
case lang_output_statement_enum:
- ASSERT (output_bfd == (bfd *) NULL);
+ ASSERT (output_bfd == NULL);
output_bfd = open_output (statement->output_statement.name);
ldemul_set_output_arch ();
- if (config.magic_demand_paged && !link_info.relocateable)
+ if (config.magic_demand_paged && !link_info.relocatable)
output_bfd->flags |= D_PAGED;
else
output_bfd->flags &= ~D_PAGED;
@@ -1927,14 +1800,36 @@ ldlang_open_output (statement)
}
}
+/* Convert between addresses in bytes and sizes in octets.
+ For currently supported targets, octets_per_byte is always a power
+ of two, so we can use shifts. */
+#define TO_ADDR(X) ((X) >> opb_shift)
+#define TO_SIZE(X) ((X) << opb_shift)
+
+/* Support the above. */
+static unsigned int opb_shift = 0;
+
+static void
+init_opb (void)
+{
+ unsigned x = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
+ ldfile_output_machine);
+ opb_shift = 0;
+ if (x > 1)
+ while ((x & 1) == 0)
+ {
+ x >>= 1;
+ ++opb_shift;
+ }
+ ASSERT (x == 1);
+}
+
/* Open all the input files. */
static void
-open_input_bfds (s, force)
- lang_statement_union_type *s;
- boolean force;
+open_input_bfds (lang_statement_union_type *s, bfd_boolean force)
{
- for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
+ for (; s != NULL; s = s->header.next)
{
switch (s->header.type)
{
@@ -1948,7 +1843,7 @@ open_input_bfds (s, force)
/* Maybe we should load the file's symbols. */
if (s->wild_statement.filename
&& ! wildcardp (s->wild_statement.filename))
- (void) lookup_name (s->wild_statement.filename);
+ lookup_name (s->wild_statement.filename);
open_input_bfds (s->wild_statement.children.head, force);
break;
case lang_group_statement_enum:
@@ -1962,7 +1857,7 @@ open_input_bfds (s, force)
do
{
undefs = link_info.hash->undefs_tail;
- open_input_bfds (s->group_statement.children.head, true);
+ open_input_bfds (s->group_statement.children.head, TRUE);
}
while (undefs != link_info.hash->undefs_tail);
}
@@ -1986,12 +1881,12 @@ open_input_bfds (s, force)
&& s->input_statement.loaded
&& bfd_check_format (s->input_statement.the_bfd,
bfd_archive))
- s->input_statement.loaded = false;
+ s->input_statement.loaded = FALSE;
lang_list_init (&add);
if (! load_symbols (&s->input_statement, &add))
- config.make_executable = false;
+ config.make_executable = FALSE;
if (add.head != NULL)
{
@@ -2010,7 +1905,7 @@ open_input_bfds (s, force)
section. */
static void
-lang_reasonable_defaults ()
+lang_reasonable_defaults (void)
{
#if 0
lang_output_section_statement_lookup (".text");
@@ -2025,12 +1920,91 @@ lang_reasonable_defaults ()
&default_common_section->children);
new->section_name = "COMMON";
- new->filename = (char *) NULL;
+ new->filename = NULL;
lang_list_init (&new->children);
}
#endif
}
+/* Add a symbol to a hash of symbols used in DEFINED (NAME) expressions. */
+
+void
+lang_track_definedness (const char *name)
+{
+ if (bfd_hash_lookup (&lang_definedness_table, name, TRUE, FALSE) == NULL)
+ einfo (_("%P%F: bfd_hash_lookup failed creating symbol %s\n"), name);
+}
+
+/* New-function for the definedness hash table. */
+
+static struct bfd_hash_entry *
+lang_definedness_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table ATTRIBUTE_UNUSED,
+ const char *name ATTRIBUTE_UNUSED)
+{
+ struct lang_definedness_hash_entry *ret
+ = (struct lang_definedness_hash_entry *) entry;
+
+ if (ret == NULL)
+ ret = (struct lang_definedness_hash_entry *)
+ bfd_hash_allocate (table, sizeof (struct lang_definedness_hash_entry));
+
+ if (ret == NULL)
+ einfo (_("%P%F: bfd_hash_allocate failed creating symbol %s\n"), name);
+
+ ret->iteration = -1;
+ return &ret->root;
+}
+
+/* Return the iteration when the definition of NAME was last updated. A
+ value of -1 means that the symbol is not defined in the linker script
+ or the command line, but may be defined in the linker symbol table. */
+
+int
+lang_symbol_definition_iteration (const char *name)
+{
+ struct lang_definedness_hash_entry *defentry
+ = (struct lang_definedness_hash_entry *)
+ bfd_hash_lookup (&lang_definedness_table, name, FALSE, FALSE);
+
+ /* We've already created this one on the presence of DEFINED in the
+ script, so it can't be NULL unless something is borked elsewhere in
+ the code. */
+ if (defentry == NULL)
+ FAIL ();
+
+ return defentry->iteration;
+}
+
+/* Update the definedness state of NAME. */
+
+void
+lang_update_definedness (const char *name, struct bfd_link_hash_entry *h)
+{
+ struct lang_definedness_hash_entry *defentry
+ = (struct lang_definedness_hash_entry *)
+ bfd_hash_lookup (&lang_definedness_table, name, FALSE, FALSE);
+
+ /* We don't keep track of symbols not tested with DEFINED. */
+ if (defentry == NULL)
+ return;
+
+ /* If the symbol was already defined, and not from an earlier statement
+ iteration, don't update the definedness iteration, because that'd
+ make the symbol seem defined in the linker script at this point, and
+ it wasn't; it was defined in some object. If we do anyway, DEFINED
+ would start to yield false before this point and the construct "sym =
+ DEFINED (sym) ? sym : X;" would change sym to X despite being defined
+ in an object. */
+ if (h->type != bfd_link_hash_undefined
+ && h->type != bfd_link_hash_common
+ && h->type != bfd_link_hash_new
+ && defentry->iteration == -1)
+ return;
+
+ defentry->iteration = lang_statement_iteration;
+}
+
/* Add the supplied name to the symbol table as an undefined reference.
This is a two step process as the symbol table doesn't even exist at
the time the ld command line is processed. First we put the name
@@ -2042,12 +2016,10 @@ typedef struct bfd_sym_chain ldlang_undef_chain_list_type;
#define ldlang_undef_chain_list_head entry_symbol.next
void
-ldlang_add_undef (name)
- const char *const name;
+ldlang_add_undef (const char *const name)
{
ldlang_undef_chain_list_type *new =
- ((ldlang_undef_chain_list_type *)
- stat_alloc (sizeof (ldlang_undef_chain_list_type)));
+ stat_alloc (sizeof (ldlang_undef_chain_list_type));
new->next = ldlang_undef_chain_list_head;
ldlang_undef_chain_list_head = new;
@@ -2061,13 +2033,12 @@ ldlang_add_undef (name)
/* Insert NAME as undefined in the symbol table. */
static void
-insert_undefined (name)
- const char *name;
+insert_undefined (const char *name)
{
struct bfd_link_hash_entry *h;
- h = bfd_link_hash_lookup (link_info.hash, name, true, false, true);
- if (h == (struct bfd_link_hash_entry *) NULL)
+ h = bfd_link_hash_lookup (link_info.hash, name, TRUE, FALSE, TRUE);
+ if (h == NULL)
einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n"));
if (h->type == bfd_link_hash_new)
{
@@ -2082,27 +2053,22 @@ insert_undefined (name)
script file. */
static void
-lang_place_undefineds ()
+lang_place_undefineds (void)
{
ldlang_undef_chain_list_type *ptr;
- for (ptr = ldlang_undef_chain_list_head;
- ptr != (ldlang_undef_chain_list_type *) NULL;
- ptr = ptr->next)
- {
- insert_undefined (ptr->name);
- }
+ for (ptr = ldlang_undef_chain_list_head; ptr != NULL; ptr = ptr->next)
+ insert_undefined (ptr->name);
}
-/* Open input files and attatch to output sections. */
+/* Open input files and attach to output sections. */
static void
-map_input_to_output_sections (s, target, output_section_statement)
- lang_statement_union_type *s;
- const char *target;
- lang_output_section_statement_type *output_section_statement;
+map_input_to_output_sections
+ (lang_statement_union_type *s, const char *target,
+ lang_output_section_statement_type *output_section_statement)
{
- for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
+ for (; s != NULL; s = s->header.next)
{
switch (s->header.type)
{
@@ -2129,10 +2095,14 @@ map_input_to_output_sections (s, target, output_section_statement)
target,
output_section_statement);
break;
+ case lang_data_statement_enum:
+ /* Make sure that any sections mentioned in the expression
+ are initialized. */
+ exp_init_os (s->data_statement.exp);
+ /* FALLTHROUGH */
case lang_fill_statement_enum:
case lang_input_section_enum:
case lang_object_symbols_statement_enum:
- case lang_data_statement_enum:
case lang_reloc_statement_enum:
case lang_padding_statement_enum:
case lang_input_statement_enum:
@@ -2173,7 +2143,7 @@ map_input_to_output_sections (s, target, output_section_statement)
sections if they turn out to be not needed. Clean them up here. */
static void
-strip_excluded_output_sections ()
+strip_excluded_output_sections (void)
{
lang_statement_union_type *u;
@@ -2204,8 +2174,8 @@ strip_excluded_output_sections ()
}
static void
-print_output_section_statement (output_section_statement)
- lang_output_section_statement_type *output_section_statement;
+print_output_section_statement
+ (lang_output_section_statement_type *output_section_statement)
{
asection *section = output_section_statement->bfd_section;
int len;
@@ -2250,9 +2220,8 @@ print_output_section_statement (output_section_statement)
}
static void
-print_assignment (assignment, output_section)
- lang_assignment_statement_type *assignment;
- lang_output_section_statement_type *output_section;
+print_assignment (lang_assignment_statement_type *assignment,
+ lang_output_section_statement_type *output_section)
{
int i;
etree_value_type result;
@@ -2290,10 +2259,9 @@ print_assignment (assignment, output_section)
}
static void
-print_input_statement (statm)
- lang_input_statement_type *statm;
+print_input_statement (lang_input_statement_type *statm)
{
- if (statm->filename != (char *) NULL)
+ if (statm->filename != NULL)
{
fprintf (config.map_file, "LOAD %s\n", statm->filename);
}
@@ -2302,12 +2270,10 @@ print_input_statement (statm)
/* Print all symbols defined in a particular section. This is called
via bfd_link_hash_traverse. */
-static boolean
-print_one_symbol (hash_entry, ptr)
- struct bfd_link_hash_entry *hash_entry;
- PTR ptr;
+static bfd_boolean
+print_one_symbol (struct bfd_link_hash_entry *hash_entry, void *ptr)
{
- asection *sec = (asection *) ptr;
+ asection *sec = ptr;
if ((hash_entry->type == bfd_link_hash_defined
|| hash_entry->type == bfd_link_hash_defweak)
@@ -2325,19 +2291,18 @@ print_one_symbol (hash_entry, ptr)
minfo (" %T\n", hash_entry->root.string);
}
- return true;
+ return TRUE;
}
/* Print information about an input section to the map file. */
static void
-print_input_section (in)
- lang_input_section_type *in;
+print_input_section (lang_input_section_type *in)
{
asection *i = in->section;
bfd_size_type size = i->_cooked_size != 0 ? i->_cooked_size : i->_raw_size;
- unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
- ldfile_output_machine);
+
+ init_opb ();
if (size != 0)
{
print_space ();
@@ -2361,7 +2326,7 @@ print_input_section (in)
}
minfo ("0x%V %W %B\n",
- i->output_section->vma + i->output_offset, size / opb,
+ i->output_section->vma + i->output_offset, TO_ADDR (size),
i->owner);
if (i->_cooked_size != 0 && i->_cooked_size != i->_raw_size)
@@ -2381,16 +2346,16 @@ print_input_section (in)
minfo (_("%W (size before relaxing)\n"), i->_raw_size);
}
- bfd_link_hash_traverse (link_info.hash, print_one_symbol, (PTR) i);
+ bfd_link_hash_traverse (link_info.hash, print_one_symbol, i);
- print_dot = i->output_section->vma + i->output_offset + size / opb;
+ print_dot = (i->output_section->vma + i->output_offset
+ + TO_ADDR (size));
}
}
}
static void
-print_fill_statement (fill)
- lang_fill_statement_type *fill;
+print_fill_statement (lang_fill_statement_type *fill)
{
size_t size;
unsigned char *p;
@@ -2401,16 +2366,14 @@ print_fill_statement (fill)
}
static void
-print_data_statement (data)
- lang_data_statement_type *data;
+print_data_statement (lang_data_statement_type *data)
{
int i;
bfd_vma addr;
bfd_size_type size;
const char *name;
- unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
- ldfile_output_machine);
+ init_opb ();
for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++)
print_space ();
@@ -2454,16 +2417,14 @@ print_data_statement (data)
print_nl ();
- print_dot = addr + size / opb;
-
+ print_dot = addr + TO_ADDR (size);
}
/* Print an address statement. These are generated by options like
-Ttext. */
static void
-print_address_statement (address)
- lang_address_statement_type *address;
+print_address_statement (lang_address_statement_type *address)
{
minfo (_("Address of section %s set to "), address->section_name);
exp_print_tree (address->address);
@@ -2473,15 +2434,13 @@ print_address_statement (address)
/* Print a reloc statement. */
static void
-print_reloc_statement (reloc)
- lang_reloc_statement_type *reloc;
+print_reloc_statement (lang_reloc_statement_type *reloc)
{
int i;
bfd_vma addr;
bfd_size_type size;
- unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
- ldfile_output_machine);
+ init_opb ();
for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++)
print_space ();
@@ -2502,18 +2461,16 @@ print_reloc_statement (reloc)
print_nl ();
- print_dot = addr + size / opb;
+ print_dot = addr + TO_ADDR (size);
}
static void
-print_padding_statement (s)
- lang_padding_statement_type *s;
+print_padding_statement (lang_padding_statement_type *s)
{
int len;
bfd_vma addr;
- unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
- ldfile_output_machine);
+ init_opb ();
minfo (" *fill*");
len = sizeof " *fill*" - 1;
@@ -2538,13 +2495,12 @@ print_padding_statement (s)
print_nl ();
- print_dot = addr + s->size / opb;
+ print_dot = addr + TO_ADDR (s->size);
}
static void
-print_wild_statement (w, os)
- lang_wild_statement_type *w;
- lang_output_section_statement_type *os;
+print_wild_statement (lang_wild_statement_type *w,
+ lang_output_section_statement_type *os)
{
struct wildcard_list *sec;
@@ -2591,9 +2547,8 @@ print_wild_statement (w, os)
/* Print a group statement. */
static void
-print_group (s, os)
- lang_group_statement_type *s;
- lang_output_section_statement_type *os;
+print_group (lang_group_statement_type *s,
+ lang_output_section_statement_type *os)
{
fprintf (config.map_file, "START GROUP\n");
print_statement_list (s->children.head, os);
@@ -2604,9 +2559,8 @@ print_group (s, os)
This can be called for any statement type. */
static void
-print_statement_list (s, os)
- lang_statement_union_type *s;
- lang_output_section_statement_type *os;
+print_statement_list (lang_statement_union_type *s,
+ lang_output_section_statement_type *os)
{
while (s != NULL)
{
@@ -2619,9 +2573,8 @@ print_statement_list (s, os)
This can be called for any statement type. */
static void
-print_statement (s, os)
- lang_statement_union_type *s;
- lang_output_section_statement_type *os;
+print_statement (lang_statement_union_type *s,
+ lang_output_section_statement_type *os)
{
switch (s->header.type)
{
@@ -2691,7 +2644,7 @@ print_statement (s, os)
}
static void
-print_statements ()
+print_statements (void)
{
print_statement_list (statement_list.head, abs_output_section);
}
@@ -2702,9 +2655,7 @@ print_statements ()
Intended to be called from GDB. */
void
-dprint_statement (s, n)
- lang_statement_union_type *s;
- int n;
+dprint_statement (lang_statement_union_type *s, int n)
{
FILE *map_save = config.map_file;
@@ -2725,12 +2676,11 @@ dprint_statement (s, n)
}
static void
-insert_pad (ptr, fill, alignment_needed, output_section, dot)
- lang_statement_union_type **ptr;
- fill_type *fill;
- unsigned int alignment_needed;
- asection *output_section;
- bfd_vma dot;
+insert_pad (lang_statement_union_type **ptr,
+ fill_type *fill,
+ unsigned int alignment_needed,
+ asection *output_section,
+ bfd_vma dot)
{
static fill_type zero_fill = { 1, { 0 } };
lang_statement_union_type *pad;
@@ -2747,13 +2697,12 @@ insert_pad (ptr, fill, alignment_needed, output_section, dot)
else
{
/* Make a new padding statement, linked into existing chain. */
- pad = ((lang_statement_union_type *)
- stat_alloc (sizeof (lang_padding_statement_type)));
+ pad = stat_alloc (sizeof (lang_padding_statement_type));
pad->header.next = *ptr;
*ptr = pad;
pad->header.type = lang_padding_statement_enum;
pad->padding_statement.output_section = output_section;
- if (fill == (fill_type *) 0)
+ if (fill == NULL)
fill = &zero_fill;
pad->padding_statement.fill = fill;
}
@@ -2765,19 +2714,16 @@ insert_pad (ptr, fill, alignment_needed, output_section, dot)
/* Work out how much this section will move the dot point. */
static bfd_vma
-size_input_section (this_ptr, output_section_statement, fill, dot)
- lang_statement_union_type **this_ptr;
- lang_output_section_statement_type *output_section_statement;
- fill_type *fill;
- bfd_vma dot;
+size_input_section (lang_statement_union_type **this_ptr,
+ lang_output_section_statement_type *output_section_statement,
+ fill_type *fill,
+ bfd_vma dot)
{
lang_input_section_type *is = &((*this_ptr)->input_section);
asection *i = is->section;
if (!is->ifile->just_syms_flag)
{
- unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
- ldfile_output_machine);
unsigned int alignment_needed;
asection *o;
@@ -2797,7 +2743,7 @@ size_input_section (this_ptr, output_section_statement, fill, dot)
if (alignment_needed != 0)
{
- insert_pad (this_ptr, fill, alignment_needed * opb, o, dot);
+ insert_pad (this_ptr, fill, TO_SIZE (alignment_needed), o, dot);
dot += alignment_needed;
}
@@ -2807,10 +2753,10 @@ size_input_section (this_ptr, output_section_statement, fill, dot)
/* Mark how big the output section must be to contain this now. */
if (i->_cooked_size != 0)
- dot += i->_cooked_size / opb;
+ dot += TO_ADDR (i->_cooked_size);
else
- dot += i->_raw_size / opb;
- o->_raw_size = (dot - o->vma) * opb;
+ dot += TO_ADDR (i->_raw_size);
+ o->_raw_size = TO_SIZE (dot - o->vma);
}
else
{
@@ -2821,8 +2767,11 @@ size_input_section (this_ptr, output_section_statement, fill, dot)
}
#define IGNORE_SECTION(bfd, s) \
- (((bfd_get_section_flags (bfd, s) & (SEC_ALLOC | SEC_LOAD)) \
- != (SEC_ALLOC | SEC_LOAD)) \
+ (((bfd_get_section_flags (bfd, s) & SEC_THREAD_LOCAL) \
+ ? ((bfd_get_section_flags (bfd, s) & (SEC_LOAD | SEC_NEVER_LOAD)) \
+ != SEC_LOAD) \
+ : ((bfd_get_section_flags (bfd, s) & (SEC_ALLOC | SEC_NEVER_LOAD)) \
+ != SEC_ALLOC)) \
|| bfd_section_size (bfd, s) == 0)
/* Check to see if any allocated sections overlap with other allocated
@@ -2830,10 +2779,9 @@ size_input_section (this_ptr, output_section_statement, fill, dot)
the output section addresses of the two sections. */
static void
-lang_check_section_addresses ()
+lang_check_section_addresses (void)
{
asection *s;
- unsigned opb = bfd_octets_per_byte (output_bfd);
/* Scan all sections in the output list. */
for (s = output_bfd->sections; s != NULL; s = s->next)
@@ -2861,10 +2809,10 @@ lang_check_section_addresses ()
/* We must check the sections' LMA addresses not their
VMA addresses because overlay sections can have
overlapping VMAs but they must have distinct LMAs. */
- s_start = bfd_section_lma (output_bfd, s);
+ s_start = bfd_section_lma (output_bfd, s);
os_start = bfd_section_lma (output_bfd, os);
- s_end = s_start + bfd_section_size (output_bfd, s) / opb - 1;
- os_end = os_start + bfd_section_size (output_bfd, os) / opb - 1;
+ s_end = s_start + TO_ADDR (bfd_section_size (output_bfd, s)) - 1;
+ os_end = os_start + TO_ADDR (bfd_section_size (output_bfd, os)) - 1;
/* Look for an overlap. */
if ((s_end < os_start) || (s_start > os_end))
@@ -2887,18 +2835,17 @@ _("%X%P: section %s [%V -> %V] overlaps section %s [%V -> %V]\n"),
calculation wraps around. */
static void
-os_region_check (os, region, tree, base)
- lang_output_section_statement_type *os;
- struct memory_region_struct *region;
- etree_type *tree;
- bfd_vma base;
+os_region_check (lang_output_section_statement_type *os,
+ lang_memory_region_type *region,
+ etree_type *tree,
+ bfd_vma base)
{
if ((region->current < region->origin
|| (region->current - region->origin > region->length))
&& ((region->current != region->origin + region->length)
|| base == 0))
{
- if (tree != (etree_type *) NULL)
+ if (tree != NULL)
{
einfo (_("%X%P: address 0x%v of %B section %s is not within region %s\n"),
region->current,
@@ -2921,19 +2868,17 @@ os_region_check (os, region, tree, base)
/* Set the sizes for all the output sections. */
static bfd_vma
-lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
- lang_statement_union_type *s;
- lang_output_section_statement_type *output_section_statement;
- lang_statement_union_type **prev;
- fill_type *fill;
- bfd_vma dot;
- boolean *relax;
+lang_size_sections_1
+ (lang_statement_union_type *s,
+ lang_output_section_statement_type *output_section_statement,
+ lang_statement_union_type **prev,
+ fill_type *fill,
+ bfd_vma dot,
+ bfd_boolean *relax,
+ bfd_boolean check_regions)
{
- unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
- ldfile_output_machine);
-
/* Size up the sections from their constituent parts. */
- for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
+ for (; s != NULL; s = s->header.next)
{
switch (s->header.type)
{
@@ -2976,35 +2921,49 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
}
else
{
- if (os->addr_tree == (etree_type *) NULL)
+ if (os->addr_tree == NULL)
{
/* No address specified for this section, get one
from the region specification. */
- if (os->region == (lang_memory_region_type *) NULL
+ if (os->region == NULL
|| (((bfd_get_section_flags (output_bfd, os->bfd_section)
& (SEC_ALLOC | SEC_LOAD)) != 0)
&& os->region->name[0] == '*'
- && strcmp (os->region->name, "*default*") == 0))
+ && strcmp (os->region->name, DEFAULT_MEMORY_REGION) == 0))
{
os->region = lang_memory_default (os->bfd_section);
}
/* If a loadable section is using the default memory
region, and some non default memory regions were
- defined, issue a warning. */
- if ((bfd_get_section_flags (output_bfd, os->bfd_section)
- & (SEC_ALLOC | SEC_LOAD)) != 0
- && (bfd_get_section_flags (output_bfd, os->bfd_section)
- & SEC_NEVER_LOAD) == 0
- && ! link_info.relocateable
- && strcmp (os->region->name, "*default*") == 0
+ defined, issue an error message. */
+ if (!IGNORE_SECTION (output_bfd, os->bfd_section)
+ && ! link_info.relocatable
+ && check_regions
+ && strcmp (os->region->name, DEFAULT_MEMORY_REGION) == 0
&& lang_memory_region_list != NULL
&& (strcmp (lang_memory_region_list->name,
- "*default*") != 0
+ DEFAULT_MEMORY_REGION) != 0
|| lang_memory_region_list->next != NULL))
- einfo (_("%P: warning: no memory region specified for section `%s'\n"),
- bfd_get_section_name (output_bfd,
- os->bfd_section));
+ {
+ /* By default this is an error rather than just a
+ warning because if we allocate the section to the
+ default memory region we can end up creating an
+ excessively large binary, or even seg faulting when
+ attempting to perform a negative seek. See
+ http://sources.redhat.com/ml/binutils/2003-04/msg00423.html
+ for an example of this. This behaviour can be
+ overridden by the using the --no-check-sections
+ switch. */
+ if (command_line.check_section_addresses)
+ einfo (_("%P%F: error: no memory region specified for loadable section `%s'\n"),
+ bfd_get_section_name (output_bfd,
+ os->bfd_section));
+ else
+ einfo (_("%P: warning: no memory region specified for loadable section `%s'\n"),
+ bfd_get_section_name (output_bfd,
+ os->bfd_section));
+ }
dot = os->region->current;
@@ -3025,12 +2984,15 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
{
etree_value_type r;
+ os->processed = -1;
r = exp_fold_tree (os->addr_tree,
abs_output_section,
lang_allocating_phase_enum,
dot, &dot);
+ os->processed = 0;
+
if (!r.valid_p)
- einfo (_("%F%S: non constant address expression for section %s\n"),
+ einfo (_("%F%S: non constant or forward reference address expression for section %s\n"),
os->name);
dot = r.value + r.section->bfd_section->vma;
@@ -3048,26 +3010,29 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
}
lang_size_sections_1 (os->children.head, os, &os->children.head,
- os->fill, dot, relax);
+ os->fill, dot, relax, check_regions);
/* Put the section within the requested block size, or
align at the block boundary. */
- after = align_n (os->bfd_section->vma
- + os->bfd_section->_raw_size / opb,
- (bfd_vma) os->block_value);
+ after = ((os->bfd_section->vma
+ + TO_ADDR (os->bfd_section->_raw_size)
+ + os->block_value - 1)
+ & - (bfd_vma) os->block_value);
if (bfd_is_abs_section (os->bfd_section))
ASSERT (after == os->bfd_section->vma);
- else if ((os->bfd_section->flags & SEC_HAS_CONTENTS) == 0
- && (os->bfd_section->flags & SEC_THREAD_LOCAL)
- && ! link_info.relocateable)
- os->bfd_section->_raw_size = 0;
else
- os->bfd_section->_raw_size =
- (after - os->bfd_section->vma) * opb;
+ os->bfd_section->_raw_size
+ = TO_SIZE (after - os->bfd_section->vma);
+
+ dot = os->bfd_section->vma;
+ /* .tbss sections effectively have zero size. */
+ if ((os->bfd_section->flags & SEC_HAS_CONTENTS) != 0
+ || (os->bfd_section->flags & SEC_THREAD_LOCAL) == 0
+ || link_info.relocatable)
+ dot += TO_ADDR (os->bfd_section->_raw_size);
- dot = os->bfd_section->vma + os->bfd_section->_raw_size / opb;
- os->processed = true;
+ os->processed = 1;
if (os->update_dot_tree != 0)
exp_fold_tree (os->update_dot_tree, abs_output_section,
@@ -3081,7 +3046,7 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
If the SEC_NEVER_LOAD bit is not set, it will affect the
addresses of sections after it. We have to update
dot. */
- if (os->region != (lang_memory_region_type *) NULL
+ if (os->region != NULL
&& ((bfd_get_section_flags (output_bfd, os->bfd_section)
& SEC_NEVER_LOAD) == 0
|| (bfd_get_section_flags (output_bfd, os->bfd_section)
@@ -3089,9 +3054,10 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
{
os->region->current = dot;
- /* Make sure the new address is within the region. */
- os_region_check (os, os->region, os->addr_tree,
- os->bfd_section->vma);
+ if (check_regions)
+ /* Make sure the new address is within the region. */
+ os_region_check (os, os->region, os->addr_tree,
+ os->bfd_section->vma);
/* If there's no load address specified, use the run
region as the load region. */
@@ -3103,9 +3069,10 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
/* Set load_base, which will be handled later. */
os->load_base = exp_intop (os->lma_region->current);
os->lma_region->current +=
- os->bfd_section->_raw_size / opb;
- os_region_check (os, os->lma_region, NULL,
- os->bfd_section->lma);
+ TO_ADDR (os->bfd_section->_raw_size);
+ if (check_regions)
+ os_region_check (os, os->lma_region, NULL,
+ os->bfd_section->lma);
}
}
}
@@ -3115,7 +3082,7 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
dot = lang_size_sections_1 (constructor_list.head,
output_section_statement,
&s->wild_statement.children.head,
- fill, dot, relax);
+ fill, dot, relax, check_regions);
break;
case lang_data_statement_enum:
@@ -3127,6 +3094,11 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
s->data_statement.output_section =
output_section_statement->bfd_section;
+ /* We might refer to provided symbols in the expression, and
+ need to mark them as needed. */
+ exp_fold_tree (s->data_statement.exp, abs_output_section,
+ lang_allocating_phase_enum, dot, &dot);
+
switch (s->data_statement.type)
{
default:
@@ -3145,9 +3117,9 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
size = BYTE_SIZE;
break;
}
- if (size < opb)
- size = opb;
- dot += size / opb;
+ if (size < TO_SIZE ((unsigned) 1))
+ size = TO_SIZE ((unsigned) 1);
+ dot += TO_ADDR (size);
output_section_statement->bfd_section->_raw_size += size;
/* The output section gets contents, and then we inspect for
any flags set in the input script which override any ALLOC. */
@@ -3169,7 +3141,7 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
s->reloc_statement.output_section =
output_section_statement->bfd_section;
size = bfd_get_reloc_size (s->reloc_statement.howto);
- dot += size / opb;
+ dot += TO_ADDR (size);
output_section_statement->bfd_section->_raw_size += size;
}
break;
@@ -3179,7 +3151,7 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
dot = lang_size_sections_1 (s->wild_statement.children.head,
output_section_statement,
&s->wild_statement.children.head,
- fill, dot, relax);
+ fill, dot, relax, check_regions);
break;
@@ -3202,12 +3174,12 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
}
else
{
- boolean again;
+ bfd_boolean again;
if (! bfd_relax_section (i->owner, i, &link_info, &again))
einfo (_("%P%F: can't relax section: %E\n"));
if (again)
- *relax = true;
+ *relax = TRUE;
}
dot = size_input_section (prev, output_section_statement,
output_section_statement->fill, dot);
@@ -3237,20 +3209,26 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
{
/* If we don't have an output section, then just adjust
the default memory address. */
- lang_memory_region_lookup ("*default*")->current = newdot;
+ lang_memory_region_lookup (DEFAULT_MEMORY_REGION, FALSE)->current = newdot;
}
else
{
/* Insert a pad after this statement. We can't
put the pad before when relaxing, in case the
assignment references dot. */
- insert_pad (&s->header.next, fill, (newdot - dot) * opb,
+ insert_pad (&s->header.next, fill, TO_SIZE (newdot - dot),
output_section_statement->bfd_section, dot);
/* Don't neuter the pad below when relaxing. */
s = s->header.next;
}
+ /* If dot is advanced, this implies that the section should
+ have space allocated to it, unless the user has explicitly
+ stated that the section should never be loaded. */
+ if (!(output_section_statement->flags & (SEC_NEVER_LOAD | SEC_ALLOC)))
+ output_section_statement->bfd_section->flags |= SEC_ALLOC;
+
dot = newdot;
}
}
@@ -3277,7 +3255,7 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
dot = lang_size_sections_1 (s->group_statement.children.head,
output_section_statement,
&s->group_statement.children.head,
- fill, dot, relax);
+ fill, dot, relax, check_regions);
break;
default:
@@ -3294,19 +3272,24 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax)
}
bfd_vma
-lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
- lang_statement_union_type *s;
- lang_output_section_statement_type *output_section_statement;
- lang_statement_union_type **prev;
- fill_type *fill;
- bfd_vma dot;
- boolean *relax;
+lang_size_sections
+ (lang_statement_union_type *s,
+ lang_output_section_statement_type *output_section_statement,
+ lang_statement_union_type **prev,
+ fill_type *fill,
+ bfd_vma dot,
+ bfd_boolean *relax,
+ bfd_boolean check_regions)
{
bfd_vma result;
+ asection *o;
+
+ /* Callers of exp_fold_tree need to increment this. */
+ lang_statement_iteration++;
exp_data_seg.phase = exp_dataseg_none;
result = lang_size_sections_1 (s, output_section_statement, prev, fill,
- dot, relax);
+ dot, relax, check_regions);
if (exp_data_seg.phase == exp_dataseg_end_seen)
{
/* If DATA_SEGMENT_ALIGN DATA_SEGMENT_END pair was seen, check whether
@@ -3321,33 +3304,41 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
&& first + last <= exp_data_seg.pagesize)
{
exp_data_seg.phase = exp_dataseg_adjust;
+ lang_statement_iteration++;
result = lang_size_sections_1 (s, output_section_statement, prev,
- fill, dot, relax);
+ fill, dot, relax, check_regions);
}
}
+ /* Some backend relaxers want to refer to the output section size. Give
+ them a section size that does not change on the next call while they
+ relax. We can't set this at top because lang_reset_memory_regions
+ which is called before we get here, sets _raw_size to 0 on relaxing
+ rounds. */
+ for (o = output_bfd->sections; o != NULL; o = o->next)
+ o->_cooked_size = o->_raw_size;
+
return result;
}
-bfd_vma
-lang_do_assignments (s, output_section_statement, fill, dot)
- lang_statement_union_type *s;
- lang_output_section_statement_type *output_section_statement;
- fill_type *fill;
- bfd_vma dot;
-{
- unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
- ldfile_output_machine);
+/* Worker function for lang_do_assignments. Recursiveness goes here. */
- for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
+static bfd_vma
+lang_do_assignments_1
+ (lang_statement_union_type *s,
+ lang_output_section_statement_type *output_section_statement,
+ fill_type *fill,
+ bfd_vma dot)
+{
+ for (; s != NULL; s = s->header.next)
{
switch (s->header.type)
{
case lang_constructors_statement_enum:
- dot = lang_do_assignments (constructor_list.head,
- output_section_statement,
- fill,
- dot);
+ dot = lang_do_assignments_1 (constructor_list.head,
+ output_section_statement,
+ fill,
+ dot);
break;
case lang_output_section_statement_enum:
@@ -3358,9 +3349,9 @@ lang_do_assignments (s, output_section_statement, fill, dot)
if (os->bfd_section != NULL)
{
dot = os->bfd_section->vma;
- (void) lang_do_assignments (os->children.head, os,
- os->fill, dot);
- dot = os->bfd_section->vma + os->bfd_section->_raw_size / opb;
+ lang_do_assignments_1 (os->children.head, os, os->fill, dot);
+ dot = (os->bfd_section->vma
+ + TO_ADDR (os->bfd_section->_raw_size));
}
if (os->load_base)
@@ -3378,9 +3369,9 @@ lang_do_assignments (s, output_section_statement, fill, dot)
break;
case lang_wild_statement_enum:
- dot = lang_do_assignments (s->wild_statement.children.head,
- output_section_statement,
- fill, dot);
+ dot = lang_do_assignments_1 (s->wild_statement.children.head,
+ output_section_statement,
+ fill, dot);
break;
@@ -3398,9 +3389,10 @@ lang_do_assignments (s, output_section_statement, fill, dot)
value = exp_fold_tree (s->data_statement.exp,
abs_output_section,
lang_final_phase_enum, dot, &dot);
- s->data_statement.value = value.value;
if (!value.valid_p)
einfo (_("%F%P: invalid data statement\n"));
+ s->data_statement.value
+ = value.value + value.section->bfd_section->vma;
}
{
unsigned int size;
@@ -3422,9 +3414,9 @@ lang_do_assignments (s, output_section_statement, fill, dot)
size = BYTE_SIZE;
break;
}
- if (size < opb)
- size = opb;
- dot += size / opb;
+ if (size < TO_SIZE ((unsigned) 1))
+ size = TO_SIZE ((unsigned) 1);
+ dot += TO_ADDR (size);
}
break;
@@ -3439,7 +3431,7 @@ lang_do_assignments (s, output_section_statement, fill, dot)
if (!value.valid_p)
einfo (_("%F%P: invalid reloc statement\n"));
}
- dot += bfd_get_reloc_size (s->reloc_statement.howto) / opb;
+ dot += TO_ADDR (bfd_get_reloc_size (s->reloc_statement.howto));
break;
case lang_input_section_enum:
@@ -3447,9 +3439,9 @@ lang_do_assignments (s, output_section_statement, fill, dot)
asection *in = s->input_section.section;
if (in->_cooked_size != 0)
- dot += in->_cooked_size / opb;
+ dot += TO_ADDR (in->_cooked_size);
else
- dot += in->_raw_size / opb;
+ dot += TO_ADDR (in->_raw_size);
}
break;
@@ -3469,13 +3461,13 @@ lang_do_assignments (s, output_section_statement, fill, dot)
break;
case lang_padding_statement_enum:
- dot += s->padding_statement.size / opb;
+ dot += TO_ADDR (s->padding_statement.size);
break;
case lang_group_statement_enum:
- dot = lang_do_assignments (s->group_statement.children.head,
- output_section_statement,
- fill, dot);
+ dot = lang_do_assignments_1 (s->group_statement.children.head,
+ output_section_statement,
+ fill, dot);
break;
@@ -3490,6 +3482,17 @@ lang_do_assignments (s, output_section_statement, fill, dot)
return dot;
}
+void
+lang_do_assignments (lang_statement_union_type *s,
+ lang_output_section_statement_type *output_section_statement,
+ fill_type *fill,
+ bfd_vma dot)
+{
+ /* Callers of exp_fold_tree need to increment this. */
+ lang_statement_iteration++;
+ lang_do_assignments_1 (s, output_section_statement, fill, dot);
+}
+
/* Fix any .startof. or .sizeof. symbols. When the assemblers see the
operator .startof. (section_name), it produces an undefined symbol
.startof.section_name. Similarly, when it sees
@@ -3498,11 +3501,11 @@ lang_do_assignments (s, output_section_statement, fill, dot)
such symbols, and set them to the correct value. */
static void
-lang_set_startof ()
+lang_set_startof (void)
{
asection *s;
- if (link_info.relocateable)
+ if (link_info.relocatable)
return;
for (s = output_bfd->sections; s != NULL; s = s->next)
@@ -3515,7 +3518,7 @@ lang_set_startof ()
buf = xmalloc (10 + strlen (secname));
sprintf (buf, ".startof.%s", secname);
- h = bfd_link_hash_lookup (link_info.hash, buf, false, false, true);
+ h = bfd_link_hash_lookup (link_info.hash, buf, FALSE, FALSE, TRUE);
if (h != NULL && h->type == bfd_link_hash_undefined)
{
h->type = bfd_link_hash_defined;
@@ -3524,18 +3527,14 @@ lang_set_startof ()
}
sprintf (buf, ".sizeof.%s", secname);
- h = bfd_link_hash_lookup (link_info.hash, buf, false, false, true);
+ h = bfd_link_hash_lookup (link_info.hash, buf, FALSE, FALSE, TRUE);
if (h != NULL && h->type == bfd_link_hash_undefined)
{
- unsigned opb;
-
- opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
- ldfile_output_machine);
h->type = bfd_link_hash_defined;
if (s->_cooked_size != 0)
- h->u.def.value = s->_cooked_size / opb;
+ h->u.def.value = TO_ADDR (s->_cooked_size);
else
- h->u.def.value = s->_raw_size / opb;
+ h->u.def.value = TO_ADDR (s->_raw_size);
h->u.def.section = bfd_abs_section_ptr;
}
@@ -3544,27 +3543,27 @@ lang_set_startof ()
}
static void
-lang_finish ()
+lang_finish (void)
{
struct bfd_link_hash_entry *h;
- boolean warn;
+ bfd_boolean warn;
- if (link_info.relocateable || link_info.shared)
- warn = false;
+ if (link_info.relocatable || link_info.shared)
+ warn = FALSE;
else
- warn = true;
+ warn = TRUE;
- if (entry_symbol.name == (const char *) NULL)
+ if (entry_symbol.name == NULL)
{
/* No entry has been specified. Look for start, but don't warn
if we don't find it. */
entry_symbol.name = "start";
- warn = false;
+ warn = FALSE;
}
h = bfd_link_hash_lookup (link_info.hash, entry_symbol.name,
- false, false, true);
- if (h != (struct bfd_link_hash_entry *) NULL
+ FALSE, FALSE, TRUE);
+ if (h != NULL
&& (h->type == bfd_link_hash_defined
|| h->type == bfd_link_hash_defweak)
&& h->u.def.section->output_section != NULL)
@@ -3598,7 +3597,7 @@ lang_finish ()
/* Can't find the entry symbol, and it's not a number. Use
the first address in the text section. */
ts = bfd_get_section_by_name (output_bfd, entry_section);
- if (ts != (asection *) NULL)
+ if (ts != NULL)
{
if (warn)
einfo (_("%P: warning: cannot find entry symbol %s; defaulting to %V\n"),
@@ -3617,18 +3616,15 @@ lang_finish ()
}
}
}
+
+ bfd_hash_table_free (&lang_definedness_table);
}
/* This is a small function used when we want to ignore errors from
BFD. */
static void
-#ifdef ANSI_PROTOTYPES
ignore_bfd_errors (const char *s ATTRIBUTE_UNUSED, ...)
-#else
-ignore_bfd_errors (s)
- const char *s ATTRIBUTE_UNUSED;
-#endif
{
/* Don't do anything. */
}
@@ -3638,18 +3634,17 @@ ignore_bfd_errors (s)
other checking that is needed. */
static void
-lang_check ()
+lang_check (void)
{
lang_statement_union_type *file;
bfd *input_bfd;
const bfd_arch_info_type *compatible;
- for (file = file_chain.head;
- file != (lang_statement_union_type *) NULL;
- file = file->input_statement.next)
+ for (file = file_chain.head; file != NULL; file = file->input_statement.next)
{
input_bfd = file->input_statement.the_bfd;
- compatible = bfd_arch_get_compatible (input_bfd, output_bfd);
+ compatible = bfd_arch_get_compatible (input_bfd, output_bfd,
+ command_line.accept_unknown_input_arch);
/* In general it is not possible to perform a relocatable
link between differing object formats when the input
@@ -3657,7 +3652,7 @@ lang_check ()
input format may not have equivalent representations in
the output format (and besides BFD does not translate
relocs for other link purposes than a final link). */
- if ((link_info.relocateable || link_info.emitrelocations)
+ if ((link_info.relocatable || link_info.emitrelocations)
&& (compatible == NULL
|| bfd_get_flavour (input_bfd) != bfd_get_flavour (output_bfd))
&& (bfd_get_file_flags (input_bfd) & HAS_RELOC) != 0)
@@ -3692,7 +3687,7 @@ lang_check ()
if (! bfd_merge_private_bfd_data (input_bfd, output_bfd))
{
if (command_line.warn_mismatch)
- einfo (_("%E%X: failed to merge target specific data of file %B\n"),
+ einfo (_("%P%X: failed to merge target specific data of file %B\n"),
input_bfd);
}
if (! command_line.warn_mismatch)
@@ -3706,54 +3701,49 @@ lang_check ()
to roughly sort the entries by size. */
static void
-lang_common ()
+lang_common (void)
{
if (command_line.inhibit_common_definition)
return;
- if (link_info.relocateable
+ if (link_info.relocatable
&& ! command_line.force_common_definition)
return;
if (! config.sort_common)
- bfd_link_hash_traverse (link_info.hash, lang_one_common, (PTR) NULL);
+ bfd_link_hash_traverse (link_info.hash, lang_one_common, NULL);
else
{
int power;
for (power = 4; power >= 0; power--)
- bfd_link_hash_traverse (link_info.hash, lang_one_common,
- (PTR) &power);
+ bfd_link_hash_traverse (link_info.hash, lang_one_common, &power);
}
}
/* Place one common symbol in the correct section. */
-static boolean
-lang_one_common (h, info)
- struct bfd_link_hash_entry *h;
- PTR info;
+static bfd_boolean
+lang_one_common (struct bfd_link_hash_entry *h, void *info)
{
unsigned int power_of_two;
bfd_vma size;
asection *section;
- unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
- ldfile_output_machine);
if (h->type != bfd_link_hash_common)
- return true;
+ return TRUE;
size = h->u.c.size;
power_of_two = h->u.c.p->alignment_power;
if (config.sort_common
&& power_of_two < (unsigned int) *(int *) info)
- return true;
+ return TRUE;
section = h->u.c.p->section;
- /* Increase the size of the section. */
- section->_cooked_size = align_n ((section->_cooked_size + opb - 1) / opb,
- (bfd_vma) 1 << power_of_two) * opb;
+ /* Increase the size of the section to align the common sym. */
+ section->_cooked_size += ((bfd_vma) 1 << (power_of_two + opb_shift)) - 1;
+ section->_cooked_size &= (- (bfd_vma) 1 << (power_of_two + opb_shift));
/* Adjust the alignment if necessary. */
if (power_of_two > section->alignment_power)
@@ -3774,7 +3764,7 @@ lang_one_common (h, info)
if (config.map_file != NULL)
{
- static boolean header_printed;
+ static bfd_boolean header_printed;
int len;
char *name;
char buf[50];
@@ -3783,7 +3773,7 @@ lang_one_common (h, info)
{
minfo (_("\nAllocating common symbols\n"));
minfo (_("Common symbol size file\n\n"));
- header_printed = true;
+ header_printed = TRUE;
}
name = demangle (h->root.string);
@@ -3819,7 +3809,7 @@ lang_one_common (h, info)
minfo ("%B\n", section->owner);
}
- return true;
+ return TRUE;
}
/* Run through the input files and ensure that every input section has
@@ -3827,19 +3817,17 @@ lang_one_common (h, info)
an input request and place it into the statement tree. */
static void
-lang_place_orphans ()
+lang_place_orphans (void)
{
LANG_FOR_EACH_INPUT_STATEMENT (file)
{
asection *s;
- for (s = file->the_bfd->sections;
- s != (asection *) NULL;
- s = s->next)
+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
{
- if (s->output_section == (asection *) NULL)
+ if (s->output_section == NULL)
{
- /* This section of the file is not attatched, root
+ /* This section of the file is not attached, root
around for a sensible place for it to go. */
if (file->just_syms_flag)
@@ -3851,7 +3839,7 @@ lang_place_orphans ()
/* This is a lonely common section which must have
come from an archive. We attach to the section
with the wildcard. */
- if (! link_info.relocateable
+ if (! link_info.relocatable
|| command_line.force_common_definition)
{
if (default_common_section == NULL)
@@ -3885,10 +3873,7 @@ lang_place_orphans ()
}
void
-lang_set_flags (ptr, flags, invert)
- lang_memory_region_type *ptr;
- const char *flags;
- int invert;
+lang_set_flags (lang_memory_region_type *ptr, const char *flags, int invert)
{
flagword *ptr_flags;
@@ -3930,8 +3915,7 @@ lang_set_flags (ptr, flags, invert)
on an archive, but not on the elements. */
void
-lang_for_each_input_file (func)
- void (*func) PARAMS ((lang_input_statement_type *));
+lang_for_each_input_file (void (*func) (lang_input_statement_type *))
{
lang_input_statement_type *f;
@@ -3946,8 +3930,7 @@ lang_for_each_input_file (func)
not be called on the archive file itself. */
void
-lang_for_each_file (func)
- void (*func) PARAMS ((lang_input_statement_type *));
+lang_for_each_file (void (*func) (lang_input_statement_type *))
{
LANG_FOR_EACH_INPUT_STATEMENT (f)
{
@@ -3955,32 +3938,8 @@ lang_for_each_file (func)
}
}
-#if 0
-
-/* Not used. */
-
void
-lang_for_each_input_section (func)
- void (*func) PARAMS ((bfd *ab, asection *as));
-{
- LANG_FOR_EACH_INPUT_STATEMENT (f)
- {
- asection *s;
-
- for (s = f->the_bfd->sections;
- s != (asection *) NULL;
- s = s->next)
- {
- func (f->the_bfd, s);
- }
- }
-}
-
-#endif
-
-void
-ldlang_add_file (entry)
- lang_input_statement_type *entry;
+ldlang_add_file (lang_input_statement_type *entry)
{
bfd **pp;
@@ -3990,14 +3949,12 @@ ldlang_add_file (entry)
/* The BFD linker needs to have a list of all input BFDs involved in
a link. */
- ASSERT (entry->the_bfd->link_next == (bfd *) NULL);
+ ASSERT (entry->the_bfd->link_next == NULL);
ASSERT (entry->the_bfd != output_bfd);
- for (pp = &link_info.input_bfds;
- *pp != (bfd *) NULL;
- pp = &(*pp)->link_next)
+ for (pp = &link_info.input_bfds; *pp != NULL; pp = &(*pp)->link_next)
;
*pp = entry->the_bfd;
- entry->the_bfd->usrdata = (PTR) entry;
+ entry->the_bfd->usrdata = entry;
bfd_set_gp_size (entry->the_bfd, g_switch_value);
/* Look through the sections and check for any which should not be
@@ -4010,27 +3967,24 @@ ldlang_add_file (entry)
each backend which might set the SEC_LINK_ONCE flag. If we do
this, we should probably handle SEC_EXCLUDE in the same way. */
- bfd_map_over_sections (entry->the_bfd, section_already_linked, (PTR) entry);
+ bfd_map_over_sections (entry->the_bfd, section_already_linked, entry);
}
void
-lang_add_output (name, from_script)
- const char *name;
- int from_script;
+lang_add_output (const char *name, int from_script)
{
/* Make -o on command line override OUTPUT in script. */
if (!had_output_filename || !from_script)
{
output_filename = name;
- had_output_filename = true;
+ had_output_filename = TRUE;
}
}
static lang_output_section_statement_type *current_section;
static int
-topower (x)
- int x;
+topower (int x)
{
unsigned int i = 1;
int l;
@@ -4049,16 +4003,12 @@ topower (x)
}
lang_output_section_statement_type *
-lang_enter_output_section_statement (output_section_statement_name,
- address_exp, sectype, block_value,
- align, subalign, ebase)
- const char *output_section_statement_name;
- etree_type *address_exp;
- enum section_type sectype;
- bfd_vma block_value;
- etree_type *align;
- etree_type *subalign;
- etree_type *ebase;
+lang_enter_output_section_statement (const char *output_section_statement_name,
+ etree_type *address_exp,
+ enum section_type sectype,
+ etree_type *align,
+ etree_type *subalign,
+ etree_type *ebase)
{
lang_output_section_statement_type *os;
@@ -4073,7 +4023,7 @@ lang_enter_output_section_statement (output_section_statement_name,
#endif
/* Make next things chain into subchain of this. */
- if (os->addr_tree == (etree_type *) NULL)
+ if (os->addr_tree == NULL)
{
os->addr_tree = address_exp;
}
@@ -4082,7 +4032,7 @@ lang_enter_output_section_statement (output_section_statement_name,
os->flags = SEC_NO_FLAGS;
else
os->flags = SEC_NEVER_LOAD;
- os->block_value = block_value ? block_value : 1;
+ os->block_value = 1;
stat_ptr = &os->children;
os->subsection_alignment =
@@ -4095,7 +4045,7 @@ lang_enter_output_section_statement (output_section_statement_name,
}
void
-lang_final ()
+lang_final (void)
{
lang_output_statement_type *new =
new_stat (lang_output_statement, stat_ptr);
@@ -4106,14 +4056,12 @@ lang_final ()
/* Reset the current counters in the regions. */
void
-lang_reset_memory_regions ()
+lang_reset_memory_regions (void)
{
lang_memory_region_type *p = lang_memory_region_list;
asection *o;
- for (p = lang_memory_region_list;
- p != (lang_memory_region_type *) NULL;
- p = p->next)
+ for (p = lang_memory_region_list; p != NULL; p = p->next)
{
p->old_length = (bfd_size_type) (p->current - p->origin);
p->current = p->origin;
@@ -4127,12 +4075,11 @@ lang_reset_memory_regions ()
should be as well. */
static void
-gc_section_callback (ptr, sec, section, file, data)
- lang_wild_statement_type *ptr;
- struct wildcard_list *sec ATTRIBUTE_UNUSED;
- asection *section;
- lang_input_statement_type *file ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
+gc_section_callback (lang_wild_statement_type *ptr,
+ struct wildcard_list *sec ATTRIBUTE_UNUSED,
+ asection *section,
+ lang_input_statement_type *file ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED)
{
if (ptr->keep_sections)
section->flags |= SEC_KEEP;
@@ -4141,8 +4088,7 @@ gc_section_callback (ptr, sec, section, file, data)
/* Handle a wild statement, marking it against GC. */
static void
-lang_gc_wild (s)
- lang_wild_statement_type *s;
+lang_gc_wild (lang_wild_statement_type *s)
{
walk_wild (s, gc_section_callback, NULL);
}
@@ -4150,10 +4096,9 @@ lang_gc_wild (s)
/* Iterate over sections marking them against GC. */
static void
-lang_gc_sections_1 (s)
- lang_statement_union_type *s;
+lang_gc_sections_1 (lang_statement_union_type *s)
{
- for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
+ for (; s != NULL; s = s->header.next)
{
switch (s->header.type)
{
@@ -4176,7 +4121,7 @@ lang_gc_sections_1 (s)
}
static void
-lang_gc_sections ()
+lang_gc_sections (void)
{
struct bfd_link_hash_entry *h;
ldlang_undef_chain_list_type *ulist;
@@ -4191,9 +4136,9 @@ lang_gc_sections ()
for (ulist = link_info.gc_sym_list; ulist; ulist = ulist->next)
{
h = bfd_link_hash_lookup (link_info.hash, ulist->name,
- false, false, false);
+ FALSE, FALSE, FALSE);
- if (h != (struct bfd_link_hash_entry *) NULL
+ if (h != NULL
&& (h->type == bfd_link_hash_defined
|| h->type == bfd_link_hash_defweak)
&& ! bfd_is_abs_section (h->u.def.section))
@@ -4206,13 +4151,14 @@ lang_gc_sections ()
}
void
-lang_process ()
+lang_process (void)
{
lang_reasonable_defaults ();
current_target = default_target;
/* Open the output file. */
lang_for_each_statement (ldlang_open_output);
+ init_opb ();
ldemul_create_output_section_statements ();
@@ -4223,7 +4169,7 @@ lang_process ()
/* Create a bfd for each input file. */
current_target = default_target;
- open_input_bfds (statement_list.head, false);
+ open_input_bfds (statement_list.head, FALSE);
link_info.gc_sym_list = &entry_symbol;
if (entry_symbol.name == NULL)
@@ -4263,18 +4209,17 @@ lang_process ()
/* Run through the contours of the script and attach input sections
to the correct output sections. */
- map_input_to_output_sections (statement_list.head, (char *) NULL,
- (lang_output_section_statement_type *) NULL);
+ map_input_to_output_sections (statement_list.head, NULL, NULL);
/* Find any sections not attached explicitly and handle them. */
lang_place_orphans ();
- if (! link_info.relocateable)
+ if (! link_info.relocatable)
{
/* Look for a text section and set the readonly attribute in it. */
asection *found = bfd_get_section_by_name (output_bfd, ".text");
- if (found != (asection *) NULL)
+ if (found != NULL)
{
if (config.text_read_only)
found->flags |= SEC_READONLY;
@@ -4287,7 +4232,7 @@ lang_process ()
and other back-ends size dynamic sections. */
ldemul_before_allocation ();
- if (!link_info.relocateable)
+ if (!link_info.relocatable)
strip_excluded_output_sections ();
/* We must record the program headers before we try to fix the
@@ -4295,21 +4240,19 @@ lang_process ()
lang_record_phdrs ();
/* Size up the sections. */
- lang_size_sections (statement_list.head,
- abs_output_section,
- &statement_list.head, 0, (bfd_vma) 0, NULL);
+ lang_size_sections (statement_list.head, abs_output_section,
+ &statement_list.head, 0, 0, NULL,
+ command_line.relax ? FALSE : TRUE);
/* Now run around and relax if we can. */
if (command_line.relax)
{
/* Keep relaxing until bfd_relax_section gives up. */
- boolean relax_again;
+ bfd_boolean relax_again;
do
{
- lang_reset_memory_regions ();
-
- relax_again = false;
+ relax_again = FALSE;
/* Note: pe-dll.c does something like this also. If you find
you need to change this code, you probably need to change
@@ -4317,18 +4260,33 @@ lang_process ()
/* Do all the assignments with our current guesses as to
section sizes. */
- lang_do_assignments (statement_list.head,
- abs_output_section,
- (fill_type *) 0, (bfd_vma) 0);
+ lang_do_assignments (statement_list.head, abs_output_section,
+ NULL, 0);
+
+ /* We must do this after lang_do_assignments, because it uses
+ _raw_size. */
+ lang_reset_memory_regions ();
/* Perform another relax pass - this time we know where the
globals are, so can make a better guess. */
- lang_size_sections (statement_list.head,
- abs_output_section,
- &statement_list.head, 0, (bfd_vma) 0,
- &relax_again);
+ lang_size_sections (statement_list.head, abs_output_section,
+ &statement_list.head, 0, 0, &relax_again, FALSE);
+
+ /* If the normal relax is done and the relax finalize pass
+ is not performed yet, we perform another relax pass. */
+ if (!relax_again && link_info.need_relax_finalize)
+ {
+ link_info.need_relax_finalize = FALSE;
+ relax_again = TRUE;
+ }
}
while (relax_again);
+
+ /* Final extra sizing to report errors. */
+ lang_do_assignments (statement_list.head, abs_output_section, NULL, 0);
+ lang_reset_memory_regions ();
+ lang_size_sections (statement_list.head, abs_output_section,
+ &statement_list.head, 0, 0, NULL, TRUE);
}
/* See if anything special should be done now we know how big
@@ -4341,12 +4299,10 @@ lang_process ()
/* Do all the assignments, now that we know the final resting places
of all the symbols. */
- lang_do_assignments (statement_list.head,
- abs_output_section,
- (fill_type *) 0, (bfd_vma) 0);
+ lang_do_assignments (statement_list.head, abs_output_section, NULL, 0);
/* Make sure that the section addresses make sense. */
- if (! link_info.relocateable
+ if (! link_info.relocatable
&& command_line.check_section_addresses)
lang_check_section_addresses ();
@@ -4359,10 +4315,9 @@ lang_process ()
/* EXPORTED TO YACC */
void
-lang_add_wild (filespec, section_list, keep_sections)
- struct wildcard_spec *filespec;
- struct wildcard_list *section_list;
- boolean keep_sections;
+lang_add_wild (struct wildcard_spec *filespec,
+ struct wildcard_list *section_list,
+ bfd_boolean keep_sections)
{
struct wildcard_list *curr, *next;
lang_wild_statement_type *new;
@@ -4373,7 +4328,7 @@ lang_add_wild (filespec, section_list, keep_sections)
section_list = curr, curr = next)
{
if (curr->spec.name != NULL && strcmp (curr->spec.name, "COMMON") == 0)
- placed_commons = true;
+ placed_commons = TRUE;
next = curr->next;
curr->next = section_list;
@@ -4384,12 +4339,12 @@ lang_add_wild (filespec, section_list, keep_sections)
if (strcmp (filespec->name, "*") == 0)
filespec->name = NULL;
else if (! wildcardp (filespec->name))
- lang_has_input_file = true;
+ lang_has_input_file = TRUE;
}
new = new_stat (lang_wild_statement, stat_ptr);
new->filename = NULL;
- new->filenames_sorted = false;
+ new->filenames_sorted = FALSE;
if (filespec != NULL)
{
new->filename = filespec->name;
@@ -4401,9 +4356,7 @@ lang_add_wild (filespec, section_list, keep_sections)
}
void
-lang_section_start (name, address)
- const char *name;
- etree_type *address;
+lang_section_start (const char *name, etree_type *address)
{
lang_address_statement_type *ad;
@@ -4418,9 +4371,7 @@ lang_section_start (name, address)
precedence. */
void
-lang_add_entry (name, cmdline)
- const char *name;
- boolean cmdline;
+lang_add_entry (const char *name, bfd_boolean cmdline)
{
if (entry_symbol.name == NULL
|| cmdline
@@ -4432,8 +4383,7 @@ lang_add_entry (name, cmdline)
}
void
-lang_add_target (name)
- const char *name;
+lang_add_target (const char *name)
{
lang_target_statement_type *new = new_stat (lang_target_statement,
stat_ptr);
@@ -4443,15 +4393,14 @@ lang_add_target (name)
}
void
-lang_add_map (name)
- const char *name;
+lang_add_map (const char *name)
{
while (*name)
{
switch (*name)
{
case 'F':
- map_option_f = true;
+ map_option_f = TRUE;
break;
}
name++;
@@ -4459,8 +4408,7 @@ lang_add_map (name)
}
void
-lang_add_fill (fill)
- fill_type *fill;
+lang_add_fill (fill_type *fill)
{
lang_fill_statement_type *new = new_stat (lang_fill_statement,
stat_ptr);
@@ -4469,9 +4417,7 @@ lang_add_fill (fill)
}
void
-lang_add_data (type, exp)
- int type;
- union etree_union *exp;
+lang_add_data (int type, union etree_union *exp)
{
lang_data_statement_type *new = new_stat (lang_data_statement,
@@ -4490,12 +4436,11 @@ lang_add_data (type, exp)
NAME must be NULL. ADDEND is an expression for the addend. */
void
-lang_add_reloc (reloc, howto, section, name, addend)
- bfd_reloc_code_real_type reloc;
- reloc_howto_type *howto;
- asection *section;
- const char *name;
- union etree_union *addend;
+lang_add_reloc (bfd_reloc_code_real_type reloc,
+ reloc_howto_type *howto,
+ asection *section,
+ const char *name,
+ union etree_union *addend)
{
lang_reloc_statement_type *p = new_stat (lang_reloc_statement, stat_ptr);
@@ -4511,8 +4456,7 @@ lang_add_reloc (reloc, howto, section, name, addend)
}
lang_assignment_statement_type *
-lang_add_assignment (exp)
- etree_type *exp;
+lang_add_assignment (etree_type *exp)
{
lang_assignment_statement_type *new = new_stat (lang_assignment_statement,
stat_ptr);
@@ -4522,30 +4466,27 @@ lang_add_assignment (exp)
}
void
-lang_add_attribute (attribute)
- enum statement_enum attribute;
+lang_add_attribute (enum statement_enum attribute)
{
new_statement (attribute, sizeof (lang_statement_union_type), stat_ptr);
}
void
-lang_startup (name)
- const char *name;
+lang_startup (const char *name)
{
- if (startup_file != (char *) NULL)
+ if (startup_file != NULL)
{
einfo (_("%P%Fmultiple STARTUP files\n"));
}
first_file->filename = name;
first_file->local_sym_name = name;
- first_file->real = true;
+ first_file->real = TRUE;
startup_file = name;
}
void
-lang_float (maybe)
- boolean maybe;
+lang_float (bfd_boolean maybe)
{
lang_float_flag = maybe;
}
@@ -4554,43 +4495,47 @@ lang_float (maybe)
/* Work out the load- and run-time regions from a script statement, and
store them in *LMA_REGION and *REGION respectively.
- MEMSPEC is the name of the run-time region, or "*default*" if the
- statement didn't specify one. LMA_MEMSPEC is the name of the
- load-time region, or null if the statement didn't specify one.
- HAVE_LMA_P is true if the statement had an explicit load address.
+ MEMSPEC is the name of the run-time region, or the value of
+ DEFAULT_MEMORY_REGION if the statement didn't specify one.
+ LMA_MEMSPEC is the name of the load-time region, or null if the
+ statement didn't specify one.HAVE_LMA_P is TRUE if the statement
+ had an explicit load address.
It is an error to specify both a load region and a load address. */
static void
-lang_get_regions (region, lma_region, memspec, lma_memspec, have_lma_p)
- struct memory_region_struct **region, **lma_region;
- const char *memspec, *lma_memspec;
- int have_lma_p;
-{
- *lma_region = lang_memory_region_lookup (lma_memspec);
-
- /* If no runtime region has been given, but the load region has
- been, use the load region. */
- if (lma_memspec != 0 && strcmp (memspec, "*default*") == 0)
+lang_get_regions (lang_memory_region_type **region,
+ lang_memory_region_type **lma_region,
+ const char *memspec,
+ const char *lma_memspec,
+ bfd_boolean have_lma,
+ bfd_boolean have_vma)
+{
+ *lma_region = lang_memory_region_lookup (lma_memspec, FALSE);
+
+ /* If no runtime region or VMA has been specified, but the load region has
+ been specified, then use the load region for the runtime region as well. */
+ if (lma_memspec != NULL
+ && ! have_vma
+ && strcmp (memspec, DEFAULT_MEMORY_REGION) == 0)
*region = *lma_region;
else
- *region = lang_memory_region_lookup (memspec);
+ *region = lang_memory_region_lookup (memspec, FALSE);
- if (have_lma_p && lma_memspec != 0)
+ if (have_lma && lma_memspec != 0)
einfo (_("%X%P:%S: section has both a load address and a load region\n"));
}
void
-lang_leave_output_section_statement (fill, memspec, phdrs, lma_memspec)
- fill_type *fill;
- const char *memspec;
- struct lang_output_section_phdr_list *phdrs;
- const char *lma_memspec;
+lang_leave_output_section_statement (fill_type *fill, const char *memspec,
+ lang_output_section_phdr_list *phdrs,
+ const char *lma_memspec)
{
lang_get_regions (&current_section->region,
&current_section->lma_region,
memspec, lma_memspec,
- current_section->load_base != 0);
+ current_section->load_base != NULL,
+ current_section->addr_tree != NULL);
current_section->fill = fill;
current_section->phdrs = phdrs;
stat_ptr = &statement_list;
@@ -4602,14 +4547,12 @@ lang_leave_output_section_statement (fill, memspec, phdrs, lma_memspec)
If the symbol already exists, then do nothing. */
void
-lang_abs_symbol_at_beginning_of (secname, name)
- const char *secname;
- const char *name;
+lang_abs_symbol_at_beginning_of (const char *secname, const char *name)
{
struct bfd_link_hash_entry *h;
- h = bfd_link_hash_lookup (link_info.hash, name, true, true, true);
- if (h == (struct bfd_link_hash_entry *) NULL)
+ h = bfd_link_hash_lookup (link_info.hash, name, TRUE, TRUE, TRUE);
+ if (h == NULL)
einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n"));
if (h->type == bfd_link_hash_new
@@ -4620,7 +4563,7 @@ lang_abs_symbol_at_beginning_of (secname, name)
h->type = bfd_link_hash_defined;
sec = bfd_get_section_by_name (output_bfd, secname);
- if (sec == (asection *) NULL)
+ if (sec == NULL)
h->u.def.value = 0;
else
h->u.def.value = bfd_get_section_vma (output_bfd, sec);
@@ -4635,14 +4578,12 @@ lang_abs_symbol_at_beginning_of (secname, name)
If the symbol already exists, then do nothing. */
void
-lang_abs_symbol_at_end_of (secname, name)
- const char *secname;
- const char *name;
+lang_abs_symbol_at_end_of (const char *secname, const char *name)
{
struct bfd_link_hash_entry *h;
- h = bfd_link_hash_lookup (link_info.hash, name, true, true, true);
- if (h == (struct bfd_link_hash_entry *) NULL)
+ h = bfd_link_hash_lookup (link_info.hash, name, TRUE, TRUE, TRUE);
+ if (h == NULL)
einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n"));
if (h->type == bfd_link_hash_new
@@ -4653,22 +4594,20 @@ lang_abs_symbol_at_end_of (secname, name)
h->type = bfd_link_hash_defined;
sec = bfd_get_section_by_name (output_bfd, secname);
- if (sec == (asection *) NULL)
+ if (sec == NULL)
h->u.def.value = 0;
else
h->u.def.value = (bfd_get_section_vma (output_bfd, sec)
- + bfd_section_size (output_bfd, sec) /
- bfd_octets_per_byte (output_bfd));
+ + TO_ADDR (bfd_section_size (output_bfd, sec)));
h->u.def.section = bfd_abs_section_ptr;
}
}
void
-lang_statement_append (list, element, field)
- lang_statement_list_type *list;
- lang_statement_union_type *element;
- lang_statement_union_type **field;
+lang_statement_append (lang_statement_list_type *list,
+ lang_statement_union_type *element,
+ lang_statement_union_type **field)
{
*(list->tail) = element;
list->tail = field;
@@ -4677,11 +4616,10 @@ lang_statement_append (list, element, field)
/* Set the output format type. -oformat overrides scripts. */
void
-lang_add_output_format (format, big, little, from_script)
- const char *format;
- const char *big;
- const char *little;
- int from_script;
+lang_add_output_format (const char *format,
+ const char *big,
+ const char *little,
+ int from_script)
{
if (output_target == NULL || !from_script)
{
@@ -4700,7 +4638,7 @@ lang_add_output_format (format, big, little, from_script)
stat_ptr to build new statements within the group. */
void
-lang_enter_group ()
+lang_enter_group (void)
{
lang_group_statement_type *g;
@@ -4715,7 +4653,7 @@ lang_enter_group ()
but currently they can't. */
void
-lang_leave_group ()
+lang_leave_group (void)
{
stat_ptr = &statement_list;
}
@@ -4724,17 +4662,16 @@ lang_leave_group ()
command in a linker script. */
void
-lang_new_phdr (name, type, filehdr, phdrs, at, flags)
- const char *name;
- etree_type *type;
- boolean filehdr;
- boolean phdrs;
- etree_type *at;
- etree_type *flags;
+lang_new_phdr (const char *name,
+ etree_type *type,
+ bfd_boolean filehdr,
+ bfd_boolean phdrs,
+ etree_type *at,
+ etree_type *flags)
{
struct lang_phdr *n, **pp;
- n = (struct lang_phdr *) stat_alloc (sizeof (struct lang_phdr));
+ n = stat_alloc (sizeof (struct lang_phdr));
n->next = NULL;
n->name = name;
n->type = exp_get_value_int (type, 0, "program header type",
@@ -4753,16 +4690,16 @@ lang_new_phdr (name, type, filehdr, phdrs, at, flags)
should not be calling an ELF specific function here. */
static void
-lang_record_phdrs ()
+lang_record_phdrs (void)
{
unsigned int alc;
asection **secs;
- struct lang_output_section_phdr_list *last;
+ lang_output_section_phdr_list *last;
struct lang_phdr *l;
lang_statement_union_type *u;
alc = 10;
- secs = (asection **) xmalloc (alc * sizeof (asection *));
+ secs = xmalloc (alc * sizeof (asection *));
last = NULL;
for (l = lang_phdr_list; l != NULL; l = l->next)
{
@@ -4776,7 +4713,7 @@ lang_record_phdrs ()
u = u->output_section_statement.next)
{
lang_output_section_statement_type *os;
- struct lang_output_section_phdr_list *pl;
+ lang_output_section_phdr_list *pl;
os = &u->output_section_statement;
@@ -4802,12 +4739,11 @@ lang_record_phdrs ()
if (c >= alc)
{
alc *= 2;
- secs = ((asection **)
- xrealloc (secs, alc * sizeof (asection *)));
+ secs = xrealloc (secs, alc * sizeof (asection *));
}
secs[c] = os->bfd_section;
++c;
- pl->used = true;
+ pl->used = TRUE;
}
}
}
@@ -4837,7 +4773,7 @@ lang_record_phdrs ()
u != NULL;
u = u->output_section_statement.next)
{
- struct lang_output_section_phdr_list *pl;
+ lang_output_section_phdr_list *pl;
if (u->output_section_statement.bfd_section == NULL)
continue;
@@ -4854,24 +4790,25 @@ lang_record_phdrs ()
/* Record a list of sections which may not be cross referenced. */
void
-lang_add_nocrossref (l)
- struct lang_nocrossref *l;
+lang_add_nocrossref (lang_nocrossref_type *l)
{
struct lang_nocrossrefs *n;
- n = (struct lang_nocrossrefs *) xmalloc (sizeof *n);
+ n = xmalloc (sizeof *n);
n->next = nocrossref_list;
n->list = l;
nocrossref_list = n;
/* Set notice_all so that we get informed about all symbols. */
- link_info.notice_all = true;
+ link_info.notice_all = TRUE;
}
/* Overlay handling. We handle overlays with some static variables. */
/* The overlay virtual address. */
static etree_type *overlay_vma;
+/* And subsection alignment. */
+static etree_type *overlay_subalign;
/* An expression for the maximum section size seen so far. */
static etree_type *overlay_max;
@@ -4888,13 +4825,15 @@ static struct overlay_list *overlay_list;
/* Start handling an overlay. */
void
-lang_enter_overlay (vma_expr)
- etree_type *vma_expr;
+lang_enter_overlay (etree_type *vma_expr, etree_type *subalign)
{
/* The grammar should prevent nested overlays from occurring. */
- ASSERT (overlay_vma == NULL && overlay_max == NULL);
+ ASSERT (overlay_vma == NULL
+ && overlay_subalign == NULL
+ && overlay_max == NULL);
overlay_vma = vma_expr;
+ overlay_subalign = subalign;
}
/* Start a section in an overlay. We handle this by calling
@@ -4902,14 +4841,13 @@ lang_enter_overlay (vma_expr)
lang_leave_overlay sets up the LMA and memory regions. */
void
-lang_enter_overlay_section (name)
- const char *name;
+lang_enter_overlay_section (const char *name)
{
struct overlay_list *n;
etree_type *size;
lang_enter_output_section_statement (name, overlay_vma, normal_section,
- 0, 0, 0, 0);
+ 0, overlay_subalign, 0);
/* If this is the first section, then base the VMA of future
sections on this one. This will work correctly even if `.' is
@@ -4918,7 +4856,7 @@ lang_enter_overlay_section (name)
overlay_vma = exp_nameop (ADDR, name);
/* Remember the section. */
- n = (struct overlay_list *) xmalloc (sizeof *n);
+ n = xmalloc (sizeof *n);
n->os = current_section;
n->next = overlay_list;
overlay_list = n;
@@ -4936,9 +4874,8 @@ lang_enter_overlay_section (name)
here. */
void
-lang_leave_overlay_section (fill, phdrs)
- fill_type *fill;
- struct lang_output_section_phdr_list *phdrs;
+lang_leave_overlay_section (fill_type *fill,
+ lang_output_section_phdr_list *phdrs)
{
const char *name;
char *clean, *s2;
@@ -4947,10 +4884,11 @@ lang_leave_overlay_section (fill, phdrs)
name = current_section->name;
- /* For now, assume that "*default*" is the run-time memory region and
- that no load-time region has been specified. It doesn't really
- matter what we say here, since lang_leave_overlay will override it. */
- lang_leave_output_section_statement (fill, "*default*", phdrs, 0);
+ /* For now, assume that DEFAULT_MEMORY_REGION is the run-time memory
+ region and that no load-time region has been specified. It doesn't
+ really matter what we say here, since lang_leave_overlay will
+ override it. */
+ lang_leave_output_section_statement (fill, DEFAULT_MEMORY_REGION, phdrs, 0);
/* Define the magic symbols. */
@@ -4980,22 +4918,21 @@ lang_leave_overlay_section (fill, phdrs)
looks through all the sections in the overlay and sets them. */
void
-lang_leave_overlay (lma_expr, nocrossrefs, fill, memspec, phdrs, lma_memspec)
- etree_type *lma_expr;
- int nocrossrefs;
- fill_type *fill;
- const char *memspec;
- struct lang_output_section_phdr_list *phdrs;
- const char *lma_memspec;
+lang_leave_overlay (etree_type *lma_expr,
+ int nocrossrefs,
+ fill_type *fill,
+ const char *memspec,
+ lang_output_section_phdr_list *phdrs,
+ const char *lma_memspec)
{
lang_memory_region_type *region;
lang_memory_region_type *lma_region;
struct overlay_list *l;
- struct lang_nocrossref *nocrossref;
+ lang_nocrossref_type *nocrossref;
lang_get_regions (&region, &lma_region,
memspec, lma_memspec,
- lma_expr != 0);
+ lma_expr != NULL, FALSE);
nocrossref = NULL;
@@ -5010,7 +4947,7 @@ lang_leave_overlay (lma_expr, nocrossrefs, fill, memspec, phdrs, lma_memspec)
{
struct overlay_list *next;
- if (fill != (fill_type *) 0 && l->os->fill == (fill_type *) 0)
+ if (fill != NULL && l->os->fill == NULL)
l->os->fill = fill;
l->os->region = region;
@@ -5032,9 +4969,9 @@ lang_leave_overlay (lma_expr, nocrossrefs, fill, memspec, phdrs, lma_memspec)
if (nocrossrefs)
{
- struct lang_nocrossref *nc;
+ lang_nocrossref_type *nc;
- nc = (struct lang_nocrossref *) xmalloc (sizeof *nc);
+ nc = xmalloc (sizeof *nc);
nc->name = l->os->name;
nc->next = nocrossref;
nocrossref = nc;
@@ -5059,97 +4996,181 @@ lang_leave_overlay (lma_expr, nocrossrefs, fill, memspec, phdrs, lma_memspec)
struct bfd_elf_version_tree *lang_elf_version_info;
-static int
-lang_vers_match_lang_c (expr, sym)
- struct bfd_elf_version_expr *expr;
- const char *sym;
-{
- if (expr->pattern[0] == '*' && expr->pattern[1] == '\0')
- return 1;
- return fnmatch (expr->pattern, sym, 0) == 0;
-}
+/* If PREV is NULL, return first version pattern matching particular symbol.
+ If PREV is non-NULL, return first version pattern matching particular
+ symbol after PREV (previously returned by lang_vers_match). */
-static int
-lang_vers_match_lang_cplusplus (expr, sym)
- struct bfd_elf_version_expr *expr;
- const char *sym;
+static struct bfd_elf_version_expr *
+lang_vers_match (struct bfd_elf_version_expr_head *head,
+ struct bfd_elf_version_expr *prev,
+ const char *sym)
{
- char *alt_sym;
- int result;
+ const char *cxx_sym = sym;
+ const char *java_sym = sym;
+ struct bfd_elf_version_expr *expr = NULL;
- if (expr->pattern[0] == '*' && expr->pattern[1] == '\0')
- return 1;
+ if (head->mask & BFD_ELF_VERSION_CXX_TYPE)
+ {
+ cxx_sym = cplus_demangle (sym, DMGL_PARAMS | DMGL_ANSI);
+ if (!cxx_sym)
+ cxx_sym = sym;
+ }
+ if (head->mask & BFD_ELF_VERSION_JAVA_TYPE)
+ {
+ java_sym = cplus_demangle (sym, DMGL_JAVA);
+ if (!java_sym)
+ java_sym = sym;
+ }
- alt_sym = cplus_demangle (sym, /* DMGL_NO_TPARAMS */ 0);
- if (!alt_sym)
+ if (head->htab && (prev == NULL || prev->symbol))
{
- /* cplus_demangle (also) returns NULL when it is not a C++ symbol.
- Should we early out false in this case? */
- result = fnmatch (expr->pattern, sym, 0) == 0;
+ struct bfd_elf_version_expr e;
+
+ switch (prev ? prev->mask : 0)
+ {
+ case 0:
+ if (head->mask & BFD_ELF_VERSION_C_TYPE)
+ {
+ e.symbol = sym;
+ expr = htab_find (head->htab, &e);
+ while (expr && strcmp (expr->symbol, sym) == 0)
+ if (expr->mask == BFD_ELF_VERSION_C_TYPE)
+ goto out_ret;
+ else
+ expr = expr->next;
+ }
+ /* Fallthrough */
+ case BFD_ELF_VERSION_C_TYPE:
+ if (head->mask & BFD_ELF_VERSION_CXX_TYPE)
+ {
+ e.symbol = cxx_sym;
+ expr = htab_find (head->htab, &e);
+ while (expr && strcmp (expr->symbol, cxx_sym) == 0)
+ if (expr->mask == BFD_ELF_VERSION_CXX_TYPE)
+ goto out_ret;
+ else
+ expr = expr->next;
+ }
+ /* Fallthrough */
+ case BFD_ELF_VERSION_CXX_TYPE:
+ if (head->mask & BFD_ELF_VERSION_JAVA_TYPE)
+ {
+ e.symbol = java_sym;
+ expr = htab_find (head->htab, &e);
+ while (expr && strcmp (expr->symbol, java_sym) == 0)
+ if (expr->mask == BFD_ELF_VERSION_JAVA_TYPE)
+ goto out_ret;
+ else
+ expr = expr->next;
+ }
+ /* Fallthrough */
+ default:
+ break;
+ }
}
+
+ /* Finally, try the wildcards. */
+ if (prev == NULL || prev->symbol)
+ expr = head->remaining;
else
+ expr = prev->next;
+ while (expr)
{
- result = fnmatch (expr->pattern, alt_sym, 0) == 0;
- free (alt_sym);
+ const char *s;
+
+ if (expr->pattern[0] == '*' && expr->pattern[1] == '\0')
+ break;
+
+ if (expr->mask == BFD_ELF_VERSION_JAVA_TYPE)
+ s = java_sym;
+ else if (expr->mask == BFD_ELF_VERSION_CXX_TYPE)
+ s = cxx_sym;
+ else
+ s = sym;
+ if (fnmatch (expr->pattern, s, 0) == 0)
+ break;
+ expr = expr->next;
}
- return result;
+out_ret:
+ if (cxx_sym != sym)
+ free ((char *) cxx_sym);
+ if (java_sym != sym)
+ free ((char *) java_sym);
+ return expr;
}
-static int
-lang_vers_match_lang_java (expr, sym)
- struct bfd_elf_version_expr *expr;
- const char *sym;
+/* Return NULL if the PATTERN argument is a glob pattern, otherwise,
+ return a string pointing to the symbol name. */
+
+static const char *
+realsymbol (const char *pattern)
{
- char *alt_sym;
- int result;
+ const char *p;
+ bfd_boolean changed = FALSE, backslash = FALSE;
+ char *s, *symbol = xmalloc (strlen (pattern) + 1);
- if (expr->pattern[0] == '*' && expr->pattern[1] == '\0')
- return 1;
+ for (p = pattern, s = symbol; *p != '\0'; ++p)
+ {
+ /* It is a glob pattern only if there is no preceding
+ backslash. */
+ if (! backslash && (*p == '?' || *p == '*' || *p == '['))
+ {
+ free (symbol);
+ return NULL;
+ }
- alt_sym = cplus_demangle (sym, DMGL_JAVA);
- if (!alt_sym)
+ if (backslash)
+ {
+ /* Remove the preceding backslash. */
+ *(s - 1) = *p;
+ changed = TRUE;
+ }
+ else
+ *s++ = *p;
+
+ backslash = *p == '\\';
+ }
+
+ if (changed)
{
- /* cplus_demangle (also) returns NULL when it is not a Java symbol.
- Should we early out false in this case? */
- result = fnmatch (expr->pattern, sym, 0) == 0;
+ *s = '\0';
+ return symbol;
}
else
{
- result = fnmatch (expr->pattern, alt_sym, 0) == 0;
- free (alt_sym);
+ free (symbol);
+ return pattern;
}
-
- return result;
}
/* This is called for each variable name or match expression. */
struct bfd_elf_version_expr *
-lang_new_vers_pattern (orig, new, lang)
- struct bfd_elf_version_expr *orig;
- const char *new;
- const char *lang;
+lang_new_vers_pattern (struct bfd_elf_version_expr *orig,
+ const char *new,
+ const char *lang)
{
struct bfd_elf_version_expr *ret;
- ret = (struct bfd_elf_version_expr *) xmalloc (sizeof *ret);
+ ret = xmalloc (sizeof *ret);
ret->next = orig;
ret->pattern = new;
ret->symver = 0;
ret->script = 0;
+ ret->symbol = realsymbol (new);
if (lang == NULL || strcasecmp (lang, "C") == 0)
- ret->match = lang_vers_match_lang_c;
+ ret->mask = BFD_ELF_VERSION_C_TYPE;
else if (strcasecmp (lang, "C++") == 0)
- ret->match = lang_vers_match_lang_cplusplus;
+ ret->mask = BFD_ELF_VERSION_CXX_TYPE;
else if (strcasecmp (lang, "Java") == 0)
- ret->match = lang_vers_match_lang_java;
+ ret->mask = BFD_ELF_VERSION_JAVA_TYPE;
else
{
einfo (_("%X%P: unknown language `%s' in version information\n"),
lang);
- ret->match = lang_vers_match_lang_c;
+ ret->mask = BFD_ELF_VERSION_C_TYPE;
}
return ldemul_new_vers_pattern (ret);
@@ -5159,21 +5180,16 @@ lang_new_vers_pattern (orig, new, lang)
expressions. */
struct bfd_elf_version_tree *
-lang_new_vers_node (globals, locals)
- struct bfd_elf_version_expr *globals;
- struct bfd_elf_version_expr *locals;
+lang_new_vers_node (struct bfd_elf_version_expr *globals,
+ struct bfd_elf_version_expr *locals)
{
struct bfd_elf_version_tree *ret;
- ret = (struct bfd_elf_version_tree *) xmalloc (sizeof *ret);
- ret->next = NULL;
- ret->name = NULL;
- ret->vernum = 0;
- ret->globals = globals;
- ret->locals = locals;
- ret->deps = NULL;
+ ret = xcalloc (1, sizeof *ret);
+ ret->globals.list = globals;
+ ret->locals.list = locals;
+ ret->match = lang_vers_match;
ret->name_indx = (unsigned int) -1;
- ret->used = 0;
return ret;
}
@@ -5181,14 +5197,109 @@ lang_new_vers_node (globals, locals)
static int version_index;
+static hashval_t
+version_expr_head_hash (const void *p)
+{
+ const struct bfd_elf_version_expr *e = p;
+
+ return htab_hash_string (e->symbol);
+}
+
+static int
+version_expr_head_eq (const void *p1, const void *p2)
+{
+ const struct bfd_elf_version_expr *e1 = p1;
+ const struct bfd_elf_version_expr *e2 = p2;
+
+ return strcmp (e1->symbol, e2->symbol) == 0;
+}
+
+static void
+lang_finalize_version_expr_head (struct bfd_elf_version_expr_head *head)
+{
+ size_t count = 0;
+ struct bfd_elf_version_expr *e, *next;
+ struct bfd_elf_version_expr **list_loc, **remaining_loc;
+
+ for (e = head->list; e; e = e->next)
+ {
+ if (e->symbol)
+ count++;
+ head->mask |= e->mask;
+ }
+
+ if (count)
+ {
+ head->htab = htab_create (count * 2, version_expr_head_hash,
+ version_expr_head_eq, NULL);
+ list_loc = &head->list;
+ remaining_loc = &head->remaining;
+ for (e = head->list; e; e = next)
+ {
+ next = e->next;
+ if (!e->symbol)
+ {
+ *remaining_loc = e;
+ remaining_loc = &e->next;
+ }
+ else
+ {
+ void **loc = htab_find_slot (head->htab, e, INSERT);
+
+ if (*loc)
+ {
+ struct bfd_elf_version_expr *e1, *last;
+
+ e1 = *loc;
+ last = NULL;
+ do
+ {
+ if (e1->mask == e->mask)
+ {
+ last = NULL;
+ break;
+ }
+ last = e1;
+ e1 = e1->next;
+ }
+ while (e1 && strcmp (e1->symbol, e->symbol) == 0);
+
+ if (last == NULL)
+ {
+ /* This is a duplicate. */
+ /* FIXME: Memory leak. Sometimes pattern is not
+ xmalloced alone, but in larger chunk of memory. */
+ /* free (e->symbol); */
+ free (e);
+ }
+ else
+ {
+ e->next = last->next;
+ last->next = e;
+ }
+ }
+ else
+ {
+ *loc = e;
+ *list_loc = e;
+ list_loc = &e->next;
+ }
+ }
+ }
+ *remaining_loc = NULL;
+ *list_loc = head->remaining;
+ }
+ else
+ head->remaining = head->list;
+}
+
/* This is called when we know the name and dependencies of the
version. */
void
-lang_register_vers_node (name, version, deps)
- const char *name;
- struct bfd_elf_version_tree *version;
- struct bfd_elf_version_deps *deps;
+lang_register_vers_node (const char *name,
+ struct bfd_elf_version_tree *version,
+ struct bfd_elf_version_deps *deps)
{
struct bfd_elf_version_tree *t, **pp;
struct bfd_elf_version_expr *e1;
@@ -5200,6 +5311,7 @@ lang_register_vers_node (name, version, deps)
|| (lang_elf_version_info && lang_elf_version_info->name[0] == '\0'))
{
einfo (_("%X%P: anonymous version tag cannot be combined with other version tags\n"));
+ free (version);
return;
}
@@ -5208,32 +5320,59 @@ lang_register_vers_node (name, version, deps)
if (strcmp (t->name, name) == 0)
einfo (_("%X%P: duplicate version tag `%s'\n"), name);
+ lang_finalize_version_expr_head (&version->globals);
+ lang_finalize_version_expr_head (&version->locals);
+
/* Check the global and local match names, and make sure there
aren't any duplicates. */
- for (e1 = version->globals; e1 != NULL; e1 = e1->next)
+ for (e1 = version->globals.list; e1 != NULL; e1 = e1->next)
{
for (t = lang_elf_version_info; t != NULL; t = t->next)
{
struct bfd_elf_version_expr *e2;
- for (e2 = t->locals; e2 != NULL; e2 = e2->next)
- if (strcmp (e1->pattern, e2->pattern) == 0)
- einfo (_("%X%P: duplicate expression `%s' in version information\n"),
- e1->pattern);
+ if (t->locals.htab && e1->symbol)
+ {
+ e2 = htab_find (t->locals.htab, e1);
+ while (e2 && strcmp (e1->symbol, e2->symbol) == 0)
+ {
+ if (e1->mask == e2->mask)
+ einfo (_("%X%P: duplicate expression `%s' in version information\n"),
+ e1->symbol);
+ e2 = e2->next;
+ }
+ }
+ else if (!e1->symbol)
+ for (e2 = t->locals.remaining; e2 != NULL; e2 = e2->next)
+ if (strcmp (e1->pattern, e2->pattern) == 0 && e1->mask == e2->mask)
+ einfo (_("%X%P: duplicate expression `%s' in version information\n"),
+ e1->pattern);
}
}
- for (e1 = version->locals; e1 != NULL; e1 = e1->next)
+ for (e1 = version->locals.list; e1 != NULL; e1 = e1->next)
{
for (t = lang_elf_version_info; t != NULL; t = t->next)
{
struct bfd_elf_version_expr *e2;
- for (e2 = t->globals; e2 != NULL; e2 = e2->next)
- if (strcmp (e1->pattern, e2->pattern) == 0)
- einfo (_("%X%P: duplicate expression `%s' in version information\n"),
- e1->pattern);
+ if (t->globals.htab && e1->symbol)
+ {
+ e2 = htab_find (t->globals.htab, e1);
+ while (e2 && strcmp (e1->symbol, e2->symbol) == 0)
+ {
+ if (e1->mask == e2->mask)
+ einfo (_("%X%P: duplicate expression `%s' in version information\n"),
+ e1->symbol);
+ e2 = e2->next;
+ }
+ }
+ else if (!e1->symbol)
+ for (e2 = t->globals.remaining; e2 != NULL; e2 = e2->next)
+ if (strcmp (e1->pattern, e2->pattern) == 0 && e1->mask == e2->mask)
+ einfo (_("%X%P: duplicate expression `%s' in version information\n"),
+ e1->pattern);
}
}
@@ -5255,14 +5394,12 @@ lang_register_vers_node (name, version, deps)
/* This is called when we see a version dependency. */
struct bfd_elf_version_deps *
-lang_add_vers_depend (list, name)
- struct bfd_elf_version_deps *list;
- const char *name;
+lang_add_vers_depend (struct bfd_elf_version_deps *list, const char *name)
{
struct bfd_elf_version_deps *ret;
struct bfd_elf_version_tree *t;
- ret = (struct bfd_elf_version_deps *) xmalloc (sizeof *ret);
+ ret = xmalloc (sizeof *ret);
ret->next = list;
for (t = lang_elf_version_info; t != NULL; t = t->next)
@@ -5280,7 +5417,7 @@ lang_add_vers_depend (list, name)
}
static void
-lang_do_version_exports_section ()
+lang_do_version_exports_section (void)
{
struct bfd_elf_version_expr *greg = NULL, *lreg;
@@ -5318,8 +5455,7 @@ lang_do_version_exports_section ()
}
void
-lang_add_unique (name)
- const char *name;
+lang_add_unique (const char *name)
{
struct unique_sections *ent;
@@ -5327,7 +5463,7 @@ lang_add_unique (name)
if (strcmp (ent->name, name) == 0)
return;
- ent = (struct unique_sections *) xmalloc (sizeof *ent);
+ ent = xmalloc (sizeof *ent);
ent->name = xstrdup (name);
ent->next = unique_section_list;
unique_section_list = ent;
diff --git a/contrib/binutils/ld/ldlang.h b/contrib/binutils/ld/ldlang.h
index 57c8c51..649fea1 100644
--- a/contrib/binutils/ld/ldlang.h
+++ b/contrib/binutils/ld/ldlang.h
@@ -1,6 +1,6 @@
/* ldlang.h - linker command language support
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002
+ 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -23,7 +23,10 @@
#ifndef LDLANG_H
#define LDLANG_H
-typedef enum {
+#define DEFAULT_MEMORY_REGION "*default*"
+
+typedef enum
+{
lang_input_file_is_l_enum,
lang_input_file_is_symbols_only_enum,
lang_input_file_is_marker_enum,
@@ -32,17 +35,20 @@ typedef enum {
lang_input_file_is_file_enum
} lang_input_file_enum_type;
-struct _fill_type {
+struct _fill_type
+{
size_t size;
unsigned char data[1];
};
-typedef struct statement_list {
+typedef struct statement_list
+{
union lang_statement_union *head;
union lang_statement_union **tail;
} lang_statement_list_type;
-typedef struct memory_region_struct {
+typedef struct memory_region_struct
+{
char *name;
struct memory_region_struct *next;
bfd_vma origin;
@@ -51,12 +57,14 @@ typedef struct memory_region_struct {
bfd_size_type old_length;
flagword flags;
flagword not_flags;
- boolean had_full_message;
+ bfd_boolean had_full_message;
} lang_memory_region_type;
-typedef struct lang_statement_header_struct {
+typedef struct lang_statement_header_struct
+{
union lang_statement_union *next;
- enum statement_enum {
+ enum statement_enum
+ {
lang_output_section_statement_enum,
lang_assignment_statement_enum,
lang_input_statement_enum,
@@ -77,24 +85,28 @@ typedef struct lang_statement_header_struct {
} type;
} lang_statement_header_type;
-typedef struct {
+typedef struct
+{
lang_statement_header_type header;
union etree_union *exp;
} lang_assignment_statement_type;
-typedef struct lang_target_statement_struct {
+typedef struct lang_target_statement_struct
+{
lang_statement_header_type header;
const char *target;
} lang_target_statement_type;
-typedef struct lang_output_statement_struct {
+typedef struct lang_output_statement_struct
+{
lang_statement_header_type header;
const char *name;
} lang_output_statement_type;
/* Section types specified in a linker script. */
-enum section_type {
+enum section_type
+{
normal_section,
dsect_section,
copy_section,
@@ -103,16 +115,18 @@ enum section_type {
overlay_section
};
-/* This structure holds a list of program headers describing segments
- in which this section should be placed. */
+/* This structure holds a list of program headers describing
+ segments in which this section should be placed. */
-struct lang_output_section_phdr_list {
+typedef struct lang_output_section_phdr_list
+{
struct lang_output_section_phdr_list *next;
const char *name;
- boolean used;
-};
+ bfd_boolean used;
+} lang_output_section_phdr_list;
-typedef struct lang_output_section_statement_struct {
+typedef struct lang_output_section_statement_struct
+{
lang_statement_header_type header;
union etree_union *addr_tree;
lang_statement_list_type children;
@@ -120,18 +134,18 @@ typedef struct lang_output_section_statement_struct {
union lang_statement_union *next;
const char *name;
- boolean processed;
+ int processed;
asection *bfd_section;
- flagword flags; /* Or together of all input sections */
+ flagword flags; /* Or together of all input sections. */
enum section_type sectype;
- struct memory_region_struct *region;
- struct memory_region_struct *lma_region;
+ lang_memory_region_type *region;
+ lang_memory_region_type *lma_region;
size_t block_value;
fill_type *fill;
- int subsection_alignment; /* alignment of components */
- int section_alignment; /* alignment of start of section */
+ int subsection_alignment; /* Alignment of components. */
+ int section_alignment; /* Alignment of start of section. */
union etree_union *load_base;
@@ -141,25 +155,29 @@ typedef struct lang_output_section_statement_struct {
to move '.' past all the overlaid sections. */
union etree_union *update_dot_tree;
- struct lang_output_section_phdr_list *phdrs;
+ lang_output_section_phdr_list *phdrs;
} lang_output_section_statement_type;
-typedef struct {
+typedef struct
+{
lang_statement_header_type header;
} lang_common_statement_type;
-typedef struct {
+typedef struct
+{
lang_statement_header_type header;
} lang_object_symbols_statement_type;
-typedef struct {
+typedef struct
+{
lang_statement_header_type header;
fill_type *fill;
int size;
asection *output_section;
} lang_fill_statement_type;
-typedef struct {
+typedef struct
+{
lang_statement_header_type header;
unsigned int type;
union etree_union *exp;
@@ -170,7 +188,8 @@ typedef struct {
/* Generate a reloc in the output file. */
-typedef struct {
+typedef struct
+{
lang_statement_header_type header;
/* Reloc to generate. */
@@ -179,12 +198,12 @@ typedef struct {
/* Reloc howto structure. */
reloc_howto_type *howto;
- /* Section to generate reloc against. Exactly one of section and
- name must be NULL. */
+ /* Section to generate reloc against.
+ Exactly one of section and name must be NULL. */
asection *section;
- /* Name of symbol to generate reloc against. Exactly one of section
- and name must be NULL. */
+ /* Name of symbol to generate reloc against.
+ Exactly one of section and name must be NULL. */
const char *name;
/* Expression for addend. */
@@ -200,18 +219,19 @@ typedef struct {
bfd_vma output_vma;
} lang_reloc_statement_type;
-typedef struct lang_input_statement_struct {
+typedef struct lang_input_statement_struct
+{
lang_statement_header_type header;
/* Name of this file. */
const char *filename;
- /* Name to use for the symbol giving address of text start */
- /* Usually the same as filename, but for a file spec'd with -l
- this is the -l switch itself rather than the filename. */
+ /* Name to use for the symbol giving address of text start.
+ Usually the same as filename, but for a file spec'd with
+ -l this is the -l switch itself rather than the filename. */
const char *local_sym_name;
bfd *the_bfd;
- boolean closed;
+ bfd_boolean closed;
file_ptr passive_position;
/* Symbol table of the file. */
@@ -220,66 +240,80 @@ typedef struct lang_input_statement_struct {
/* Point to the next file - whatever it is, wanders up and down
archives */
-
union lang_statement_union *next;
- /* Point to the next file, but skips archive contents */
+
+ /* Point to the next file, but skips archive contents. */
union lang_statement_union *next_real_file;
- boolean is_archive;
+ bfd_boolean is_archive;
/* 1 means search a set of directories for this file. */
- boolean search_dirs_flag;
+ bfd_boolean search_dirs_flag;
+
+ /* 1 means this was found in a search directory marked as sysrooted,
+ if search_dirs_flag is false, otherwise, that it should be
+ searched in ld_sysroot before any other location, as long as it
+ starts with a slash. */
+ bfd_boolean sysrooted;
/* 1 means this is base file of incremental load.
Do not load this file's text or data.
Also default text_start to after this file's bss. */
-
- boolean just_syms_flag;
+ bfd_boolean just_syms_flag;
/* Whether to search for this entry as a dynamic archive. */
- boolean dynamic;
+ bfd_boolean dynamic;
+
+ /* Whether this entry should cause a DT_NEEDED tag only when
+ satisfying references from regular files, or always. */
+ bfd_boolean as_needed;
/* Whether to include the entire contents of an archive. */
- boolean whole_archive;
+ bfd_boolean whole_archive;
- boolean loaded;
+ bfd_boolean loaded;
#if 0
unsigned int globals_in_this_file;
#endif
const char *target;
- boolean real;
+ bfd_boolean real;
} lang_input_statement_type;
-typedef struct {
+typedef struct
+{
lang_statement_header_type header;
asection *section;
lang_input_statement_type *ifile;
} lang_input_section_type;
-typedef struct {
+typedef struct
+{
lang_statement_header_type header;
asection *section;
union lang_statement_union *file;
} lang_afile_asection_pair_statement_type;
-typedef struct lang_wild_statement_struct {
+typedef struct lang_wild_statement_struct
+{
lang_statement_header_type header;
const char *filename;
- boolean filenames_sorted;
+ bfd_boolean filenames_sorted;
struct wildcard_list *section_list;
- boolean keep_sections;
+ bfd_boolean keep_sections;
lang_statement_list_type children;
} lang_wild_statement_type;
-typedef struct lang_address_statement_struct {
+typedef struct lang_address_statement_struct
+{
lang_statement_header_type header;
const char *section_name;
union etree_union *address;
} lang_address_statement_type;
-typedef struct {
+typedef struct
+{
lang_statement_header_type header;
bfd_vma output_offset;
size_t size;
@@ -292,12 +326,14 @@ typedef struct {
symbols are found. The effect is to search a group of libraries as
though they were a single library. */
-typedef struct {
+typedef struct
+{
lang_statement_header_type header;
lang_statement_list_type children;
} lang_group_statement_type;
-typedef union lang_statement_union {
+typedef union lang_statement_union
+{
lang_statement_header_type header;
lang_wild_statement_type wild_statement;
lang_data_statement_type data_statement;
@@ -320,12 +356,13 @@ typedef union lang_statement_union {
/* This structure holds information about a program header, from the
PHDRS command in the linker script. */
-struct lang_phdr {
+struct lang_phdr
+{
struct lang_phdr *next;
const char *name;
unsigned long type;
- boolean filehdr;
- boolean phdrs;
+ bfd_boolean filehdr;
+ bfd_boolean phdrs;
etree_type *at;
etree_type *flags;
};
@@ -333,16 +370,18 @@ struct lang_phdr {
/* This structure is used to hold a list of sections which may not
cross reference each other. */
-struct lang_nocrossref {
+typedef struct lang_nocrossref
+{
struct lang_nocrossref *next;
const char *name;
-};
+} lang_nocrossref_type;
/* The list of nocrossref lists. */
-struct lang_nocrossrefs {
+struct lang_nocrossrefs
+{
struct lang_nocrossrefs *next;
- struct lang_nocrossref *list;
+ lang_nocrossref_type *list;
};
extern struct lang_nocrossrefs *nocrossref_list;
@@ -350,139 +389,181 @@ extern struct lang_nocrossrefs *nocrossref_list;
/* This structure is used to hold a list of input section names which
will not match an output section in the linker script. */
-struct unique_sections {
+struct unique_sections
+{
struct unique_sections *next;
const char *name;
};
+/* This structure records symbols for which we need to keep track of
+ definedness for use in the DEFINED () test. */
+
+struct lang_definedness_hash_entry
+{
+ struct bfd_hash_entry root;
+ int iteration;
+};
+
extern struct unique_sections *unique_section_list;
extern lang_output_section_statement_type *abs_output_section;
extern lang_statement_list_type lang_output_section_statement;
-extern boolean lang_has_input_file;
+extern bfd_boolean lang_has_input_file;
extern etree_type *base;
extern lang_statement_list_type *stat_ptr;
-extern boolean delete_output_file_on_failure;
+extern bfd_boolean delete_output_file_on_failure;
extern struct bfd_sym_chain entry_symbol;
extern const char *entry_section;
-extern boolean entry_from_cmdline;
+extern bfd_boolean entry_from_cmdline;
extern lang_statement_list_type file_chain;
-extern void lang_init PARAMS ((void));
-extern struct memory_region_struct *lang_memory_region_lookup
- PARAMS ((const char *const));
-extern struct memory_region_struct *lang_memory_region_default
- PARAMS ((asection *));
-extern void lang_map PARAMS ((void));
-extern void lang_set_flags PARAMS ((lang_memory_region_type *, const char *,
- int));
-extern void lang_add_output PARAMS ((const char *, int from_script));
+extern int lang_statement_iteration;
+
+extern void lang_init
+ (void);
+extern lang_memory_region_type *lang_memory_region_lookup
+ (const char *const, bfd_boolean);
+extern lang_memory_region_type *lang_memory_region_default
+ (asection *);
+extern void lang_map
+ (void);
+extern void lang_set_flags
+ (lang_memory_region_type *, const char *, int);
+extern void lang_add_output
+ (const char *, int from_script);
extern lang_output_section_statement_type *lang_enter_output_section_statement
- PARAMS ((const char *output_section_statement_name,
- etree_type * address_exp,
- enum section_type sectype,
- bfd_vma block_value,
- etree_type *align,
- etree_type *subalign,
- etree_type *));
-extern void lang_final PARAMS ((void));
-extern void lang_process PARAMS ((void));
-extern void lang_section_start PARAMS ((const char *, union etree_union *));
-extern void lang_add_entry PARAMS ((const char *, boolean));
-extern void lang_add_target PARAMS ((const char *));
+ (const char *output_section_statement_name,
+ etree_type *address_exp,
+ enum section_type sectype,
+ etree_type *align,
+ etree_type *subalign,
+ etree_type *);
+extern void lang_final
+ (void);
+extern void lang_process
+ (void);
+extern void lang_section_start
+ (const char *, union etree_union *);
+extern void lang_add_entry
+ (const char *, bfd_boolean);
+extern void lang_add_target
+ (const char *);
extern void lang_add_wild
- PARAMS ((struct wildcard_spec *, struct wildcard_list *, boolean));
-extern void lang_add_map PARAMS ((const char *));
-extern void lang_add_fill PARAMS ((fill_type *));
-extern lang_assignment_statement_type * lang_add_assignment PARAMS ((union etree_union *));
-extern void lang_add_attribute PARAMS ((enum statement_enum));
-extern void lang_startup PARAMS ((const char *));
-extern void lang_float PARAMS ((enum bfd_boolean));
+ (struct wildcard_spec *, struct wildcard_list *, bfd_boolean);
+extern void lang_add_map
+ (const char *);
+extern void lang_add_fill
+ (fill_type *);
+extern lang_assignment_statement_type *lang_add_assignment
+ (union etree_union *);
+extern void lang_add_attribute
+ (enum statement_enum);
+extern void lang_startup
+ (const char *);
+extern void lang_float
+ (bfd_boolean);
extern void lang_leave_output_section_statement
- PARAMS ((fill_type *, const char *, struct lang_output_section_phdr_list *,
- const char *));
-extern void lang_abs_symbol_at_end_of PARAMS ((const char *, const char *));
-extern void lang_abs_symbol_at_beginning_of PARAMS ((const char *,
- const char *));
-extern void lang_statement_append PARAMS ((struct statement_list *,
- union lang_statement_union *,
- union lang_statement_union **));
+ (fill_type *, const char *, lang_output_section_phdr_list *,
+ const char *);
+extern void lang_abs_symbol_at_end_of
+ (const char *, const char *);
+extern void lang_abs_symbol_at_beginning_of
+ (const char *, const char *);
+extern void lang_statement_append
+ (lang_statement_list_type *, lang_statement_union_type *,
+ lang_statement_union_type **);
extern void lang_for_each_input_file
- PARAMS ((void (*dothis) (lang_input_statement_type *)));
+ (void (*dothis) (lang_input_statement_type *));
extern void lang_for_each_file
- PARAMS ((void (*dothis) (lang_input_statement_type *)));
-extern void lang_reset_memory_regions PARAMS ((void));
-extern bfd_vma lang_do_assignments
- PARAMS ((lang_statement_union_type * s,
- lang_output_section_statement_type *output_section_statement,
- fill_type *fill,
- bfd_vma dot));
-
-#define LANG_FOR_EACH_INPUT_STATEMENT(statement) \
- lang_input_statement_type *statement; \
- for (statement = (lang_input_statement_type *)file_chain.head;\
- statement != (lang_input_statement_type *)NULL; \
- statement = (lang_input_statement_type *)statement->next)\
-
-extern void lang_process PARAMS ((void));
-extern void ldlang_add_file PARAMS ((lang_input_statement_type *));
+ (void (*dothis) (lang_input_statement_type *));
+extern void lang_reset_memory_regions
+ (void);
+extern void lang_do_assignments
+ (lang_statement_union_type *, lang_output_section_statement_type *,
+ fill_type *, bfd_vma);
+
+#define LANG_FOR_EACH_INPUT_STATEMENT(statement) \
+ lang_input_statement_type *statement; \
+ for (statement = (lang_input_statement_type *) file_chain.head; \
+ statement != (lang_input_statement_type *) NULL; \
+ statement = (lang_input_statement_type *) statement->next) \
+
+extern void lang_process
+ (void);
+extern void ldlang_add_file
+ (lang_input_statement_type *);
extern lang_output_section_statement_type *lang_output_section_find
- PARAMS ((const char * const));
+ (const char * const);
extern lang_input_statement_type *lang_add_input_file
- PARAMS ((const char *name, lang_input_file_enum_type file_type,
- const char *target));
-extern void lang_add_keepsyms_file PARAMS ((const char *filename));
+ (const char *, lang_input_file_enum_type, const char *);
+extern void lang_add_keepsyms_file
+ (const char *);
extern lang_output_section_statement_type *
- lang_output_section_statement_lookup PARAMS ((const char * const name));
-extern void ldlang_add_undef PARAMS ((const char *const name));
-extern void lang_add_output_format PARAMS ((const char *, const char *,
- const char *, int from_script));
-extern void lang_list_init PARAMS ((lang_statement_list_type*));
-extern void lang_add_data PARAMS ((int type, union etree_union *));
+ lang_output_section_statement_lookup
+ (const char *const);
+extern void ldlang_add_undef
+ (const char *const);
+extern void lang_add_output_format
+ (const char *, const char *, const char *, int);
+extern void lang_list_init
+ (lang_statement_list_type *);
+extern void lang_add_data
+ (int type, union etree_union *);
extern void lang_add_reloc
- PARAMS ((bfd_reloc_code_real_type reloc, reloc_howto_type *howto,
- asection *section, const char *name, union etree_union *addend));
+ (bfd_reloc_code_real_type, reloc_howto_type *, asection *, const char *,
+ union etree_union *);
extern void lang_for_each_statement
- PARAMS ((void (*func) (lang_statement_union_type *)));
-extern PTR stat_alloc PARAMS ((size_t size));
-extern void dprint_statement PARAMS ((lang_statement_union_type *, int));
+ (void (*) (lang_statement_union_type *));
+extern void *stat_alloc
+ (size_t);
+extern void dprint_statement
+ (lang_statement_union_type *, int);
extern bfd_vma lang_size_sections
- PARAMS ((lang_statement_union_type *s,
- lang_output_section_statement_type *output_section_statement,
- lang_statement_union_type **prev, fill_type *fill,
- bfd_vma dot, boolean *relax));
-extern void lang_enter_group PARAMS ((void));
-extern void lang_leave_group PARAMS ((void));
+ (lang_statement_union_type *, lang_output_section_statement_type *,
+ lang_statement_union_type **, fill_type *, bfd_vma, bfd_boolean *,
+ bfd_boolean);
+extern void lang_enter_group
+ (void);
+extern void lang_leave_group
+ (void);
extern void lang_add_section
- PARAMS ((lang_statement_list_type *ptr, asection *section,
- lang_output_section_statement_type *output,
- lang_input_statement_type *file));
+ (lang_statement_list_type *, asection *,
+ lang_output_section_statement_type *, lang_input_statement_type *);
extern void lang_new_phdr
- PARAMS ((const char *, etree_type *, boolean, boolean, etree_type *,
- etree_type *));
-extern void lang_add_nocrossref PARAMS ((struct lang_nocrossref *));
-extern void lang_enter_overlay PARAMS ((etree_type *));
-extern void lang_enter_overlay_section PARAMS ((const char *));
+ (const char *, etree_type *, bfd_boolean, bfd_boolean, etree_type *,
+ etree_type *);
+extern void lang_add_nocrossref
+ (lang_nocrossref_type *);
+extern void lang_enter_overlay
+ (etree_type *, etree_type *);
+extern void lang_enter_overlay_section
+ (const char *);
extern void lang_leave_overlay_section
- PARAMS ((fill_type *, struct lang_output_section_phdr_list *));
+ (fill_type *, lang_output_section_phdr_list *);
extern void lang_leave_overlay
- PARAMS ((etree_type *, int, fill_type *, const char *,
- struct lang_output_section_phdr_list *, const char *));
+ (etree_type *, int, fill_type *, const char *,
+ lang_output_section_phdr_list *, const char *);
extern struct bfd_elf_version_tree *lang_elf_version_info;
extern struct bfd_elf_version_expr *lang_new_vers_pattern
- PARAMS ((struct bfd_elf_version_expr *, const char *, const char *));
+ (struct bfd_elf_version_expr *, const char *, const char *);
extern struct bfd_elf_version_tree *lang_new_vers_node
- PARAMS ((struct bfd_elf_version_expr *, struct bfd_elf_version_expr *));
+ (struct bfd_elf_version_expr *, struct bfd_elf_version_expr *);
extern struct bfd_elf_version_deps *lang_add_vers_depend
- PARAMS ((struct bfd_elf_version_deps *, const char *));
+ (struct bfd_elf_version_deps *, const char *);
extern void lang_register_vers_node
- PARAMS ((const char *, struct bfd_elf_version_tree *,
- struct bfd_elf_version_deps *));
-boolean unique_section_p PARAMS ((const char *));
-extern void lang_add_unique PARAMS ((const char *));
-extern const char *lang_get_output_target PARAMS ((void));
+ (const char *, struct bfd_elf_version_tree *, struct bfd_elf_version_deps *);
+bfd_boolean unique_section_p
+ (const char *);
+extern void lang_add_unique
+ (const char *);
+extern const char *lang_get_output_target
+ (void);
+extern void lang_track_definedness (const char *);
+extern int lang_symbol_definition_iteration (const char *);
+extern void lang_update_definedness
+ (const char *, struct bfd_link_hash_entry *);
#endif
diff --git a/contrib/binutils/ld/ldlex.h b/contrib/binutils/ld/ldlex.h
index 36f2ad3..f956e9c 100644
--- a/contrib/binutils/ld/ldlex.h
+++ b/contrib/binutils/ld/ldlex.h
@@ -1,5 +1,5 @@
/* ldlex.h -
- Copyright 1991, 1992, 1993, 1994, 1995, 1997, 2000
+ Copyright 1991, 1992, 1993, 1994, 1995, 1997, 2000, 2003
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -39,25 +39,25 @@ extern unsigned int lineno;
extern const char *lex_string;
/* In ldlex.l. */
-extern int yylex PARAMS ((void));
-extern void lex_push_file PARAMS ((FILE *, const char *));
-extern void lex_redirect PARAMS ((const char *));
-extern void ldlex_script PARAMS ((void));
-extern void ldlex_mri_script PARAMS ((void));
-extern void ldlex_version_script PARAMS ((void));
-extern void ldlex_version_file PARAMS ((void));
-extern void ldlex_defsym PARAMS ((void));
-extern void ldlex_expression PARAMS ((void));
-extern void ldlex_both PARAMS ((void));
-extern void ldlex_command PARAMS ((void));
-extern void ldlex_popstate PARAMS ((void));
+extern int yylex (void);
+extern void lex_push_file (FILE *, const char *);
+extern void lex_redirect (const char *);
+extern void ldlex_script (void);
+extern void ldlex_mri_script (void);
+extern void ldlex_version_script (void);
+extern void ldlex_version_file (void);
+extern void ldlex_defsym (void);
+extern void ldlex_expression (void);
+extern void ldlex_both (void);
+extern void ldlex_command (void);
+extern void ldlex_popstate (void);
/* In lexsup.c. */
-extern int lex_input PARAMS ((void));
-extern void lex_unput PARAMS ((int));
+extern int lex_input (void);
+extern void lex_unput (int);
#ifndef yywrap
-extern int yywrap PARAMS ((void));
+extern int yywrap (void);
#endif
-extern void parse_args PARAMS ((unsigned, char **));
+extern void parse_args (unsigned, char **);
#endif
diff --git a/contrib/binutils/ld/ldlex.l b/contrib/binutils/ld/ldlex.l
index 5b799c4..aeac817 100644
--- a/contrib/binutils/ld/ldlex.l
+++ b/contrib/binutils/ld/ldlex.l
@@ -1,7 +1,7 @@
%{
/* Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -26,7 +26,6 @@ This was written by steve chamberlain
*/
-#include "ansidecl.h"
#include <stdio.h>
#ifdef MPW
@@ -69,7 +68,7 @@ const char *lex_string = NULL;
Otherwise, stack elements 0 through `include_stack_ptr - 1' are valid. */
#undef YY_INPUT
-#define YY_INPUT(buf,result,max_size) yy_input(buf, &result, max_size)
+#define YY_INPUT(buf,result,max_size) yy_input (buf, &result, max_size)
#define MAX_INCLUDE_DEPTH 10
static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
@@ -78,14 +77,11 @@ static unsigned int lineno_stack[MAX_INCLUDE_DEPTH];
static unsigned int include_stack_ptr = 0;
static int vers_node_nesting = 0;
-static YY_BUFFER_STATE yy_create_string_buffer PARAMS ((const char *string,
- size_t size));
-static void yy_input PARAMS ((char *, int *result, int max_size));
+static void yy_input (char *, int *, int);
+static void comment (void);
+static void lex_warn_invalid (char *where, char *what);
-static void comment PARAMS ((void));
-static void lex_warn_invalid PARAMS ((char *where, char *what));
-
-/* STATES
+/* STATES
EXPRESSION definitely in an expression
SCRIPT definitely in a script
BOTH either EXPRESSION or SCRIPT
@@ -99,7 +95,7 @@ static void lex_warn_invalid PARAMS ((char *where, char *what));
/* Some versions of flex want this. */
#ifndef yywrap
-int yywrap () { return 1; }
+int yywrap (void) { return 1; }
#endif
%}
@@ -112,12 +108,12 @@ FILENAMECHAR1 [_a-zA-Z\/\.\\\$\_\~]
SYMBOLCHARN [_a-zA-Z\/\.\\\$\_\~0-9]
FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~]
WILDCHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~\?\*]
-WHITE [ \t\n\r]+
+WHITE [ \t\n\r]+
NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]
V_TAG [.$_a-zA-Z][._a-zA-Z0-9]*
-V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)*
+V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
%s SCRIPT
%s EXPRESSION
@@ -144,24 +140,24 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)*
}
}
-<BOTH,SCRIPT,EXPRESSION>"/*" { comment(); }
+<BOTH,SCRIPT,EXPRESSION,VERS_START,VERS_NODE,VERS_SCRIPT>"/*" { comment (); }
<DEFSYMEXP>"-" { RTOKEN('-');}
<DEFSYMEXP>"+" { RTOKEN('+');}
-<DEFSYMEXP>{FILENAMECHAR1}{SYMBOLCHARN}* { yylval.name = xstrdup(yytext); return NAME; }
+<DEFSYMEXP>{FILENAMECHAR1}{SYMBOLCHARN}* { yylval.name = xstrdup (yytext); return NAME; }
<DEFSYMEXP>"=" { RTOKEN('='); }
<MRI,EXPRESSION>"$"([0-9A-Fa-f])+ {
- yylval.integer = bfd_scan_vma (yytext+1, 0,16);
- yylval.bigint.str = (char *) 0;
+ yylval.integer = bfd_scan_vma (yytext + 1, 0, 16);
+ yylval.bigint.str = NULL;
return INT;
}
<MRI,EXPRESSION>([0-9A-Fa-f])+(H|h|X|x|B|b|O|o|D|d) {
int ibase ;
- switch (yytext[yyleng-1]) {
- case 'X':
+ switch (yytext[yyleng - 1]) {
+ case 'X':
case 'x':
case 'H':
case 'h':
@@ -180,7 +176,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)*
}
yylval.integer = bfd_scan_vma (yytext, 0,
ibase);
- yylval.bigint.str = (char *) 0;
+ yylval.bigint.str = NULL;
return INT;
}
<SCRIPT,DEFSYMEXP,MRI,BOTH,EXPRESSION>((("$"|0[xX])([0-9A-Fa-f])+)|(([0-9])+))(M|K|m|k)? {
@@ -193,14 +189,14 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)*
ibase = 16;
}
yylval.integer = bfd_scan_vma (s, 0, ibase);
- yylval.bigint.str = (char *) 0;
- if (yytext[yyleng-1] == 'M'
- || yytext[yyleng-1] == 'm')
+ yylval.bigint.str = NULL;
+ if (yytext[yyleng - 1] == 'M'
+ || yytext[yyleng - 1] == 'm')
{
yylval.integer *= 1024 * 1024;
}
- else if (yytext[yyleng-1] == 'K'
- || yytext[yyleng-1]=='k')
+ else if (yytext[yyleng - 1] == 'K'
+ || yytext[yyleng - 1]=='k')
{
yylval.integer *= 1024;
}
@@ -310,6 +306,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)*
<BOTH,SCRIPT>"INCLUDE" { RTOKEN(INCLUDE);}
<BOTH,SCRIPT>"PHDRS" { RTOKEN (PHDRS); }
<EXPRESSION,BOTH,SCRIPT>"AT" { RTOKEN(AT);}
+<EXPRESSION,BOTH,SCRIPT>"SUBALIGN" { RTOKEN(SUBALIGN);}
<EXPRESSION,BOTH,SCRIPT>"PROVIDE" { RTOKEN(PROVIDE); }
<EXPRESSION,BOTH,SCRIPT>"KEEP" { RTOKEN(KEEP); }
<EXPRESSION,BOTH,SCRIPT>"EXCLUDE_FILE" { RTOKEN(EXCLUDE_FILE); }
@@ -355,13 +352,13 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)*
<MRI>{FILENAMECHAR1}{NOCFILENAMECHAR}* {
/* Filename without commas, needed to parse mri stuff */
- yylval.name = xstrdup(yytext);
+ yylval.name = xstrdup (yytext);
return NAME;
}
<BOTH,EXPRESSION>{FILENAMECHAR1}{FILENAMECHAR}* {
- yylval.name = xstrdup(yytext);
+ yylval.name = xstrdup (yytext);
return NAME;
}
<BOTH,EXPRESSION>"-l"{FILENAMECHAR}+ {
@@ -375,12 +372,12 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)*
try again. */
if (yytext[0] == '/' && yytext[1] == '*')
{
- yyless(2);
+ yyless (2);
comment ();
}
else
{
- yylval.name = xstrdup(yytext);
+ yylval.name = xstrdup (yytext);
return NAME;
}
}
@@ -388,8 +385,8 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)*
<EXPRESSION,BOTH,SCRIPT,VERS_NODE>"\""[^\"]*"\"" {
/* No matter the state, quotes
give what's inside */
- yylval.name = xstrdup(yytext+1);
- yylval.name[yyleng-2] = 0;
+ yylval.name = xstrdup (yytext + 1);
+ yylval.name[yyleng - 2] = 0;
return NAME;
}
<BOTH,SCRIPT,EXPRESSION>"\n" { lineno++;}
@@ -411,7 +408,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)*
<VERS_START>"{" { BEGIN(VERS_SCRIPT); return *yytext; }
-<VERS_SCRIPT>"{" { BEGIN(VERS_NODE);
+<VERS_SCRIPT>"{" { BEGIN(VERS_NODE);
vers_node_nesting = 0;
return *yytext;
}
@@ -430,14 +427,14 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)*
<<EOF>> {
include_stack_ptr--;
-
- if (include_stack_ptr == 0)
+
+ if (include_stack_ptr == 0)
{
- yyterminate();
+ yyterminate ();
}
- else
+ else
{
- yy_switch_to_buffer(include_stack[include_stack_ptr]);
+ yy_switch_to_buffer (include_stack[include_stack_ptr]);
}
ldfile_input_filename = file_name_stack[include_stack_ptr - 1];
@@ -446,9 +443,9 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)*
return END;
}
-<SCRIPT,MRI,VERS_START,VERS_SCRIPT,VERS_NODE>. lex_warn_invalid(" in script", yytext);
-<EXPRESSION,DEFSYMEXP,BOTH>. lex_warn_invalid(" in expression", yytext);
-
+<SCRIPT,MRI,VERS_START,VERS_SCRIPT,VERS_NODE>. lex_warn_invalid (" in script", yytext);
+<EXPRESSION,DEFSYMEXP,BOTH>. lex_warn_invalid (" in expression", yytext);
+
%%
@@ -456,13 +453,11 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)*
saving the current input info on the include stack. */
void
-lex_push_file (file, name)
- FILE *file;
- const char *name;
+lex_push_file (FILE *file, const char *name)
{
- if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
+ if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
{
- einfo("%F:includes nested too deeply\n");
+ einfo ("%F:includes nested too deeply\n");
}
file_name_stack[include_stack_ptr] = name;
lineno_stack[include_stack_ptr] = lineno;
@@ -471,27 +466,25 @@ lex_push_file (file, name)
include_stack_ptr++;
lineno = 1;
yyin = file;
- yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
+ yy_switch_to_buffer (yy_create_buffer (yyin, YY_BUF_SIZE));
}
/* Return a newly created flex input buffer containing STRING,
which is SIZE bytes long. */
-static YY_BUFFER_STATE
-yy_create_string_buffer (string, size)
- const char *string;
- size_t size;
+static YY_BUFFER_STATE
+yy_create_string_buffer (const char *string, size_t size)
{
YY_BUFFER_STATE b;
/* Calls to m-alloc get turned by sed into xm-alloc. */
- b = (YY_BUFFER_STATE) malloc (sizeof (struct yy_buffer_state));
+ b = malloc (sizeof (struct yy_buffer_state));
b->yy_input_file = 0;
b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
we need to put in 2 end-of-buffer characters. */
- b->yy_ch_buf = (char *) malloc ((unsigned) (b->yy_buf_size + 3));
+ b->yy_ch_buf = malloc ((unsigned) (b->yy_buf_size + 3));
b->yy_ch_buf[0] = '\n';
strcpy (b->yy_ch_buf+1, string);
@@ -520,13 +513,12 @@ yy_create_string_buffer (string, size)
on the include stack. */
void
-lex_redirect (string)
- const char *string;
+lex_redirect (const char *string)
{
YY_BUFFER_STATE tmp;
yy_init = 0;
- if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
+ if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
{
einfo("%F: macros nested too deeply\n");
}
@@ -546,56 +538,56 @@ static int state_stack[MAX_INCLUDE_DEPTH * 2];
static int *state_stack_p = state_stack;
void
-ldlex_script ()
+ldlex_script (void)
{
*(state_stack_p)++ = yy_start;
BEGIN (SCRIPT);
}
void
-ldlex_mri_script ()
+ldlex_mri_script (void)
{
*(state_stack_p)++ = yy_start;
BEGIN (MRI);
}
void
-ldlex_version_script ()
+ldlex_version_script (void)
{
*(state_stack_p)++ = yy_start;
BEGIN (VERS_START);
}
void
-ldlex_version_file ()
+ldlex_version_file (void)
{
*(state_stack_p)++ = yy_start;
BEGIN (VERS_SCRIPT);
}
void
-ldlex_defsym ()
+ldlex_defsym (void)
{
*(state_stack_p)++ = yy_start;
BEGIN (DEFSYMEXP);
}
-
+
void
-ldlex_expression ()
+ldlex_expression (void)
{
*(state_stack_p)++ = yy_start;
BEGIN (EXPRESSION);
}
void
-ldlex_both ()
+ldlex_both (void)
{
*(state_stack_p)++ = yy_start;
BEGIN (BOTH);
}
void
-ldlex_popstate ()
+ldlex_popstate (void)
{
yy_start = *(--state_stack_p);
}
@@ -605,18 +597,15 @@ ldlex_popstate ()
either the number of characters read, or 0 to indicate EOF. */
static void
-yy_input (buf, result, max_size)
- char *buf;
- int *result;
- int max_size;
+yy_input (char *buf, int *result, int max_size)
{
- *result = 0;
- if (yy_current_buffer->yy_input_file)
+ *result = 0;
+ if (YY_CURRENT_BUFFER->yy_input_file)
{
if (yyin)
{
- *result = fread ((char *) buf, 1, max_size, yyin);
- if (*result < max_size && ferror (yyin))
+ *result = fread (buf, 1, max_size, yyin);
+ if (*result < max_size && ferror (yyin))
einfo ("%F%P: read in flex scanner failed\n");
}
}
@@ -625,14 +614,14 @@ yy_input (buf, result, max_size)
/* Eat the rest of a C-style comment. */
static void
-comment ()
+comment (void)
{
int c;
while (1)
{
c = input();
- while (c != '*' && c != EOF)
+ while (c != '*' && c != EOF)
{
if (c == '\n')
lineno++;
@@ -663,8 +652,7 @@ comment ()
in context WHERE. */
static void
-lex_warn_invalid (where, what)
- char *where, *what;
+lex_warn_invalid (char *where, char *what)
{
char buf[5];
diff --git a/contrib/binutils/ld/ldmain.c b/contrib/binutils/ld/ldmain.c
index 41d778f..d0e0b12 100644
--- a/contrib/binutils/ld/ldmain.c
+++ b/contrib/binutils/ld/ldmain.c
@@ -1,25 +1,25 @@
/* Main program of GNU linker.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002
+ 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
-This file is part of GLD, the Gnu Linker.
+ This file is part of GLD, the Gnu Linker.
-GLD is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+ GLD is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
-GLD is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ GLD is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with GLD; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with GLD; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -42,7 +42,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ldemul.h"
#include "ldctor.h"
-/* Somewhere above, sys/stat.h got included . . . . */
+/* Somewhere above, sys/stat.h got included. */
#if !defined(S_ISDIR) && defined(S_IFDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
@@ -51,14 +51,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifdef HAVE_SBRK
#ifdef NEED_DECLARATION_SBRK
-extern PTR sbrk ();
+extern void *sbrk ();
#endif
#endif
-int main PARAMS ((int, char **));
-
-static char *get_emulation PARAMS ((int, char **));
-static void set_scripts_dir PARAMS ((void));
+#ifndef TARGET_SYSTEM_ROOT
+#define TARGET_SYSTEM_ROOT ""
+#endif
/* EXPORTS */
@@ -68,6 +67,13 @@ const char *output_filename = "a.out";
/* Name this program was invoked by. */
char *program_name;
+/* The prefix for system library directories. */
+char *ld_sysroot;
+
+/* The canonical representation of ld_sysroot. */
+char * ld_canon_sysroot;
+int ld_canon_sysroot_len;
+
/* The file that we're creating. */
bfd *output_bfd = 0;
@@ -75,65 +81,67 @@ bfd *output_bfd = 0;
int g_switch_value = 8;
/* Nonzero means print names of input files as processed. */
-boolean trace_files;
+bfd_boolean trace_files;
/* Nonzero means same, but note open failures, too. */
-boolean trace_file_tries;
+bfd_boolean trace_file_tries;
/* Nonzero means version number was printed, so exit successfully
instead of complaining if no input files are given. */
-boolean version_printed;
+bfd_boolean version_printed;
/* Nonzero means link in every member of an archive. */
-boolean whole_archive;
+bfd_boolean whole_archive;
+
+/* Nonzero means create DT_NEEDED entries only if a dynamic library
+ actually satisfies some reference in a regular object. */
+bfd_boolean as_needed;
-/* True if we should demangle symbol names. */
-boolean demangling;
+/* TRUE if we should demangle symbol names. */
+bfd_boolean demangling;
args_type command_line;
ld_config_type config;
-static void remove_output PARAMS ((void));
-static boolean check_for_scripts_dir PARAMS ((char *dir));
-static boolean add_archive_element PARAMS ((struct bfd_link_info *, bfd *,
- const char *));
-static boolean multiple_definition PARAMS ((struct bfd_link_info *,
- const char *,
- bfd *, asection *, bfd_vma,
- bfd *, asection *, bfd_vma));
-static boolean multiple_common PARAMS ((struct bfd_link_info *,
- const char *, bfd *,
- enum bfd_link_hash_type, bfd_vma,
- bfd *, enum bfd_link_hash_type,
- bfd_vma));
-static boolean add_to_set PARAMS ((struct bfd_link_info *,
- struct bfd_link_hash_entry *,
- bfd_reloc_code_real_type,
- bfd *, asection *, bfd_vma));
-static boolean constructor_callback PARAMS ((struct bfd_link_info *,
- boolean constructor,
- const char *name,
- bfd *, asection *, bfd_vma));
-static boolean warning_callback PARAMS ((struct bfd_link_info *,
- const char *, const char *, bfd *,
- asection *, bfd_vma));
-static void warning_find_reloc PARAMS ((bfd *, asection *, PTR));
-static boolean undefined_symbol PARAMS ((struct bfd_link_info *,
- const char *, bfd *,
- asection *, bfd_vma, boolean));
-static boolean reloc_overflow PARAMS ((struct bfd_link_info *, const char *,
- const char *, bfd_vma,
- bfd *, asection *, bfd_vma));
-static boolean reloc_dangerous PARAMS ((struct bfd_link_info *, const char *,
- bfd *, asection *, bfd_vma));
-static boolean unattached_reloc PARAMS ((struct bfd_link_info *,
- const char *, bfd *, asection *,
- bfd_vma));
-static boolean notice PARAMS ((struct bfd_link_info *, const char *,
- bfd *, asection *, bfd_vma));
-
-static struct bfd_link_callbacks link_callbacks = {
+static char *get_emulation
+ (int, char **);
+static void set_scripts_dir
+ (void);
+static bfd_boolean add_archive_element
+ (struct bfd_link_info *, bfd *, const char *);
+static bfd_boolean multiple_definition
+ (struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma,
+ bfd *, asection *, bfd_vma);
+static bfd_boolean multiple_common
+ (struct bfd_link_info *, const char *, bfd *, enum bfd_link_hash_type,
+ bfd_vma, bfd *, enum bfd_link_hash_type, bfd_vma);
+static bfd_boolean add_to_set
+ (struct bfd_link_info *, struct bfd_link_hash_entry *,
+ bfd_reloc_code_real_type, bfd *, asection *, bfd_vma);
+static bfd_boolean constructor_callback
+ (struct bfd_link_info *, bfd_boolean, const char *, bfd *,
+ asection *, bfd_vma);
+static bfd_boolean warning_callback
+ (struct bfd_link_info *, const char *, const char *, bfd *,
+ asection *, bfd_vma);
+static void warning_find_reloc
+ (bfd *, asection *, void *);
+static bfd_boolean undefined_symbol
+ (struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma,
+ bfd_boolean);
+static bfd_boolean reloc_overflow
+ (struct bfd_link_info *, const char *, const char *, bfd_vma,
+ bfd *, asection *, bfd_vma);
+static bfd_boolean reloc_dangerous
+ (struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma);
+static bfd_boolean unattached_reloc
+ (struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma);
+static bfd_boolean notice
+ (struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma);
+
+static struct bfd_link_callbacks link_callbacks =
+{
add_archive_element,
multiple_definition,
multiple_common,
@@ -144,27 +152,26 @@ static struct bfd_link_callbacks link_callbacks = {
reloc_overflow,
reloc_dangerous,
unattached_reloc,
- notice
+ notice,
+ error_handler
};
struct bfd_link_info link_info;
static void
-remove_output ()
+remove_output (void)
{
if (output_filename)
{
- if (output_bfd && output_bfd->iostream)
- fclose ((FILE *) (output_bfd->iostream));
+ if (output_bfd)
+ bfd_cache_close (output_bfd);
if (delete_output_file_on_failure)
unlink (output_filename);
}
}
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
char *emulation;
long start_time = get_run_time ();
@@ -189,6 +196,52 @@ main (argc, argv)
xatexit (remove_output);
+#ifdef TARGET_SYSTEM_ROOT_RELOCATABLE
+ ld_sysroot = make_relative_prefix (program_name, BINDIR,
+ TARGET_SYSTEM_ROOT);
+
+ if (ld_sysroot)
+ {
+ struct stat s;
+ int res = stat (ld_sysroot, &s) == 0 && S_ISDIR (s.st_mode);
+
+ if (!res)
+ {
+ free (ld_sysroot);
+ ld_sysroot = NULL;
+ }
+ }
+
+ if (! ld_sysroot)
+ {
+ ld_sysroot = make_relative_prefix (program_name, TOOLBINDIR,
+ TARGET_SYSTEM_ROOT);
+
+ if (ld_sysroot)
+ {
+ struct stat s;
+ int res = stat (ld_sysroot, &s) == 0 && S_ISDIR (s.st_mode);
+
+ if (!res)
+ {
+ free (ld_sysroot);
+ ld_sysroot = NULL;
+ }
+ }
+ }
+
+ if (! ld_sysroot)
+#endif
+ ld_sysroot = TARGET_SYSTEM_ROOT;
+
+ if (ld_sysroot && *ld_sysroot)
+ ld_canon_sysroot = lrealpath (ld_sysroot);
+
+ if (ld_canon_sysroot)
+ ld_canon_sysroot_len = strlen (ld_canon_sysroot);
+ else
+ ld_canon_sysroot_len = -1;
+
/* Set the default BFD target based on the configured target. Doing
this permits the linker to be configured for a particular target,
and linked against a shared BFD library which was configured for
@@ -207,19 +260,20 @@ main (argc, argv)
#endif
/* Initialize the data about options. */
- trace_files = trace_file_tries = version_printed = false;
- whole_archive = false;
- config.build_constructors = true;
- config.dynamic_link = false;
- config.has_shared = false;
+ trace_files = trace_file_tries = version_printed = FALSE;
+ whole_archive = FALSE;
+ config.build_constructors = TRUE;
+ config.dynamic_link = FALSE;
+ config.has_shared = FALSE;
config.split_by_reloc = (unsigned) -1;
config.split_by_file = (bfd_size_type) -1;
- command_line.force_common_definition = false;
- command_line.inhibit_common_definition = false;
+ command_line.force_common_definition = FALSE;
+ command_line.inhibit_common_definition = FALSE;
command_line.interpreter = NULL;
command_line.rpath = NULL;
- command_line.warn_mismatch = true;
- command_line.check_section_addresses = true;
+ command_line.warn_mismatch = TRUE;
+ command_line.check_section_addresses = TRUE;
+ command_line.accept_unknown_input_arch = FALSE;
/* We initialize DEMANGLING based on the environment variable
COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
@@ -228,67 +282,72 @@ main (argc, argv)
interface by default. */
demangling = getenv ("COLLECT_NO_DEMANGLE") == NULL;
- link_info.callbacks = &link_callbacks;
- link_info.relocateable = false;
- link_info.emitrelocations = false;
- link_info.shared = false;
- link_info.symbolic = false;
- link_info.export_dynamic = false;
- link_info.static_link = false;
- link_info.traditional_format = false;
- link_info.optimize = false;
- link_info.no_undefined = false;
- link_info.allow_shlib_undefined = false;
- link_info.allow_multiple_definition = false;
- link_info.allow_undefined_version = true;
+ link_info.relocatable = FALSE;
+ link_info.emitrelocations = FALSE;
+ link_info.task_link = FALSE;
+ link_info.shared = FALSE;
+ link_info.pie = FALSE;
+ link_info.executable = FALSE;
+ link_info.symbolic = FALSE;
+ link_info.export_dynamic = FALSE;
+ link_info.static_link = FALSE;
+ link_info.traditional_format = FALSE;
+ link_info.optimize = FALSE;
+ link_info.unresolved_syms_in_objects = RM_NOT_YET_SET;
+ link_info.unresolved_syms_in_shared_libs = RM_NOT_YET_SET;
+ link_info.allow_multiple_definition = FALSE;
+ link_info.allow_undefined_version = TRUE;
+ link_info.keep_memory = TRUE;
+ link_info.notice_all = FALSE;
+ link_info.nocopyreloc = FALSE;
+ link_info.new_dtags = FALSE;
+ link_info.combreloc = TRUE;
+ link_info.eh_frame_hdr = FALSE;
+ link_info.strip_discarded = TRUE;
link_info.strip = strip_none;
link_info.discard = discard_sec_merge;
- link_info.keep_memory = true;
- link_info.input_bfds = NULL;
- link_info.create_object_symbols_section = NULL;
- link_info.gc_sym_list = NULL;
+ link_info.common_skip_ar_aymbols = bfd_link_common_skip_none;
+ link_info.callbacks = &link_callbacks;
link_info.hash = NULL;
link_info.keep_hash = NULL;
- link_info.notice_all = false;
link_info.notice_hash = NULL;
link_info.wrap_hash = NULL;
- link_info.mpc860c0 = 0;
+ link_info.input_bfds = NULL;
+ link_info.create_object_symbols_section = NULL;
+ link_info.gc_sym_list = NULL;
+ link_info.base_file = NULL;
/* SVR4 linkers seem to set DT_INIT and DT_FINI based on magic _init
and _fini symbols. We are compatible. */
link_info.init_function = "_init";
link_info.fini_function = "_fini";
- link_info.new_dtags = false;
- link_info.eh_frame_hdr = false;
- link_info.flags = (bfd_vma) 0;
- link_info.flags_1 = (bfd_vma) 0;
- link_info.pei386_auto_import = false;
link_info.pei386_auto_import = -1;
- link_info.combreloc = true;
+ link_info.pei386_runtime_pseudo_reloc = FALSE;
link_info.spare_dynamic_tags = 5;
+ link_info.flags = 0;
+ link_info.flags_1 = 0;
+ link_info.need_relax_finalize = FALSE;
ldfile_add_arch ("");
- config.make_executable = true;
- force_make_executable = false;
- config.magic_demand_paged = true;
- config.text_read_only = true;
+ config.make_executable = TRUE;
+ force_make_executable = FALSE;
+ config.magic_demand_paged = TRUE;
+ config.text_read_only = TRUE;
emulation = get_emulation (argc, argv);
ldemul_choose_mode (emulation);
default_target = ldemul_choose_target (argc, argv);
lang_init ();
ldemul_before_parse ();
- lang_has_input_file = false;
+ lang_has_input_file = FALSE;
parse_args (argc, argv);
ldemul_set_symbols ();
- if (link_info.relocateable)
+ if (link_info.relocatable)
{
if (command_line.gc_sections)
einfo ("%P%F: --gc-sections and -r may not be used together\n");
- if (link_info.mpc860c0)
- einfo (_("%P%F: -r and --mpc860c0 may not be used together\n"));
else if (command_line.relax)
einfo (_("%P%F: --relax and -r may not be used together\n"));
if (link_info.shared)
@@ -303,10 +362,13 @@ main (argc, argv)
einfo (_("%P%F: -f may not be used without -shared\n"));
}
+ if (! link_info.shared || link_info.pie)
+ link_info.executable = TRUE;
+
/* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols). I
don't see how else this can be handled, since in this case we
must preserve all externally visible symbols. */
- if (link_info.relocateable && link_info.strip == strip_all)
+ if (link_info.relocatable && link_info.strip == strip_all)
{
link_info.strip = strip_debugger;
if (link_info.discard == discard_sec_merge)
@@ -371,7 +433,7 @@ main (argc, argv)
lang_final ();
- if (lang_has_input_file == false)
+ if (!lang_has_input_file)
{
if (version_printed)
xexit (0);
@@ -379,9 +441,7 @@ main (argc, argv)
}
if (trace_files)
- {
- info_msg (_("%P: mode %s\n"), emulation);
- }
+ info_msg (_("%P: mode %s\n"), emulation);
ldemul_after_parse ();
@@ -407,8 +467,7 @@ main (argc, argv)
/* Print error messages for any missing symbols, for any warning
symbols, and possibly multiple definitions. */
-
- if (link_info.relocateable)
+ if (link_info.relocatable)
output_bfd->flags &= ~EXEC_P;
else
output_bfd->flags |= EXEC_P;
@@ -422,20 +481,16 @@ main (argc, argv)
if (nocrossref_list != NULL)
check_nocrossrefs ();
- /* Even if we're producing relocateable output, some non-fatal errors should
+ /* Even if we're producing relocatable output, some non-fatal errors should
be reported in the exit status. (What non-fatal errors, if any, do we
- want to ignore for relocateable output?) */
-
- if (config.make_executable == false && force_make_executable == false)
+ want to ignore for relocatable output?) */
+ if (!config.make_executable && !force_make_executable)
{
- if (trace_files == true)
- {
- einfo (_("%P: link errors found, deleting executable `%s'\n"),
- output_filename);
- }
+ if (trace_files)
+ einfo (_("%P: link errors found, deleting executable `%s'\n"),
+ output_filename);
/* The file will be removed by remove_output. */
-
xexit (1);
}
else
@@ -446,9 +501,10 @@ main (argc, argv)
/* If the --force-exe-suffix is enabled, and we're making an
executable file and it doesn't end in .exe, copy it to one
which does. */
- if (! link_info.relocateable && command_line.force_exe_suffix)
+ if (! link_info.relocatable && command_line.force_exe_suffix)
{
int len = strlen (output_filename);
+
if (len < 4
|| (strcasecmp (output_filename + len - 4, ".exe") != 0
&& strcasecmp (output_filename + len - 4, ".dll") != 0))
@@ -459,28 +515,29 @@ main (argc, argv)
char *buf = xmalloc (bsize);
int l;
char *dst_name = xmalloc (len + 5);
+
strcpy (dst_name, output_filename);
strcat (dst_name, ".exe");
src = fopen (output_filename, FOPEN_RB);
dst = fopen (dst_name, FOPEN_WB);
if (!src)
- einfo (_("%X%P: unable to open for source of copy `%s'\n"), output_filename);
+ einfo (_("%X%P: unable to open for source of copy `%s'\n"),
+ output_filename);
if (!dst)
- einfo (_("%X%P: unable to open for destination of copy `%s'\n"), dst_name);
+ einfo (_("%X%P: unable to open for destination of copy `%s'\n"),
+ dst_name);
while ((l = fread (buf, 1, bsize, src)) > 0)
{
int done = fwrite (buf, 1, l, dst);
+
if (done != l)
- {
- einfo (_("%P: Error writing file `%s'\n"), dst_name);
- }
+ einfo (_("%P: Error writing file `%s'\n"), dst_name);
}
+
fclose (src);
if (fclose (dst) == EOF)
- {
- einfo (_("%P: Error closing file `%s'\n"), dst_name);
- }
+ einfo (_("%P: Error closing file `%s'\n"), dst_name);
free (dst_name);
free (buf);
}
@@ -492,7 +549,7 @@ main (argc, argv)
if (config.stats)
{
#ifdef HAVE_SBRK
- char *lim = (char *) sbrk (0);
+ char *lim = sbrk (0);
#endif
long run_time = get_run_time () - start_time;
@@ -515,9 +572,7 @@ main (argc, argv)
state that's needed by the lex&yacc argument parser (parse_args). */
static char *
-get_emulation (argc, argv)
- int argc;
- char **argv;
+get_emulation (int argc, char **argv)
{
char *emulation;
int i;
@@ -539,17 +594,17 @@ get_emulation (argc, argv)
i++;
}
else
- {
- einfo (_("%P%F: missing argument to -m\n"));
- }
+ einfo (_("%P%F: missing argument to -m\n"));
}
else if (strcmp (argv[i], "-mips1") == 0
|| strcmp (argv[i], "-mips2") == 0
|| strcmp (argv[i], "-mips3") == 0
+ || strcmp (argv[i], "-mips4") == 0
+ || strcmp (argv[i], "-mips5") == 0
|| strcmp (argv[i], "-mips32") == 0
+ || strcmp (argv[i], "-mips32r2") == 0
|| strcmp (argv[i], "-mips64") == 0
- || strcmp (argv[i], "-mips4") == 0
- || strcmp (argv[i], "-mips5") == 0)
+ || strcmp (argv[i], "-mips64r2") == 0)
{
/* FIXME: The arguments -mips1, -mips2, -mips3, etc. are
passed to the linker by some MIPS compilers. They
@@ -577,27 +632,26 @@ get_emulation (argc, argv)
}
/* If directory DIR contains an "ldscripts" subdirectory,
- add DIR to the library search path and return true,
- else return false. */
+ add DIR to the library search path and return TRUE,
+ else return FALSE. */
-static boolean
-check_for_scripts_dir (dir)
- char *dir;
+static bfd_boolean
+check_for_scripts_dir (char *dir)
{
size_t dirlen;
char *buf;
struct stat s;
- boolean res;
+ bfd_boolean res;
dirlen = strlen (dir);
/* sizeof counts the terminating NUL. */
- buf = (char *) xmalloc (dirlen + sizeof ("/ldscripts"));
+ buf = xmalloc (dirlen + sizeof ("/ldscripts"));
sprintf (buf, "%s/ldscripts", dir);
res = stat (buf, &s) == 0 && S_ISDIR (s.st_mode);
free (buf);
if (res)
- ldfile_add_library_path (dir, false);
+ ldfile_add_library_path (dir, FALSE);
return res;
}
@@ -606,14 +660,36 @@ check_for_scripts_dir (dir)
We look for the "ldscripts" directory in:
SCRIPTDIR (passed from Makefile)
+ (adjusted according to the current location of the binary)
+ SCRIPTDIR (passed from Makefile)
the dir where this program is (for using it from the build tree)
- the dir where this program is/../lib (for installing the tool suite elsewhere) */
+ the dir where this program is/../lib
+ (for installing the tool suite elsewhere). */
static void
-set_scripts_dir ()
+set_scripts_dir (void)
{
char *end, *dir;
size_t dirlen;
+ bfd_boolean found;
+
+ dir = make_relative_prefix (program_name, BINDIR, SCRIPTDIR);
+ if (dir)
+ {
+ found = check_for_scripts_dir (dir);
+ free (dir);
+ if (found)
+ return;
+ }
+
+ dir = make_relative_prefix (program_name, TOOLBINDIR, SCRIPTDIR);
+ if (dir)
+ {
+ found = check_for_scripts_dir (dir);
+ free (dir);
+ if (found)
+ return;
+ }
if (check_for_scripts_dir (SCRIPTDIR))
/* We've been installed normally. */
@@ -625,81 +701,74 @@ set_scripts_dir ()
{
/* We could have \foo\bar, or /foo\bar. */
char *bslash = strrchr (program_name, '\\');
+
if (end == NULL || (bslash != NULL && bslash > end))
end = bslash;
}
#endif
if (end == NULL)
- {
- /* Don't look for ldscripts in the current directory. There is
- too much potential for confusion. */
- return;
- }
+ /* Don't look for ldscripts in the current directory. There is
+ too much potential for confusion. */
+ return;
dirlen = end - program_name;
/* Make a copy of program_name in dir.
Leave room for later "/../lib". */
- dir = (char *) xmalloc (dirlen + 8);
+ dir = xmalloc (dirlen + 8);
strncpy (dir, program_name, dirlen);
dir[dirlen] = '\0';
if (check_for_scripts_dir (dir))
- /* Don't free dir. */
- return;
+ {
+ free (dir);
+ return;
+ }
/* Look for "ldscripts" in <the dir where our binary is>/../lib. */
strcpy (dir + dirlen, "/../lib");
- if (check_for_scripts_dir (dir))
- return;
-
- /* Well, we tried. */
+ check_for_scripts_dir (dir);
free (dir);
}
void
-add_ysym (name)
- const char *name;
+add_ysym (const char *name)
{
- if (link_info.notice_hash == (struct bfd_hash_table *) NULL)
+ if (link_info.notice_hash == NULL)
{
- link_info.notice_hash = ((struct bfd_hash_table *)
- xmalloc (sizeof (struct bfd_hash_table)));
+ link_info.notice_hash = xmalloc (sizeof (struct bfd_hash_table));
if (! bfd_hash_table_init_n (link_info.notice_hash,
bfd_hash_newfunc,
61))
einfo (_("%P%F: bfd_hash_table_init failed: %E\n"));
}
- if (bfd_hash_lookup (link_info.notice_hash, name, true, true)
- == (struct bfd_hash_entry *) NULL)
+ if (bfd_hash_lookup (link_info.notice_hash, name, TRUE, TRUE) == NULL)
einfo (_("%P%F: bfd_hash_lookup failed: %E\n"));
}
/* Record a symbol to be wrapped, from the --wrap option. */
void
-add_wrap (name)
- const char *name;
+add_wrap (const char *name)
{
if (link_info.wrap_hash == NULL)
{
- link_info.wrap_hash = ((struct bfd_hash_table *)
- xmalloc (sizeof (struct bfd_hash_table)));
+ link_info.wrap_hash = xmalloc (sizeof (struct bfd_hash_table));
if (! bfd_hash_table_init_n (link_info.wrap_hash,
bfd_hash_newfunc,
61))
einfo (_("%P%F: bfd_hash_table_init failed: %E\n"));
}
- if (bfd_hash_lookup (link_info.wrap_hash, name, true, true) == NULL)
+
+ if (bfd_hash_lookup (link_info.wrap_hash, name, TRUE, TRUE) == NULL)
einfo (_("%P%F: bfd_hash_lookup failed: %E\n"));
}
/* Handle the -retain-symbols-file option. */
void
-add_keepsyms_file (filename)
- const char *filename;
+add_keepsyms_file (const char *filename)
{
FILE *file;
char *buf;
@@ -710,20 +779,19 @@ add_keepsyms_file (filename)
einfo (_("%X%P: error: duplicate retain-symbols-file\n"));
file = fopen (filename, "r");
- if (file == (FILE *) NULL)
+ if (file == NULL)
{
bfd_set_error (bfd_error_system_call);
einfo ("%X%P: %s: %E\n", filename);
return;
}
- link_info.keep_hash = ((struct bfd_hash_table *)
- xmalloc (sizeof (struct bfd_hash_table)));
+ link_info.keep_hash = xmalloc (sizeof (struct bfd_hash_table));
if (! bfd_hash_table_init (link_info.keep_hash, bfd_hash_newfunc))
einfo (_("%P%F: bfd_hash_table_init failed: %E\n"));
bufsize = 100;
- buf = (char *) xmalloc (bufsize);
+ buf = xmalloc (bufsize);
c = getc (file);
while (c != EOF)
@@ -749,8 +817,7 @@ add_keepsyms_file (filename)
buf[len] = '\0';
- if (bfd_hash_lookup (link_info.keep_hash, buf, true, true)
- == (struct bfd_hash_entry *) NULL)
+ if (bfd_hash_lookup (link_info.keep_hash, buf, TRUE, TRUE) == NULL)
einfo (_("%P%F: bfd_hash_lookup for insertion failed: %E\n"));
}
}
@@ -758,6 +825,7 @@ add_keepsyms_file (filename)
if (link_info.strip != strip_none)
einfo (_("%P: `-retain-symbols-file' overrides `-s' and `-S'\n"));
+ free (buf);
link_info.strip = strip_some;
}
@@ -766,24 +834,22 @@ add_keepsyms_file (filename)
/* This is called when BFD has decided to include an archive member in
a link. */
-static boolean
-add_archive_element (info, abfd, name)
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- bfd *abfd;
- const char *name;
+static bfd_boolean
+add_archive_element (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ bfd *abfd,
+ const char *name)
{
lang_input_statement_type *input;
- input = ((lang_input_statement_type *)
- xmalloc (sizeof (lang_input_statement_type)));
+ input = xmalloc (sizeof (lang_input_statement_type));
input->filename = abfd->filename;
input->local_sym_name = abfd->filename;
input->the_bfd = abfd;
input->asymbols = NULL;
input->next = NULL;
- input->just_syms_flag = false;
- input->loaded = false;
- input->search_dirs_flag = false;
+ input->just_syms_flag = FALSE;
+ input->loaded = FALSE;
+ input->search_dirs_flag = FALSE;
/* FIXME: The following fields are not set: header.next,
header.type, closed, passive_position, symbol_count,
@@ -793,14 +859,14 @@ add_archive_element (info, abfd, name)
ldlang_add_file (input);
- if (config.map_file != (FILE *) NULL)
+ if (config.map_file != NULL)
{
- static boolean header_printed;
+ static bfd_boolean header_printed;
struct bfd_link_hash_entry *h;
bfd *from;
int len;
- h = bfd_link_hash_lookup (link_info.hash, name, false, false, true);
+ h = bfd_link_hash_lookup (link_info.hash, name, FALSE, FALSE, TRUE);
if (h == NULL)
from = NULL;
@@ -834,7 +900,7 @@ add_archive_element (info, abfd, name)
sprintf (buf, _("Archive member included because of file (symbol)\n\n"));
minfo ("%s", buf);
- header_printed = true;
+ header_printed = TRUE;
}
if (bfd_my_archive (abfd) == NULL)
@@ -873,22 +939,21 @@ add_archive_element (info, abfd, name)
if (trace_files || trace_file_tries)
info_msg ("%I\n", input);
- return true;
+ return TRUE;
}
/* This is called when BFD has discovered a symbol which is defined
multiple times. */
-static boolean
-multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval)
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- const char *name;
- bfd *obfd;
- asection *osec;
- bfd_vma oval;
- bfd *nbfd;
- asection *nsec;
- bfd_vma nval;
+static bfd_boolean
+multiple_definition (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ const char *name,
+ bfd *obfd,
+ asection *osec,
+ bfd_vma oval,
+ bfd *nbfd,
+ asection *nsec,
+ bfd_vma nval)
{
/* If either section has the output_section field set to
bfd_abs_section_ptr, it means that the section is being
@@ -901,11 +966,11 @@ multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval)
|| (nsec->output_section != NULL
&& ! bfd_is_abs_section (nsec)
&& bfd_is_abs_section (nsec->output_section)))
- return true;
+ return TRUE;
einfo (_("%X%C: multiple definition of `%T'\n"),
nbfd, nsec, nval, name);
- if (obfd != (bfd *) NULL)
+ if (obfd != NULL)
einfo (_("%D: first defined here\n"), obfd, osec, oval);
if (command_line.relax)
@@ -914,7 +979,7 @@ multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval)
command_line.relax = 0;
}
- return true;
+ return TRUE;
}
/* This is called when there is a definition of a common symbol, or
@@ -922,19 +987,18 @@ multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval)
or when two common symbols are found. We only do something if
-warn-common was used. */
-static boolean
-multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize)
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- const char *name;
- bfd *obfd;
- enum bfd_link_hash_type otype;
- bfd_vma osize;
- bfd *nbfd;
- enum bfd_link_hash_type ntype;
- bfd_vma nsize;
+static bfd_boolean
+multiple_common (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ const char *name,
+ bfd *obfd,
+ enum bfd_link_hash_type otype,
+ bfd_vma osize,
+ bfd *nbfd,
+ enum bfd_link_hash_type ntype,
+ bfd_vma nsize)
{
if (! config.warn_common)
- return true;
+ return TRUE;
if (ntype == bfd_link_hash_defined
|| ntype == bfd_link_hash_defweak
@@ -981,30 +1045,29 @@ multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize)
}
}
- return true;
+ return TRUE;
}
/* This is called when BFD has discovered a set element. H is the
entry in the linker hash table for the set. SECTION and VALUE
represent a value which should be added to the set. */
-static boolean
-add_to_set (info, h, reloc, abfd, section, value)
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- struct bfd_link_hash_entry *h;
- bfd_reloc_code_real_type reloc;
- bfd *abfd;
- asection *section;
- bfd_vma value;
+static bfd_boolean
+add_to_set (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ struct bfd_link_hash_entry *h,
+ bfd_reloc_code_real_type reloc,
+ bfd *abfd,
+ asection *section,
+ bfd_vma value)
{
if (config.warn_constructors)
einfo (_("%P: warning: global constructor %s used\n"),
h->root.string);
if (! config.build_constructors)
- return true;
+ return TRUE;
- ldctor_add_set_entry (h, reloc, (const char *) NULL, section, value);
+ ldctor_add_set_entry (h, reloc, NULL, section, value);
if (h->type == bfd_link_hash_new)
{
@@ -1015,7 +1078,7 @@ add_to_set (info, h, reloc, abfd, section, value)
ourselves. */
}
- return true;
+ return TRUE;
}
/* This is called when BFD has discovered a constructor. This is only
@@ -1023,14 +1086,13 @@ add_to_set (info, h, reloc, abfd, section, value)
constructors in some more clever fashion. This is similar to
adding an element to a set, but less general. */
-static boolean
-constructor_callback (info, constructor, name, abfd, section, value)
- struct bfd_link_info *info;
- boolean constructor;
- const char *name;
- bfd *abfd;
- asection *section;
- bfd_vma value;
+static bfd_boolean
+constructor_callback (struct bfd_link_info *info,
+ bfd_boolean constructor,
+ const char *name,
+ bfd *abfd,
+ asection *section,
+ bfd_vma value)
{
char *s;
struct bfd_link_hash_entry *h;
@@ -1040,12 +1102,12 @@ constructor_callback (info, constructor, name, abfd, section, value)
einfo (_("%P: warning: global constructor %s used\n"), name);
if (! config.build_constructors)
- return true;
+ return TRUE;
/* Ensure that BFD_RELOC_CTOR exists now, so that we can give a
useful error message. */
if (bfd_reloc_type_lookup (output_bfd, BFD_RELOC_CTOR) == NULL
- && (link_info.relocateable
+ && (link_info.relocatable
|| bfd_reloc_type_lookup (abfd, BFD_RELOC_CTOR) == NULL))
einfo (_("%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n"));
@@ -1057,7 +1119,7 @@ constructor_callback (info, constructor, name, abfd, section, value)
else
strcpy (s, "__DTOR_LIST__");
- h = bfd_link_hash_lookup (info->hash, set_name, true, true, true);
+ h = bfd_link_hash_lookup (info->hash, set_name, TRUE, TRUE, TRUE);
if (h == (struct bfd_link_hash_entry *) NULL)
einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n"));
if (h->type == bfd_link_hash_new)
@@ -1070,14 +1132,15 @@ constructor_callback (info, constructor, name, abfd, section, value)
}
ldctor_add_set_entry (h, BFD_RELOC_CTOR, name, section, value);
- return true;
+ return TRUE;
}
/* A structure used by warning_callback to pass information through
bfd_map_over_sections. */
-struct warning_callback_info {
- boolean found;
+struct warning_callback_info
+{
+ bfd_boolean found;
const char *warning;
const char *symbol;
asymbol **asymbols;
@@ -1085,20 +1148,19 @@ struct warning_callback_info {
/* This is called when there is a reference to a warning symbol. */
-static boolean
-warning_callback (info, warning, symbol, abfd, section, address)
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- const char *warning;
- const char *symbol;
- bfd *abfd;
- asection *section;
- bfd_vma address;
+static bfd_boolean
+warning_callback (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ const char *warning,
+ const char *symbol,
+ bfd *abfd,
+ asection *section,
+ bfd_vma address)
{
/* This is a hack to support warn_multiple_gp. FIXME: This should
have a cleaner interface, but what? */
if (! config.warn_multiple_gp
&& strcmp (warning, "using multiple gp values") == 0)
- return true;
+ return TRUE;
if (section != NULL)
einfo ("%C: %s\n", abfd, section, address, warning);
@@ -1114,7 +1176,6 @@ warning_callback (info, warning, symbol, abfd, section, address)
/* Look through the relocs to see if we can find a plausible
address. */
-
entry = (lang_input_statement_type *) abfd->usrdata;
if (entry != NULL && entry->asymbols != NULL)
asymbols = entry->asymbols;
@@ -1126,7 +1187,7 @@ warning_callback (info, warning, symbol, abfd, section, address)
symsize = bfd_get_symtab_upper_bound (abfd);
if (symsize < 0)
einfo (_("%B%F: could not read symbols: %E\n"), abfd);
- asymbols = (asymbol **) xmalloc (symsize);
+ asymbols = xmalloc (symsize);
symbol_count = bfd_canonicalize_symtab (abfd, asymbols);
if (symbol_count < 0)
einfo (_("%B%F: could not read symbols: %E\n"), abfd);
@@ -1137,11 +1198,11 @@ warning_callback (info, warning, symbol, abfd, section, address)
}
}
- info.found = false;
+ info.found = FALSE;
info.warning = warning;
info.symbol = symbol;
info.asymbols = asymbols;
- bfd_map_over_sections (abfd, warning_find_reloc, (PTR) &info);
+ bfd_map_over_sections (abfd, warning_find_reloc, &info);
if (! info.found)
einfo ("%B: %s\n", abfd, warning);
@@ -1150,7 +1211,7 @@ warning_callback (info, warning, symbol, abfd, section, address)
free (asymbols);
}
- return true;
+ return TRUE;
}
/* This is called by warning_callback for each section. It checks the
@@ -1159,12 +1220,9 @@ warning_callback (info, warning, symbol, abfd, section, address)
to give an error message with a file and line number. */
static void
-warning_find_reloc (abfd, sec, iarg)
- bfd *abfd;
- asection *sec;
- PTR iarg;
+warning_find_reloc (bfd *abfd, asection *sec, void *iarg)
{
- struct warning_callback_info *info = (struct warning_callback_info *) iarg;
+ struct warning_callback_info *info = iarg;
long relsize;
arelent **relpp;
long relcount;
@@ -1179,7 +1237,7 @@ warning_find_reloc (abfd, sec, iarg)
if (relsize == 0)
return;
- relpp = (arelent **) xmalloc (relsize);
+ relpp = xmalloc (relsize);
relcount = bfd_canonicalize_reloc (abfd, sec, relpp, info->asymbols);
if (relcount < 0)
einfo (_("%B%F: could not read relocs: %E\n"), abfd);
@@ -1196,7 +1254,7 @@ warning_find_reloc (abfd, sec, iarg)
{
/* We found a reloc for the symbol we are looking for. */
einfo ("%C: %s\n", abfd, sec, q->address, info->warning);
- info->found = true;
+ info->found = TRUE;
break;
}
}
@@ -1206,14 +1264,13 @@ warning_find_reloc (abfd, sec, iarg)
/* This is called when an undefined symbol is found. */
-static boolean
-undefined_symbol (info, name, abfd, section, address, fatal)
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- const char *name;
- bfd *abfd;
- asection *section;
- bfd_vma address;
- boolean fatal ATTRIBUTE_UNUSED;
+static bfd_boolean
+undefined_symbol (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ const char *name,
+ bfd *abfd,
+ asection *section,
+ bfd_vma address,
+ bfd_boolean error)
{
static char *error_name;
static unsigned int error_count;
@@ -1225,31 +1282,29 @@ undefined_symbol (info, name, abfd, section, address, fatal)
static struct bfd_hash_table *hash;
/* Only warn once about a particular undefined symbol. */
-
if (hash == NULL)
{
- hash = ((struct bfd_hash_table *)
- xmalloc (sizeof (struct bfd_hash_table)));
+ hash = xmalloc (sizeof (struct bfd_hash_table));
if (! bfd_hash_table_init (hash, bfd_hash_newfunc))
einfo (_("%F%P: bfd_hash_table_init failed: %E\n"));
}
- if (bfd_hash_lookup (hash, name, false, false) != NULL)
- return true;
+ if (bfd_hash_lookup (hash, name, FALSE, FALSE) != NULL)
+ return TRUE;
- if (bfd_hash_lookup (hash, name, true, true) == NULL)
+ if (bfd_hash_lookup (hash, name, TRUE, TRUE) == NULL)
einfo (_("%F%P: bfd_hash_lookup failed: %E\n"));
}
/* We never print more than a reasonable number of errors in a row
for a single symbol. */
- if (error_name != (char *) NULL
+ if (error_name != NULL
&& strcmp (name, error_name) == 0)
++error_count;
else
{
error_count = 0;
- if (error_name != (char *) NULL)
+ if (error_name != NULL)
free (error_name);
error_name = xstrdup (name);
}
@@ -1258,107 +1313,143 @@ undefined_symbol (info, name, abfd, section, address, fatal)
{
if (error_count < MAX_ERRORS_IN_A_ROW)
{
- einfo (_("%C: undefined reference to `%T'\n"),
- abfd, section, address, name);
- if (fatal)
- einfo ("%X");
+ if (error)
+ einfo (_("%X%C: undefined reference to `%T'\n"),
+ abfd, section, address, name);
+ else
+ einfo (_("%C: warning: undefined reference to `%T'\n"),
+ abfd, section, address, name);
}
else if (error_count == MAX_ERRORS_IN_A_ROW)
- einfo (_("%D: more undefined references to `%T' follow\n"),
- abfd, section, address, name);
+ {
+ if (error)
+ einfo (_("%X%D: more undefined references to `%T' follow\n"),
+ abfd, section, address, name);
+ else
+ einfo (_("%D: warning: more undefined references to `%T' follow\n"),
+ abfd, section, address, name);
+ }
+ else if (error)
+ einfo ("%X");
}
else
{
if (error_count < MAX_ERRORS_IN_A_ROW)
{
- einfo (_("%B: undefined reference to `%T'\n"),
- abfd, name);
- if (fatal)
- einfo ("%X");
+ if (error)
+ einfo (_("%X%B: undefined reference to `%T'\n"),
+ abfd, name);
+ else
+ einfo (_("%B: warning: undefined reference to `%T'\n"),
+ abfd, name);
}
else if (error_count == MAX_ERRORS_IN_A_ROW)
- einfo (_("%B: more undefined references to `%T' follow\n"),
- abfd, name);
+ {
+ if (error)
+ einfo (_("%X%B: more undefined references to `%T' follow\n"),
+ abfd, name);
+ else
+ einfo (_("%B: warning: more undefined references to `%T' follow\n"),
+ abfd, name);
+ }
+ else if (error)
+ einfo ("%X");
}
- return true;
+ return TRUE;
}
+/* Counter to limit the number of relocation overflow error messages
+ to print. Errors are printed as it is decremented. When it's
+ called and the counter is zero, a final message is printed
+ indicating more relocations were omitted. When it gets to -1, no
+ such errors are printed. If it's initially set to a value less
+ than -1, all such errors will be printed (--verbose does this). */
+
+int overflow_cutoff_limit = 10;
+
/* This is called when a reloc overflows. */
-static boolean
-reloc_overflow (info, name, reloc_name, addend, abfd, section, address)
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- const char *name;
- const char *reloc_name;
- bfd_vma addend;
- bfd *abfd;
- asection *section;
- bfd_vma address;
+static bfd_boolean
+reloc_overflow (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ const char *name,
+ const char *reloc_name,
+ bfd_vma addend,
+ bfd *abfd,
+ asection *section,
+ bfd_vma address)
{
- if (abfd == (bfd *) NULL)
+ if (overflow_cutoff_limit == -1)
+ return TRUE;
+
+ if (abfd == NULL)
einfo (_("%P%X: generated"));
else
einfo ("%X%C:", abfd, section, address);
+
+ if (overflow_cutoff_limit >= 0
+ && overflow_cutoff_limit-- == 0)
+ {
+ einfo (_(" additional relocation overflows omitted from the output\n"));
+ return TRUE;
+ }
+
einfo (_(" relocation truncated to fit: %s %T"), reloc_name, name);
if (addend != 0)
einfo ("+%v", addend);
einfo ("\n");
- return true;
+ return TRUE;
}
/* This is called when a dangerous relocation is made. */
-static boolean
-reloc_dangerous (info, message, abfd, section, address)
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- const char *message;
- bfd *abfd;
- asection *section;
- bfd_vma address;
+static bfd_boolean
+reloc_dangerous (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ const char *message,
+ bfd *abfd,
+ asection *section,
+ bfd_vma address)
{
- if (abfd == (bfd *) NULL)
+ if (abfd == NULL)
einfo (_("%P%X: generated"));
else
einfo ("%X%C:", abfd, section, address);
einfo (_("dangerous relocation: %s\n"), message);
- return true;
+ return TRUE;
}
/* This is called when a reloc is being generated attached to a symbol
that is not being output. */
-static boolean
-unattached_reloc (info, name, abfd, section, address)
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- const char *name;
- bfd *abfd;
- asection *section;
- bfd_vma address;
+static bfd_boolean
+unattached_reloc (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ const char *name,
+ bfd *abfd,
+ asection *section,
+ bfd_vma address)
{
- if (abfd == (bfd *) NULL)
+ if (abfd == NULL)
einfo (_("%P%X: generated"));
else
einfo ("%X%C:", abfd, section, address);
einfo (_(" reloc refers to symbol `%T' which is not being output\n"), name);
- return true;
+ return TRUE;
}
/* This is called if link_info.notice_all is set, or when a symbol in
link_info.notice_hash is found. Symbols are put in notice_hash
using the -y option. */
-static boolean
-notice (info, name, abfd, section, value)
- struct bfd_link_info *info;
- const char *name;
- bfd *abfd;
- asection *section;
- bfd_vma value;
+static bfd_boolean
+notice (struct bfd_link_info *info,
+ const char *name,
+ bfd *abfd,
+ asection *section,
+ bfd_vma value)
{
if (! info->notice_all
|| (info->notice_hash != NULL
- && bfd_hash_lookup (info->notice_hash, name, false, false) != NULL))
+ && bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) != NULL))
{
if (bfd_is_und_section (section))
einfo ("%B: reference to %s\n", abfd, name);
@@ -1369,5 +1460,5 @@ notice (info, name, abfd, section, value)
if (command_line.cref || nocrossref_list != NULL)
add_cref (name, abfd, section, value);
- return true;
+ return TRUE;
}
diff --git a/contrib/binutils/ld/ldmain.h b/contrib/binutils/ld/ldmain.h
index f5d8b0d..8cab5fe 100644
--- a/contrib/binutils/ld/ldmain.h
+++ b/contrib/binutils/ld/ldmain.h
@@ -1,5 +1,5 @@
/* ldmain.h -
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -23,19 +23,24 @@
#define LDMAIN_H
extern char *program_name;
+extern char *ld_sysroot;
+extern char *ld_canon_sysroot;
+extern int ld_canon_sysroot_len;
extern bfd *output_bfd;
extern char *default_target;
-extern boolean trace_files;
-extern boolean trace_file_tries;
-extern boolean version_printed;
-extern boolean whole_archive;
-extern boolean demangling;
+extern bfd_boolean trace_files;
+extern bfd_boolean trace_file_tries;
+extern bfd_boolean version_printed;
+extern bfd_boolean whole_archive;
+extern bfd_boolean as_needed;
+extern bfd_boolean demangling;
extern int g_switch_value;
extern const char *output_filename;
extern struct bfd_link_info link_info;
+extern int overflow_cutoff_limit;
-extern void add_ysym PARAMS ((const char *));
-extern void add_wrap PARAMS ((const char *));
-extern void add_keepsyms_file PARAMS ((const char *filename));
+extern void add_ysym (const char *);
+extern void add_wrap (const char *);
+extern void add_keepsyms_file (const char *);
#endif
diff --git a/contrib/binutils/ld/ldmisc.c b/contrib/binutils/ld/ldmisc.c
index 7f9746a..def598d 100644
--- a/contrib/binutils/ld/ldmisc.c
+++ b/contrib/binutils/ld/ldmisc.c
@@ -1,37 +1,32 @@
/* ldmisc.c
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2002
+ 2000, 2002, 2003
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
-This file is part of GLD, the Gnu Linker.
+ This file is part of GLD, the Gnu Linker.
-GLD is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+ GLD is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
-GLD is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ GLD is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with GLD; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with GLD; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
#include "bfd.h"
+#include "bfdlink.h"
#include "sysdep.h"
#include "libiberty.h"
#include "demangle.h"
-
-#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
#include "ld.h"
#include "ldmisc.h"
#include "ldexp.h"
@@ -41,8 +36,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ldmain.h"
#include "ldfile.h"
-static void vfinfo PARAMS ((FILE *, const char *, va_list));
-
/*
%% literal %
%F error is fatal
@@ -66,12 +59,9 @@ static void vfinfo PARAMS ((FILE *, const char *, va_list));
*/
static void
-vfinfo (fp, fmt, arg)
- FILE *fp;
- const char *fmt;
- va_list arg;
+vfinfo (FILE *fp, const char *fmt, va_list arg)
{
- boolean fatal = false;
+ bfd_boolean fatal = FALSE;
while (*fmt != '\0')
{
@@ -97,7 +87,7 @@ vfinfo (fp, fmt, arg)
case 'X':
/* no object output, fail return */
- config.make_executable = false;
+ config.make_executable = FALSE;
break;
case 'V':
@@ -125,7 +115,7 @@ vfinfo (fp, fmt, arg)
case 'W':
/* hex bfd_vma with 0x with no leading zeroes taking up
- 8 spaces. */
+ 8 spaces. */
{
char buf[100];
bfd_vma value;
@@ -153,7 +143,7 @@ vfinfo (fp, fmt, arg)
{
const char *name = va_arg (arg, const char *);
- if (name == (const char *) NULL || *name == 0)
+ if (name == NULL || *name == 0)
fprintf (fp, _("no symbol"));
else if (! demangling)
fprintf (fp, "%s", name);
@@ -182,7 +172,7 @@ vfinfo (fp, fmt, arg)
case 'F':
/* Error is fatal. */
- fatal = true;
+ fatal = TRUE;
break;
case 'P':
@@ -236,9 +226,8 @@ vfinfo (fp, fmt, arg)
case 'C':
case 'D':
case 'G':
- /* Clever filename:linenumber with function name if possible,
- or section name as a last resort. The arguments are a BFD,
- a section, and an offset. */
+ /* Clever filename:linenumber with function name if possible.
+ The arguments are a BFD, a section, and an offset. */
{
static bfd *last_bfd;
static char *last_file = NULL;
@@ -251,7 +240,7 @@ vfinfo (fp, fmt, arg)
const char *filename;
const char *functionname;
unsigned int linenumber;
- boolean discard_last;
+ bfd_boolean discard_last;
abfd = va_arg (arg, bfd *);
section = va_arg (arg, asection *);
@@ -269,7 +258,7 @@ vfinfo (fp, fmt, arg)
symsize = bfd_get_symtab_upper_bound (abfd);
if (symsize < 0)
einfo (_("%B%F: could not read symbols\n"), abfd);
- asymbols = (asymbol **) xmalloc (symsize);
+ asymbols = xmalloc (symsize);
symbol_count = bfd_canonicalize_symtab (abfd, asymbols);
if (symbol_count < 0)
einfo (_("%B%F: could not read symbols\n"), abfd);
@@ -280,68 +269,57 @@ vfinfo (fp, fmt, arg)
}
}
- discard_last = true;
+ lfinfo (fp, "%B(%s+0x%v)", abfd, section->name, offset);
+
+ discard_last = TRUE;
if (bfd_find_nearest_line (abfd, section, asymbols, offset,
&filename, &functionname,
&linenumber))
{
- if (functionname != NULL && fmt[-1] == 'G')
- {
- lfinfo (fp, "%B:", abfd);
- if (filename != NULL
- && strcmp (filename, bfd_get_filename (abfd)) != 0)
- fprintf (fp, "%s:", filename);
- lfinfo (fp, "%T", functionname);
- }
- else if (functionname != NULL && fmt[-1] == 'C')
- {
- if (filename == (char *) NULL)
- filename = abfd->filename;
+ bfd_boolean need_colon = TRUE;
+ if (functionname != NULL && fmt[-1] == 'C')
+ {
if (last_bfd == NULL
|| last_file == NULL
|| last_function == NULL
|| last_bfd != abfd
- || strcmp (last_file, filename) != 0
+ || (filename != NULL
+ && strcmp (last_file, filename) != 0)
|| strcmp (last_function, functionname) != 0)
{
- /* We use abfd->filename in this initial line,
- in case filename is a .h file or something
- similarly unhelpful. */
- lfinfo (fp, _("%B: In function `%T':\n"),
- abfd, functionname);
+ lfinfo (fp, _(": In function `%T':\n"),
+ functionname);
+ need_colon = FALSE;
last_bfd = abfd;
if (last_file != NULL)
free (last_file);
- last_file = xstrdup (filename);
+ last_file = NULL;
+ if (filename)
+ last_file = xstrdup (filename);
if (last_function != NULL)
free (last_function);
last_function = xstrdup (functionname);
}
- discard_last = false;
- if (linenumber != 0)
- fprintf (fp, "%s:%u", filename, linenumber);
- else
- lfinfo (fp, "%s(%s+0x%v)", filename, section->name,
- offset);
+ discard_last = FALSE;
}
- else if (filename == NULL
- || strcmp (filename, abfd->filename) == 0)
+
+ if (filename != NULL)
{
- lfinfo (fp, "%B(%s+0x%v)", abfd, section->name,
- offset);
- if (linenumber != 0)
- lfinfo (fp, ":%u", linenumber);
+ if (need_colon)
+ putc (':', fp);
+ fputs (filename, fp);
}
- else if (linenumber != 0)
- lfinfo (fp, "%B:%s:%u", abfd, filename, linenumber);
- else
- lfinfo (fp, "%B(%s+0x%v):%s", abfd, section->name,
- offset, filename);
+
+ if (functionname != NULL && fmt[-1] == 'G')
+ lfinfo (fp, ":%T", functionname);
+ else if (filename != NULL && linenumber != 0)
+ fprintf (fp, ":%u", linenumber);
}
- else
- lfinfo (fp, "%B(%s+0x%v)", abfd, section->name, offset);
+
+ if (asymbols != NULL && entry == NULL)
+ free (asymbols);
if (discard_last)
{
@@ -379,9 +357,9 @@ vfinfo (fp, fmt, arg)
}
if (config.fatal_warnings)
- config.make_executable = false;
+ config.make_executable = FALSE;
- if (fatal == true)
+ if (fatal)
xexit (1);
}
@@ -389,8 +367,7 @@ vfinfo (fp, fmt, arg)
other such chars that would otherwise confuse the demangler. */
char *
-demangle (name)
- const char *name;
+demangle (const char *name)
{
char *res;
const char *p;
@@ -431,34 +408,32 @@ demangle (name)
/* Format info message and print on stdout. */
/* (You would think this should be called just "info", but then you
- would hosed by LynxOS, which defines that name in its libc.) */
+ would be hosed by LynxOS, which defines that name in its libc.) */
void
-info_msg VPARAMS ((const char *fmt, ...))
+info_msg (const char *fmt, ...)
{
- VA_OPEN (arg, fmt);
- VA_FIXEDARG (arg, const char *, fmt);
+ va_list arg;
+ va_start (arg, fmt);
vfinfo (stdout, fmt, arg);
- VA_CLOSE (arg);
+ va_end (arg);
}
/* ('e' for error.) Format info message and print on stderr. */
void
-einfo VPARAMS ((const char *fmt, ...))
+einfo (const char *fmt, ...)
{
- VA_OPEN (arg, fmt);
- VA_FIXEDARG (arg, const char *, fmt);
+ va_list arg;
+ va_start (arg, fmt);
vfinfo (stderr, fmt, arg);
- VA_CLOSE (arg);
+ va_end (arg);
}
void
-info_assert (file, line)
- const char *file;
- unsigned int line;
+info_assert (const char *file, unsigned int line)
{
einfo (_("%F%P: internal error %s %d\n"), file, line);
}
@@ -466,36 +441,35 @@ info_assert (file, line)
/* ('m' for map) Format info message and print on map. */
void
-minfo VPARAMS ((const char *fmt, ...))
+minfo (const char *fmt, ...)
{
- VA_OPEN (arg, fmt);
- VA_FIXEDARG (arg, const char *, fmt);
+ va_list arg;
+ va_start (arg, fmt);
vfinfo (config.map_file, fmt, arg);
- VA_CLOSE (arg);
+ va_end (arg);
}
void
-lfinfo VPARAMS ((FILE *file, const char *fmt, ...))
+lfinfo (FILE *file, const char *fmt, ...)
{
- VA_OPEN (arg, fmt);
- VA_FIXEDARG (arg, FILE *, file);
- VA_FIXEDARG (arg, const char *, fmt);
+ va_list arg;
+ va_start (arg, fmt);
vfinfo (file, fmt, arg);
- VA_CLOSE (arg);
+ va_end (arg);
}
/* Functions to print the link map. */
void
-print_space ()
+print_space (void)
{
fprintf (config.map_file, " ");
}
void
-print_nl ()
+print_nl (void)
{
fprintf (config.map_file, "\n");
}
@@ -504,10 +478,7 @@ print_nl ()
call this function. */
void
-ld_abort (file, line, fn)
- const char *file;
- int line;
- const char *fn;
+ld_abort (const char *file, int line, const char *fn)
{
if (fn != NULL)
einfo (_("%P: internal error: aborting at %s line %d in %s\n"),
@@ -518,3 +489,64 @@ ld_abort (file, line, fn)
einfo (_("%P%F: please report this bug\n"));
xexit (1);
}
+
+bfd_boolean
+error_handler (int id, const char *fmt, ...)
+{
+ va_list arg;
+
+ va_start (arg, fmt);
+
+ switch (id)
+ {
+ default:
+ break;
+
+ /* We can be called with
+
+ error_handler (-LD_DEFINITION_IN_DISCARDED_SECTION, "", 0);
+
+ to make this error non-fatal and
+
+ error_handler (-LD_DEFINITION_IN_DISCARDED_SECTION, "", 1);
+
+ to make this error fatal. */
+ case -LD_DEFINITION_IN_DISCARDED_SECTION:
+ case LD_DEFINITION_IN_DISCARDED_SECTION:
+ {
+ static struct bfd_hash_table *hash;
+ static int fatal = 1;
+ const char *name;
+
+ if (id == -LD_DEFINITION_IN_DISCARDED_SECTION)
+ {
+ fatal = va_arg (arg, int);
+ goto out;
+ }
+
+ name = va_arg (arg, const char *);
+ /* Only warn once about a particular undefined symbol. */
+ if (hash == NULL)
+ {
+ hash = xmalloc (sizeof (struct bfd_hash_table));
+ if (! bfd_hash_table_init (hash, bfd_hash_newfunc))
+ einfo (_("%F%P: bfd_hash_table_init failed: %E\n"));
+ }
+
+ if (bfd_hash_lookup (hash, name, FALSE, FALSE) != NULL)
+ goto out;
+
+ if (bfd_hash_lookup (hash, name, TRUE, TRUE) == NULL)
+ einfo (_("%F%P: bfd_hash_lookup failed: %E\n"));
+
+ if (fatal)
+ config.make_executable = FALSE;
+ }
+ break;
+ }
+ vfinfo (stderr, fmt, arg);
+
+out:
+ va_end (arg);
+ return TRUE;
+}
diff --git a/contrib/binutils/ld/ldmisc.h b/contrib/binutils/ld/ldmisc.h
index aa3f6af..b2812fb 100644
--- a/contrib/binutils/ld/ldmisc.h
+++ b/contrib/binutils/ld/ldmisc.h
@@ -1,5 +1,5 @@
/* ldmisc.h -
- Copyright 1991, 1992, 1993, 1994, 1996, 1997, 2001
+ Copyright 1991, 1992, 1993, 1994, 1996, 1997, 2001, 2003
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -22,15 +22,16 @@
#ifndef LDMISC_H
#define LDMISC_H
-extern void einfo PARAMS ((const char *, ...));
-extern void minfo PARAMS ((const char *, ...));
-extern void info_msg PARAMS ((const char *, ...));
-extern void lfinfo PARAMS ((FILE *, const char *, ...));
-extern void info_assert PARAMS ((const char *, unsigned int));
-extern void yyerror PARAMS ((const char *));
-extern PTR xmalloc PARAMS ((size_t));
-extern PTR xrealloc PARAMS ((PTR, size_t));
-extern void xexit PARAMS ((int));
+extern bfd_boolean error_handler (int, const char *, ...);
+extern void einfo (const char *, ...);
+extern void minfo (const char *, ...);
+extern void info_msg (const char *, ...);
+extern void lfinfo (FILE *, const char *, ...);
+extern void info_assert (const char *, unsigned int);
+extern void yyerror (const char *);
+extern void *xmalloc (size_t);
+extern void *xrealloc (void *, size_t);
+extern void xexit (int);
#define ASSERT(x) \
do { if (!(x)) info_assert(__FILE__,__LINE__); } while (0)
@@ -38,8 +39,8 @@ do { if (!(x)) info_assert(__FILE__,__LINE__); } while (0)
#define FAIL() \
do { info_assert(__FILE__,__LINE__); } while (0)
-extern void print_space PARAMS ((void));
-extern void print_nl PARAMS ((void));
-extern char *demangle PARAMS ((const char *));
+extern void print_space (void);
+extern void print_nl (void);
+extern char *demangle (const char *);
#endif
diff --git a/contrib/binutils/ld/ldver.c b/contrib/binutils/ld/ldver.c
index f81884c..710bf90 100644
--- a/contrib/binutils/ld/ldver.c
+++ b/contrib/binutils/ld/ldver.c
@@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include "bfd.h"
+#include "bfdver.h"
#include "sysdep.h"
#include "ld.h"
@@ -31,8 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ldmain.h"
void
-ldversion (noisy)
- int noisy;
+ldversion (int noisy)
{
/* Output for noisy == 2 is intended to follow the GNU standards. */
fprintf (stdout, _("GNU ld version %s\n"), BFD_VERSION_STRING);
diff --git a/contrib/binutils/ld/ldver.h b/contrib/binutils/ld/ldver.h
index ef06937..fd840a8 100644
--- a/contrib/binutils/ld/ldver.h
+++ b/contrib/binutils/ld/ldver.h
@@ -1,5 +1,5 @@
/* ldver.h -- Header file for ldver.c.
- Copyright 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1996, 2003 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -17,4 +17,4 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-void ldversion PARAMS ((int));
+void ldversion (int);
diff --git a/contrib/binutils/ld/ldver.texi b/contrib/binutils/ld/ldver.texi
new file mode 100644
index 0000000..3610a96
--- /dev/null
+++ b/contrib/binutils/ld/ldver.texi
@@ -0,0 +1 @@
+@set VERSION 2.15
diff --git a/contrib/binutils/ld/ldwrite.c b/contrib/binutils/ld/ldwrite.c
index eb31171..e4bec32 100644
--- a/contrib/binutils/ld/ldwrite.c
+++ b/contrib/binutils/ld/ldwrite.c
@@ -1,5 +1,5 @@
/* ldwrite.c -- write out the linked file
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2003
Free Software Foundation, Inc.
Written by Steve Chamberlain sac@cygnus.com
@@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "bfdlink.h"
#include "libiberty.h"
+#include "safe-ctype.h"
#include "ld.h"
#include "ldexp.h"
@@ -32,15 +33,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <ldgram.h>
#include "ldmain.h"
-static void build_link_order PARAMS ((lang_statement_union_type *));
-static asection *clone_section PARAMS ((bfd *, asection *, const char *, int *));
-static void split_sections PARAMS ((bfd *, struct bfd_link_info *));
-
/* Build link_order structures for the BFD linker. */
static void
-build_link_order (statement)
- lang_statement_union_type *statement;
+build_link_order (lang_statement_union_type *statement)
{
switch (statement->header.type)
{
@@ -49,7 +45,7 @@ build_link_order (statement)
asection *output_section;
struct bfd_link_order *link_order;
bfd_vma value;
- boolean big_endian = false;
+ bfd_boolean big_endian = FALSE;
output_section = statement->data_statement.output_section;
ASSERT (output_section->owner == output_bfd);
@@ -60,7 +56,7 @@ build_link_order (statement)
link_order->type = bfd_data_link_order;
link_order->offset = statement->data_statement.output_vma;
- link_order->u.data.contents = (bfd_byte *) xmalloc (QUAD_SIZE);
+ link_order->u.data.contents = xmalloc (QUAD_SIZE);
value = statement->data_statement.value;
@@ -70,24 +66,24 @@ build_link_order (statement)
endianness are big endian, so we must swap here if the
input file is little endian. */
if (bfd_big_endian (output_bfd))
- big_endian = true;
+ big_endian = TRUE;
else if (bfd_little_endian (output_bfd))
- big_endian = false;
+ big_endian = FALSE;
else
{
- boolean swap;
+ bfd_boolean swap;
- swap = false;
+ swap = FALSE;
if (command_line.endian == ENDIAN_BIG)
- big_endian = true;
+ big_endian = TRUE;
else if (command_line.endian == ENDIAN_LITTLE)
{
- big_endian = false;
- swap = true;
+ big_endian = FALSE;
+ swap = TRUE;
}
else if (command_line.endian == ENDIAN_UNSET)
{
- big_endian = true;
+ big_endian = TRUE;
{
LANG_FOR_EACH_INPUT_STATEMENT (s)
{
@@ -95,8 +91,8 @@ build_link_order (statement)
{
if (bfd_little_endian (s->the_bfd))
{
- big_endian = false;
- swap = true;
+ big_endian = FALSE;
+ swap = TRUE;
}
break;
}
@@ -197,9 +193,7 @@ build_link_order (statement)
link_order->offset = rs->output_vma;
link_order->size = bfd_get_reloc_size (rs->howto);
- link_order->u.reloc.p =
- ((struct bfd_link_order_reloc *)
- xmalloc (sizeof (struct bfd_link_order_reloc)));
+ link_order->u.reloc.p = xmalloc (sizeof (struct bfd_link_order_reloc));
link_order->u.reloc.p->reloc = rs->reloc;
link_order->u.reloc.p->addend = rs->addend_value;
@@ -226,7 +220,7 @@ build_link_order (statement)
case lang_input_section_enum:
/* Create a new link_order in the output section with this
attached */
- if (statement->input_section.ifile->just_syms_flag == false)
+ if (!statement->input_section.ifile->just_syms_flag)
{
asection *i = statement->input_section.section;
asection *output_section = i->output_section;
@@ -292,9 +286,24 @@ build_link_order (statement)
}
}
-/* Call BFD to write out the linked file. */
+/* Return true if NAME is the name of an unsplittable section. These
+ are the stabs strings, dwarf strings. */
-/**********************************************************************/
+static bfd_boolean
+unsplittable_name (const char *name)
+{
+ if (strncmp (name, ".stab", 5) == 0)
+ {
+ /* There are several stab like string sections. We pattern match on
+ ".stab...str" */
+ unsigned len = strlen (name);
+ if (strcmp (&name[len-3], "str") == 0)
+ return TRUE;
+ }
+ else if (strcmp (name, "$GDB_STRINGS$") == 0)
+ return TRUE;
+ return FALSE;
+}
/* Wander around the input sections, make sure that
we'll never try and create an output section with more relocs
@@ -302,31 +311,53 @@ build_link_order (statement)
creating new output sections with all the right bits. */
#define TESTIT 1
static asection *
-clone_section (abfd, s, name, count)
- bfd *abfd;
- asection *s;
- const char *name;
- int *count;
+clone_section (bfd *abfd, asection *s, const char *name, int *count)
{
- char templ[6];
+ char *tname;
char *sname;
+ unsigned int len;
asection *n;
struct bfd_link_hash_entry *h;
- /* Invent a section name from the first five chars of the base
- section name and a digit suffix. */
- strncpy (templ, name, sizeof (templ) - 1);
- templ[sizeof (templ) - 1] = '\0';
- if ((sname = bfd_get_unique_section_name (abfd, templ, count)) == NULL
+ /* Invent a section name from the section name and a dotted numeric
+ suffix. */
+ len = strlen (name);
+ tname = xmalloc (len + 1);
+ memcpy (tname, name, len + 1);
+ /* Remove a dotted number suffix, from a previous split link. */
+ while (len && ISDIGIT (tname[len-1]))
+ len--;
+ if (len > 1 && tname[len-1] == '.')
+ /* It was a dotted number. */
+ tname[len-1] = 0;
+
+ /* We want to use the whole of the original section name for the
+ split name, but coff can be restricted to 8 character names. */
+ if (bfd_family_coff (abfd) && strlen (tname) > 5)
+ {
+ /* Some section names cannot be truncated, as the name is
+ used to locate some other section. */
+ if (strncmp (name, ".stab", 5) == 0
+ || strcmp (name, "$GDB_SYMBOLS$") == 0)
+ {
+ einfo (_ ("%F%P: cannot create split section name for %s\n"), name);
+ /* Silence gcc warnings. einfo exits, so we never reach here. */
+ return NULL;
+ }
+ tname[5] = 0;
+ }
+
+ if ((sname = bfd_get_unique_section_name (abfd, tname, count)) == NULL
|| (n = bfd_make_section_anyway (abfd, sname)) == NULL
|| (h = bfd_link_hash_lookup (link_info.hash,
- sname, true, true, false)) == NULL)
+ sname, TRUE, TRUE, FALSE)) == NULL)
{
einfo (_("%F%P: clone section failed: %E\n"));
/* Silence gcc warnings. einfo exits, so we never reach here. */
return NULL;
}
-
+ free (tname);
+
/* Set up section symbol. */
h->type = bfd_link_hash_defined;
h->u.def.value = 0;
@@ -348,8 +379,7 @@ clone_section (abfd, s, name, count)
#if TESTING
static void
-ds (s)
- asection *s;
+ds (asection *s)
{
struct bfd_link_order *l = s->link_order_head;
printf ("vma %x size %x\n", s->vma, s->_raw_size);
@@ -368,10 +398,7 @@ ds (s)
printf ("\n");
}
-dump (s, a1, a2)
- char *s;
- asection *a1;
- asection *a2;
+dump (char *s, asection *a1, asection *a2)
{
printf ("%s\n", s);
ds (a1);
@@ -379,8 +406,7 @@ dump (s, a1, a2)
}
static void
-sanity_check (abfd)
- bfd *abfd;
+sanity_check (bfd *abfd)
{
asection *s;
for (s = abfd->sections; s; s = s->next)
@@ -403,9 +429,7 @@ sanity_check (abfd)
#endif
static void
-split_sections (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+split_sections (bfd *abfd, struct bfd_link_info *info)
{
asection *original_sec;
int nsecs = abfd->section_count;
@@ -441,7 +465,7 @@ split_sections (abfd, info)
|| info->strip == strip_some)
thislines = sec->lineno_count;
- if (info->relocateable)
+ if (info->relocatable)
thisrelocs = sec->reloc_count;
if (sec->_cooked_size != 0)
@@ -450,7 +474,7 @@ split_sections (abfd, info)
thissize = sec->_raw_size;
}
- else if (info->relocateable
+ else if (info->relocatable
&& (p->type == bfd_section_reloc_link_order
|| p->type == bfd_symbol_reloc_link_order))
thisrelocs++;
@@ -458,7 +482,8 @@ split_sections (abfd, info)
if (l != NULL
&& (thisrelocs + relocs >= config.split_by_reloc
|| thislines + lines >= config.split_by_reloc
- || thissize + sec_size >= config.split_by_file))
+ || (thissize + sec_size >= config.split_by_file))
+ && !unsplittable_name (cursor->name))
{
/* Create a new section and put this link order and the
following link orders into it. */
@@ -524,10 +549,10 @@ split_sections (abfd, info)
sanity_check (abfd);
}
-/**********************************************************************/
+/* Call BFD to write out the linked file. */
void
-ldwrite ()
+ldwrite (void)
{
/* Reset error indicator, which can typically something like invalid
format from opening up the .o files. */
diff --git a/contrib/binutils/ld/ldwrite.h b/contrib/binutils/ld/ldwrite.h
index 68d8b52..13617c0 100644
--- a/contrib/binutils/ld/ldwrite.h
+++ b/contrib/binutils/ld/ldwrite.h
@@ -1,5 +1,5 @@
/* ldwrite.h -
- Copyright 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 2003 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -15,6 +15,7 @@
You should have received a copy of the GNU General Public License
along with GLD; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-void ldwrite PARAMS ((void));
+void ldwrite (void);
diff --git a/contrib/binutils/ld/lexsup.c b/contrib/binutils/ld/lexsup.c
index f0d4c50..b377bd4 100644
--- a/contrib/binutils/ld/lexsup.c
+++ b/contrib/binutils/ld/lexsup.c
@@ -1,24 +1,24 @@
/* Parse options for the GNU linker.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002
+ 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
-This file is part of GLD, the Gnu Linker.
+ This file is part of GLD, the Gnu Linker.
-GLD is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+ GLD is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
-GLD is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ GLD is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with GLD; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with GLD; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -53,85 +53,97 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
-static int is_num PARAMS ((const char *, int, int, int));
-static void set_default_dirlist PARAMS ((char *dirlist_ptr));
-static void set_section_start PARAMS ((char *sect, char *valstr));
-static void help PARAMS ((void));
+static void set_default_dirlist (char *);
+static void set_section_start (char *, char *);
+static void help (void);
/* Non-zero if we are processing a --defsym from the command line. */
int parsing_defsym = 0;
/* Codes used for the long options with no short synonyms. 150 isn't
special; it's just an arbitrary non-ASCII char value. */
-
-#define OPTION_ASSERT 150
-#define OPTION_CALL_SHARED (OPTION_ASSERT + 1)
-#define OPTION_CREF (OPTION_CALL_SHARED + 1)
-#define OPTION_DEFSYM (OPTION_CREF + 1)
-#define OPTION_DEMANGLE (OPTION_DEFSYM + 1)
-#define OPTION_DYNAMIC_LINKER (OPTION_DEMANGLE + 1)
-#define OPTION_EB (OPTION_DYNAMIC_LINKER + 1)
-#define OPTION_EL (OPTION_EB + 1)
-#define OPTION_EMBEDDED_RELOCS (OPTION_EL + 1)
-#define OPTION_EXPORT_DYNAMIC (OPTION_EMBEDDED_RELOCS + 1)
-#define OPTION_HELP (OPTION_EXPORT_DYNAMIC + 1)
-#define OPTION_IGNORE (OPTION_HELP + 1)
-#define OPTION_MAP (OPTION_IGNORE + 1)
-#define OPTION_NO_DEMANGLE (OPTION_MAP + 1)
-#define OPTION_NO_KEEP_MEMORY (OPTION_NO_DEMANGLE + 1)
-#define OPTION_NO_WARN_MISMATCH (OPTION_NO_KEEP_MEMORY + 1)
-#define OPTION_NOINHIBIT_EXEC (OPTION_NO_WARN_MISMATCH + 1)
-#define OPTION_NON_SHARED (OPTION_NOINHIBIT_EXEC + 1)
-#define OPTION_NO_WHOLE_ARCHIVE (OPTION_NON_SHARED + 1)
-#define OPTION_OFORMAT (OPTION_NO_WHOLE_ARCHIVE + 1)
-#define OPTION_RELAX (OPTION_OFORMAT + 1)
-#define OPTION_RETAIN_SYMBOLS_FILE (OPTION_RELAX + 1)
-#define OPTION_RPATH (OPTION_RETAIN_SYMBOLS_FILE + 1)
-#define OPTION_RPATH_LINK (OPTION_RPATH + 1)
-#define OPTION_SHARED (OPTION_RPATH_LINK + 1)
-#define OPTION_SONAME (OPTION_SHARED + 1)
-#define OPTION_SORT_COMMON (OPTION_SONAME + 1)
-#define OPTION_STATS (OPTION_SORT_COMMON + 1)
-#define OPTION_SYMBOLIC (OPTION_STATS + 1)
-#define OPTION_TASK_LINK (OPTION_SYMBOLIC + 1)
-#define OPTION_TBSS (OPTION_TASK_LINK + 1)
-#define OPTION_TDATA (OPTION_TBSS + 1)
-#define OPTION_TTEXT (OPTION_TDATA + 1)
-#define OPTION_TRADITIONAL_FORMAT (OPTION_TTEXT + 1)
-#define OPTION_UR (OPTION_TRADITIONAL_FORMAT + 1)
-#define OPTION_VERBOSE (OPTION_UR + 1)
-#define OPTION_VERSION (OPTION_VERBOSE + 1)
-#define OPTION_VERSION_SCRIPT (OPTION_VERSION + 1)
-#define OPTION_VERSION_EXPORTS_SECTION (OPTION_VERSION_SCRIPT + 1)
-#define OPTION_WARN_COMMON (OPTION_VERSION_EXPORTS_SECTION + 1)
-#define OPTION_WARN_CONSTRUCTORS (OPTION_WARN_COMMON + 1)
-#define OPTION_WARN_FATAL (OPTION_WARN_CONSTRUCTORS + 1)
-#define OPTION_WARN_MULTIPLE_GP (OPTION_WARN_FATAL + 1)
-#define OPTION_WARN_ONCE (OPTION_WARN_MULTIPLE_GP + 1)
-#define OPTION_WARN_SECTION_ALIGN (OPTION_WARN_ONCE + 1)
-#define OPTION_SPLIT_BY_RELOC (OPTION_WARN_SECTION_ALIGN + 1)
-#define OPTION_SPLIT_BY_FILE (OPTION_SPLIT_BY_RELOC + 1)
-#define OPTION_WHOLE_ARCHIVE (OPTION_SPLIT_BY_FILE + 1)
-#define OPTION_WRAP (OPTION_WHOLE_ARCHIVE + 1)
-#define OPTION_FORCE_EXE_SUFFIX (OPTION_WRAP + 1)
-#define OPTION_GC_SECTIONS (OPTION_FORCE_EXE_SUFFIX + 1)
-#define OPTION_NO_GC_SECTIONS (OPTION_GC_SECTIONS + 1)
-#define OPTION_CHECK_SECTIONS (OPTION_NO_GC_SECTIONS + 1)
-#define OPTION_NO_CHECK_SECTIONS (OPTION_CHECK_SECTIONS + 1)
-#define OPTION_MPC860C0 (OPTION_NO_CHECK_SECTIONS + 1)
-#define OPTION_NO_UNDEFINED (OPTION_MPC860C0 + 1)
-#define OPTION_INIT (OPTION_NO_UNDEFINED + 1)
-#define OPTION_FINI (OPTION_INIT + 1)
-#define OPTION_SECTION_START (OPTION_FINI + 1)
-#define OPTION_UNIQUE (OPTION_SECTION_START + 1)
-#define OPTION_TARGET_HELP (OPTION_UNIQUE + 1)
-#define OPTION_ALLOW_SHLIB_UNDEFINED (OPTION_TARGET_HELP + 1)
-#define OPTION_ALLOW_MULTIPLE_DEFINITION (OPTION_ALLOW_SHLIB_UNDEFINED + 1)
-#define OPTION_NO_UNDEFINED_VERSION (OPTION_ALLOW_MULTIPLE_DEFINITION + 1)
-#define OPTION_DISCARD_NONE (OPTION_NO_UNDEFINED_VERSION + 1)
-#define OPTION_SPARE_DYNAMIC_TAGS (OPTION_DISCARD_NONE + 1)
-#define OPTION_NO_DEFINE_COMMON (OPTION_SPARE_DYNAMIC_TAGS + 1)
-#define OPTION_NOSTDLIB (OPTION_NO_DEFINE_COMMON + 1)
+enum option_values
+{
+ OPTION_ASSERT = 150,
+ OPTION_CALL_SHARED,
+ OPTION_CREF,
+ OPTION_DEFSYM,
+ OPTION_DEMANGLE,
+ OPTION_DYNAMIC_LINKER,
+ OPTION_EB,
+ OPTION_EL,
+ OPTION_EMBEDDED_RELOCS,
+ OPTION_EXPORT_DYNAMIC,
+ OPTION_HELP,
+ OPTION_IGNORE,
+ OPTION_MAP,
+ OPTION_NO_DEMANGLE,
+ OPTION_NO_KEEP_MEMORY,
+ OPTION_NO_WARN_MISMATCH,
+ OPTION_NOINHIBIT_EXEC,
+ OPTION_NON_SHARED,
+ OPTION_NO_WHOLE_ARCHIVE,
+ OPTION_OFORMAT,
+ OPTION_RELAX,
+ OPTION_RETAIN_SYMBOLS_FILE,
+ OPTION_RPATH,
+ OPTION_RPATH_LINK,
+ OPTION_SHARED,
+ OPTION_SONAME,
+ OPTION_SORT_COMMON,
+ OPTION_STATS,
+ OPTION_SYMBOLIC,
+ OPTION_TASK_LINK,
+ OPTION_TBSS,
+ OPTION_TDATA,
+ OPTION_TTEXT,
+ OPTION_TRADITIONAL_FORMAT,
+ OPTION_UR,
+ OPTION_VERBOSE,
+ OPTION_VERSION,
+ OPTION_VERSION_SCRIPT,
+ OPTION_VERSION_EXPORTS_SECTION,
+ OPTION_WARN_COMMON,
+ OPTION_WARN_CONSTRUCTORS,
+ OPTION_WARN_FATAL,
+ OPTION_WARN_MULTIPLE_GP,
+ OPTION_WARN_ONCE,
+ OPTION_WARN_SECTION_ALIGN,
+ OPTION_SPLIT_BY_RELOC,
+ OPTION_SPLIT_BY_FILE ,
+ OPTION_WHOLE_ARCHIVE,
+ OPTION_AS_NEEDED,
+ OPTION_NO_AS_NEEDED,
+ OPTION_WRAP,
+ OPTION_FORCE_EXE_SUFFIX,
+ OPTION_GC_SECTIONS,
+ OPTION_NO_GC_SECTIONS,
+ OPTION_CHECK_SECTIONS,
+ OPTION_NO_CHECK_SECTIONS,
+ OPTION_NO_UNDEFINED,
+ OPTION_INIT,
+ OPTION_FINI,
+ OPTION_SECTION_START,
+ OPTION_UNIQUE,
+ OPTION_TARGET_HELP,
+ OPTION_ALLOW_SHLIB_UNDEFINED,
+ OPTION_NO_ALLOW_SHLIB_UNDEFINED,
+ OPTION_ALLOW_MULTIPLE_DEFINITION,
+ OPTION_NO_UNDEFINED_VERSION,
+ OPTION_DISCARD_NONE,
+ OPTION_SPARE_DYNAMIC_TAGS,
+ OPTION_NO_DEFINE_COMMON,
+ OPTION_NOSTDLIB,
+ OPTION_NO_OMAGIC,
+ OPTION_STRIP_DISCARDED,
+ OPTION_NO_STRIP_DISCARDED,
+ OPTION_ACCEPT_UNKNOWN_INPUT_ARCH,
+ OPTION_NO_ACCEPT_UNKNOWN_INPUT_ARCH,
+ OPTION_PIE,
+ OPTION_UNRESOLVED_SYMBOLS,
+ OPTION_WARN_UNRESOLVED_SYMBOLS,
+ OPTION_ERROR_UNRESOLVED_SYMBOLS
+};
/* The long options. This structure is used for both the option
parsing and the help text. */
@@ -217,6 +229,8 @@ static const struct ld_option ld_options[] =
{ {"omagic", no_argument, NULL, 'N'},
'N', NULL, N_("Do not page align data, do not make text readonly"),
EXACTLY_TWO_DASHES },
+ { {"no-omagic", no_argument, NULL, OPTION_NO_OMAGIC},
+ '\0', NULL, N_("Page align data, make text readonly"), EXACTLY_TWO_DASHES },
{ {"output", required_argument, NULL, 'o'},
'o', N_("FILE"), N_("Set output file name"), EXACTLY_TWO_DASHES },
{ {NULL, required_argument, NULL, '\0'},
@@ -225,8 +239,8 @@ static const struct ld_option ld_options[] =
'\0', NULL, N_("Ignored for SVR4 compatibility"), ONE_DASH },
{ {"emit-relocs", no_argument, NULL, 'q'},
'q', NULL, "Generate relocations in final output", TWO_DASHES },
- { {"relocateable", no_argument, NULL, 'r'},
- 'r', NULL, N_("Generate relocateable output"), TWO_DASHES },
+ { {"relocatable", no_argument, NULL, 'r'},
+ 'r', NULL, N_("Generate relocatable output"), TWO_DASHES },
{ {NULL, no_argument, NULL, '\0'},
'i', NULL, NULL, ONE_DASH },
{ {"just-symbols", required_argument, NULL, 'R'},
@@ -236,6 +250,10 @@ static const struct ld_option ld_options[] =
's', NULL, N_("Strip all symbols"), TWO_DASHES },
{ {"strip-debug", no_argument, NULL, 'S'},
'S', NULL, N_("Strip debugging symbols"), TWO_DASHES },
+ { {"strip-discarded", no_argument, NULL, OPTION_STRIP_DISCARDED},
+ '\0', NULL, N_("Strip symbols in discarded sections"), TWO_DASHES },
+ { {"no-strip-discarded", no_argument, NULL, OPTION_NO_STRIP_DISCARDED},
+ '\0', NULL, N_("Do not strip symbols in discarded sections"), TWO_DASHES },
{ {"trace", no_argument, NULL, 't'},
't', NULL, N_("Trace file opens"), TWO_DASHES },
{ {"script", required_argument, NULL, 'T'},
@@ -264,6 +282,10 @@ static const struct ld_option ld_options[] =
'(', NULL, N_("Start a group"), TWO_DASHES },
{ {"end-group", no_argument, NULL, ')'},
')', NULL, N_("End a group"), TWO_DASHES },
+ { {"accept-unknown-input-arch", no_argument, NULL, OPTION_ACCEPT_UNKNOWN_INPUT_ARCH},
+ '\0', NULL, N_("Accept input files whose architecture cannot be determined"), TWO_DASHES },
+ { {"no-accept-unknown-input-arch", no_argument, NULL, OPTION_NO_ACCEPT_UNKNOWN_INPUT_ARCH},
+ '\0', NULL, N_("Reject input files whose architecture is unknown"), TWO_DASHES },
{ {"assert", required_argument, NULL, OPTION_ASSERT},
'\0', N_("KEYWORD"), N_("Ignored for SunOS compatibility"), ONE_DASH },
{ {"Bdynamic", no_argument, NULL, OPTION_CALL_SHARED},
@@ -318,9 +340,11 @@ static const struct ld_option ld_options[] =
{ {"no-keep-memory", no_argument, NULL, OPTION_NO_KEEP_MEMORY},
'\0', NULL, N_("Use less memory and more disk I/O"), TWO_DASHES },
{ {"no-undefined", no_argument, NULL, OPTION_NO_UNDEFINED},
- '\0', NULL, N_("Allow no undefined symbols"), TWO_DASHES },
+ '\0', NULL, N_("Do not allow unresolved references in object files"), TWO_DASHES },
{ {"allow-shlib-undefined", no_argument, NULL, OPTION_ALLOW_SHLIB_UNDEFINED},
- '\0', NULL, N_("Allow undefined symbols in shared objects"), TWO_DASHES },
+ '\0', NULL, N_("Allow unresolved references in shared libaries"), TWO_DASHES },
+ { {"no-allow-shlib-undefined", no_argument, NULL, OPTION_NO_ALLOW_SHLIB_UNDEFINED},
+ '\0', NULL, N_("Do not allow unresolved references in shared libs"), TWO_DASHES },
{ {"allow-multiple-definition", no_argument, NULL, OPTION_ALLOW_MULTIPLE_DEFINITION},
'\0', NULL, N_("Allow multiple definitions"), TWO_DASHES },
{ {"no-undefined-version", no_argument, NULL, OPTION_NO_UNDEFINED_VERSION},
@@ -352,6 +376,10 @@ static const struct ld_option ld_options[] =
'\0', NULL, N_("Create a shared library"), ONE_DASH },
{ {"Bshareable", no_argument, NULL, OPTION_SHARED }, /* FreeBSD. */
'\0', NULL, NULL, ONE_DASH },
+ { {"pie", no_argument, NULL, OPTION_PIE},
+ '\0', NULL, N_("Create a position independent executable"), ONE_DASH },
+ { {"pic-executable", no_argument, NULL, OPTION_PIE},
+ '\0', NULL, NULL, TWO_DASHES },
{ {"sort-common", no_argument, NULL, OPTION_SORT_COMMON},
'\0', NULL, N_("Sort common symbols by size"), TWO_DASHES },
{ {"sort_common", no_argument, NULL, OPTION_SORT_COMMON},
@@ -378,6 +406,9 @@ static const struct ld_option ld_options[] =
'\0', N_("ADDRESS"), N_("Set address of .data section"), ONE_DASH },
{ {"Ttext", required_argument, NULL, OPTION_TTEXT},
'\0', N_("ADDRESS"), N_("Set address of .text section"), ONE_DASH },
+ { {"unresolved-symbols=<method>", required_argument, NULL, OPTION_UNRESOLVED_SYMBOLS},
+ '\0', NULL, N_("How to handle unresolved symbols. <method> is:\n\t\t\t\tignore-all, report-all, ignore-in-object-files,\n\t\t\t\tignore-in-shared-libs"),
+ TWO_DASHES },
{ {"verbose", no_argument, NULL, OPTION_VERBOSE},
'\0', NULL, N_("Output lots of information during link"), TWO_DASHES },
{ {"dll-verbose", no_argument, NULL, OPTION_VERBOSE}, /* Linux. */
@@ -400,59 +431,41 @@ static const struct ld_option ld_options[] =
{ {"warn-section-align", no_argument, NULL, OPTION_WARN_SECTION_ALIGN},
'\0', NULL, N_("Warn if start of section changes due to alignment"),
TWO_DASHES },
+ { {"warn-unresolved-symbols", no_argument, NULL, OPTION_WARN_UNRESOLVED_SYMBOLS},
+ '\0', NULL, N_("Report unresolved symbols as warnings"), TWO_DASHES },
+ { {"error-unresolved-symbols", no_argument, NULL, OPTION_ERROR_UNRESOLVED_SYMBOLS},
+ '\0', NULL, N_("Report unresolved symbols as errors"), TWO_DASHES },
{ {"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL},
'\0', NULL, N_("Treat warnings as errors"),
TWO_DASHES },
{ {"whole-archive", no_argument, NULL, OPTION_WHOLE_ARCHIVE},
'\0', NULL, N_("Include all objects from following archives"), TWO_DASHES },
+ { {"as-needed", no_argument, NULL, OPTION_AS_NEEDED},
+ '\0', NULL, N_("Only set DT_NEEDED for following dynamic libs if used"), TWO_DASHES },
+ { {"no-as-needed", no_argument, NULL, OPTION_NO_AS_NEEDED},
+ '\0', NULL, N_("Always set DT_NEEDED for following dynamic libs"), TWO_DASHES },
{ {"wrap", required_argument, NULL, OPTION_WRAP},
- '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES },
- { {"mpc860c0", optional_argument, NULL, OPTION_MPC860C0},
- '\0', N_("[=WORDS]"), N_("Modify problematic branches in last WORDS (1-10,\n\t\t\t\tdefault 5) words of a page"), TWO_DASHES }
+ '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES }
};
#define OPTION_COUNT ARRAY_SIZE (ld_options)
-/* Test STRING for containing a string of digits that form a number
- between MIN and MAX. The return value is the number or ERR. */
-
-static int
-is_num (string, min, max, err)
- const char *string;
- int min;
- int max;
- int err;
-{
- int result = 0;
-
- for (; *string; ++string)
- {
- if (! ISDIGIT (*string))
- {
- result = err;
- break;
- }
- result = result * 10 + (*string - '0');
- }
- if (result < min || result > max)
- result = err;
-
- return result;
-}
-
void
-parse_args (argc, argv)
- unsigned argc;
- char **argv;
+parse_args (unsigned argc, char **argv)
{
unsigned i;
int is, il, irl;
int ingroup = 0;
char *default_dirlist = NULL;
- char shortopts[OPTION_COUNT * 3 + 2];
- struct option longopts[OPTION_COUNT + 1];
- struct option really_longopts[OPTION_COUNT + 1];
+ char *shortopts;
+ struct option *longopts;
+ struct option *really_longopts;
int last_optind;
+ enum report_method how_to_report_unresolved_symbols = RM_GENERATE_ERROR;
+
+ shortopts = xmalloc (OPTION_COUNT * 3 + 2);
+ longopts = xmalloc (sizeof (*longopts) * (OPTION_COUNT + 1));
+ really_longopts = xmalloc (sizeof (*really_longopts) * (OPTION_COUNT + 1));
/* Starting the short option string with '-' is for programs that
expect options and other ARGV-elements in any order and that care about
@@ -498,6 +511,8 @@ parse_args (argc, argv)
longopts[il].name = NULL;
really_longopts[irl].name = NULL;
+ ldemul_add_options (is, &shortopts, il, &longopts, irl, &really_longopts);
+
/* The -G option is ambiguous on different platforms. Sometimes it
specifies the largest data size to put into the small data
section. Sometimes it is equivalent to --shared. Unfortunately,
@@ -535,7 +550,7 @@ parse_args (argc, argv)
{
char *n;
- n = (char *) xmalloc (strlen (argv[i]) + 20);
+ n = xmalloc (strlen (argv[i]) + 20);
sprintf (n, "--library=%s", argv[i] + 2);
argv[i] = n;
}
@@ -568,6 +583,9 @@ parse_args (argc, argv)
optc = getopt_long (argc, argv, "-", really_longopts, &longind);
}
+ if (ldemul_handle_option (optc))
+ continue;
+
if (optc == -1)
break;
@@ -579,21 +597,20 @@ parse_args (argc, argv)
einfo (_("%P%F: use the --help option for usage information\n"));
case 1: /* File name. */
- lang_add_input_file (optarg, lang_input_file_is_file_enum,
- (char *) NULL);
+ lang_add_input_file (optarg, lang_input_file_is_file_enum, NULL);
break;
case OPTION_IGNORE:
break;
case 'a':
/* For HP/UX compatibility. Actually -a shared should mean
- ``use only shared libraries'' but, then, we don't
- currently support shared libraries on HP/UX anyhow. */
+ ``use only shared libraries'' but, then, we don't
+ currently support shared libraries on HP/UX anyhow. */
if (strcmp (optarg, "archive") == 0)
- config.dynamic_link = false;
+ config.dynamic_link = FALSE;
else if (strcmp (optarg, "shared") == 0
|| strcmp (optarg, "default") == 0)
- config.dynamic_link = true;
+ config.dynamic_link = TRUE;
else
einfo (_("%P%F: unrecognized -a option `%s'\n"), optarg);
break;
@@ -622,17 +639,17 @@ parse_args (argc, argv)
yyparse ();
break;
case OPTION_CALL_SHARED:
- config.dynamic_link = true;
+ config.dynamic_link = TRUE;
break;
case OPTION_NON_SHARED:
- config.dynamic_link = false;
+ config.dynamic_link = FALSE;
break;
case OPTION_CREF:
- command_line.cref = true;
- link_info.notice_all = true;
+ command_line.cref = TRUE;
+ link_info.notice_all = TRUE;
break;
case 'd':
- command_line.force_common_definition = true;
+ command_line.force_common_definition = TRUE;
break;
case OPTION_DEFSYM:
lex_string = optarg;
@@ -644,7 +661,7 @@ parse_args (argc, argv)
lex_string = NULL;
break;
case OPTION_DEMANGLE:
- demangling = true;
+ demangling = TRUE;
if (optarg != NULL)
{
enum demangling_styles style;
@@ -668,20 +685,19 @@ parse_args (argc, argv)
command_line.endian = ENDIAN_LITTLE;
break;
case OPTION_EMBEDDED_RELOCS:
- command_line.embedded_relocs = true;
+ command_line.embedded_relocs = TRUE;
break;
case OPTION_EXPORT_DYNAMIC:
case 'E': /* HP/UX compatibility. */
- link_info.export_dynamic = true;
+ link_info.export_dynamic = TRUE;
break;
case 'e':
- lang_add_entry (optarg, true);
+ lang_add_entry (optarg, TRUE);
break;
case 'f':
if (command_line.auxiliary_filters == NULL)
{
- command_line.auxiliary_filters =
- (char **) xmalloc (2 * sizeof (char *));
+ command_line.auxiliary_filters = xmalloc (2 * sizeof (char *));
command_line.auxiliary_filters[0] = optarg;
command_line.auxiliary_filters[1] = NULL;
}
@@ -693,9 +709,9 @@ parse_args (argc, argv)
c = 0;
for (p = command_line.auxiliary_filters; *p != NULL; p++)
++c;
- command_line.auxiliary_filters =
- (char **) xrealloc (command_line.auxiliary_filters,
- (c + 2) * sizeof (char *));
+ command_line.auxiliary_filters
+ = xrealloc (command_line.auxiliary_filters,
+ (c + 2) * sizeof (char *));
command_line.auxiliary_filters[c] = optarg;
command_line.auxiliary_filters[c + 1] = NULL;
}
@@ -704,7 +720,7 @@ parse_args (argc, argv)
command_line.filter_shlib = optarg;
break;
case OPTION_FORCE_EXE_SUFFIX:
- command_line.force_exe_suffix = true;
+ command_line.force_exe_suffix = TRUE;
break;
case 'G':
{
@@ -718,18 +734,17 @@ parse_args (argc, argv)
/* Ignore. */
break;
case OPTION_GC_SECTIONS:
- command_line.gc_sections = true;
+ command_line.gc_sections = TRUE;
break;
case OPTION_HELP:
help ();
xexit (0);
break;
case 'L':
- ldfile_add_library_path (optarg, true);
+ ldfile_add_library_path (optarg, TRUE);
break;
case 'l':
- lang_add_input_file (optarg, lang_input_file_is_l_enum,
- (char *) NULL);
+ lang_add_input_file (optarg, lang_input_file_is_l_enum, NULL);
break;
case 'M':
config.map_filename = "-";
@@ -741,49 +756,97 @@ parse_args (argc, argv)
config.map_filename = optarg;
break;
case 'N':
- config.text_read_only = false;
- config.magic_demand_paged = false;
- config.dynamic_link = false;
+ config.text_read_only = FALSE;
+ config.magic_demand_paged = FALSE;
+ config.dynamic_link = FALSE;
+ break;
+ case OPTION_NO_OMAGIC:
+ config.text_read_only = TRUE;
+ config.magic_demand_paged = TRUE;
+ /* NB/ Does not set dynamic_link to TRUE.
+ Use --call-shared or -Bdynamic for this. */
break;
case 'n':
- config.magic_demand_paged = false;
- config.dynamic_link = false;
+ config.magic_demand_paged = FALSE;
+ config.dynamic_link = FALSE;
break;
case OPTION_NO_DEFINE_COMMON:
- command_line.inhibit_common_definition = true;
+ command_line.inhibit_common_definition = TRUE;
break;
case OPTION_NO_DEMANGLE:
- demangling = false;
+ demangling = FALSE;
break;
case OPTION_NO_GC_SECTIONS:
- command_line.gc_sections = false;
+ command_line.gc_sections = FALSE;
break;
case OPTION_NO_KEEP_MEMORY:
- link_info.keep_memory = false;
+ link_info.keep_memory = FALSE;
break;
case OPTION_NO_UNDEFINED:
- link_info.no_undefined = true;
+ link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols;
break;
case OPTION_ALLOW_SHLIB_UNDEFINED:
- link_info.allow_shlib_undefined = true;
+ link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
break;
+ case OPTION_NO_ALLOW_SHLIB_UNDEFINED:
+ link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols;
+ break;
+ case OPTION_UNRESOLVED_SYMBOLS:
+ if (strcmp (optarg, "ignore-all") == 0)
+ {
+ link_info.unresolved_syms_in_objects = RM_IGNORE;
+ link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
+ }
+ else if (strcmp (optarg, "report-all") == 0)
+ {
+ link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols;
+ link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols;
+ }
+ else if (strcmp (optarg, "ignore-in-object-files") == 0)
+ {
+ link_info.unresolved_syms_in_objects = RM_IGNORE;
+ link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols;
+ }
+ else if (strcmp (optarg, "ignore-in-shared-libs") == 0)
+ {
+ link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols;
+ link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
+ }
+ else
+ einfo (_("%P%F: bad --unresolved-symbols option: %s\n"), optarg);
+ break;
+ case OPTION_WARN_UNRESOLVED_SYMBOLS:
+ how_to_report_unresolved_symbols = RM_GENERATE_WARNING;
+ if (link_info.unresolved_syms_in_objects == RM_GENERATE_ERROR)
+ link_info.unresolved_syms_in_objects = RM_GENERATE_WARNING;
+ if (link_info.unresolved_syms_in_shared_libs == RM_GENERATE_ERROR)
+ link_info.unresolved_syms_in_shared_libs = RM_GENERATE_WARNING;
+ break;
+
+ case OPTION_ERROR_UNRESOLVED_SYMBOLS:
+ how_to_report_unresolved_symbols = RM_GENERATE_ERROR;
+ if (link_info.unresolved_syms_in_objects == RM_GENERATE_WARNING)
+ link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR;
+ if (link_info.unresolved_syms_in_shared_libs == RM_GENERATE_WARNING)
+ link_info.unresolved_syms_in_shared_libs = RM_GENERATE_ERROR;
+ break;
case OPTION_ALLOW_MULTIPLE_DEFINITION:
- link_info.allow_multiple_definition = true;
+ link_info.allow_multiple_definition = TRUE;
break;
case OPTION_NO_UNDEFINED_VERSION:
- link_info.allow_undefined_version = false;
+ link_info.allow_undefined_version = FALSE;
break;
case OPTION_NO_WARN_MISMATCH:
- command_line.warn_mismatch = false;
+ command_line.warn_mismatch = FALSE;
break;
case OPTION_NOINHIBIT_EXEC:
- force_make_executable = true;
+ force_make_executable = TRUE;
break;
case OPTION_NOSTDLIB:
- config.only_cmd_line_lib_dirs = true;
+ config.only_cmd_line_lib_dirs = TRUE;
break;
case OPTION_NO_WHOLE_ARCHIVE:
- whole_archive = false;
+ whole_archive = FALSE;
break;
case 'O':
/* FIXME "-O<non-digits> <value>" used to set the address of
@@ -793,16 +856,16 @@ parse_args (argc, argv)
getopt can't handle two args to an option without kludges. */
/* Enable optimizations of output files. */
- link_info.optimize = strtoul (optarg, NULL, 0) ? true : false;
+ link_info.optimize = strtoul (optarg, NULL, 0) ? TRUE : FALSE;
break;
case 'o':
lang_add_output (optarg, 0);
break;
case OPTION_OFORMAT:
- lang_add_output_format (optarg, (char *) NULL, (char *) NULL, 0);
+ lang_add_output_format (optarg, NULL, NULL, 0);
break;
case 'q':
- link_info.emitrelocations = true;
+ link_info.emitrelocations = TRUE;
break;
case 'i':
case 'r':
@@ -817,11 +880,11 @@ parse_args (argc, argv)
and will seg-fault the next time around. */
einfo(_("%P%F: bad -rpath option\n"));
- link_info.relocateable = true;
- config.build_constructors = false;
- config.magic_demand_paged = false;
- config.text_read_only = false;
- config.dynamic_link = false;
+ link_info.relocatable = TRUE;
+ config.build_constructors = FALSE;
+ config.magic_demand_paged = FALSE;
+ config.text_read_only = FALSE;
+ config.dynamic_link = FALSE;
break;
case 'R':
/* The GNU linker traditionally uses -R to mean to include
@@ -839,7 +902,7 @@ parse_args (argc, argv)
{
lang_add_input_file (optarg,
lang_input_file_is_symbols_only_enum,
- (char *) NULL);
+ NULL);
break;
}
}
@@ -898,7 +961,7 @@ parse_args (argc, argv)
}
break;
case OPTION_RELAX:
- command_line.relax = true;
+ command_line.relax = TRUE;
break;
case OPTION_RETAIN_SYMBOLS_FILE:
add_keepsyms_file (optarg);
@@ -909,27 +972,50 @@ parse_args (argc, argv)
case 's':
link_info.strip = strip_all;
break;
+ case OPTION_STRIP_DISCARDED:
+ link_info.strip_discarded = TRUE;
+ break;
+ case OPTION_NO_STRIP_DISCARDED:
+ link_info.strip_discarded = FALSE;
+ break;
case OPTION_SHARED:
if (config.has_shared)
- link_info.shared = true;
+ {
+ link_info.shared = TRUE;
+ /* When creating a shared library, the default
+ behaviour is to ignore any unresolved references. */
+ if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
+ link_info.unresolved_syms_in_objects = RM_IGNORE;
+ if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
+ link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
+ }
else
einfo (_("%P%F: -shared not supported\n"));
break;
+ case OPTION_PIE:
+ if (config.has_shared)
+ {
+ link_info.shared = TRUE;
+ link_info.pie = TRUE;
+ }
+ else
+ einfo (_("%P%F: -pie not supported\n"));
+ break;
case 'h': /* Used on Solaris. */
case OPTION_SONAME:
command_line.soname = optarg;
break;
case OPTION_SORT_COMMON:
- config.sort_common = true;
+ config.sort_common = TRUE;
break;
case OPTION_STATS:
- config.stats = true;
+ config.stats = TRUE;
break;
case OPTION_SYMBOLIC:
- link_info.symbolic = true;
+ link_info.symbolic = TRUE;
break;
case 't':
- trace_files = true;
+ trace_files = TRUE;
break;
case 'T':
ldfile_open_command_file (optarg);
@@ -978,17 +1064,17 @@ parse_args (argc, argv)
set_section_start (".text", optarg);
break;
case OPTION_TRADITIONAL_FORMAT:
- link_info.traditional_format = true;
+ link_info.traditional_format = TRUE;
break;
case OPTION_TASK_LINK:
- link_info.task_link = true;
+ link_info.task_link = TRUE;
/* Fall through - do an implied -r option. */
case OPTION_UR:
- link_info.relocateable = true;
- config.build_constructors = true;
- config.magic_demand_paged = false;
- config.text_read_only = false;
- config.dynamic_link = false;
+ link_info.relocatable = TRUE;
+ config.build_constructors = TRUE;
+ config.magic_demand_paged = FALSE;
+ config.text_read_only = FALSE;
+ config.dynamic_link = FALSE;
break;
case 'u':
ldlang_add_undef (optarg);
@@ -997,20 +1083,21 @@ parse_args (argc, argv)
if (optarg != NULL)
lang_add_unique (optarg);
else
- config.unique_orphan_sections = true;
+ config.unique_orphan_sections = TRUE;
break;
case OPTION_VERBOSE:
ldversion (1);
- version_printed = true;
- trace_file_tries = true;
+ version_printed = TRUE;
+ trace_file_tries = TRUE;
+ overflow_cutoff_limit = -2;
break;
case 'v':
ldversion (0);
- version_printed = true;
+ version_printed = TRUE;
break;
case 'V':
ldversion (1);
- version_printed = true;
+ version_printed = TRUE;
break;
case OPTION_VERSION:
ldversion (2);
@@ -1018,8 +1105,8 @@ parse_args (argc, argv)
break;
case OPTION_VERSION_SCRIPT:
/* This option indicates a small script that only specifies
- version information. Read it, but don't assume that
- we've seen a linker script. */
+ version information. Read it, but don't assume that
+ we've seen a linker script. */
{
FILE *hold_script_handle;
@@ -1037,25 +1124,31 @@ parse_args (argc, argv)
command_line.version_exports_section = optarg;
break;
case OPTION_WARN_COMMON:
- config.warn_common = true;
+ config.warn_common = TRUE;
break;
case OPTION_WARN_CONSTRUCTORS:
- config.warn_constructors = true;
+ config.warn_constructors = TRUE;
break;
case OPTION_WARN_FATAL:
- config.fatal_warnings = true;
+ config.fatal_warnings = TRUE;
break;
case OPTION_WARN_MULTIPLE_GP:
- config.warn_multiple_gp = true;
+ config.warn_multiple_gp = TRUE;
break;
case OPTION_WARN_ONCE:
- config.warn_once = true;
+ config.warn_once = TRUE;
break;
case OPTION_WARN_SECTION_ALIGN:
- config.warn_section_align = true;
+ config.warn_section_align = TRUE;
break;
case OPTION_WHOLE_ARCHIVE:
- whole_archive = true;
+ whole_archive = TRUE;
+ break;
+ case OPTION_AS_NEEDED:
+ as_needed = TRUE;
+ break;
+ case OPTION_NO_AS_NEEDED:
+ as_needed = FALSE;
break;
case OPTION_WRAP:
add_wrap (optarg);
@@ -1072,6 +1165,8 @@ parse_args (argc, argv)
case 'Y':
if (strncmp (optarg, "P,", 2) == 0)
optarg += 2;
+ if (default_dirlist != NULL)
+ free (default_dirlist);
default_dirlist = xstrdup (optarg);
break;
case 'y':
@@ -1093,10 +1188,16 @@ parse_args (argc, argv)
config.split_by_file = 1;
break;
case OPTION_CHECK_SECTIONS:
- command_line.check_section_addresses = true;
+ command_line.check_section_addresses = TRUE;
break;
case OPTION_NO_CHECK_SECTIONS:
- command_line.check_section_addresses = false;
+ command_line.check_section_addresses = FALSE;
+ break;
+ case OPTION_ACCEPT_UNKNOWN_INPUT_ARCH:
+ command_line.accept_unknown_input_arch = TRUE;
+ break;
+ case OPTION_NO_ACCEPT_UNKNOWN_INPUT_ARCH:
+ command_line.accept_unknown_input_arch = FALSE;
break;
case '(':
if (ingroup)
@@ -1112,22 +1213,6 @@ parse_args (argc, argv)
lang_leave_group ();
ingroup = 0;
break;
- case OPTION_MPC860C0:
- /* Default value (in bytes). */
- link_info.mpc860c0 = 20;
- if (optarg)
- {
- unsigned words;
-
- words = is_num (optarg, 1, 10, 0);
- if (words == 0)
- einfo (_("%P%F: invalid argument to option \"mpc860c0\"\n"));
-
- /* Convert words to bytes. */
- link_info.mpc860c0 = words * 4;
- }
- command_line.relax = true;
- break;
case OPTION_INIT:
link_info.init_function = optarg;
@@ -1143,16 +1228,25 @@ parse_args (argc, argv)
lang_leave_group ();
if (default_dirlist != NULL)
- set_default_dirlist (default_dirlist);
+ {
+ set_default_dirlist (default_dirlist);
+ free (default_dirlist);
+ }
+ if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
+ /* FIXME: Should we allow emulations a chance to set this ? */
+ link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols;
+
+ if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
+ /* FIXME: Should we allow emulations a chance to set this ? */
+ link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols;
}
/* Add the (colon-separated) elements of DIRLIST_PTR to the
library search path. */
static void
-set_default_dirlist (dirlist_ptr)
- char *dirlist_ptr;
+set_default_dirlist (char *dirlist_ptr)
{
char *p;
@@ -1162,7 +1256,7 @@ set_default_dirlist (dirlist_ptr)
if (p != NULL)
*p = '\0';
if (*dirlist_ptr != '\0')
- ldfile_add_library_path (dirlist_ptr, true);
+ ldfile_add_library_path (dirlist_ptr, TRUE);
if (p == NULL)
break;
dirlist_ptr = p + 1;
@@ -1170,8 +1264,7 @@ set_default_dirlist (dirlist_ptr)
}
static void
-set_section_start (sect, valstr)
- char *sect, *valstr;
+set_section_start (char *sect, char *valstr)
{
const char *end;
bfd_vma val = bfd_scan_vma (valstr, &end, 16);
@@ -1183,7 +1276,7 @@ set_section_start (sect, valstr)
/* Print help messages for the options. */
static void
-help ()
+help (void)
{
unsigned i;
const char **targets, **pp;
@@ -1195,13 +1288,13 @@ help ()
{
if (ld_options[i].doc != NULL)
{
- boolean comma;
+ bfd_boolean comma;
int len;
unsigned j;
printf (" ");
- comma = false;
+ comma = FALSE;
len = 2;
j = i;
@@ -1222,7 +1315,7 @@ help ()
printf ("%s", _(ld_options[j].arg));
len += strlen (_(ld_options[j].arg));
}
- comma = true;
+ comma = TRUE;
}
++j;
}
@@ -1251,7 +1344,7 @@ help ()
printf (" %s", _(ld_options[j].arg));
len += 1 + strlen (_(ld_options[j].arg));
}
- comma = true;
+ comma = TRUE;
}
++j;
}
diff --git a/contrib/binutils/ld/mri.c b/contrib/binutils/ld/mri.c
index 62a7f08..f7edd88 100644
--- a/contrib/binutils/ld/mri.c
+++ b/contrib/binutils/ld/mri.c
@@ -1,6 +1,6 @@
/* mri.c -- handle MRI style linker scripts
- Copyright 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2002
- Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2002,
+ 2003, 2004 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -53,17 +53,8 @@ struct section_name_struct *alias;
struct section_name_struct *alignment;
struct section_name_struct *subalignment;
-static struct section_name_struct **lookup
- PARAMS ((const char *name, struct section_name_struct **list));
-static void mri_add_to_list PARAMS ((struct section_name_struct **list,
- const char *name, etree_type *vma,
- const char *zalias, etree_type *align,
- etree_type *subalign));
-
static struct section_name_struct **
-lookup (name, list)
- const char *name;
- struct section_name_struct **list;
+lookup (const char *name, struct section_name_struct **list)
{
struct section_name_struct **ptr = list;
@@ -77,24 +68,23 @@ lookup (name, list)
ptr = &((*ptr)->next);
}
- *ptr = (struct section_name_struct *) xmalloc (sizeof (struct section_name_struct));
+ *ptr = xmalloc (sizeof (struct section_name_struct));
return ptr;
}
static void
-mri_add_to_list (list, name, vma, zalias, align, subalign)
- struct section_name_struct **list;
- const char *name;
- etree_type *vma;
- const char *zalias;
- etree_type *align;
- etree_type *subalign;
+mri_add_to_list (struct section_name_struct **list,
+ const char *name,
+ etree_type *vma,
+ const char *zalias,
+ etree_type *align,
+ etree_type *subalign)
{
struct section_name_struct **ptr = lookup (name, list);
(*ptr)->name = name;
(*ptr)->vma = vma;
- (*ptr)->next = (struct section_name_struct *) NULL;
+ (*ptr)->next = NULL;
(*ptr)->ok_to_load = 0;
(*ptr)->alias = zalias;
(*ptr)->align = align;
@@ -102,9 +92,7 @@ mri_add_to_list (list, name, vma, zalias, align, subalign)
}
void
-mri_output_section (name, vma)
- const char *name;
- etree_type *vma;
+mri_output_section (const char *name, etree_type *vma)
{
mri_add_to_list (&address, name, vma, 0, 0, 0);
}
@@ -113,15 +101,13 @@ mri_output_section (name, vma)
marked thus. */
void
-mri_only_load (name)
- const char *name;
+mri_only_load (const char *name)
{
mri_add_to_list (&only_load, name, 0, 0, 0, 0);
}
void
-mri_base (exp)
- etree_type *exp;
+mri_base (etree_type *exp)
{
base = exp;
}
@@ -129,7 +115,7 @@ mri_base (exp)
static int done_tree = 0;
void
-mri_draw_tree ()
+mri_draw_tree (void)
{
if (done_tree)
return;
@@ -142,32 +128,30 @@ mri_draw_tree ()
r = lang_memory_region_lookup("long");
r->current = r->origin = exp_get_vma (base, (bfd_vma)0, "origin",
lang_first_phase_enum);
- r->length = (bfd_size_type) exp_get_vma (0, (bfd_vma) ~((bfd_size_type)0),
- "length", lang_first_phase_enum);
+ r->length = (bfd_size_type) exp_get_vma (0, ~(bfd_vma) 0, "length",
+ lang_first_phase_enum);
}
#endif
/* Now build the statements for the ldlang machine. */
- /* Attatch the addresses of any which have addresses,
+ /* Attach the addresses of any which have addresses,
and add the ones not mentioned. */
- if (address != (struct section_name_struct *) NULL)
+ if (address != NULL)
{
struct section_name_struct *alist;
struct section_name_struct *olist;
- if (order == (struct section_name_struct *) NULL)
+ if (order == NULL)
order = address;
for (alist = address;
- alist != (struct section_name_struct *) NULL;
+ alist != NULL;
alist = alist->next)
{
int done = 0;
- for (olist = order;
- done == 0 && olist != (struct section_name_struct *) NULL;
- olist = olist->next)
+ for (olist = order; done == 0 && olist != NULL; olist = olist->next)
{
if (strcmp (alist->name, olist->name) == 0)
{
@@ -186,12 +170,12 @@ mri_draw_tree ()
/* If we're only supposed to load a subset of them in, then prune
the list. */
- if (only_load != (struct section_name_struct *) NULL)
+ if (only_load != NULL)
{
struct section_name_struct *ptr1;
struct section_name_struct *ptr2;
- if (order == (struct section_name_struct *) NULL)
+ if (order == NULL)
order = only_load;
/* See if this name is in the list, if it is then we can load it. */
@@ -210,7 +194,7 @@ mri_draw_tree ()
}
/* Create the order of sections to load. */
- if (order != (struct section_name_struct *) NULL)
+ if (order != NULL)
{
/* Been told to output the sections in a certain order. */
struct section_name_struct *p = order;
@@ -236,31 +220,28 @@ mri_draw_tree ()
lang_enter_output_section_statement (p->name, base,
p->ok_to_load ? 0 : noload_section,
- 1, align, subalign,
- (etree_type *) NULL);
+ align, subalign, NULL);
base = 0;
- tmp = (struct wildcard_list *) xmalloc (sizeof *tmp);
+ tmp = xmalloc (sizeof *tmp);
tmp->next = NULL;
tmp->spec.name = p->name;
tmp->spec.exclude_name_list = NULL;
- tmp->spec.sorted = false;
- lang_add_wild (NULL, tmp, false);
+ tmp->spec.sorted = FALSE;
+ lang_add_wild (NULL, tmp, FALSE);
/* If there is an alias for this section, add it too. */
for (aptr = alias; aptr; aptr = aptr->next)
if (strcmp (aptr->alias, p->name) == 0)
{
- tmp = (struct wildcard_list *) xmalloc (sizeof *tmp);
+ tmp = xmalloc (sizeof *tmp);
tmp->next = NULL;
tmp->spec.name = aptr->name;
tmp->spec.exclude_name_list = NULL;
- tmp->spec.sorted = false;
- lang_add_wild (NULL, tmp, false);
+ tmp->spec.sorted = FALSE;
+ lang_add_wild (NULL, tmp, FALSE);
}
- lang_leave_output_section_statement
- (0, "*default*", (struct lang_output_section_phdr_list *) NULL,
- NULL);
+ lang_leave_output_section_statement (0, "*default*", NULL, NULL);
p = p->next;
}
@@ -270,29 +251,23 @@ mri_draw_tree ()
}
void
-mri_load (name)
- const char *name;
+mri_load (const char *name)
{
base = 0;
- lang_add_input_file (name,
- lang_input_file_is_file_enum, (char *) NULL);
+ lang_add_input_file (name, lang_input_file_is_file_enum, NULL);
#if 0
lang_leave_output_section_statement (0, "*default*");
#endif
}
void
-mri_order (name)
- const char *name;
+mri_order (const char *name)
{
mri_add_to_list (&order, name, 0, 0, 0, 0);
}
void
-mri_alias (want, is, isn)
- const char *want;
- const char *is;
- int isn;
+mri_alias (const char *want, const char *is, int isn)
{
if (!is)
{
@@ -311,56 +286,47 @@ mri_alias (want, is, isn)
}
void
-mri_name (name)
- const char *name;
+mri_name (const char *name)
{
lang_add_output (name, 1);
}
void
-mri_format (name)
- const char *name;
+mri_format (const char *name)
{
if (strcmp (name, "S") == 0)
- lang_add_output_format ("srec", (char *) NULL, (char *) NULL, 1);
+ lang_add_output_format ("srec", NULL, NULL, 1);
else if (strcmp (name, "IEEE") == 0)
- lang_add_output_format ("ieee", (char *) NULL, (char *) NULL, 1);
+ lang_add_output_format ("ieee", NULL, NULL, 1);
else if (strcmp (name, "COFF") == 0)
- lang_add_output_format ("coff-m68k", (char *) NULL, (char *) NULL, 1);
+ lang_add_output_format ("coff-m68k", NULL, NULL, 1);
else
einfo (_("%P%F: unknown format type %s\n"), name);
}
void
-mri_public (name, exp)
- const char *name;
- etree_type *exp;
+mri_public (const char *name, etree_type *exp)
{
lang_add_assignment (exp_assop ('=', name, exp));
}
void
-mri_align (name, exp)
- const char *name;
- etree_type *exp;
+mri_align (const char *name, etree_type *exp)
{
mri_add_to_list (&alignment, name, 0, 0, exp, 0);
}
void
-mri_alignmod (name, exp)
- const char *name;
- etree_type *exp;
+mri_alignmod (const char *name, etree_type *exp)
{
mri_add_to_list (&subalignment, name, 0, 0, 0, exp);
}
void
-mri_truncate (exp)
- unsigned int exp;
+mri_truncate (unsigned int exp)
{
symbol_truncate = exp;
}
diff --git a/contrib/binutils/ld/mri.h b/contrib/binutils/ld/mri.h
index e857e3d..b430d20 100644
--- a/contrib/binutils/ld/mri.h
+++ b/contrib/binutils/ld/mri.h
@@ -1,5 +1,5 @@
/* mri.h -- header file for MRI scripting functions
- Copyright 1993, 1995, 1996 Free Software Foundation, Inc.
+ Copyright 1993, 1995, 1996, 2003 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -22,18 +22,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
extern unsigned int symbol_truncate;
-extern void mri_output_section PARAMS ((const char *name, etree_type *vma));
-extern void mri_only_load PARAMS ((const char *name));
-extern void mri_base PARAMS ((etree_type *exp));
-extern void mri_load PARAMS ((const char *name));
-extern void mri_order PARAMS ((const char *name));
-extern void mri_alias PARAMS ((const char *want, const char *is, int isn));
-extern void mri_name PARAMS ((const char *name));
-extern void mri_format PARAMS ((const char *name));
-extern void mri_public PARAMS ((const char *name, etree_type *exp));
-extern void mri_align PARAMS ((const char *name, etree_type *exp));
-extern void mri_alignmod PARAMS ((const char *name, etree_type *exp));
-extern void mri_truncate PARAMS ((unsigned int exp));
-extern void mri_draw_tree PARAMS ((void));
+extern void mri_output_section (const char *, etree_type *);
+extern void mri_only_load (const char *);
+extern void mri_base (etree_type *);
+extern void mri_load (const char *);
+extern void mri_order (const char *);
+extern void mri_alias (const char *, const char *, int);
+extern void mri_name (const char *);
+extern void mri_format (const char *);
+extern void mri_public (const char *, etree_type *);
+extern void mri_align (const char *, etree_type *);
+extern void mri_alignmod (const char *, etree_type *);
+extern void mri_truncate (unsigned int);
+extern void mri_draw_tree (void);
#endif
diff --git a/contrib/binutils/ld/pe-dll.c b/contrib/binutils/ld/pe-dll.c
index e59c32d..45d00ae 100644
--- a/contrib/binutils/ld/pe-dll.c
+++ b/contrib/binutils/ld/pe-dll.c
@@ -1,5 +1,6 @@
/* Routines to help build PEI-format DLLs (Win32 etc)
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Free Software Foundation, Inc.
Written by DJ Delorie <dj@cygnus.com>
This file is part of GLD, the Gnu Linker.
@@ -59,7 +60,7 @@
code modifications).
2. This is done completely in bounds of the PE specification (to be fair,
- there's a place where it pokes nose out of, but in practise it works).
+ there's a place where it pokes nose out of, but in practice it works).
So, resulting module can be used with any other PE compiler/linker.
3. Auto-import is fully compatible with standard import method and they
@@ -74,7 +75,7 @@
The obvious and only way to get rid of dllimport insanity is to make client
access variable directly in the DLL, bypassing extra dereference. I.e.,
- whenever client contains someting like
+ whenever client contains something like
mov dll_var,%eax,
@@ -82,7 +83,7 @@
DLL. The aim is to make OS loader do so, and than make ld help with that.
Import section of PE made following way: there's a vector of structures
each describing imports from particular DLL. Each such structure points
- to two other parellel vectors: one holding imported names, and one which
+ to two other parallel vectors: one holding imported names, and one which
will hold address of corresponding imported name. So, the solution is
de-vectorize these structures, making import locations be sparse and
pointing directly into code. Before continuing, it is worth a note that,
@@ -104,7 +105,7 @@
above: PE specification rambles that name vector (OriginalFirstThunk)
should run in parallel with addresses vector (FirstThunk), i.e. that they
should have same number of elements and terminated with zero. We violate
- this, since FirstThunk points directly into machine code. But in practise,
+ this, since FirstThunk points directly into machine code. But in practice,
OS loader implemented the sane way: it goes thru OriginalFirstThunk and
puts addresses to FirstThunk, not something else. It once again should be
noted that dll and symbol name structures are reused across fixup entries
@@ -115,13 +116,12 @@
in windows9x kernel32.dll, so if you use it, you have two
IMAGE_IMPORT_DESCRIPTORS for kernel32.dll). Yet other question is whether
referencing the same PE structures several times is valid. The answer is why
- not, prohibitting that (detecting violation) would require more work on
+ not, prohibiting that (detecting violation) would require more work on
behalf of loader than not doing it.
See also: ld/emultempl/pe.em. */
-static void
-add_bfd_to_link PARAMS ((bfd *, const char *, struct bfd_link_info *));
+static void add_bfd_to_link (bfd *, const char *, struct bfd_link_info *);
/* For emultempl/pe.em. */
@@ -138,9 +138,10 @@ int pe_dll_extra_pe_debug = 0;
static bfd_vma image_base;
static bfd *filler_bfd;
-static struct sec *edata_s, *reloc_s;
+static struct bfd_section *edata_s, *reloc_s;
static unsigned char *edata_d, *reloc_d;
static size_t edata_sz, reloc_sz;
+static int runtime_pseudo_relocs_created = 0;
typedef struct
{
@@ -198,7 +199,7 @@ static pe_details_type pe_detail_list[] =
11 /* ARM_RVA32 */,
PE_ARCH_arm,
bfd_arch_arm,
- 0
+ 1
},
{
"epoc-pei-arm-little",
@@ -222,18 +223,24 @@ static autofilter_entry_type autofilter_symbollist[] =
{ "_cygwin_crt0_common@8", 21 },
{ "_cygwin_noncygwin_dll_entry@12", 30 },
{ "impure_ptr", 10 },
+ { "_pei386_runtime_relocator", 25 },
+ { "do_pseudo_reloc", 15 },
+ { "cygwin_crt0", 11 },
{ NULL, 0 }
};
/* Do not specify library suffix explicitly, to allow for dllized versions. */
static autofilter_entry_type autofilter_liblist[] =
{
- { "libgcc.", 7 },
- { "libstdc++.", 10 },
- { "libmingw32.", 11 },
- { "libg2c.", 7 },
- { "libsupc++.", 10 },
- { "libobjc.", 8 },
+ { "libcygwin", 9 },
+ { "libgcc", 6 },
+ { "libstdc++", 9 },
+ { "libmingw32", 10 },
+ { "libmingwex", 10 },
+ { "libg2c", 6 },
+ { "libsupc++", 9 },
+ { "libobjc", 7 },
+ { "libgcj", 6 },
{ NULL, 0 }
};
@@ -281,35 +288,8 @@ static autofilter_entry_type autofilter_symbolsuffixlist[] =
#define U(str) (pe_details->underscored ? "_" str : str)
-static int reloc_sort PARAMS ((const void *, const void *));
-static int pe_export_sort PARAMS ((const void *, const void *));
-static int auto_export PARAMS ((bfd *, def_file *, const char *));
-static void process_def_file PARAMS ((bfd *, struct bfd_link_info *));
-static void build_filler_bfd PARAMS ((int));
-static void generate_edata PARAMS ((bfd *, struct bfd_link_info *));
-static void fill_exported_offsets PARAMS ((bfd *, struct bfd_link_info *));
-static void fill_edata PARAMS ((bfd *, struct bfd_link_info *));
-static void generate_reloc PARAMS ((bfd *, struct bfd_link_info *));
-static void quoteput PARAMS ((char *, FILE *, int));
-static asection *quick_section PARAMS ((bfd *, const char *, int, int));
-static void quick_symbol
- PARAMS ((bfd *, const char *, const char *, const char *,
- asection *, int, int));
-static void quick_reloc PARAMS ((bfd *, int, int, int));
-static bfd *make_head PARAMS ((bfd *));
-static bfd *make_tail PARAMS ((bfd *));
-static bfd *make_one PARAMS ((def_file_export *, bfd *));
-static bfd *make_singleton_name_thunk PARAMS ((const char *, bfd *));
-static char *make_import_fixup_mark PARAMS ((arelent *));
-static bfd *make_import_fixup_entry
- PARAMS ((const char *, const char *, const char *, bfd *));
-static unsigned int pe_get16 PARAMS ((bfd *, int));
-static unsigned int pe_get32 PARAMS ((bfd *, int));
-static unsigned int pe_as32 PARAMS ((void *));
-
void
-pe_dll_id_target (target)
- const char *target;
+pe_dll_id_target (const char *target)
{
int i;
@@ -336,21 +316,19 @@ typedef struct
reloc_data_type;
static int
-reloc_sort (va, vb)
- const void *va, *vb;
+reloc_sort (const void *va, const void *vb)
{
- bfd_vma a = ((reloc_data_type *) va)->vma;
- bfd_vma b = ((reloc_data_type *) vb)->vma;
+ bfd_vma a = ((const reloc_data_type *) va)->vma;
+ bfd_vma b = ((const reloc_data_type *) vb)->vma;
return (a > b) ? 1 : ((a < b) ? -1 : 0);
}
static int
-pe_export_sort (va, vb)
- const void *va, *vb;
+pe_export_sort (const void *va, const void *vb)
{
- def_file_export *a = (def_file_export *) va;
- def_file_export *b = (def_file_export *) vb;
+ const def_file_export *a = va;
+ const def_file_export *b = vb;
return strcmp (a->name, b->name);
}
@@ -362,7 +340,7 @@ pe_export_sort (va, vb)
defined, since we can't export symbols we don't have. */
static bfd_vma *exported_symbol_offsets;
-static struct sec **exported_symbol_sections;
+static struct bfd_section **exported_symbol_sections;
static int export_table_size;
static int count_exported;
static int count_exported_byname;
@@ -382,9 +360,7 @@ exclude_list_struct;
static struct exclude_list_struct *excludes = 0;
void
-pe_dll_add_excludes (new_excludes, type)
- const char *new_excludes;
- const int type;
+pe_dll_add_excludes (const char *new_excludes, const int type)
{
char *local_copy;
char *exclude_string;
@@ -396,9 +372,8 @@ pe_dll_add_excludes (new_excludes, type)
{
struct exclude_list_struct *new_exclude;
- new_exclude = ((struct exclude_list_struct *)
- xmalloc (sizeof (struct exclude_list_struct)));
- new_exclude->string = (char *) xmalloc (strlen (exclude_string) + 1);
+ new_exclude = xmalloc (sizeof (struct exclude_list_struct));
+ new_exclude->string = xmalloc (strlen (exclude_string) + 1);
strcpy (new_exclude->string, exclude_string);
new_exclude->type = type;
new_exclude->next = excludes;
@@ -413,10 +388,7 @@ pe_dll_add_excludes (new_excludes, type)
It can be used for contextual checks. */
static int
-auto_export (abfd, d, n)
- bfd *abfd;
- def_file *d;
- const char *n;
+auto_export (bfd *abfd, def_file *d, const char *n)
{
int i;
struct exclude_list_struct *ex;
@@ -443,7 +415,7 @@ auto_export (abfd, d, n)
n, abfd, abfd->my_archive);
/* First of all, make context checks:
- Don't export anything from standard libs. */
+ Don't export anything from standard libs. */
if (libname)
{
afptr = autofilter_liblist;
@@ -525,14 +497,12 @@ auto_export (abfd, d, n)
}
static void
-process_def_file (abfd, info)
- bfd *abfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
+process_def_file (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
{
int i, j;
struct bfd_link_hash_entry *blhe;
bfd *b;
- struct sec *s;
+ struct bfd_section *s;
def_file_export *e = 0;
if (!pe_def_file)
@@ -554,6 +524,12 @@ process_def_file (abfd, info)
}
}
+ /* If we are not building a DLL, when there are no exports
+ we do not build an export table at all. */
+ if (!pe_dll_export_everything && pe_def_file->num_exports == 0
+ && !info->shared)
+ return;
+
/* Now, maybe export everything else the default way. */
if (pe_dll_export_everything || pe_def_file->num_exports == 0)
{
@@ -563,14 +539,14 @@ process_def_file (abfd, info)
int nsyms, symsize;
symsize = bfd_get_symtab_upper_bound (b);
- symbols = (asymbol **) xmalloc (symsize);
+ symbols = xmalloc (symsize);
nsyms = bfd_canonicalize_symtab (b, symbols);
for (j = 0; j < nsyms; j++)
{
/* We should export symbols which are either global or not
- anything at all. (.bss data is the latter)
- We should not export undefined symbols. */
+ anything at all. (.bss data is the latter)
+ We should not export undefined symbols. */
if (symbols[j]->section != &bfd_und_section
&& ((symbols[j]->flags & BSF_GLOBAL)
|| (symbols[j]->flags == BFD_FORT_COMM_DEFAULT_VALUE)))
@@ -579,11 +555,11 @@ process_def_file (abfd, info)
/* We should not re-export imported stuff. */
{
- char *name = (char *) xmalloc (strlen (sn) + 2 + 6);
+ char *name = xmalloc (strlen (sn) + 2 + 6);
sprintf (name, "%s%s", U("_imp_"), sn);
blhe = bfd_link_hash_lookup (info->hash, name,
- false, false, false);
+ FALSE, FALSE, FALSE);
free (name);
if (blhe && blhe->type == bfd_link_hash_defined)
@@ -616,9 +592,10 @@ process_def_file (abfd, info)
if (strchr (pe_def_file->exports[i].name, '@'))
{
/* This will preserve internal_name, which may have been
- pointing to the same memory as name, or might not
- have. */
- char *tmp = xstrdup (pe_def_file->exports[i].name);
+ pointing to the same memory as name, or might not
+ have. */
+ int lead_at = (*pe_def_file->exports[i].name == '@');
+ char *tmp = xstrdup (pe_def_file->exports[i].name + lead_at);
*(strchr (tmp, '@')) = 0;
pe_def_file->exports[i].name = tmp;
@@ -632,7 +609,8 @@ process_def_file (abfd, info)
{
if (strchr (pe_def_file->exports[i].name, '@'))
{
- char *tmp = xstrdup (pe_def_file->exports[i].name);
+ int lead_at = (*pe_def_file->exports[i].name == '@');
+ char *tmp = xstrdup (pe_def_file->exports[i].name + lead_at);
*(strchr (tmp, '@')) = 0;
if (auto_export (NULL, pe_def_file, tmp))
@@ -648,17 +626,18 @@ process_def_file (abfd, info)
/* Convenience, but watch out for it changing. */
e = pe_def_file->exports;
- exported_symbol_offsets = (bfd_vma *) xmalloc (NE * sizeof (bfd_vma));
- exported_symbol_sections = (struct sec **) xmalloc (NE * sizeof (struct sec *));
+ exported_symbol_offsets = xmalloc (NE * sizeof (bfd_vma));
+ exported_symbol_sections = xmalloc (NE * sizeof (struct bfd_section *));
- memset (exported_symbol_sections, 0, NE * sizeof (struct sec *));
+ memset (exported_symbol_sections, 0, NE * sizeof (struct bfd_section *));
max_ordinal = 0;
min_ordinal = 65536;
count_exported = 0;
count_exported_byname = 0;
count_with_ordinals = 0;
- qsort (pe_def_file->exports, NE, sizeof (pe_def_file->exports[0]), pe_export_sort);
+ qsort (pe_def_file->exports, NE, sizeof (pe_def_file->exports[0]),
+ pe_export_sort);
for (i = 0, j = 0; i < NE; i++)
{
if (i > 0 && strcmp (e[i].name, e[i - 1].name) == 0)
@@ -699,9 +678,11 @@ process_def_file (abfd, info)
for (i = 0; i < NE; i++)
{
- char *name = (char *) xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2);
+ char *name;
- if (pe_details->underscored)
+ name = xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2);
+ if (pe_details->underscored
+ && (*pe_def_file->exports[i].internal_name != '@'))
{
*name = '_';
strcpy (name + 1, pe_def_file->exports[i].internal_name);
@@ -711,7 +692,7 @@ process_def_file (abfd, info)
blhe = bfd_link_hash_lookup (info->hash,
name,
- false, false, true);
+ FALSE, FALSE, TRUE);
if (blhe
&& (blhe->type == bfd_link_hash_defined
@@ -764,8 +745,7 @@ process_def_file (abfd, info)
/* Build the bfd that will contain .edata and .reloc sections. */
static void
-build_filler_bfd (include_edata)
- int include_edata;
+build_filler_bfd (int include_edata)
{
lang_input_statement_type *filler_file;
filler_file = lang_add_input_file ("dll stuff",
@@ -819,9 +799,7 @@ build_filler_bfd (include_edata)
/* Gather all the exported symbols and build the .edata section. */
static void
-generate_edata (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
+generate_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
int i, next_ordinal;
int name_table_size = 0;
@@ -852,7 +830,7 @@ generate_edata (abfd, info)
}
export_table_size = max_ordinal - min_ordinal + 1;
- exported_symbols = (int *) xmalloc (export_table_size * sizeof (int));
+ exported_symbols = xmalloc (export_table_size * sizeof (int));
for (i = 0; i < export_table_size; i++)
exported_symbols[i] = -1;
@@ -904,18 +882,18 @@ generate_edata (abfd, info)
been done in process_def_file(). */
static void
-fill_exported_offsets (abfd, info)
- bfd *abfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
+fill_exported_offsets (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
{
int i;
struct bfd_link_hash_entry *blhe;
for (i = 0; i < pe_def_file->num_exports; i++)
{
- char *name = (char *) xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2);
+ char *name;
- if (pe_details->underscored)
+ name = xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2);
+ if (pe_details->underscored
+ && *pe_def_file->exports[i].internal_name != '@')
{
*name = '_';
strcpy (name + 1, pe_def_file->exports[i].internal_name);
@@ -925,9 +903,9 @@ fill_exported_offsets (abfd, info)
blhe = bfd_link_hash_lookup (info->hash,
name,
- false, false, true);
+ FALSE, FALSE, TRUE);
- if (blhe && (blhe->type == bfd_link_hash_defined))
+ if (blhe && blhe->type == bfd_link_hash_defined)
exported_symbol_offsets[i] = blhe->u.def.value;
free (name);
@@ -935,30 +913,29 @@ fill_exported_offsets (abfd, info)
}
static void
-fill_edata (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
+fill_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
- int i, hint;
+ int s, hint;
unsigned char *edirectory;
- unsigned long *eaddresses;
- unsigned long *enameptrs;
- unsigned short *eordinals;
+ unsigned char *eaddresses;
+ unsigned char *enameptrs;
+ unsigned char *eordinals;
unsigned char *enamestr;
time_t now;
time (&now);
- edata_d = (unsigned char *) xmalloc (edata_sz);
+ edata_d = xmalloc (edata_sz);
/* Note use of array pointer math here. */
edirectory = edata_d;
- eaddresses = (unsigned long *) (edata_d + 40);
- enameptrs = eaddresses + export_table_size;
- eordinals = (unsigned short *) (enameptrs + count_exported_byname);
- enamestr = (char *) (eordinals + count_exported_byname);
+ eaddresses = edata_d + 40;
+ enameptrs = eaddresses + 4 * export_table_size;
+ eordinals = enameptrs + 4 * count_exported_byname;
+ enamestr = eordinals + 2 * count_exported_byname;
-#define ERVA(ptr) (((unsigned char *)(ptr) - edata_d) + edata_s->output_section->vma - image_base)
+#define ERVA(ptr) (((unsigned char *)(ptr) - edata_d) \
+ + edata_s->output_section->vma - image_base)
memset (edata_d, 0, edata_sz);
bfd_put_32 (abfd, now, edata_d + 4);
@@ -980,32 +957,36 @@ fill_edata (abfd, info)
fill_exported_offsets (abfd, info);
- /* Ok, now for the filling in part. */
+ /* Ok, now for the filling in part.
+ Scan alphabetically - ie the ordering in the exports[] table,
+ rather than by ordinal - the ordering in the exported_symbol[]
+ table. See dlltool.c and:
+ http://sources.redhat.com/ml/binutils/2003-04/msg00379.html
+ for more information. */
hint = 0;
- for (i = 0; i < export_table_size; i++)
+ for (s = 0; s < NE; s++)
{
- int s = exported_symbols[i];
-
- if (s != -1)
+ struct bfd_section *ssec = exported_symbol_sections[s];
+ if (ssec && pe_def_file->exports[s].ordinal != -1)
{
- struct sec *ssec = exported_symbol_sections[s];
unsigned long srva = (exported_symbol_offsets[s]
+ ssec->output_section->vma
+ ssec->output_offset);
int ord = pe_def_file->exports[s].ordinal;
bfd_put_32 (abfd, srva - image_base,
- (void *) (eaddresses + ord - min_ordinal));
+ eaddresses + 4 * (ord - min_ordinal));
if (!pe_def_file->exports[s].flag_noname)
{
char *ename = pe_def_file->exports[s].name;
- bfd_put_32 (abfd, ERVA (enamestr), (void *) enameptrs);
- enameptrs++;
+
+ bfd_put_32 (abfd, ERVA (enamestr), enameptrs);
+ enameptrs += 4;
strcpy (enamestr, ename);
enamestr += strlen (enamestr) + 1;
- bfd_put_16 (abfd, ord - min_ordinal, (void *) eordinals);
- eordinals++;
+ bfd_put_16 (abfd, ord - min_ordinal, eordinals);
+ eordinals += 2;
pe_def_file->exports[s].hint = hint++;
}
}
@@ -1013,13 +994,12 @@ fill_edata (abfd, info)
}
-static struct sec *current_sec;
+static struct bfd_section *current_sec;
void
-pe_walk_relocs_of_symbol (info, name, cb)
- struct bfd_link_info *info;
- const char *name;
- int (*cb) (arelent *, asection *);
+pe_walk_relocs_of_symbol (struct bfd_link_info *info,
+ const char *name,
+ int (*cb) (arelent *, asection *))
{
bfd *b;
asection *s;
@@ -1030,7 +1010,7 @@ pe_walk_relocs_of_symbol (info, name, cb)
int nsyms, symsize;
symsize = bfd_get_symtab_upper_bound (b);
- symbols = (asymbol **) xmalloc (symsize);
+ symbols = xmalloc (symsize);
nsyms = bfd_canonicalize_symtab (b, symbols);
for (s = b->sections; s; s = s->next)
@@ -1047,12 +1027,12 @@ pe_walk_relocs_of_symbol (info, name, cb)
current_sec = s;
relsize = bfd_get_reloc_upper_bound (b, s);
- relocs = (arelent **) xmalloc ((size_t) relsize);
+ relocs = xmalloc (relsize);
nrelocs = bfd_canonicalize_reloc (b, s, relocs, symbols);
for (i = 0; i < nrelocs; i++)
{
- struct symbol_cache_entry *sym = *relocs[i]->sym_ptr_ptr;
+ struct bfd_symbol *sym = *relocs[i]->sym_ptr_ptr;
if (!strcmp (name, sym->name))
cb (relocs[i], s);
@@ -1070,28 +1050,25 @@ pe_walk_relocs_of_symbol (info, name, cb)
/* Gather all the relocations and build the .reloc section. */
static void
-generate_reloc (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+generate_reloc (bfd *abfd, struct bfd_link_info *info)
{
/* For .reloc stuff. */
reloc_data_type *reloc_data;
int total_relocs = 0;
int i;
- unsigned long sec_page = (unsigned long) (-1);
+ unsigned long sec_page = (unsigned long) -1;
unsigned long page_ptr, page_count;
int bi;
bfd *b;
- struct sec *s;
+ struct bfd_section *s;
total_relocs = 0;
for (b = info->input_bfds; b; b = b->link_next)
for (s = b->sections; s; s = s->next)
total_relocs += s->reloc_count;
- reloc_data =
- (reloc_data_type *) xmalloc (total_relocs * sizeof (reloc_data_type));
+ reloc_data = xmalloc (total_relocs * sizeof (reloc_data_type));
total_relocs = 0;
bi = 0;
@@ -1125,25 +1102,25 @@ generate_reloc (abfd, info)
}
symsize = bfd_get_symtab_upper_bound (b);
- symbols = (asymbol **) xmalloc (symsize);
+ symbols = xmalloc (symsize);
nsyms = bfd_canonicalize_symtab (b, symbols);
relsize = bfd_get_reloc_upper_bound (b, s);
- relocs = (arelent **) xmalloc ((size_t) relsize);
+ relocs = xmalloc (relsize);
nrelocs = bfd_canonicalize_reloc (b, s, relocs, symbols);
for (i = 0; i < nrelocs; i++)
{
if (pe_dll_extra_pe_debug)
{
- struct symbol_cache_entry *sym = *relocs[i]->sym_ptr_ptr;
+ struct bfd_symbol *sym = *relocs[i]->sym_ptr_ptr;
printf ("rel: %s\n", sym->name);
}
if (!relocs[i]->howto->pc_relative
&& relocs[i]->howto->type != pe_details->imagebase_reloc)
{
bfd_vma sym_vma;
- struct symbol_cache_entry *sym = *relocs[i]->sym_ptr_ptr;
+ struct bfd_symbol *sym = *relocs[i]->sym_ptr_ptr;
sym_vma = (relocs[i]->addend
+ sym->value
@@ -1178,6 +1155,18 @@ generate_reloc (abfd, info)
reloc_data[total_relocs].type = 5;
total_relocs++;
break;
+ case BITS_AND_SHIFT (24, 2):
+ /* FIXME: 0 is ARM_26D, it is defined in bfd/coff-arm.c
+ Those ARM_xxx definitions should go in proper
+ header someday. */
+ if (relocs[i]->howto->type == 0
+ /* Older GNU linkers used 5 instead of 0 for this reloc. */
+ || relocs[i]->howto->type == 5)
+ /* This is an ARM_26D reloc, which is an ARM_26 reloc
+ that has already been fully processed during a
+ previous link stage, so ignore it here. */
+ break;
+ /* Fall through. */
default:
/* xgettext:c-format */
einfo (_("%XError: %d-bit reloc in dll\n"),
@@ -1218,10 +1207,10 @@ generate_reloc (abfd, info)
}
reloc_sz = (reloc_sz + 3) & ~3; /* 4-byte align. */
- reloc_d = (unsigned char *) xmalloc (reloc_sz);
- sec_page = (unsigned long) (-1);
+ reloc_d = xmalloc (reloc_sz);
+ sec_page = (unsigned long) -1;
reloc_sz = 0;
- page_ptr = (unsigned long) (-1);
+ page_ptr = (unsigned long) -1;
page_count = 0;
for (i = 0; i < total_relocs; i++)
@@ -1234,7 +1223,7 @@ generate_reloc (abfd, info)
while (reloc_sz & 3)
reloc_d[reloc_sz++] = 0;
- if (page_ptr != (unsigned long) (-1))
+ if (page_ptr != (unsigned long) -1)
bfd_put_32 (abfd, reloc_sz - page_ptr, reloc_d + page_ptr + 4);
bfd_put_32 (abfd, this_page, reloc_d + reloc_sz);
@@ -1260,7 +1249,7 @@ generate_reloc (abfd, info)
while (reloc_sz & 3)
reloc_d[reloc_sz++] = 0;
- if (page_ptr != (unsigned long) (-1))
+ if (page_ptr != (unsigned long) -1)
bfd_put_32 (abfd, reloc_sz - page_ptr, reloc_d + page_ptr + 4);
while (reloc_sz < reloc_s->_raw_size)
@@ -1271,10 +1260,7 @@ generate_reloc (abfd, info)
corresponds to it. */
static void
-quoteput (s, f, needs_quotes)
- char *s;
- FILE *f;
- int needs_quotes;
+quoteput (char *s, FILE *f, int needs_quotes)
{
char *cp;
@@ -1307,8 +1293,7 @@ quoteput (s, f, needs_quotes)
}
void
-pe_dll_generate_def_file (pe_out_def_filename)
- const char *pe_out_def_filename;
+pe_dll_generate_def_file (const char *pe_out_def_filename)
{
int i;
FILE *out = fopen (pe_out_def_filename, "w");
@@ -1476,11 +1461,7 @@ static char *dll_symname;
#define UNDSEC (asection *) &bfd_und_section
static asection *
-quick_section (abfd, name, flags, align)
- bfd *abfd;
- const char *name;
- int flags;
- int align;
+quick_section (bfd *abfd, const char *name, int flags, int align)
{
asection *sec;
asymbol *sym;
@@ -1502,17 +1483,16 @@ quick_section (abfd, name, flags, align)
}
static void
-quick_symbol (abfd, n1, n2, n3, sec, flags, addr)
- bfd *abfd;
- const char *n1;
- const char *n2;
- const char *n3;
- asection *sec;
- int flags;
- int addr;
+quick_symbol (bfd *abfd,
+ const char *n1,
+ const char *n2,
+ const char *n3,
+ asection *sec,
+ int flags,
+ int addr)
{
asymbol *sym;
- char *name = (char *) xmalloc (strlen (n1) + strlen (n2) + strlen (n3) + 1);
+ char *name = xmalloc (strlen (n1) + strlen (n2) + strlen (n3) + 1);
strcpy (name, n1);
strcat (name, n2);
@@ -1529,19 +1509,15 @@ static arelent *reltab = 0;
static int relcount = 0, relsize = 0;
static void
-quick_reloc (abfd, address, which_howto, symidx)
- bfd *abfd;
- int address;
- int which_howto;
- int symidx;
+quick_reloc (bfd *abfd, int address, int which_howto, int symidx)
{
- if (relcount >= (relsize - 1))
+ if (relcount >= relsize - 1)
{
relsize += 10;
if (reltab)
- reltab = (arelent *) xrealloc (reltab, relsize * sizeof (arelent));
+ reltab = xrealloc (reltab, relsize * sizeof (arelent));
else
- reltab = (arelent *) xmalloc (relsize * sizeof (arelent));
+ reltab = xmalloc (relsize * sizeof (arelent));
}
reltab[relcount].address = address;
reltab[relcount].addend = 0;
@@ -1557,7 +1533,7 @@ save_relocs (asection *sec)
sec->relocation = reltab;
sec->reloc_count = relcount;
- sec->orelocation = (arelent **) xmalloc ((relcount + 1) * sizeof (arelent *));
+ sec->orelocation = xmalloc ((relcount + 1) * sizeof (arelent *));
for (i = 0; i < relcount; i++)
sec->orelocation[i] = sec->relocation + i;
sec->orelocation[relcount] = 0;
@@ -1584,15 +1560,14 @@ save_relocs (asection *sec)
hname: */
static bfd *
-make_head (parent)
- bfd *parent;
+make_head (bfd *parent)
{
asection *id2, *id5, *id4;
unsigned char *d2, *d5, *d4;
char *oname;
bfd *abfd;
- oname = (char *) xmalloc (20);
+ oname = xmalloc (20);
sprintf (oname, "d%06d.o", tmp_seq);
tmp_seq++;
@@ -1604,7 +1579,7 @@ make_head (parent)
bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
symptr = 0;
- symtab = (asymbol **) xmalloc (6 * sizeof (asymbol *));
+ symtab = xmalloc (6 * sizeof (asymbol *));
id2 = quick_section (abfd, ".idata$2", SEC_HAS_CONTENTS, 2);
id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2);
id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
@@ -1618,7 +1593,7 @@ make_head (parent)
the start of the list of sections from other objects. */
bfd_set_section_size (abfd, id2, 20);
- d2 = (unsigned char *) xmalloc (20);
+ d2 = xmalloc (20);
id2->contents = d2;
memset (d2, 0, 20);
d2[0] = d2[16] = 4; /* Reloc addend. */
@@ -1628,12 +1603,12 @@ make_head (parent)
save_relocs (id2);
bfd_set_section_size (abfd, id5, 4);
- d5 = (unsigned char *) xmalloc (4);
+ d5 = xmalloc (4);
id5->contents = d5;
memset (d5, 0, 4);
bfd_set_section_size (abfd, id4, 4);
- d4 = (unsigned char *) xmalloc (4);
+ d4 = xmalloc (4);
id4->contents = d4;
memset (d4, 0, 4);
@@ -1657,8 +1632,7 @@ make_head (parent)
.asciz "my.dll" */
static bfd *
-make_tail (parent)
- bfd *parent;
+make_tail (bfd *parent)
{
asection *id4, *id5, *id7;
unsigned char *d4, *d5, *d7;
@@ -1666,7 +1640,7 @@ make_tail (parent)
char *oname;
bfd *abfd;
- oname = (char *) xmalloc (20);
+ oname = xmalloc (20);
sprintf (oname, "d%06d.o", tmp_seq);
tmp_seq++;
@@ -1678,19 +1652,19 @@ make_tail (parent)
bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
symptr = 0;
- symtab = (asymbol **) xmalloc (5 * sizeof (asymbol *));
+ symtab = xmalloc (5 * sizeof (asymbol *));
id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2);
id7 = quick_section (abfd, ".idata$7", SEC_HAS_CONTENTS, 2);
quick_symbol (abfd, U (""), dll_symname, "_iname", id7, BSF_GLOBAL, 0);
bfd_set_section_size (abfd, id4, 4);
- d4 = (unsigned char *) xmalloc (4);
+ d4 = xmalloc (4);
id4->contents = d4;
memset (d4, 0, 4);
bfd_set_section_size (abfd, id5, 4);
- d5 = (unsigned char *) xmalloc (4);
+ d5 = xmalloc (4);
id5->contents = d5;
memset (d5, 0, 4);
@@ -1698,7 +1672,7 @@ make_tail (parent)
if (len & 1)
len++;
bfd_set_section_size (abfd, id7, len);
- d7 = (unsigned char *) xmalloc (len);
+ d7 = xmalloc (len);
id7->contents = d7;
strcpy (d7, dll_filename);
@@ -1763,9 +1737,7 @@ static unsigned char jmp_mips_bytes[] =
};
static bfd *
-make_one (exp, parent)
- def_file_export *exp;
- bfd *parent;
+make_one (def_file_export *exp, bfd *parent)
{
asection *tx, *id7, *id5, *id4, *id6;
unsigned char *td = NULL, *d7, *d5, *d4, *d6 = NULL;
@@ -1793,7 +1765,7 @@ make_one (exp, parent)
abort ();
}
- oname = (char *) xmalloc (20);
+ oname = xmalloc (20);
sprintf (oname, "d%06d.o", tmp_seq);
tmp_seq++;
@@ -1805,29 +1777,47 @@ make_one (exp, parent)
bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
symptr = 0;
- symtab = (asymbol **) xmalloc (11 * sizeof (asymbol *));
+ symtab = xmalloc (11 * sizeof (asymbol *));
tx = quick_section (abfd, ".text", SEC_CODE|SEC_HAS_CONTENTS, 2);
id7 = quick_section (abfd, ".idata$7", SEC_HAS_CONTENTS, 2);
id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2);
id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
id6 = quick_section (abfd, ".idata$6", SEC_HAS_CONTENTS, 2);
- if (! exp->flag_data)
- quick_symbol (abfd, U (""), exp->internal_name, "", tx, BSF_GLOBAL, 0);
- quick_symbol (abfd, U ("_head_"), dll_symname, "", UNDSEC, BSF_GLOBAL, 0);
- quick_symbol (abfd, U ("_imp__"), exp->internal_name, "", id5, BSF_GLOBAL, 0);
- /* Symbol to reference ord/name of imported
- data symbol, used to implement auto-import. */
- if (exp->flag_data)
- quick_symbol (abfd, U("_nm__"), exp->internal_name, "", id6,
- BSF_GLOBAL,0);
+
+ if (*exp->internal_name == '@')
+ {
+ quick_symbol (abfd, U ("_head_"), dll_symname, "", UNDSEC,
+ BSF_GLOBAL, 0);
+ if (! exp->flag_data)
+ quick_symbol (abfd, "", exp->internal_name, "", tx, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U ("_imp_"), exp->internal_name, "", id5,
+ BSF_GLOBAL, 0);
+ /* Fastcall applies only to functions,
+ so no need for auto-import symbol. */
+ }
+ else
+ {
+ quick_symbol (abfd, U ("_head_"), dll_symname, "", UNDSEC,
+ BSF_GLOBAL, 0);
+ if (! exp->flag_data)
+ quick_symbol (abfd, U (""), exp->internal_name, "", tx,
+ BSF_GLOBAL, 0);
+ quick_symbol (abfd, U ("_imp__"), exp->internal_name, "", id5,
+ BSF_GLOBAL, 0);
+ /* Symbol to reference ord/name of imported
+ data symbol, used to implement auto-import. */
+ if (exp->flag_data)
+ quick_symbol (abfd, U("_nm__"), exp->internal_name, "", id6,
+ BSF_GLOBAL,0);
+ }
if (pe_dll_compat_implib)
- quick_symbol (abfd, U ("__imp_"), exp->internal_name, "",
- id5, BSF_GLOBAL, 0);
+ quick_symbol (abfd, U ("__imp_"), exp->internal_name, "", id5,
+ BSF_GLOBAL, 0);
if (! exp->flag_data)
{
bfd_set_section_size (abfd, tx, jmp_byte_count);
- td = (unsigned char *) xmalloc (jmp_byte_count);
+ td = xmalloc (jmp_byte_count);
tx->contents = td;
memcpy (td, jmp_bytes, jmp_byte_count);
@@ -1851,14 +1841,14 @@ make_one (exp, parent)
}
bfd_set_section_size (abfd, id7, 4);
- d7 = (unsigned char *) xmalloc (4);
+ d7 = xmalloc (4);
id7->contents = d7;
memset (d7, 0, 4);
- quick_reloc (abfd, 0, BFD_RELOC_RVA, 6);
+ quick_reloc (abfd, 0, BFD_RELOC_RVA, 5);
save_relocs (id7);
bfd_set_section_size (abfd, id5, 4);
- d5 = (unsigned char *) xmalloc (4);
+ d5 = xmalloc (4);
id5->contents = d5;
memset (d5, 0, 4);
@@ -1875,7 +1865,7 @@ make_one (exp, parent)
}
bfd_set_section_size (abfd, id4, 4);
- d4 = (unsigned char *) xmalloc (4);
+ d4 = xmalloc (4);
id4->contents = d4;
memset (d4, 0, 4);
@@ -1902,7 +1892,7 @@ make_one (exp, parent)
if (len & 1)
len++;
bfd_set_section_size (abfd, id6, len);
- d6 = (unsigned char *) xmalloc (len);
+ d6 = xmalloc (len);
id6->contents = d6;
memset (d6, 0, len);
d6[0] = exp->hint & 0xff;
@@ -1924,9 +1914,7 @@ make_one (exp, parent)
}
static bfd *
-make_singleton_name_thunk (import, parent)
- const char *import;
- bfd *parent;
+make_singleton_name_thunk (const char *import, bfd *parent)
{
/* Name thunks go to idata$4. */
asection *id4;
@@ -1934,7 +1922,7 @@ make_singleton_name_thunk (import, parent)
char *oname;
bfd *abfd;
- oname = (char *) xmalloc (20);
+ oname = xmalloc (20);
sprintf (oname, "nmth%06d.o", tmp_seq);
tmp_seq++;
@@ -1946,13 +1934,13 @@ make_singleton_name_thunk (import, parent)
bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
symptr = 0;
- symtab = (asymbol **) xmalloc (3 * sizeof (asymbol *));
+ symtab = xmalloc (3 * sizeof (asymbol *));
id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
quick_symbol (abfd, U ("_nm_thnk_"), import, "", id4, BSF_GLOBAL, 0);
quick_symbol (abfd, U ("_nm_"), import, "", UNDSEC, BSF_GLOBAL, 0);
bfd_set_section_size (abfd, id4, 8);
- d4 = (unsigned char *) xmalloc (4);
+ d4 = xmalloc (4);
id4->contents = d4;
memset (d4, 0, 8);
quick_reloc (abfd, 0, BFD_RELOC_RVA, 2);
@@ -1967,22 +1955,21 @@ make_singleton_name_thunk (import, parent)
}
static char *
-make_import_fixup_mark (rel)
- arelent *rel;
+make_import_fixup_mark (arelent *rel)
{
/* We convert reloc to symbol, for later reference. */
static int counter;
static char *fixup_name = NULL;
static size_t buffer_len = 0;
- struct symbol_cache_entry *sym = *rel->sym_ptr_ptr;
+ struct bfd_symbol *sym = *rel->sym_ptr_ptr;
bfd *abfd = bfd_asymbol_bfd (sym);
struct bfd_link_hash_entry *bh;
if (!fixup_name)
{
- fixup_name = (char *) xmalloc (384);
+ fixup_name = xmalloc (384);
buffer_len = 384;
}
@@ -1992,10 +1979,10 @@ make_import_fixup_mark (rel)
overflowing this buffer... */
{
free (fixup_name);
- /* New buffer size is length of symbol, plus 25, but then
- rounded up to the nearest multiple of 128. */
+ /* New buffer size is length of symbol, plus 25, but
+ then rounded up to the nearest multiple of 128. */
buffer_len = ((strlen (sym->name) + 25) + 127) & ~127;
- fixup_name = (char *) xmalloc (buffer_len);
+ fixup_name = xmalloc (buffer_len);
}
sprintf (fixup_name, "__fu%d_%s", counter++, sym->name);
@@ -2003,7 +1990,7 @@ make_import_fixup_mark (rel)
bh = NULL;
bfd_coff_link_add_one_symbol (&link_info, abfd, fixup_name, BSF_GLOBAL,
current_sec, /* sym->section, */
- rel->address, NULL, true, false, &bh);
+ rel->address, NULL, TRUE, FALSE, &bh);
if (0)
{
@@ -2025,18 +2012,17 @@ make_import_fixup_mark (rel)
.rva __fuNN_SYM (pointer to reference (address) in text) */
static bfd *
-make_import_fixup_entry (name, fixup_name, dll_symname, parent)
- const char *name;
- const char *fixup_name;
- const char *dll_symname;
- bfd *parent;
+make_import_fixup_entry (const char *name,
+ const char *fixup_name,
+ const char *dll_symname,
+ bfd *parent)
{
asection *id3;
unsigned char *d3;
char *oname;
bfd *abfd;
- oname = (char *) xmalloc (20);
+ oname = xmalloc (20);
sprintf (oname, "fu%06d.o", tmp_seq);
tmp_seq++;
@@ -2048,7 +2034,7 @@ make_import_fixup_entry (name, fixup_name, dll_symname, parent)
bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
symptr = 0;
- symtab = (asymbol **) xmalloc (6 * sizeof (asymbol *));
+ symtab = xmalloc (6 * sizeof (asymbol *));
id3 = quick_section (abfd, ".idata$3", SEC_HAS_CONTENTS, 2);
#if 0
@@ -2059,7 +2045,7 @@ make_import_fixup_entry (name, fixup_name, dll_symname, parent)
quick_symbol (abfd, "", fixup_name, "", UNDSEC, BSF_GLOBAL, 0);
bfd_set_section_size (abfd, id3, 20);
- d3 = (unsigned char *) xmalloc (20);
+ d3 = xmalloc (20);
id3->contents = d3;
memset (d3, 0, 20);
@@ -2076,15 +2062,109 @@ make_import_fixup_entry (name, fixup_name, dll_symname, parent)
return abfd;
}
+/* .section .rdata_runtime_pseudo_reloc
+ .long addend
+ .rva __fuNN_SYM (pointer to reference (address) in text) */
+
+static bfd *
+make_runtime_pseudo_reloc (const char *name ATTRIBUTE_UNUSED,
+ const char *fixup_name,
+ int addend,
+ bfd *parent)
+{
+ asection *rt_rel;
+ unsigned char *rt_rel_d;
+ char *oname;
+ bfd *abfd;
+
+ oname = xmalloc (20);
+ sprintf (oname, "rtr%06d.o", tmp_seq);
+ tmp_seq++;
+
+ abfd = bfd_create (oname, parent);
+ bfd_find_target (pe_details->object_target, abfd);
+ bfd_make_writable (abfd);
+
+ bfd_set_format (abfd, bfd_object);
+ bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
+
+ symptr = 0;
+ symtab = xmalloc (2 * sizeof (asymbol *));
+ rt_rel = quick_section (abfd, ".rdata_runtime_pseudo_reloc",
+ SEC_HAS_CONTENTS, 2);
+
+ quick_symbol (abfd, "", fixup_name, "", UNDSEC, BSF_GLOBAL, 0);
+
+ bfd_set_section_size (abfd, rt_rel, 8);
+ rt_rel_d = xmalloc (8);
+ rt_rel->contents = rt_rel_d;
+ memset (rt_rel_d, 0, 8);
+ bfd_put_32 (abfd, addend, rt_rel_d);
+
+ quick_reloc (abfd, 4, BFD_RELOC_RVA, 1);
+ save_relocs (rt_rel);
+
+ bfd_set_symtab (abfd, symtab, symptr);
+
+ bfd_set_section_contents (abfd, rt_rel, rt_rel_d, 0, 8);
+
+ bfd_make_readable (abfd);
+ return abfd;
+}
+
+/* .section .rdata
+ .rva __pei386_runtime_relocator */
+
+static bfd *
+pe_create_runtime_relocator_reference (bfd *parent)
+{
+ asection *extern_rt_rel;
+ unsigned char *extern_rt_rel_d;
+ char *oname;
+ bfd *abfd;
+
+ oname = xmalloc (20);
+ sprintf (oname, "ertr%06d.o", tmp_seq);
+ tmp_seq++;
+
+ abfd = bfd_create (oname, parent);
+ bfd_find_target (pe_details->object_target, abfd);
+ bfd_make_writable (abfd);
+
+ bfd_set_format (abfd, bfd_object);
+ bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
+
+ symptr = 0;
+ symtab = xmalloc (2 * sizeof (asymbol *));
+ extern_rt_rel = quick_section (abfd, ".rdata", SEC_HAS_CONTENTS, 2);
+
+ quick_symbol (abfd, "", "__pei386_runtime_relocator", "", UNDSEC,
+ BSF_NO_FLAGS, 0);
+
+ bfd_set_section_size (abfd, extern_rt_rel, 4);
+ extern_rt_rel_d = xmalloc (4);
+ extern_rt_rel->contents = extern_rt_rel_d;
+
+ quick_reloc (abfd, 0, BFD_RELOC_RVA, 1);
+ save_relocs (extern_rt_rel);
+
+ bfd_set_symtab (abfd, symtab, symptr);
+
+ bfd_set_section_contents (abfd, extern_rt_rel, extern_rt_rel_d, 0, 4);
+
+ bfd_make_readable (abfd);
+ return abfd;
+}
+
void
-pe_create_import_fixup (rel)
- arelent *rel;
+pe_create_import_fixup (arelent *rel, asection *s, int addend)
{
char buf[300];
- struct symbol_cache_entry *sym = *rel->sym_ptr_ptr;
+ struct bfd_symbol *sym = *rel->sym_ptr_ptr;
struct bfd_link_hash_entry *name_thunk_sym;
const char *name = sym->name;
char *fixup_name = make_import_fixup_mark (rel);
+ bfd *b;
sprintf (buf, U ("_nm_thnk_%s"), name);
@@ -2096,24 +2176,48 @@ pe_create_import_fixup (rel)
add_bfd_to_link (b, b->filename, &link_info);
/* If we ever use autoimport, we have to cast text section writable. */
- config.text_read_only = false;
+ config.text_read_only = FALSE;
+ output_bfd->flags &= ~WP_TEXT;
}
- {
- extern char * pe_data_import_dll;
- char * dll_symname = pe_data_import_dll ? pe_data_import_dll : "unknown";
+ if (addend == 0 || link_info.pei386_runtime_pseudo_reloc)
+ {
+ extern char * pe_data_import_dll;
+ char * dll_symname = pe_data_import_dll ? pe_data_import_dll : "unknown";
- bfd *b = make_import_fixup_entry (name, fixup_name, dll_symname,
- output_bfd);
- add_bfd_to_link (b, b->filename, &link_info);
- }
+ b = make_import_fixup_entry (name, fixup_name, dll_symname, output_bfd);
+ add_bfd_to_link (b, b->filename, &link_info);
+ }
+
+ if (addend != 0)
+ {
+ if (link_info.pei386_runtime_pseudo_reloc)
+ {
+ if (pe_dll_extra_pe_debug)
+ printf ("creating runtime pseudo-reloc entry for %s (addend=%d)\n",
+ fixup_name, addend);
+ b = make_runtime_pseudo_reloc (name, fixup_name, addend, output_bfd);
+ add_bfd_to_link (b, b->filename, &link_info);
+
+ if (runtime_pseudo_relocs_created == 0)
+ {
+ b = pe_create_runtime_relocator_reference (output_bfd);
+ add_bfd_to_link (b, b->filename, &link_info);
+ }
+ runtime_pseudo_relocs_created++;
+ }
+ else
+ {
+ einfo (_("%C: variable '%T' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.\n"),
+ s->owner, s, rel->address, sym->name);
+ einfo ("%X");
+ }
+ }
}
void
-pe_dll_generate_implib (def, impfilename)
- def_file *def;
- const char *impfilename;
+pe_dll_generate_implib (def_file *def, const char *impfilename)
{
int i;
bfd *ar_head;
@@ -2153,6 +2257,9 @@ pe_dll_generate_implib (def, impfilename)
char *internal = def->exports[i].internal_name;
bfd *n;
+ /* Don't add PRIVATE entries to import lib. */
+ if (pe_def_file->exports[i].flag_private)
+ continue;
def->exports[i].internal_name = def->exports[i].name;
n = make_one (def->exports + i, outarch);
n->next = head;
@@ -2185,10 +2292,7 @@ pe_dll_generate_implib (def, impfilename)
}
static void
-add_bfd_to_link (abfd, name, link_info)
- bfd *abfd;
- const char *name;
- struct bfd_link_info *link_info;
+add_bfd_to_link (bfd *abfd, const char *name, struct bfd_link_info *link_info)
{
lang_input_statement_type *fake_file;
@@ -2203,9 +2307,7 @@ add_bfd_to_link (abfd, name, link_info)
}
void
-pe_process_import_defs (output_bfd, link_info)
- bfd *output_bfd;
- struct bfd_link_info *link_info;
+pe_process_import_defs (bfd *output_bfd, struct bfd_link_info *link_info)
{
def_file_module *module;
@@ -2231,20 +2333,35 @@ pe_process_import_defs (output_bfd, link_info)
{
def_file_export exp;
struct bfd_link_hash_entry *blhe;
-
+ int lead_at = (*pe_def_file->imports[i].internal_name == '@');
/* See if we need this import. */
- char *name = (char *) xmalloc (strlen (pe_def_file->imports[i].internal_name) + 2 + 6);
- sprintf (name, "%s%s", U (""), pe_def_file->imports[i].internal_name);
+ size_t len = strlen (pe_def_file->imports[i].internal_name);
+ char *name = xmalloc (len + 2 + 6);
+
+ if (lead_at)
+ sprintf (name, "%s%s", "",
+ pe_def_file->imports[i].internal_name);
+ else
+ sprintf (name, "%s%s",U (""),
+ pe_def_file->imports[i].internal_name);
+
blhe = bfd_link_hash_lookup (link_info->hash, name,
- false, false, false);
+ FALSE, FALSE, FALSE);
+
if (!blhe || (blhe && blhe->type != bfd_link_hash_undefined))
{
- sprintf (name, "%s%s", U ("_imp__"),
- pe_def_file->imports[i].internal_name);
+ if (lead_at)
+ sprintf (name, "%s%s", U ("_imp_"),
+ pe_def_file->imports[i].internal_name);
+ else
+ sprintf (name, "%s%s", U ("_imp__"),
+ pe_def_file->imports[i].internal_name);
+
blhe = bfd_link_hash_lookup (link_info->hash, name,
- false, false, false);
+ FALSE, FALSE, FALSE);
}
free (name);
+
if (blhe && blhe->type == bfd_link_hash_undefined)
{
bfd *one;
@@ -2261,7 +2378,7 @@ pe_process_import_defs (output_bfd, link_info)
exp.hint = exp.ordinal >= 0 ? exp.ordinal : 0;
exp.flag_private = 0;
exp.flag_constant = 0;
- exp.flag_data = 0;
+ exp.flag_data = pe_def_file->imports[i].data;
exp.flag_noname = exp.name ? 0 : 1;
one = make_one (&exp, output_bfd);
add_bfd_to_link (one, one->filename, link_info);
@@ -2278,13 +2395,11 @@ pe_process_import_defs (output_bfd, link_info)
}
/* We were handed a *.DLL file. Parse it and turn it into a set of
- IMPORTS directives in the def file. Return true if the file was
- handled, false if not. */
+ IMPORTS directives in the def file. Return TRUE if the file was
+ handled, FALSE if not. */
static unsigned int
-pe_get16 (abfd, where)
- bfd *abfd;
- int where;
+pe_get16 (bfd *abfd, int where)
{
unsigned char b[2];
@@ -2294,9 +2409,7 @@ pe_get16 (abfd, where)
}
static unsigned int
-pe_get32 (abfd, where)
- bfd *abfd;
- int where;
+pe_get32 (bfd *abfd, int where)
{
unsigned char b[4];
@@ -2308,8 +2421,7 @@ pe_get32 (abfd, where)
#if 0 /* This is not currently used. */
static unsigned int
-pe_as16 (ptr)
- void *ptr;
+pe_as16 (void *ptr)
{
unsigned char *b = ptr;
@@ -2319,24 +2431,31 @@ pe_as16 (ptr)
#endif
static unsigned int
-pe_as32 (ptr)
- void *ptr;
+pe_as32 (void *ptr)
{
unsigned char *b = ptr;
return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24);
}
-boolean
-pe_implied_import_dll (filename)
- const char *filename;
+bfd_boolean
+pe_implied_import_dll (const char *filename)
{
bfd *dll;
unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
unsigned long export_rva, export_size, nsections, secptr, expptr;
+ unsigned long exp_funcbase;
unsigned char *expdata, *erva;
unsigned long name_rvas, ordinals, nexp, ordbase;
const char *dll_name;
+ /* Initialization with start > end guarantees that is_data
+ will not be set by mistake, and avoids compiler warning. */
+ unsigned long data_start = 1;
+ unsigned long data_end = 0;
+ unsigned long rdata_start = 1;
+ unsigned long rdata_end = 0;
+ unsigned long bss_start = 1;
+ unsigned long bss_end = 0;
/* No, I can't use bfd here. kernel32.dll puts its export table in
the middle of the .rdata section. */
@@ -2344,27 +2463,23 @@ pe_implied_import_dll (filename)
if (!dll)
{
einfo ("%Xopen %s: %s\n", filename, bfd_errmsg (bfd_get_error ()));
- return false;
+ return FALSE;
}
/* PEI dlls seem to be bfd_objects. */
if (!bfd_check_format (dll, bfd_object))
{
einfo ("%X%s: this doesn't appear to be a DLL\n", filename);
- return false;
+ return FALSE;
}
- dll_name = filename;
- for (i = 0; filename[i]; i++)
- if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
- dll_name = filename + i + 1;
-
+ /* Get pe_header, optional header and numbers of export entries. */
pe_header_offset = pe_get32 (dll, 0x3c);
opthdr_ofs = pe_header_offset + 4 + 20;
num_entries = pe_get32 (dll, opthdr_ofs + 92);
if (num_entries < 1) /* No exports. */
- return false;
+ return FALSE;
export_rva = pe_get32 (dll, opthdr_ofs + 96);
export_size = pe_get32 (dll, opthdr_ofs + 100);
@@ -2373,6 +2488,7 @@ pe_implied_import_dll (filename)
pe_get16 (dll, pe_header_offset + 4 + 16));
expptr = 0;
+ /* Get the rva and size of the export section. */
for (i = 0; i < nsections; i++)
{
char sname[8];
@@ -2393,7 +2509,50 @@ pe_implied_import_dll (filename)
}
}
- expdata = (unsigned char *) xmalloc (export_size);
+ /* Scan sections and store the base and size of the
+ data and bss segments in data/base_start/end. */
+ for (i = 0; i < nsections; i++)
+ {
+ unsigned long secptr1 = secptr + 40 * i;
+ unsigned long vsize = pe_get32 (dll, secptr1 + 8);
+ unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
+ unsigned long flags = pe_get32 (dll, secptr1 + 36);
+ char sec_name[9];
+
+ sec_name[8] = '\0';
+ bfd_seek (dll, (file_ptr) secptr1 + 0, SEEK_SET);
+ bfd_bread (sec_name, (bfd_size_type) 8, dll);
+
+ if (strcmp(sec_name,".data") == 0)
+ {
+ data_start = vaddr;
+ data_end = vaddr + vsize;
+
+ if (pe_dll_extra_pe_debug)
+ printf ("%s %s: 0x%08lx-0x%08lx (0x%08lx)\n",
+ __FUNCTION__, sec_name, vaddr, vaddr + vsize, flags);
+ }
+ else if (strcmp(sec_name,".rdata") == 0)
+ {
+ rdata_start = vaddr;
+ rdata_end = vaddr + vsize;
+
+ if (pe_dll_extra_pe_debug)
+ printf ("%s %s: 0x%08lx-0x%08lx (0x%08lx)\n",
+ __FUNCTION__, sec_name, vaddr, vaddr + vsize, flags);
+ }
+ else if (strcmp (sec_name,".bss") == 0)
+ {
+ bss_start = vaddr;
+ bss_end = vaddr + vsize;
+
+ if (pe_dll_extra_pe_debug)
+ printf ("%s %s: 0x%08lx-0x%08lx (0x%08lx)\n",
+ __FUNCTION__, sec_name, vaddr, vaddr + vsize, flags);
+ }
+ }
+
+ expdata = xmalloc (export_size);
bfd_seek (dll, (file_ptr) expptr, SEEK_SET);
bfd_bread (expdata, (bfd_size_type) export_size, dll);
erva = expdata - export_rva;
@@ -2405,17 +2564,56 @@ pe_implied_import_dll (filename)
name_rvas = pe_as32 (expdata + 32);
ordinals = pe_as32 (expdata + 36);
ordbase = pe_as32 (expdata + 16);
+ exp_funcbase = pe_as32 (expdata + 28);
+
+ /* Use internal dll name instead of filename
+ to enable symbolic dll linking. */
+ dll_name = pe_as32 (expdata + 12) + erva;
+ /* Check to see if the dll has already been added to
+ the definition list and if so return without error.
+ This avoids multiple symbol definitions. */
+ if (def_get_module (pe_def_file, dll_name))
+ {
+ if (pe_dll_extra_pe_debug)
+ printf ("%s is already loaded\n", dll_name);
+ return TRUE;
+ }
+
+ /* Iterate through the list of symbols. */
for (i = 0; i < nexp; i++)
{
+ /* Pointer to the names vector. */
unsigned long name_rva = pe_as32 (erva + name_rvas + i * 4);
def_file_import *imp;
-
- imp = def_file_add_import (pe_def_file, erva + name_rva, dll_name,
- i, 0);
+ /* Pointer to the function address vector. */
+ unsigned long func_rva = pe_as32 (erva + exp_funcbase + i * 4);
+ int is_data = 0;
+
+ /* Skip unwanted symbols, which are
+ exported in buggy auto-import releases. */
+ if (strncmp (erva + name_rva, "_nm_", 4) != 0)
+ {
+ /* is_data is true if the address is in the data, rdata or bss
+ segment. */
+ is_data =
+ (func_rva >= data_start && func_rva < data_end)
+ || (func_rva >= rdata_start && func_rva < rdata_end)
+ || (func_rva >= bss_start && func_rva < bss_end);
+
+ imp = def_file_add_import (pe_def_file, erva + name_rva,
+ dll_name, i, 0);
+ /* Mark symbol type. */
+ imp->data = is_data;
+
+ if (pe_dll_extra_pe_debug)
+ printf ("%s dll-name: %s sym: %s addr: 0x%lx %s\n",
+ __FUNCTION__, dll_name, erva + name_rva,
+ func_rva, is_data ? "(data)" : "");
+ }
}
- return true;
+ return TRUE;
}
/* These are the main functions, called from the emulation. The first
@@ -2424,30 +2622,27 @@ pe_implied_import_dll (filename)
can put the right values in place. */
void
-pe_dll_build_sections (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+pe_dll_build_sections (bfd *abfd, struct bfd_link_info *info)
{
pe_dll_id_target (bfd_get_target (abfd));
process_def_file (abfd, info);
+ if (pe_def_file->num_exports == 0 && !info->shared)
+ return;
+
generate_edata (abfd, info);
build_filler_bfd (1);
}
void
-pe_exe_build_sections (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
+pe_exe_build_sections (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
pe_dll_id_target (bfd_get_target (abfd));
build_filler_bfd (0);
}
void
-pe_dll_fill_sections (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+pe_dll_fill_sections (bfd *abfd, struct bfd_link_info *info)
{
pe_dll_id_target (bfd_get_target (abfd));
image_base = pe_data (abfd)->pe_opthdr.ImageBase;
@@ -2459,29 +2654,26 @@ pe_dll_fill_sections (abfd, info)
/* Resize the sections. */
lang_size_sections (stat_ptr->head, abs_output_section,
- &stat_ptr->head, 0, (bfd_vma) 0, NULL);
+ &stat_ptr->head, 0, 0, NULL, TRUE);
/* Redo special stuff. */
ldemul_after_allocation ();
/* Do the assignments again. */
- lang_do_assignments (stat_ptr->head,
- abs_output_section,
- (fill_type *) 0, (bfd_vma) 0);
+ lang_do_assignments (stat_ptr->head, abs_output_section, NULL, 0);
}
fill_edata (abfd, info);
- pe_data (abfd)->dll = 1;
+ if (info->shared)
+ pe_data (abfd)->dll = 1;
edata_s->contents = edata_d;
reloc_s->contents = reloc_d;
}
void
-pe_exe_fill_sections (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+pe_exe_fill_sections (bfd *abfd, struct bfd_link_info *info)
{
pe_dll_id_target (bfd_get_target (abfd));
image_base = pe_data (abfd)->pe_opthdr.ImageBase;
@@ -2493,15 +2685,13 @@ pe_exe_fill_sections (abfd, info)
/* Resize the sections. */
lang_size_sections (stat_ptr->head, abs_output_section,
- &stat_ptr->head, 0, (bfd_vma) 0, NULL);
+ &stat_ptr->head, 0, 0, NULL, TRUE);
/* Redo special stuff. */
ldemul_after_allocation ();
/* Do the assignments again. */
- lang_do_assignments (stat_ptr->head,
- abs_output_section,
- (fill_type *) 0, (bfd_vma) 0);
+ lang_do_assignments (stat_ptr->head, abs_output_section, NULL, 0);
}
reloc_s->contents = reloc_d;
}
diff --git a/contrib/binutils/ld/pe-dll.h b/contrib/binutils/ld/pe-dll.h
index b8fcdb9..029bf33 100644
--- a/contrib/binutils/ld/pe-dll.h
+++ b/contrib/binutils/ld/pe-dll.h
@@ -1,5 +1,5 @@
/* pe-dll.h: Header file for routines used to build Windows DLLs.
- Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -35,20 +35,28 @@ extern int pe_dll_warn_dup_exports;
extern int pe_dll_compat_implib;
extern int pe_dll_extra_pe_debug;
-extern void pe_dll_id_target PARAMS ((const char *));
-extern void pe_dll_add_excludes PARAMS ((const char *, const int));
-extern void pe_dll_generate_def_file PARAMS ((const char *));
-extern void pe_dll_generate_implib PARAMS ((def_file *, const char *));
-extern void pe_process_import_defs PARAMS ((bfd *, struct bfd_link_info *));
-extern boolean pe_implied_import_dll PARAMS ((const char *));
-extern void pe_dll_build_sections PARAMS ((bfd *, struct bfd_link_info *));
-extern void pe_exe_build_sections PARAMS ((bfd *, struct bfd_link_info *));
-extern void pe_dll_fill_sections PARAMS ((bfd *, struct bfd_link_info *));
-extern void pe_exe_fill_sections PARAMS ((bfd *, struct bfd_link_info *));
-
-extern void pe_walk_relocs_of_symbol PARAMS ((struct bfd_link_info * info,
- const char *name,
- int (*cb) (arelent *, asection *)));
-
-extern void pe_create_import_fixup PARAMS ((arelent * rel));
+extern void pe_dll_id_target
+ (const char *);
+extern void pe_dll_add_excludes
+ (const char *, const int);
+extern void pe_dll_generate_def_file
+ (const char *);
+extern void pe_dll_generate_implib
+ (def_file *, const char *);
+extern void pe_process_import_defs
+ (bfd *, struct bfd_link_info *);
+extern bfd_boolean pe_implied_import_dll
+ (const char *);
+extern void pe_dll_build_sections
+ (bfd *, struct bfd_link_info *);
+extern void pe_exe_build_sections
+ (bfd *, struct bfd_link_info *);
+extern void pe_dll_fill_sections
+ (bfd *, struct bfd_link_info *);
+extern void pe_exe_fill_sections
+ (bfd *, struct bfd_link_info *);
+extern void pe_walk_relocs_of_symbol
+ (struct bfd_link_info *, const char *, int (*) (arelent *, asection *));
+extern void pe_create_import_fixup
+ (arelent * rel, asection *, int);
#endif /* PE_DLL_H */
diff --git a/contrib/binutils/ld/scripttempl/armcoff.sc b/contrib/binutils/ld/scripttempl/armcoff.sc
index c61f734..781301c 100644
--- a/contrib/binutils/ld/scripttempl/armcoff.sc
+++ b/contrib/binutils/ld/scripttempl/armcoff.sc
@@ -44,7 +44,7 @@ SECTIONS
${RELOCATING+ etext = .;}
${RELOCATING+ _etext = .;}
}
- .data ${RELOCATING+${DATA_ADDR-0x40000 + (. & 0xfffc0fff)}} : {
+ .data ${RELOCATING+${DATA_ADDR-0x40000 + (ALIGN(0x8) & 0xfffc0fff)}} : {
${RELOCATING+ __data_start__ = . ;}
*(.data*)
@@ -60,7 +60,7 @@ SECTIONS
}
${CONSTRUCTING+${RELOCATING-$CTOR}}
${CONSTRUCTING+${RELOCATING-$DTOR}}
- .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
+ .bss ${RELOCATING+ ALIGN(0x8)} :
{
${RELOCATING+ __bss_start__ = . ;}
*(.bss)
diff --git a/contrib/binutils/ld/scripttempl/elf.sc b/contrib/binutils/ld/scripttempl/elf.sc
index 6bbe1b8..187a289 100644
--- a/contrib/binutils/ld/scripttempl/elf.sc
+++ b/contrib/binutils/ld/scripttempl/elf.sc
@@ -72,18 +72,20 @@ if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHI
test -z "${ELFSIZE}" && ELFSIZE=32
test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
test "$LD_FLAG" = "N" && DATA_ADDR=.
-test -n "$CREATE_SHLIB" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE=""
-test -z "$CREATE_SHLIB" && test -n "$DATA_ADDR" && COMMONPAGESIZE=""
-DATA_SEGMENT_ALIGN="ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))"
+test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE=""
+test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE=""
+DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))"
DATA_SEGMENT_END=""
if test -n "${COMMONPAGESIZE}"; then
- DATA_SEGMENT_ALIGN="DATA_SEGMENT_ALIGN(${MAXPAGESIZE}, ${COMMONPAGESIZE})"
+ DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})"
DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
fi
INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }"
+test -z "$GOT" && GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }"
DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
+STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
if test -z "${NO_SMALL_DATA}"; then
SBSS=".sbss ${RELOCATING-0} :
{
@@ -127,14 +129,14 @@ CTOR=".ctors ${CONSTRUCTING-0} :
doesn't matter which directory crtbegin.o
is in. */
- KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
- KEEP (*(EXCLUDE_FILE (*crtend.o $OTHER_EXCLUDE_FILES) .ctors))
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
${CONSTRUCTING+${CTOR_END}}
@@ -142,8 +144,8 @@ CTOR=".ctors ${CONSTRUCTING-0} :
DTOR=".dtors ${CONSTRUCTING-0} :
{
${CONSTRUCTING+${DTOR_START}}
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o $OTHER_EXCLUDE_FILES) .dtors))
+ KEEP (*crtbegin*.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
${CONSTRUCTING+${DTOR_END}}
@@ -180,8 +182,9 @@ ${RELOCATING- /* For some reason, the Solaris linker makes bad executables
SECTIONS
{
/* Read-only sections, merged into text segment: */
- ${CREATE_SHLIB-${RELOCATING+. = ${TEXT_BASE_ADDRESS};}}
+ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}
${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
+ ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
${CREATE_SHLIB-${INTERP}}
${INITIAL_READONLY_SECTIONS}
${TEXT_DYNAMIC+${DYNAMIC}}
@@ -283,8 +286,9 @@ cat <<EOF
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
- ${CREATE_SHLIB-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
+ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}}
${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
+ ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
@@ -322,7 +326,7 @@ cat <<EOF
.jcr ${RELOCATING-0} : { KEEP (*(.jcr)) }
${DATA_PLT+${PLT}}
${RELOCATING+${OTHER_GOT_SYMBOLS}}
- .got ${RELOCATING-0} : { *(.got.plt) *(.got) }
+ ${GOT}
${OTHER_GOT_SECTIONS}
${CREATE_SHLIB+${SDATA2}}
${CREATE_SHLIB+${SBSS2}}
@@ -395,5 +399,6 @@ cat <<EOF
${STACK_ADDR+${STACK}}
${OTHER_SECTIONS}
${RELOCATING+${OTHER_END_SYMBOLS}}
+ ${RELOCATING+${STACKNOTE}}
}
EOF
diff --git a/contrib/binutils/ld/scripttempl/pe.sc b/contrib/binutils/ld/scripttempl/pe.sc
index a22611c..da09eb4 100644
--- a/contrib/binutils/ld/scripttempl/pe.sc
+++ b/contrib/binutils/ld/scripttempl/pe.sc
@@ -25,6 +25,10 @@ if test "${RELOCATING}"; then
SORT(*)(.idata$6)
SORT(*)(.idata$7)'
R_CRT='*(SORT(.CRT$*))'
+ R_TLS='
+ *(.tls)
+ *(.tls$)
+ *(SORT(.tls$*))'
R_RSRC='*(SORT(.rsrc$*))'
else
R_TEXT=
@@ -60,7 +64,7 @@ SECTIONS
${RELOCATING+ *(.fini)}
/* ??? Why is .gcc_exc here? */
${RELOCATING+ *(.gcc_exc)}
- ${RELOCATING+ etext = .;}
+ ${RELOCATING+PROVIDE (etext = .);}
*(.gcc_except_table)
}
@@ -129,11 +133,16 @@ SECTIONS
${R_CRT}
}
+ .tls ${RELOCATING+BLOCK(__section_alignment__)} :
+ {
+ ${R_TLS}
+ }
+
.endjunk ${RELOCATING+BLOCK(__section_alignment__)} :
{
/* end is deprecated, don't use it */
- ${RELOCATING+ end = .;}
- ${RELOCATING+ _end = .;}
+ ${RELOCATING+PROVIDE (end = .);}
+ ${RELOCATING+PROVIDE ( _end = .);}
${RELOCATING+ __end__ = .;}
}
diff --git a/contrib/binutils/ld/sysdep.h b/contrib/binutils/ld/sysdep.h
index 24688a6..f164e74 100644
--- a/contrib/binutils/ld/sysdep.h
+++ b/contrib/binutils/ld/sysdep.h
@@ -1,5 +1,6 @@
/* sysdep.h -- handle host dependencies for the GNU linker
- Copyright 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1999, 2002, 2003
+ Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -21,8 +22,6 @@
#ifndef LD_SYSDEP_H
#define LD_SYSDEP_H
-#include "ansidecl.h"
-
#include "config.h"
#include <stdio.h>
@@ -48,6 +47,30 @@ extern char *strrchr ();
#include <unistd.h>
#endif
+/* for PATH_MAX */
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+/* for MAXPATHLEN */
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef PATH_MAX
+# define LD_PATHMAX PATH_MAX
+#else
+# ifdef MAXPATHLEN
+# define LD_PATHMAX MAXPATHLEN
+# else
+# define LD_PATHMAX 1024
+# endif
+#endif
+
+#ifdef HAVE_REALPATH
+# define REALPATH(a,b) realpath (a, b)
+#else
+# define REALPATH(a,b) NULL
+#endif
+
#ifdef USE_BINARY_FOPEN
#include "fopen-bin.h"
#else
OpenPOWER on IntegriCloud