summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/ld
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2010-10-21 19:11:14 +0000
committerdim <dim@FreeBSD.org>2010-10-21 19:11:14 +0000
commit844d5c9852c83cc56dccdc017c27f2bfc0928f05 (patch)
tree506464413c40d2c6a4a46d04892a9415cb886522 /contrib/binutils/ld
parentacc1b913a3297e19f9ffe7d2b7b8a3142926d3b4 (diff)
parent0acbbeece75076693a5c54ce4d376aa9f021b4e3 (diff)
downloadFreeBSD-src-844d5c9852c83cc56dccdc017c27f2bfc0928f05.zip
FreeBSD-src-844d5c9852c83cc56dccdc017c27f2bfc0928f05.tar.gz
Merge ^vendor/binutils/dist@214082 into contrib/binutils.
Diffstat (limited to 'contrib/binutils/ld')
-rw-r--r--contrib/binutils/ld/ChangeLog538
-rw-r--r--contrib/binutils/ld/Makefile.am431
-rw-r--r--contrib/binutils/ld/Makefile.in1554
-rw-r--r--contrib/binutils/ld/NEWS76
-rw-r--r--contrib/binutils/ld/acinclude.m415
-rw-r--r--contrib/binutils/ld/aclocal.m41007
-rw-r--r--contrib/binutils/ld/config.in259
-rwxr-xr-xcontrib/binutils/ld/configure12093
-rw-r--r--contrib/binutils/ld/configure.host75
-rw-r--r--contrib/binutils/ld/configure.in55
-rw-r--r--contrib/binutils/ld/configure.tgt735
-rw-r--r--contrib/binutils/ld/deffile.h6
-rw-r--r--contrib/binutils/ld/deffilep.y50
-rw-r--r--contrib/binutils/ld/dep-in.sed1
-rw-r--r--contrib/binutils/ld/emulparams/armelf.sh11
-rw-r--r--contrib/binutils/ld/emulparams/armelf_fbsd.sh1
-rw-r--r--contrib/binutils/ld/emulparams/armelf_linux.sh5
-rw-r--r--contrib/binutils/ld/emulparams/armelf_nbsd.sh1
-rw-r--r--contrib/binutils/ld/emulparams/armelf_oabi.sh23
-rw-r--r--contrib/binutils/ld/emulparams/armpe.sh2
-rw-r--r--contrib/binutils/ld/emulparams/elf32bmip.sh17
-rw-r--r--contrib/binutils/ld/emulparams/elf32bmipn32-defs.sh6
-rw-r--r--contrib/binutils/ld/emulparams/elf32btsmip.sh1
-rw-r--r--contrib/binutils/ld/emulparams/elf32ppc.sh48
-rw-r--r--contrib/binutils/ld/emulparams/elf32ppccommon.sh49
-rw-r--r--contrib/binutils/ld/emulparams/elf32ppclinux.sh4
-rw-r--r--contrib/binutils/ld/emulparams/elf64_ia64.sh4
-rw-r--r--contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh2
-rw-r--r--contrib/binutils/ld/emulparams/elf64_s390.sh1
-rw-r--r--contrib/binutils/ld/emulparams/elf64alpha.sh8
-rw-r--r--contrib/binutils/ld/emulparams/elf64ppc.sh8
-rw-r--r--contrib/binutils/ld/emulparams/elf_i386.sh1
-rw-r--r--contrib/binutils/ld/emulparams/elf_s390.sh1
-rw-r--r--contrib/binutils/ld/emulparams/elf_x86_64.sh2
-rw-r--r--contrib/binutils/ld/emulparams/i386freebsd.sh6
-rw-r--r--contrib/binutils/ld/emulparams/i386pe.sh1
-rw-r--r--contrib/binutils/ld/emulparams/i386pe_posix.sh1
-rw-r--r--contrib/binutils/ld/emulparams/mipsidt.sh3
-rw-r--r--contrib/binutils/ld/emulparams/mipsidtl.sh3
-rw-r--r--contrib/binutils/ld/emulparams/mipspe.sh1
-rw-r--r--contrib/binutils/ld/emulparams/ppcpe.sh1
-rw-r--r--contrib/binutils/ld/emultempl/alphaelf.em95
-rw-r--r--contrib/binutils/ld/emultempl/armcoff.em8
-rw-r--r--contrib/binutils/ld/emultempl/armelf.em123
-rw-r--r--contrib/binutils/ld/emultempl/armelf_oabi.em176
-rw-r--r--contrib/binutils/ld/emultempl/elf32.em1064
-rw-r--r--contrib/binutils/ld/emultempl/generic.em6
-rw-r--r--contrib/binutils/ld/emultempl/ia64elf.em4
-rw-r--r--contrib/binutils/ld/emultempl/linux.em10
-rw-r--r--contrib/binutils/ld/emultempl/mipsecoff.em255
-rw-r--r--contrib/binutils/ld/emultempl/mipself.em177
-rw-r--r--contrib/binutils/ld/emultempl/needrelax.em2
-rw-r--r--contrib/binutils/ld/emultempl/pe.em637
-rw-r--r--contrib/binutils/ld/emultempl/ppc32elf.em114
-rw-r--r--contrib/binutils/ld/emultempl/ppc64elf.em186
-rw-r--r--contrib/binutils/ld/emultempl/sunos.em24
-rw-r--r--contrib/binutils/ld/emultempl/ticoff.em4
-rw-r--r--contrib/binutils/ld/emultempl/vanilla.em4
-rw-r--r--contrib/binutils/ld/fdl.texi4
-rw-r--r--contrib/binutils/ld/gen-doc.texi2
-rwxr-xr-xcontrib/binutils/ld/genscripts.sh63
-rw-r--r--contrib/binutils/ld/ld.1256
-rw-r--r--contrib/binutils/ld/ld.h89
-rw-r--r--contrib/binutils/ld/ld.texinfo1081
-rw-r--r--contrib/binutils/ld/ldcref.c217
-rw-r--r--contrib/binutils/ld/ldctor.c8
-rw-r--r--contrib/binutils/ld/ldctor.h4
-rw-r--r--contrib/binutils/ld/ldemul.c30
-rw-r--r--contrib/binutils/ld/ldemul.h14
-rw-r--r--contrib/binutils/ld/ldexp.c838
-rw-r--r--contrib/binutils/ld/ldexp.h91
-rw-r--r--contrib/binutils/ld/ldfile.c95
-rw-r--r--contrib/binutils/ld/ldfile.h6
-rw-r--r--contrib/binutils/ld/ldgram.y269
-rw-r--r--contrib/binutils/ld/ldint.texinfo2
-rw-r--r--contrib/binutils/ld/ldlang.c3145
-rw-r--r--contrib/binutils/ld/ldlang.h137
-rw-r--r--contrib/binutils/ld/ldlex.h4
-rw-r--r--contrib/binutils/ld/ldlex.l114
-rw-r--r--contrib/binutils/ld/ldmain.c229
-rw-r--r--contrib/binutils/ld/ldmain.h11
-rw-r--r--contrib/binutils/ld/ldmisc.c246
-rw-r--r--contrib/binutils/ld/ldmisc.h7
-rw-r--r--contrib/binutils/ld/ldver.c30
-rw-r--r--contrib/binutils/ld/ldver.h5
-rw-r--r--contrib/binutils/ld/ldver.texi2
-rw-r--r--contrib/binutils/ld/ldwrite.c112
-rw-r--r--contrib/binutils/ld/ldwrite.h4
-rw-r--r--contrib/binutils/ld/lexsup.c504
-rw-r--r--contrib/binutils/ld/mri.c44
-rw-r--r--contrib/binutils/ld/mri.h4
-rw-r--r--contrib/binutils/ld/pe-dll.c156
-rw-r--r--contrib/binutils/ld/pe-dll.h6
-rw-r--r--contrib/binutils/ld/po/Make-in6
-rw-r--r--contrib/binutils/ld/po/POTFILES.in1
-rw-r--r--contrib/binutils/ld/po/ld.pot1071
-rw-r--r--contrib/binutils/ld/scripttempl/elf.sc209
-rw-r--r--contrib/binutils/ld/scripttempl/mips.sc3
-rw-r--r--contrib/binutils/ld/scripttempl/pe.sc119
-rw-r--r--contrib/binutils/ld/sysdep.h12
100 files changed, 19698 insertions, 9547 deletions
diff --git a/contrib/binutils/ld/ChangeLog b/contrib/binutils/ld/ChangeLog
index e48196d..a912aea 100644
--- a/contrib/binutils/ld/ChangeLog
+++ b/contrib/binutils/ld/ChangeLog
@@ -1,329 +1,359 @@
-2005-01-21 Nick Hudson <skrll@netbsd.org>
+2006-07-19 Alan Modra <amodra@bigpond.net.au>
- PR ld/676
- * emultempl/hppaelf.em (hppaelf_create_output_section_statements):
- Handle bfd_elf32_hppa_nbsd_vec.
+ * ld.h (handle_asneeded_cref): Declare.
+ * ldcref.c: Include objalloc.h.
+ (old_table, old_tab, alloc_mark): New variables.
+ (tabsize, entsize, refsize, old_symcount): Likewise.
+ (add_cref): Use bfd_hash_allocate for refs.
+ (handle_asneeded_cref): New function.
+ * ldmain.c (notice): Call handle_asneeded_cref for NULL name.
-2004-07-28 Jason Thorpe <thorpej@wasabisystems.com>
+2006-07-04 Daniel Jacobowitz <dan@codesourcery.com>
- * emulparams/hppanbsd.sh (OUTPUT_FORMAT): Set to "elf32-hppa-netbsd".
+ Backport:
+ 2006-05-19 Alan Modra <amodra@bigpond.net.au>
+ * ldlang.c (lang_size_sections_1): Don't check mem regions for
+ os->ignored sections.
-2004-05-13 Joel Sherrill <joel@oarcorp.com>
+2006-06-12 Fred Fish <fnf@specifix.com>
- * configure.tgt (or32-*-rtems*): Switch to elf and
- support versioned targets.
+ * emulparams/elf32bmip.sh (OTHER_SECTIONS): Keep the
+ ".mdebug.<abi>" and ".gcc_compiled_long<size>" sections
+ generated by mips gcc.
-2004-05-13 Nick Clifton <nickc@redhat.com>
+2006-06-09 Alan Modra <amodra@bigpond.net.au>
- * po/fr.po: Updated French translation.
+ * ldlang.h (lang_input_statement_type): Use bitfields for booleans.
+ * ldlang.c (struct out_section_hash_entry): Rename from
+ output_statement_hash_entry. Delete output_section_statement_type
+ entry. Add statement_union_type entry. Adjust all users.
+ (output_section_statement_table): Rename from output_statement_table.
+ Adjust all users.
+ (output_section_statement_newfunc): Rename from
+ output_statement_newfunc. Adjust all users.
+ (output_section_statement_table_init): Rename from
+ output_statement_table_init. Adjust all users.
+ (output_section_statement_table_free): Rename from
+ output_statement_table_free. Adjust all users.
-2004-05-05 Alexandre Oliva <aoliva@redhat.com>
+2006-06-08 Alan Modra <amodra@bigpond.net.au>
- * emulparams/elf32frvfd.sh (OUTPUT_FORMAT): Switch to new
- elf32-frvfdpic.
+ * emultempl/elf32.em (global_found): Make it a pointer.
+ (stat_needed, try_needed): Adjust.
+ (check_needed): Don't skip non-loaded as-needed entries. Only
+ consider entries with both filename and the_bfd non-null.
+ (after_open): Try loading non-loaded as-needed libs to satisfy
+ DT_NEEDED libs.
-2004-04-29 Alan Modra <amodra@bigpond.net.au>
+2006-06-07 Joseph S. Myers <joseph@codesourcery.com>
- * pe-dll.c: Revert changes accidentally committed 2004-03-08.
- (fill_edata): Correct pointer arithmetic.
+ * po/Make-in (pdf, ps): New dummy targets.
-2004-04-21 Hans-Peter Nilsson <hp@axis.com>
+2006-06-02 Joseph S. Myers <joseph@codesourcery.com>
- * NEWS: Mention change in DEFINED semantics.
+ * Makefile.am (TEXI2DVI): Add -I $(top_srcdir)/../libiberty.
+ * Makefile.in: Regenerate.
+
+2006-05-30 Nick Clifton <nickc@redhat.com>
+
+ * po/es.po: Updated Spanish translation.
+
+2006-05-24 Nick Clifton <nickc@redhat.com>
+
+ * po/vi.po: Updated Vietnamese translation.
+
+2006-05-22 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * ld-mips-elf/textrel-1.d: Relax some patterns.
+
+2006-05-22 Nick Clifton <nickc@redhat.com>
+
+ * scripttempl/elf32crx.sc (.rdata): Add .rodata.*.
+
+2006-05-05 Alan Modra <amodra@bigpond.net.au>
+
+ * ld.texinfo: Document PowerPC and PowerPC64 options.
+ * gen-doc.texi: Enable.
+ * configdoc.texi: Regenerate.
+ * ld.info: Regenerate.
+
+2006-05-02 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * Makefile.am (AM_MAKEINFOFLAGS): Add libiberty.
+ (TEXI2POD): Use AM_MAKEINFOFLAGS.
+ (configdoc.texi): Don't set top_srcdir.
+ * ld.texinfo: Don't use top_srcdir.
+ * aclocal.m4, Makefile.in: Regenerated.
+
+2006-04-16 Daniel Jacobowitz <dan@codesourcery.com>
-2004-04-20 Chris Demetriou <cgd@broadcom.com>
+ * po/POTFILES.in: Regenerated.
- * NEWS: Note that MIPS --embedded-relocs option is deprecated.
+2006-04-16 Daniel Jacobowitz <dan@codesourcery.com>
-2004-04-11 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+ * config.in: Regenerated.
- * configure.host: Remove mips*-dec-bsd* target.
- * configure.tgt: Likewise.
+2006-04-14 David Heine <dlheine@tensilica.com>
+ Bob Wilson <bob.wilson@acm.org>
-2004-04-09 Daniel Jacobowitz <drow@mvista.com>
+ * emultempl/xtensaelf.em (elf_xtensa_before_allocation): Call new
+ function to strip inconsistent linkonce sections.
+ (input_section_linked_worker, input_section_linked): New.
+ (is_inconsistent_linkonce_section): New.
+ (xtensa_strip_inconsistent_linkonce_sections): New.
- Merge from mainline:
- 2004-03-30 Nick Clifton <nickc@redhat.com>
- * po/sv.po: Updated Swedish translation.
+2006-04-11 Diego Pettenò <flameeyes@gentoo.org>
- 2004-03-20 Alexandre Oliva <aoliva@redhat.com>
- * emulparams/elf32frvfd.sh (MAXPAGESIZE): Change to 16Kb.
+ * emultempl/elf32.em: Add support for elf-hints.h on FreeBSD
+ and Dragonfly targets.
+ * configure.in (AC_CHECK_HEADERS): Add elf-hints.h.
+ * Makefile.am (HFILES): Add elf-hints-local.h.
+ * elf-hints-local.h: New file.
+ * Makefile.in: Regenerate.
+ * configure: Regenerate.
- 2004-03-08 Danny Smith <dannysmith@users.sourceforge.net>
- * pe-dll.c (pe_dll_generate_implib): Skip sections marked as
- private when building implib.
+2006-04-07 Bernhard Fischer <aldot@gcc.gnu.org>
- 2004-03-01 Andreas Schwab <schwab@suse.de>
- * ld.texinfo (Options): Fix example for --wrap.
+ * ld.texinfo: Fix typo in documentation of --check-sections.
- 2004-02-25 Danny Smith <dannysmith@users.sourceforge.net>
- * pe-dll.c (fill_edata): Check that exported_symbol_sections is
- not NULL.
+2006-04-07 Kaz Kojima <kkojima@rr.iij4u.or.jp>
- 2004-02-23 Ian Lance Taylor <ian@wasabisystems.com>
- * ldlang.c (lang_check): Use %P, not %E, in error message.
+ * ldlang.c (load_symbols): Set as_needed and add_needed according
+ to the corresponding script's fields while processing it.
-2004-04-08 Richard Sandiford <rsandifo@redhat.com>
+2006-04-06 Carlos O'Donell <carlos@codesourcery.com>
- * 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.am: Add install-html, install-html-am, and
+ install-html-recursive targets.
* Makefile.in: Regenerate.
+ * configure.in: AC_SUBST datarootdir, docdir, htmldir.
+ * configure: Regenerate.
+ * po/Make-in: Add install-html target.
+
+2006-04-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * emultempl/ia64elf.em: Set link_info.relax_pass to 2. Remove
+ link_info.need_relax_finalize.
+
+ * ldlang.c (relax_sections): New.
+ (lang_process): Use. Call relax_sections link_info.relax_pass
+ times.
-2004-04-08 Alan Modra <amodra@bigpond.net.au>
+ * ldmain.c (main): Set link_info.relax_pass to 1. Remove
+ link_info.need_relax_finalize.
- 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/sh64elf.em: Likewise.
+2006-04-05 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.am (GENSCRIPTS): Pass prefix.
+ * Makefile.in: Regenerate.
+ * genscripts.sh: Adjust for extra parameter.
+ * emultempl/elf32.em (parse_ld_so_conf): Return true iff file
+ exists.
+ (check_ld_so_conf): Use ${prefix}/etc/ld.so.conf if it exists.
+ * NEWS: Update.
+
+2006-04-05 Richard Sandiford <richard@codesourcery.com>
+ Daniel Jacobowitz <dan@codesourcery.com>
+
+ * configure.tgt (sparc*-*-vxworks*): New stanza.
+ * emulparams/elf32_sparc_vxworks.sh: New file.
+ * Makefile.am (ALL_EMULATIONS): Add eelf32_sparc_vxworks.o.
+ (eelf32_sparc_vxworks.c): New rule.
+ * Makefile.in: Regenerate.
- 2004-03-25 Alan Modra <amodra@bigpond.net.au>
- * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Update
- size_dynamic_sections call.
+2006-04-04 Eric Botcazou <ebotcazou@adacore.com>
- 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.
+ * ldlang.c (lang_map): Print the list of discarded input sections.
+ (print_input_section): Change parameter and print zero-sized sections.
+ (print_statement): Adjust call to print_input_section.
- 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.
- * 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.
+2006-04-01 Danny Smith <dannysmith@users.sourceforge.net>
-2004-03-23 Alan Modra <amodra@bigpond.net.au>
+ * deffilep.y (def_image_name): If LIBRARY or NAME statement
+ specifies an empty string, retain the name specified on command
+ line.
+ * ld.texinfo: Document above.
- PR 51.
- * emultempl/ppc64elf.em (ppc_create_output_section_statements): Set
- link_info.wrap_char.
+2006-03-31 Jakub Jelinek <jakub@redhat.com>
-2004-03-17 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+ * ldmisc.c (vfinfo): Revert 2005-10-05 changes. If
+ bfd_find_nearest_line succeeded for %C or %D, but filename
+ is NULL, print section+offset at the end.
- * configure.tgt: Switch sh-*-rtems* to ELF. Add sh-*-rtemscoff*.
+2006-03-25 Bernd Schmidt <bernd.schmidt@analog.com>
-2004-03-05 Nathan Sidwell <nathan@codesourcery.com>
+ * emulparams/elf32bfinfd.sh: New file.
+ * emultempl/bfin.em: Delete.
+ * emulparams/bfin.sh: Lose reference to bfin.em.
+ * Makefile.am (eelf32bfin.c): Likewise.
+ (eelf32bfinfd.c): New.
+ * Makefile.in: Regenerate.
+ * configure.tgt (bfin-*-elf, bfin-*-uclinux): Add elf32bfinfd to
+ targ_extra_emuls.
+
+2006-03-22 Richard Sandiford <richard@codesourcery.com>
+ Daniel Jacobowitz <dan@codesourcery.com>
+ Phil Edwards <phil@codesourcery.com>
+ Zack Weinberg <zack@codesourcery.com>
+ Mark Mitchell <mark@codesourcery.com>
+ Nathan Sidwell <nathan@codesourcery.com>
+
+ * configure.tgt (mips*el-*-vxworks*, mips*-*-vxworks*): Use
+ separate VxWorks emulations.
+ * emulparams/elf32ebmipvxworks.sh: New file.
+ * emulparams/elf32elmipvxworks.sh: New file.
+ * Makefile.am (ALL_EMULATIONS): Add eelf32ebmipvxworks.o and
+ eelf32elmipvxworks.o.
+ (eelf32ebmipvxworks.c, eelf32elmipvxworks.c): New rules.
+ * Makefile.in: Regenerate.
- * 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.
+2006-03-16 Alan Modra <amodra@bigpond.net.au>
+
+ PR 2434
+ * ldcref.c (add_cref): Adjust bfd_hash_table_init calls.
+ * ldlang.c (output_statement_table_init, lang_init): Likewise.
+ * ldmain.c (add_ysym, add_wrap, add_keepsyms_file): Likewise.
+ (undefined_symbol): Likewise.
+
+2006-03-07 Richard Sandiford <richard@codesourcery.com>
+ Daniel Jacobowitz <dan@codesourcery.com>
+ Zack Weinberg <zack@codesourcery.com>
+ Nathan Sidwell <nathan@codesourcery.com>
+ Paul Brook <paul@codesourcery.com>
+ Ricardo Anguiano <anguiano@codesourcery.com>
+ Phil Edwards <phil@codesourcery.com>
+
+ * emulparams/armelf_vxworks.sh: Include vxworks.sh.
+ (MAXPAGESIZE): Define.
+ * emulparams/vxworks.sh: Undefine EMBEDDED.
+ * Makefile.am (earmelf_vxworks.c): Depend on vxworks.sh and vxworks.em.
+ * Makefile.in: Regenerate.
-2004-02-23 Nathan Sidwell <nathan@codesourcery.com>
+2006-03-03 Bjoern Haase <bjoern.m.haase@web.de>
- * 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.
+ * scripttempl/avr.sc: Add *(.jumptables) *(.lowtext) sections.
+ Add KEEP() directives.
+ Add *(.data*) *(.rodata) and *(.rodata*) and *(.bss*) to .data and
+ .bss output sections.
-2004-02-23 Alan Modra <amodra@bigpond.net.au>
+2006-03-03 Richard Sandiford <richard@codesourcery.com>
- * ldexp.c (fold_tree): Follow indirect symbols.
+ * emulparams/vxworks.sh (VXWORKS_BASE_EM_FILE): New variable.
+ (EXTRA_EM_FILE): Define.
+ * emultempl/vxworks.em: New file.
+ * ld.texinfo (--force-dynamic): Document.
+ * Makefile.am (eelf32ppcvxworks.cm, eelf_i386_vxworks.c): Depend
+ on vxworks.em.
+ * Makefile.in: Regenerate.
-2004-02-20 Nathan Sidwell <nathan@codesourcery.com>
+2006-03-02 Richard Sandiford <richard@codesourcery.com>
+
+ * emulparams/elf32ppccommon.sh: New file, extracted from...
+ * emulparams/elf32ppc.sh: ...here.
+ * emulparams/elf32ppcvxworks.sh: Include elf32ppccommon.sh
+ instead of elf32ppc.sh.
+ (BSS_PLT): Remove override.
+ * Makefile.am (eelf32lppc.c): Depend on elf32ppccommons.h.
+ (eelf32lppcnto.c, eelf32lppcsim.c, eelf32ppcnto.c): Likewise.
+ (eelf32ppc.c, eelf32ppc_fbsd.c, eelf32ppcsimm): Likewise.
+ (eelf32ppclinux.c): Likewise.
+ (eelf32ppcvxworks.c): Likewise. Add missing vxworks.sh dependency.
+ * Makefile.in: Regenerate.
- * ldgram.y (exp): Add two operand ALIGN.
- * ldexp.c (fold_binary): Add ALIGN_K case.
- * ld.texinfo (ALIGN): Document two operand version.
+2006-02-27 Carlos O'Donell <carlos@codesourcery.com>
-2004-02-19 Nathan Sidwell <nathan@codesourcery.com>
+ * Makefile.am: Add html target.
+ * Makefile.in: Regenerate.
+ * po/Make-in: Add html target.
+
+2006-02-17 Shrirang Khisti <shrirangk@kpitcummins.com>
+ Anil Paranjape <anilp1@kpitcummins.com>
+ Shilin Shakti <shilins@kpitcummins.com>
+
+ * scripttemp/elf32xc16x.sc: Default linker script for tiny model.
+ * scripttemp/elf32xc16xl.sc: Default linker script for large model.
+ * scripttemp/elf32xc16xs.sc: Default linker script for small model.
+ * emulparams/elf32xc16x.sh: Emulation script for tiny model.
+ * emulparams/elf32xc16xl.sh: Emulation script for large model.
+ * emulparams/elf32xc16xs.sh: Emulation script for small model.
+ * Makefile.am: Add entry to make xc16x target.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Specify default and other emulation parameters
+ for xc16x.
+ * NEWS: Announce the support for the new target.
- * 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.
+2006-02-16 Nick Hudson <nick.hudson@dsl.pipex.com>
-2004-02-18 Nathan Sidwell <nathan@codesourcery.com>
+ * configure.tgt (mips*el-*-netbsd*, mips*-*-netbsd*):
+ Use the traditional target.
- * ldgram.y (statement_anywhere): Add assert rule.
- * ldlang.c (exp_init_os): Add assert case.
+2006-02-13 Joseph S. Myers <joseph@codesourcery.com>
-2004-02-14 Andrew Cagney <cagney@redhat.com>
+ * configure.tgt (arm*b-*-linux-gnueabi): Change to
+ arm*b-*-linux-*eabi.
+ (arm*-*-linux-gnueabi): Change to arm*-*-linux-*eabi.
- * ldmain.c (remove_output): Call bfd_cache_close.
+2006-02-08 H.J. Lu <hongjiu.lu@intel.com>
-2004-02-14 Richard Sandiford <rsandifo@redhat.com>
+ PR ld/2290
+ * NEWS: Updated for the Linux linker search order change.
- * emulparams/elf32bmipn32-defs.sh (OTHER_SECTIONS): Discard
- .MIPS.content* and .MIPS.events* sections.
+ * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Call
+ gld${EMULATION_NAME}_check_ld_so_conf before checking default
+ search directories for DT_NEEDED entries.
-2004-02-09 Daniel Jacobowitz <drow@mvista.com>
+2006-02-07 Paul Brook <paul@codesourcery.com>
- * emulparams/armelf.sh, emulparams/armelf_linux.sh: Move
- .note.gnu.arm.ident to after allocated sections. Mark its
- address as 0.
+ * emultempl/armelf.em: Include elf/arm.h.
+ (arm_elf_finish): Set low address bit if enty point is a Thumb
+ function.
-2004-02-09 Daniel Jacobowitz <drow@mvista.com>
+2006-02-01 Danny Smith <dannysmith@users.sourceforge.net>
- * 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.
+ * deffilep.y (def_image_name): If the image name does not have
+ a suffix, append the default.
+ * ld.texinfo: Document NAME, LIBRARY usage in PE-COFF .def files.
-2004-02-05 Nick Clifton <nickc@redhat.com>
+2006-01-31 Danny Smith dannysmith@users.sourceforge.net
- * emultempl/pe.em (_after_open): Fix typo in previous delta.
+ * NEWS: Mention support for forward exports in PE-COFF dll's.
+ * ld.texinfo: Expand documentation of EXPORT statements in
+ PE-COFF .def files.
-2004-02-04 Danny Smith <dannysmith@users.sourceforge.net>
+2006-01-31 Filip Navara <navaraf@reactos.com>
- * emultempl/pe.em (_after_open): Fix thinko in 2003-12-18 patch.
+ * deffile.h (struct def_file_export): Add field flag_forward.
+ * pe-dll.c (process_def_file): Check for forward exports.
+ (generate_edata): Generate forward export symbols.
+ (fill_edata): Emit them.
-2004-01-28 Alan Modra <amodra@bigpond.net.au>
+ * pe-dll.c (process_def_file): Don't crash on malformed
+ fastcall symbol names in .def file.
- * genscripts.sh: Fix typo.
+2006-01-30 Nick Clifton <nickc@redhat.com>
- * genscripts.sh: Apply $LIBPATH_SUFFIX to $tool_lib and $libdir too.
+ * po/vi.po: Updated Vietnamese translation.
-2004-01-24 Jakub Jelinek <jakub@redhat.com>
+2006-01-27 Yitzchak Scott-Thoennes <sthoenna@efn.org>
- * emulparams/elf64_ia64.sh: Put .rela.opd into
- OTHER_GOT_RELOC_SECTIONS instead of OTHER_PLT_RELOC_SECTIONS.
+ * pe-dll.c (pe_dll_generate_implib): Issue "Creating library
+ file:" as informational message, not a warning.
-2004-01-20 Danny Smith <dannysmith@users.sourceforge.net>
+2006-01-18 Roger Sayle <roger@eyesopen.com>
- * 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.
+ * emultempl/irix.em: Use lbasename instead of basename.
-2004-01-15 Alan Modra <amodra@bigpond.net.au>
+2006-01-16 Nick Clifton <nickc@redhat.com>
- * emulparams/elf32ppc.sh (COMMONPAGESIZE): Define.
+ * po/zh_CN.po: New Chinese (simplified) translation.
+ * configure.in (ALL_LINGUAS): Add "zh_CH".
+ * configure: Regenerate.
-2004-01-13 Nick Clifton <nickc@redhat.com>
-
- * 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.
+2006-01-16 Bernhard Fischer <aldot@gcc.gnu.org>
-2004-01-09 Alan Modra <amodra@bigpond.net.au>
+ * ld.texinfo (Options): Fix typo.
- * 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.
- 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
+For older changes see ChangeLog-2005
Local Variables:
mode: change-log
diff --git a/contrib/binutils/ld/Makefile.am b/contrib/binutils/ld/Makefile.am
index a2f1ac1..3f5d1a6 100644
--- a/contrib/binutils/ld/Makefile.am
+++ b/contrib/binutils/ld/Makefile.am
@@ -14,6 +14,7 @@ YFLAGS = -d
LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi`
WARN_CFLAGS = @WARN_CFLAGS@
+NO_WERROR = @NO_WERROR@
AM_CFLAGS = $(WARN_CFLAGS)
# We put the scripts in the directory $(scriptdir)/ldscripts.
@@ -45,7 +46,7 @@ DOCVER = gen
# Options to extract the man page from ld.texinfo
MANCONF = -Dman
-TEXI2POD = perl $(BASEDIR)/etc/texi2pod.pl
+TEXI2POD = perl $(BASEDIR)/etc/texi2pod.pl $(AM_MAKEINFOFLAGS)
POD2MAN = pod2man --center="GNU Development Tools" \
--release="binutils-$(VERSION)" --section=1
@@ -56,14 +57,8 @@ HOSTING_LIBS = @HOSTING_LIBS@
HOSTING_EMU = -m $(EMUL)
# Setup the testing framework, if you have one
-EXPECT = `if [ -f $$r/../expect/expect ] ; \
- then echo $$r/../expect/expect ; \
- else echo expect ; fi`
-
-RUNTEST = `if [ -f $${srcroot}/../dejagnu/runtest ] ; \
- then echo $${srcroot}/../dejagnu/runtest ; \
- else echo runtest ; fi`
-
+EXPECT = expect
+RUNTEST = runtest
RUNTESTFLAGS =
CC_FOR_TARGET = ` \
@@ -102,13 +97,15 @@ info_TEXINFOS = ld.texinfo
noinst_TEXINFOS = ldint.texinfo
man_MANS = ld.1
-INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) -I$(top_srcdir)/../intl -I../intl $(HDEFINES) $(CFLAGS) -DLOCALEDIR="\"$(prefix)/share/locale\""
+AM_MAKEINFOFLAGS = -I $(srcdir) -I $(BFDDIR)/doc -I $(top_srcdir)/../libiberty
+TEXI2DVI = texi2dvi -I $(srcdir) -I $(BFDDIR)/doc -I $(top_srcdir)/../libiberty
+
+INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) -I$(top_srcdir)/../intl -I../intl $(HDEFINES) $(CFLAGS) -DLOCALEDIR="\"$(datadir)/locale\""
BFDLIB = ../bfd/libbfd.la
LIBIBERTY = ../libiberty/libiberty.a
ALL_EMULATIONS = \
- ea29k.o \
eaixppc.o \
eaixrs6.o \
ealpha.o \
@@ -121,13 +118,16 @@ ALL_EMULATIONS = \
earmelfb.o \
earmelf_fbsd.o \
earmelf_linux.o \
+ earmelf_linux_eabi.o \
earmelfb_linux.o \
+ earmelfb_linux_eabi.o \
earmelf_nbsd.o \
earmelfb_nbsd.o \
- earmelf_oabi.o \
+ earmelf_vxworks.o \
earmnto.o \
earmnbsd.o \
earmpe.o \
+ earmsymbian.o \
eavr2.o \
eavr1.o \
eavr3.o \
@@ -144,19 +144,25 @@ ALL_EMULATIONS = \
ed30velf.o \
edelta68.o \
eelf32_dlx.o \
- eebmon29k.o \
eelf32_i960.o \
eelf32_i860.o \
eelf32_sparc.o \
+ eelf32_sparc_vxworks.o \
eelf32b4300.o \
+ eelf32bfin.o \
+ eelf32bfinfd.o \
+ eelf32cr16c.o \
eelf32bmip.o \
eelf32bmipn32.o \
eelf32btsmip.o \
+ eelf32crx.o \
eelf32btsmipn32.o \
eelf32ltsmip.o \
eelf32ltsmipn32.o \
eelf32ebmip.o \
+ eelf32ebmipvxworks.o \
eelf32elmip.o \
+ eelf32elmipvxworks.o \
eelf32fr30.o \
eelf32frv.o \
eelf32i370.o \
@@ -168,8 +174,10 @@ ALL_EMULATIONS = \
eelf32lppc.o \
eelf32lppcnto.o \
eelf32lppcsim.o \
+ eelf32m32c.o \
eelf32mcore.o \
eelf32mipswindiss.o \
+ eelf32mt.o \
eelf32openrisc.o \
eelf32ppc.o \
eelf32ppc_fbsd.o \
@@ -177,7 +185,11 @@ ALL_EMULATIONS = \
eelf32ppcnto.o \
eelf32ppcsim.o \
eelf32ppcwindiss.o \
+ eelf32ppcvxworks.o \
eelf32vax.o \
+ eelf32xc16x.o \
+ eelf32xc16xl.o \
+ eelf32xc16xs.o \
eelf32xstormy16.o \
eelf32xtensa.o \
eelf_i386.o \
@@ -185,6 +197,7 @@ ALL_EMULATIONS = \
eelf_i386_chaos.o \
eelf_i386_fbsd.o \
eelf_i386_ldso.o \
+ eelf_i386_vxworks.o \
eelf_s390.o \
egld960.o \
egld960coff.o \
@@ -244,10 +257,10 @@ ALL_EMULATIONS = \
em68kelf.o \
em68kelfnbsd.o \
em68klinux.o \
- em68klynx.o \
em68knbsd.o \
em68kpsos.o \
em88kbcs.o \
+ emaxqcoff.o \
emcorepe.o \
emipsbig.o \
emipsbsd.o \
@@ -280,6 +293,13 @@ ALL_EMULATIONS = \
emsp430x167.o \
emsp430x168.o \
emsp430x169.o \
+ emsp430x1610.o \
+ emsp430x1611.o \
+ emsp430x1612.o \
+ emsp430x2101.o \
+ emsp430x2111.o \
+ emsp430x2121.o \
+ emsp430x2131.o \
emsp430x311.o \
emsp430x312.o \
emsp430x313.o \
@@ -291,12 +311,17 @@ ALL_EMULATIONS = \
emsp430x337.o \
emsp430x412.o \
emsp430x413.o \
+ emsp430x415.o \
+ emsp430x417.o \
emsp430xE423.o \
emsp430xE425.o \
emsp430xE427.o \
emsp430xW423.o \
emsp430xW425.o \
emsp430xW427.o \
+ emsp430xG437.o \
+ emsp430xG438.o \
+ emsp430xG439.o \
emsp430x435.o \
emsp430x436.o \
emsp430x437.o \
@@ -314,8 +339,8 @@ ALL_EMULATIONS = \
eppcmacos.o \
eppcnw.o \
eppcpe.o \
+ eppclynx.o \
eriscix.o \
- esa29200.o \
esh.o \
eshelf32.o \
eshlelf32.o \
@@ -332,10 +357,10 @@ ALL_EMULATIONS = \
eshlelf_nto.o \
eshl.o \
eshlelf.o \
+ eshlsymbian.o \
eshpe.o \
esparcaout.o \
esparclinux.o \
- esparclynx.o \
esparcnbsd.o \
est2000.o \
esun3.o \
@@ -353,7 +378,8 @@ ALL_EMULATIONS = \
evsta.o \
ew65.o \
ez8001.o \
- eelf32frvfd.o \
+ eelf32frvfd.o \
+ ez80.o \
ez8002.o
ALL_64_EMULATIONS = \
@@ -392,7 +418,7 @@ CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
- ldwrite.h mri.h deffile.h pe-dll.h
+ ldwrite.h mri.h deffile.h pe-dll.h elf-hints-local.h
GENERATED_CFILES = ldgram.c ldlex.c deffilep.c
GENERATED_HFILES = ldgram.h ldemul-list.h deffilep.h
@@ -403,6 +429,15 @@ OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
STAGESTUFF = *.o ldscripts/* e*.c
+# Disable -Werror, if it has been enabled, since old versions of bison/
+# yacc will produce working code which contain compile time warnings.
+ldgram.o:
+ $(COMPILE) -c $< $(NO_WERROR)
+ldlex.o:
+ $(COMPILE) -c $< $(NO_WERROR)
+deffilep.o:
+ $(COMPILE) -c $< $(NO_WERROR)
+
# At the moment this is just a list of those emulation template files
# that contain internationalised strings.
EMULATION_FILES = emultempl/pe.em emultempl/armcoff.em
@@ -440,14 +475,11 @@ stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
# These all start with e so 'make clean' can find them.
-GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@
+GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${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 \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} a29k "$(tdir_a29k)"
eaix5ppc.c: $(srcdir)/emulparams/aix5ppc.sh \
$(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
${GENSCRIPTS} aix5ppc "$(tdir_aixppc)"
@@ -474,9 +506,6 @@ 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)"
earmelf_fbsd.c: $(srcdir)/emulparams/armelf_fbsd.sh \
$(srcdir)/emulparams/armelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
@@ -486,11 +515,22 @@ 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)"
+earmelf_linux_eabi.c: $(srcdir)/emulparams/armelf_linux_eabi.sh \
+ $(srcdir)/emulparams/armelf_linux.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armelf_linux_eabi "$(tdir_armelf_linux_abi)"
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)"
+earmelfb_linux_eabi.c: $(srcdir)/emulparams/armelfb_linux_eabi.sh \
+ $(srcdir)/emulparams/armelf_linux_eabi.sh \
+ $(srcdir)/emulparams/armelf_linux.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armelfb_linux_eabi "$(tdir_armelfb_linux_abi)"
earmelf_nbsd.c: $(srcdir)/emulparams/armelf_nbsd.sh \
$(srcdir)/emulparams/armelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
@@ -502,6 +542,12 @@ earmelfb_nbsd.c: $(srcdir)/emulparams/armelfb_nbsd.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelfb_nbsd "$(tdir_armelfb_nbsd)"
+earmelf_vxworks.c: $(srcdir)/emulparams/armelf_vxworks.sh \
+ $(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/armelf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/vxworks.em \
+ $(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/elf.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} armelf_vxworks "$(tdir_armelf)"
earmaoutb.c: $(srcdir)/emulparams/armaoutb.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
${GENSCRIPTS} armaoutb "$(tdir_armaoutb)"
@@ -524,6 +570,11 @@ earm_epoc_pe.c: $(srcdir)/emulparams/arm_epoc_pe.sh \
earmpe.c: $(srcdir)/emulparams/armpe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
${GENSCRIPTS} armpe "$(tdir_armpe)"
+earmsymbian.c: $(srcdir)/emulparams/armsymbian.sh \
+ $(srcdir)/emulparams/armelf.sh $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/armbpabi.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} armsymbian "$(tdir_armelf)"
eavr2.c: $(srcdir)/emulparams/avr2.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \
${GEN_DEPENDS}
@@ -574,15 +625,32 @@ ed30v_e.c: $(srcdir)/emulparams/d30v_e.sh \
edelta68.c: $(srcdir)/emulparams/delta68.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/delta68.sc ${GEN_DEPENDS}
${GENSCRIPTS} delta68 "$(tdir_delta68)"
+eelf32bfin.c: $(srcdir)/emulparams/bfin.sh \
+ $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32bfin "$(tdir_elf32bfin)" bfin
+eelf32bfinfd.c: $(srcdir)/emulparams/elf32bfinfd.sh $(srcdir)/emulparams/bfin.sh \
+ $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32bfinfd "$(tdir_elf32bfinfd)" elf32bfinfd
eelf32_dlx.c: $(srcdir)/emulparams/elf32_dlx.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/dlx.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_dlx "$(tdir_elf32_dlx)"
-eebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ebmon29k "$(tdir_ebmon29k)"
-eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \
+eelf32xc16x.c: $(srcdir)/emulparams/elf32xc16x.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32xc16x "$(tdir_xc16x)"
+eelf32xc16xl.c: $(srcdir)/emulparams/elf32xc16xl.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32xc16xl "$(tdir_xc16xl)"
+eelf32xc16xs.c: $(srcdir)/emulparams/elf32xc16xs.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32xc16xs "$(tdir_xc16xs)"
+eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/scripttempl/xstormy16.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32xstormy16 "$(tdir_xstormy16)"
eelf32am33lin.c: $(srcdir)/emulparams/elf32am33lin.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -591,8 +659,9 @@ 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)/emulparams/xtensa-config.sh $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/emultempl/xtensaelf.em $(INCDIR)/xtensa-config.h \
+ $(BFDDIR)/elf-bfd.h $(BFDDIR)/libbfd.h $(INCDIR)/elf/xtensa.h \
$(srcdir)/scripttempl/elfxtensa.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32xtensa "$(tdir_elf32xtensa)"
eelf32fr30.c: $(srcdir)/emulparams/elf32fr30.sh \
@@ -619,6 +688,11 @@ em32rlelf_linux.c: $(srcdir)/emulparams/m32rlelf_linux.sh \
eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
+eelf32_sparc_vxworks.c: $(srcdir)/emulparams/elf32_sparc_vxworks.sh \
+ $(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/elf32_sparc.sh \
+ $(srcdir)/emultempl/vxworks.em $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32_sparc_vxworks "$(tdir_elf32_sparc_vxworks)"
eelf32_i860.c: $(srcdir)/emulparams/elf32_i860.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_i860 "$(tdir_elf32_i860)"
@@ -626,11 +700,14 @@ 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)/emultempl/mipself.em \
+ $(srcdir)/emulparams/elf32bmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
+eelf32cr16c.c: $(srcdir)/emulparams/elf32cr16c.sh \
+ $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elf32cr16c.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32cr16c "$(tdir_elf32cr16c)"
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 \
@@ -638,90 +715,111 @@ eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \
$(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)/emultempl/mipself.em \
+ $(srcdir)/emulparams/elf32bmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)"
+eelf32crx.c: $(srcdir)/emulparams/elf32crx.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/crxelf.em \
+ $(srcdir)/scripttempl/elf32crx.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32crx "$(tdir_elf32crx)"
eelf32btsmipn32.c: $(srcdir)/emulparams/elf32btsmipn32.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
+ $(srcdir)/emulparams/elf32bmip.sh \
$(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)/emultempl/mipself.em \
+ $(srcdir)/emulparams/elf32bmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
+eelf32ebmipvxworks.c: $(srcdir)/emulparams/elf32ebmipvxworks.sh \
+ $(srcdir)/emulparams/elf32ebmip.sh $(srcdir)/emulparams/vxworks.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/vxworks.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ebmipvxworks "$(tdir_elf32ebmipvxworks)"
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)"
+eelf32elmipvxworks.c: $(srcdir)/emulparams/elf32elmipvxworks.sh \
+ $(srcdir)/emulparams/elf32elmip.sh $(srcdir)/emulparams/vxworks.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/vxworks.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32elmipvxworks "$(tdir_elf32elmipvxworks)"
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)/emultempl/mipself.em \
+ $(srcdir)/emulparams/elf32bmip.sh \
$(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/elf32ppccommon.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}
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.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)/emulparams/elf32ppccommon.sh $(srcdir)/emultempl/ppc32elf.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lppcsim "$(tdir_elf32lppcsim)"
eelf32ppcnto.c: $(srcdir)/emulparams/elf32ppcnto.sh \
- $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.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)"
+eelf32ppcvxworks.c: $(srcdir)/emulparams/elf32ppcvxworks.sh \
+ $(srcdir)/emulparams/elf32ppccommon.sh $(srcdir)/emulparams/vxworks.sh \
+ $(srcdir)/emultempl/vxworks.em $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ppcvxworks "$(tdir_elf32ppcvxworks)"
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 $(srcdir)/emultempl/ppc32elf.em \
+eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emulparams/elf32ppccommon.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)/emultempl/ppc32elf.em \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.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)/emultempl/ppc32elf.em \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.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)/emultempl/ppc32elf.em \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.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 \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -743,15 +841,18 @@ 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}
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/alphaelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
eelf64alpha_fbsd.c: $(srcdir)/emulparams/elf64alpha_fbsd.sh \
$(srcdir)/emulparams/elf64alpha.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/alphaelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha_fbsd "$(tdir_elf64alpha_fbsd)"
eelf64alpha_nbsd.c: $(srcdir)/emulparams/elf64alpha_nbsd.sh \
$(srcdir)/emulparams/elf64alpha.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/alphaelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha_nbsd "$(tdir_elf64alpha_nbsd)"
eelf64hppa.c: $(srcdir)/emulparams/elf64hppa.sh \
$(srcdir)/emulparams/hppa64linux.sh \
@@ -824,6 +925,10 @@ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)"
+eelf_i386_vxworks.c: $(srcdir)/emulparams/elf_i386_vxworks.sh \
+ $(srcdir)/emulparams/vxworks.sh $(srcdir)/emultempl/vxworks.em \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_i386_vxworks "$(tdir_elf_i386_vxworks)"
eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)"
@@ -941,7 +1046,7 @@ ei386linux.c: $(srcdir)/emulparams/i386linux.sh \
$(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} i386linux "$(tdir_i386linux)"
ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386lynx.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} i386lynx "$(tdir_i386lynx)"
ei386mach.c: $(srcdir)/emulparams/i386mach.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
@@ -1010,9 +1115,6 @@ em68kelfnbsd.c: $(srcdir)/emulparams/m68kelfnbsd.sh \
em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \
$(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68klinux "$(tdir_m68klinux)"
-em68klynx.c: $(srcdir)/emulparams/m68klynx.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68klynx.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68klynx "$(tdir_m68klynx)"
em68knbsd.c: $(srcdir)/emulparams/m68knbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68knbsd "$(tdir_m68knbsd)"
@@ -1022,6 +1124,9 @@ em68kpsos.c: $(srcdir)/emulparams/m68kpsos.sh \
em88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
${GENSCRIPTS} m88kbcs "$(tdir_m88kbcs)"
+emaxqcoff.c: $(srcdir)/emulparams/maxqcoff.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/maxqcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} maxqcoff "$(tdir_maxqcoff)"
emcorepe.c: $(srcdir)/emulparams/mcorepe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
${GENSCRIPTS} mcorepe "$(tdir_mcorepe)"
@@ -1032,10 +1137,12 @@ emipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mipsbsd.sc ${GEN_DEPENDS}
${GENSCRIPTS} mipsbsd
emipsidt.c: $(srcdir)/emulparams/mipsidt.sh \
- $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/mipsecoff.em $(srcdir)/emultempl/generic.em \
+ $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
${GENSCRIPTS} mipsidt "$(tdir_mipsidt)"
emipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
- $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/mipsecoff.em $(srcdir)/emultempl/generic.em \
+ $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
${GENSCRIPTS} mipsidtl "$(tdir_mipsidtl)"
emipslit.c: $(srcdir)/emulparams/mipslit.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
@@ -1149,6 +1256,34 @@ emsp430x169.c: $(srcdir)/emulparams/msp430all.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
${GEN_DEPENDS}
${GENSCRIPTS} msp430x169 "$(tdir_msp430x169)" msp430all
+emsp430x1610.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1610 "$(tdir_msp430x1610)" msp430all
+emsp430x1611.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1611 "$(tdir_msp430x1611)" msp430all
+emsp430x1612.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1612 "$(tdir_msp430x1612)" msp430all
+emsp430x2101.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x2101 "$(tdir_msp430x2101)" msp430all
+emsp430x2111.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x2111 "$(tdir_msp430x2111)" msp430all
+emsp430x2121.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x2121 "$(tdir_msp430x2121)" msp430all
+emsp430x2131.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x2131 "$(tdir_msp430x2131)" msp430all
emsp430x311.c: $(srcdir)/emulparams/msp430all.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
${GEN_DEPENDS}
@@ -1193,6 +1328,14 @@ emsp430x413.c: $(srcdir)/emulparams/msp430all.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
${GEN_DEPENDS}
${GENSCRIPTS} msp430x413 "$(tdir_msp430x413)" msp430all
+emsp430x415.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x415 "$(tdir_msp430x415)" msp430all
+emsp430x417.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x417 "$(tdir_msp430x417)" msp430all
emsp430xE423.c: $(srcdir)/emulparams/msp430all.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
${GEN_DEPENDS}
@@ -1217,6 +1360,18 @@ emsp430xW427.c: $(srcdir)/emulparams/msp430all.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
${GEN_DEPENDS}
${GENSCRIPTS} msp430xW427 "$(tdir_msp430xW427)" msp430all
+emsp430xG437.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xG437 "$(tdir_msp430xG437)" msp430all
+emsp430xG438.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xG438 "$(tdir_msp430xG438)" msp430all
+emsp430xG439.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xG439 "$(tdir_msp430xG439)" msp430all
emsp430x435.c: $(srcdir)/emulparams/msp430all.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
${GEN_DEPENDS}
@@ -1275,12 +1430,12 @@ eppcnw.c: $(srcdir)/emulparams/ppcnw.sh \
eppcpe.c: $(srcdir)/emulparams/ppcpe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/ppcpe.sc ${GEN_DEPENDS}
${GENSCRIPTS} ppcpe "$(tdir_ppcpe)"
+eppclynx.c: $(srcdir)/emulparams/ppclynx.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} ppclynx "$(tdir_ppclynx)"
eriscix.c: $(srcdir)/emulparams/riscix.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} riscix "$(tdir_riscix)"
-esa29200.c: $(srcdir)/emulparams/sa29200.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sa29200 "$(tdir_sa29200)"
esh.c: $(srcdir)/emulparams/sh.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
${GENSCRIPTS} sh "$(tdir_sh)"
@@ -1337,6 +1492,10 @@ eshlelf.c: $(srcdir)/emulparams/shlelf.sh \
$(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf "$(tdir_shlelf)"
+eshlsymbian.c: $(srcdir)/emulparams/shlsymbian.sh \
+ $(srcdir)/emulparams/shelf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf32sh-symbian.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} shlsymbian "$(tdir_shlelf)"
eshlelf32.c: $(srcdir)/emulparams/shlelf32.sh \
$(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h $(srcdir)/emulparams/shelf32.sh \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
@@ -1376,9 +1535,6 @@ esparcaout.c: $(srcdir)/emulparams/sparcaout.sh \
esparclinux.c: $(srcdir)/emulparams/sparclinux.sh \
$(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} sparclinux "$(tdir_sparclinux)"
-esparclynx.c: $(srcdir)/emulparams/sparclynx.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparclynx.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sparclynx "$(tdir_sparclynx)"
esparcnbsd.c: $(srcdir)/emulparams/sparcnbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} sparcnbsd "$(tdir_sparcnbsd)"
@@ -1430,6 +1586,10 @@ ev850.c: $(srcdir)/emulparams/v850.sh \
ew65.c: $(srcdir)/emulparams/w65.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/w65.sc ${GEN_DEPENDS}
${GENSCRIPTS} w65 "$(tdir_w65)"
+ez80.c: $(srcdir)/emulparams/z80.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/z80.em \
+ $(srcdir)/scripttempl/z80.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} z80 "$(tdir_z80)"
ez8001.c: $(srcdir)/emulparams/z8001.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
${GENSCRIPTS} z8001 "$(tdir_z8001)"
@@ -1440,6 +1600,13 @@ eelf32frvfd.c: $(srcdir)/emulparams/elf32frvfd.sh \
$(srcdir)/emulparams/elf32frv.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32frvfd "$(tdir_frv)"
+eelf32m32c.c: $(srcdir)/emulparams/elf32m32c.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32m32c "$(tdir_m32c)"
+eelf32mt.c: $(srcdir)/emulparams/elf32mt.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32mt "$(tdir_mt)"
# We need this for automake to use YLWRAP.
EXTRA_ld_new_SOURCES = deffilep.y
@@ -1462,10 +1629,6 @@ check-DEJAGNU: site.exp
r=`pwd`; export r; \
LC_COLLATE=; LC_ALL=; LANG=; export LC_COLLATE LC_ALL LANG; \
EXPECT=$(EXPECT); export EXPECT; \
- if [ -f $(top_builddir)/../expect/expect ]; then \
- TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \
- export TCL_LIBRARY; \
- fi; \
runtest=$(RUNTEST); \
if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
$$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
@@ -1537,21 +1700,15 @@ bootstrap: ld3$(EXEEXT)
# because almost all configs use "gen" version of manual.
# Set DOCVER above to change.
configdoc.texi: ${DOCVER}-doc.texi
- ln -s ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi >/dev/null 2>&1 \
- || ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi >/dev/null 2>&1 \
- || cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
+ cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
+ chmod u+w ./configdoc.texi
-ldver.texi: Makefile
+ldver.texi: $(srcdir)/../bfd/configure
rm -f $@
- echo '@set VERSION $(VERSION)' > $@
+ eval `grep '^ *VERSION=' $(srcdir)/../bfd/configure`; \
+ echo "@set VERSION $$VERSION" > $@
-ld.info: $(srcdir)/ld.texinfo configdoc.texi ldver.texi
- @rm -f $@ $@-[0-9] $@-[0-9][0-9]
- $(MAKEINFO) -I $(srcdir) -I $(BFDDIR)/doc $(srcdir)/ld.texinfo
-
-ld.dvi: $(srcdir)/ld.texinfo configdoc.texi ldver.texi
- TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
- MAKEINFO="$(MAKEINFO) -I $(srcdir) -I $(BFDDIR)/doc" $(TEXI2DVI) -I $(BFDDIR)/doc $(srcdir)/ld.texinfo
+$(srcdir)/ld.info ld.dvi ld.html: $(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
@@ -1565,10 +1722,12 @@ ld.1: $(srcdir)/ld.texinfo configdoc.texi ldver.texi
(rm -f $@.T$$$$ && exit 1)
rm -f ld.pod
-MAINTAINERCLEANFILES = ldver.texi
+MAINTAINERCLEANFILES = ldver.texi configdoc.texi
-# We want to reconfigure if configure.host or configure.tgt changes.
-CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt
+# We want to reconfigure if configure.host or configure.tgt changes. We
+# extract version from bfd/configure.in, so we must depend on that also.
+CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt \
+ $(srcdir)/../bfd/configure.in
MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \
ldemul-list.h crtbegin.o crtend.o ld.log ld.sum
@@ -1576,6 +1735,54 @@ mostlyclean-local:
-rm -rf tmpdir
CLEANFILES = dep.sed DEP DEPA DEP1 DEP2
+.PHONY: install-html install-html-am install-html-recursive
+
+html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+
+install-html: install-html-recursive install-html-am
+
+install-html-am: $(HTMLS)
+ @$(NORMAL_INSTALL)
+ test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
+ @list='$(HTMLS)'; for p in $$list; do \
+ if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
+ f=$(html__strip_dir) \
+ if test -d "$$d$$p"; then \
+ echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
+ $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+ echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+ $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
+ else \
+ echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
+ $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+ fi; \
+ done
+
+install-html-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
.PHONY: install-exec-local install-data-local
install-exec-local: ld-new$(EXEEXT)
@@ -1601,19 +1808,23 @@ install-data-local:
# We want install to imply install-info as per GNU standards, despite the
# cygnus option.
-install: install-info
+install-data-local: install-info
# Stuff that should be included in a distribution. The diststuff
# target is run by the taz target in ../Makefile.in.
EXTRA_DIST = ldgram.c ldgram.h ldlex.c $(man_MANS)
diststuff: info $(EXTRA_DIST)
+all: info ld.1
+
+# Both info (ld.info) and ld.1 depend on configdoc.texi and ldver.texi.
+# But info isn't a direct target. Make info-recursive to depend on
+# ld.1 to support parallel build.
+info-recursive: ld.1
DISTCLEANFILES = tdirs site.exp site.bak stringify.sed
distclean-local:
rm -rf ldscripts
-Makefile: $(BFDDIR)/configure.in
-
# Targets to rebuild dependencies in this Makefile.
# Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES).
DEP: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h
@@ -1657,29 +1868,6 @@ dep-am: DEP
.PHONY: dep dep-in dep-am
-@MAINT@.PHONY: mpw
-@MAINT@mpw: $(srcdir)/mpw-ei386go32.c $(srcdir)/mpw-elfmips.c \
-@MAINT@ $(srcdir)/mpw-em68kcoff.c $(srcdir)/mpw-eppcmac.c \
-@MAINT@ $(srcdir)/mpw-esh.c $(srcdir)/mpw-idtmips.c
-@MAINT@
-@MAINT@$(srcdir)/mpw-ei386go32.c: ei386go32.c
-@MAINT@ $(srcdir)/../move-if-change $< $@
-@MAINT@
-@MAINT@$(srcdir)/mpw-elfmips.c: eelf32ebmip.c
-@MAINT@ $(srcdir)/../move-if-change $< $@
-@MAINT@
-@MAINT@$(srcdir)/mpw-em68kcoff.c: em68kcoff.c
-@MAINT@ $(srcdir)/../move-if-change $< $@
-@MAINT@
-@MAINT@$(srcdir)/mpw-eppcmac.c: eppcmacos.c
-@MAINT@ $(srcdir)/../move-if-change $< $@
-@MAINT@
-@MAINT@$(srcdir)/mpw-esh.c: esh.c
-@MAINT@ $(srcdir)/../move-if-change $< $@
-@MAINT@
-@MAINT@$(srcdir)/mpw-idtmips.c: emipsidt.c
-@MAINT@ $(srcdir)/../move-if-change $< $@
-
# What appears below is generated by a hacked mkdep using gcc -MM.
# DO NOT DELETE THIS LINE -- mkdep uses it.
@@ -1688,10 +1876,10 @@ ldctor.o: ldctor.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 \
ldexp.h ldlang.h ldmisc.h ldgram.h ldmain.h ldctor.h
-ldemul.o: ldemul.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
- ld.h $(INCDIR)/bin-bugs.h ldmisc.h ldexp.h ldlang.h \
- ldfile.h ldemul.h ldmain.h ldemul-list.h
+ldemul.o: ldemul.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/symcat.h sysdep.h $(INCDIR)/fopen-same.h \
+ $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldmisc.h \
+ ldexp.h ldlang.h ldfile.h ldemul.h ldmain.h ldemul-list.h
ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldmain.h \
@@ -1719,7 +1907,8 @@ ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.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
+ ldgram.h ldlex.h ldmain.h ldfile.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h ../bfd/bfdver.h sysdep.h config.h \
$(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h ldver.h \
@@ -1729,8 +1918,8 @@ ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.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 \
+lexsup.o: lexsup.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/symcat.h sysdep.h $(INCDIR)/fopen-same.h \
$(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h \
ld.h $(INCDIR)/bin-bugs.h ldmain.h ldmisc.h ldexp.h \
ldlang.h ldgram.h ldlex.h ldfile.h ldver.h ldemul.h \
diff --git a/contrib/binutils/ld/Makefile.in b/contrib/binutils/ld/Makefile.in
index 020064b..e75b3c7 100644
--- a/contrib/binutils/ld/Makefile.in
+++ b/contrib/binutils/ld/Makefile.in
@@ -1,6 +1,8 @@
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -10,142 +12,266 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-
# $FreeBSD$
-
-SHELL = @SHELL@
+@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-DESTDIR =
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-
top_builddir = .
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-build_alias = @build_alias@
build_triplet = @build@
-host_alias = @host_alias@
host_triplet = @host@
-target_alias = @target_alias@
target_triplet = @target@
-AS = @AS@
+noinst_PROGRAMS = ld-new$(EXEEXT)
+DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \
+ README ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/configure $(am__configure_deps) \
+ $(srcdir)/config.in $(srcdir)/../mkinstalldirs \
+ $(top_srcdir)/po/Make-in ldgram.h ldgram.c ldlex.c deffilep.h \
+ deffilep.c $(srcdir)/../ylwrap $(srcdir)/../ltmain.sh \
+ $(srcdir)/../config.guess $(srcdir)/../config.sub
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/../bfd/acinclude.m4 \
+ $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../bfd/bfd.m4 \
+ $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \
+ $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = po/Makefile.in
+PROGRAMS = $(noinst_PROGRAMS)
+am_ld_new_OBJECTS = ldgram.$(OBJEXT) ldlex.$(OBJEXT) lexsup.$(OBJEXT) \
+ ldlang.$(OBJEXT) mri.$(OBJEXT) ldctor.$(OBJEXT) \
+ ldmain.$(OBJEXT) ldwrite.$(OBJEXT) ldexp.$(OBJEXT) \
+ ldemul.$(OBJEXT) ldver.$(OBJEXT) ldmisc.$(OBJEXT) \
+ ldfile.$(OBJEXT) ldcref.$(OBJEXT)
+ld_new_OBJECTS = $(am_ld_new_OBJECTS)
+am__DEPENDENCIES_1 =
+am__DEPENDENCIES_2 = ../bfd/libbfd.la
+am__DEPENDENCIES_3 = ../libiberty/libiberty.a
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
+LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS)
+YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
+LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) \
+ $(AM_YFLAGS)
+YLWRAP = $(top_srcdir)/../ylwrap
+SOURCES = $(ld_new_SOURCES) $(EXTRA_ld_new_SOURCES)
+INFO_DEPS = $(srcdir)/ld.info
+TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
+am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo
+DVIS = ld.dvi
+PDFS = ld.pdf
+PSS = ld.ps
+HTMLS = ld.html
+TEXINFOS = ld.texinfo
+TEXI2PDF = $(TEXI2DVI) --pdf --batch
+MAKEINFOHTML = $(MAKEINFO) --html
+AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
+DVIPS = dvips
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+man1dir = $(mandir)/man1
+am__installdirs = "$(DESTDIR)$(man1dir)"
+NROFF = nroff
+MANS = $(man_MANS)
+ETAGS = etags
+CTAGS = ctags
+DEJATOOL = $(PACKAGE)
+RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
+DIST_SUBDIRS = $(SUBDIRS)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
-CC_FOR_BUILD = @CC_FOR_BUILD@
-CXXCPP = @CXXCPP@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
-DLLTOOL = @DLLTOOL@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMUL = @EMUL@
EMULATION_LIBPATH = @EMULATION_LIBPATH@
+EMULATION_OFILES = @EMULATION_OFILES@
+EMUL_EXTRA_OFILES = @EMUL_EXTRA_OFILES@
EXEEXT = @EXEEXT@
-EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
-GCJ = @GCJ@
-GCJFLAGS = @GCJFLAGS@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
HDEFINES = @HDEFINES@
+
+#stuff for self hosting (can be overridden in config file).
+HOSTING_CRT0 = @HOSTING_CRT0@
+HOSTING_LIBS = @HOSTING_LIBS@
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
+INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+LDFLAGS = @LDFLAGS@
+LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi`
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
+
+# Search path to override the default search path for -lfoo libraries.
+# If LIB_PATH is empty, the ones in the script (if any) are left alone.
+# (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. This can be set
+# when the linker is configured via the --with-lib-path configure switch.
+LIB_PATH = @LIB_PATH@
LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
NATIVE_LIB_DIRS = @NATIVE_LIB_DIRS@
-OBJDUMP = @OBJDUMP@
+NO_WERROR = @NO_WERROR@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
STRINGIFY = @STRINGIFY@
STRIP = @STRIP@
TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
+
+# This is the real libbfd.a created by libtool.
+TESTBFDLIB = @TESTBFDLIB@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
-bfdincludedir = @bfdincludedir@
-bfdlibdir = @bfdlibdir@
+WARN_CFLAGS = @WARN_CFLAGS@
+XGETTEXT = @XGETTEXT@
+YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bison/; else echo @YACC@; fi`
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
l = @l@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
use_sysroot = @use_sysroot@
-
-INTLLIBS = @INTLLIBS@
-
AUTOMAKE_OPTIONS = cygnus dejagnu
-
SUBDIRS = po
-
tooldir = $(exec_prefix)/$(target_alias)
-
-YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bison/; else echo @YACC@; fi`
YFLAGS = -d
-LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi`
-
-WARN_CFLAGS = @WARN_CFLAGS@
AM_CFLAGS = $(WARN_CFLAGS)
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
scriptdir = $(tooldir)/lib
-
-EMUL = @EMUL@
-EMULATION_OFILES = @EMULATION_OFILES@
-EMUL_EXTRA_OFILES = @EMUL_EXTRA_OFILES@
-
-# Search path to override the default search path for -lfoo libraries.
-# If LIB_PATH is empty, the ones in the script (if any) are left alone.
-# (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. 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
INCDIR = $(BASEDIR)/include
@@ -156,31 +282,16 @@ DOCVER = gen
# Options to extract the man page from ld.texinfo
MANCONF = -Dman
-
-TEXI2POD = perl $(BASEDIR)/etc/texi2pod.pl
-
+TEXI2POD = perl $(BASEDIR)/etc/texi2pod.pl $(AM_MAKEINFOFLAGS)
POD2MAN = pod2man --center="GNU Development Tools" \
--release="binutils-$(VERSION)" --section=1
-
-#stuff for self hosting (can be overridden in config file).
-HOSTING_CRT0 = @HOSTING_CRT0@
-HOSTING_LIBS = @HOSTING_LIBS@
HOSTING_EMU = -m $(EMUL)
# Setup the testing framework, if you have one
-EXPECT = `if [ -f $$r/../expect/expect ] ; \
- then echo $$r/../expect/expect ; \
- else echo expect ; fi`
-
-
-RUNTEST = `if [ -f $${srcroot}/../dejagnu/runtest ] ; \
- then echo $${srcroot}/../dejagnu/runtest ; \
- else echo runtest ; fi`
-
-
+EXPECT = expect
+RUNTEST = runtest
RUNTESTFLAGS =
-
CC_FOR_TARGET = ` \
if [ -f $$r/../gcc/xgcc ] ; then \
if [ -f $$r/../newlib/Makefile ] ; then \
@@ -196,7 +307,6 @@ CC_FOR_TARGET = ` \
fi; \
fi`
-
CXX = gcc
CXX_FOR_TARGET = ` \
if [ -f $$r/../gcc/xgcc ] ; then \
@@ -213,19 +323,15 @@ CXX_FOR_TARGET = ` \
fi; \
fi`
-
-noinst_PROGRAMS = ld-new
info_TEXINFOS = ld.texinfo
noinst_TEXINFOS = ldint.texinfo
man_MANS = ld.1
-
-INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) -I$(top_srcdir)/../intl -I../intl $(HDEFINES) $(CFLAGS) -DLOCALEDIR="\"$(prefix)/share/locale\""
-
+AM_MAKEINFOFLAGS = -I $(srcdir) -I $(BFDDIR)/doc -I $(top_srcdir)/../libiberty
+TEXI2DVI = texi2dvi -I $(srcdir) -I $(BFDDIR)/doc -I $(top_srcdir)/../libiberty
+INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) -I$(top_srcdir)/../intl -I../intl $(HDEFINES) $(CFLAGS) -DLOCALEDIR="\"$(datadir)/locale\""
BFDLIB = ../bfd/libbfd.la
LIBIBERTY = ../libiberty/libiberty.a
-
ALL_EMULATIONS = \
- ea29k.o \
eaixppc.o \
eaixrs6.o \
ealpha.o \
@@ -238,13 +344,16 @@ ALL_EMULATIONS = \
earmelfb.o \
earmelf_fbsd.o \
earmelf_linux.o \
+ earmelf_linux_eabi.o \
earmelfb_linux.o \
+ earmelfb_linux_eabi.o \
earmelf_nbsd.o \
earmelfb_nbsd.o \
- earmelf_oabi.o \
+ earmelf_vxworks.o \
earmnto.o \
earmnbsd.o \
earmpe.o \
+ earmsymbian.o \
eavr2.o \
eavr1.o \
eavr3.o \
@@ -261,19 +370,25 @@ ALL_EMULATIONS = \
ed30velf.o \
edelta68.o \
eelf32_dlx.o \
- eebmon29k.o \
eelf32_i960.o \
eelf32_i860.o \
eelf32_sparc.o \
+ eelf32_sparc_vxworks.o \
eelf32b4300.o \
+ eelf32bfin.o \
+ eelf32bfinfd.o \
+ eelf32cr16c.o \
eelf32bmip.o \
eelf32bmipn32.o \
eelf32btsmip.o \
+ eelf32crx.o \
eelf32btsmipn32.o \
eelf32ltsmip.o \
eelf32ltsmipn32.o \
eelf32ebmip.o \
+ eelf32ebmipvxworks.o \
eelf32elmip.o \
+ eelf32elmipvxworks.o \
eelf32fr30.o \
eelf32frv.o \
eelf32i370.o \
@@ -285,8 +400,10 @@ ALL_EMULATIONS = \
eelf32lppc.o \
eelf32lppcnto.o \
eelf32lppcsim.o \
+ eelf32m32c.o \
eelf32mcore.o \
eelf32mipswindiss.o \
+ eelf32mt.o \
eelf32openrisc.o \
eelf32ppc.o \
eelf32ppc_fbsd.o \
@@ -294,7 +411,11 @@ ALL_EMULATIONS = \
eelf32ppcnto.o \
eelf32ppcsim.o \
eelf32ppcwindiss.o \
+ eelf32ppcvxworks.o \
eelf32vax.o \
+ eelf32xc16x.o \
+ eelf32xc16xl.o \
+ eelf32xc16xs.o \
eelf32xstormy16.o \
eelf32xtensa.o \
eelf_i386.o \
@@ -302,6 +423,7 @@ ALL_EMULATIONS = \
eelf_i386_chaos.o \
eelf_i386_fbsd.o \
eelf_i386_ldso.o \
+ eelf_i386_vxworks.o \
eelf_s390.o \
egld960.o \
egld960coff.o \
@@ -362,10 +484,10 @@ ALL_EMULATIONS = \
em68kelf.o \
em68kelfnbsd.o \
em68klinux.o \
- em68klynx.o \
em68knbsd.o \
em68kpsos.o \
em88kbcs.o \
+ emaxqcoff.o \
emcorepe.o \
emipsbig.o \
emipsbsd.o \
@@ -398,6 +520,13 @@ ALL_EMULATIONS = \
emsp430x167.o \
emsp430x168.o \
emsp430x169.o \
+ emsp430x1610.o \
+ emsp430x1611.o \
+ emsp430x1612.o \
+ emsp430x2101.o \
+ emsp430x2111.o \
+ emsp430x2121.o \
+ emsp430x2131.o \
emsp430x311.o \
emsp430x312.o \
emsp430x313.o \
@@ -409,12 +538,17 @@ ALL_EMULATIONS = \
emsp430x337.o \
emsp430x412.o \
emsp430x413.o \
+ emsp430x415.o \
+ emsp430x417.o \
emsp430xE423.o \
emsp430xE425.o \
emsp430xE427.o \
emsp430xW423.o \
emsp430xW425.o \
emsp430xW427.o \
+ emsp430xG437.o \
+ emsp430xG438.o \
+ emsp430xG439.o \
emsp430x435.o \
emsp430x436.o \
emsp430x437.o \
@@ -432,8 +566,8 @@ ALL_EMULATIONS = \
eppcmacos.o \
eppcnw.o \
eppcpe.o \
+ eppclynx.o \
eriscix.o \
- esa29200.o \
esh.o \
eshelf32.o \
eshlelf32.o \
@@ -450,10 +584,10 @@ ALL_EMULATIONS = \
eshlelf_nto.o \
eshl.o \
eshlelf.o \
+ eshlsymbian.o \
eshpe.o \
esparcaout.o \
esparclinux.o \
- esparclynx.o \
esparcnbsd.o \
est2000.o \
esun3.o \
@@ -471,10 +605,10 @@ ALL_EMULATIONS = \
evsta.o \
ew65.o \
ez8001.o \
- eelf32frvfd.o \
+ eelf32frvfd.o \
+ ez80.o \
ez8002.o
-
ALL_64_EMULATIONS = \
eelf64_aix.o \
eelf64_ia64.o \
@@ -501,204 +635,159 @@ ALL_64_EMULATIONS = \
eelf64lppc.o \
ehppa64linux.o
-
ALL_EMUL_EXTRA_OFILES = \
deffilep.o \
pe-dll.o
-
CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
mri.c ldcref.c pe-dll.c
-
HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
- ldwrite.h mri.h deffile.h pe-dll.h
-
+ ldwrite.h mri.h deffile.h pe-dll.h elf-hints-local.h
GENERATED_CFILES = ldgram.c ldlex.c deffilep.c
GENERATED_HFILES = ldgram.h ldemul-list.h deffilep.h
-
OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o \
ldfile.o ldcref.o ${EMULATION_OFILES} ${EMUL_EXTRA_OFILES}
-
STAGESTUFF = *.o ldscripts/* e*.c
# At the moment this is just a list of those emulation template files
# that contain internationalised strings.
EMULATION_FILES = emultempl/pe.em emultempl/armcoff.em
-
POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES)
# These all start with e so 'make clean' can find them.
-
-GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@
+GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${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.
EXTRA_ld_new_SOURCES = deffilep.y
-
ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c
ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(INTLDEPS)
ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(INTLLIBS)
+MAINTAINERCLEANFILES = ldver.texi configdoc.texi
-# This is the real libbfd.a created by libtool.
-TESTBFDLIB = @TESTBFDLIB@
-
-MAINTAINERCLEANFILES = ldver.texi
-
-# We want to reconfigure if configure.host or configure.tgt changes.
-CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt
+# We want to reconfigure if configure.host or configure.tgt changes. We
+# extract version from bfd/configure.in, so we must depend on that also.
+CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt \
+ $(srcdir)/../bfd/configure.in
MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \
ldemul-list.h crtbegin.o crtend.o ld.log ld.sum
CLEANFILES = dep.sed DEP DEPA DEP1 DEP2
+html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
# Stuff that should be included in a distribution. The diststuff
# target is run by the taz target in ../Makefile.in.
EXTRA_DIST = ldgram.c ldgram.h ldlex.c $(man_MANS)
-
DISTCLEANFILES = tdirs site.exp site.bak stringify.sed
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =
-noinst_PROGRAMS = ld-new$(EXEEXT)
-PROGRAMS = $(noinst_PROGRAMS)
-
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I.
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-ld_new_OBJECTS = ldgram.$(OBJEXT) ldlex.$(OBJEXT) lexsup.$(OBJEXT) \
-ldlang.$(OBJEXT) mri.$(OBJEXT) ldctor.$(OBJEXT) ldmain.$(OBJEXT) \
-ldwrite.$(OBJEXT) ldexp.$(OBJEXT) ldemul.$(OBJEXT) ldver.$(OBJEXT) \
-ldmisc.$(OBJEXT) ldfile.$(OBJEXT) ldcref.$(OBJEXT)
-ld_new_LDFLAGS =
-LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-LEXLIB = @LEXLIB@
-YLWRAP = $(top_srcdir)/../ylwrap
-CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi`
-TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
-INFO_DEPS = ld.info
-DVIS = ld.dvi
-TEXINFOS = ld.texinfo
-man1dir = $(mandir)/man1
-MANS = $(man_MANS)
-
-NROFF = nroff
-DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \
-NEWS TODO acinclude.m4 aclocal.m4 config.in configure configure.in \
-deffilep.c ldgram.c ldlex.c
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = gtar
-GZIP_ENV = --best
-SOURCES = $(ld_new_SOURCES) $(EXTRA_ld_new_SOURCES)
-OBJECTS = $(ld_new_OBJECTS)
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
-all: all-redirect
.SUFFIXES:
-.SUFFIXES: .S .c .dvi .info .l .lo .o .obj .ps .s .texi .texinfo .txi .y
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4
- cd $(srcdir) && $(ACLOCAL)
-
-config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+.SUFFIXES: .c .dvi .html .info .l .lo .o .obj .pdf .ps .texinfo .y
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+ cd $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
-$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-config.h: stamp-h
+config.h: stamp-h1
@if test ! -f $@; then \
- rm -f stamp-h; \
- $(MAKE) stamp-h; \
+ rm -f stamp-h1; \
+ $(MAKE) stamp-h1; \
else :; fi
-stamp-h: $(srcdir)/config.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES= CONFIG_HEADERS=config.h:config.in \
- $(SHELL) ./config.status
- @echo timestamp > stamp-h 2> /dev/null
-$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in
- @if test ! -f $@; then \
- rm -f $(srcdir)/stamp-h.in; \
- $(MAKE) $(srcdir)/stamp-h.in; \
- else :; fi
-$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOHEADER)
- @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
-
-mostlyclean-hdr:
-clean-hdr:
+stamp-h1: $(srcdir)/config.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_srcdir) && $(AUTOHEADER)
+ rm -f stamp-h1
+ touch $@
distclean-hdr:
- -rm -f config.h
-
-maintainer-clean-hdr:
-
-mostlyclean-noinstPROGRAMS:
+ -rm -f config.h stamp-h1
+po/Makefile.in: $(top_builddir)/config.status $(top_srcdir)/po/Make-in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
clean-noinstPROGRAMS:
- -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
-
-distclean-noinstPROGRAMS:
-
-maintainer-clean-noinstPROGRAMS:
-
-.c.o:
- $(COMPILE) -c $<
-
-# FIXME: We should only use cygpath when building on Windows,
-# and only if it is available.
-.c.obj:
- $(COMPILE) -c `cygpath -w $<`
-
-.s.o:
- $(COMPILE) -c $<
-
-.S.o:
- $(COMPILE) -c $<
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+ldgram.h: ldgram.c
+ @if test ! -f $@; then \
+ rm -f ldgram.c; \
+ $(MAKE) ldgram.c; \
+ else :; fi
+deffilep.h: deffilep.c
+ @if test ! -f $@; then \
+ rm -f deffilep.c; \
+ $(MAKE) deffilep.c; \
+ else :; fi
+ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_new_DEPENDENCIES)
+ @rm -f ld-new$(EXEEXT)
+ $(LINK) $(ld_new_LDFLAGS) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS)
mostlyclean-compile:
- -rm -f *.o core *.core
-rm -f *.$(OBJEXT)
-clean-compile:
-
distclean-compile:
-rm -f *.tab.c
-maintainer-clean-compile:
+.c.o:
+ $(COMPILE) -c $<
+
+.c.obj:
+ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+ $(LTCOMPILE) -c -o $@ $<
-.s.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+.l.c:
+ $(LEXCOMPILE) $<
+ sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@
+ rm -f $(LEX_OUTPUT_ROOT).c
-.S.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+.y.c:
+ $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
mostlyclean-libtool:
-rm -f *.lo
@@ -707,135 +796,116 @@ clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-
-maintainer-clean-libtool:
-
-ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_new_DEPENDENCIES)
- @rm -f ld-new$(EXEEXT)
- $(LINK) $(ld_new_LDFLAGS) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS)
-.l.c:
- $(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
-.y.c:
- $(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(AM_YFLAGS) $(YFLAGS)
-deffilep.h: deffilep.c
-ldgram.h: ldgram.c
-
-
-ld.info: ld.texinfo
-ld.dvi: ld.texinfo
-
-
-DVIPS = dvips
-
-.texi.info:
- @rm -f $@ $@-[0-9] $@-[0-9][0-9]
- $(MAKEINFO) -I $(srcdir) $<
-
-.texi.dvi:
- TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.texi:
- @rm -f $@ $@-[0-9] $@-[0-9][0-9]
- $(MAKEINFO) -I $(srcdir) $<
+ -rm -f libtool
.texinfo.info:
- @rm -f $@ $@-[0-9] $@-[0-9][0-9]
- $(MAKEINFO) -I $(srcdir) $<
-
-.texinfo:
- @rm -f $@ $@-[0-9] $@-[0-9][0-9]
- $(MAKEINFO) -I $(srcdir) $<
+ restore=: && backupdir="$(am__leading_dot)am$$$$" && \
+ am__cwd=`pwd` && cd $(srcdir) && \
+ rm -rf $$backupdir && mkdir $$backupdir && \
+ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
+ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
+ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
+ done; \
+ else :; fi && \
+ cd "$$am__cwd"; \
+ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+ -o $@ $<; \
+ then \
+ rc=0; \
+ cd $(srcdir); \
+ else \
+ rc=$$?; \
+ cd $(srcdir) && \
+ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
+ fi; \
+ rm -rf $$backupdir; exit $$rc
.texinfo.dvi:
- TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.txi.info:
- @rm -f $@ $@-[0-9] $@-[0-9][0-9]
- $(MAKEINFO) -I $(srcdir) $<
-
-.txi.dvi:
- TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.txi:
- @rm -f $@ $@-[0-9] $@-[0-9][0-9]
- $(MAKEINFO) -I $(srcdir) $<
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+ $(TEXI2DVI) $<
+
+.texinfo.pdf:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+ $(TEXI2PDF) $<
+
+.texinfo.html:
+ rm -rf $(@:.html=.htp)
+ if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+ -o $(@:.html=.htp) $<; \
+ then \
+ rm -rf $@; \
+ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
+ mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
+ else \
+ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
+ rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
+ exit 1; \
+ fi
+$(srcdir)/ld.info: ld.texinfo
+ld.dvi: ld.texinfo
+ld.pdf: ld.texinfo
+ld.html: ld.texinfo
.dvi.ps:
- $(DVIPS) $< -o $@
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ $(DVIPS) -o $@ $<
-install-info-am: $(INFO_DEPS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(infodir)
- @list='$(INFO_DEPS)'; \
- for file in $$list; do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
- for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
- if test -f $$d/$$ifile; then \
- echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
- $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
- else : ; fi; \
- done; \
- done
- @$(POST_INSTALL)
- @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+uninstall-info-am:
+ @$(PRE_UNINSTALL)
+ @if (install-info --version && \
+ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
- echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
- install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
+ relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
+ install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
done; \
- else : ; fi
-
-uninstall-info:
- $(PRE_UNINSTALL)
- @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
- ii=yes; \
- else ii=; fi; \
- list='$(INFO_DEPS)'; \
- for file in $$list; do \
- test -z "$$ii" \
- || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
- done
+ else :; fi
@$(NORMAL_UNINSTALL)
- list='$(INFO_DEPS)'; \
+ @list='$(INFO_DEPS)'; \
for file in $$list; do \
- (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+ relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
+ (if cd "$(DESTDIR)$(infodir)"; then \
+ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
+ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
+ else :; fi); \
done
dist-info: $(INFO_DEPS)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
list='$(INFO_DEPS)'; \
for base in $$list; do \
+ case $$base in \
+ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
+ esac; \
if test -f $$base; then d=.; else d=$(srcdir); fi; \
- for file in `cd $$d && eval echo $$base*`; do \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ for file in $$d/$$base*; do \
+ relfile=`expr "$$file" : "$$d/\(.*\)"`; \
+ test -f $(distdir)/$$relfile || \
+ cp -p $$file $(distdir)/$$relfile; \
done; \
done
mostlyclean-aminfo:
- -rm -f ld.aux ld.cp ld.cps ld.dvi ld.fn ld.fns ld.ky ld.kys ld.ps \
- ld.log ld.pg ld.toc ld.tp ld.tps ld.vr ld.vrs ld.op ld.tr \
- ld.cv ld.cn
-
-clean-aminfo:
-
-distclean-aminfo:
+ -rm -rf ld.aux ld.cp ld.cps ld.fn ld.fns ld.ky ld.log ld.pg ld.pgs ld.tmp \
+ ld.toc ld.tp ld.tps ld.vr ld.vrs ld.dvi ld.pdf ld.ps ld.html
maintainer-clean-aminfo:
- for i in $(INFO_DEPS); do \
- rm -f $$i; \
- if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
- rm -f $$i-[0-9]*; \
- fi; \
+ @list='$(INFO_DEPS)'; for i in $$list; do \
+ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
+ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
+ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
done
-clean-info: mostlyclean-aminfo
-install-man1:
- $(mkinstalldirs) $(DESTDIR)$(man1dir)
- @list='$(man1_MANS)'; \
- l2='$(man_MANS)'; for i in $$l2; do \
+clean-info: mostlyclean-aminfo
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
@@ -844,32 +914,37 @@ install-man1:
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
+ esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
- $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
done
-
uninstall-man1:
- @list='$(man1_MANS)'; \
- l2='$(man_MANS)'; for i in $$l2; do \
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
+ esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
- rm -f $(DESTDIR)$(man1dir)/$$inst; \
+ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
+ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
-install-man: $(MANS)
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-man1
-uninstall-man:
- @$(NORMAL_UNINSTALL)
- $(MAKE) $(AM_MAKEFLAGS) uninstall-man1
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
@@ -877,13 +952,14 @@ uninstall-man:
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
-
-@SET_MAKE@
-
-all-recursive install-data-recursive install-exec-recursive \
-installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
-check-recursive installcheck-recursive info-recursive dvi-recursive:
- @set fnord $(MAKEFLAGS); amf=$$2; \
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -895,7 +971,7 @@ check-recursive installcheck-recursive info-recursive dvi-recursive:
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ || eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
@@ -903,13 +979,24 @@ check-recursive installcheck-recursive info-recursive dvi-recursive:
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
- @set fnord $(MAKEFLAGS); amf=$$2; \
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
dot_seen=no; \
- rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
- rev="$$subdir $$rev"; \
- test "$$subdir" != "." || dot_seen=yes; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
done; \
- test "$$dot_seen" = "no" && rev=". $$rev"; \
+ rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
@@ -919,163 +1006,125 @@ maintainer-clean-recursive:
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ || eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -fID $$unique
+tags: TAGS
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
- fi; \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
done; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)config.in$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.in $$unique $(LISP) -o $$here/TAGS)
-
-mostlyclean-tags:
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
-clean-tags:
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-
-# This target untars the dist file and tries a VPATH configuration. Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
- -rm -rf $(distdir)
- GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
- mkdir $(distdir)/=build
- mkdir $(distdir)/=inst
- dc_install_base=`cd $(distdir)/=inst && pwd`; \
- cd $(distdir)/=build \
- && ../configure --srcdir=.. --prefix=$$dc_install_base \
- && $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) dist
- -rm -rf $(distdir)
- @banner="$(distdir).tar.gz is ready for distribution"; \
- dashes=`echo "$$banner" | sed s/./=/g`; \
- echo "$$dashes"; \
- echo "$$banner"; \
- echo "$$dashes"
-dist: distdir
- -chmod -R a+r $(distdir)
- GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
- -rm -rf $(distdir)
-dist-all: distdir
- -chmod -R a+r $(distdir)
- GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
- -rm -rf $(distdir)
-distdir: $(DISTFILES)
- -rm -rf $(distdir)
- mkdir $(distdir)
- -chmod 777 $(distdir)
- @for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
- else \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
- fi; \
- done
- for subdir in $(SUBDIRS); do \
- if test "$$subdir" = .; then :; else \
- test -d $(distdir)/$$subdir \
- || mkdir $(distdir)/$$subdir \
- || exit 1; \
- chmod 777 $(distdir)/$$subdir; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
- || exit 1; \
- fi; \
- done
- $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
-
-DEJATOOL = $(PACKAGE)
-
-RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
site.exp: Makefile
@echo 'Making a new site.exp file...'
- @test ! -f site.bak || rm -f site.bak
- @echo '## these variables are automatically generated by make ##' > $@-t
- @echo '# Do not edit here. If you wish to override these values' >> $@-t
- @echo '# edit the last section' >> $@-t
- @echo 'set tool $(DEJATOOL)' >> $@-t
- @echo 'set srcdir $(srcdir)' >> $@-t
- @echo 'set objdir' `pwd` >> $@-t
- @echo 'set host_alias $(host_alias)' >> $@-t
- @echo 'set host_triplet $(host_triplet)' >> $@-t
- @echo 'set target_alias $(target_alias)' >> $@-t
- @echo 'set target_triplet $(target_triplet)' >> $@-t
- @echo 'set build_alias $(build_alias)' >> $@-t
- @echo 'set build_triplet $(build_triplet)' >> $@-t
- @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
- @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t
+ @echo '## these variables are automatically generated by make ##' >site.tmp
+ @echo '# Do not edit here. If you wish to override these values' >>site.tmp
+ @echo '# edit the last section' >>site.tmp
+ @echo 'set srcdir $(srcdir)' >>site.tmp
+ @echo "set objdir `pwd`" >>site.tmp
+ @echo 'set build_alias "$(build_alias)"' >>site.tmp
+ @echo 'set build_triplet $(build_triplet)' >>site.tmp
+ @echo 'set host_alias "$(host_alias)"' >>site.tmp
+ @echo 'set host_triplet $(host_triplet)' >>site.tmp
+ @echo 'set target_alias "$(target_alias)"' >>site.tmp
+ @echo 'set target_triplet $(target_triplet)' >>site.tmp
+ @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
+ @test ! -f site.exp || \
+ sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
+ @-rm -f site.bak
@test ! -f site.exp || mv site.exp site.bak
- @mv $@-t site.exp
-info-am: $(INFO_DEPS)
-info: info-recursive
-dvi-am: $(DVIS)
-dvi: dvi-recursive
+ @mv site.tmp site.exp
+
+distclean-DEJAGNU:
+ -rm -f site.exp site.bak
+ -l='$(DEJATOOL)'; for tool in $$l; do \
+ rm -f $$tool.sum $$tool.log; \
+ done
check-am:
$(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
check: check-recursive
-installcheck-am:
-installcheck: installcheck-recursive
-install-info-am:
-install-info: install-info-recursive
-all-recursive-am: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-install-exec-am: install-exec-local
+all-am: Makefile $(PROGRAMS) $(MANS) config.h
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(man1dir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-recursive
install-exec: install-exec-recursive
-
-install-data-am: install-man install-data-local
install-data: install-data-recursive
+uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-recursive
-uninstall-am: uninstall-man
-uninstall: uninstall-recursive
-all-am: Makefile $(PROGRAMS) $(MANS) config.h
-all-redirect: all-recursive-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs: installdirs-recursive
-installdirs-am:
- $(mkinstalldirs) $(DESTDIR)$(mandir)/man1
-
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
@@ -1083,66 +1132,136 @@ clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
- -test -z "ldlexldeffilephdeffilepcldgramhldgramc$(MAINTAINERCLEANFILES)" || rm -f ldlexl deffileph deffilepc ldgramh ldgramc $(MAINTAINERCLEANFILES)
-mostlyclean-am: mostlyclean-hdr mostlyclean-noinstPROGRAMS \
- mostlyclean-compile mostlyclean-libtool \
- mostlyclean-aminfo mostlyclean-tags mostlyclean-generic \
- mostlyclean-local
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -rm -f deffilep.c
+ -rm -f deffilep.h
+ -rm -f ldgram.c
+ -rm -f ldgram.h
+ -rm -f ldlex.c
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-recursive
-mostlyclean: mostlyclean-recursive
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
-clean-am: clean-hdr clean-noinstPROGRAMS clean-compile clean-libtool \
- clean-aminfo clean-tags clean-generic mostlyclean-am
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-DEJAGNU distclean-compile \
+ distclean-generic distclean-hdr distclean-libtool \
+ distclean-local distclean-tags
-clean: clean-recursive
+dvi: dvi-recursive
-distclean-am: distclean-hdr distclean-noinstPROGRAMS distclean-compile \
- distclean-libtool distclean-aminfo distclean-tags \
- distclean-generic clean-am distclean-local
- -rm -f libtool
+dvi-am: $(DVIS)
-distclean: distclean-recursive
- -rm -f config.status
-
-maintainer-clean-am: maintainer-clean-hdr \
- maintainer-clean-noinstPROGRAMS \
- maintainer-clean-compile maintainer-clean-libtool \
- maintainer-clean-aminfo maintainer-clean-tags \
- maintainer-clean-generic distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+html: html-recursive
+
+html-am: $(HTMLS)
+
+info: info-recursive
+
+info-am: $(INFO_DEPS)
+
+install-data-am: install-data-local install-man
+
+install-exec-am: install-exec-local
+
+install-info: install-info-recursive
+
+install-info-am: $(INFO_DEPS)
+ @$(NORMAL_INSTALL)
+ test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ esac; \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
+ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
+ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
+ if test -f $$ifile; then \
+ relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
+ echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \
+ $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \
+ else : ; fi; \
+ done; \
+ done
+ @$(POST_INSTALL)
+ @if (install-info --version && \
+ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
+ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
+ done; \
+ else : ; fi
+install-man: install-man1
+
+installcheck-am:
maintainer-clean: maintainer-clean-recursive
- -rm -f config.status
-
-.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
-mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
-clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile mostlyclean-libtool distclean-libtool \
-clean-libtool maintainer-clean-libtool install-info-am uninstall-info \
-mostlyclean-aminfo distclean-aminfo clean-aminfo \
-maintainer-clean-aminfo install-man1 uninstall-man1 install-man \
-uninstall-man install-data-recursive uninstall-data-recursive \
-install-exec-recursive uninstall-exec-recursive installdirs-recursive \
-uninstalldirs-recursive all-recursive check-recursive \
-installcheck-recursive info-recursive dvi-recursive \
-mostlyclean-recursive distclean-recursive clean-recursive \
-maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir check-DEJAGNU \
-info-am info dvi-am dvi check check-am installcheck-am installcheck \
-install-info-am install-info all-recursive-am install-exec-local \
-install-exec-am install-exec install-data-local install-data-am \
-install-data install-am install uninstall-am uninstall all-redirect \
-all-am all installdirs-am installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-aminfo \
+ maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool mostlyclean-local
+
+pdf: pdf-recursive
+
+pdf-am: $(PDFS)
+
+ps: ps-recursive
+
+ps-am: $(PSS)
+
+uninstall-am: uninstall-man
+
+uninstall-info: uninstall-info-recursive
+
+uninstall-man: uninstall-man1
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
+ check-DEJAGNU check-am clean clean-generic clean-info \
+ clean-libtool clean-noinstPROGRAMS clean-recursive ctags \
+ ctags-recursive dist-info distclean distclean-DEJAGNU \
+ distclean-compile distclean-generic distclean-hdr \
+ distclean-libtool distclean-local distclean-recursive \
+ distclean-tags dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-data-local \
+ install-exec install-exec-am install-exec-local install-info \
+ install-info-am install-man install-man1 install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-aminfo \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-aminfo mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool mostlyclean-local \
+ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-info-am uninstall-man \
+ uninstall-man1
+
+
+# Disable -Werror, if it has been enabled, since old versions of bison/
+# yacc will produce working code which contain compile time warnings.
+ldgram.o:
+ $(COMPILE) -c $< $(NO_WERROR)
+ldlex.o:
+ $(COMPILE) -c $< $(NO_WERROR)
+deffilep.o:
+ $(COMPILE) -c $< $(NO_WERROR)
po/POTFILES.in: @MAINT@ Makefile
for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \
@@ -1175,9 +1294,6 @@ stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
@TDIRS@
-ea29k.c: $(srcdir)/emulparams/a29k.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} a29k "$(tdir_a29k)"
eaix5ppc.c: $(srcdir)/emulparams/aix5ppc.sh \
$(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
${GENSCRIPTS} aix5ppc "$(tdir_aixppc)"
@@ -1204,9 +1320,6 @@ 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)"
earmelf_fbsd.c: $(srcdir)/emulparams/armelf_fbsd.sh \
$(srcdir)/emulparams/armelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
@@ -1216,11 +1329,22 @@ 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)"
+earmelf_linux_eabi.c: $(srcdir)/emulparams/armelf_linux_eabi.sh \
+ $(srcdir)/emulparams/armelf_linux.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armelf_linux_eabi "$(tdir_armelf_linux_abi)"
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)"
+earmelfb_linux_eabi.c: $(srcdir)/emulparams/armelfb_linux_eabi.sh \
+ $(srcdir)/emulparams/armelf_linux_eabi.sh \
+ $(srcdir)/emulparams/armelf_linux.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armelfb_linux_eabi "$(tdir_armelfb_linux_abi)"
earmelf_nbsd.c: $(srcdir)/emulparams/armelf_nbsd.sh \
$(srcdir)/emulparams/armelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
@@ -1232,6 +1356,12 @@ earmelfb_nbsd.c: $(srcdir)/emulparams/armelfb_nbsd.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelfb_nbsd "$(tdir_armelfb_nbsd)"
+earmelf_vxworks.c: $(srcdir)/emulparams/armelf_vxworks.sh \
+ $(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/armelf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/vxworks.em \
+ $(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/elf.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} armelf_vxworks "$(tdir_armelf)"
earmaoutb.c: $(srcdir)/emulparams/armaoutb.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
${GENSCRIPTS} armaoutb "$(tdir_armaoutb)"
@@ -1254,6 +1384,11 @@ earm_epoc_pe.c: $(srcdir)/emulparams/arm_epoc_pe.sh \
earmpe.c: $(srcdir)/emulparams/armpe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
${GENSCRIPTS} armpe "$(tdir_armpe)"
+earmsymbian.c: $(srcdir)/emulparams/armsymbian.sh \
+ $(srcdir)/emulparams/armelf.sh $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/armbpabi.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} armsymbian "$(tdir_armelf)"
eavr2.c: $(srcdir)/emulparams/avr2.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \
${GEN_DEPENDS}
@@ -1304,15 +1439,32 @@ ed30v_e.c: $(srcdir)/emulparams/d30v_e.sh \
edelta68.c: $(srcdir)/emulparams/delta68.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/delta68.sc ${GEN_DEPENDS}
${GENSCRIPTS} delta68 "$(tdir_delta68)"
+eelf32bfin.c: $(srcdir)/emulparams/bfin.sh \
+ $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32bfin "$(tdir_elf32bfin)" bfin
+eelf32bfinfd.c: $(srcdir)/emulparams/elf32bfinfd.sh $(srcdir)/emulparams/bfin.sh \
+ $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32bfinfd "$(tdir_elf32bfinfd)" elf32bfinfd
eelf32_dlx.c: $(srcdir)/emulparams/elf32_dlx.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/dlx.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_dlx "$(tdir_elf32_dlx)"
-eebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ebmon29k "$(tdir_ebmon29k)"
-eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \
+eelf32xc16x.c: $(srcdir)/emulparams/elf32xc16x.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32xc16x "$(tdir_xc16x)"
+eelf32xc16xl.c: $(srcdir)/emulparams/elf32xc16xl.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32xc16xl "$(tdir_xc16xl)"
+eelf32xc16xs.c: $(srcdir)/emulparams/elf32xc16xs.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32xc16xs "$(tdir_xc16xs)"
+eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/scripttempl/xstormy16.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32xstormy16 "$(tdir_xstormy16)"
eelf32am33lin.c: $(srcdir)/emulparams/elf32am33lin.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -1321,8 +1473,9 @@ 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)/emulparams/xtensa-config.sh $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/emultempl/xtensaelf.em $(INCDIR)/xtensa-config.h \
+ $(BFDDIR)/elf-bfd.h $(BFDDIR)/libbfd.h $(INCDIR)/elf/xtensa.h \
$(srcdir)/scripttempl/elfxtensa.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32xtensa "$(tdir_elf32xtensa)"
eelf32fr30.c: $(srcdir)/emulparams/elf32fr30.sh \
@@ -1349,6 +1502,11 @@ em32rlelf_linux.c: $(srcdir)/emulparams/m32rlelf_linux.sh \
eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
+eelf32_sparc_vxworks.c: $(srcdir)/emulparams/elf32_sparc_vxworks.sh \
+ $(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/elf32_sparc.sh \
+ $(srcdir)/emultempl/vxworks.em $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32_sparc_vxworks "$(tdir_elf32_sparc_vxworks)"
eelf32_i860.c: $(srcdir)/emulparams/elf32_i860.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_i860 "$(tdir_elf32_i860)"
@@ -1356,11 +1514,14 @@ 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)/emultempl/mipself.em \
+ $(srcdir)/emulparams/elf32bmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
+eelf32cr16c.c: $(srcdir)/emulparams/elf32cr16c.sh \
+ $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elf32cr16c.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32cr16c "$(tdir_elf32cr16c)"
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 \
@@ -1368,90 +1529,111 @@ eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \
$(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)/emultempl/mipself.em \
+ $(srcdir)/emulparams/elf32bmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)"
+eelf32crx.c: $(srcdir)/emulparams/elf32crx.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/crxelf.em \
+ $(srcdir)/scripttempl/elf32crx.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32crx "$(tdir_elf32crx)"
eelf32btsmipn32.c: $(srcdir)/emulparams/elf32btsmipn32.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \
+ $(srcdir)/emulparams/elf32bmip.sh \
$(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)/emultempl/mipself.em \
+ $(srcdir)/emulparams/elf32bmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
+eelf32ebmipvxworks.c: $(srcdir)/emulparams/elf32ebmipvxworks.sh \
+ $(srcdir)/emulparams/elf32ebmip.sh $(srcdir)/emulparams/vxworks.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/vxworks.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ebmipvxworks "$(tdir_elf32ebmipvxworks)"
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)"
+eelf32elmipvxworks.c: $(srcdir)/emulparams/elf32elmipvxworks.sh \
+ $(srcdir)/emulparams/elf32elmip.sh $(srcdir)/emulparams/vxworks.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/vxworks.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32elmipvxworks "$(tdir_elf32elmipvxworks)"
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)/emultempl/mipself.em \
+ $(srcdir)/emulparams/elf32bmip.sh \
$(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/elf32ppccommon.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}
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.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)/emulparams/elf32ppccommon.sh $(srcdir)/emultempl/ppc32elf.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lppcsim "$(tdir_elf32lppcsim)"
eelf32ppcnto.c: $(srcdir)/emulparams/elf32ppcnto.sh \
- $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.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)"
+eelf32ppcvxworks.c: $(srcdir)/emulparams/elf32ppcvxworks.sh \
+ $(srcdir)/emulparams/elf32ppccommon.sh $(srcdir)/emulparams/vxworks.sh \
+ $(srcdir)/emultempl/vxworks.em $(srcdir)/emultempl/elf32.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ppcvxworks "$(tdir_elf32ppcvxworks)"
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 $(srcdir)/emultempl/ppc32elf.em \
+eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emulparams/elf32ppccommon.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)/emultempl/ppc32elf.em \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.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)/emultempl/ppc32elf.em \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.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)/emultempl/ppc32elf.em \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.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 \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -1473,15 +1655,18 @@ 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}
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/alphaelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
eelf64alpha_fbsd.c: $(srcdir)/emulparams/elf64alpha_fbsd.sh \
$(srcdir)/emulparams/elf64alpha.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/alphaelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha_fbsd "$(tdir_elf64alpha_fbsd)"
eelf64alpha_nbsd.c: $(srcdir)/emulparams/elf64alpha_nbsd.sh \
$(srcdir)/emulparams/elf64alpha.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/alphaelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha_nbsd "$(tdir_elf64alpha_nbsd)"
eelf64hppa.c: $(srcdir)/emulparams/elf64hppa.sh \
$(srcdir)/emulparams/hppa64linux.sh \
@@ -1554,6 +1739,10 @@ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)"
+eelf_i386_vxworks.c: $(srcdir)/emulparams/elf_i386_vxworks.sh \
+ $(srcdir)/emulparams/vxworks.sh $(srcdir)/emultempl/vxworks.em \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_i386_vxworks "$(tdir_elf_i386_vxworks)"
eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)"
@@ -1674,7 +1863,7 @@ ei386linux.c: $(srcdir)/emulparams/i386linux.sh \
$(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} i386linux "$(tdir_i386linux)"
ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386lynx.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} i386lynx "$(tdir_i386lynx)"
ei386mach.c: $(srcdir)/emulparams/i386mach.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
@@ -1743,9 +1932,6 @@ em68kelfnbsd.c: $(srcdir)/emulparams/m68kelfnbsd.sh \
em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \
$(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68klinux "$(tdir_m68klinux)"
-em68klynx.c: $(srcdir)/emulparams/m68klynx.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68klynx.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68klynx "$(tdir_m68klynx)"
em68knbsd.c: $(srcdir)/emulparams/m68knbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68knbsd "$(tdir_m68knbsd)"
@@ -1755,6 +1941,9 @@ em68kpsos.c: $(srcdir)/emulparams/m68kpsos.sh \
em88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
${GENSCRIPTS} m88kbcs "$(tdir_m88kbcs)"
+emaxqcoff.c: $(srcdir)/emulparams/maxqcoff.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/maxqcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} maxqcoff "$(tdir_maxqcoff)"
emcorepe.c: $(srcdir)/emulparams/mcorepe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
${GENSCRIPTS} mcorepe "$(tdir_mcorepe)"
@@ -1765,10 +1954,12 @@ emipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mipsbsd.sc ${GEN_DEPENDS}
${GENSCRIPTS} mipsbsd
emipsidt.c: $(srcdir)/emulparams/mipsidt.sh \
- $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/mipsecoff.em $(srcdir)/emultempl/generic.em \
+ $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
${GENSCRIPTS} mipsidt "$(tdir_mipsidt)"
emipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
- $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/mipsecoff.em $(srcdir)/emultempl/generic.em \
+ $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
${GENSCRIPTS} mipsidtl "$(tdir_mipsidtl)"
emipslit.c: $(srcdir)/emulparams/mipslit.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
@@ -1882,6 +2073,34 @@ emsp430x169.c: $(srcdir)/emulparams/msp430all.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
${GEN_DEPENDS}
${GENSCRIPTS} msp430x169 "$(tdir_msp430x169)" msp430all
+emsp430x1610.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1610 "$(tdir_msp430x1610)" msp430all
+emsp430x1611.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1611 "$(tdir_msp430x1611)" msp430all
+emsp430x1612.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x1612 "$(tdir_msp430x1612)" msp430all
+emsp430x2101.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x2101 "$(tdir_msp430x2101)" msp430all
+emsp430x2111.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x2111 "$(tdir_msp430x2111)" msp430all
+emsp430x2121.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x2121 "$(tdir_msp430x2121)" msp430all
+emsp430x2131.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x2131 "$(tdir_msp430x2131)" msp430all
emsp430x311.c: $(srcdir)/emulparams/msp430all.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \
${GEN_DEPENDS}
@@ -1926,6 +2145,14 @@ emsp430x413.c: $(srcdir)/emulparams/msp430all.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
${GEN_DEPENDS}
${GENSCRIPTS} msp430x413 "$(tdir_msp430x413)" msp430all
+emsp430x415.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x415 "$(tdir_msp430x415)" msp430all
+emsp430x417.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430x417 "$(tdir_msp430x417)" msp430all
emsp430xE423.c: $(srcdir)/emulparams/msp430all.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
${GEN_DEPENDS}
@@ -1950,6 +2177,18 @@ emsp430xW427.c: $(srcdir)/emulparams/msp430all.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
${GEN_DEPENDS}
${GENSCRIPTS} msp430xW427 "$(tdir_msp430xW427)" msp430all
+emsp430xG437.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xG437 "$(tdir_msp430xG437)" msp430all
+emsp430xG438.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xG438 "$(tdir_msp430xG438)" msp430all
+emsp430xG439.c: $(srcdir)/emulparams/msp430all.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} msp430xG439 "$(tdir_msp430xG439)" msp430all
emsp430x435.c: $(srcdir)/emulparams/msp430all.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \
${GEN_DEPENDS}
@@ -2008,12 +2247,12 @@ eppcnw.c: $(srcdir)/emulparams/ppcnw.sh \
eppcpe.c: $(srcdir)/emulparams/ppcpe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/ppcpe.sc ${GEN_DEPENDS}
${GENSCRIPTS} ppcpe "$(tdir_ppcpe)"
+eppclynx.c: $(srcdir)/emulparams/ppclynx.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} ppclynx "$(tdir_ppclynx)"
eriscix.c: $(srcdir)/emulparams/riscix.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} riscix "$(tdir_riscix)"
-esa29200.c: $(srcdir)/emulparams/sa29200.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sa29200 "$(tdir_sa29200)"
esh.c: $(srcdir)/emulparams/sh.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
${GENSCRIPTS} sh "$(tdir_sh)"
@@ -2070,6 +2309,10 @@ eshlelf.c: $(srcdir)/emulparams/shlelf.sh \
$(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf "$(tdir_shlelf)"
+eshlsymbian.c: $(srcdir)/emulparams/shlsymbian.sh \
+ $(srcdir)/emulparams/shelf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf32sh-symbian.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} shlsymbian "$(tdir_shlelf)"
eshlelf32.c: $(srcdir)/emulparams/shlelf32.sh \
$(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h $(srcdir)/emulparams/shelf32.sh \
$(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
@@ -2109,9 +2352,6 @@ esparcaout.c: $(srcdir)/emulparams/sparcaout.sh \
esparclinux.c: $(srcdir)/emulparams/sparclinux.sh \
$(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} sparclinux "$(tdir_sparclinux)"
-esparclynx.c: $(srcdir)/emulparams/sparclynx.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparclynx.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sparclynx "$(tdir_sparclynx)"
esparcnbsd.c: $(srcdir)/emulparams/sparcnbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} sparcnbsd "$(tdir_sparcnbsd)"
@@ -2163,6 +2403,10 @@ ev850.c: $(srcdir)/emulparams/v850.sh \
ew65.c: $(srcdir)/emulparams/w65.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/w65.sc ${GEN_DEPENDS}
${GENSCRIPTS} w65 "$(tdir_w65)"
+ez80.c: $(srcdir)/emulparams/z80.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/z80.em \
+ $(srcdir)/scripttempl/z80.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} z80 "$(tdir_z80)"
ez8001.c: $(srcdir)/emulparams/z8001.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
${GENSCRIPTS} z8001 "$(tdir_z8001)"
@@ -2173,6 +2417,13 @@ eelf32frvfd.c: $(srcdir)/emulparams/elf32frvfd.sh \
$(srcdir)/emulparams/elf32frv.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32frvfd "$(tdir_frv)"
+eelf32m32c.c: $(srcdir)/emulparams/elf32m32c.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32m32c "$(tdir_m32c)"
+eelf32mt.c: $(srcdir)/emulparams/elf32mt.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32mt "$(tdir_mt)"
# The generated emulation files mostly have the same dependencies.
$(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \
@@ -2184,10 +2435,6 @@ check-DEJAGNU: site.exp
r=`pwd`; export r; \
LC_COLLATE=; LC_ALL=; LANG=; export LC_COLLATE LC_ALL LANG; \
EXPECT=$(EXPECT); export EXPECT; \
- if [ -f $(top_builddir)/../expect/expect ]; then \
- TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \
- export TCL_LIBRARY; \
- fi; \
runtest=$(RUNTEST); \
if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
$$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
@@ -2259,21 +2506,15 @@ bootstrap: ld3$(EXEEXT)
# because almost all configs use "gen" version of manual.
# Set DOCVER above to change.
configdoc.texi: ${DOCVER}-doc.texi
- ln -s ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi >/dev/null 2>&1 \
- || ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi >/dev/null 2>&1 \
- || cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
+ cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
+ chmod u+w ./configdoc.texi
-ldver.texi: Makefile
+ldver.texi: $(srcdir)/../bfd/configure
rm -f $@
- echo '@set VERSION $(VERSION)' > $@
+ eval `grep '^ *VERSION=' $(srcdir)/../bfd/configure`; \
+ echo "@set VERSION $$VERSION" > $@
-ld.info: $(srcdir)/ld.texinfo configdoc.texi ldver.texi
- @rm -f $@ $@-[0-9] $@-[0-9][0-9]
- $(MAKEINFO) -I $(srcdir) -I $(BFDDIR)/doc $(srcdir)/ld.texinfo
-
-ld.dvi: $(srcdir)/ld.texinfo configdoc.texi ldver.texi
- TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
- MAKEINFO="$(MAKEINFO) -I $(srcdir) -I $(BFDDIR)/doc" $(TEXI2DVI) -I $(BFDDIR)/doc $(srcdir)/ld.texinfo
+$(srcdir)/ld.info ld.dvi ld.html: $(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
@@ -2289,6 +2530,52 @@ ld.1: $(srcdir)/ld.texinfo configdoc.texi ldver.texi
mostlyclean-local:
-rm -rf tmpdir
+.PHONY: install-html install-html-am install-html-recursive
+
+install-html: install-html-recursive install-html-am
+
+install-html-am: $(HTMLS)
+ @$(NORMAL_INSTALL)
+ test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
+ @list='$(HTMLS)'; for p in $$list; do \
+ if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
+ f=$(html__strip_dir) \
+ if test -d "$$d$$p"; then \
+ echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
+ $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+ echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+ $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
+ else \
+ echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
+ $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+ fi; \
+ done
+
+install-html-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
.PHONY: install-exec-local install-data-local
install-exec-local: ld-new$(EXEEXT)
@@ -2314,13 +2601,17 @@ install-data-local:
# We want install to imply install-info as per GNU standards, despite the
# cygnus option.
-install: install-info
+install-data-local: install-info
diststuff: info $(EXTRA_DIST)
+all: info ld.1
+
+# Both info (ld.info) and ld.1 depend on configdoc.texi and ldver.texi.
+# But info isn't a direct target. Make info-recursive to depend on
+# ld.1 to support parallel build.
+info-recursive: ld.1
distclean-local:
rm -rf ldscripts
-Makefile: $(BFDDIR)/configure.in
-
# Targets to rebuild dependencies in this Makefile.
# Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES).
DEP: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h
@@ -2364,29 +2655,6 @@ dep-am: DEP
.PHONY: dep dep-in dep-am
-@MAINT@.PHONY: mpw
-@MAINT@mpw: $(srcdir)/mpw-ei386go32.c $(srcdir)/mpw-elfmips.c \
-@MAINT@ $(srcdir)/mpw-em68kcoff.c $(srcdir)/mpw-eppcmac.c \
-@MAINT@ $(srcdir)/mpw-esh.c $(srcdir)/mpw-idtmips.c
-@MAINT@
-@MAINT@$(srcdir)/mpw-ei386go32.c: ei386go32.c
-@MAINT@ $(srcdir)/../move-if-change $< $@
-@MAINT@
-@MAINT@$(srcdir)/mpw-elfmips.c: eelf32ebmip.c
-@MAINT@ $(srcdir)/../move-if-change $< $@
-@MAINT@
-@MAINT@$(srcdir)/mpw-em68kcoff.c: em68kcoff.c
-@MAINT@ $(srcdir)/../move-if-change $< $@
-@MAINT@
-@MAINT@$(srcdir)/mpw-eppcmac.c: eppcmacos.c
-@MAINT@ $(srcdir)/../move-if-change $< $@
-@MAINT@
-@MAINT@$(srcdir)/mpw-esh.c: esh.c
-@MAINT@ $(srcdir)/../move-if-change $< $@
-@MAINT@
-@MAINT@$(srcdir)/mpw-idtmips.c: emipsidt.c
-@MAINT@ $(srcdir)/../move-if-change $< $@
-
# What appears below is generated by a hacked mkdep using gcc -MM.
# DO NOT DELETE THIS LINE -- mkdep uses it.
@@ -2395,10 +2663,10 @@ ldctor.o: ldctor.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 \
ldexp.h ldlang.h ldmisc.h ldgram.h ldmain.h ldctor.h
-ldemul.o: ldemul.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
- ld.h $(INCDIR)/bin-bugs.h ldmisc.h ldexp.h ldlang.h \
- ldfile.h ldemul.h ldmain.h ldemul-list.h
+ldemul.o: ldemul.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/symcat.h sysdep.h $(INCDIR)/fopen-same.h \
+ $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldmisc.h \
+ ldexp.h ldlang.h ldfile.h ldemul.h ldmain.h ldemul-list.h
ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
$(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldmain.h \
@@ -2426,7 +2694,8 @@ ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.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
+ ldgram.h ldlex.h ldmain.h ldfile.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
$(INCDIR)/symcat.h ../bfd/bfdver.h sysdep.h config.h \
$(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h ldver.h \
@@ -2436,8 +2705,8 @@ ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.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 \
+lexsup.o: lexsup.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/symcat.h sysdep.h $(INCDIR)/fopen-same.h \
$(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h \
ld.h $(INCDIR)/bin-bugs.h ldmain.h ldmisc.h ldexp.h \
ldlang.h ldgram.h ldlex.h ldfile.h ldver.h ldemul.h \
@@ -2470,7 +2739,6 @@ deffilep.o: deffilep.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \
ldmisc.h deffile.h
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
-
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/contrib/binutils/ld/NEWS b/contrib/binutils/ld/NEWS
index 81512c4..27fb0ae 100644
--- a/contrib/binutils/ld/NEWS
+++ b/contrib/binutils/ld/NEWS
@@ -1,11 +1,87 @@
-*- text -*-
+* Support for the Infineon XC16X has been added by KPIT Cummins Infosystems.
+
+* Modify the Linux linker search order to better match ld.so search order.
+ Look for DT_NEEDED libraries in paths specified by ld.so.conf before
+ searching the default directories, rather than vice versa.
+ Use $prefix/etc/ld.so.conf if it exists, otherwise /etc/ld.so.conf.
+
+* PE-COFF: Forward exports from DLL's can now be specified in .def files
+ passed directly to ld.
+
+* Support for the Z80 processor family has been added.
+
+* Add support for the "@<file>" syntax to the command line, so that extra
+ switches can be read from <file>.
+
+Changes in 2.16:
+
+* Support for the R_ARM_V4BX relocation as defined in the ARM AAELF
+ specification has been added via the --fix-v4bx command-line option.
+
+* New linker script construct AS_NEEDED(), which sets the --as-needed flag
+ for input files listed inside of it.
+
+* A new command-line option, --sysroot, can be used to override the
+ default sysroot location. It only applies to toolchains that were
+ configured using --with-sysroot.
+
+* New linker script functions: ORIGIN() and LENGTH() which return information
+ about a specified memory region.
+
+* Port to MAXQ processor contributed by HCL Tech.
+
+* Added SEGMENT_START to the linker script language to permit the user to
+ override the base address for a segment from the command-line.
+
+* ELF: --warn-shared-textrel option to warn if adding a DT_TEXTREL to a shared
+ object.
+
+* Added SORT_BY_NAME and SORT_BY_ALIGNMENT to the linker script
+ language to permit sorting sections by section name or section
+ maximum alignment.
+
+* Added a new linker command line switch, --sort-section name|alignment,
+ to sort sections by section name or maximum alignment.
+
+* ELF: --add-needed/--no-add-needed options to control if a DT_NEEDED tag
+ should be added when a shared library comes from DT_NEEDED tags.
+
+* Support for the crx-elf target added.
+
+* Support for the sh-symbianelf target added.
+
+* A new linker command line switch has been added which allows the hash table
+ size to be set to a suitable prime value near to its argument. This switch
+ is --hash-size=<NUMBER>. Also if the switch --reduce-memory-overheads is
+ used, and --hash-size has not been used, then the default value will be set
+ to 1021.
+
+* Linker map files are now generated with an O(N) algorithm for finding symbols
+ that are defined in each section. This uses about 40% more memory for
+ symbols than the old O(N^2) algorithm. You can use the new
+ --reduce-memory-overheads option to select the old algorithm; this option
+ might also be used in the future to select similar tradeoffs.
+
+Changes in 2.15:
+
+* ELF: --as-needed/--no-as-needed options to control if a DT_NEEDED tag should
+ be added only when a shared library is referenced.
+
+* PE: --large-address-aware option to indicate executables support virtual
+ addresses greater than 2 gigabytes.
+
+* DWARF 2 support for i386pe added.
+
* 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.
+* cr16c support added by NSC.
+
* m32r Linux (ELF) support added by Renesas.
* Improved linker's handling of unresolved symbols. The switch
diff --git a/contrib/binutils/ld/acinclude.m4 b/contrib/binutils/ld/acinclude.m4
index 403aa0e..71b09b9 100644
--- a/contrib/binutils/ld/acinclude.m4
+++ b/contrib/binutils/ld/acinclude.m4
@@ -1,16 +1 @@
sinclude(../bfd/acinclude.m4)
-
-dnl sinclude(../libtool.m4) already included in bfd/acinclude.m4
-dnl The lines below arrange for aclocal not to bring libtool.m4
-dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
-dnl to add a definition of LIBTOOL to Makefile.in.
-ifelse(yes,no,[
-AC_DEFUN([AM_PROG_LIBTOOL],)
-AC_SUBST(LIBTOOL)
-])
-
-dnl sinclude(../gettext.m4) already included in bfd/acinclude.m4
-ifelse(yes,no,[
-AC_DEFUN([CY_WITH_NLS],)
-AC_SUBST(INTLLIBS)
-])
diff --git a/contrib/binutils/ld/aclocal.m4 b/contrib/binutils/ld/aclocal.m4
index 7b50bb9..cd42673 100644
--- a/contrib/binutils/ld/aclocal.m4
+++ b/contrib/binutils/ld/aclocal.m4
@@ -1,105 +1,771 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4-p5
-
-dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-dnl PARTICULAR PURPOSE.
-
-sinclude(../bfd/acinclude.m4)
-
-dnl sinclude(../libtool.m4) already included in bfd/acinclude.m4
-dnl The lines below arrange for aclocal not to bring libtool.m4
-dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
-dnl to add a definition of LIBTOOL to Makefile.in.
-ifelse(yes,no,[
-AC_DEFUN([AM_PROG_LIBTOOL],)
-AC_SUBST(LIBTOOL)
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+ [AM_AUTOMAKE_VERSION([1.9.6])])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
])
-dnl sinclude(../gettext.m4) already included in bfd/acinclude.m4
-ifelse(yes,no,[
-AC_DEFUN([CY_WITH_NLS],)
-AC_SUBST(INTLLIBS)
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 7
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
-#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.
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
-# serial 1
-dnl Usage:
-dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# 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.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_REQUIRE([AC_PROG_INSTALL])
-PACKAGE=[$1]
-AC_SUBST(PACKAGE)
-VERSION=[$2]
-AC_SUBST(VERSION)
-dnl test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+[AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
-ifelse([$3],,
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
-AC_REQUIRE([AM_SANITY_CHECK])
-AC_REQUIRE([AC_ARG_PROGRAM])
-dnl FIXME This is truly gross.
-missing_dir=`cd $ac_aux_dir && pwd`
-AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
-AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
-AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
-AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
-AC_REQUIRE([AC_PROG_MAKE_SET])])
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $1 | $1:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_PROG_LEX
+# -----------
+# Autoconf leaves LEX=: if lex or flex can't be found. Change that to a
+# "missing" invocation, for better error output.
+AC_DEFUN([AM_PROG_LEX],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AM_MISSING_HAS_RUN])dnl
+AC_REQUIRE([AC_PROG_LEX])dnl
+if test "$LEX" = :; then
+ LEX=${am_missing_run}flex
+fi])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
#
-# Check to make sure that the build environment is sane.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
#
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake. There are at least two reasons why we must not
+# use `-m 0755':
+# - it causes special bits like SGID to be ignored,
+# - it may be too restrictive (some setups expect 775 directories).
+#
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
+#
+# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+# Some implementations (such as Solaris 8's) are not thread-safe: if a
+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+# concurrently, both version can detect that a/ is missing, but only
+# one can create it and the other will error out. Consequently we
+# restrict ourselves to GNU make (using the --version option ensures
+# this.)
+AC_DEFUN([AM_PROG_MKDIR_P],
+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # We used to keeping the `.' as first argument, in order to
+ # allow $(mkdir_p) to be used without argument. As in
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined. However this is wrong
+ # for two reasons:
+ # 1. if the package is installed by a user who cannot write `.'
+ # make install will fail,
+ # 2. the above comment should most certainly read
+ # $(mkdir_p) $(DESTDIR)$(somedir)
+ # so it does not work when $(somedir) is undefined and
+ # $(DESTDIR) is not.
+ # To support the latter case, we have to write
+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+ # so the `.' trick is pointless.
+ mkdir_p='mkdir -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
+ else
+ mkdir_p='$(install_sh) -d'
+ fi
+fi
+AC_SUBST([mkdir_p])])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
-echo timestamp > conftestfile
+echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
- if test "[$]*" = "X"; then
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
# -L didn't work.
- set X `ls -t $srcdir/configure conftestfile`
+ set X `ls -t $srcdir/configure conftest.file`
fi
- if test "[$]*" != "X $srcdir/configure conftestfile" \
- && test "[$]*" != "X conftestfile $srcdir/configure"; then
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
@@ -109,7 +775,7 @@ if (
alias in your environment])
fi
- test "[$]2" = conftestfile
+ test "$[2]" = conftest.file
)
then
# Ok.
@@ -118,87 +784,130 @@ else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
-rm -f conftest*
AC_MSG_RESULT(yes)])
-dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
-dnl The program must properly implement --version.
-AC_DEFUN([AM_MISSING_PROG],
-[AC_MSG_CHECKING(for working $2)
-# 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.
-if ($2 --version) < /dev/null > /dev/null 2>&1; then
- $1=$2
- AC_MSG_RESULT(found)
-else
- $1="$3/missing $2"
- AC_MSG_RESULT(missing)
-fi
-AC_SUBST($1)])
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# Like AC_CONFIG_HEADER, but automatically create stamp file.
-
-AC_DEFUN([AM_CONFIG_HEADER],
-[AC_PREREQ([2.12])
-AC_CONFIG_HEADER([$1])
-dnl When config.status generates a header, we must update the stamp-h file.
-dnl This file resides in the same directory as the config header
-dnl that is generated. We must strip everything past the first ":",
-dnl and everything past the last "/".
-AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
-ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
-<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
-<<am_indx=1
-for am_file in <<$1>>; do
- case " <<$>>CONFIG_HEADERS " in
- *" <<$>>am_file "*<<)>>
- echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
- ;;
- esac
- am_indx=`expr "<<$>>am_indx" + 1`
-done<<>>dnl>>)
-changequote([,]))])
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+# Check how to create a tarball. -*- Autoconf -*-
-dnl AM_PROG_LEX
-dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
-AC_DEFUN([AM_PROG_LEX],
-[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
-AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
-AC_PROG_LEX
-AC_DECL_YYTEXT])
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# Add --enable-maintainer-mode option to configure.
-# From Jim Meyering
+# serial 2
-# serial 1
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
-AC_DEFUN([AM_MAINTAINER_MODE],
-[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
- dnl maintainer-mode is disabled by default
- AC_ARG_ENABLE(maintainer-mode,
-[ --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer],
- USE_MAINTAINER_MODE=$enableval,
- USE_MAINTAINER_MODE=no)
- AC_MSG_RESULT($USE_MAINTAINER_MODE)
- AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
- MAINT=$MAINTAINER_MODE_TRUE
- AC_SUBST(MAINT)dnl
-]
-)
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
-# Define a conditional.
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
-AC_DEFUN([AM_CONDITIONAL],
-[AC_SUBST($1_TRUE)
-AC_SUBST($1_FALSE)
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi])
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+m4_include([acinclude.m4])
diff --git a/contrib/binutils/ld/config.in b/contrib/binutils/ld/config.in
index f76bb42..fa2e69f 100644
--- a/contrib/binutils/ld/config.in
+++ b/contrib/binutils/ld/config.in
@@ -1,177 +1,222 @@
-/* config.in. Generated automatically from configure.in by autoheader. */
+/* config.in. Generated from configure.in by autoheader. */
-/* Define if using alloca.c. */
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for `alloca.c' support on those systems.
+ */
+#undef CRAY_STACKSEG_END
+
+/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
-/* Define to empty if the keyword does not work. */
-#undef const
+/* Define to 1 if NLS is requested */
+#undef ENABLE_NLS
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-#undef CRAY_STACKSEG_END
+/* Additional extension a shared object might have. */
+#undef EXTRA_SHLIB_EXTENSION
-/* Define if you have alloca, as a function or macro. */
+/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
#undef HAVE_ALLOCA_H
-/* Define if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define as __inline if that's what the C compiler calls it. */
-#undef inline
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-#undef off_t
+/* Define to 1 if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
-/* Define if you need to in order for stat and other things to work. */
-#undef _POSIX_SOURCE
+/* Define to 1 if you have the `dcgettext' function. */
+#undef HAVE_DCGETTEXT
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
+/* Define to 1 if you have the declaration of `environ', and to 0 if you
+ don't. */
+#undef HAVE_DECL_ENVIRON
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-#undef STACK_DIRECTION
+/* Define to 1 if you have the declaration of `free', and to 0 if you don't.
+ */
+#undef HAVE_DECL_FREE
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
+/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
+ */
+#undef HAVE_DECL_GETENV
-/* Define if lex declares yytext as a char * by default, not a char[]. */
-#undef YYTEXT_POINTER
+/* Is the prototype for getopt in <unistd.h> in the expected format? */
+#undef HAVE_DECL_GETOPT
-/* Define if you have the __argz_count function. */
-#undef HAVE___ARGZ_COUNT
+/* Define to 1 if you have the declaration of `sbrk', and to 0 if you don't.
+ */
+#undef HAVE_DECL_SBRK
-/* Define if you have the __argz_next function. */
-#undef HAVE___ARGZ_NEXT
+/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
+ */
+#undef HAVE_DECL_STRSTR
-/* Define if you have the __argz_stringify function. */
-#undef HAVE___ARGZ_STRINGIFY
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_DIRENT_H
-/* Define if you have the dcgettext function. */
-#undef HAVE_DCGETTEXT
+/* Define to 1 if you have the <elf-hints.h> header file. */
+#undef HAVE_ELF_HINTS_H
-/* Define if you have the getcwd function. */
+/* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD
-/* Define if you have the getpagesize function. */
+/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
-/* Define if you have the munmap function. */
-#undef HAVE_MUNMAP
+/* Define as 1 if you have gettext and don't want to use GNU gettext. */
+#undef HAVE_GETTEXT
-/* Define if you have the putenv function. */
-#undef HAVE_PUTENV
+/* Define to 1 if you have the `glob' function. */
+#undef HAVE_GLOB
-/* Define if you have the realpath function. */
-#undef HAVE_REALPATH
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
-/* Define if you have the sbrk function. */
-#undef HAVE_SBRK
+/* Define if your locale.h file contains LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
-/* Define if you have the setenv function. */
-#undef HAVE_SETENV
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
-/* Define if you have the setlocale function. */
-#undef HAVE_SETLOCALE
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
-/* Define if you have the stpcpy function. */
-#undef HAVE_STPCPY
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
-/* Define if you have the strcasecmp function. */
-#undef HAVE_STRCASECMP
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
-/* Define if you have the strchr function. */
-#undef HAVE_STRCHR
+/* Define to 1 if you have a working `mmap' system call. */
+#undef HAVE_MMAP
-/* Define if you have the <argz.h> header file. */
-#undef HAVE_ARGZ_H
+/* Define to 1 if you have the `munmap' function. */
+#undef HAVE_MUNMAP
-/* Define if you have the <dirent.h> header file. */
-#undef HAVE_DIRENT_H
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
-/* Define if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
+/* Define to 1 if you have the <nl_types.h> header file. */
+#undef HAVE_NL_TYPES_H
-/* Define if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
+/* Define to 1 if you have the `putenv' function. */
+#undef HAVE_PUTENV
-/* Define if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
+/* Define to 1 if you have the `realpath' function. */
+#undef HAVE_REALPATH
-/* Define if you have the <ndir.h> header file. */
-#undef HAVE_NDIR_H
+/* Define to 1 if you have the `sbrk' function. */
+#undef HAVE_SBRK
-/* Define if you have the <nl_types.h> header file. */
-#undef HAVE_NL_TYPES_H
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
+
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
-/* Define if you have the <stdlib.h> header file. */
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
-/* Define if you have the <string.h> header file. */
-#undef HAVE_STRING_H
+/* Define if you have the stpcpy function */
+#undef HAVE_STPCPY
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
-/* Define if you have the <strings.h> header file. */
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
-/* Define if you have the <sys/dir.h> header file. */
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
#undef HAVE_SYS_DIR_H
-/* Define if you have the <sys/ndir.h> header file. */
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
#undef HAVE_SYS_NDIR_H
-/* Define if you have the <sys/param.h> header file. */
+/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
-/* Define if you have the <unistd.h> header file. */
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define if you have the <values.h> header file. */
+/* Define to 1 if you have the <values.h> header file. */
#undef HAVE_VALUES_H
+/* Define to 1 if you have the `__argz_count' function. */
+#undef HAVE___ARGZ_COUNT
+
+/* Define to 1 if you have the `__argz_next' function. */
+#undef HAVE___ARGZ_NEXT
+
+/* Define to 1 if you have the `__argz_stringify' function. */
+#undef HAVE___ARGZ_STRINGIFY
+
/* Name of package */
#undef PACKAGE
-/* Version number of package */
-#undef VERSION
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
-/* Define if you have the stpcpy function */
-#undef HAVE_STPCPY
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
-/* Define if your locale.h file contains LC_MESSAGES. */
-#undef HAVE_LC_MESSAGES
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
-/* Define to 1 if NLS is requested */
-#undef ENABLE_NLS
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-#undef HAVE_GETTEXT
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
/* Use b modifier when opening binary files? */
#undef USE_BINARY_FOPEN
-/* Define if strstr is not declared in system header files. */
-#undef NEED_DECLARATION_STRSTR
-
-/* Define if free is not declared in system header files. */
-#undef NEED_DECLARATION_FREE
+/* Version number of package */
+#undef VERSION
-/* Define if sbrk is not declared in system header files. */
-#undef NEED_DECLARATION_SBRK
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
+ `char[]'. */
+#undef YYTEXT_POINTER
-/* Define if getenv is not declared in system header files. */
-#undef NEED_DECLARATION_GETENV
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
-/* Define if environ is not declared in system header files. */
-#undef NEED_DECLARATION_ENVIRON
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
-/* Additional extension a shared object might have. */
-#undef EXTRA_SHLIB_EXTENSION
+/* Define to `long' if <sys/types.h> does not define. */
+#undef off_t
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
diff --git a/contrib/binutils/ld/configure b/contrib/binutils/ld/configure
index 410f9c2..0cd6f5c 100755
--- a/contrib/binutils/ld/configure
+++ b/contrib/binutils/ld/configure
@@ -1,55 +1,325 @@
#! /bin/sh
-
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Generated by GNU Autoconf 2.59.
#
+# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-# Defaults:
-ac_help=
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
ac_default_prefix=/usr/local
-# Any additions from configure.in:
-ac_help="$ac_help
- --enable-shared[=PKGS] build shared libraries [default=yes]"
-ac_help="$ac_help
- --enable-static[=PKGS] build static libraries [default=yes]"
-ac_help="$ac_help
- --enable-fast-install[=PKGS] optimize for fast installation [default=yes]"
-ac_help="$ac_help
- --with-gnu-ld assume the C compiler uses GNU ld [default=no]"
-ac_help="$ac_help
- --disable-libtool-lock avoid locking (might break parallel builds)"
-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
- --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
- --with-included-gettext use the GNU gettext library included here"
-ac_help="$ac_help
- --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer"
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="ldmain.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL use_sysroot TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS NO_WERROR CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l YACC LEX LEXLIB LEX_OUTPUT_ROOT MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT HDEFINES HOSTING_CRT0 HOSTING_LIBS NATIVE_LIB_DIRS STRINGIFY EMUL EMULATION_OFILES EMUL_EXTRA_OFILES LIB_PATH EMULATION_LIBPATH TESTBFDLIB datarootdir docdir htmldir LIBOBJS LTLIBOBJS'
+ac_subst_files='TDIRS'
# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
# The variables have the same names as the options, with
# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
+cache_file=/dev/null
exec_prefix=NONE
-host=NONE
no_create=
-nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
@@ -57,12 +327,16 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
-sitefile=
srcdir=
-target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
@@ -76,17 +350,9 @@ oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
ac_prev=
for ac_option
do
-
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval "$ac_prev=\$ac_option"
@@ -94,59 +360,59 @@ do
continue
fi
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
# Accept the important Cygnus configure options, so we can diagnose typos.
- case "$ac_option" in
+ case $ac_option in
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
+ bindir=$ac_optarg ;;
-build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
+ ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
+ build_alias=$ac_optarg ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
-datadir | --datadir | --datadi | --datad | --data | --dat | --da)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
| --da=*)
- datadir="$ac_optarg" ;;
+ datadir=$ac_optarg ;;
-disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
-enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
+ eval "enable_$ac_feature='$ac_optarg'" ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -155,96 +421,47 @@ do
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
+ exec_prefix=$ac_optarg ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --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
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
-host | --host | --hos | --ho)
- ac_prev=host ;;
+ ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
+ host_alias=$ac_optarg ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
+ includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
+ infodir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
+ libdir=$ac_optarg ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
+ libexecdir=$ac_optarg ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst \
@@ -253,19 +470,19 @@ EOF
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* \
| --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
+ localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
+ mandir=$ac_optarg ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
+ | --no-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
@@ -279,26 +496,26 @@ EOF
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
+ oldincludedir=$ac_optarg ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
+ prefix=$ac_optarg ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
+ program_prefix=$ac_optarg ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
+ program_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
@@ -315,7 +532,7 @@ EOF
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
+ program_transform_name=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
@@ -325,7 +542,7 @@ EOF
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
+ sbindir=$ac_optarg ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
@@ -336,63 +553,57 @@ EOF
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
+ sharedstatedir=$ac_optarg ;;
-site | --site | --sit)
ac_prev=site ;;
-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" ;;
+ site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
+ srcdir=$ac_optarg ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
+ sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
+ ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
+ target_alias=$ac_optarg ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.13"
- exit 0 ;;
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
-with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
- eval "with_${ac_package}='$ac_optarg'" ;;
+ eval "with_$ac_package='$ac_optarg'" ;;
-without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
--x)
# Obsolete; use --with-x.
@@ -403,99 +614,110 @@ EOF
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
+ x_includes=$ac_optarg ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
+ x_libraries=$ac_optarg ;;
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
;;
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
*)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
;;
esac
done
if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
fi
-exec 5>./config.log
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
esac
done
-# NLS nuisances.
-# Only set these to C if already set. These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=ldmain.c
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
@@ -505,123 +727,598 @@ else
fi
if test ! -r $srcdir/$ac_unique_file; then
if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
fi
fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
-# Prefer explicitly selected file to automatically selected ones.
-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"
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+ --target=TARGET configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --enable-shared=PKGS build shared libraries default=yes
+ --enable-static=PKGS build static libraries default=yes
+ --enable-fast-install=PKGS optimize for fast installation default=yes
+ --disable-libtool-lock avoid locking (might break parallel builds)
+ --enable-targets alternative target configurations
+ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)
+ --enable-werror treat compile warnings as errors
+ --enable-build-warnings Enable build-time compiler warnings
+ --disable-nls do not use Native Language Support
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-gnu-ld assume the C compiler uses GNU ld default=no
+ --with-pic try to use only PIC/non-PIC objects default=use both
+ --with-lib-path=dir1:dir2... set default LIB_PATH
+ --with-sysroot=DIR Search for usr/lib et al within DIR.
+ --with-included-gettext use the GNU gettext library included here
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# 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"
fi
-else
- CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file"
fi
done
if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
else
- echo "creating cache $cache_file"
- > $cache_file
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
fi
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
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
-echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-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 570 "configure"
-#include "confdefs.h"
-int main() {
-#ifndef __CYGWIN__
-#define __CYGWIN__ __CYGWIN32__
-#endif
-return __CYGWIN__;
-; return 0; }
-EOF
-if { (eval echo configure:581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_cygwin=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_cygwin=no
-fi
-rm -f conftest*
-rm -f conftest*
-fi
-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: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 603 "configure"
-#include "confdefs.h"
-int main() {
-return __MINGW32__;
-; return 0; }
-EOF
-if { (eval echo configure:610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_mingw32=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_mingw32=no
-fi
-rm -f conftest*
-rm -f conftest*
-fi
-echo "$ac_t""$ac_cv_mingw32" 1>&6
-MINGW32=
-test "$ac_cv_mingw32" = yes && MINGW32=yes
ac_aux_dir=
@@ -634,149 +1331,1163 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
fi
done
if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { (exit 1); exit 1; }; }
fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+ ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+ ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+ ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-# Do some error checking and defaulting for the host and target type.
-# The inputs are:
-# configure --host=HOST --target=TARGET --build=BUILD NONOPT
-#
-# The rules are:
-# 1. You are not allowed to specify --host, --target, and nonopt at the
-# same time.
-# 2. Host defaults to nonopt.
-# 3. If nonopt is not specified, then host defaults to the current host,
-# as determined by config.guess.
-# 4. Target and build default to nonopt.
-# 5. If nonopt is not specified, then target and build default to host.
# The aliases save the names the user supplied, while $host etc.
# will get canonicalized.
-case $host---$target---$nonopt in
-NONE---*---* | *---NONE---* | *---*---NONE) ;;
-*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
-esac
+test -n "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:675: checking host system type" >&5
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
- NONE)
- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
- fi ;;
- *) host_alias=$nonopt ;;
- esac ;;
-esac
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-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:696: checking target system type" >&5
-
-target_alias=$target
-case "$target_alias" in
-NONE)
- case $nonopt in
- NONE) target_alias=$host_alias ;;
- *) target_alias=$nonopt ;;
- esac ;;
-esac
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
-target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-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:714: checking build system type" >&5
-
-build_alias=$build
-case "$build_alias" in
-NONE)
- case $nonopt in
- NONE) build_alias=$host_alias ;;
- *) build_alias=$nonopt ;;
- esac ;;
-esac
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$build" 1>&6
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-test "$host_alias" != "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
- 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
+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 $# != 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
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- 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();
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
-int main() {
-strerror()
-; return 0; }
-EOF
-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"
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&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 "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
rm -f conftest*
-LIBS="$ac_save_LIBS"
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- LIBS="$LIBS -lcposix"
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for library containing strerror" >&5
+echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6
+if test "${ac_cv_search_strerror+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_strerror=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strerror ();
+int
+main ()
+{
+strerror ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_strerror="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_strerror" = no; then
+ for ac_lib in cposix; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strerror ();
+int
+main ()
+{
+strerror ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_strerror="-l$ac_lib"
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
+echo "${ECHO_T}$ac_cv_search_strerror" >&6
+if test "$ac_cv_search_strerror" != no; then
+ test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
-
+fi
BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
+am__api_version="1.9"
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
@@ -784,233 +2495,585 @@ BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
# ./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:793: checking for a BSD compatible install" >&5
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if test -f $ac_dir/$ac_prog; then
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
fi
fi
done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
+ done
+ ;;
+esac
+done
+
fi
if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
+ INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. We don't cache a
# path for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the path is relative.
- INSTALL="$ac_install_sh"
+ INSTALL=$ac_install_sh
fi
fi
-echo "$ac_t""$INSTALL" 1>&6
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:846: checking whether build environment is sane" >&5
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
# Just in case
sleep 1
-echo timestamp > conftestfile
+echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$*" = "X"; then
# -L didn't work.
- set X `ls -t $srcdir/configure conftestfile`
+ set X `ls -t $srcdir/configure conftest.file`
fi
- if test "$*" != "X $srcdir/configure conftestfile" \
- && test "$*" != "X conftestfile $srcdir/configure"; then
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
- { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
fi
- test "$2" = conftestfile
+ test "$2" = conftest.file
)
then
# Ok.
:
else
- { echo "configure: error: newly created file is older than distributed files!
-Check your system clock" 1>&2; exit 1; }
-fi
-rm -f conftest*
-echo "$ac_t""yes" 1>&6
-if test "$program_transform_name" = s,x,x,; then
- program_transform_name=
-else
- # Double any \ or $. echo might interpret backslashes.
- cat <<\EOF_SED > conftestsed
-s,\\,\\\\,g; s,\$,$$,g
-EOF_SED
- program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
- rm -f conftestsed
+ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
test "$program_prefix" != NONE &&
- program_transform_name="s,^,${program_prefix},; $program_transform_name"
+ program_transform_name="s,^,$program_prefix,;$program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
- program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # We used to keeping the `.' as first argument, in order to
+ # allow $(mkdir_p) to be used without argument. As in
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined. However this is wrong
+ # for two reasons:
+ # 1. if the package is installed by a user who cannot write `.'
+ # make install will fail,
+ # 2. the above comment should most certainly read
+ # $(mkdir_p) $(DESTDIR)$(somedir)
+ # so it does not work when $(somedir) is undefined and
+ # $(DESTDIR) is not.
+ # To support the latter case, we have to write
+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+ # so the `.' trick is pointless.
+ mkdir_p='mkdir -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
+ else
+ mkdir_p='$(install_sh) -d'
+ fi
+fi
-# sed with no file args requires a program.
-test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+for ac_prog in gawk mawk nawk awk
+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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-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
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftestmake <<\EOF
+ cat >conftest.make <<\_ACEOF
all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
eval ac_cv_prog_make_${ac_make}_set=yes
else
eval ac_cv_prog_make_${ac_make}_set=no
fi
-rm -f conftestmake
+rm -f conftest.make
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
SET_MAKE=
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
SET_MAKE="MAKE=${MAKE-make}"
fi
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+DEPDIR="${am__leading_dot}deps"
+
+ ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
-PACKAGE=ld
-VERSION=${BFD_VERSION}
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+fi
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
- { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
fi
-cat >> confdefs.h <<EOF
+
+
+# Define the identity of the package.
+ PACKAGE=ld
+ VERSION=${BFD_VERSION}
+
+
+cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
-EOF
+_ACEOF
-cat >> confdefs.h <<EOF
+
+cat >>confdefs.h <<_ACEOF
#define VERSION "$VERSION"
-EOF
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
-missing_dir=`cd $ac_aux_dir && pwd`
-echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-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.
-if (aclocal --version) < /dev/null > /dev/null 2>&1; then
- ACLOCAL=aclocal
- echo "$ac_t""found" 1>&6
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # 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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
else
- ACLOCAL="$missing_dir/missing aclocal"
- echo "$ac_t""missing" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-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.
-if (autoconf --version) < /dev/null > /dev/null 2>&1; then
- AUTOCONF=autoconf
- echo "$ac_t""found" 1>&6
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- AUTOCONF="$missing_dir/missing autoconf"
- echo "$ac_t""missing" 1>&6
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo $ac_n "checking for working automake""... $ac_c" 1>&6
-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.
-if (automake --version) < /dev/null > /dev/null 2>&1; then
- AUTOMAKE=automake
- echo "$ac_t""found" 1>&6
+ STRIP=$ac_ct_STRIP
else
- AUTOMAKE="$missing_dir/missing automake"
- echo "$ac_t""missing" 1>&6
+ STRIP="$ac_cv_prog_STRIP"
fi
-echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-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.
-if (autoheader --version) < /dev/null > /dev/null 2>&1; then
- AUTOHEADER=autoheader
- echo "$ac_t""found" 1>&6
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+depcc="$CC" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
else
- AUTOHEADER="$missing_dir/missing autoheader"
- echo "$ac_t""missing" 1>&6
+ am_cv_CC_dependencies_compiler_type=none
fi
-echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-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.
-if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
- MAKEINFO=makeinfo
- echo "$ac_t""found" 1>&6
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
else
- MAKEINFO="$missing_dir/missing makeinfo"
- echo "$ac_t""missing" 1>&6
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
fi
+
# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
@@ -1032,8 +3095,7 @@ no) enable_shared=no ;;
esac
else
enable_shared=yes
-fi
-
+fi;
# Check whether --enable-static or --disable-static was given.
if test "${enable_static+set}" = set; then
enableval="$enable_static"
@@ -1055,8 +3117,7 @@ no) enable_static=no ;;
esac
else
enable_static=yes
-fi
-
+fi;
# Check whether --enable-fast-install or --disable-fast-install was given.
if test "${enable_fast_install+set}" = set; then
enableval="$enable_fast_install"
@@ -1078,229 +3139,7 @@ no) enable_fast_install=no ;;
esac
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
+fi;
# Check whether --with-gnu-ld or --without-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
@@ -1308,13 +3147,12 @@ if test "${with_gnu_ld+set}" = set; then
test "$withval" = no || with_gnu_ld=yes
else
with_gnu_ld=no
-fi
-
+fi;
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:1318: checking for ld used by GCC" >&5
+ echo "$as_me:$LINENO: checking for ld used by GCC" >&5
+echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1343,14 +3181,14 @@ echo "configure:1318: 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:1348: checking for GNU ld" >&5
+ echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
else
- echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1351: checking for non-GNU ld" >&5
+ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
fi
-if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+if test "${lt_cv_path_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
@@ -1376,15 +3214,19 @@ fi
LD="$lt_cv_path_LD"
if test -n "$LD"; then
- echo "$ac_t""$LD" 1>&6
+ echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
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: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
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
@@ -1393,27 +3235,27 @@ else
lt_cv_prog_gnu_ld=no
fi
fi
-
-echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
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: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
+echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
lt_cv_ld_reload_flag='-r'
fi
-
-echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
+echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
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: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
+echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+if test "${lt_cv_path_NM+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$NM"; then
# Let the user override the test.
@@ -1446,33 +3288,24 @@ fi
fi
NM="$lt_cv_path_NM"
-echo "$ac_t""$NM" 1>&6
+echo "$as_me:$LINENO: result: $NM" >&5
+echo "${ECHO_T}$NM" >&6
-echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-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
- rm -f conftestdata
-if ln -s X conftestdata 2>/dev/null
-then
- rm -f conftestdata
- ac_cv_prog_LN_S="ln -s"
-else
- ac_cv_prog_LN_S=ln
-fi
-fi
-LN_S="$ac_cv_prog_LN_S"
-if test "$ac_cv_prog_LN_S" = "ln -s"; then
- echo "$ac_t""yes" 1>&6
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
fi
-echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-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
+echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5
+echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
@@ -1509,6 +3342,7 @@ cygwin* | mingw* |pw32*)
;;
darwin* | rhapsody*)
+ # this will be overwritten by pass_all, but leave it in just in case
lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
lt_cv_file_magic_cmd='/usr/bin/file -L'
case "$host_os" in
@@ -1519,9 +3353,10 @@ darwin* | rhapsody*)
lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
;;
esac
+ lt_cv_deplibs_check_method=pass_all
;;
-freebsd* )
+freebsd* | kfreebsd*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
@@ -1579,17 +3414,10 @@ irix5* | irix6*)
# This must be Linux ELF.
linux-gnu*)
- case $host_cpu in
- 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
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
- esac
- lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ lt_cv_deplibs_check_method=pass_all
;;
-netbsd*)
+netbsd* | knetbsd*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
else
@@ -1637,84 +3465,85 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
esac
fi
-
-echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
+echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
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: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:1653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- for ac_file in conftest.*; do
- case $ac_file in
- *.c) ;;
- *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
- esac
- done
-else
- { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
-fi
-rm -f conftest*
-fi
-echo "$ac_t""$ac_cv_objext" 1>&6
-OBJEXT=$ac_cv_objext
-ac_objext=$ac_cv_objext
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-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
- if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
- ac_cv_exeext=.exe
-else
- rm -f conftest*
- echo 'int main () { return 0; }' > conftest.$ac_ext
- ac_cv_exeext=
- 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 | *.ilk | *.pdb) ;;
- *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
- esac
- done
- else
- { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
- fi
- rm -f conftest*
- test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
-fi
-fi
+# find the maximum length of command line arguments
+echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
-EXEEXT=""
-test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
-echo "$ac_t""${ac_cv_exeext}" 1>&6
-ac_exeext=$EXEEXT
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
-if test $host != $build; then
- ac_tool_prefix=${host_alias}-
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+ esac
+
+fi
+
+if test -n "$lt_cv_sys_max_cmd_len" ; then
+ echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
else
- ac_tool_prefix=
+ echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
fi
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
# Only perform the check for file, if the check method requires it
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: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
+ echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
case $MAGIC_CMD in
/*)
@@ -1766,17 +3595,19 @@ fi
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
- echo "$ac_t""$MAGIC_CMD" 1>&6
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
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: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
+ echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
case $MAGIC_CMD in
/*)
@@ -1828,9 +3659,11 @@ fi
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
- echo "$ac_t""$MAGIC_CMD" 1>&6
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
else
@@ -1842,138 +3675,164 @@ fi
;;
esac
-# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+if test -n "$ac_tool_prefix"; then
+ # 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: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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="${ac_tool_prefix}ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-RANLIB="$ac_cv_prog_RANLIB"
+RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
+fi
if test -z "$ac_cv_prog_RANLIB"; then
-if test -n "$ac_tool_prefix"; then
+ ac_ct_RANLIB=$RANLIB
# 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: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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
fi
fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+ RANLIB=$ac_ct_RANLIB
else
- RANLIB=":"
-fi
+ RANLIB="$ac_cv_prog_RANLIB"
fi
-# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+if test -n "$ac_tool_prefix"; then
+ # 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: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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$STRIP"; then
ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-STRIP="$ac_cv_prog_STRIP"
+STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
- echo "$ac_t""$STRIP" 1>&6
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
+fi
if test -z "$ac_cv_prog_STRIP"; then
-if test -n "$ac_tool_prefix"; then
+ ac_ct_STRIP=$STRIP
# 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: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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
fi
fi
-STRIP="$ac_cv_prog_STRIP"
-if test -n "$STRIP"; then
- echo "$ac_t""$STRIP" 1>&6
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+ STRIP=$ac_ct_STRIP
else
- STRIP=":"
-fi
+ STRIP="$ac_cv_prog_STRIP"
fi
@@ -1989,20 +3848,19 @@ test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
if test "${enable_libtool_lock+set}" = set; then
enableval="$enable_libtool_lock"
- :
-fi
+fi;
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
# Check whether --with-pic or --without-pic was given.
if test "${with_pic+set}" = set; then
withval="$with_pic"
pic_mode="$withval"
else
pic_mode=default
-fi
-
+fi;
test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
@@ -2011,8 +3869,12 @@ 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 2015 "configure"' > conftest.$ac_ext
- if { (eval echo configure:2016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 3872 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
if test "$lt_cv_prog_gnu_ld" = yes; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
@@ -2045,7 +3907,11 @@ case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:2049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
case "`/usr/bin/file conftest.o`" in
*ELF-32*)
HPUX_IA64_MODE="32"
@@ -2058,51 +3924,124 @@ ia64-*-hpux*)
rm -rf conftest*
;;
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
- echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-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
+ echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
+
+
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
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
- cat > conftest.$ac_ext <<EOF
-#line 2080 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-int main() {
+int
+main ()
+{
-; return 0; }
-EOF
-if { (eval echo configure:2087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
lt_cv_cc_needs_belf=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- lt_cv_cc_needs_belf=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_cc_needs_belf=no
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
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
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
-
-echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS="$SAVE_CFLAGS"
@@ -2114,54 +4053,61 @@ esac
# Save cache, so that ltconfig can load it
-cat > confcache <<\EOF
+cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
#
-EOF
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
else
echo "not updating unwritable cache $cache_file"
fi
fi
rm -f confcache
-
# Actually configure libtool. ac_aux_dir is where install-sh is found.
AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
@@ -2171,15 +4117,26 @@ objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
-|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+|| { { echo "$as_me:$LINENO: error: libtool configure failed" >&5
+echo "$as_me: error: libtool configure failed" >&2;}
+ { (exit 1); exit 1; }; }
# Reload cache, that may have been modified by ltconfig
if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
else
- echo "creating cache $cache_file"
- > $cache_file
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
fi
@@ -2193,44 +4150,47 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
# clobbered by the next message.
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
-
+fi;
# Check whether --enable-targets or --disable-targets was given.
if test "${enable_targets+set}" = set; then
enableval="$enable_targets"
case "${enableval}" in
- yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
+ yes | "") { { echo "$as_me:$LINENO: error: enable-targets option must specify target names or 'all'" >&5
+echo "$as_me: error: enable-targets option must specify target names or 'all'" >&2;}
+ { (exit 1); exit 1; }; }
;;
no) enable_targets= ;;
*) enable_targets=$enableval ;;
esac
-fi
-# Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given.
+fi; # Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given.
if test "${enable_64_bit_bfd+set}" = set; then
enableval="$enable_64_bit_bfd"
case "${enableval}" in
yes) want64=true ;;
no) want64=false ;;
- *) { echo "configure: error: bad value ${enableval} for 64-bit-bfd option" 1>&2; exit 1; } ;;
+ *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for 64-bit-bfd option" >&5
+echo "$as_me: error: bad value ${enableval} for 64-bit-bfd option" >&2;}
+ { (exit 1); exit 1; }; } ;;
esac
else
want64=false
-fi
+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 ;;
@@ -2257,261 +4217,538 @@ if test "${with_sysroot+set}" = set; then
esac
else
-
+
use_sysroot=no
TARGET_SYSTEM_ROOT=
TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"\"'
-fi
+fi;
+
+
+
+GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+# Check whether --enable-werror or --disable-werror was given.
+if test "${enable_werror+set}" = set; then
+ enableval="$enable_werror"
+ case "${enableval}" in
+ yes | y) ERROR_ON_WARNING="yes" ;;
+ no | n) ERROR_ON_WARNING="no" ;;
+ *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-werror" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-werror" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+fi;
+
+# Enable -Werror by default when using gcc
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+ ERROR_ON_WARNING=yes
+fi
+
+NO_WERROR=
+if test "${ERROR_ON_WARNING}" = yes ; then
+ GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror"
+ NO_WERROR="-Wno-error"
+fi
+if test "${GCC}" = yes ; then
+ WARN_CFLAGS="${GCC_WARN_CFLAGS}"
+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
enableval="$enable_build_warnings"
case "${enableval}" in
- yes) ;;
- no) build_warnings="-w";;
+ yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";;
+ no) if test "${GCC}" = yes ; then
+ WARN_CFLAGS="-w"
+ fi;;
,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
- build_warnings="${build_warnings} ${t}";;
+ WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";;
*,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
- build_warnings="${t} ${build_warnings}";;
- *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+ WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";;
+ *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;;
esac
-if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
- echo "Setting warning flags = $build_warnings" 6>&1
-fi
-fi
-WARN_CFLAGS=""
-if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
- WARN_CFLAGS="${build_warnings}"
+fi;
+
+if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then
+ echo "Setting warning flags = $WARN_CFLAGS" 6>&1
fi
+ ac_config_headers="$ac_config_headers config.h:config.in"
+
if test -z "$target" ; then
- { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: Unrecognized target system type; please check config.sub." >&5
+echo "$as_me: error: Unrecognized target system type; please check config.sub." >&2;}
+ { (exit 1); exit 1; }; }
fi
if test -z "$host" ; then
- { echo "configure: error: Unrecognized host system type; please check config.sub." 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: Unrecognized host system type; please check config.sub." >&5
+echo "$as_me: error: Unrecognized host system type; please check config.sub." >&2;}
+ { (exit 1); exit 1; }; }
fi
# host-specific stuff:
-# Extract the first word of "gcc", so it can be a program name with args.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # 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: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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+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: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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
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
+ if test $# != 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="$@"
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
fi
fi
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&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: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
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&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; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-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.
-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 2435 "configure"
-#include "confdefs.h"
-
-main(){return(0);}
-EOF
-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
- ac_cv_prog_cc_cross=no
- else
- ac_cv_prog_cc_cross=yes
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_prog_cc_works=no
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
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: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
+ test -n "$ac_ct_CC" && break
+done
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-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
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
#endif
-EOF
-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
-fi
-fi
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
-else
- GCC=
-fi
+int
+main ()
+{
-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: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
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_prog_cc_g=yes
else
- ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_prog_cc_g=no
fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
+ CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
@@ -2525,6 +4762,269 @@ else
CFLAGS=
fi
fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -2533,215 +5033,480 @@ fi
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
# ./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:2542: checking for a BSD compatible install" >&5
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if test -f $ac_dir/$ac_prog; then
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
fi
fi
done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
+ done
+ ;;
+esac
+done
+
fi
if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
+ INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. We don't cache a
# path for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the path is relative.
- INSTALL="$ac_install_sh"
+ INSTALL=$ac_install_sh
fi
fi
-echo "$ac_t""$INSTALL" 1>&6
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-ALL_LINGUAS="fr sv tr es da"
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2597: checking how to run the C preprocessor" >&5
+ALL_LINGUAS="fr sv tr es da vi zh_CN"
+if test -n "$ac_tool_prefix"; then
+ # 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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ RANLIB=$ac_ct_RANLIB
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#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: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
- :
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#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: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
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
:
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -nologo -E"
- cat > conftest.$ac_ext <<EOF
-#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: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
- :
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
+ ac_cpp_err=yes
fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
+
+ done
+ ac_cv_prog_CPP=$CPP
+
fi
- CPP="$ac_cv_prog_CPP"
+ CPP=$ac_cv_prog_CPP
else
- ac_cv_prog_CPP="$CPP"
+ ac_cv_prog_CPP=$CPP
fi
-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: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
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
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_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-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
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2712 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (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*
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_header_stdc=yes
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_stdc=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
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 2737 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <string.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
+ $EGREP "memchr" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
@@ -2750,16 +5515,19 @@ 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 2755 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdlib.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
+ $EGREP "free" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
@@ -2768,269 +5536,530 @@ fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
+ if test "$cross_compiling" = yes; then
:
else
- cat > conftest.$ac_ext <<EOF
-#line 2776 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
-EOF
-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
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
:
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
fi
-rm -fr conftest*
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define STDC_HEADERS 1
-EOF
+_ACEOF
fi
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-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 2816 "configure"
-#include "confdefs.h"
-
-int main() {
-
-/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this. */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this. */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in an arm
- of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
-}
+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-; return 0; }
-EOF
-if { (eval echo configure:2865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset x;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *ccp;
+ char **p;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ ccp = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++ccp;
+ p = (char**) ccp;
+ ccp = (char const *const *) p;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ }
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_const=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_c_const=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_const=no
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-
-echo "$ac_t""$ac_cv_c_const" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
if test $ac_cv_c_const = no; then
- cat >> confdefs.h <<\EOF
-#define const
-EOF
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
fi
-echo $ac_n "checking for inline""... $ac_c" 1>&6
-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
+echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
- cat > conftest.$ac_ext <<EOF
-#line 2893 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
-int main() {
-} $ac_kw foo() {
-; return 0; }
-EOF
-if { (eval echo configure:2900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_inline=$ac_kw; break
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
fi
+echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
-echo "$ac_t""$ac_cv_c_inline" 1>&6
-case "$ac_cv_c_inline" in
+
+case $ac_cv_c_inline in
inline | yes) ;;
- no) cat >> confdefs.h <<\EOF
-#define inline
-EOF
- ;;
- *) cat >> confdefs.h <<EOF
-#define inline $ac_cv_c_inline
-EOF
- ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
esac
-echo $ac_n "checking for off_t""... $ac_c" 1>&6
-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
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+echo "$as_me:$LINENO: checking for off_t" >&5
+echo $ECHO_N "checking for off_t... $ECHO_C" >&6
+if test "${ac_cv_type_off_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2931 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((off_t *) 0)
+ return 0;
+if (sizeof (off_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_type_off_t=yes
else
- rm -rf conftest*
- ac_cv_type_off_t=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_off_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$ac_t""$ac_cv_type_off_t" 1>&6
-if test $ac_cv_type_off_t = no; then
- cat >> confdefs.h <<\EOF
+echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+echo "${ECHO_T}$ac_cv_type_off_t" >&6
+if test $ac_cv_type_off_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
#define off_t long
-EOF
+_ACEOF
fi
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-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
+echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6
+if test "${ac_cv_type_size_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2964 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((size_t *) 0)
+ return 0;
+if (sizeof (size_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_type_size_t=yes
else
- rm -rf conftest*
- ac_cv_type_size_t=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_size_t=no
fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&6
-if test $ac_cv_type_size_t = no; then
- cat >> confdefs.h <<\EOF
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6
+if test $ac_cv_type_size_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
#define size_t unsigned
-EOF
+_ACEOF
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: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 2999 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking for working alloca.h" >&5
+echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6
+if test "${ac_cv_working_alloca_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <alloca.h>
-int main() {
-char *p = alloca(2 * sizeof(int));
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_alloca_h=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
-if test $ac_cv_header_alloca_h = yes; then
- cat >> confdefs.h <<\EOF
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_working_alloca_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_working_alloca_h=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
+echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
+if test $ac_cv_working_alloca_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_ALLOCA_H 1
-EOF
+_ACEOF
fi
-echo $ac_n "checking for alloca""... $ac_c" 1>&6
-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
+echo "$as_me:$LINENO: checking for alloca" >&5
+echo $ECHO_N "checking for alloca... $ECHO_C" >&6
+if test "${ac_cv_func_alloca_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 3032 "configure"
-#include "confdefs.h"
-
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#ifdef __GNUC__
# define alloca __builtin_alloca
#else
@@ -3052,137 +6081,217 @@ char *alloca ();
# endif
#endif
-int main() {
-char *p = (char *) alloca(1);
-; return 0; }
-EOF
-if { (eval echo configure:3060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+int
+main ()
+{
+char *p = (char *) alloca (1);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_func_alloca_works=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_func_alloca_works=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_alloca_works=no
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
+echo "${ECHO_T}$ac_cv_func_alloca_works" >&6
-echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
if test $ac_cv_func_alloca_works = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_ALLOCA 1
-EOF
-fi
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALLOCA 1
+_ACEOF
-if test $ac_cv_func_alloca_works = no; then
+else
# The SVR3 libPW and SVR4 libucb both contain incompatible functions
- # that cause trouble. Some versions do not even contain alloca or
- # contain a buggy version. If you still want to use their alloca,
- # use ar to extract alloca.o from them instead of compiling alloca.c.
- ALLOCA=alloca.${ac_objext}
- cat >> confdefs.h <<\EOF
+# that cause trouble. Some versions do not even contain alloca or
+# contain a buggy version. If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+ALLOCA=alloca.$ac_objext
+
+cat >>confdefs.h <<\_ACEOF
#define C_ALLOCA 1
-EOF
+_ACEOF
-echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-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
+echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
+echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
+if test "${ac_cv_os_cray+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 3097 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#if defined(CRAY) && ! defined(CRAY2)
webecray
#else
wenotbecray
#endif
-EOF
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "webecray" >/dev/null 2>&1; then
- rm -rf conftest*
+ $EGREP "webecray" >/dev/null 2>&1; then
ac_cv_os_cray=yes
else
- rm -rf conftest*
ac_cv_os_cray=no
fi
rm -f conftest*
fi
-
-echo "$ac_t""$ac_cv_os_cray" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
+echo "${ECHO_T}$ac_cv_os_cray" >&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: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 3127 "configure"
-#include "confdefs.h"
+ for ac_func in _getb67 GETB67 getb67; do
+ as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.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 $ac_func();
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
-int main() {
+#undef $ac_func
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<EOF
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+
+cat >>confdefs.h <<_ACEOF
#define CRAY_STACKSEG_END $ac_func
-EOF
+_ACEOF
- break
-else
- echo "$ac_t""no" 1>&6
+ break
fi
-done
+ done
fi
-echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-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
+echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
+if test "${ac_cv_c_stack_direction+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
ac_cv_c_stack_direction=0
else
- cat > conftest.$ac_ext <<EOF
-#line 3185 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+int
find_stack_direction ()
{
static char *addr = 0;
@@ -3195,138 +6304,316 @@ find_stack_direction ()
else
return (&dummy > addr) ? 1 : -1;
}
+
+int
main ()
{
- exit (find_stack_direction() < 0);
+ exit (find_stack_direction () < 0);
}
-EOF
-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
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_stack_direction=1
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_c_stack_direction=-1
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_stack_direction=-1
fi
-rm -fr conftest*
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
+echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
-echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
#define STACK_DIRECTION $ac_cv_c_stack_direction
-EOF
+_ACEOF
+
fi
-for ac_hdr in unistd.h
+
+
+for ac_header in 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: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 3234 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (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*
- eval "ac_cv_header_$ac_safe=yes"
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ ac_cpp_err=yes
fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
done
+
for ac_func in getpagesize
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-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 3273 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.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 $ac_func();
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
-int main() {
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
-echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-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
+echo "$as_me:$LINENO: checking for working mmap" >&5
+echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
+if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
ac_cv_func_mmap_fixed_mapped=no
else
- cat > conftest.$ac_ext <<EOF
-#line 3329 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+/* malloc might have been renamed as rpl_malloc. */
+#undef malloc
/* Thanks to Mike Haertel and Jim Avera for this test.
Here is a matrix of mmap possibilities:
@@ -3340,34 +6627,34 @@ else
back from the file, nor mmap's back from the file at a different
address. (There have been systems where private was not correctly
implemented like the infamous i386 svr4.0, and systems where the
- VM page cache was not coherent with the filesystem buffer cache
+ VM page cache was not coherent with the file system buffer cache
like early versions of FreeBSD and possibly contemporary NetBSD.)
For shared mappings, we should conversely verify that changes get
- propogated back to all the places they're supposed to be.
+ propagated back to all the places they're supposed to be.
Grep wants private fixed already mapped.
The main things grep needs to know about mmap are:
* does it exist and is it safe to write into the mmap'd area
* how to use it (BSD variants) */
-#include <sys/types.h>
+
#include <fcntl.h>
#include <sys/mman.h>
-/* This mess was copied from the GNU getpagesize.h. */
-#ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-# include <unistd.h>
-# endif
+#if !STDC_HEADERS && !HAVE_STDLIB_H
+char *malloc ();
+#endif
+/* This mess was copied from the GNU getpagesize.h. */
+#if !HAVE_GETPAGESIZE
/* Assume that all systems that can run configure have sys/param.h. */
-# ifndef HAVE_SYS_PARAM_H
+# if !HAVE_SYS_PARAM_H
# define HAVE_SYS_PARAM_H 1
# endif
# ifdef _SC_PAGESIZE
# define getpagesize() sysconf(_SC_PAGESIZE)
# else /* no _SC_PAGESIZE */
-# ifdef HAVE_SYS_PARAM_H
+# if HAVE_SYS_PARAM_H
# include <sys/param.h>
# ifdef EXEC_PAGESIZE
# define getpagesize() EXEC_PAGESIZE
@@ -3394,469 +6681,910 @@ else
#endif /* no HAVE_GETPAGESIZE */
-#ifdef __cplusplus
-extern "C" { void *malloc(unsigned); }
-#else
-char *malloc();
-#endif
-
int
-main()
+main ()
{
- char *data, *data2, *data3;
- int i, pagesize;
- int fd;
-
- pagesize = getpagesize();
-
- /*
- * First, make a file with some known garbage in it.
- */
- data = malloc(pagesize);
- if (!data)
- exit(1);
- for (i = 0; i < pagesize; ++i)
- *(data + i) = rand();
- umask(0);
- fd = creat("conftestmmap", 0600);
- if (fd < 0)
- exit(1);
- if (write(fd, data, pagesize) != pagesize)
- exit(1);
- close(fd);
-
- /*
- * Next, try to mmap the file at a fixed address which
- * already has something else allocated at it. If we can,
- * also make sure that we see the same garbage.
- */
- fd = open("conftestmmap", O_RDWR);
- if (fd < 0)
- exit(1);
- data2 = malloc(2 * pagesize);
- if (!data2)
- exit(1);
- data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
- if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_FIXED, fd, 0L))
- exit(1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data2 + i))
- exit(1);
-
- /*
- * Finally, make sure that changes to the mapped area
- * do not percolate back to the file as seen by read().
- * (This is a bug on some variants of i386 svr4.0.)
- */
- for (i = 0; i < pagesize; ++i)
- *(data2 + i) = *(data2 + i) + 1;
- data3 = malloc(pagesize);
- if (!data3)
- exit(1);
- if (read(fd, data3, pagesize) != pagesize)
- exit(1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data3 + i))
- exit(1);
- close(fd);
- unlink("conftestmmap");
- exit(0);
+ char *data, *data2, *data3;
+ int i, pagesize;
+ int fd;
+
+ pagesize = getpagesize ();
+
+ /* First, make a file with some known garbage in it. */
+ data = (char *) malloc (pagesize);
+ if (!data)
+ exit (1);
+ for (i = 0; i < pagesize; ++i)
+ *(data + i) = rand ();
+ umask (0);
+ fd = creat ("conftest.mmap", 0600);
+ if (fd < 0)
+ exit (1);
+ if (write (fd, data, pagesize) != pagesize)
+ exit (1);
+ close (fd);
+
+ /* Next, try to mmap the file at a fixed address which already has
+ something else allocated at it. If we can, also make sure that
+ we see the same garbage. */
+ fd = open ("conftest.mmap", O_RDWR);
+ if (fd < 0)
+ exit (1);
+ data2 = (char *) malloc (2 * pagesize);
+ if (!data2)
+ exit (1);
+ data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1);
+ if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_FIXED, fd, 0L))
+ exit (1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data2 + i))
+ exit (1);
+
+ /* Finally, make sure that changes to the mapped area do not
+ percolate back to the file as seen by read(). (This is a bug on
+ some variants of i386 svr4.0.) */
+ for (i = 0; i < pagesize; ++i)
+ *(data2 + i) = *(data2 + i) + 1;
+ data3 = (char *) malloc (pagesize);
+ if (!data3)
+ exit (1);
+ if (read (fd, data3, pagesize) != pagesize)
+ exit (1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data3 + i))
+ exit (1);
+ close (fd);
+ exit (0);
}
-
-EOF
-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
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_func_mmap_fixed_mapped=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_mmap_fixed_mapped=no
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_mmap_fixed_mapped=no
fi
-rm -fr conftest*
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
-
-echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
+echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
if test $ac_cv_func_mmap_fixed_mapped = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_MMAP 1
-EOF
+_ACEOF
fi
+rm -f conftest.mmap
+
+
+
+
+
-
- for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \
+
+
+
+
+
+for ac_header in argz.h limits.h locale.h nl_types.h malloc.h string.h \
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: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 3502 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (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*
- eval "ac_cv_header_$ac_safe=yes"
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ ac_cpp_err=yes
fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
done
- for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
+
+
+
+
+
+
+
+
+
+
+for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
__argz_count __argz_stringify __argz_next
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-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 3542 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.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 $ac_func();
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
-int main() {
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
if test "${ac_cv_func_stpcpy+set}" != "set"; then
- for ac_func in stpcpy
+
+for ac_func in stpcpy
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-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 3599 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.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 $ac_func();
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
-int main() {
+#undef $ac_func
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
if test "${ac_cv_func_stpcpy}" = "yes"; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_STPCPY 1
-EOF
+_ACEOF
fi
if test $ac_cv_header_locale_h = yes; then
- echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-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 3661 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5
+echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6
+if test "${am_cv_val_LC_MESSAGES+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <locale.h>
-int main() {
+int
+main ()
+{
return LC_MESSAGES
-; return 0; }
-EOF
-if { (eval echo configure:3668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
am_cv_val_LC_MESSAGES=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- am_cv_val_LC_MESSAGES=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+am_cv_val_LC_MESSAGES=no
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-
-echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
+echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5
+echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6
if test $am_cv_val_LC_MESSAGES = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_LC_MESSAGES 1
-EOF
+_ACEOF
fi
fi
- echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3689: checking whether NLS is requested" >&5
+ echo "$as_me:$LINENO: checking whether NLS is requested" >&5
+echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
USE_NLS=$enableval
else
USE_NLS=yes
-fi
+fi;
+ echo "$as_me:$LINENO: result: $USE_NLS" >&5
+echo "${ECHO_T}$USE_NLS" >&6
- echo "$ac_t""$USE_NLS" 1>&6
-
USE_INCLUDED_LIBINTL=no
if test "$USE_NLS" = "yes"; then
- cat >> confdefs.h <<\EOF
-#define ENABLE_NLS 1
-EOF
+ echo "$as_me:$LINENO: checking whether included gettext is requested" >&5
+echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6
- echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3709: checking whether included gettext is requested" >&5
- # Check whether --with-included-gettext or --without-included-gettext was given.
+# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
nls_cv_force_use_gnu_gettext=$withval
else
nls_cv_force_use_gnu_gettext=no
-fi
-
- echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
+fi;
+ echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5
+echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
nls_cv_header_intl=
nls_cv_header_libgt=
- CATOBJEXT=NONE
-
- ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-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 3733 "configure"
-#include "confdefs.h"
+ CATOBJEXT=
+
+ if test "${ac_cv_header_libintl_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for libintl.h" >&5
+echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6
+if test "${ac_cv_header_libintl_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5
+echo "${ECHO_T}$ac_cv_header_libintl_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking libintl.h usability" >&5
+echo $ECHO_N "checking libintl.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
#include <libintl.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (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*
- eval "ac_cv_header_$ac_safe=yes"
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking libintl.h presence" >&5
+echo $ECHO_N "checking libintl.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <libintl.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ ac_cpp_err=yes
fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
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: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
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for libintl.h" >&5
+echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6
+if test "${ac_cv_header_libintl_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 3760 "configure"
-#include "confdefs.h"
+ ac_cv_header_libintl_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5
+echo "${ECHO_T}$ac_cv_header_libintl_h" >&6
+
+fi
+if test $ac_cv_header_libintl_h = yes; then
+ echo "$as_me:$LINENO: checking for gettext in libc" >&5
+echo $ECHO_N "checking for gettext in libc... $ECHO_C" >&6
+if test "${gt_cv_func_gettext_libc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <libintl.h>
-int main() {
+int
+main ()
+{
return (int) gettext ("")
-; return 0; }
-EOF
-if { (eval echo configure:3767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
gt_cv_func_gettext_libc=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- gt_cv_func_gettext_libc=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gt_cv_func_gettext_libc=no
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-
-echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
+echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libc" >&5
+echo "${ECHO_T}$gt_cv_func_gettext_libc" >&6
if test "$gt_cv_func_gettext_libc" != "yes"; then
- echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-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
+ echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5
+echo $ECHO_N "checking for bindtextdomain in -lintl... $ECHO_C" >&6
+if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-lintl $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3791 "configure"
-#include "confdefs.h"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char bindtextdomain();
-
-int main() {
-bindtextdomain()
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-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: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 3823 "configure"
-#include "confdefs.h"
+ builtin and then its argument prototype would still apply. */
+char bindtextdomain ();
+int
+main ()
+{
+bindtextdomain ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_intl_bindtextdomain=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_intl_bindtextdomain=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6
+if test $ac_cv_lib_intl_bindtextdomain = yes; then
+ echo "$as_me:$LINENO: checking for gettext in libintl" >&5
+echo $ECHO_N "checking for gettext in libintl... $ECHO_C" >&6
+if test "${gt_cv_func_gettext_libintl+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-int main() {
+int
+main ()
+{
return (int) gettext ("")
-; return 0; }
-EOF
-if { (eval echo configure:3830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
gt_cv_func_gettext_libintl=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- gt_cv_func_gettext_libintl=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gt_cv_func_gettext_libintl=no
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-
-echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6
-else
- echo "$ac_t""no" 1>&6
+echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libintl" >&5
+echo "${ECHO_T}$gt_cv_func_gettext_libintl" >&6
fi
fi
if test "$gt_cv_func_gettext_libc" = "yes" \
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_GETTEXT 1
-EOF
+_ACEOF
# 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: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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_MSGFMT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
case "$MSGFMT" in
/*)
@@ -3880,108 +7608,161 @@ esac
fi
MSGFMT="$ac_cv_path_MSGFMT"
if test -n "$MSGFMT"; then
- echo "$ac_t""$MSGFMT" 1>&6
+ echo "$as_me:$LINENO: result: $MSGFMT" >&5
+echo "${ECHO_T}$MSGFMT" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
if test "$MSGFMT" != "no"; then
- for ac_func in dcgettext
+
+for ac_func in dcgettext
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-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 3897 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.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 $ac_func();
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
-int main() {
+#undef $ac_func
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
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: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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GMSGFMT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$GMSGFMT" in
- /*)
+ case $GMSGFMT in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
- ;;
*)
- 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_path_GMSGFMT="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
;;
esac
fi
-GMSGFMT="$ac_cv_path_GMSGFMT"
+GMSGFMT=$ac_cv_path_GMSGFMT
+
if test -n "$GMSGFMT"; then
- echo "$ac_t""$GMSGFMT" 1>&6
+ echo "$as_me:$LINENO: result: $GMSGFMT" >&5
+echo "${ECHO_T}$GMSGFMT" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
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: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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_XGETTEXT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
case "$XGETTEXT" in
/*)
@@ -4005,44 +7786,75 @@ esac
fi
XGETTEXT="$ac_cv_path_XGETTEXT"
if test -n "$XGETTEXT"; then
- echo "$ac_t""$XGETTEXT" 1>&6
+ echo "$as_me:$LINENO: result: $XGETTEXT" >&5
+echo "${ECHO_T}$XGETTEXT" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- cat > conftest.$ac_ext <<EOF
-#line 4015 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-int main() {
+int
+main ()
+{
extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
-; return 0; }
-EOF
-if { (eval echo configure:4023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
CATOBJEXT=.gmo
DATADIRNAME=share
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CATOBJEXT=.mo
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+CATOBJEXT=.mo
DATADIRNAME=lib
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
INSTOBJEXT=.mo
fi
fi
-
-else
- echo "$ac_t""no" 1>&6
+
fi
-
- if test "$CATOBJEXT" = "NONE"; then
- nls_cv_use_gnu_gettext=yes
+
+
+ if test x"$CATOBJEXT" = x && test -d $srcdir/../intl; then
+ # Neither gettext nor catgets in included in the C library.
+ # Fall back on GNU gettext library (assuming it is present).
+ nls_cv_use_gnu_gettext=yes
fi
fi
@@ -4050,10 +7862,10 @@ fi
INTLOBJS="\$(GETTOBJS)"
# 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: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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_MSGFMT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
case "$MSGFMT" in
/*)
@@ -4077,53 +7889,59 @@ esac
fi
MSGFMT="$ac_cv_path_MSGFMT"
if test -n "$MSGFMT"; then
- echo "$ac_t""$MSGFMT" 1>&6
+ echo "$as_me:$LINENO: result: $MSGFMT" >&5
+echo "${ECHO_T}$MSGFMT" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
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: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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GMSGFMT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$GMSGFMT" in
- /*)
+ case $GMSGFMT in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
- ;;
*)
- 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_path_GMSGFMT="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
;;
esac
fi
-GMSGFMT="$ac_cv_path_GMSGFMT"
+GMSGFMT=$ac_cv_path_GMSGFMT
+
if test -n "$GMSGFMT"; then
- echo "$ac_t""$GMSGFMT" 1>&6
+ echo "$as_me:$LINENO: result: $GMSGFMT" >&5
+echo "${ECHO_T}$GMSGFMT" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
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: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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_XGETTEXT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
case "$XGETTEXT" in
/*)
@@ -4147,12 +7965,14 @@ esac
fi
XGETTEXT="$ac_cv_path_XGETTEXT"
if test -n "$XGETTEXT"; then
- echo "$ac_t""$XGETTEXT" 1>&6
+ echo "$as_me:$LINENO: result: $XGETTEXT" >&5
+echo "${ECHO_T}$XGETTEXT" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
+
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.gmo
INSTOBJEXT=.mo
@@ -4168,7 +7988,8 @@ fi
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
: ;
else
- echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6
+ echo "$as_me:$LINENO: result: found xgettext programs is not GNU xgettext; ignore it" >&5
+echo "${ECHO_T}found xgettext programs is not GNU xgettext; ignore it" >&6
XGETTEXT=":"
fi
fi
@@ -4193,25 +8014,32 @@ fi
POFILES="$POFILES $lang.po"
done
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ if test "x$CATOBJEXT" != "x"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define ENABLE_NLS 1
+_ACEOF
+
+ fi
+
if test "x$CATOBJEXT" != "x"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
else
- echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:4215: checking for catalogs to be installed" >&5
+ echo "$as_me:$LINENO: checking for catalogs to be installed" >&5
+echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
@@ -4219,7 +8047,8 @@ echo "configure:4215: checking for catalogs to be installed" >&5
esac
done
LINGUAS=$NEW_LINGUAS
- echo "$ac_t""$LINGUAS" 1>&6
+ echo "$as_me:$LINENO: result: $LINGUAS" >&5
+echo "${ECHO_T}$LINGUAS" >&6
fi
if test -n "$LINGUAS"; then
@@ -4233,45 +8062,155 @@ echo "configure:4215: checking for catalogs to be installed" >&5
INCLUDE_LOCALE_H="\
/* The system does not provide the header <locale.h>. Take care yourself. */"
fi
-
+
if test -f $srcdir/po2tbl.sed.in; then
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: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 4248 "configure"
-#include "confdefs.h"
+ if test "${ac_cv_header_linux_version_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for linux/version.h" >&5
+echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6
+if test "${ac_cv_header_linux_version_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5
+echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking linux/version.h usability" >&5
+echo $ECHO_N "checking linux/version.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
#include <linux/version.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (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*
- eval "ac_cv_header_$ac_safe=yes"
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking linux/version.h presence" >&5
+echo $ECHO_N "checking linux/version.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <linux/version.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ ac_cpp_err=yes
fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: linux/version.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: linux/version.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: linux/version.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: linux/version.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: linux/version.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: linux/version.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: linux/version.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: linux/version.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: linux/version.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: linux/version.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for linux/version.h" >&5
+echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6
+if test "${ac_cv_header_linux_version_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_linux_version_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5
+echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+if test $ac_cv_header_linux_version_h = yes; then
msgformat=linux
else
- echo "$ac_t""no" 1>&6
-msgformat=xopen
+ msgformat=xopen
fi
+
sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
fi
sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
@@ -4285,14 +8224,14 @@ fi
GT_NO=
GT_YES="#YES#"
fi
-
-
+
+
MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
-
+
l=
-
+
if test -f $srcdir/po/POTFILES.in; then
test -d po || mkdir po
@@ -4309,266 +8248,341 @@ fi
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES
fi
-
-echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-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
- if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
- ac_cv_exeext=.exe
-else
- rm -f conftest*
- echo 'int main () { return 0; }' > conftest.$ac_ext
- ac_cv_exeext=
- 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 | *.ilk | *.pdb) ;;
- *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
- esac
- done
- else
- { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
- fi
- rm -f conftest*
- test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
-fi
-fi
-
-EXEEXT=""
-test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
-echo "$ac_t""${ac_cv_exeext}" 1>&6
-ac_exeext=$EXEEXT
-
for ac_prog in 'bison -y' byacc
do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
+ # 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: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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_YACC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$YACC"; then
ac_cv_prog_YACC="$YACC" # 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_YACC="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_YACC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-YACC="$ac_cv_prog_YACC"
+YACC=$ac_cv_prog_YACC
if test -n "$YACC"; then
- echo "$ac_t""$YACC" 1>&6
+ echo "$as_me:$LINENO: result: $YACC" >&5
+echo "${ECHO_T}$YACC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-test -n "$YACC" && break
+ test -n "$YACC" && break
done
test -n "$YACC" || YACC="yacc"
-missing_dir=`cd $ac_aux_dir && pwd`
for ac_prog in flex lex
do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
+ # 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: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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_LEX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$LEX"; then
ac_cv_prog_LEX="$LEX" # 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_LEX="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-LEX="$ac_cv_prog_LEX"
-if test -n "$LEX"; then
- echo "$ac_t""$LEX" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-test -n "$LEX" && break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_LEX="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
done
-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: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
- if test -n "$LEX"; then
- ac_cv_prog_LEX="$LEX" # 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_LEX="flex"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
fi
fi
-LEX="$ac_cv_prog_LEX"
+LEX=$ac_cv_prog_LEX
if test -n "$LEX"; then
- echo "$ac_t""$LEX" 1>&6
+ echo "$as_me:$LINENO: result: $LEX" >&5
+echo "${ECHO_T}$LEX" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+ test -n "$LEX" && break
+done
+test -n "$LEX" || LEX=":"
+
if test -z "$LEXLIB"
then
- case "$LEX" in
- flex*) ac_lib=fl ;;
- *) ac_lib=l ;;
- esac
- echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-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
-else
- ac_save_LIBS="$LIBS"
-LIBS="-l$ac_lib $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4465 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5
+echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6
+if test "${ac_cv_lib_fl_yywrap+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lfl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char yywrap();
-
-int main() {
-yywrap()
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- LEXLIB="-l$ac_lib"
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
+ builtin and then its argument prototype would still apply. */
+char yywrap ();
+int
+main ()
+{
+yywrap ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_fl_yywrap=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_fl_yywrap=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5
+echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6
+if test $ac_cv_lib_fl_yywrap = yes; then
+ LEXLIB="-lfl"
+else
+ echo "$as_me:$LINENO: checking for yywrap in -ll" >&5
+echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6
+if test "${ac_cv_lib_l_yywrap+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ll $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-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
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char yywrap ();
+int
+main ()
+{
+yywrap ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_l_yywrap=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_l_yywrap=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5
+echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6
+if test $ac_cv_lib_l_yywrap = yes; then
+ LEXLIB="-ll"
+fi
+
+fi
+
+fi
+
+if test "x$LEX" != "x:"; then
+ echo "$as_me:$LINENO: checking lex output file root" >&5
+echo $ECHO_N "checking lex output file root... $ECHO_C" >&6
+if test "${ac_cv_prog_lex_root+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
# The minimal lex program is just a single line: %%. But some broken lexes
# (Solaris, I think it was) want two %% lines, so accommodate them.
-echo '%%
-%%' | $LEX
+cat >conftest.l <<_ACEOF
+%%
+%%
+_ACEOF
+{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5
+ (eval $LEX conftest.l) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
if test -f lex.yy.c; then
ac_cv_prog_lex_root=lex.yy
elif test -f lexyy.c; then
ac_cv_prog_lex_root=lexyy
else
- { echo "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
+echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
+ { (exit 1); exit 1; }; }
fi
fi
-
-echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
+echo "${ECHO_T}$ac_cv_prog_lex_root" >&6
+rm -f conftest.l
LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
-echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-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
+echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
+echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6
+if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
# POSIX says lex can declare yytext either as a pointer or an array; the
# default is implementation-dependent. Figure out which it is, since
# not all implementations provide the %pointer and %array declarations.
ac_cv_prog_lex_yytext_pointer=no
echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
-ac_save_LIBS="$LIBS"
+ac_save_LIBS=$LIBS
LIBS="$LIBS $LEXLIB"
-cat > conftest.$ac_ext <<EOF
-#line 4532 "configure"
-#include "confdefs.h"
+cat >conftest.$ac_ext <<_ACEOF
`cat $LEX_OUTPUT_ROOT.c`
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:4539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_prog_lex_yytext_pointer=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_save_LIBS
rm -f "${LEX_OUTPUT_ROOT}.c"
fi
-
-echo "$ac_t""$ac_cv_prog_lex_yytext_pointer" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
+echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6
if test $ac_cv_prog_lex_yytext_pointer = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define YYTEXT_POINTER 1
-EOF
+_ACEOF
fi
+fi
+if test "$LEX" = :; then
+ LEX=${am_missing_run}flex
+fi
-echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:4562: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
USE_MAINTAINER_MODE=$enableval
else
USE_MAINTAINER_MODE=no
-fi
+fi;
+ echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
- echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
-
if test $USE_MAINTAINER_MODE = yes; then
MAINTAINER_MODE_TRUE=
@@ -4577,8 +8591,9 @@ else
MAINTAINER_MODE_TRUE='#'
MAINTAINER_MODE_FALSE=
fi
+
MAINT=$MAINTAINER_MODE_TRUE
-
+
. ${srcdir}/configure.host
@@ -4588,504 +8603,1080 @@ fi
-for ac_hdr in string.h strings.h stdlib.h unistd.h
+
+
+
+
+
+for ac_header in string.h strings.h stdlib.h unistd.h elf-hints.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-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 4601 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (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*
- eval "ac_cv_header_$ac_safe=yes"
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ ac_cpp_err=yes
fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
fi
+
done
-for ac_func in sbrk realpath
+
+
+
+for ac_func in sbrk realpath glob
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-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 4640 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.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 $ac_func();
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
-int main() {
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
+
+
+
+
+
ac_header_dirent=no
-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: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 4697 "configure"
-#include "confdefs.h"
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
+echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/types.h>
#include <$ac_hdr>
-int main() {
-DIR *dirp = 0;
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_dirent_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
- ac_header_dirent=$ac_hdr; break
-else
- echo "$ac_t""no" 1>&6
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+ac_header_dirent=$ac_hdr; break
fi
+
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: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
-else
- ac_save_LIBS="$LIBS"
-LIBS="-ldir $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4738 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
+if test "${ac_cv_search_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_opendir=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char opendir();
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_opendir" = no; then
+ for ac_lib in dir; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-int main() {
-opendir()
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="-l$ac_lib"
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+LIBS=$ac_func_search_save_LIBS
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- LIBS="$LIBS -ldir"
-else
- echo "$ac_t""no" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6
+if test "$ac_cv_search_opendir" != no; then
+ test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
+
fi
else
-echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-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
+ echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
+if test "${ac_cv_search_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-lx $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4779 "configure"
-#include "confdefs.h"
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_opendir=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char opendir();
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_opendir" = no; then
+ for ac_lib in x; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-int main() {
-opendir()
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="-l$ac_lib"
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+LIBS=$ac_func_search_save_LIBS
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- LIBS="$LIBS -lx"
-else
- echo "$ac_t""no" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6
+if test "$ac_cv_search_opendir" != no; then
+ test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
+
fi
fi
+echo "$as_me:$LINENO: checking for a known getopt prototype in unistd.h" >&5
+echo $ECHO_N "checking for a known getopt prototype in unistd.h... $ECHO_C" >&6
+if test "${ld_cv_decl_getopt_unistd_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <unistd.h>
+int
+main ()
+{
+extern int getopt (int, char *const*, const char *);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ld_cv_decl_getopt_unistd_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ld_cv_decl_getopt_unistd_h=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ld_cv_decl_getopt_unistd_h" >&5
+echo "${ECHO_T}$ld_cv_decl_getopt_unistd_h" >&6
+if test $ld_cv_decl_getopt_unistd_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DECL_GETOPT 1
+_ACEOF
+
+fi
+
case "${host}" in
*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define USE_BINARY_FOPEN 1
-EOF
+_ACEOF
;;
esac
-echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-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 4828 "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+echo "$as_me:$LINENO: checking whether strstr is declared" >&5
+echo $ECHO_N "checking whether strstr is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_strstr+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef strstr
+ char *p = (char *) strstr;
#endif
-int main() {
-char *(*pfn) = (char *(*)) strstr
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- bfd_cv_decl_needed_strstr=yes
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$bfd_cv_decl_needed_strstr" 1>&6
-if test $bfd_cv_decl_needed_strstr = yes; then
- cat >> confdefs.h <<\EOF
-#define NEED_DECLARATION_STRSTR 1
-EOF
-
-fi
-
-echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-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 4875 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl_strstr=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_strstr=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_strstr" >&5
+echo "${ECHO_T}$ac_cv_have_decl_strstr" >&6
+if test $ac_cv_have_decl_strstr = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRSTR 1
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRSTR 0
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking whether free is declared" >&5
+echo $ECHO_N "checking whether free is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_free+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef free
+ char *p = (char *) free;
#endif
-int main() {
-char *(*pfn) = (char *(*)) free
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- bfd_cv_decl_needed_free=yes
-fi
-rm -f conftest*
-fi
-echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6
-if test $bfd_cv_decl_needed_free = yes; then
- cat >> confdefs.h <<\EOF
-#define NEED_DECLARATION_FREE 1
-EOF
-
-fi
-
-echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6
-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 4922 "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl_free=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_free=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_free" >&5
+echo "${ECHO_T}$ac_cv_have_decl_free" >&6
+if test $ac_cv_have_decl_free = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FREE 1
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FREE 0
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking whether sbrk is declared" >&5
+echo $ECHO_N "checking whether sbrk is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_sbrk+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef sbrk
+ char *p = (char *) sbrk;
#endif
-int main() {
-char *(*pfn) = (char *(*)) sbrk
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- bfd_cv_decl_needed_sbrk=yes
-fi
-rm -f conftest*
-fi
-echo "$ac_t""$bfd_cv_decl_needed_sbrk" 1>&6
-if test $bfd_cv_decl_needed_sbrk = yes; then
- cat >> confdefs.h <<\EOF
-#define NEED_DECLARATION_SBRK 1
-EOF
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl_sbrk=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_sbrk=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_sbrk" >&5
+echo "${ECHO_T}$ac_cv_have_decl_sbrk" >&6
+if test $ac_cv_have_decl_sbrk = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SBRK 1
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SBRK 0
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking whether getenv is declared" >&5
+echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_getenv+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef getenv
+ char *p = (char *) getenv;
+#endif
-fi
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl_getenv=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_getenv=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5
+echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6
+if test $ac_cv_have_decl_getenv = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETENV 1
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETENV 0
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking whether environ is declared" >&5
+echo $ECHO_N "checking whether environ is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_environ+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef environ
+ char *p = (char *) environ;
+#endif
-echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-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
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl_environ=yes
else
- cat > conftest.$ac_ext <<EOF
-#line 4969 "configure"
-#include "confdefs.h"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-int main() {
-char *(*pfn) = (char *(*)) getenv
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- bfd_cv_decl_needed_getenv=yes
+ac_cv_have_decl_environ=no
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_environ" >&5
+echo "${ECHO_T}$ac_cv_have_decl_environ" >&6
+if test $ac_cv_have_decl_environ = yes; then
-echo "$ac_t""$bfd_cv_decl_needed_getenv" 1>&6
-if test $bfd_cv_decl_needed_getenv = yes; then
- cat >> confdefs.h <<\EOF
-#define NEED_DECLARATION_GETENV 1
-EOF
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ENVIRON 1
+_ACEOF
-fi
-echo $ac_n "checking whether environ must be declared""... $ac_c" 1>&6
-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 5016 "configure"
-#include "confdefs.h"
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ENVIRON 0
+_ACEOF
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-int main() {
-char *(*pfn) = (char *(*)) environ
-; return 0; }
-EOF
-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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- bfd_cv_decl_needed_environ=yes
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$bfd_cv_decl_needed_environ" 1>&6
-if test $bfd_cv_decl_needed_environ = yes; then
- cat >> confdefs.h <<\EOF
-#define NEED_DECLARATION_ENVIRON 1
-EOF
fi
+
# When converting linker scripts into strings for use in emulation
# files, use astring.sed if the compiler supports ANSI string
# concatenation, or ostring.sed otherwise. This is to support the
# broken Microsoft MSVC compiler, which limits the length of string
# 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: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 5070 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking whether ANSI C string concatenation works" >&5
+echo $ECHO_N "checking whether ANSI C string concatenation works... $ECHO_C" >&6
+if test "${ld_cv_string_concatenation+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-int main() {
+int
+main ()
+{
char *a = "a" "a";
-; return 0; }
-EOF
-if { (eval echo configure:5077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ld_cv_string_concatenation=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ld_cv_string_concatenation=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ld_cv_string_concatenation=no
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$ac_t""$ld_cv_string_concatenation" 1>&6
+echo "$as_me:$LINENO: result: $ld_cv_string_concatenation" >&5
+echo "${ECHO_T}$ld_cv_string_concatenation" >&6
if test "$ld_cv_string_concatenation" = "yes"; then
STRINGIFY=astring.sed
else
@@ -5193,443 +9784,1491 @@ case "$target_vendor" in
hp) EXTRA_SHLIB_EXTENSION=".sl" ;;
*) EXTRA_SHLIB_EXTENSION= ;;
esac
+
+case "$target_os" in
+ lynxos) EXTRA_SHLIB_EXTENSION=".a" ;;
+esac
+
if test x${EXTRA_SHLIB_EXTENSION} != x ; then
- cat >> confdefs.h <<EOF
+
+cat >>confdefs.h <<_ACEOF
#define EXTRA_SHLIB_EXTENSION "$EXTRA_SHLIB_EXTENSION"
-EOF
+_ACEOF
fi
-trap '' 1 2 15
-cat > confcache <<\EOF
+
+
+
+
+ ac_config_files="$ac_config_files Makefile po/Makefile.in:po/Make-in"
+ ac_config_commands="$ac_config_commands default"
+cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
#
-EOF
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
else
echo "not updating unwritable cache $cache_file"
fi
fi
rm -f confcache
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
fi
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
DEFS=-DHAVE_CONFIG_H
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
+# configure, is in config.log if it exists.
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.13"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
done
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
-trap 'rm -fr `echo "Makefile po/Makefile.in:po/Make-in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@host@%$host%g
-s%@host_alias@%$host_alias%g
-s%@host_cpu@%$host_cpu%g
-s%@host_vendor@%$host_vendor%g
-s%@host_os@%$host_os%g
-s%@target@%$target%g
-s%@target_alias@%$target_alias%g
-s%@target_cpu@%$target_cpu%g
-s%@target_vendor@%$target_vendor%g
-s%@target_os@%$target_os%g
-s%@build@%$build%g
-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%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@PACKAGE@%$PACKAGE%g
-s%@VERSION@%$VERSION%g
-s%@ACLOCAL@%$ACLOCAL%g
-s%@AUTOCONF@%$AUTOCONF%g
-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
-s%@USE_NLS@%$USE_NLS%g
-s%@MSGFMT@%$MSGFMT%g
-s%@GMSGFMT@%$GMSGFMT%g
-s%@XGETTEXT@%$XGETTEXT%g
-s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
-s%@CATALOGS@%$CATALOGS%g
-s%@CATOBJEXT@%$CATOBJEXT%g
-s%@DATADIRNAME@%$DATADIRNAME%g
-s%@GMOFILES@%$GMOFILES%g
-s%@INSTOBJEXT@%$INSTOBJEXT%g
-s%@INTLDEPS@%$INTLDEPS%g
-s%@INTLLIBS@%$INTLLIBS%g
-s%@INTLOBJS@%$INTLOBJS%g
-s%@POFILES@%$POFILES%g
-s%@POSUB@%$POSUB%g
-s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g
-s%@GT_NO@%$GT_NO%g
-s%@GT_YES@%$GT_YES%g
-s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
-s%@l@%$l%g
-s%@YACC@%$YACC%g
-s%@LEX@%$LEX%g
-s%@LEXLIB@%$LEXLIB%g
-s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g
-s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
-s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
-s%@MAINT@%$MAINT%g
-s%@HDEFINES@%$HDEFINES%g
-s%@HOSTING_CRT0@%$HOSTING_CRT0%g
-s%@HOSTING_LIBS@%$HOSTING_LIBS%g
-s%@NATIVE_LIB_DIRS@%$NATIVE_LIB_DIRS%g
-s%@STRINGIFY@%$STRINGIFY%g
-s%@EMUL@%$EMUL%g
-/@TDIRS@/r $TDIRS
-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
-CEOF
-EOF
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ PATH_SEPARATOR=:
fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ as_ln_s='ln -s'
fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.59,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
-EOF
-cat >> $CONFIG_STATUS <<EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
-CONFIG_FILES=\${CONFIG_FILES-"Makefile po/Makefile.in:po/Make-in"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;;
+ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
esac
+done
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@target@,$target,;t t
+s,@target_cpu@,$target_cpu,;t t
+s,@target_vendor@,$target_vendor,;t t
+s,@target_os@,$target_os,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CYGPATH_W@,$CYGPATH_W,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@VERSION@,$VERSION,;t t
+s,@ACLOCAL@,$ACLOCAL,;t t
+s,@AUTOCONF@,$AUTOCONF,;t t
+s,@AUTOMAKE@,$AUTOMAKE,;t t
+s,@AUTOHEADER@,$AUTOHEADER,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@install_sh@,$install_sh,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@mkdir_p@,$mkdir_p,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@am__leading_dot@,$am__leading_dot,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@am__tar@,$am__tar,;t t
+s,@am__untar@,$am__untar,;t t
+s,@DEPDIR@,$DEPDIR,;t t
+s,@am__include@,$am__include,;t t
+s,@am__quote@,$am__quote,;t t
+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s,@CCDEPMODE@,$CCDEPMODE,;t t
+s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@LN_S@,$LN_S,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@LIBTOOL@,$LIBTOOL,;t t
+s,@use_sysroot@,$use_sysroot,;t t
+s,@TARGET_SYSTEM_ROOT@,$TARGET_SYSTEM_ROOT,;t t
+s,@TARGET_SYSTEM_ROOT_DEFINE@,$TARGET_SYSTEM_ROOT_DEFINE,;t t
+s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t
+s,@NO_WERROR@,$NO_WERROR,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@ALLOCA@,$ALLOCA,;t t
+s,@USE_NLS@,$USE_NLS,;t t
+s,@MSGFMT@,$MSGFMT,;t t
+s,@GMSGFMT@,$GMSGFMT,;t t
+s,@XGETTEXT@,$XGETTEXT,;t t
+s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t
+s,@CATALOGS@,$CATALOGS,;t t
+s,@CATOBJEXT@,$CATOBJEXT,;t t
+s,@DATADIRNAME@,$DATADIRNAME,;t t
+s,@GMOFILES@,$GMOFILES,;t t
+s,@INSTOBJEXT@,$INSTOBJEXT,;t t
+s,@INTLDEPS@,$INTLDEPS,;t t
+s,@INTLLIBS@,$INTLLIBS,;t t
+s,@INTLOBJS@,$INTLOBJS,;t t
+s,@POFILES@,$POFILES,;t t
+s,@POSUB@,$POSUB,;t t
+s,@INCLUDE_LOCALE_H@,$INCLUDE_LOCALE_H,;t t
+s,@GT_NO@,$GT_NO,;t t
+s,@GT_YES@,$GT_YES,;t t
+s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t
+s,@l@,$l,;t t
+s,@YACC@,$YACC,;t t
+s,@LEX@,$LEX,;t t
+s,@LEXLIB@,$LEXLIB,;t t
+s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
+s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
+s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
+s,@MAINT@,$MAINT,;t t
+s,@HDEFINES@,$HDEFINES,;t t
+s,@HOSTING_CRT0@,$HOSTING_CRT0,;t t
+s,@HOSTING_LIBS@,$HOSTING_LIBS,;t t
+s,@NATIVE_LIB_DIRS@,$NATIVE_LIB_DIRS,;t t
+s,@STRINGIFY@,$STRINGIFY,;t t
+s,@EMUL@,$EMUL,;t t
+s,@EMULATION_OFILES@,$EMULATION_OFILES,;t t
+s,@EMUL_EXTRA_OFILES@,$EMUL_EXTRA_OFILES,;t t
+s,@LIB_PATH@,$LIB_PATH,;t t
+s,@EMULATION_LIBPATH@,$EMULATION_LIBPATH,;t t
+s,@TESTBFDLIB@,$TESTBFDLIB,;t t
+s,@datarootdir@,$datarootdir,;t t
+s,@docdir@,$docdir,;t t
+s,@htmldir@,$htmldir,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+/@TDIRS@/r $TDIRS
+s,@TDIRS@,,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
fi
+fi # test -n "$CONFIG_FILES"
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
esac
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
esac
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='\([ ]\)%\1#\2define\3'
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='$,\1#\2define\3'
ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
-
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-cat >> $CONFIG_STATUS <<EOF
- CONFIG_HEADERS="config.h:config.in"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-fi
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
esac
- echo creating $ac_file
-
- rm -f conftest.frag conftest.in conftest.out
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- cat $ac_file_inputs > conftest.in
-
-EOF
-
-# Transform confdefs.h into a sed script conftest.vals that substitutes
-# the proper values into config.h.in to produce config.h. And first:
-# Protect against being on the right side of a sed subst in config.status.
-# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
-cat > conftest.hdr <<\EOF
-s/[\\&%]/\\&/g
-s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-s%ac_d%ac_u%gp
-s%ac_u%ac_e%gp
-EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ # Do quote $f, to prevent DOS paths from being IFS'd.
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h. The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status. Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
# This sed command replaces #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-EOF
-
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
+cat >>conftest.undefs <<\_ACEOF
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo ' :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo ' fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
rm -f conftest.tail
-while :
+while grep . conftest.undefs >/dev/null
do
- ac_lines=`grep -c . conftest.vals`
- # grep -c gives empty output for an empty file on some AIX systems.
- if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
echo 'CEOF
- sed -f conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-' >> $CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
- rm -f conftest.vals
- mv conftest.tail conftest.vals
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+ rm -f conftest.undefs
+ mv conftest.tail conftest.undefs
done
-rm -f conftest.vals
-
-cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
- echo "$ac_file is unchanged"
- rm -f conftest.h
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated by configure. */" >$tmp/config.h
else
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
+ fi
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
+ if test x"$ac_file" != x-; then
+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
fi
- rm -f $ac_file
- mv conftest.h $ac_file
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
fi
-fi; done
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $ac_file | $ac_file:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X$ac_file : 'X\(//\)[^/]' \| \
+ X$ac_file : 'X\(//\)$' \| \
+ X$ac_file : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
-EOF
-cat >> $CONFIG_STATUS <<EOF
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+ ac_builddir=.
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
-sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile
-exit 0
-EOF
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p $dirpart/$fdir
+ else
+ as_dir=$dirpart/$fdir
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+ default ) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;
+ esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
diff --git a/contrib/binutils/ld/configure.host b/contrib/binutils/ld/configure.host
index f2e1eb4..f9f080f 100644
--- a/contrib/binutils/ld/configure.host
+++ b/contrib/binutils/ld/configure.host
@@ -10,7 +10,7 @@
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 --start-group $libgcc -lc --end-group`'
+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; if [ -f ../gcc/libunwind.a ]; then libgcc="$libgcc ../gcc/libunwind.a"; else libunwind=\`${CC} -print-file-name=libunwind.a\`; if [ x"$libunwind" != xlibunwind.a ]; then libgcc="$libgcc $libunwind"; fi; fi; echo --start-group $libgcc -lc --end-group`'
#
# Generic configurations:
@@ -33,7 +33,7 @@ case "${host}" in
;;
*-*-linux*)
- HOSTING_CRT0='-dynamic-linker `egrep "ld[^ ]*\.so" \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld[^ ]*\.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_CRT0='-dynamic-linker `${CC} --help --verbose 2>&1 | egrep "ld[^ ]*\.so" | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld[^ ]*\.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`'
;;
@@ -67,6 +67,12 @@ case "${host}" in
fi
;;
+*-*-openbsd*)
+ HOSTING_CRT0="-dynamic-linker /usr/libexec/ld.so /usr/lib/crt0.o"
+ HOSTING_CRT0="$HOSTING_CRT0 /usr/lib/crtbegin.o"
+ HOSTING_LIBS="$HOSTING_LIBS /usr/lib/crtend.o"
+ ;;
+
esac
#
@@ -83,7 +89,7 @@ am33_2.0-*-linux*)
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"`
;;
-arm*-*-linux-gnu*)
+arm*-*-linux-*)
HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"`
;;
@@ -132,11 +138,6 @@ i[3-7]86-*-sco* | i[3-7]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[3-7]86-*-lynxos*)
- HOSTING_CRT0=/lib/init1.o
- HOSTING_LIBS="$HOSTING_LIBS"' -lm /lib/initn.o'
- ;;
-
i[3-7]86-pc-interix*)
HOSTING_CRT0='$$INTERIX_ROOT/usr/lib/crt0.o'
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'
@@ -146,15 +147,10 @@ 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*)
+ia64-*-linux-*)
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux-ia64,g"`
;;
-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`'
- ;;
-
mips*-sgi-irix4* | mips*-sgi-irix5*)
HOSTING_CRT0=/usr/lib/crt1.o
HOSTING_LIBS="$HOSTING_LIBS"' /usr/lib/crtn.o'
@@ -165,17 +161,12 @@ mips*-sgi-irix6*)
HOSTING_LIBS='-L/usr/lib32 '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o ; else ${CC} -print-file-name=crtend.o; fi` /usr/lib32/crtn.o -init __do_global_ctors -fini __do_global_dtors'
;;
-mips*-*-linux-gnu*)
- HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"`
+mips*-*-linux-*)
+ HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"`
;;
-m68*-*-linux-gnu*)
- HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"`
- ;;
-
-m68*-*-lynxos*)
- HOSTING_CRT0=/lib/init1.o
- HOSTING_LIBS="$HOSTING_LIBS"' -lm /lib/initn.o'
+m68*-*-linux-*)
+ HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"`
;;
m68*-motorola-sysv)
@@ -198,37 +189,42 @@ 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,"`
+powerpc64*-*-linux-*)
+ HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib64/ld64.so.1,"`
;;
-powerpc*-*-linux-gnu*)
- HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"`
+powerpc*-*-linux-*)
+ HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"`
;;
-s390x-*-linux-gnu*)
- HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld64.so.1,"`
+s390x-*-linux-*)
+ HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld64.so.1,"`
;;
-s390-*-linux-gnu*)
- HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"`
+s390-*-linux-*)
+ HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"`
;;
-sparc*-*-solaris2*)
+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`'
;;
-sparc-*-linux-gnu*)
- HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld-linux.so.2,"`
+sparc64-*-solaris2* | sparcv9-*-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/sparcv9/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`'
;;
-sparc64-*-linux-gnu*)
- HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld-linux.so.2,"`
+sparc-*-linux-*)
+ HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld-linux.so.2,"`
;;
-x86_64-*-linux-gnu*)
- HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld-linux-x86-64.so.2,"`
+sparc64-*-linux-*)
+ HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib64/ld-linux.so.2,"`
+ ;;
+
+x86_64-*-linux-*)
+ HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib64/ld-linux-x86-64.so.2,"`
;;
*-*-freebsd* | *-*-kfreebsd*-gnu)
@@ -240,6 +236,9 @@ x86_64-*-linux-gnu*)
*-*-netbsd*)
;;
+*-*-openbsd*)
+ ;;
+
alpha*-*-*)
HOSTING_CRT0=/usr/ccs/lib/crt0.o
;;
diff --git a/contrib/binutils/ld/configure.in b/contrib/binutils/ld/configure.in
index 4358cbe..e020288 100644
--- a/contrib/binutils/ld/configure.in
+++ b/contrib/binutils/ld/configure.in
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script
dnl
-AC_PREREQ(2.13)
+AC_PREREQ(2.57)
AC_INIT(ldmain.c)
AC_CANONICAL_SYSTEM
@@ -66,26 +66,7 @@ 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],
-[case "${enableval}" in
- yes) ;;
- no) build_warnings="-w";;
- ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
- build_warnings="${build_warnings} ${t}";;
- *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
- build_warnings="${t} ${build_warnings}";;
- *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
-esac
-if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
- echo "Setting warning flags = $build_warnings" 6>&1
-fi])dnl
-WARN_CFLAGS=""
-if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
- WARN_CFLAGS="${build_warnings}"
-fi
-AC_SUBST(WARN_CFLAGS)
+AM_BINUTILS_WARNINGS
AM_CONFIG_HEADER(config.h:config.in)
@@ -101,7 +82,7 @@ fi
AC_PROG_CC
AC_PROG_INSTALL
-ALL_LINGUAS="fr sv tr es da"
+ALL_LINGUAS="fr sv tr es da vi zh_CN"
CY_GNU_GETTEXT
AC_EXEEXT
@@ -118,17 +99,23 @@ AC_SUBST(HOSTING_CRT0)
AC_SUBST(HOSTING_LIBS)
AC_SUBST(NATIVE_LIB_DIRS)
-AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
-AC_CHECK_FUNCS(sbrk realpath)
+AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h elf-hints.h)
+AC_CHECK_FUNCS(sbrk realpath glob)
AC_HEADER_DIRENT
+AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
+AC_CACHE_VAL(ld_cv_decl_getopt_unistd_h,
+[AC_TRY_COMPILE([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);],
+ld_cv_decl_getopt_unistd_h=yes, ld_cv_decl_getopt_unistd_h=no)])
+AC_MSG_RESULT($ld_cv_decl_getopt_unistd_h)
+if test $ld_cv_decl_getopt_unistd_h = yes; then
+ AC_DEFINE([HAVE_DECL_GETOPT], 1,
+ [Is the prototype for getopt in <unistd.h> in the expected format?])
+fi
+
BFD_BINARY_FOPEN
-BFD_NEED_DECLARATION(strstr)
-BFD_NEED_DECLARATION(free)
-BFD_NEED_DECLARATION(sbrk)
-BFD_NEED_DECLARATION(getenv)
-BFD_NEED_DECLARATION(environ)
+AC_CHECK_DECLS([strstr, free, sbrk, getenv, environ])
# When converting linker scripts into strings for use in emulation
# files, use astring.sed if the compiler supports ANSI string
@@ -256,10 +243,20 @@ case "$target_vendor" in
hp) EXTRA_SHLIB_EXTENSION=".sl" ;;
*) EXTRA_SHLIB_EXTENSION= ;;
esac
+
+case "$target_os" in
+ lynxos) EXTRA_SHLIB_EXTENSION=".a" ;;
+esac
+
if test x${EXTRA_SHLIB_EXTENSION} != x ; then
AC_DEFINE_UNQUOTED(EXTRA_SHLIB_EXTENSION, "$EXTRA_SHLIB_EXTENSION",
[Additional extension a shared object might have.])
fi
+dnl Required by html and install-html
+AC_SUBST(datarootdir)
+AC_SUBST(docdir)
+AC_SUBST(htmldir)
+
AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
[sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile])
diff --git a/contrib/binutils/ld/configure.tgt b/contrib/binutils/ld/configure.tgt
index 9b29291..d324e4e 100644
--- a/contrib/binutils/ld/configure.tgt
+++ b/contrib/binutils/ld/configure.tgt
@@ -15,123 +15,122 @@
targ_extra_emuls=
targ_extra_ofiles=
+# Please try to keep this table in alphabetic order - it makes it
+# much easier to lookup a specific archictecture. Naturally any
+# architecture variants should be kept together even if their names
+# break the alpha sorting.
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 ;
+alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ targ_emul=elf64alpha_fbsd
+ targ_extra_emuls="elf64alpha alpha"
+ tdir_alpha=`echo ${targ_alias} | sed -e 's/freebsd/freebsdecoff/'` ;;
+alpha*-*-linuxecoff*) targ_emul=alpha targ_extra_emuls=elf64alpha
+ tdir_elf64alpha=`echo ${targ_alias} | sed -e 's/ecoff//'` ;;
+alpha*-*-linux-*) targ_emul=elf64alpha targ_extra_emuls=alpha
+ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'` ;;
+alpha*-*-osf*) targ_emul=alpha ;;
+alpha*-*-gnu*) targ_emul=elf64alpha ;;
+alpha*-*-netware*) targ_emul=alpha ;;
+alpha*-*-netbsd*) targ_emul=elf64alpha_nbsd ;;
+alpha*-*-openbsd*) targ_emul=elf64alpha
+ ;;
+arc-*-elf*) targ_emul=arcelf
+ ;;
+arm-epoc-pe) targ_emul=arm_epoc_pe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;;
+arm-*-wince) targ_emul=armpe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;;
+arm-*-pe) targ_emul=armpe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;;
+arm-*-aout | armel-*-aout) targ_emul=armaoutl ;;
+armeb-*-aout) targ_emul=armaoutb ;;
+arm-*-coff) targ_emul=armcoff ;;
+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" ;;
+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 ;;
+armeb-*-elf) targ_emul=armelfb ;;
+arm-*-elf | arm*-*-eabi*)
+ targ_emul=armelf ;;
+arm*-*-symbianelf*) targ_emul=armsymbian;;
+arm-*-kaos*) targ_emul=armelf ;;
+arm9e-*-elf) targ_emul=armelf ;;
+arm*b-*-linux-*eabi) targ_emul=armelfb_linux_eabi ;;
+arm*b-*-linux-*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
+arm*-*-linux-*eabi) targ_emul=armelf_linux_eabi ;;
+arm*-*-linux-*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+arm-*-vxworks) targ_emul=armelf_vxworks ;;
+arm*-*-conix*) targ_emul=armelf ;;
+thumb-*-linux-* | 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-epoc-pe) targ_emul=arm_epoc_pe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-arm-*-pe) targ_emul=armpe ;
+thumb-*-pe) targ_emul=armpe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-arc-*-elf*) targ_emul=arcelf ;;
+xscale-*-coff) targ_emul=armcoff ;;
+xscale-*-elf) targ_emul=armelf
+ ;;
avr-*-*) targ_emul=avr2
- targ_extra_emuls="avr1 avr3 avr4 avr5" ;;
+ targ_extra_emuls="avr1 avr3 avr4 avr5"
+ ;;
+bfin-*-elf) targ_emul=elf32bfin; targ_extra_emuls="elf32bfinfd" ;;
+bfin-*-uclinux*) targ_emul=elf32bfin; targ_extra_emuls="elf32bfinfd" ;;
+cr16c-*-elf*) targ_emul=elf32cr16c
+ ;;
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
+cris-*-linux-* | crisv32-*-linux-*)
+ targ_emul=crislinux ;;
+cris-*-* | crisv32-*-*) targ_emul=criself
targ_extra_emuls="crisaout crislinux"
- targ_extra_libpath=$targ_extra_emuls ;;
+ targ_extra_libpath=$targ_extra_emuls
+ ;;
+crx-*-elf*) targ_emul=elf32crx
+ ;;
d10v-*-*) targ_emul=d10velf ;;
d30v-*-*ext*) targ_emul=d30v_e; targ_extra_emuls="d30velf d30v_o" ;;
d30v-*-*onchip*) targ_emul=d30v_o; targ_extra_emuls="d30velf d30v_e" ;;
-d30v-*-*) targ_emul=d30velf; targ_extra_emuls="d30v_e d30v_o" ;;
-dlx-*-elf*) targ_emul=elf32_dlx ;;
-sparc64-*-aout*) targ_emul=sparcaout ;;
-sparc64-*-elf*) targ_emul=elf64_sparc ;;
-sparc-sun-sunos4*) targ_emul=sun4 ;;
-sparclite*-*-elf) targ_emul=elf32_sparc ;;
-sparclite*-*-coff) targ_emul=coff_sparc ;;
-sparclite*-fujitsu-*) targ_emul=sparcaout ;;
-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-*-kfreebsd*-gnu | sparcv9-*-kfreebsd*-gnu)
- targ_emul=elf64_sparc_fbsd
- targ_extra_emuls="elf64_sparc elf32_sparc"
- targ_extra_libpath=$targ_extra_emuls
- tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
+d30v-*-*) targ_emul=d30velf; targ_extra_emuls="d30v_e d30v_o"
;;
-sparc*-*-linux*aout*) targ_emul=sparclinux
- targ_extra_emuls="elf32_sparc sun4"
- tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
- tdir_sun4=sparc-sun-sunos4
+dlx-*-elf*) targ_emul=elf32_dlx
;;
-sparc64-*-linux-gnu*) targ_emul=elf64_sparc
- targ_extra_emuls="elf32_sparc sparclinux sun4"
- targ_extra_libpath=elf32_sparc
- tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
- tdir_sparclinux=${tdir_elf32_sparc}aout
- tdir_sun4=sparc-sun-sunos4
+fr30-*-*) targ_emul=elf32fr30
;;
-sparc*-*-linux-gnu*) targ_emul=elf32_sparc
- targ_extra_emuls="sparclinux elf64_sparc sun4"
- targ_extra_libpath=elf64_sparc
- tdir_sparclinux=${targ_alias}aout
- tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'`
- tdir_sun4=sparc-sun-sunos4
+frv-*-*linux*) targ_emul=elf32frvfd ;;
+frv-*-*) targ_emul=elf32frv ; targ_extra_emuls="elf32frvfd"
;;
-sparc*-*-lynxos*) targ_emul=sparclynx ;;
-sparc64-*-netbsd* | sparc64-*-openbsd*)
- targ_emul=elf64_sparc
- targ_extra_emuls="elf32_sparc"
+h8300-*-hms* | h8300-*-coff* | h8300-*-rtemscoff*)
+ targ_emul=h8300; targ_extra_emuls="h8300h h8300s h8300hn h8300sn h8300sx h8300sxn" ;;
+h8300-*-elf* | h8300-*-rtems*)
+ targ_emul=h8300elf;
+ targ_extra_emuls="h8300helf h8300self h8300hnelf h8300snelf h8300sxelf h8300sxnelf" ;;
+h8500-*-hms* | h8500-*-coff* | h8500-*-rtems*)
+ targ_emul=h8500
+ targ_extra_emuls="h8500s h8500b h8500m h8500c"
;;
-sparc*-*-netbsd*elf*) targ_emul=elf32_sparc ;;
-sparc*-*-netbsd*) targ_emul=sparcnbsd ;;
-sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
- targ_emul=elf32_sparc ;;
-sparc-*-solaris2*) targ_emul=elf32_sparc
- targ_extra_emuls="elf64_sparc"
- targ_extra_libpath=$targ_extra_emuls
- tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'`
+hppa*64*-*-linux-*) targ_emul=hppa64linux ;;
+hppa*64*-*) targ_emul=elf64hppa ;;
+hppa*-*-linux-*) targ_emul=hppalinux ;;
+hppa*-*-*elf*) targ_emul=hppaelf ;;
+hppa*-*-lites*) targ_emul=hppaelf ;;
+hppa*-*-netbsd*) targ_emul=hppanbsd ;;
+hppa*-*-openbsd*) targ_emul=hppaobsd
;;
-sparcv9-*-solaris2* | sparc64-*-solaris2*)
- targ_emul=elf64_sparc
- targ_extra_emuls="elf32_sparc"
- targ_extra_libpath=$targ_extra_emuls
- tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
+i370-*-elf* | i370-*-linux-*) targ_emul=elf32i370
;;
-sparc*-*-solaris2*) targ_emul=elf32_sparc ;;
-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 ;;
-i960-wrs-vxworks5*) targ_emul=gld960coff ;;
-i960-wrs-vxworks*) targ_emul=gld960 ;;
-i960-*-coff) targ_emul=gld960coff ;;
-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* | 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*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
- targ_extra_emuls="m68hc12elfb m68hc11elf m68hc11elfb" ;;
-m68*-sun-sunos[34]*) targ_emul=sun3 ;;
-m68*-wrs-vxworks*) targ_emul=sun3 ;;
-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[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 ;;
@@ -139,35 +138,31 @@ 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-*-rdos*) 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//'`
- ;;
+ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'` ;;
i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
+i[3-7]86-*-linux-*) 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
+ tdir_i386linux=${targ_alias}aout ;;
+x86_64-*-linux-*) targ_emul=elf_x86_64
targ_extra_emuls="elf_i386 i386linux"
targ_extra_libpath=elf_i386
tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
- tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
- ;;
+ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'` ;;
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"
+ targ_extra_emuls="elf_i386 elf_x86_64"
;;
i[3-7]86-*-unixware) targ_emul=elf_i386 ;;
i[3-7]86-*-solaris*) targ_emul=elf_i386_ldso
@@ -177,28 +172,25 @@ 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
- ;;
+ targ_extra_emuls=i386nbsd ;;
i[3-7]86-*-netbsdpe*) targ_emul=i386pe
- targ_extra_ofiles="deffilep.o pe-dll.o"
- ;;
+ targ_extra_ofiles="deffilep.o pe-dll.o" ;;
i[3-7]86-*-netbsd*) targ_emul=i386nbsd
- targ_extra_emuls=elf_i386
- ;;
+ targ_extra_emuls=elf_i386 ;;
x86_64-*-netbsd*) targ_emul=elf_x86_64
targ_extra_emuls="elf_i386 i386nbsd"
tdir_elf_i386=`echo ${targ_alias} | \
sed -e 's/x86_64/i386/'`
case "${tdir_elf_i386}" in
- *-netbsdelf*) ;;
- *)
- tdir_elf_i386=`echo ${tdir_elf_i386} | \
- sed -e 's/netbsd/netbsdelf/'`
- ;;
- esac
- ;;
+ *-netbsdelf*) ;;
+ *) tdir_elf_i386=`echo ${tdir_elf_i386} | \
+ sed -e 's/netbsd/netbsdelf/'`;;
+ esac ;;
i[3-7]86-*-netware) targ_emul=i386nw ;;
i[3-7]86-*-elf*) targ_emul=elf_i386 ;;
+x86_64-*-elf*) targ_emul=elf_x86_64
+ targ_extra_emuls=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 ;;
@@ -209,8 +201,7 @@ 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/'`
- ;;
+ | sed -e 's/x86_64/i386/'` ;;
i[3-7]86-*-sysv*) targ_emul=i386coff ;;
i[3-7]86-*-ptx*) targ_emul=i386coff ;;
i[3-7]86-*-mach*) targ_emul=i386mach ;;
@@ -230,129 +221,48 @@ i[3-7]86-*-interix*) targ_emul=i386pe_posix;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
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 ;;
-a29k-*-*) targ_emul=a29k ;;
-# arm-*-riscix*) targ_emul=riscix ;;
-arm-*-aout | armel-*-aout) targ_emul=armaoutl ;;
-armeb-*-aout) targ_emul=armaoutb ;;
-arm-*-coff) targ_emul=armcoff ;;
-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" ;;
-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 ;;
-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 ;;
-thumb-epoc-pe) targ_emul=arm_epoc_pe ;
- targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-thumb-*-pe) targ_emul=armpe ;
- targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-xscale-*-coff) targ_emul=armcoff ;;
-xscale-*-elf) targ_emul=armelf ;;
-h8300-*-hms* | h8300-*-coff* | h8300-*-rtems*)
- targ_emul=h8300; targ_extra_emuls="h8300h h8300s h8300hn h8300sn h8300sx h8300sxn"
- ;;
-h8300-*-elf*)
- targ_emul=h8300elf;
- targ_extra_emuls="h8300helf h8300self h8300hnelf h8300snelf h8300sxelf h8300sxnelf"
- ;;
-h8500-*-hms* | h8500-*-coff* | h8500-*-rtems*)
- targ_emul=h8500
- targ_extra_emuls="h8500s h8500b h8500m h8500c"
- ;;
-sh-*-linux*)
- targ_emul=shlelf_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
+i[3-7]86-*-vxworks*) targ_emul=elf_i386_vxworks ;;
+i[3-7]86-*-chaos) targ_emul=elf_i386_chaos
;;
-sh*eb-*-linux*)
- targ_emul=shelf_linux
- ;;
-sh*-*-linux*)
- targ_emul=shlelf_linux
- ;;
-sh5le-*-netbsd*)
- targ_emul=shlelf32_nbsd
- targ_extra_emuls="shelf32_nbsd shelf64_nbsd shlelf64_nbsd shelf_nbsd shlelf_nbsd"
- ;;
-sh5-*-netbsd*)
- targ_emul=shelf32_nbsd
- targ_extra_emuls="shlelf32_nbsd shelf64_nbsd shlelf64_nbsd shelf_nbsd shlelf_nbsd"
- ;;
-sh64le-*-netbsd*)
- targ_emul=shlelf64_nbsd
- targ_extra_emuls="shelf64_nbsd shelf32_nbsd shlelf32_nbsd shelf_nbsd shlelf_nbsd"
- ;;
-sh64-*-netbsd*)
- targ_emul=shelf64_nbsd
- targ_extra_emuls="shlelf64_nbsd shelf32_nbsd shlelf32_nbsd shelf_nbsd shlelf_nbsd"
- ;;
-sh*l*-*-netbsdelf*)
- targ_emul=shlelf_nbsd
- targ_extra_emuls=shelf_nbsd
+i860-*-coff) targ_emul=coff_i860 ;;
+i860-stardent-sysv4* | i860-stardent-elf*)
+ targ_emul=elf32_i860
;;
-sh*-*-netbsdelf*)
- targ_emul=shelf_nbsd
- targ_extra_emuls=shlelf_nbsd
+i960-wrs-vxworks5.0*) targ_emul=gld960 ;;
+i960-wrs-vxworks5*) targ_emul=gld960coff ;;
+i960-wrs-vxworks*) targ_emul=gld960 ;;
+i960-*-coff) targ_emul=gld960coff ;;
+i960-intel-nindy) targ_emul=gld960 ;;
+i960-*-rtems*) targ_emul=gld960coff ;;
+i960-*-elf*) targ_emul=elf32_i960
;;
-shle*-*-elf* | sh[1234]*le*-*-elf | shle*-*-kaos*)
- targ_emul=shlelf
- targ_extra_emuls="shelf shl sh"
+ia64-*-elf*) targ_emul=elf64_ia64 ;;
+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
;;
-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"
+ip2k-*-elf) targ_emul=elf32ip2k
;;
-sh-*-nto*) targ_emul=shelf_nto
- targ_extra_emuls=shlelf_nto
+iq2000-*-elf) targ_emul=elf32iq2000 ; targ_extra_emuls="elf32iq10"
;;
-sh-*-pe) targ_emul=shpe ;
- targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-sh-*-*) targ_emul=sh; targ_extra_emuls=shl ;;
-sh64le-*-elf*)
- targ_emul=shlelf
- targ_extra_emuls="shelf shlelf32 shelf32 shlelf64 shelf64"
- targ_extra_libpath=$targ_extra_emuls
+m32c-*-elf) targ_emul=elf32m32c
;;
-sh64-*-elf*)
- targ_emul=shelf
- targ_extra_emuls="shlelf shelf32 shlelf32 shelf64 shlelf64"
- targ_extra_libpath=$targ_extra_emuls
+m32r*le-*-elf*) targ_emul=m32rlelf ;;
+m32r*-*-elf*) targ_emul=m32relf ;;
+m32r*le-*-linux-*) targ_emul=m32rlelf_linux ;;
+m32r*-*-linux-*) targ_emul=m32relf_linux
;;
+m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf
+ targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
+m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
+ targ_extra_emuls="m68hc12elfb m68hc11elf m68hc11elfb" ;;
+m68*-sun-sunos[34]*) targ_emul=sun3 ;;
+m68*-wrs-vxworks*) targ_emul=sun3 ;;
+m68*-ericsson-ose) targ_emul=sun3 ;;
+m68*-apple-aux*) targ_emul=m68kaux ;;
m68k-sony-*) targ_emul=news ;;
m68k-hp-bsd*) targ_emul=hp300bsd ;;
m68*-motorola-sysv*) targ_emul=delta68 ;;
@@ -362,15 +272,12 @@ m68*-*-elf) targ_emul=m68kelf ;;
m68*-*-hpux*) targ_emul=hp3hpux ;;
m68k-*-linux*aout*) targ_emul=m68klinux
targ_extra_emuls=m68kelf
- tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
- ;;
-m68k-*-linux-gnu*) targ_emul=m68kelf
+ tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'` ;;
+m68k-*-linux-*) targ_emul=m68kelf
targ_extra_emuls=m68klinux
- tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
- ;;
+ 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
targ_extra_emuls="m68knbsd m68kelfnbsd" ;;
m68*-*-netbsdelf*) targ_emul=m68kelfnbsd
@@ -380,22 +287,16 @@ m68*-*-netbsdaout* | m68*-*-netbsd*)
targ_extra_emuls="m68kelfnbsd m68k4knbsd" ;;
m68*-*-psos*) targ_emul=m68kpsos ;;
m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
-m68*-*-rtems*) targ_emul=m68kelf ;;
-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
-hppa*64*-*) targ_emul=elf64hppa ;;
-hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
-hppa*-*-*elf*) targ_emul=hppaelf ;;
-hppa*-*-lites*) targ_emul=hppaelf ;;
-hppa*-*-netbsd*) targ_emul=hppanbsd ;;
-hppa*-*-openbsd*) targ_emul=hppaobsd ;;
-hppa*-*-rtems*) targ_emul=hppaelf ;;
-vax-dec-ultrix* | vax-dec-bsd*) targ_emul=vax ;;
-vax-*-netbsdelf*) targ_emul=elf32vax
- targ_extra_emuls=vaxnbsd ;;
-vax-*-netbsdaout* | vax-*-netbsd*)
- targ_emul=vaxnbsd
- targ_extra_emuls=elf32vax ;;
-vax-*-linux-gnu*) targ_emul=elf32vax ;;
+m68*-*-rtems*) targ_emul=m68kelf
+ ;;
+m8*-*-*) targ_emul=m88kbcs
+ ;;
+maxq-*-coff) targ_emul=maxqcoff
+ ;;
+mcore-*-pe) targ_emul=mcorepe ;
+ targ_extra_ofiles="deffilep.o pe-dll.o" ;;
+mcore-*-elf) targ_emul=elf32mcore
+ ;;
mips*-*-pe) targ_emul=mipspe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
mips*-dec-ultrix*) targ_emul=mipslit ;;
@@ -403,17 +304,16 @@ 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
- ;;
+ targ_extra_libpath=$targ_extra_emuls ;;
mips*-sgi-irix*) targ_emul=mipsbig ;;
mips*el-*-ecoff*) targ_emul=mipsidtl ;;
mips*-*-ecoff*) targ_emul=mipsidt ;;
-mips*el-*-netbsd*) targ_emul=elf32lmip
- targ_extra_emuls="elf32bmip"
- ;;
-mips*-*-netbsd*) targ_emul=elf32bmip
- targ_extra_emuls="elf32lmip"
+mips*el-*-netbsd*) targ_emul=elf32ltsmip
+ targ_extra_emuls="elf32btsmip elf64ltsmip elf64btsmip"
;;
+mips*-*-netbsd*) targ_emul=elf32btsmip
+ targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip"
+ ;;
mips*-*-bsd*) targ_emul=mipsbig ;;
mips*vr4300el-*-elf*) targ_emul=elf32l4300 ;;
mips*vr4300-*-elf*) targ_emul=elf32b4300 ;;
@@ -423,106 +323,99 @@ mips*vr5000el-*-elf*) targ_emul=elf32l4300 ;;
mips*vr5000-*-elf*) targ_emul=elf32b4300 ;;
mips*el-*-elf*) targ_emul=elf32elmip ;;
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
- targ_extra_emuls="elf32elmip" ;;
+mips*el-*-vxworks*) targ_emul=elf32elmipvxworks
+ targ_extra_emuls="elf32ebmipvxworks" ;;
+mips*-*-vxworks*) targ_emul=elf32ebmipvxworks
+ targ_extra_emuls="elf32elmipvxworks" ;;
mips*-*-windiss) targ_emul=elf32mipswindiss ;;
-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
+mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
- ;;
-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
+ targ_extra_libpath="elf32ltsmip elf64ltsmip" ;;
+mips64*-*-linux-*) targ_emul=elf32btsmipn32
targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
- ;;
-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
- targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
- ;;
-mips*-*-linux-gnu*) targ_emul=elf32btsmip
- targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
- ;;
+ targ_extra_libpath="elf32btsmip elf64btsmip" ;;
+mips*el-*-linux-*) targ_emul=elf32ltsmip
+ targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" ;;
+mips*-*-linux-*) targ_emul=elf32btsmip
+ targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip" ;;
mips*-*-lnews*) targ_emul=mipslnews ;;
-mips*-*-sysv4*) targ_emul=elf32btsmip ;;
+mips*-*-sysv4*) targ_emul=elf32btsmip
+ ;;
mmix-*-*) targ_emul=mmo
targ_extra_emuls=elf64mmix
;;
+am33_2.0-*-linux*) targ_emul=elf32am33lin ;;
mn10200-*-*) targ_emul=mn10200 ;;
-mn10300-*-*) targ_emul=mn10300 ;;
-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/'`
+mn10300-*-*) targ_emul=mn10300
;;
-alpha*-*-linuxecoff*) targ_emul=alpha targ_extra_emuls=elf64alpha
- tdir_elf64alpha=`echo ${targ_alias} | sed -e 's/ecoff//'`
+mt-*elf) targ_emul=elf32mt
;;
-alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
- tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
+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 msp430x1610 msp430x1611 msp430x1612 msp430x2101 msp430x2111 msp430x2121 msp430x2131 msp430x311 msp430x312 msp430x313 msp430x314 msp430x315 msp430x323 msp430x325 msp430x336 msp430x337 msp430x412 msp430x413 msp430x415 msp430x417 msp430xE423 msp430xE425 msp430xE427 msp430xW423 msp430xW425 msp430xW427 msp430xG437 msp430xG438 msp430xG439 msp430x435 msp430x436 msp430x437 msp430x447 msp430x448 msp430x449"
+ ;;
+ns32k-pc532-mach* | ns32k-pc532-ux*) targ_emul=pc532macha ;;
+ns32k-*-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd
;;
-alpha*-*-osf*) targ_emul=alpha ;;
-alpha*-*-gnu*) targ_emul=elf64alpha ;;
-alpha*-*-netware*) targ_emul=alpha ;;
-alpha*-*-netbsd*) targ_emul=elf64alpha_nbsd ;;
-alpha*-*-openbsd*) targ_emul=elf64alpha ;;
-z8k-*-coff) targ_emul=z8002; targ_extra_emuls=z8001 ;;
-ns32k-pc532-mach* | ns32k-pc532-ux*) targ_emul=pc532macha ;;
-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=or32elf ;;
-pdp11-*-*) targ_emul=pdp11 ;;
+or32-*-rtems*) targ_emul=or32elf
+ ;;
+pdp11-*-*) targ_emul=pdp11
+ ;;
pjl*-*-*) targ_emul=pjlelf ; targ_extra_emuls="elf_i386" ;;
-pj*-*-*) targ_emul=pjelf ;;
+pj*-*-*) targ_emul=pjelf
+ ;;
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/'`
- ;;
-powerpc*-*-linux*)
- case "${targ}" in
- *64*) targ_emul=elf64ppc
- targ_extra_emuls="elf32ppclinux elf32ppc elf32ppcsim"
- 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
- if test "${want64}" = "true"; then
- targ_extra_emuls="$targ_extra_emuls elf64ppc"
- targ_extra_libpath="$targ_extra_libpath elf64ppc"
- fi
- ;;
- esac ;;
+ tdir_elf32ppcsim=`echo ${targ_alias} | sed -e 's/ppc/ppcsim/'` ;;
+powerpc*-*-linux*) case "${targ}" in
+ *64*) targ_emul=elf64ppc
+ targ_extra_emuls="elf32ppclinux elf32ppc elf32ppcsim"
+ 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
+ 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*)
- case "${targ}" in
- *64*) targ_emul=elf64lppc
- targ_extra_emuls="elf32lppc elf32lppcsim"
- tdir_elf32lppc=`echo "${targ_alias}" | sed -e 's/64//'`
- tdir_elf32lppcsim=$tdir_elf32lppc ;;
- *) targ_emul=elf32lppc
- targ_extra_emuls="elf32ppcsim" ;;
- esac ;;
+ case "${targ}" in
+ *64*) targ_emul=elf64lppc
+ targ_extra_emuls="elf32lppc elf32lppcsim"
+ tdir_elf32lppc=`echo "${targ_alias}" | sed -e 's/64//'`
+ tdir_elf32lppcsim=$tdir_elf32lppc
+ ;;
+ *) targ_emul=elf32lppc
+ targ_extra_emuls="elf32ppcsim" ;;
+ esac ;;
powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \
- | powerpc*-*-netbsd* | powerpc-*-openbsd* | powerpc*-*-vxworks* | powerpc*-*-kaos*)
- case "${targ}" in
- *64*) targ_emul=elf64ppc
- targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim"
- tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'`
- tdir_elf32ppclinux=$tdir_elf32ppc
- tdir_elf32ppcsim=$tdir_elf32ppc ;;
- *) targ_emul=elf32ppc
- targ_extra_emuls="elf32ppclinux elf32ppcsim" ;;
- esac ;;
+ | powerpc*-*-netbsd* | powerpc-*-openbsd* | powerpc*-*-kaos*)
+ case "${targ}" in
+ *64*) targ_emul=elf64ppc
+ targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim"
+ tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'`
+ tdir_elf32ppclinux=$tdir_elf32ppc
+ tdir_elf32ppcsim=$tdir_elf32ppc
+ ;;
+ *) targ_emul=elf32ppc
+ targ_extra_emuls="elf32ppclinux elf32ppcsim" ;;
+ esac ;;
+powerpc-*-vxworks*)
+ targ_emul=elf32ppcvxworks
+ targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim" ;;
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 ;;
powerpc-*-netware*) targ_emul=ppcnw ;;
@@ -533,39 +426,151 @@ powerpc-*-aix5*) targ_emul=aix5ppc ;;
powerpc-*-aix*) targ_emul=aixppc ;;
powerpc-*-beos*) targ_emul=aixppc ;;
powerpc-*-windiss*) targ_emul=elf32ppcwindiss ;;
+powerpc-*-lynxos*) targ_emul=ppclynx ;;
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 ;;
-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" ;;
-mcore-*-elf) targ_emul=elf32mcore ;;
+rs6000-*-aix*) targ_emul=aixrs6
+ ;;
s390x-*-linux*) targ_emul=elf64_s390
targ_extra_emuls=elf_s390
targ_extra_libpath=$targ_extra_emuls
tdir_elf_s390=`echo ${targ_alias} | sed -e 's/s390x/s390/'` ;;
+s390x-*-tpf*) targ_emul=elf64_s390
+ tdir_elf_s390=`echo ${targ_alias} | sed -e 's/s390x/s390/'` ;;
s390-*-linux*) targ_emul=elf_s390
if test "${want64}" = "true"; then
targ_extra_emuls=elf64_s390
targ_extra_libpath=$targ_extra_emuls
tdir_elf64_s390=`echo ${targ_alias} | sed -e 's/s390/s390x/'`
- fi ;;
-*-*-ieee*) targ_emul=vanilla ;;
-ip2k-*-elf) targ_emul=elf32ip2k ;;
-
+ fi
+ ;;
+sh-*-linux*) targ_emul=shlelf_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 ;;
+sh*-*-linux*) targ_emul=shlelf_linux ;;
+sh5le-*-netbsd*) targ_emul=shlelf32_nbsd
+ targ_extra_emuls="shelf32_nbsd shelf64_nbsd shlelf64_nbsd shelf_nbsd shlelf_nbsd" ;;
+sh5-*-netbsd*) targ_emul=shelf32_nbsd
+ targ_extra_emuls="shlelf32_nbsd shelf64_nbsd shlelf64_nbsd shelf_nbsd shlelf_nbsd" ;;
+sh64le-*-netbsd*) targ_emul=shlelf64_nbsd
+ targ_extra_emuls="shelf64_nbsd shelf32_nbsd shlelf32_nbsd shelf_nbsd shlelf_nbsd" ;;
+sh64-*-netbsd*) targ_emul=shelf64_nbsd
+ targ_extra_emuls="shlelf64_nbsd shelf32_nbsd shlelf32_nbsd shelf_nbsd shlelf_nbsd" ;;
+sh*l*-*-netbsdelf*) targ_emul=shlelf_nbsd
+ targ_extra_emuls=shelf_nbsd ;;
+sh*-*-netbsdelf*) targ_emul=shelf_nbsd
+ targ_extra_emuls=shlelf_nbsd ;;
+sh*-*-symbianelf*) targ_emul=shlsymbian ;;
+shle*-*-elf* | sh[1234]*le*-*-elf | shle*-*-kaos*)
+ targ_emul=shlelf
+ targ_extra_emuls="shelf shl sh" ;;
+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-*-*) targ_emul=sh; targ_extra_emuls=shl ;;
+sh64le-*-elf*) targ_emul=shlelf
+ targ_extra_emuls="shelf shlelf32 shelf32 shlelf64 shelf64"
+ targ_extra_libpath=$targ_extra_emuls ;;
+sh64-*-elf*) targ_emul=shelf
+ targ_extra_emuls="shlelf shelf32 shlelf32 shelf64 shlelf64"
+ targ_extra_libpath=$targ_extra_emuls ;;
+sparc64-*-aout*) targ_emul=sparcaout ;;
+sparc64-*-elf*) targ_emul=elf64_sparc ;;
+sparc-sun-sunos4*) targ_emul=sun4 ;;
+sparclite*-*-elf) targ_emul=elf32_sparc ;;
+sparclite*-*-coff) targ_emul=coff_sparc ;;
+sparclite*-fujitsu-*) targ_emul=sparcaout ;;
+sparc*-*-aout) targ_emul=sparcaout ;;
+sparc*-*-coff) targ_emul=coff_sparc ;;
+sparc*-*-elf) targ_emul=elf32_sparc ;;
+sparc*-*-sysv4*) targ_emul=elf32_sparc ;;
+sparc*-*-vxworks*) targ_emul=elf32_sparc_vxworks ;;
+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
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'` ;;
+sparc*-*-linux*aout*) targ_emul=sparclinux
+ targ_extra_emuls="elf32_sparc sun4"
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
+ tdir_sun4=sparc-sun-sunos4 ;;
+sparc64-*-linux-*) targ_emul=elf64_sparc
+ targ_extra_emuls="elf32_sparc sparclinux sun4"
+ targ_extra_libpath=elf32_sparc
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
+ tdir_sparclinux=${tdir_elf32_sparc}aout
+ tdir_sun4=sparc-sun-sunos4 ;;
+sparc*-*-linux-*) targ_emul=elf32_sparc
+ targ_extra_emuls="sparclinux elf64_sparc sun4"
+ targ_extra_libpath=elf64_sparc
+ tdir_sparclinux=${targ_alias}aout
+ tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'`
+ tdir_sun4=sparc-sun-sunos4 ;;
+sparc64-*-netbsd* | sparc64-*-openbsd*)
+ targ_emul=elf64_sparc
+ targ_extra_emuls="elf32_sparc" ;;
+sparc*-*-netbsd*elf*) targ_emul=elf32_sparc ;;
+sparc*-*-netbsd*) targ_emul=sparcnbsd ;;
+sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
+ targ_emul=elf32_sparc ;;
+sparc-*-solaris2*) targ_emul=elf32_sparc
+ targ_extra_emuls="elf64_sparc"
+ targ_extra_libpath=$targ_extra_emuls
+ tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'` ;;
+sparcv9-*-solaris2* | sparc64-*-solaris2*)
+ targ_emul=elf64_sparc
+ targ_extra_emuls="elf32_sparc"
+ targ_extra_libpath=$targ_extra_emuls
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'` ;;
+sparc*-*-solaris2*) targ_emul=elf32_sparc ;;
+sparc*-wrs-vxworks*) targ_emul=sparcaout ;;
+sparc*-*-rtems*) targ_emul=elf32_sparc
+ ;;
+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
+ ;;
+vax-dec-ultrix* | vax-dec-bsd*) targ_emul=vax ;;
+vax-*-netbsdelf*) targ_emul=elf32vax
+ targ_extra_emuls=vaxnbsd ;;
+vax-*-netbsdaout* | vax-*-netbsd*)
+ targ_emul=vaxnbsd
+ targ_extra_emuls=elf32vax ;;
+vax-*-linux-*) targ_emul=elf32vax
+ ;;
+w65-*-*) targ_emul=w65
+ ;;
+xc16x-*-elf) targ_emul=elf32xc16x
+ targ_extra_emuls="elf32xc16xl elf32xc16xs"
+ ;;
+xstormy16-*-*) targ_emul=elf32xstormy16
+ ;;
+xtensa-*-*) targ_emul=elf32xtensa
+ ;;
+z80-*-coff) targ_emul=z80
+ ;;
+z8k-*-coff) targ_emul=z8002; targ_extra_emuls=z8001
+ ;;
+*-*-ieee*) targ_emul=vanilla
+ ;;
+*-tandem-none) targ_emul=st2000
+ ;;
*)
echo 2>&1 "*** ld does not support target ${targ}"
echo 2>&1 "*** see ld/configure.tgt for supported targets"
diff --git a/contrib/binutils/ld/deffile.h b/contrib/binutils/ld/deffile.h
index f1e3301..6db8bf7 100644
--- a/contrib/binutils/ld/deffile.h
+++ b/contrib/binutils/ld/deffile.h
@@ -16,8 +16,8 @@
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. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#ifndef DEFFILE_H
#define DEFFILE_H
@@ -36,7 +36,7 @@ typedef struct def_file_export {
char *internal_name; /* always set, may == name */
int ordinal; /* -1 if not specified */
int hint;
- char flag_private, flag_constant, flag_noname, flag_data;
+ char flag_private, flag_constant, flag_noname, flag_data, flag_forward;
} def_file_export;
typedef struct def_file_module {
diff --git a/contrib/binutils/ld/deffilep.y b/contrib/binutils/ld/deffilep.y
index 80cf548..5c699f3 100644
--- a/contrib/binutils/ld/deffilep.y
+++ b/contrib/binutils/ld/deffilep.y
@@ -1,6 +1,6 @@
%{ /* deffilep.y - parser for .def files */
-/* Copyright 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+/* Copyright 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005
Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -17,7 +17,7 @@
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. */
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include "libiberty.h"
@@ -83,8 +83,7 @@ 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_image_name (const char *, int, int);
static void def_section (const char *, int);
static void def_section_alt (const char *, const char *);
static void def_stacksize (int, int);
@@ -122,8 +121,8 @@ start: start command
;
command:
- NAME opt_name opt_base { def_name ($2, $3); }
- | LIBRARY opt_name opt_base { def_library ($2, $3); }
+ NAME opt_name opt_base { def_image_name ($2, $3, 0); }
+ | LIBRARY opt_name opt_base { def_image_name ($2, $3, 1); }
| DESCRIPTION ID { def_description ($2);}
| STACKSIZE NUMBER opt_number { def_stacksize ($2, $3);}
| HEAPSIZE NUMBER opt_number { def_heapsize ($2, $3);}
@@ -647,23 +646,34 @@ def_file_add_directive (def_file *my_def, const char *param, int len)
/* Parser Callbacks. */
static void
-def_name (const char *name, int base)
+def_image_name (const char *name, int base, int is_dll)
{
- if (def->name)
- free (def->name);
- def->name = xstrdup (name);
- def->base_address = base;
- def->is_dll = 0;
-}
+ /* If a LIBRARY or NAME statement is specified without a name, there is nothing
+ to do here. We retain the output filename specified on command line. */
+ if (*name)
+ {
+ const char* image_name = lbasename (name);
+ if (image_name != name)
+ einfo ("%s:%d: Warning: path components stripped from %s, '%s'\n",
+ def_filename, linenumber, is_dll ? "LIBRARY" : "NAME",
+ name);
+ if (def->name)
+ free (def->name);
+ /* Append the default suffix, if none specified. */
+ if (strchr (image_name, '.') == 0)
+ {
+ const char * suffix = is_dll ? ".dll" : ".exe";
-static void
-def_library (const char *name, int base)
-{
- if (def->name)
- free (def->name);
- def->name = xstrdup (name);
+ def->name = xmalloc (strlen (image_name) + strlen (suffix) + 1);
+ sprintf (def->name, "%s%s", image_name, suffix);
+ }
+ else
+ def->name = xstrdup (image_name);
+ }
+
+ /* Honor a BASE address statement, even if LIBRARY string is empty. */
def->base_address = base;
- def->is_dll = 1;
+ def->is_dll = is_dll;
}
static void
diff --git a/contrib/binutils/ld/dep-in.sed b/contrib/binutils/ld/dep-in.sed
index 83418e2..0bf6ffe 100644
--- a/contrib/binutils/ld/dep-in.sed
+++ b/contrib/binutils/ld/dep-in.sed
@@ -2,6 +2,7 @@
/\\$/N
/\\$/b loop
+s! \./! !g
s!@INCDIR@!$(INCDIR)!g
s!@TOPDIR@/include!$(INCDIR)!g
s!@BFDDIR@!$(BFDDIR)!g
diff --git a/contrib/binutils/ld/emulparams/armelf.sh b/contrib/binutils/ld/emulparams/armelf.sh
index 35a6d23..6dc50b2 100644
--- a/contrib/binutils/ld/emulparams/armelf.sh
+++ b/contrib/binutils/ld/emulparams/armelf.sh
@@ -8,8 +8,15 @@ TEMPLATE_NAME=elf32
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)) }'
+OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
+OTHER_END_SYMBOLS='__end__ = . ;'
+OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
+ .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }'
+OTHER_READONLY_SECTIONS="
+ .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) }
+ ${RELOCATING+ __exidx_start = .; }
+ .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) }
+ ${RELOCATING+ __exidx_end = .; }"
DATA_START_SYMBOLS='__data_start = . ;';
diff --git a/contrib/binutils/ld/emulparams/armelf_fbsd.sh b/contrib/binutils/ld/emulparams/armelf_fbsd.sh
index 52da345..ee9520d 100644
--- a/contrib/binutils/ld/emulparams/armelf_fbsd.sh
+++ b/contrib/binutils/ld/emulparams/armelf_fbsd.sh
@@ -1,2 +1,3 @@
. ${srcdir}/emulparams/armelf.sh
. ${srcdir}/emulparams/elf_fbsd.sh
+TARGET2_TYPE=got-rel
diff --git a/contrib/binutils/ld/emulparams/armelf_linux.sh b/contrib/binutils/ld/emulparams/armelf_linux.sh
index 88a2d19..39b7f65 100644
--- a/contrib/binutils/ld/emulparams/armelf_linux.sh
+++ b/contrib/binutils/ld/emulparams/armelf_linux.sh
@@ -8,14 +8,17 @@ COMMONPAGESIZE=0x1000
TEMPLATE_NAME=elf32
EXTRA_EM_FILE=armelf
GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
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_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
+OTHER_END_SYMBOLS='__end__ = . ;'
OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
TEXT_START_ADDR=0x00008000
+TARGET2_TYPE=got-rel
# ARM does not support .s* sections.
NO_SMALL_DATA=yes
diff --git a/contrib/binutils/ld/emulparams/armelf_nbsd.sh b/contrib/binutils/ld/emulparams/armelf_nbsd.sh
index 571483c..3d94839 100644
--- a/contrib/binutils/ld/emulparams/armelf_nbsd.sh
+++ b/contrib/binutils/ld/emulparams/armelf_nbsd.sh
@@ -1,6 +1,7 @@
. ${srcdir}/emulparams/armelf.sh
MAXPAGESIZE=0x8000
TEXT_START_ADDR=0x00008000
+TARGET2_TYPE=got-rel
unset STACK_ADDR
unset EMBEDDED
diff --git a/contrib/binutils/ld/emulparams/armelf_oabi.sh b/contrib/binutils/ld/emulparams/armelf_oabi.sh
deleted file mode 100644
index 0c2c1d3..0000000
--- a/contrib/binutils/ld/emulparams/armelf_oabi.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-MACHINE=
-SCRIPT_NAME=elf
-OUTPUT_FORMAT="elf32-littlearm-oabi"
-BIG_OUTPUT_FORMAT="elf32-bigarm-oabi"
-LITTLE_OUTPUT_FORMAT="elf32-littlearm-oabi"
-TEXT_START_ADDR=0x8000
-TEMPLATE_NAME=armelf_oabi
-OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
-OTHER_BSS_SYMBOLS='__bss_start__ = .;'
-OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
-
-
-ARCH=arm
-MACHINE=
-MAXPAGESIZE=256
-ENTRY=_start
-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 aa60536..5db5faf 100644
--- a/contrib/binutils/ld/emulparams/armpe.sh
+++ b/contrib/binutils/ld/emulparams/armpe.sh
@@ -11,3 +11,5 @@ TEMPLATE_NAME=pe
ENTRY="_mainCRTStartup"
SUBSYSTEM=PE_DEF_SUBSYSTEM
INITIAL_SYMBOL_CHAR=\"_\"
+
+TARGET_PAGE_SIZE=0x1000
diff --git a/contrib/binutils/ld/emulparams/elf32bmip.sh b/contrib/binutils/ld/emulparams/elf32bmip.sh
index 94e1c9c..6148565 100644
--- a/contrib/binutils/ld/emulparams/elf32bmip.sh
+++ b/contrib/binutils/ld/emulparams/elf32bmip.sh
@@ -11,12 +11,17 @@ MAXPAGESIZE=0x40000
COMMONPAGESIZE=0x1000
NONPAGED_TEXT_START_ADDR=0x0400000
SHLIB_TEXT_START_ADDR=0x5ffe0000
-test -n "${EMBEDDED}" || TEXT_DYNAMIC=
+TEXT_DYNAMIC=
INITIAL_READONLY_SECTIONS="
.reginfo ${RELOCATING-0} : { *(.reginfo) }
"
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
+# If the output has a GOT section, there must be exactly 0x7ff0 bytes
+# between .got and _gp. The ". = ." below stops the orphan code from
+# inserting other sections between the assignment to _gp and the start
+# of .got.
OTHER_GOT_SYMBOLS='
+ . = .;
_gp = ALIGN(16) + 0x7ff0;
'
OTHER_SDATA_SECTIONS="
@@ -29,9 +34,17 @@ OTHER_BSS_SYMBOLS='_fbss = .;'
OTHER_SECTIONS='
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
'
ARCH=mips
MACHINE=
TEMPLATE_NAME=elf32
-EXTRA_EM_FILE=mipself
GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
diff --git a/contrib/binutils/ld/emulparams/elf32bmipn32-defs.sh b/contrib/binutils/ld/emulparams/elf32bmipn32-defs.sh
index f7b0d08..b81ac49 100644
--- a/contrib/binutils/ld/emulparams/elf32bmipn32-defs.sh
+++ b/contrib/binutils/ld/emulparams/elf32bmipn32-defs.sh
@@ -30,13 +30,19 @@ fi
LIBPATH_SUFFIX=$ELFSIZE
GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
TEXT_START_ADDR=0x10000000
MAXPAGESIZE=0x100000
ENTRY=__start
# GOT-related settings.
+# If the output has a GOT section, there must be exactly 0x7ff0 bytes
+# between .got and _gp. The ". = ." below stops the orphan code from
+# inserting other sections between the assignment to _gp and the start
+# of .got.
OTHER_GOT_SYMBOLS='
+ . = .;
_gp = ALIGN(16) + 0x7ff0;
'
OTHER_SDATA_SECTIONS="
diff --git a/contrib/binutils/ld/emulparams/elf32btsmip.sh b/contrib/binutils/ld/emulparams/elf32btsmip.sh
index 4c5a9ab..e29e045 100644
--- a/contrib/binutils/ld/emulparams/elf32btsmip.sh
+++ b/contrib/binutils/ld/emulparams/elf32btsmip.sh
@@ -5,5 +5,6 @@
OUTPUT_FORMAT="elf32-tradbigmips"
BIG_OUTPUT_FORMAT="elf32-tradbigmips"
LITTLE_OUTPUT_FORMAT="elf32-tradlittlemips"
+unset DATA_ADDR
SHLIB_TEXT_START_ADDR=0
ENTRY=__start
diff --git a/contrib/binutils/ld/emulparams/elf32ppc.sh b/contrib/binutils/ld/emulparams/elf32ppc.sh
index d95cb786..587b8d3 100644
--- a/contrib/binutils/ld/emulparams/elf32ppc.sh
+++ b/contrib/binutils/ld/emulparams/elf32ppc.sh
@@ -1,41 +1,15 @@
# If you change this file, please also look at files which source this one:
# 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
-COMMONPAGESIZE=0x1000
-ARCH=powerpc:common
-MACHINE=
+. ${srcdir}/emulparams/elf32ppccommon.sh
+# Yes, we want duplicate .got and .plt sections. The linker chooses the
+# appropriate one magically in ppc_after_open
+DATA_GOT=
+SDATA_GOT=
+SEPARATE_GOTPLT=0
BSS_PLT=
-EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);'
-OTHER_BSS_END_SYMBOLS='__end = .;'
-OTHER_READWRITE_SECTIONS="
- .fixup ${RELOCATING-0} : { *(.fixup) }
- .got1 ${RELOCATING-0} : { *(.got1) }
- .got2 ${RELOCATING-0} : { *(.got2) }
-"
-OTHER_GOT_RELOC_SECTIONS="
- .rela.got1 ${RELOCATING-0} : { *(.rela.got1) }
- .rela.got2 ${RELOCATING-0} : { *(.rela.got2) }
-"
-
-# 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} "*)
- 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
+GOT=".got ${RELOCATING-0} : SPECIAL { *(.got) }"
+PLT=".plt ${RELOCATING-0} : SPECIAL { *(.plt) }"
+GOTPLT="${PLT}"
+OTHER_TEXT_SECTIONS="*(.glink)"
+EXTRA_EM_FILE=ppc32elf
diff --git a/contrib/binutils/ld/emulparams/elf32ppccommon.sh b/contrib/binutils/ld/emulparams/elf32ppccommon.sh
new file mode 100644
index 0000000..b5fbc8d
--- /dev/null
+++ b/contrib/binutils/ld/emulparams/elf32ppccommon.sh
@@ -0,0 +1,49 @@
+# The PLT-agnostic parts of a generic 32-bit ELF PowerPC target. Included by:
+# elf32ppc.sh elf32ppcvxworks.sh
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-powerpc"
+TEXT_START_ADDR=0x01800000
+MAXPAGESIZE=0x10000
+COMMONPAGESIZE=0x1000
+ARCH=powerpc:common
+MACHINE=
+EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);'
+if test -z "${CREATE_SHLIB}"; then
+ SDATA_START_SYMBOLS="PROVIDE (_SDA_BASE_ = 32768);"
+ SDATA2_START_SYMBOLS="PROVIDE (_SDA2_BASE_ = 32768);"
+ SBSS_START_SYMBOLS="PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);"
+ SBSS_END_SYMBOLS="PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);"
+else
+ unset SDATA_START_SYMBOLS
+ unset SDATA2_START_SYMBOLS
+ unset SBSS_START_SYMBOLS
+ unset SBSS_END_SYMBOLS
+fi
+OTHER_END_SYMBOLS="__end = .;"
+OTHER_RELRO_SECTIONS="
+ .fixup ${RELOCATING-0} : { *(.fixup) }
+ .got1 ${RELOCATING-0} : { *(.got1) }
+ .got2 ${RELOCATING-0} : { *(.got2) }
+"
+OTHER_GOT_RELOC_SECTIONS="
+ .rela.got1 ${RELOCATING-0} : { *(.rela.got1) }
+ .rela.got2 ${RELOCATING-0} : { *(.rela.got2) }
+"
+
+# 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} "*)
+ 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/elf32ppclinux.sh b/contrib/binutils/ld/emulparams/elf32ppclinux.sh
index 5ced00d..262731a 100644
--- a/contrib/binutils/ld/emulparams/elf32ppclinux.sh
+++ b/contrib/binutils/ld/emulparams/elf32ppclinux.sh
@@ -1,8 +1,8 @@
. ${srcdir}/emulparams/elf32ppc.sh
TEXT_START_ADDR=0x10000000
unset EXECUTABLE_SYMBOLS
-unset OTHER_BSS_END_SYMBOLS
+unset OTHER_END_SYMBOLS
test -z "${RELOCATING}" || OTHER_SECTIONS="/DISCARD/ : { *(.fixup) }"
-OTHER_READWRITE_SECTIONS="
+OTHER_RELRO_SECTIONS="
.got1 ${RELOCATING-0} : { *(.got1) }
.got2 ${RELOCATING-0} : { *(.got2) }"
diff --git a/contrib/binutils/ld/emulparams/elf64_ia64.sh b/contrib/binutils/ld/emulparams/elf64_ia64.sh
index 60c8c4c..c5be56e 100644
--- a/contrib/binutils/ld/emulparams/elf64_ia64.sh
+++ b/contrib/binutils/ld/emulparams/elf64_ia64.sh
@@ -33,3 +33,7 @@ test -n "$CREATE_PIE" && OTHER_GOT_RELOC_SECTIONS="
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.*}) }"
+# Intel C++ compiler, prior to 9.0, puts small data in .ctors and
+# .dtors. They have to be next to .sbss/.sbss2/.sdata/.sdata2.
+SMALL_DATA_CTOR=" "
+SMALL_DATA_DTOR=" "
diff --git a/contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh b/contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh
index 47cde5c..ab7e78f 100644
--- a/contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh
+++ b/contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh
@@ -1,4 +1,6 @@
. ${srcdir}/emulparams/elf64_ia64.sh
TEXT_START_ADDR="0x2000000000000000"
unset DATA_ADDR
+unset SMALL_DATA_CTOR
+unset SMALL_DATA_DTOR
. ${srcdir}/emulparams/elf_fbsd.sh
diff --git a/contrib/binutils/ld/emulparams/elf64_s390.sh b/contrib/binutils/ld/emulparams/elf64_s390.sh
index 0c689a9..ea75d31 100644
--- a/contrib/binutils/ld/emulparams/elf64_s390.sh
+++ b/contrib/binutils/ld/emulparams/elf64_s390.sh
@@ -3,6 +3,7 @@ ELFSIZE=64
OUTPUT_FORMAT="elf64-s390"
TEXT_START_ADDR=0x80000000
MAXPAGESIZE=0x1000
+COMMONPAGESIZE=0x1000
NONPAGED_TEXT_START_ADDR=0x80000000
ARCH="s390:64-bit"
MACHINE=
diff --git a/contrib/binutils/ld/emulparams/elf64alpha.sh b/contrib/binutils/ld/emulparams/elf64alpha.sh
index 093c8df..47a0bb0 100644
--- a/contrib/binutils/ld/emulparams/elf64alpha.sh
+++ b/contrib/binutils/ld/emulparams/elf64alpha.sh
@@ -12,7 +12,13 @@ ARCH=alpha
MACHINE=
GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
-DATA_PLT=
+
+# Yes, we want duplicate .plt sections. The linker chooses the
+# appropriate one magically in alpha_after_open.
+PLT=".plt ${RELOCATING-0} : SPECIAL { *(.plt) }"
+DATA_PLT=yes
+TEXT_PLT=yes
+
# Note that the number is always big-endian, thus we have to
# reverse the digit string.
NOP=0x0000fe2f1f04ff47 # unop; nop
diff --git a/contrib/binutils/ld/emulparams/elf64ppc.sh b/contrib/binutils/ld/emulparams/elf64ppc.sh
index c190b18..8285723 100644
--- a/contrib/binutils/ld/emulparams/elf64ppc.sh
+++ b/contrib/binutils/ld/emulparams/elf64ppc.sh
@@ -15,13 +15,13 @@ NOP=0x60000000
OTHER_TEXT_SECTIONS="*(.sfpr .glink)"
BSS_PLT=
OTHER_BSS_SYMBOLS="
- .tocbss ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.tocbss)}"
+ .tocbss ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.tocbss)}"
OTHER_PLT_RELOC_SECTIONS="
.rela.tocbss ${RELOCATING-0} : { *(.rela.tocbss) }"
if test x${RELOCATING+set} = xset; then
GOT="
- .got ALIGN(8) : { *(.got .toc) }"
+ .got : ALIGN(8) { *(.got .toc) }"
else
GOT="
.got 0 : { *(.got) }
@@ -30,8 +30,8 @@ fi
OTHER_GOT_RELOC_SECTIONS="
.rela.toc ${RELOCATING-0} : { *(.rela.toc) }"
OTHER_READWRITE_SECTIONS="
- .toc1 ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.toc1) }
- .opd ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { KEEP (*(.opd)) }"
+ .toc1 ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.toc1) }
+ .opd ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { KEEP (*(.opd)) }"
# Treat a host that matches the target with the possible exception of "64"
# in the name as if it were native.
diff --git a/contrib/binutils/ld/emulparams/elf_i386.sh b/contrib/binutils/ld/emulparams/elf_i386.sh
index 2382286..af7010b 100644
--- a/contrib/binutils/ld/emulparams/elf_i386.sh
+++ b/contrib/binutils/ld/emulparams/elf_i386.sh
@@ -11,3 +11,4 @@ TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
NO_SMALL_DATA=yes
+SEPARATE_GOTPLT=12
diff --git a/contrib/binutils/ld/emulparams/elf_s390.sh b/contrib/binutils/ld/emulparams/elf_s390.sh
index e710673..8d057dc 100644
--- a/contrib/binutils/ld/emulparams/elf_s390.sh
+++ b/contrib/binutils/ld/emulparams/elf_s390.sh
@@ -2,6 +2,7 @@ SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-s390"
TEXT_START_ADDR=0x00400000
MAXPAGESIZE=0x1000
+COMMONPAGESIZE=0x1000
NONPAGED_TEXT_START_ADDR=0x00400000
ARCH="s390:31-bit"
MACHINE=
diff --git a/contrib/binutils/ld/emulparams/elf_x86_64.sh b/contrib/binutils/ld/emulparams/elf_x86_64.sh
index 6d37058..35240df 100644
--- a/contrib/binutils/ld/emulparams/elf_x86_64.sh
+++ b/contrib/binutils/ld/emulparams/elf_x86_64.sh
@@ -12,6 +12,8 @@ TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
NO_SMALL_DATA=yes
+LARGE_SECTIONS=yes
+SEPARATE_GOTPLT=24
if [ "x${host}" = "x${target}" ]; then
case " $EMULATION_LIBPATH " in
diff --git a/contrib/binutils/ld/emulparams/i386freebsd.sh b/contrib/binutils/ld/emulparams/i386freebsd.sh
deleted file mode 100644
index 0d5e9ff..0000000
--- a/contrib/binutils/ld/emulparams/i386freebsd.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-SCRIPT_NAME=aout
-TEXT_START_ADDR=0x1020
-OUTPUT_FORMAT="a.out-i386-freebsd"
-TARGET_PAGE_SIZE=0x1000
-ARCH=i386
-EXECUTABLE_SYMBOLS='__DYNAMIC = 0;'
diff --git a/contrib/binutils/ld/emulparams/i386pe.sh b/contrib/binutils/ld/emulparams/i386pe.sh
index a8add23..879379f 100644
--- a/contrib/binutils/ld/emulparams/i386pe.sh
+++ b/contrib/binutils/ld/emulparams/i386pe.sh
@@ -6,3 +6,4 @@ TEMPLATE_NAME=pe
ENTRY="_mainCRTStartup"
SUBSYSTEM=PE_DEF_SUBSYSTEM
INITIAL_SYMBOL_CHAR=\"_\"
+TARGET_PAGE_SIZE=0x1000
diff --git a/contrib/binutils/ld/emulparams/i386pe_posix.sh b/contrib/binutils/ld/emulparams/i386pe_posix.sh
index 37f51b5..afa00de 100644
--- a/contrib/binutils/ld/emulparams/i386pe_posix.sh
+++ b/contrib/binutils/ld/emulparams/i386pe_posix.sh
@@ -7,3 +7,4 @@ ENTRY="___PosixProcessStartup"
SUBSYSTEM=7
EXECUTABLE_NAME=a.out
INITIAL_SYMBOL_CHAR=\"_\"
+TARGET_PAGE_SIZE=0x1000
diff --git a/contrib/binutils/ld/emulparams/mipsidt.sh b/contrib/binutils/ld/emulparams/mipsidt.sh
index 63176f5..f381267 100644
--- a/contrib/binutils/ld/emulparams/mipsidt.sh
+++ b/contrib/binutils/ld/emulparams/mipsidt.sh
@@ -7,5 +7,6 @@ ARCH=mips
ENTRY=start
TEXT_START_ADDR=0xa0012000
DATA_ADDR=.
-TEMPLATE_NAME=mipsecoff
+TEMPLATE_NAME=generic
+EXTRA_EM_FILE=mipsecoff
EMBEDDED=yes
diff --git a/contrib/binutils/ld/emulparams/mipsidtl.sh b/contrib/binutils/ld/emulparams/mipsidtl.sh
index 02279de..52447ff 100644
--- a/contrib/binutils/ld/emulparams/mipsidtl.sh
+++ b/contrib/binutils/ld/emulparams/mipsidtl.sh
@@ -7,5 +7,6 @@ ARCH=mips
ENTRY=start
TEXT_START_ADDR=0xa0012000
DATA_ADDR=.
-TEMPLATE_NAME=mipsecoff
+TEMPLATE_NAME=generic
+EXTRA_EM_FILE=mipsecoff
EMBEDDED=yes
diff --git a/contrib/binutils/ld/emulparams/mipspe.sh b/contrib/binutils/ld/emulparams/mipspe.sh
index 9dd9ce7..a5cfc2e 100644
--- a/contrib/binutils/ld/emulparams/mipspe.sh
+++ b/contrib/binutils/ld/emulparams/mipspe.sh
@@ -7,3 +7,4 @@ TEMPLATE_NAME=pe
SUBSYSTEM=PE_DEF_SUBSYSTEM
INITIAL_SYMBOL_CHAR=\"_\"
ENTRY="_mainCRTStartup"
+TARGET_PAGE_SIZE=0x1000
diff --git a/contrib/binutils/ld/emulparams/ppcpe.sh b/contrib/binutils/ld/emulparams/ppcpe.sh
index a2d09ef..2e1e102 100644
--- a/contrib/binutils/ld/emulparams/ppcpe.sh
+++ b/contrib/binutils/ld/emulparams/ppcpe.sh
@@ -5,3 +5,4 @@ TEMPLATE_NAME=pe
ENTRY="_mainCRTStartup"
SUBSYSTEM=PE_DEF_SUBSYSTEM
INITIAL_SYMBOL_CHAR=\"_\"
+TARGET_PAGE_SIZE=0x1000
diff --git a/contrib/binutils/ld/emultempl/alphaelf.em b/contrib/binutils/ld/emultempl/alphaelf.em
index 7e64323..62eca18 100644
--- a/contrib/binutils/ld/emultempl/alphaelf.em
+++ b/contrib/binutils/ld/emultempl/alphaelf.em
@@ -1,5 +1,5 @@
# This shell script emits a C file. -*- C -*-
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003, 2004, 2005 Free Software Foundation, Inc.
#
# This file is part of GLD, the Gnu Linker.
#
@@ -15,7 +15,7 @@
#
# 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.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#
# This file is sourced from elf32.em, and defines extra alpha
@@ -27,25 +27,76 @@ cat >>e${EMULATION_NAME}.c <<EOF
#include "elf/alpha.h"
#include "elf-bfd.h"
-static int elf64alpha_32bit = 0;
+static bfd_boolean limit_32bit;
+static bfd_boolean disable_relaxation;
+
+extern bfd_boolean elf64_alpha_use_secureplt;
+extern const bfd_target bfd_elf64_alpha_vec;
+extern const bfd_target bfd_elf64_alpha_freebsd_vec;
+
/* Set the start address as in the Tru64 ld. */
#define ALPHA_TEXT_START_32BIT 0x12000000
static void
+alpha_after_open (void)
+{
+ if (link_info.hash->creator == &bfd_elf64_alpha_vec
+ || link_info.hash->creator == &bfd_elf64_alpha_freebsd_vec)
+ {
+ unsigned int num_plt;
+ lang_output_section_statement_type *os;
+ lang_output_section_statement_type *plt_os[2];
+
+ num_plt = 0;
+ for (os = &lang_output_section_statement.head->output_section_statement;
+ os != NULL;
+ os = os->next)
+ {
+ if (os->constraint == SPECIAL && strcmp (os->name, ".plt") == 0)
+ {
+ if (num_plt < 2)
+ plt_os[num_plt] = os;
+ ++num_plt;
+ }
+ }
+
+ if (num_plt == 2)
+ {
+ plt_os[0]->constraint = elf64_alpha_use_secureplt ? 0 : -1;
+ plt_os[1]->constraint = elf64_alpha_use_secureplt ? -1 : 0;
+ }
+ }
+
+ gld${EMULATION_NAME}_after_open ();
+}
+
+static void
alpha_after_parse (void)
{
- if (elf64alpha_32bit && !link_info.shared && !link_info.relocatable)
+ if (limit_32bit && !link_info.shared && !link_info.relocatable)
lang_section_start (".interp",
exp_binop ('+',
exp_intop (ALPHA_TEXT_START_32BIT),
- exp_nameop (SIZEOF_HEADERS, NULL)));
+ exp_nameop (SIZEOF_HEADERS, NULL)),
+ NULL);
+}
+
+static void
+alpha_before_allocation (void)
+{
+ /* Call main function; we're just extending it. */
+ gld${EMULATION_NAME}_before_allocation ();
+
+ /* Add -relax if -O, not -r, and not explicitly disabled. */
+ if (link_info.optimize && !link_info.relocatable && !disable_relaxation)
+ command_line.relax = TRUE;
}
static void
alpha_finish (void)
{
- if (elf64alpha_32bit)
+ if (limit_32bit)
elf_elfheader (output_bfd)->e_flags |= EF_ALPHA_32BIT;
gld${EMULATION_NAME}_finish ();
@@ -56,25 +107,47 @@ EOF
# parse_args and list_options functions.
#
PARSE_AND_LIST_PROLOGUE='
-#define OPTION_TASO 300
+#define OPTION_TASO 300
+#define OPTION_NO_RELAX (OPTION_TASO + 1)
+#define OPTION_SECUREPLT (OPTION_NO_RELAX + 1)
+#define OPTION_NO_SECUREPLT (OPTION_SECUREPLT + 1)
'
PARSE_AND_LIST_LONGOPTS='
- {"taso", no_argument, NULL, OPTION_TASO},
+ { "taso", no_argument, NULL, OPTION_TASO },
+ { "no-relax", no_argument, NULL, OPTION_NO_RELAX },
+ { "secureplt", no_argument, NULL, OPTION_SECUREPLT },
+ { "no-secureplt", no_argument, NULL, OPTION_NO_SECUREPLT },
'
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"));
+ fprintf (file, _("\
+ --taso Load executable in the lower 31-bit addressable\n\
+ virtual address range.\n\
+ --no-relax Do not relax call and gp sequences.\n\
+ --secureplt Force PLT in text segment.\n\
+ --no-secureplt Force PLT in data segment.\n\
+"));
'
PARSE_AND_LIST_ARGS_CASES='
case OPTION_TASO:
- elf64alpha_32bit = 1;
+ limit_32bit = 1;
+ break;
+ case OPTION_NO_RELAX:
+ disable_relaxation = TRUE;
+ break;
+ case OPTION_SECUREPLT:
+ elf64_alpha_use_secureplt = TRUE;
+ break;
+ case OPTION_NO_SECUREPLT:
+ elf64_alpha_use_secureplt = FALSE;
break;
'
# Put these extra alpha routines in ld_${EMULATION_NAME}_emulation
#
+LDEMUL_AFTER_OPEN=alpha_after_open
LDEMUL_AFTER_PARSE=alpha_after_parse
+LDEMUL_BEFORE_ALLOCATION=alpha_before_allocation
LDEMUL_FINISH=alpha_finish
diff --git a/contrib/binutils/ld/emultempl/armcoff.em b/contrib/binutils/ld/emultempl/armcoff.em
index 468c3b0..d5fd67d 100644
--- a/contrib/binutils/ld/emultempl/armcoff.em
+++ b/contrib/binutils/ld/emultempl/armcoff.em
@@ -5,7 +5,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* emulate the original gld for the given ${EMULATION_NAME}
Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004 Free Software Foundation, Inc.
+ 2004, 2005 Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
This file is part of GLD, the Gnu Linker.
@@ -22,7 +22,7 @@ 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. */
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#define TARGET_IS_${EMULATION_NAME}
@@ -125,6 +125,8 @@ gld${EMULATION_NAME}_before_allocation (void)
/* We have seen it all. Allocate it, and carry on */
bfd_arm_allocate_interworking_sections (& link_info);
+
+ before_allocation_default ();
}
static void
@@ -191,6 +193,8 @@ gld${EMULATION_NAME}_finish (void)
}
else
einfo (_("%P: warning: connot find thumb start symbol %s\n"), thumb_entry_symbol);
+
+ finish_default ();
}
static char *
diff --git a/contrib/binutils/ld/emultempl/armelf.em b/contrib/binutils/ld/emultempl/armelf.em
index 0c051ad..bd74ab5 100644
--- a/contrib/binutils/ld/emultempl/armelf.em
+++ b/contrib/binutils/ld/emultempl/armelf.em
@@ -1,5 +1,6 @@
# This shell script emits a C file. -*- C -*-
-# Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004
+# Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+# 2004, 2005
# Free Software Foundation, Inc.
#
# This file is part of GLD, the Gnu Linker.
@@ -16,17 +17,24 @@
#
# 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.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#
# This file is sourced from elf32.em, and defines extra arm-elf
# specific routines.
#
+test -z "$TARGET2_TYPE" && TARGET2_TYPE="rel"
cat >>e${EMULATION_NAME}.c <<EOF
-static int no_pipeline_knowledge = 0;
+#include "elf/arm.h"
+
static char *thumb_entry_symbol = NULL;
static bfd *bfd_for_interwork;
+static int byteswap_code = 0;
+static int target1_is_rel = 0${TARGET1_IS_REL};
+static char *target2_type = "${TARGET2_TYPE}";
+static int fix_v4bx = 0;
+static int use_blx = 0;
static void
gld${EMULATION_NAME}_before_parse (void)
@@ -65,20 +73,27 @@ arm_elf_after_open (void)
static void
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)
+ if (statement->header.type == lang_input_section_enum)
{
asection *i = statement->input_section.section;
- asection *output_section = i->output_section;
-
- ASSERT (output_section->owner == output_bfd);
- if ((output_section->flags & SEC_HAS_CONTENTS) != 0
- && (i->flags & SEC_NEVER_LOAD) == 0
- && ! i->owner->output_has_begun)
+ if (!((lang_input_statement_type *) i->owner->usrdata)->just_syms_flag
+ && (i->flags & SEC_EXCLUDE) == 0)
{
- bfd_for_interwork = i->owner;
- bfd_for_interwork->output_has_begun = TRUE;
+ asection *output_section = i->output_section;
+
+ ASSERT (output_section->owner == output_bfd);
+
+ /* Don't attach the interworking stubs to a dynamic object, to
+ an empty section, etc. */
+ if ((output_section->flags & SEC_HAS_CONTENTS) != 0
+ && (i->flags & SEC_NEVER_LOAD) == 0
+ && ! (i->owner->flags & DYNAMIC)
+ && ! i->owner->output_has_begun)
+ {
+ bfd_for_interwork = i->owner;
+ bfd_for_interwork->output_has_begun = TRUE;
+ }
}
}
}
@@ -117,7 +132,7 @@ arm_elf_before_allocation (void)
LANG_FOR_EACH_INPUT_STATEMENT (is)
{
if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, & link_info,
- no_pipeline_knowledge))
+ byteswap_code))
{
/* xgettext:c-format */
einfo (_("Errors encountered processing file %s"), is->filename);
@@ -137,11 +152,25 @@ arm_elf_finish (void)
/* Call the elf32.em routine. */
gld${EMULATION_NAME}_finish ();
- if (thumb_entry_symbol == NULL)
- return;
+ if (thumb_entry_symbol)
+ {
+ h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol,
+ FALSE, FALSE, TRUE);
+ }
+ else
+ {
+ struct elf_link_hash_entry * eh;
+
+ if (!entry_symbol.name)
+ return;
+
+ h = bfd_link_hash_lookup (link_info.hash, entry_symbol.name,
+ FALSE, FALSE, TRUE);
+ eh = (struct elf_link_hash_entry *)h;
+ if (!h || ELF_ST_TYPE(eh->type) != STT_ARM_TFUNC)
+ return;
+ }
- 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
@@ -167,7 +196,8 @@ arm_elf_finish (void)
sprintf_vma (buffer + 2, val);
- if (entry_symbol.name != NULL && entry_from_cmdline)
+ if (thumb_entry_symbol != NULL && entry_symbol.name != NULL
+ && entry_from_cmdline)
einfo (_("%P: warning: '--thumb-entry %s' is overriding '-e %s'\n"),
thumb_entry_symbol, entry_symbol.name);
entry_symbol.name = buffer;
@@ -177,6 +207,15 @@ arm_elf_finish (void)
thumb_entry_symbol);
}
+/* This is a convenitent point to tell BFD about target specific flags.
+ After the output has been created, but before inputs are read. */
+static void
+arm_elf_create_output_section_statements (void)
+{
+ bfd_elf32_arm_set_target_relocs (&link_info, target1_is_rel, target2_type,
+ fix_v4bx, use_blx);
+}
+
EOF
# Define some shell vars to insert bits of code into the standard elf
@@ -184,6 +223,12 @@ EOF
#
PARSE_AND_LIST_PROLOGUE='
#define OPTION_THUMB_ENTRY 301
+#define OPTION_BE8 302
+#define OPTION_TARGET1_REL 303
+#define OPTION_TARGET1_ABS 304
+#define OPTION_TARGET2 305
+#define OPTION_FIX_V4BX 306
+#define OPTION_USE_BLX 307
'
PARSE_AND_LIST_SHORTOPTS=p
@@ -191,27 +236,63 @@ PARSE_AND_LIST_SHORTOPTS=p
PARSE_AND_LIST_LONGOPTS='
{ "no-pipeline-knowledge", no_argument, NULL, '\'p\''},
{ "thumb-entry", required_argument, NULL, OPTION_THUMB_ENTRY},
+ { "be8", no_argument, NULL, OPTION_BE8},
+ { "target1-rel", no_argument, NULL, OPTION_TARGET1_REL},
+ { "target1-abs", no_argument, NULL, OPTION_TARGET1_ABS},
+ { "target2", required_argument, NULL, OPTION_TARGET2},
+ { "fix-v4bx", no_argument, NULL, OPTION_FIX_V4BX},
+ { "use-blx", no_argument, NULL, OPTION_USE_BLX},
'
PARSE_AND_LIST_OPTIONS='
- fprintf (file, _(" -p --no-pipeline-knowledge Stop the linker knowing about the pipeline length\n"));
fprintf (file, _(" --thumb-entry=<sym> Set the entry point to be Thumb symbol <sym>\n"));
+ fprintf (file, _(" --be8 Oputput BE8 format image\n"));
+ fprintf (file, _(" --target1=rel Interpret R_ARM_TARGET1 as R_ARM_REL32\n"));
+ fprintf (file, _(" --target1=abs Interpret R_ARM_TARGET1 as R_ARM_ABS32\n"));
+ fprintf (file, _(" --target2=<type> Specify definition of R_ARM_TARGET2\n"));
+ fprintf (file, _(" --fix-v4bx Rewrite BX rn as MOV pc, rn for ARMv4\n"));
+ fprintf (file, _(" --use-blx Enable use of BLX instructions\n"));
'
PARSE_AND_LIST_ARGS_CASES='
case '\'p\'':
- no_pipeline_knowledge = 1;
+ /* Only here for backwards compatibility. */
break;
case OPTION_THUMB_ENTRY:
thumb_entry_symbol = optarg;
break;
+
+ case OPTION_BE8:
+ byteswap_code = 1;
+ break;
+
+ case OPTION_TARGET1_REL:
+ target1_is_rel = 1;
+ break;
+
+ case OPTION_TARGET1_ABS:
+ target1_is_rel = 0;
+ break;
+
+ case OPTION_TARGET2:
+ target2_type = optarg;
+ break;
+
+ case OPTION_FIX_V4BX:
+ fix_v4bx = 1;
+ break;
+
+ case OPTION_USE_BLX:
+ use_blx = 1;
+ break;
'
# We have our own after_open and before_allocation functions, but they call
# the standard routines, so give them a different name.
LDEMUL_AFTER_OPEN=arm_elf_after_open
LDEMUL_BEFORE_ALLOCATION=arm_elf_before_allocation
+LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=arm_elf_create_output_section_statements
# Replace the elf before_parse function with our own.
LDEMUL_BEFORE_PARSE=gld"${EMULATION_NAME}"_before_parse
diff --git a/contrib/binutils/ld/emultempl/armelf_oabi.em b/contrib/binutils/ld/emultempl/armelf_oabi.em
deleted file mode 100644
index d75c658..0000000
--- a/contrib/binutils/ld/emultempl/armelf_oabi.em
+++ /dev/null
@@ -1,176 +0,0 @@
-# This shell script emits a C file. -*- C -*-
-# It does some substitutions.
-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, 2003,
- 2004 Free Software Foundation, Inc.
- Written by Steve Chamberlain steve@cygnus.com
-
-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. */
-
-#define TARGET_IS_${EMULATION_NAME}
-
-#define bfd_elf32_arm_allocate_interworking_sections \
- bfd_elf32_arm_oabi_allocate_interworking_sections
-#define bfd_elf32_arm_get_bfd_for_interworking \
- bfd_elf32_arm_oabi_get_bfd_for_interworking
-#define bfd_elf32_arm_process_before_allocation \
- bfd_elf32_arm_oabi_process_before_allocation
-
-#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"
-
-static void
-gld${EMULATION_NAME}_before_parse (void)
-{
-#ifndef TARGET_ /* I.e., if not generic. */
- ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
-#endif /* not TARGET_ */
-}
-
-/* This is called after the sections have been attached to output
- sections, but before any sizes or addresses have been set. */
-
-static void
-gld${EMULATION_NAME}_before_allocation (void)
-{
- /* we should be able to set the size of the interworking stub section */
-
- /* Here we rummage through the found bfds to collect glue information */
- /* FIXME: should this be based on a command line option? krk@cygnus.com */
- {
- LANG_FOR_EACH_INPUT_STATEMENT (is)
- {
- if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, &link_info, 0))
- {
- /* xgettext:c-format */
- einfo (_("Errors encountered processing file %s"), is->filename);
- }
- }
- }
-
- /* We have seen it all. Allocate it, and carry on */
- bfd_elf32_arm_allocate_interworking_sections (& link_info);
-}
-
-static void
-gld${EMULATION_NAME}_after_open (void)
-{
-
- LANG_FOR_EACH_INPUT_STATEMENT (is)
- {
- /* The interworking bfd must be the last one to be processed */
- if (!is->next)
- bfd_elf32_arm_get_bfd_for_interworking (is->the_bfd, & link_info);
- }
-}
-
-static char *
-gld${EMULATION_NAME}_get_script (int *isfile)
-EOF
-
-if test -n "$COMPILE_IN"
-then
-# Scripts compiled in.
-
-# sed commands to quote an ld script as a C string.
-sc="-f stringify.sed"
-
-cat >>e${EMULATION_NAME}.c <<EOF
-{
- *isfile = 0;
-
- if (link_info.relocatable && config.build_constructors)
- return
-EOF
-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.relocatable && config.build_constructors)
- return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocatable)
- return "ldscripts/${EMULATION_NAME}.xr";
- else if (!config.text_read_only)
- return "ldscripts/${EMULATION_NAME}.xbn";
- else if (!config.magic_demand_paged)
- return "ldscripts/${EMULATION_NAME}.xn";
- else
- return "ldscripts/${EMULATION_NAME}.x";
-}
-EOF
-
-fi
-
-cat >>e${EMULATION_NAME}.c <<EOF
-
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
-{
- gld${EMULATION_NAME}_before_parse,
- syslib_default,
- hll_default,
- after_parse_default,
- gld${EMULATION_NAME}_after_open,
- after_allocation_default,
- set_output_arch_default,
- ldemul_default_target,
- gld${EMULATION_NAME}_before_allocation,
- gld${EMULATION_NAME}_get_script,
- "${EMULATION_NAME}",
- "${OUTPUT_FORMAT}",
- NULL, /* finish */
- NULL, /* create output section statements */
- NULL, /* open dynamic archive */
- NULL, /* place orphan */
- NULL, /* set symbols */
- NULL, /* parse args */
- NULL, /* add_options */
- NULL, /* handle_option */
- NULL, /* unrecognized file */
- NULL, /* list options */
- NULL, /* recognized file */
- NULL, /* find_potential_libraries */
- NULL /* new_vers_pattern */
-};
-EOF
diff --git a/contrib/binutils/ld/emultempl/elf32.em b/contrib/binutils/ld/emultempl/elf32.em
index b970e56..1925979 100644
--- a/contrib/binutils/ld/emultempl/elf32.em
+++ b/contrib/binutils/ld/emultempl/elf32.em
@@ -1,6 +1,3 @@
-# $FreeBSD$
-
-
# This shell script emits a C file. -*- C -*-
# It does some substitutions.
# This file is now misnamed, because it supports both 32 bit and 64 bit
@@ -16,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, 2003, 2004 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
ELF support by Ian Lance Taylor <ian@cygnus.com>
@@ -34,10 +31,11 @@ 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. */
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#define TARGET_IS_${EMULATION_NAME}
+#include "config.h"
#include "bfd.h"
#include "sysdep.h"
#include "libiberty.h"
@@ -55,17 +53,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ldemul.h"
#include <ldgram.h>
#include "elf/common.h"
+#include "elf-bfd.h"
/* 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);
+static bfd_boolean gld${EMULATION_NAME}_place_orphan (asection *s);
+static void gld${EMULATION_NAME}_layout_sections_again (void);
+static void gld${EMULATION_NAME}_finish (void) ATTRIBUTE_UNUSED;
EOF
+if [ "x${USE_LIBPATH}" = xyes ] ; then
+ case ${target} in
+ *-*-linux-* | *-*-k*bsd*-*)
+ cat >>e${EMULATION_NAME}.c <<EOF
+#ifdef HAVE_GLOB
+#include <glob.h>
+#endif
+EOF
+ ;;
+ esac
+fi
+
# Import any needed special functions and/or overrides.
#
if test -n "$EXTRA_EM_FILE" ; then
@@ -99,14 +110,30 @@ cat >>e${EMULATION_NAME}.c <<EOF
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;
+ int class = 0;
/* 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);
+ if (entry->as_needed)
+ class = DYN_AS_NEEDED;
+
+ /* Tell the ELF linker that we don't want the output file to have a
+ DT_NEEDED entry for any dynamic library in DT_NEEDED tags from
+ this file at all. */
+ if (!entry->add_needed)
+ class |= DYN_NO_ADD_NEEDED;
+
+ if (entry->just_syms_flag
+ && (bfd_get_file_flags (entry->the_bfd) & DYNAMIC) != 0)
+ einfo (_("%P%F: --just-symbols may not be used on DSO: %B\n"),
+ entry->the_bfd);
+
+ if (!class
+ || (bfd_get_file_flags (entry->the_bfd) & DYNAMIC) == 0)
+ return FALSE;
+
+ bfd_elf_set_dyn_lib_class (entry->the_bfd, class);
/* Continue on with normal load_symbols processing. */
return FALSE;
@@ -121,7 +148,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
static struct bfd_link_needed_list *global_needed;
static struct stat global_stat;
-static bfd_boolean global_found;
+static lang_input_statement_type *global_found;
static struct bfd_link_needed_list *global_vercheck_needed;
static bfd_boolean global_vercheck_failed;
@@ -202,21 +229,34 @@ gld${EMULATION_NAME}_stat_needed (lang_input_statement_type *s)
const char *suffix;
const char *soname;
- if (global_found)
+ if (global_found != NULL)
return;
if (s->the_bfd == NULL)
return;
+ /* If this input file was an as-needed entry, and wasn't found to be
+ needed at the stage it was linked, then don't say we have loaded it. */
+ if ((bfd_elf_get_dyn_lib_class (s->the_bfd) & DYN_AS_NEEDED) != 0)
+ return;
+
if (bfd_stat (s->the_bfd, &st) != 0)
{
einfo ("%P:%B: bfd_stat failed: %E\n", s->the_bfd);
return;
}
+ /* Some operating systems, e.g. Windows, do not provide a meaningful
+ st_ino; they always set it to zero. (Windows does provide a
+ meaningful st_dev.) Do not indicate a duplicate library in that
+ case. While there is no guarantee that a system that provides
+ meaningful inode numbers will never set st_ino to zero, this is
+ merely an optimization, so we do not need to worry about false
+ negatives. */
if (st.st_dev == global_stat.st_dev
- && st.st_ino == global_stat.st_ino)
+ && st.st_ino == global_stat.st_ino
+ && st.st_ino != 0)
{
- global_found = TRUE;
+ global_found = s;
return;
}
@@ -245,16 +285,24 @@ gld${EMULATION_NAME}_stat_needed (lang_input_statement_type *s)
global_needed->name, global_needed->by, soname);
}
+struct dt_needed
+{
+ bfd *by;
+ const char *name;
+};
/* This function is called for each possible name for a dynamic object
named by a DT_NEEDED entry. The FORCE parameter indicates whether
to skip the check for a conflicting version. */
static bfd_boolean
-gld${EMULATION_NAME}_try_needed (const char *name, int force)
+gld${EMULATION_NAME}_try_needed (struct dt_needed *needed,
+ int force)
{
bfd *abfd;
+ const char *name = needed->name;
const char *soname;
+ int class;
abfd = bfd_openr (name, bfd_get_target (output_bfd));
if (abfd == NULL)
@@ -311,7 +359,7 @@ gld${EMULATION_NAME}_try_needed (const char *name, int force)
EOF
case ${target} in
- *-*-linux-gnu*)
+ *-*-linux-* | *-*-k*bsd*-*)
cat >>e${EMULATION_NAME}.c <<EOF
{
struct bfd_link_needed_list *l;
@@ -352,9 +400,9 @@ cat >>e${EMULATION_NAME}.c <<EOF
if (trace_file_tries)
info_msg (_("found %s at %s\n"), soname, name);
- global_found = FALSE;
+ global_found = NULL;
lang_for_each_input_file (gld${EMULATION_NAME}_stat_needed);
- if (global_found)
+ if (global_found != NULL)
{
/* Return TRUE to indicate that we found the file, even though
we aren't going to do anything with it. */
@@ -367,7 +415,16 @@ cat >>e${EMULATION_NAME}.c <<EOF
/* 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);
+ class = DYN_DT_NEEDED;
+
+ /* Tell the ELF linker that we don't want the output file to have a
+ DT_NEEDED entry for this file at all if the entry is from a file
+ with DYN_NO_ADD_NEEDED. */
+ if (needed->by != NULL
+ && (bfd_elf_get_dyn_lib_class (needed->by) & DYN_NO_ADD_NEEDED) != 0)
+ class |= DYN_NO_NEEDED | DYN_NO_ADD_NEEDED;
+
+ bfd_elf_set_dyn_lib_class (abfd, class);
/* Add this file into the symbol table. */
if (! bfd_link_add_symbols (abfd, &link_info))
@@ -380,16 +437,23 @@ cat >>e${EMULATION_NAME}.c <<EOF
/* Search for a needed file in a path. */
static bfd_boolean
-gld${EMULATION_NAME}_search_needed (const char *path, const char *name, int force)
+gld${EMULATION_NAME}_search_needed (const char *path,
+ struct dt_needed *n, int force)
{
const char *s;
+ const char *name = n->name;
size_t len;
+ struct dt_needed needed;
if (name[0] == '/')
- return gld${EMULATION_NAME}_try_needed (name, force);
+ return gld${EMULATION_NAME}_try_needed (n, force);
if (path == NULL || *path == '\0')
return FALSE;
+
+ needed.by = n->by;
+ needed.name = n->name;
+
len = strlen (name);
while (1)
{
@@ -410,7 +474,8 @@ gld${EMULATION_NAME}_search_needed (const char *path, const char *name, int forc
}
strcpy (sset, name);
- if (gld${EMULATION_NAME}_try_needed (filename, force))
+ needed.name = filename;
+ if (gld${EMULATION_NAME}_try_needed (&needed, force))
return TRUE;
free (filename);
@@ -466,20 +531,23 @@ gld${EMULATION_NAME}_add_sysroot (const char *path)
EOF
case ${target} in
- *-*-freebsd*)
+ *-*-freebsd* | *-*-dragonfly*)
cat >>e${EMULATION_NAME}.c <<EOF
-/*
- * Read the system search path the FreeBSD way rather than like Linux.
- */
+/* Read the system search path the FreeBSD way rather than the Linux way. */
+#ifdef HAVE_ELF_HINTS_H
#include <elf-hints.h>
+#else
+#include "elf-hints-local.h"
+#endif
static bfd_boolean
gld${EMULATION_NAME}_check_ld_elf_hints (const char *name, int force)
{
static bfd_boolean initialized;
static char *ld_elf_hints;
+ struct dt_needed needed;
- if (! initialized)
+ if (!initialized)
{
FILE *f;
char *tmppath;
@@ -491,26 +559,20 @@ gld${EMULATION_NAME}_check_ld_elf_hints (const char *name, int force)
{
struct elfhints_hdr hdr;
- if (fread(&hdr, 1, sizeof(hdr), f) == sizeof(hdr) &&
- hdr.magic == ELFHINTS_MAGIC &&
- hdr.version == 1)
+ if (fread (&hdr, 1, sizeof (hdr), f) == sizeof (hdr)
+ && hdr.magic == ELFHINTS_MAGIC
+ && hdr.version == 1)
{
- if (fseek(f, hdr.strtab + hdr.dirlist, SEEK_SET) != -1)
+ if (fseek (f, hdr.strtab + hdr.dirlist, SEEK_SET) != -1)
{
char *b;
- b = (char *) xmalloc (hdr.dirlistlen + 1);
- if (fread(b, 1, hdr.dirlistlen + 1, f) !=
+ b = xmalloc (hdr.dirlistlen + 1);
+ if (fread (b, 1, hdr.dirlistlen + 1, f) ==
hdr.dirlistlen + 1)
- {
- free(b);
- b = NULL;
- }
- else
- {
- ld_elf_hints = gld${EMULATION_NAME}_add_sysroot (b);
- free (b);
- }
+ ld_elf_hints = gld${EMULATION_NAME}_add_sysroot (b);
+
+ free (b);
}
}
fclose (f);
@@ -522,98 +584,219 @@ gld${EMULATION_NAME}_check_ld_elf_hints (const char *name, int force)
if (ld_elf_hints == NULL)
return FALSE;
- return gld${EMULATION_NAME}_search_needed (ld_elf_hints, name, force);
+ needed.by = NULL;
+ needed.name = name;
+ return gld${EMULATION_NAME}_search_needed (ld_elf_hints, & needed,
+ force);
}
EOF
# FreeBSD
;;
- *-*-linux-gnu*)
+ *-*-linux-* | *-*-k*bsd*-*)
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. */
+struct gld${EMULATION_NAME}_ld_so_conf
+{
+ char *path;
+ size_t len, alloc;
+};
+
static bfd_boolean
-gld${EMULATION_NAME}_check_ld_so_conf (const char *name, int force)
+gld${EMULATION_NAME}_parse_ld_so_conf
+ (struct gld${EMULATION_NAME}_ld_so_conf *info, const char *filename);
+
+static void
+gld${EMULATION_NAME}_parse_ld_so_conf_include
+ (struct gld${EMULATION_NAME}_ld_so_conf *info, const char *filename,
+ const char *pattern)
{
- static bfd_boolean initialized;
- static char *ld_so_conf;
+ char *newp = NULL;
+#ifdef HAVE_GLOB
+ glob_t gl;
+#endif
- if (! initialized)
+ if (pattern[0] != '/')
{
- FILE *f;
- char *tmppath;
+ char *p = strrchr (filename, '/');
+ size_t patlen = strlen (pattern) + 1;
- tmppath = concat (ld_sysroot, "/etc/ld.so.conf", NULL);
- f = fopen (tmppath, FOPEN_RT);
- free (tmppath);
- if (f != NULL)
+ newp = xmalloc (p - filename + 1 + patlen);
+ memcpy (newp, filename, p - filename + 1);
+ memcpy (newp + (p - filename + 1), pattern, patlen);
+ pattern = newp;
+ }
+
+#ifdef HAVE_GLOB
+ if (glob (pattern, 0, NULL, &gl) == 0)
+ {
+ size_t i;
+
+ for (i = 0; i < gl.gl_pathc; ++i)
+ gld${EMULATION_NAME}_parse_ld_so_conf (info, gl.gl_pathv[i]);
+ globfree (&gl);
+ }
+#else
+ /* If we do not have glob, treat the pattern as a literal filename. */
+ gld${EMULATION_NAME}_parse_ld_so_conf (info, pattern);
+#endif
+
+ if (newp)
+ free (newp);
+}
+
+static bfd_boolean
+gld${EMULATION_NAME}_parse_ld_so_conf
+ (struct gld${EMULATION_NAME}_ld_so_conf *info, const char *filename)
+{
+ FILE *f = fopen (filename, FOPEN_RT);
+ char *line;
+ size_t linelen;
+
+ if (f == NULL)
+ return FALSE;
+
+ linelen = 256;
+ line = xmalloc (linelen);
+ do
+ {
+ char *p = line, *q;
+
+ /* Normally this would use getline(3), but we need to be portable. */
+ while ((q = fgets (p, linelen - (p - line), f)) != NULL
+ && strlen (q) == linelen - (p - line) - 1
+ && line[linelen - 2] != '\n')
{
- char *b;
- size_t len, alloc;
- int c;
+ line = xrealloc (line, 2 * linelen);
+ p = line + linelen - 1;
+ linelen += linelen;
+ }
- len = 0;
- alloc = 100;
- b = (char *) xmalloc (alloc);
+ if (q == NULL && p == line)
+ break;
+
+ p = strchr (line, '\n');
+ if (p)
+ *p = '\0';
+
+ /* Because the file format does not know any form of quoting we
+ can search forward for the next '#' character and if found
+ make it terminating the line. */
+ p = strchr (line, '#');
+ if (p)
+ *p = '\0';
+
+ /* Remove leading whitespace. NUL is no whitespace character. */
+ p = line;
+ while (*p == ' ' || *p == '\f' || *p == '\r' || *p == '\t' || *p == '\v')
+ ++p;
- while ((c = getc (f)) != EOF)
+ /* If the line is blank it is ignored. */
+ if (p[0] == '\0')
+ continue;
+
+ if (!strncmp (p, "include", 7) && (p[7] == ' ' || p[7] == '\t'))
+ {
+ char *dir, c;
+ p += 8;
+ do
{
- if (len + 1 >= alloc)
- {
- alloc *= 2;
- b = (char *) xrealloc (b, alloc);
- }
- if (c != ':'
- && c != ' '
- && c != '\t'
- && c != '\n'
- && c != ',')
- {
- b[len] = c;
- ++len;
- }
- else
- {
- if (len > 0 && b[len - 1] != ':')
- {
- b[len] = ':';
- ++len;
- }
- }
- }
+ while (*p == ' ' || *p == '\t')
+ ++p;
+
+ if (*p == '\0')
+ break;
+
+ dir = p;
- if (len > 0 && b[len - 1] == ':')
- --len;
+ while (*p != ' ' && *p != '\t' && *p)
+ ++p;
- if (len > 0)
- b[len] = '\0';
+ c = *p;
+ *p++ = '\0';
+ if (dir[0] != '\0')
+ gld${EMULATION_NAME}_parse_ld_so_conf_include (info, filename,
+ dir);
+ }
+ while (c != '\0');
+ }
+ else
+ {
+ char *dir = p;
+ while (*p && *p != '=' && *p != ' ' && *p != '\t' && *p != '\f'
+ && *p != '\r' && *p != '\v')
+ ++p;
+
+ while (p != dir && p[-1] == '/')
+ --p;
+ if (info->path == NULL)
+ {
+ info->alloc = p - dir + 1 + 256;
+ info->path = xmalloc (info->alloc);
+ info->len = 0;
+ }
else
{
- free (b);
- b = NULL;
+ if (info->len + 1 + (p - dir) >= info->alloc)
+ {
+ info->alloc += p - dir + 256;
+ info->path = xrealloc (info->path, info->alloc);
+ }
+ info->path[info->len++] = ':';
}
+ memcpy (info->path + info->len, dir, p - dir);
+ info->len += p - dir;
+ info->path[info->len] = '\0';
+ }
+ }
+ while (! feof (f));
+ free (line);
+ fclose (f);
+ return TRUE;
+}
- fclose (f);
+static bfd_boolean
+gld${EMULATION_NAME}_check_ld_so_conf (const char *name, int force)
+{
+ static bfd_boolean initialized;
+ static char *ld_so_conf;
+ struct dt_needed needed;
- if (b)
- {
- char *d = gld${EMULATION_NAME}_add_sysroot (b);
- free (b);
- b = d;
- }
+ if (! initialized)
+ {
+ char *tmppath;
+ struct gld${EMULATION_NAME}_ld_so_conf info;
- ld_so_conf = b;
+ info.path = NULL;
+ info.len = info.alloc = 0;
+ tmppath = concat (ld_sysroot, "${prefix}/etc/ld.so.conf", NULL);
+ if (!gld${EMULATION_NAME}_parse_ld_so_conf (&info, tmppath))
+ {
+ free (tmppath);
+ tmppath = concat (ld_sysroot, "/etc/ld.so.conf", NULL);
+ gld${EMULATION_NAME}_parse_ld_so_conf (&info, tmppath);
}
+ free (tmppath);
+ if (info.path)
+ {
+ char *d = gld${EMULATION_NAME}_add_sysroot (info.path);
+ free (info.path);
+ ld_so_conf = d;
+ }
initialized = TRUE;
}
if (ld_so_conf == NULL)
return FALSE;
- return gld${EMULATION_NAME}_search_needed (ld_so_conf, name, force);
+
+ needed.by = NULL;
+ needed.name = name;
+ return gld${EMULATION_NAME}_search_needed (ld_so_conf, &needed, force);
}
EOF
@@ -628,43 +811,46 @@ cat >>e${EMULATION_NAME}.c <<EOF
static void
gld${EMULATION_NAME}_check_needed (lang_input_statement_type *s)
{
- if (global_found)
+ const char *soname;
+
+ /* Stop looking if we've found a loaded lib. */
+ if (global_found != NULL
+ && (bfd_elf_get_dyn_lib_class (global_found->the_bfd)
+ & DYN_AS_NEEDED) == 0)
return;
- if (s->filename != NULL)
- {
- const char *f;
+ if (s->filename == NULL || s->the_bfd == NULL)
+ return;
- if (strcmp (s->filename, global_needed->name) == 0)
- {
- global_found = TRUE;
- return;
- }
+ /* Don't look for a second non-loaded as-needed lib. */
+ if (global_found != NULL
+ && (bfd_elf_get_dyn_lib_class (s->the_bfd) & DYN_AS_NEEDED) != 0)
+ return;
- if (s->search_dirs_flag)
- {
- f = strrchr (s->filename, '/');
- if (f != NULL
- && strcmp (f + 1, global_needed->name) == 0)
- {
- global_found = TRUE;
- return;
- }
- }
+ if (strcmp (s->filename, global_needed->name) == 0)
+ {
+ global_found = s;
+ return;
}
- if (s->the_bfd != NULL)
+ if (s->search_dirs_flag)
{
- const char *soname;
-
- soname = bfd_elf_get_dt_soname (s->the_bfd);
- if (soname != NULL
- && strcmp (soname, global_needed->name) == 0)
+ const char *f = strrchr (s->filename, '/');
+ if (f != NULL
+ && strcmp (f + 1, global_needed->name) == 0)
{
- global_found = TRUE;
+ global_found = s;
return;
}
}
+
+ soname = bfd_elf_get_dt_soname (s->the_bfd);
+ if (soname != NULL
+ && strcmp (soname, global_needed->name) == 0)
+ {
+ global_found = s;
+ return;
+ }
}
EOF
@@ -696,25 +882,48 @@ gld${EMULATION_NAME}_after_open (void)
for (l = needed; l != NULL; l = l->next)
{
struct bfd_link_needed_list *ll;
+ struct dt_needed n, nn;
int force;
+ /* If the lib that needs this one was --as-needed and wasn't
+ found to be needed, then this lib isn't needed either. */
+ if (l->by != NULL
+ && (bfd_elf_get_dyn_lib_class (l->by) & DYN_AS_NEEDED) != 0)
+ continue;
+
/* If we've already seen this file, skip it. */
for (ll = needed; ll != l; ll = ll->next)
- if (strcmp (ll->name, l->name) == 0)
+ if ((ll->by == NULL
+ || (bfd_elf_get_dyn_lib_class (ll->by) & DYN_AS_NEEDED) == 0)
+ && strcmp (ll->name, l->name) == 0)
break;
if (ll != l)
continue;
/* See if this file was included in the link explicitly. */
global_needed = l;
- global_found = FALSE;
+ global_found = NULL;
lang_for_each_input_file (gld${EMULATION_NAME}_check_needed);
- if (global_found)
+ if (global_found != NULL
+ && (bfd_elf_get_dyn_lib_class (global_found->the_bfd)
+ & DYN_AS_NEEDED) == 0)
continue;
+ n.by = l->by;
+ n.name = l->name;
+ nn.by = l->by;
if (trace_file_tries)
info_msg (_("%s needed by %B\n"), l->name, l->by);
+ /* As-needed libs specified on the command line (or linker script)
+ take priority over libs found in search dirs. */
+ if (global_found != NULL)
+ {
+ nn.name = global_found->filename;
+ if (gld${EMULATION_NAME}_try_needed (&nn, TRUE))
+ continue;
+ }
+
/* We need to find this file and include the symbol table. We
want to search for the file in the same way that the dynamic
linker will search. That means that we want to use
@@ -731,9 +940,13 @@ gld${EMULATION_NAME}_after_open (void)
size_t len;
search_dirs_type *search;
EOF
-if [ "x${USE_LIBPATH}" = xyes ] ; then
+if [ "x${NATIVE}" = xyes ] ; then
cat >>e${EMULATION_NAME}.c <<EOF
const char *lib_path;
+EOF
+fi
+if [ "x${USE_LIBPATH}" = xyes ] ; then
+cat >>e${EMULATION_NAME}.c <<EOF
struct bfd_link_needed_list *rp;
int found;
EOF
@@ -741,13 +954,13 @@ fi
cat >>e${EMULATION_NAME}.c <<EOF
if (gld${EMULATION_NAME}_search_needed (command_line.rpath_link,
- l->name, force))
+ &n, force))
break;
EOF
if [ "x${USE_LIBPATH}" = xyes ] ; then
cat >>e${EMULATION_NAME}.c <<EOF
if (gld${EMULATION_NAME}_search_needed (command_line.rpath,
- l->name, force))
+ &n, force))
break;
EOF
fi
@@ -757,12 +970,12 @@ cat >>e${EMULATION_NAME}.c <<EOF
&& command_line.rpath == NULL)
{
lib_path = (const char *) getenv ("LD_RUN_PATH");
- if (gld${EMULATION_NAME}_search_needed (lib_path, l->name,
+ if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
force))
break;
}
lib_path = (const char *) getenv ("LD_LIBRARY_PATH");
- if (gld${EMULATION_NAME}_search_needed (lib_path, l->name, force))
+ if (gld${EMULATION_NAME}_search_needed (lib_path, &n, force))
break;
EOF
fi
@@ -775,7 +988,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
char *tmpname = gld${EMULATION_NAME}_add_sysroot (rp->name);
found = (rp->by == l->by
&& gld${EMULATION_NAME}_search_needed (tmpname,
- l->name,
+ &n,
force));
free (tmpname);
}
@@ -784,26 +997,9 @@ cat >>e${EMULATION_NAME}.c <<EOF
EOF
fi
-cat >>e${EMULATION_NAME}.c <<EOF
- len = strlen (l->name);
- for (search = search_head; search != NULL; search = search->next)
- {
- char *filename;
-
- if (search->cmdline)
- continue;
- filename = (char *) xmalloc (strlen (search->name) + len + 2);
- sprintf (filename, "%s/%s", search->name, l->name);
- if (gld${EMULATION_NAME}_try_needed (filename, force))
- break;
- free (filename);
- }
- if (search != NULL)
- break;
-EOF
if [ "x${USE_LIBPATH}" = xyes ] ; then
case ${target} in
- *-*-freebsd*)
+ *-*-freebsd* | *-*-dragonfly*)
cat >>e${EMULATION_NAME}.c <<EOF
if (gld${EMULATION_NAME}_check_ld_elf_hints (l->name, force))
break;
@@ -811,16 +1007,35 @@ EOF
# FreeBSD
;;
- *-*-linux-gnu*)
+ *-*-linux-* | *-*-k*bsd*-*)
+ # Linux
cat >>e${EMULATION_NAME}.c <<EOF
if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))
break;
+
EOF
- # Linux
;;
esac
fi
cat >>e${EMULATION_NAME}.c <<EOF
+ len = strlen (l->name);
+ for (search = search_head; search != NULL; search = search->next)
+ {
+ char *filename;
+
+ if (search->cmdline)
+ continue;
+ filename = (char *) xmalloc (strlen (search->name) + len + 2);
+ sprintf (filename, "%s/%s", search->name, l->name);
+ nn.name = filename;
+ if (gld${EMULATION_NAME}_try_needed (&nn, force))
+ break;
+ free (filename);
+ }
+ if (search != NULL)
+ break;
+EOF
+cat >>e${EMULATION_NAME}.c <<EOF
}
if (force < 2)
@@ -841,16 +1056,14 @@ cat >>e${EMULATION_NAME}.c <<EOF
static void
gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
{
- struct bfd_link_hash_entry *h;
+ bfd_boolean provide = FALSE;
switch (exp->type.node_class)
{
case etree_provide:
- h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst,
- FALSE, FALSE, FALSE);
- if (h == NULL)
- break;
-
+ provide = TRUE;
+ /* Fall thru */
+ case etree_assign:
/* We call record_link_assignment even if the symbol is defined.
This is because if it is defined by a dynamic object, we
actually want to use the value defined by the linker script,
@@ -858,14 +1071,11 @@ gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
symbols like etext). If the symbol is defined by a regular
object, then, as it happens, calling record_link_assignment
will do no harm. */
-
- /* Fall through. */
- case etree_assign:
if (strcmp (exp->assign.dst, ".") != 0)
{
- if (! (bfd_elf_record_link_assignment
- (output_bfd, &link_info, exp->assign.dst,
- exp->type.node_class == etree_provide ? TRUE : FALSE)))
+ if (!bfd_elf_record_link_assignment (output_bfd, &link_info,
+ exp->assign.dst, provide,
+ exp->assign.hidden))
einfo ("%P%F: failed to record assignment to %s: %E\n",
exp->assign.dst);
}
@@ -912,8 +1122,8 @@ if test x"$LDEMUL_BEFORE_ALLOCATION" != xgld"$EMULATION_NAME"_before_allocation;
ELF_INTERPRETER_SET_DEFAULT="
if (sinterp != NULL)
{
- sinterp->contents = ${ELF_INTERPRETER_NAME};
- sinterp->_raw_size = strlen (sinterp->contents) + 1;
+ sinterp->contents = (unsigned char *) ${ELF_INTERPRETER_NAME};
+ sinterp->size = strlen ((char *) sinterp->contents) + 1;
}
"
@@ -950,13 +1160,14 @@ gld${EMULATION_NAME}_before_allocation (void)
(const char * const *) command_line.auxiliary_filters,
&link_info, &sinterp, lang_elf_version_info)))
einfo ("%P%F: failed to set dynamic section sizes: %E\n");
+
${ELF_INTERPRETER_SET_DEFAULT}
/* Let the user override the dynamic linker we are using. */
if (command_line.interpreter != NULL
&& sinterp != NULL)
{
sinterp->contents = (bfd_byte *) command_line.interpreter;
- sinterp->_raw_size = strlen (command_line.interpreter) + 1;
+ sinterp->size = strlen (command_line.interpreter) + 1;
}
/* Look for any sections named .gnu.warning. As a GNU extensions,
@@ -981,7 +1192,7 @@ ${ELF_INTERPRETER_SET_DEFAULT}
if (s == NULL)
continue;
- sz = bfd_section_size (is->the_bfd, s);
+ sz = s->size;
prefix_len = strlen (gnu_warning_prefix);
msg = xmalloc ((size_t) (prefix_len + sz + 1));
strcpy (msg, gnu_warning_prefix);
@@ -999,9 +1210,18 @@ ${ELF_INTERPRETER_SET_DEFAULT}
/* Clobber the section size, so that we don't waste copying the
warning into the output file. */
- s->_raw_size = 0;
+ s->size = 0;
+
+ /* Also set SEC_EXCLUDE, so that symbols defined in the warning
+ section don't get copied to the output. */
+ s->flags |= SEC_EXCLUDE;
}
}
+
+ before_allocation_default ();
+
+ if (!bfd_elf_size_dynsym_hash_dynstr (output_bfd, &link_info))
+ einfo ("%P%F: failed to set dynamic section sizes: %E\n");
}
EOF
@@ -1089,12 +1309,11 @@ fi
if test x"$LDEMUL_PLACE_ORPHAN" != xgld"$EMULATION_NAME"_place_orphan; then
cat >>e${EMULATION_NAME}.c <<EOF
-/* A variant of lang_output_section_find. Used by place_orphan. */
+/* A variant of lang_output_section_find used by place_orphan. */
static lang_output_section_statement_type *
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;
@@ -1102,10 +1321,12 @@ output_rel_find (asection *sec, int isdyn)
lang_output_section_statement_type *last_rel_alloc = NULL;
int rela = sec->name[4] == 'a';
- for (u = lang_output_section_statement.head; u; u = lookup->next)
+ for (lookup = &lang_output_section_statement.head->output_section_statement;
+ lookup != NULL;
+ lookup = lookup->next)
{
- lookup = &u->output_section_statement;
- if (strncmp (".rel", lookup->name, 4) == 0)
+ if (lookup->constraint != -1
+ && strncmp (".rel", lookup->name, 4) == 0)
{
int lookrela = lookup->name[4] == 'a';
@@ -1145,104 +1366,128 @@ output_rel_find (asection *sec, int isdyn)
return last;
}
-/* Find the last output section before given output statement.
- Used by place_orphan. */
-
-static asection *
-output_prev_sec_find (lang_output_section_statement_type *os)
-{
- asection *s = (asection *) NULL;
- 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)
- {
- lookup = &u->output_section_statement;
- if (lookup == os)
- return s;
-
- if (lookup->bfd_section != NULL && lookup->bfd_section->owner != NULL)
- s = lookup->bfd_section;
- }
-
- return NULL;
-}
-
/* Place an orphan section. We use this to put random SHF_ALLOC
sections in the right segment. */
-struct orphan_save {
- lang_output_section_statement_type *os;
- asection **section;
- lang_statement_union_type **stmt;
- lang_statement_union_type **os_tail;
-};
-
static bfd_boolean
-gld${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s)
+gld${EMULATION_NAME}_place_orphan (asection *s)
{
- static struct orphan_save hold_text;
- static struct orphan_save hold_rodata;
- static struct orphan_save hold_data;
- static struct orphan_save hold_bss;
- static struct orphan_save hold_rel;
- static struct orphan_save hold_interp;
- static struct orphan_save hold_sdata;
- static int count = 1;
+ static struct orphan_save hold[] =
+ {
+ { ".text",
+ SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE,
+ 0, 0, 0, 0 },
+ { ".rodata",
+ SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA,
+ 0, 0, 0, 0 },
+ { ".data",
+ SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_DATA,
+ 0, 0, 0, 0 },
+ { ".bss",
+ SEC_ALLOC,
+ 0, 0, 0, 0 },
+ { 0,
+ SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA,
+ 0, 0, 0, 0 },
+ { ".interp",
+ SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA,
+ 0, 0, 0, 0 },
+ { ".sdata",
+ SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_SMALL_DATA,
+ 0, 0, 0, 0 }
+ };
+ enum orphan_save_index
+ {
+ orphan_text = 0,
+ orphan_rodata,
+ orphan_data,
+ orphan_bss,
+ orphan_rel,
+ orphan_interp,
+ orphan_sdata
+ };
+ static int orphan_init_done = 0;
struct orphan_save *place;
- lang_statement_list_type *old;
- lang_statement_list_type add;
- etree_type *address;
const char *secname;
- const char *ps = NULL;
+ lang_output_section_statement_type *after;
lang_output_section_statement_type *os;
- lang_statement_union_type **os_tail;
- etree_type *load_base;
int isdyn = 0;
+ int iself = s->owner->xvec->flavour == bfd_target_elf_flavour;
+ unsigned int sh_type = iself ? elf_section_type (s) : SHT_NULL;
secname = bfd_get_section_name (s->owner, s);
+
if (! link_info.relocatable
&& link_info.combreloc
- && (s->flags & SEC_ALLOC)
- && strncmp (secname, ".rel", 4) == 0)
+ && (s->flags & SEC_ALLOC))
{
- if (secname[4] == 'a')
- secname = ".rela.dyn";
- else
- secname = ".rel.dyn";
- isdyn = 1;
+ if (iself)
+ switch (sh_type)
+ {
+ case SHT_RELA:
+ secname = ".rela.dyn";
+ isdyn = 1;
+ break;
+ case SHT_REL:
+ secname = ".rel.dyn";
+ isdyn = 1;
+ break;
+ default:
+ break;
+ }
+ else if (strncmp (secname, ".rel", 4) == 0)
+ {
+ secname = secname[4] == 'a' ? ".rela.dyn" : ".rel.dyn";
+ isdyn = 1;
+ }
}
- if (isdyn || (!config.unique_orphan_sections && !unique_section_p (secname)))
+ if (isdyn || (!config.unique_orphan_sections && !unique_section_p (s)))
{
/* Look through the script to see where to place this section. */
os = lang_output_section_find (secname);
if (os != NULL
&& (os->bfd_section == NULL
- || ((s->flags ^ os->bfd_section->flags)
- & (SEC_LOAD | SEC_ALLOC)) == 0))
+ || os->bfd_section->flags == 0
+ || (_bfd_elf_match_sections_by_type (output_bfd,
+ os->bfd_section,
+ s->owner, s)
+ && ((s->flags ^ os->bfd_section->flags)
+ & (SEC_LOAD | SEC_ALLOC)) == 0)))
{
/* 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);
+ name, and its bfd section, if any, has compatible flags.
+ If the section already exists but does not have any flags
+ set, then it has been created by the linker, probably as a
+ result of a --section-start command line switch. */
+ lang_add_section (&os->children, s, os);
return TRUE;
}
}
- if (hold_text.os == NULL)
- hold_text.os = lang_output_section_find (".text");
+ if (!orphan_init_done)
+ {
+ struct orphan_save *ho;
+ for (ho = hold; ho < hold + sizeof (hold) / sizeof (hold[0]); ++ho)
+ if (ho->name != NULL)
+ {
+ ho->os = lang_output_section_find (ho->name);
+ if (ho->os != NULL && ho->os->flags == 0)
+ ho->os->flags = ho->flags;
+ }
+ orphan_init_done = 1;
+ }
/* 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.executable
&& ! link_info.relocatable
&& strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0
- && hold_text.os != NULL)
+ && hold[orphan_text].os != NULL)
{
- lang_add_section (&hold_text.os->children, s, hold_text.os, file);
+ lang_add_section (&hold[orphan_text].os->children, s,
+ hold[orphan_text].os);
return TRUE;
}
@@ -1251,223 +1496,60 @@ gld${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s)
right after the .interp section, so that the PT_NOTE segment is
stored right after the program headers where the OS can read it
in the first page. */
-#define HAVE_SECTION(hold, name) \
-(hold.os != NULL || (hold.os = lang_output_section_find (name)) != NULL)
-
- if ((s->flags & SEC_EXCLUDE) != 0 && !link_info.relocatable)
- {
- if (s->output_section == NULL)
- s->output_section = bfd_abs_section_ptr;
- return TRUE;
- }
place = NULL;
if ((s->flags & SEC_ALLOC) == 0)
;
else if ((s->flags & SEC_LOAD) != 0
- && strncmp (secname, ".note", 5) == 0
- && HAVE_SECTION (hold_interp, ".interp"))
- place = &hold_interp;
- else if ((s->flags & SEC_HAS_CONTENTS) == 0
- && HAVE_SECTION (hold_bss, ".bss"))
- place = &hold_bss;
- else if ((s->flags & SEC_SMALL_DATA) != 0
- && HAVE_SECTION (hold_sdata, ".sdata"))
- place = &hold_sdata;
- else if ((s->flags & SEC_READONLY) == 0
- && HAVE_SECTION (hold_data, ".data"))
- place = &hold_data;
- else if (strncmp (secname, ".rel", 4) == 0
- && (s->flags & SEC_LOAD) != 0
- && (hold_rel.os != 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"))
- place = &hold_rodata;
- else if ((s->flags & (SEC_CODE | SEC_READONLY)) == (SEC_CODE | SEC_READONLY)
- && hold_text.os != NULL)
- place = &hold_text;
-
-#undef HAVE_SECTION
+ && ((iself && sh_type == SHT_NOTE)
+ || (!iself && strncmp (secname, ".note", 5) == 0)))
+ place = &hold[orphan_interp];
+ else if ((s->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
+ place = &hold[orphan_bss];
+ else if ((s->flags & SEC_SMALL_DATA) != 0)
+ place = &hold[orphan_sdata];
+ else if ((s->flags & SEC_READONLY) == 0)
+ place = &hold[orphan_data];
+ else if (((iself && (sh_type == SHT_RELA || sh_type == SHT_REL))
+ || (!iself && strncmp (secname, ".rel", 4) == 0))
+ && (s->flags & SEC_LOAD) != 0)
+ place = &hold[orphan_rel];
+ else if ((s->flags & SEC_CODE) == 0)
+ place = &hold[orphan_rodata];
+ else
+ place = &hold[orphan_text];
+
+ after = NULL;
+ if (place != NULL)
+ {
+ if (place->os == NULL)
+ {
+ if (place->name != NULL)
+ place->os = lang_output_section_find (place->name);
+ else
+ place->os = output_rel_find (s, isdyn);
+ }
+ after = place->os;
+ if (after == NULL)
+ after = lang_output_section_find_by_flags
+ (s, &place->os, _bfd_elf_match_sections_by_type);
+ if (after == NULL)
+ /* *ABS* is always the first output section statement. */
+ after = &lang_output_section_statement.head->output_section_statement;
+ }
/* Choose a unique name for the section. This will be needed if the
same section name appears in the input file with different
loadable or allocatable characteristics. */
if (bfd_get_section_by_name (output_bfd, secname) != NULL)
{
+ static int count = 1;
secname = bfd_get_unique_section_name (output_bfd, secname, &count);
if (secname == NULL)
einfo ("%F%P: place_orphan failed: %E\n");
}
- /* Start building a list of statements for this section.
- First save the current statement pointer. */
- old = stat_ptr;
-
- /* If we have found an appropriate place for the output section
- statements for this orphan, add them to our own private list,
- inserting them later into the global statement list. */
- if (place != NULL)
- {
- stat_ptr = &add;
- lang_list_init (stat_ptr);
- }
-
- address = NULL;
- if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
- address = exp_intop ((bfd_vma) 0);
-
- 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,
- (etree_type *) NULL,
- (etree_type *) NULL,
- load_base);
-
- if (config.build_constructors)
- {
- /* 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 = secname; *ps != '\0'; ps++)
- if (! ISALNUM (*ps) && *ps != '_')
- break;
- if (*ps == '\0')
- {
- char *symname;
- etree_type *e_align;
-
- symname = (char *) xmalloc (ps - secname + sizeof "__start_");
- sprintf (symname, "__start_%s", secname);
- lang_add_assignment (exp_assop ('=', symname,
- exp_unop (ABSOLUTE,
- exp_nameop (NAME, "."))));
- }
- }
-
- lang_add_section (&os->children, s, os, file);
-
- lang_leave_output_section_statement
- ((bfd_vma) 0, "*default*",
- (struct lang_output_section_phdr_list *) NULL, NULL);
-
- if (config.build_constructors && *ps == '\0')
- {
- char *symname;
-
- /* lang_leave_ouput_section_statement resets stat_ptr. Put
- stat_ptr back where we want it. */
- if (place != NULL)
- stat_ptr = &add;
-
- symname = (char *) xmalloc (ps - secname + sizeof "__stop_");
- sprintf (symname, "__stop_%s", secname);
- lang_add_assignment (exp_assop ('=', symname,
- exp_nameop (NAME, ".")));
- }
-
- /* Restore the global list pointer. */
- stat_ptr = old;
-
- if (place != NULL && os->bfd_section != NULL)
- {
- asection *snew, **pps;
-
- snew = os->bfd_section;
-
- /* Shuffle the bfd section list to make the output file look
- neater. This is really only cosmetic. */
- if (place->section == NULL)
- {
- asection *bfd_section = place->os->bfd_section;
-
- /* If the output statement hasn't been used to place
- any input sections (and thus doesn't have an output
- bfd_section), look for the closest prior output statement
- having an output section. */
- if (bfd_section == NULL)
- bfd_section = output_prev_sec_find (place->os);
-
- if (bfd_section != NULL && bfd_section != snew)
- place->section = &bfd_section->next;
- }
-
- if (place->section != NULL)
- {
- /* Unlink the section. */
- for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next)
- ;
- bfd_section_list_remove (output_bfd, pps);
-
- /* Now tack it on to the "place->os" section list. */
- bfd_section_list_insert (output_bfd, place->section, snew);
- }
-
- /* Save the end of this list. Further ophans of this type will
- follow the one we've just added. */
- place->section = &snew->next;
-
- /* The following is non-cosmetic. We try to put the output
- statements in some sort of reasonable order here, because
- they determine the final load addresses of the orphan
- sections. In addition, placing output statements in the
- wrong order may require extra segments. For instance,
- given a typical situation of all read-only sections placed
- in one segment and following that a segment containing all
- the read-write sections, we wouldn't want to place an orphan
- 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
- {
- /* Put it after the last orphan statement we added. */
- *add.tail = *place->stmt;
- *place->stmt = add.head;
- }
-
- /* Fix the global list pointer if we happened to tack our
- new list at the tail. */
- if (*old->tail == add.head)
- old->tail = add.tail;
-
- /* 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;
- }
- }
+ lang_insert_orphan (s, secname, after, place, NULL, NULL);
return TRUE;
}
@@ -1478,23 +1560,27 @@ if test x"$LDEMUL_FINISH" != xgld"$EMULATION_NAME"_finish; then
cat >>e${EMULATION_NAME}.c <<EOF
static void
-gld${EMULATION_NAME}_finish (void)
+gld${EMULATION_NAME}_layout_sections_again (void)
{
- if (bfd_elf_discard_info (output_bfd, &link_info))
- {
- lang_reset_memory_regions ();
+ lang_reset_memory_regions ();
- /* Resize the sections. */
- lang_size_sections (stat_ptr->head, abs_output_section,
- &stat_ptr->head, 0, (bfd_vma) 0, NULL, TRUE);
+ /* Resize the sections. */
+ lang_size_sections (NULL, TRUE);
- /* Redo special stuff. */
- ldemul_after_allocation ();
+ /* 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);
- }
+ /* Do the assignments again. */
+ lang_do_assignments ();
+}
+
+static void
+gld${EMULATION_NAME}_finish (void)
+{
+ if (bfd_elf_discard_info (output_bfd, &link_info))
+ gld${EMULATION_NAME}_layout_sections_again ();
+
+ finish_default ();
}
EOF
fi
@@ -1520,38 +1606,49 @@ cat >>e${EMULATION_NAME}.c <<EOF
if (link_info.relocatable && config.build_constructors)
return
EOF
-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
+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' >> e${EMULATION_NAME}.c
+echo ' && link_info.relro' >> e${EMULATION_NAME}.c
+echo ' && (link_info.flags & DT_BIND_NOW)) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xdw >> e${EMULATION_NAME}.c
echo ' ; else if (link_info.pie && link_info.combreloc) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xdc >> 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
+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' >> e${EMULATION_NAME}.c
+echo ' && link_info.relro' >> e${EMULATION_NAME}.c
+echo ' && (link_info.flags & DT_BIND_NOW)) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xsw >> e${EMULATION_NAME}.c
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 && link_info.relro' >> e${EMULATION_NAME}.c
+echo ' && (link_info.flags & DT_BIND_NOW)) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xw >> 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.
@@ -1577,6 +1674,9 @@ 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
+ && link_info.relro && (link_info.flags & DT_BIND_NOW))
+ return "ldscripts/${EMULATION_NAME}.xdw";
else if (link_info.pie && link_info.combreloc)
return "ldscripts/${EMULATION_NAME}.xdc";
EOF
@@ -1589,6 +1689,9 @@ 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
+ && link_info.relro && (link_info.flags & DT_BIND_NOW))
+ return "ldscripts/${EMULATION_NAME}.xsw";
else if (link_info.shared && link_info.combreloc)
return "ldscripts/${EMULATION_NAME}.xsc";
EOF
@@ -1600,6 +1703,9 @@ EOF
fi
if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
cat >>e${EMULATION_NAME}.c <<EOF
+ else if (link_info.combreloc && link_info.relro
+ && (link_info.flags & DT_BIND_NOW))
+ return "ldscripts/${EMULATION_NAME}.xw";
else if (link_info.combreloc)
return "ldscripts/${EMULATION_NAME}.xc";
EOF
@@ -1627,6 +1733,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
#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)
+#define OPTION_EXCLUDE_LIBS (OPTION_EH_FRAME_HDR + 1)
static void
gld${EMULATION_NAME}_add_options
@@ -1642,6 +1749,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
{"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},
+ {"exclude-libs", required_argument, NULL, OPTION_EXCLUDE_LIBS},
{"Bgroup", no_argument, NULL, OPTION_GROUP},
EOF
fi
@@ -1694,6 +1802,10 @@ cat >>e${EMULATION_NAME}.c <<EOF
link_info.unresolved_syms_in_shared_libs = RM_GENERATE_ERROR;
break;
+ case OPTION_EXCLUDE_LIBS:
+ add_excluded_libs (optarg);
+ break;
+
case 'z':
if (strcmp (optarg, "initfirst") == 0)
link_info.flags_1 |= (bfd_vma) DF_1_INITFIRST;
@@ -1739,6 +1851,10 @@ cat >>e${EMULATION_NAME}.c <<EOF
link_info.noexecstack = TRUE;
link_info.execstack = FALSE;
}
+ else if (strcmp (optarg, "relro") == 0)
+ link_info.relro = TRUE;
+ else if (strcmp (optarg, "norelro") == 0)
+ link_info.relro = FALSE;
/* What about the other Solaris -z options? FIXME. */
break;
EOF
@@ -1786,8 +1902,10 @@ cat >>e${EMULATION_NAME}.c <<EOF
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 norelro\t\tDon't create RELRO program header\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 relro\t\tCreate RELRO program header\n"));
fprintf (file, _(" -z KEYWORD\t\tIgnored for Solaris compatibility\n"));
EOF
fi
diff --git a/contrib/binutils/ld/emultempl/generic.em b/contrib/binutils/ld/emultempl/generic.em
index 4d17ca2..985cdf8 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, 2002, 2003, 2004
+ Copyright 1991, 1992, 1994, 1996, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
@@ -22,7 +22,7 @@ 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. */
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#define TARGET_IS_${EMULATION_NAME}
@@ -131,7 +131,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
${LDEMUL_GET_SCRIPT-gld${EMULATION_NAME}_get_script},
"${EMULATION_NAME}",
"${OUTPUT_FORMAT}",
- ${LDEMUL_FINISH-NULL},
+ ${LDEMUL_FINISH-finish_default},
${LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS-NULL},
${LDEMUL_OPEN_DYNAMIC_ARCHIVE-NULL},
${LDEMUL_PLACE_ORPHAN-NULL},
diff --git a/contrib/binutils/ld/emultempl/ia64elf.em b/contrib/binutils/ld/emultempl/ia64elf.em
index eee467b..ddc5370 100644
--- a/contrib/binutils/ld/emultempl/ia64elf.em
+++ b/contrib/binutils/ld/emultempl/ia64elf.em
@@ -15,7 +15,7 @@
#
# 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.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#
# This file is sourced from elf32.em, and defines extra ia64-elf
@@ -32,7 +32,7 @@ static int itanium = 0;
static void
gld${EMULATION_NAME}_after_parse (void)
{
- link_info.need_relax_finalize = TRUE;
+ link_info.relax_pass = 2;
bfd_elf${ELFSIZE}_ia64_after_parse (itanium);
}
diff --git a/contrib/binutils/ld/emultempl/linux.em b/contrib/binutils/ld/emultempl/linux.em
index d041b68..996a7ea 100644
--- a/contrib/binutils/ld/emultempl/linux.em
+++ b/contrib/binutils/ld/emultempl/linux.em
@@ -9,8 +9,8 @@ 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, 2002, 2003, 2004
- Free Software Foundation, Inc.
+ Copyright 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
+ 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
Linux support by Eric Youngdale <ericy@cais.cais.com>
@@ -28,7 +28,7 @@ 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. */
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#define TARGET_IS_${EMULATION_NAME}
@@ -121,6 +121,8 @@ gld${EMULATION_NAME}_before_allocation (void)
dynamic linking. */
if (! bfd_${EMULATION_NAME}_size_dynamic_sections (output_bfd, &link_info))
einfo ("%P%F: failed to set dynamic section sizes: %E\n");
+
+ before_allocation_default ();
}
static char *
@@ -190,7 +192,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
gld${EMULATION_NAME}_get_script,
"${EMULATION_NAME}",
"${OUTPUT_FORMAT}",
- NULL, /* finish */
+ finish_default,
gld${EMULATION_NAME}_create_output_section_statements,
gld${EMULATION_NAME}_open_dynamic_archive,
NULL, /* place orphan */
diff --git a/contrib/binutils/ld/emultempl/mipsecoff.em b/contrib/binutils/ld/emultempl/mipsecoff.em
index dde33c2..780cc60 100644
--- a/contrib/binutils/ld/emultempl/mipsecoff.em
+++ b/contrib/binutils/ld/emultempl/mipsecoff.em
@@ -1,51 +1,30 @@
# This shell script emits a C file. -*- C -*-
-# It does some substitutions.
+# Copyright 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004
+# 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+#
+
if [ -z "$MACHINE" ]; then
OUTPUT_ARCH=${ARCH}
else
OUTPUT_ARCH=${ARCH}:${MACHINE}
fi
-cat >e${EMULATION_NAME}.c <<EOF
-/* This file is is generated by a shell script. DO NOT EDIT! */
-
-/* Handle embedded relocs for MIPS.
- Copyright 1994, 1995, 1997, 2000, 2002, 2003, 2004
- Free Software Foundation, Inc.
- Written by Ian Lance Taylor <ian@cygnus.com> based on generic.em.
-
-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. */
-
-#define TARGET_IS_${EMULATION_NAME}
-
-#include "bfd.h"
-#include "sysdep.h"
-#include "bfdlink.h"
-
-#include "ld.h"
-#include "ldmain.h"
-#include "ldmisc.h"
-
-#include "ldexp.h"
-#include "ldlang.h"
-#include "ldfile.h"
-#include "ldemul.h"
-
-static void check_sections (bfd *, asection *, void *);
-
+cat >>e${EMULATION_NAME}.c <<EOF
static void
gld${EMULATION_NAME}_before_parse (void)
{
@@ -53,196 +32,6 @@ gld${EMULATION_NAME}_before_parse (void)
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
#endif /* not TARGET_ */
}
-
-/* This function is run after all the input files have been opened.
- We create a .rel.sdata section for each input file with a non zero
- .sdata section. The BFD backend will fill in these sections with
- magic numbers which can be used to relocate the data section at run
- time. This will only do the right thing if all the input files
- have been compiled using -membedded-pic. */
-
-static void
-gld${EMULATION_NAME}_after_open (void)
-{
- bfd *abfd;
-
- if (! command_line.embedded_relocs
- || link_info.relocatable)
- return;
-
- for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
- {
- asection *datasec;
-
- /* As first-order business, make sure that each input BFD is ECOFF. It
- better be, as we are directly calling an ECOFF backend function. */
- if (bfd_get_flavour (abfd) != bfd_target_ecoff_flavour)
- einfo ("%F%B: all input objects must be ECOFF for --embedded-relocs\n");
-
- datasec = bfd_get_section_by_name (abfd, ".sdata");
-
- /* Note that we assume that the reloc_count field has already
- been set up. We could call bfd_get_reloc_upper_bound, but
- that returns the size of a memory buffer rather than a reloc
- count. We do not want to call bfd_canonicalize_reloc,
- because although it would always work it would force us to
- read in the relocs into BFD canonical form, which would waste
- a significant amount of time and memory. */
- if (datasec != NULL && datasec->reloc_count > 0)
- {
- asection *relsec;
-
- relsec = bfd_make_section (abfd, ".rel.sdata");
- if (relsec == NULL
- || ! bfd_set_section_flags (abfd, relsec,
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY))
- || ! bfd_set_section_alignment (abfd, relsec, 2)
- || ! bfd_set_section_size (abfd, relsec,
- datasec->reloc_count * 4))
- einfo ("%F%B: can not create .rel.sdata section: %E\n");
- }
-
- /* Double check that all other data sections are empty, as is
- required for embedded PIC code. */
- bfd_map_over_sections (abfd, check_sections, datasec);
- }
-}
-
-/* Check that of the data sections, only the .sdata section has
- relocs. This is called via bfd_map_over_sections. */
-
-static void
-check_sections (bfd *abfd, asection *sec, void *sdatasec)
-{
- if ((bfd_get_section_flags (abfd, sec) & SEC_CODE) == 0
- && sec != sdatasec
- && sec->reloc_count != 0)
- einfo ("%B%X: section %s has relocs; can not use --embedded-relocs\n",
- abfd, bfd_get_section_name (abfd, sec));
-}
-
-/* This function is called after the section sizes and offsets have
- been set. If we are generating embedded relocs, it calls a special
- BFD backend routine to do the work. */
-
-static void
-gld${EMULATION_NAME}_after_allocation (void)
-{
- bfd *abfd;
-
- if (! command_line.embedded_relocs
- || link_info.relocatable)
- return;
-
- for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
- {
- asection *datasec, *relsec;
- char *errmsg;
-
- datasec = bfd_get_section_by_name (abfd, ".sdata");
-
- if (datasec == NULL || datasec->reloc_count == 0)
- continue;
-
- relsec = bfd_get_section_by_name (abfd, ".rel.sdata");
- ASSERT (relsec != NULL);
-
- if (! bfd_mips_ecoff_create_embedded_relocs (abfd, &link_info,
- datasec, relsec,
- &errmsg))
- {
- if (errmsg == NULL)
- einfo ("%B%X: can not create runtime reloc information: %E\n",
- abfd);
- else
- einfo ("%X%B: can not create runtime reloc information: %s\n",
- abfd, errmsg);
- }
- }
-}
-
-static char *
-gld${EMULATION_NAME}_get_script (int *isfile)
EOF
-if test -n "$COMPILE_IN"
-then
-# Scripts compiled in.
-
-# sed commands to quote an ld script as a C string.
-sc="-f stringify.sed"
-
-cat >>e${EMULATION_NAME}.c <<EOF
-{
- *isfile = 0;
-
- if (link_info.relocatable && config.build_constructors)
- return
-EOF
-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.relocatable && config.build_constructors)
- return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocatable)
- return "ldscripts/${EMULATION_NAME}.xr";
- else if (!config.text_read_only)
- return "ldscripts/${EMULATION_NAME}.xbn";
- else if (!config.magic_demand_paged)
- return "ldscripts/${EMULATION_NAME}.xn";
- else
- return "ldscripts/${EMULATION_NAME}.x";
-}
-EOF
-
-fi
-
-cat >>e${EMULATION_NAME}.c <<EOF
-
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
-{
- gld${EMULATION_NAME}_before_parse,
- syslib_default,
- hll_default,
- after_parse_default,
- gld${EMULATION_NAME}_after_open,
- gld${EMULATION_NAME}_after_allocation,
- set_output_arch_default,
- ldemul_default_target,
- before_allocation_default,
- gld${EMULATION_NAME}_get_script,
- "${EMULATION_NAME}",
- "${OUTPUT_FORMAT}",
- NULL, /* finish */
- NULL, /* create output section statements */
- NULL, /* open dynamic archive */
- NULL, /* place orphan */
- NULL, /* set symbols */
- NULL, /* parse args */
- NULL, /* add_options */
- NULL, /* handle_option */
- NULL, /* unrecognized file */
- NULL, /* list options */
- NULL, /* recognized file */
- NULL, /* find_potential_libraries */
- NULL /* new_vers_pattern */
-};
-EOF
+LDEMUL_BEFORE_PARSE=gld${EMULATION_NAME}_before_parse
diff --git a/contrib/binutils/ld/emultempl/mipself.em b/contrib/binutils/ld/emultempl/mipself.em
deleted file mode 100644
index a950fb1..0000000
--- a/contrib/binutils/ld/emultempl/mipself.em
+++ /dev/null
@@ -1,177 +0,0 @@
-# This shell script emits a C file. -*- C -*-
-# Copyright 2002, 2003 Free Software Foundation, Inc.
-# Written by Mitch Lichtenberg <mpl@broadcom.com> and
-# Chris Demetriou <cgd@broadcom.com> based on m68kelf.em and mipsecoff.em.
-#
-# 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 some extra routines for m68k
-# embedded systems using ELF and for some other systems using m68k ELF. While
-# it is sourced from elf32.em for all m68k ELF configurations, here we include
-# only the features we want depending on the configuration.
-
-case ${target} in
- mips*-*-elf)
- echo "#define SUPPORT_EMBEDDED_RELOCS" >>e${EMULATION_NAME}.c
- ;;
-esac
-
-cat >>e${EMULATION_NAME}.c <<EOF
-
-#ifdef SUPPORT_EMBEDDED_RELOCS
-static void mips_elf${ELFSIZE}_check_sections (bfd *, asection *, void *);
-#endif
-
-/* This function is run after all the input files have been opened. */
-
-static void
-mips_elf${ELFSIZE}_after_open (void)
-{
- /* Call the standard elf routine. */
- gld${EMULATION_NAME}_after_open ();
-
-#ifdef SUPPORT_EMBEDDED_RELOCS
- if (command_line.embedded_relocs && (! link_info.relocatable))
- {
- bfd *abfd;
-
- /* In the embedded relocs mode we create a .rel.sdata section for
- each input file with a .sdata section which has has
- relocations. The BFD backend will fill in these sections
- with magic numbers which can be used to relocate the data
- section at run time. */
- for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
- {
- asection *datasec;
-
- /* As first-order business, make sure that each input BFD is
- ELF. We need to call a special BFD backend function to
- generate the embedded relocs, and we have that function
- only for ELF */
-
- if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
- einfo ("%F%B: all input objects must be ELF for --embedded-relocs\n");
-
- if (bfd_get_arch_size (abfd) != ${ELFSIZE})
- einfo ("%F%B: all input objects must be ${ELFSIZE}-bit ELF for --embedded-relocs\n");
-
- datasec = bfd_get_section_by_name (abfd, ".sdata");
-
- /* Note that we assume that the reloc_count field has already
- been set up. We could call bfd_get_reloc_upper_bound, but
- that returns the size of a memory buffer rather than a reloc
- count. We do not want to call bfd_canonicalize_reloc,
- because although it would always work it would force us to
- read in the relocs into BFD canonical form, which would waste
- a significant amount of time and memory. */
-
- if (datasec != NULL && datasec->reloc_count > 0)
- {
- asection *relsec;
-
- relsec = bfd_make_section (abfd, ".rel.sdata");
- if (relsec == NULL
- || ! bfd_set_section_flags (abfd, relsec,
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY))
- || ! bfd_set_section_alignment (abfd, relsec,
- (${ELFSIZE} == 32) ? 2 : 3)
- || ! bfd_set_section_size (abfd, relsec,
- datasec->reloc_count
- * ((${ELFSIZE} / 8) + 8)))
- einfo ("%F%B: cannot create .rel.sdata section: %E\n");
- }
-
- /* Double check that all other data sections have no relocs,
- as is required for embedded PIC code. */
- bfd_map_over_sections (abfd, mips_elf${ELFSIZE}_check_sections,
- datasec);
- }
- }
-#endif /* SUPPORT_EMBEDDED_RELOCS */
-}
-
-#ifdef SUPPORT_EMBEDDED_RELOCS
-/* Check that of the data sections, only the .sdata section has
- relocs. This is called via bfd_map_over_sections. */
-
-static void
-mips_elf${ELFSIZE}_check_sections (bfd *abfd, asection *sec, void *sdatasec)
-{
- if ((bfd_get_section_flags (abfd, sec) & SEC_DATA)
- && sec != sdatasec
- && sec->reloc_count != 0)
- einfo ("%B%X: section %s has relocs; cannot use --embedded-relocs\n",
- abfd, bfd_get_section_name (abfd, sec));
-}
-#endif /* SUPPORT_EMBEDDED_RELOCS */
-
-/* This function is called after the section sizes and offsets have
- been set. If we are generating embedded relocs, it calls a special
- BFD backend routine to do the work. */
-
-static void
-mips_elf${ELFSIZE}_after_allocation (void)
-{
- /* Call the standard elf routine. */
- after_allocation_default ();
-
-#ifdef SUPPORT_EMBEDDED_RELOCS
- if (command_line.embedded_relocs && (! link_info.relocatable))
- {
- bfd *abfd;
-
- for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
- {
- asection *datasec, *relsec;
- char *errmsg;
-
- datasec = bfd_get_section_by_name (abfd, ".sdata");
-
- if (datasec == NULL || datasec->reloc_count == 0)
- continue;
-
- relsec = bfd_get_section_by_name (abfd, ".rel.sdata");
- ASSERT (relsec != NULL);
-
- if (! bfd_mips_elf${ELFSIZE}_create_embedded_relocs (abfd,
- &link_info,
- datasec,
- relsec,
- &errmsg))
- {
- if (errmsg == NULL)
- einfo ("%B%X: can not create runtime reloc information: %E\n",
- abfd);
- else
- einfo ("%X%B: can not create runtime reloc information: %s\n",
- abfd, errmsg);
- }
- }
- }
-#endif /* SUPPORT_EMBEDDED_RELOCS */
-}
-
-EOF
-
-# We have our own after_open and after_allocation functions, but they call
-# the standard routines, so give them a different name.
-LDEMUL_AFTER_OPEN=mips_elf${ELFSIZE}_after_open
-LDEMUL_AFTER_ALLOCATION=mips_elf${ELFSIZE}_after_allocation
diff --git a/contrib/binutils/ld/emultempl/needrelax.em b/contrib/binutils/ld/emultempl/needrelax.em
index 65e622b..aaa85d0 100644
--- a/contrib/binutils/ld/emultempl/needrelax.em
+++ b/contrib/binutils/ld/emultempl/needrelax.em
@@ -15,7 +15,7 @@
#
# 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.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#
# This file is sourced from elf32.em. It is used by targets for
diff --git a/contrib/binutils/ld/emultempl/pe.em b/contrib/binutils/ld/emultempl/pe.em
index 7d6c2e8..5afa8da 100644
--- a/contrib/binutils/ld/emultempl/pe.em
+++ b/contrib/binutils/ld/emultempl/pe.em
@@ -1,5 +1,6 @@
# This shell script emits a C file. -*- C -*-
# It does some substitutions.
+test -z "${ENTRY}" && ENTRY="_mainCRTStartup"
if [ -z "$MACHINE" ]; then
OUTPUT_ARCH=${ARCH}
else
@@ -9,8 +10,8 @@ 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, 2003, 2004
- Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005 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
@@ -24,7 +25,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
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. */
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
/* For WINDOWS_NT */
/* The original file generated returned different default scripts depending
@@ -62,6 +63,11 @@ cat >>e${EMULATION_NAME}.c <<EOF
#include "ldctor.h"
#include "coff/internal.h"
+/* FIXME: See bfd/peXXigen.c for why we include an architecture specific
+ header in generic PE code. */
+#include "coff/i386.h"
+#include "coff/pe.h"
+
/* FIXME: This is a BFD internal header file, and we should not be
using it here. */
#include "../bfd/libcoff.h"
@@ -106,6 +112,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
static struct internal_extra_pe_aouthdr pe;
static int dll;
+static flagword real_flags = 0;
static int support_old_code = 0;
static char * thumb_entry_symbol = NULL;
static lang_assignment_statement_type *image_base_statement = 0;
@@ -129,14 +136,16 @@ gld_${EMULATION_NAME}_before_parse (void)
config.dynamic_link = TRUE;
config.has_shared = 1;
link_info.pei386_auto_import = -1;
- link_info.pei386_runtime_pseudo_reloc = FALSE;
+ link_info.pei386_runtime_pseudo_reloc = -1;
#if (PE_DEF_SUBSYSTEM == 9) || (PE_DEF_SUBSYSTEM == 2)
#if defined TARGET_IS_mipspe || defined TARGET_IS_armpe
- lang_add_entry ("WinMainCRTStartup", FALSE);
+ lang_default_entry ("WinMainCRTStartup");
#else
- lang_add_entry ("_WinMainCRTStartup", FALSE);
+ lang_default_entry ("_WinMainCRTStartup");
#endif
+#else
+ lang_default_entry ("${ENTRY}");
#endif
#endif
}
@@ -182,6 +191,8 @@ gld_${EMULATION_NAME}_before_parse (void)
(OPTION_EXCLUDE_LIBS + 1)
#define OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC \
(OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC + 1)
+#define OPTION_LARGE_ADDRESS_AWARE \
+ (OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC + 1)
static void
gld${EMULATION_NAME}_add_options
@@ -235,6 +246,7 @@ gld${EMULATION_NAME}_add_options
{"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
+ {"large-address-aware", no_argument, NULL, OPTION_LARGE_ADDRESS_AWARE},
{NULL, no_argument, NULL, 0}
};
@@ -335,6 +347,8 @@ gld_${EMULATION_NAME}_list_options (FILE *file)
fprintf (file, _(" --enable-extra-pe-debug Enable verbose debug output when building\n\
or linking to DLLs (esp. auto-import)\n"));
#endif
+ fprintf (file, _(" --large-address-aware Executable supports virtual addresses\n\
+ greater than 2 gigabytes\n"));
}
@@ -361,8 +375,13 @@ static void
set_pe_subsystem (void)
{
const char *sver;
+ const char *entry;
+ const char *initial_symbol_char;
+ char *end;
int len;
int i;
+ int subsystem;
+ unsigned long temp_subsystem;
static const struct
{
const char *name;
@@ -371,29 +390,23 @@ set_pe_subsystem (void)
}
v[] =
{
- { "native", 1, "NtProcessStartup" },
-#if defined TARGET_IS_mipspe || defined TARGET_IS_armpe
+ { "native", 1, "NtProcessStartup" },
{ "windows", 2, "WinMainCRTStartup" },
-#else
- { "windows", 2, "WinMainCRTStartup" },
-#endif
{ "console", 3, "mainCRTStartup" },
-#if 0
- /* The Microsoft linker does not recognize this. */
- { "os2", 5, "" },
-#endif
- { "posix", 7, "__PosixProcessStartup"},
- { "wince", 9, "_WinMainCRTStartup" },
- { 0, 0, 0 }
+ { "posix", 7, "__PosixProcessStartup"},
+ { "wince", 9, "_WinMainCRTStartup" },
+ { "xbox", 14, "mainCRTStartup" },
+ { NULL, 0, NULL }
};
+ /* Entry point name for arbitrary subsystem numbers. */
+ static const char default_entry[] = "mainCRTStartup";
+ /* Check for the presence of a version number. */
sver = strchr (optarg, ':');
if (sver == NULL)
len = strlen (optarg);
else
{
- char *end;
-
len = sver - optarg;
set_pe_name ("__major_subsystem_version__",
strtoul (sver + 1, &end, 0));
@@ -404,40 +417,62 @@ set_pe_subsystem (void)
einfo (_("%P: warning: bad version number in -subsystem option\n"));
}
- for (i = 0; v[i].name; i++)
+ /* Check for numeric subsystem. */
+ temp_subsystem = strtoul (optarg, & end, 0);
+ if ((*end == ':' || *end == '\0') && (temp_subsystem < 65536))
{
- if (strncmp (optarg, v[i].name, len) == 0
- && v[i].name[len] == '\0')
- {
- const char *initial_symbol_char;
- const char *entry;
-
- set_pe_name ("__subsystem__", v[i].value);
+ /* Search list for a numeric match to use its entry point. */
+ for (i = 0; v[i].name; i++)
+ if (v[i].value == (int) temp_subsystem)
+ break;
- initial_symbol_char = ${INITIAL_SYMBOL_CHAR};
- if (*initial_symbol_char == '\0')
- entry = v[i].entry;
- else
- {
- char *alc_entry;
-
- /* lang_add_entry expects its argument to be permanently
- allocated, so we don't free this string. */
- alc_entry = xmalloc (strlen (initial_symbol_char)
- + strlen (v[i].entry)
- + 1);
- strcpy (alc_entry, initial_symbol_char);
- strcat (alc_entry, v[i].entry);
- entry = alc_entry;
- }
+ /* If no match, use the default. */
+ if (v[i].name != NULL)
+ entry = v[i].entry;
+ else
+ entry = default_entry;
- lang_add_entry (entry, TRUE);
+ /* Use this subsystem. */
+ subsystem = (int) temp_subsystem;
+ }
+ else
+ {
+ /* Search for subsystem by name. */
+ for (i = 0; v[i].name; i++)
+ if (strncmp (optarg, v[i].name, len) == 0
+ && v[i].name[len] == '\0')
+ break;
+ if (v[i].name == NULL)
+ {
+ einfo (_("%P%F: invalid subsystem type %s\n"), optarg);
return;
}
+
+ entry = v[i].entry;
+ subsystem = v[i].value;
}
- einfo (_("%P%F: invalid subsystem type %s\n"), optarg);
+ set_pe_name ("__subsystem__", subsystem);
+
+ initial_symbol_char = ${INITIAL_SYMBOL_CHAR};
+ if (*initial_symbol_char != '\0')
+ {
+ char *alc_entry;
+
+ /* lang_default_entry expects its argument to be permanently
+ allocated, so we don't free this string. */
+ alc_entry = xmalloc (strlen (initial_symbol_char)
+ + strlen (entry)
+ + 1);
+ strcpy (alc_entry, initial_symbol_char);
+ strcat (alc_entry, entry);
+ entry = alc_entry;
+ }
+
+ lang_default_entry (entry);
+
+ return;
}
@@ -597,6 +632,9 @@ gld${EMULATION_NAME}_handle_option (int optc)
pe_dll_extra_pe_debug = 1;
break;
#endif
+ case OPTION_LARGE_ADDRESS_AWARE:
+ real_flags |= IMAGE_FILE_LARGE_ADDRESS_AWARE;
+ break;
}
return TRUE;
}
@@ -632,7 +670,7 @@ static unsigned long
compute_dll_image_base (const char *ofile)
{
unsigned long hash = strhash (ofile);
- return 0x60000000 | ((hash << 16) & 0x0FFC0000);
+ return 0x61300000 + ((hash << 16) & 0x0FFC0000);
}
#endif
@@ -651,7 +689,7 @@ gld_${EMULATION_NAME}_set_symbols (void)
{
if (link_info.relocatable)
init[IMAGEBASEOFF].value = 0;
- else if (init[DLLOFF].value || link_info.shared)
+ else if (init[DLLOFF].value || (link_info.shared && !link_info.pie))
#ifdef DLL_SUPPORT
init[IMAGEBASEOFF].value = (pe_enable_auto_image_base) ?
compute_dll_image_base (output_filename) : NT_DLL_IMAGE_BASE;
@@ -759,7 +797,7 @@ pe_fixup_stdcalls (void)
if (pe_dll_extra_pe_debug)
printf ("%s\n", __FUNCTION__);
- for (undef = link_info.hash->undefs; undef; undef=undef->und_next)
+ for (undef = link_info.hash->undefs; undef; undef=undef->u.undef.next)
if (undef->type == bfd_link_hash_undefined)
{
char* at = strchr (undef->root.string, '@');
@@ -828,17 +866,17 @@ static int
make_import_fixup (arelent *rel, asection *s)
{
struct bfd_symbol *sym = *rel->sym_ptr_ptr;
- int addend = 0;
+ char addend[4];
if (pe_dll_extra_pe_debug)
printf ("arelent: %s@%#lx: add=%li\n", sym->name,
(long) rel->address, (long) rel->addend);
- if (! bfd_get_section_contents (s->owner, s, &addend, rel->address, sizeof (addend)))
+ 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);
- pe_create_import_fixup (rel, s, addend);
+ pe_create_import_fixup (rel, s, bfd_get_32 (s->owner, addend));
return 1;
}
@@ -851,22 +889,22 @@ pe_find_data_imports (void)
if (link_info.pei386_auto_import == 0)
return;
- for (undef = link_info.hash->undefs; undef; undef=undef->und_next)
+ for (undef = link_info.hash->undefs; undef; undef=undef->u.undef.next)
{
if (undef->type == bfd_link_hash_undefined)
- {
- /* C++ symbols are *long*. */
- char buf[4096];
+ {
+ /* C++ symbols are *long*. */
+ char buf[4096];
if (pe_dll_extra_pe_debug)
printf ("%s:%s\n", __FUNCTION__, undef->root.string);
- sprintf (buf, "__imp_%s", undef->root.string);
+ sprintf (buf, "__imp_%s", undef->root.string);
- sym = bfd_link_hash_lookup (link_info.hash, buf, 0, 0, 1);
+ sym = bfd_link_hash_lookup (link_info.hash, buf, 0, 0, 1);
- if (sym && sym->type == bfd_link_hash_defined)
- {
+ if (sym && sym->type == bfd_link_hash_defined)
+ {
bfd *b = sym->u.def.section->owner;
asymbol **symbols;
int nsyms, symsize, i;
@@ -904,8 +942,8 @@ pe_find_data_imports (void)
undef->root.string = sym->root.string;
undef->u.def.value = sym->u.def.value;
undef->u.def.section = sym->u.def.section;
- }
- }
+ }
+ }
}
}
@@ -931,8 +969,8 @@ gld_${EMULATION_NAME}_after_open (void)
printf ("%s()\n", __FUNCTION__);
- for (sym = link_info.hash->undefs; sym; sym=sym->und_next)
- printf ("-%s\n", sym->root.string);
+ for (sym = link_info.hash->undefs; sym; sym=sym->u.undef.next)
+ printf ("-%s\n", sym->root.string);
bfd_hash_traverse (&link_info.hash->table, pr_sym, NULL);
for (a = link_info.input_bfds; a; a = a->link_next)
@@ -949,6 +987,7 @@ gld_${EMULATION_NAME}_after_open (void)
pe_data (output_bfd)->pe_opthdr = pe;
pe_data (output_bfd)->dll = init[DLLOFF].value;
+ pe_data (output_bfd)->real_flags |= real_flags;
#ifdef DLL_SUPPORT
if (pe_enable_stdcall_fixup) /* -1=warn or 1=disable */
@@ -1051,7 +1090,7 @@ gld_${EMULATION_NAME}_after_open (void)
relocs = (arelent **) xmalloc ((size_t) relsize);
nrelocs = bfd_canonicalize_reloc (is->the_bfd, sec,
- relocs, symbols);
+ relocs, symbols);
if (nrelocs < 0)
{
free (relocs);
@@ -1063,7 +1102,7 @@ gld_${EMULATION_NAME}_after_open (void)
{
struct bfd_symbol *s;
struct bfd_link_hash_entry * blhe;
- bfd *other_bfd;
+ char *other_bfd_filename;
char *n;
s = (relocs[i]->sym_ptr_ptr)[0];
@@ -1080,17 +1119,18 @@ gld_${EMULATION_NAME}_after_open (void)
|| blhe->type != bfd_link_hash_defined)
continue;
- other_bfd = blhe->u.def.section->owner;
+ other_bfd_filename
+ = blhe->u.def.section->owner->my_archive
+ ? bfd_get_filename (blhe->u.def.section->owner->my_archive)
+ : bfd_get_filename (blhe->u.def.section->owner);
- if (strcmp (is->the_bfd->my_archive->filename,
- other_bfd->my_archive->filename) == 0)
+ if (strcmp (bfd_get_filename (is->the_bfd->my_archive),
+ other_bfd_filename) == 0)
continue;
- /* Rename this implib to match the other. */
- n = (char *) xmalloc (strlen (other_bfd->my_archive->filename) + 1);
-
- strcpy (n, other_bfd->my_archive->filename);
-
+ /* Rename this implib to match the other one. */
+ n = xmalloc (strlen (other_bfd_filename) + 1);
+ strcpy (n, other_bfd_filename);
is->the_bfd->my_archive->filename = n;
}
@@ -1134,7 +1174,7 @@ gld_${EMULATION_NAME}_after_open (void)
is3 && is3->the_bfd->my_archive == arch;
is3 = (lang_input_statement_type *) is3->next)
{
- /* A MS dynamic import library can also contain static
+ /* 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. */
@@ -1250,6 +1290,8 @@ gld_${EMULATION_NAME}_before_allocation (void)
/* We have seen it all. Allocate it, and carry on. */
bfd_arm_pe_allocate_interworking_sections (& link_info);
#endif /* TARGET_IS_armpe */
+
+ before_allocation_default ();
}
#ifdef DLL_SUPPORT
@@ -1276,10 +1318,7 @@ gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIB
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);
+ pe_def_file = def_file_parse (entry->filename, pe_def_file);
if (pe_def_file)
{
@@ -1328,14 +1367,6 @@ gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIB
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;
- }
-#endif
if (pe_def_file->stack_reserve != -1
&& ! saw_option ("__size_of_stack_reserve__"))
{
@@ -1435,6 +1466,8 @@ gld_${EMULATION_NAME}_finish (void)
}
#endif /* defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe) */
+ finish_default ();
+
#ifdef DLL_SUPPORT
if (link_info.shared
#if !defined(TARGET_IS_shpe) && !defined(TARGET_IS_mipspe)
@@ -1464,38 +1497,13 @@ gld_${EMULATION_NAME}_finish (void)
if (asec)
{
- asec->flags &= ~SEC_CODE;
- asec->flags |= SEC_DATA;
+ asec->flags &= ~SEC_CODE;
+ asec->flags |= SEC_DATA;
}
}
}
-/* Find the last output section before given output statement.
- Used by place_orphan. */
-
-static asection *
-output_prev_sec_find (lang_output_section_statement_type *os)
-{
- asection *s = (asection *) NULL;
- 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)
- {
- lookup = &u->output_section_statement;
- if (lookup == os)
- return s;
-
- if (lookup->bfd_section != NULL && lookup->bfd_section->owner != NULL)
- s = lookup->bfd_section;
- }
-
- return NULL;
-}
-
/* Place an orphan section.
We use this to put sections in a reasonable place in the file, and
@@ -1509,244 +1517,131 @@ output_prev_sec_find (lang_output_section_statement_type *os)
default linker script using wildcards, and are sorted by
sort_sections. */
-struct orphan_save
-{
- lang_output_section_statement_type *os;
- asection **section;
- lang_statement_union_type **stmt;
-};
-
static bfd_boolean
-gld_${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s)
+gld_${EMULATION_NAME}_place_orphan (asection *s)
{
const char *secname;
- char *hold_section_name;
+ const char *orig_secname;
char *dollar = NULL;
- const char *ps = NULL;
lang_output_section_statement_type *os;
lang_statement_list_type add_child;
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.relocatable)
+ orig_secname = secname;
+ if (!link_info.relocatable
+ && (dollar = strchr (secname, '$')) != NULL)
{
- dollar = strchr (hold_section_name, '$');
- if (dollar != NULL)
- *dollar = '\0';
+ size_t len = dollar - orig_secname;
+ char *newname = xmalloc (len + 1);
+ memcpy (newname, orig_secname, len);
+ newname[len] = '\0';
+ secname = newname;
}
- os = lang_output_section_find (hold_section_name);
+ os = lang_output_section_find (secname);
lang_list_init (&add_child);
if (os != NULL
&& (os->bfd_section == NULL
+ || os->bfd_section->flags == 0
|| ((s->flags ^ os->bfd_section->flags)
& (SEC_LOAD | SEC_ALLOC)) == 0))
{
/* We already have an output section statement with this
- name, and its bfd section, if any, has compatible flags. */
- lang_add_section (&add_child, s, os, file);
+ name, and its bfd section, if any, has compatible flags.
+ If the section already exists but does not have any flags set,
+ then it has been created by the linker, probably as a result of
+ a --section-start command line switch. */
+ lang_add_section (&add_child, s, os);
}
else
{
+ static struct orphan_save hold[] =
+ {
+ { ".text",
+ SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE,
+ 0, 0, 0, 0 },
+ { ".rdata",
+ SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA,
+ 0, 0, 0, 0 },
+ { ".data",
+ SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_DATA,
+ 0, 0, 0, 0 },
+ { ".bss",
+ SEC_ALLOC,
+ 0, 0, 0, 0 }
+ };
+ enum orphan_save_index
+ {
+ orphan_text = 0,
+ orphan_rodata,
+ orphan_data,
+ orphan_bss
+ };
+ static int orphan_init_done = 0;
struct orphan_save *place;
- static struct orphan_save hold_text;
- static struct orphan_save hold_rdata;
- static struct orphan_save hold_data;
- static struct orphan_save hold_bss;
- char *outsecname;
- lang_statement_list_type *old;
- lang_statement_list_type add;
+ lang_output_section_statement_type *after;
etree_type *address;
+ if (!orphan_init_done)
+ {
+ struct orphan_save *ho;
+ for (ho = hold; ho < hold + sizeof (hold) / sizeof (hold[0]); ++ho)
+ if (ho->name != NULL)
+ {
+ ho->os = lang_output_section_find (ho->name);
+ if (ho->os != NULL && ho->os->flags == 0)
+ ho->os->flags = ho->flags;
+ }
+ orphan_init_done = 1;
+ }
+
/* Try to put the new output section in a reasonable place based
on the section name and section flags. */
-#define HAVE_SECTION(hold, name) \
-(hold.os != NULL || (hold.os = lang_output_section_find (name)) != NULL)
place = NULL;
if ((s->flags & SEC_ALLOC) == 0)
;
- else if ((s->flags & SEC_HAS_CONTENTS) == 0
- && HAVE_SECTION (hold_bss, ".bss"))
- place = &hold_bss;
- else if ((s->flags & SEC_READONLY) == 0
- && HAVE_SECTION (hold_data, ".data"))
- place = &hold_data;
- else if ((s->flags & SEC_CODE) == 0
- && (s->flags & SEC_READONLY) != 0
- && HAVE_SECTION (hold_rdata, ".rdata"))
- place = &hold_rdata;
- else if ((s->flags & SEC_READONLY) != 0
- && HAVE_SECTION (hold_text, ".text"))
- place = &hold_text;
-
-#undef HAVE_SECTION
-
- /* Choose a unique name for the section. This will be needed if
- the same section name appears in the input file with
- different loadable or allocatable characteristics. */
- outsecname = xstrdup (hold_section_name);
- if (bfd_get_section_by_name (output_bfd, outsecname) != NULL)
- {
- unsigned int len;
- char *newname;
- unsigned int i;
-
- len = strlen (outsecname);
- newname = xmalloc (len + 5);
- strcpy (newname, outsecname);
- i = 0;
- do
- {
- sprintf (newname + len, "%d", i);
- ++i;
- }
- while (bfd_get_section_by_name (output_bfd, newname) != NULL);
-
- free (outsecname);
- outsecname = newname;
- }
-
- /* Start building a list of statements for this section. */
- old = stat_ptr;
- stat_ptr = &add;
- lang_list_init (stat_ptr);
+ else if ((s->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
+ place = &hold[orphan_bss];
+ else if ((s->flags & SEC_READONLY) == 0)
+ place = &hold[orphan_data];
+ else if ((s->flags & SEC_CODE) == 0)
+ place = &hold[orphan_rodata];
+ else
+ place = &hold[orphan_text];
- if (config.build_constructors)
+ after = NULL;
+ if (place != NULL)
{
- /* 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 != '_')
- break;
- if (*ps == '\0')
- {
- char *symname;
- etree_type *e_align;
-
- symname = (char *) xmalloc (ps - outsecname + sizeof "___start_");
- sprintf (symname, "___start_%s", outsecname);
- e_align = exp_unop (ALIGN_K,
- exp_intop ((bfd_vma) 1 << s->alignment_power));
- lang_add_assignment (exp_assop ('=', symname, e_align));
- }
+ if (place->os == NULL)
+ place->os = lang_output_section_find (place->name);
+ after = place->os;
+ if (after == NULL)
+ after = lang_output_section_find_by_flags (s, &place->os, NULL);
+ if (after == NULL)
+ /* *ABS* is always the first output section statement. */
+ after = (&lang_output_section_statement.head
+ ->output_section_statement);
}
- if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
- address = exp_intop ((bfd_vma) 0);
- else
+ /* Choose a unique name for the section. This will be needed if the
+ same section name appears in the input file with different
+ loadable or allocatable characteristics. */
+ if (bfd_get_section_by_name (output_bfd, secname) != NULL)
{
- /* All sections in an executable must be aligned to a page
- boundary. */
- address = exp_unop (ALIGN_K,
- exp_nameop (NAME, "__section_alignment__"));
+ static int count = 1;
+ secname = bfd_get_unique_section_name (output_bfd, secname, &count);
+ if (secname == NULL)
+ einfo ("%F%P: place_orphan failed: %E\n");
}
- os = lang_enter_output_section_statement (outsecname, address, 0,
- (etree_type *) NULL,
- (etree_type *) NULL,
- (etree_type *) NULL);
-
- lang_add_section (&add_child, s, os, file);
-
- lang_leave_output_section_statement
- ((bfd_vma) 0, "*default*",
- (struct lang_output_section_phdr_list *) NULL, NULL);
-
- if (config.build_constructors && *ps == '\0')
- {
- char *symname;
-
- /* lang_leave_ouput_section_statement resets stat_ptr.
- Put stat_ptr back where we want it. */
- if (place != NULL)
- stat_ptr = &add;
-
- symname = (char *) xmalloc (ps - outsecname + sizeof "___stop_");
- sprintf (symname, "___stop_%s", outsecname);
- lang_add_assignment (exp_assop ('=', symname,
- exp_nameop (NAME, ".")));
- }
-
- stat_ptr = old;
-
- if (place != NULL && os->bfd_section != NULL)
- {
- asection *snew, **pps;
-
- snew = os->bfd_section;
-
- /* Shuffle the bfd section list to make the output file look
- neater. This is really only cosmetic. */
- if (place->section == NULL)
- {
- asection *bfd_section = place->os->bfd_section;
-
- /* If the output statement hasn't been used to place
- any input sections (and thus doesn't have an output
- bfd_section), look for the closest prior output statement
- having an output section. */
- if (bfd_section == NULL)
- bfd_section = output_prev_sec_find (place->os);
-
- if (bfd_section != NULL && bfd_section != snew)
- place->section = &bfd_section->next;
- }
-
- if (place->section != NULL)
- {
- /* Unlink the section. */
- for (pps = &output_bfd->sections;
- *pps != snew;
- pps = &(*pps)->next)
- ;
- bfd_section_list_remove (output_bfd, pps);
-
- /* Now tack it on to the "place->os" section list. */
- bfd_section_list_insert (output_bfd, place->section, snew);
- }
-
- /* Save the end of this list. Further ophans of this type will
- follow the one we've just added. */
- place->section = &snew->next;
-
- /* The following is non-cosmetic. We try to put the output
- statements in some sort of reasonable order here, because
- they determine the final load addresses of the orphan
- sections. In addition, placing output statements in the
- wrong order may require extra segments. For instance,
- given a typical situation of all read-only sections placed
- in one segment and following that a segment containing all
- the read-write sections, we wouldn't want to place an orphan
- read/write section before or amongst the read-only ones. */
- if (add.head != NULL)
- {
- 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;
- }
- else
- {
- /* Put it after the last orphan statement we added. */
- *add.tail = *place->stmt;
- *place->stmt = add.head;
- }
-
- /* Fix the global list pointer if we happened to tack our
- new list at the tail. */
- if (*old->tail == add.head)
- old->tail = add.tail;
-
- /* Save the end of this list. */
- place->stmt = add.tail;
- }
- }
+ /* All sections in an executable must be aligned to a page boundary. */
+ address = exp_unop (ALIGN_K, exp_nameop (NAME, "__section_alignment__"));
+ os = lang_insert_orphan (s, secname, after, place, address, &add_child);
}
{
@@ -1769,7 +1664,7 @@ gld_${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s
ls = &(*pl)->input_section;
- lname = bfd_get_section_name (ls->ifile->the_bfd, ls->section);
+ lname = bfd_get_section_name (ls->section->owner, ls->section);
if (strchr (lname, '$') == NULL)
{
if (found_dollar)
@@ -1778,7 +1673,7 @@ gld_${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s
else
{
found_dollar = TRUE;
- if (strcmp (secname, lname) < 0)
+ if (strcmp (orig_secname, lname) < 0)
break;
}
}
@@ -1791,8 +1686,6 @@ gld_${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s
}
}
- free (hold_section_name);
-
return TRUE;
}
@@ -1810,12 +1703,12 @@ gld_${EMULATION_NAME}_open_dynamic_archive
filename = entry->filename;
string = (char *) xmalloc (strlen (search->name)
- + strlen (filename)
- + sizeof "/lib.a.dll"
+ + strlen (filename)
+ + sizeof "/lib.a.dll"
#ifdef DLL_SUPPORT
- + (pe_dll_search_prefix ? strlen (pe_dll_search_prefix) : 0)
+ + (pe_dll_search_prefix ? strlen (pe_dll_search_prefix) : 0)
#endif
- + 1);
+ + 1);
/* Try "libfoo.dll.a" first (preferred explicit import library for dll's. */
sprintf (string, "%s/lib%s.dll.a", search->name, filename);
@@ -1825,7 +1718,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive
/* 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,
@@ -1835,50 +1728,50 @@ gld_${EMULATION_NAME}_open_dynamic_archive
-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). */
- sprintf (string, "%s/lib%s.a", search->name, filename);
- if (! ldfile_try_open_bfd (string, entry))
- {
+ /* Try "libfoo.a" (import lib, or static lib, but must
+ 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). */
- 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). */
- sprintf (string, "%s/lib%s.dll", search->name, filename);
- if (! ldfile_try_open_bfd (string, entry))
- {
- /* 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;
- }
- }
- }
- }
- else /* pe_dll_search_prefix not specified. */
+ if (pe_dll_search_prefix)
+ {
+ /* 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). */
+ sprintf (string, "%s/lib%s.dll", search->name, filename);
+ if (! ldfile_try_open_bfd (string, entry))
+ {
+ /* 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;
+ }
+ }
+ }
+ }
+ else /* pe_dll_search_prefix not specified. */
#endif
- {
- /* 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). */
- sprintf (string, "%s/%s.dll", search->name, filename);
- if (! ldfile_try_open_bfd (string, entry))
- {
- free (string);
- return FALSE;
- }
- }
- }
- }
- }
+ {
+ /* 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). */
+ sprintf (string, "%s/%s.dll", search->name, filename);
+ if (! ldfile_try_open_bfd (string, entry))
+ {
+ free (string);
+ return FALSE;
+ }
+ }
+ }
+ }
+ }
}
entry->filename = string;
@@ -1907,16 +1800,16 @@ cat >>e${EMULATION_NAME}.c <<EOF
if (link_info.relocatable && config.build_constructors)
return
EOF
-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
+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
diff --git a/contrib/binutils/ld/emultempl/ppc32elf.em b/contrib/binutils/ld/emultempl/ppc32elf.em
index 4614593..10f9107 100644
--- a/contrib/binutils/ld/emultempl/ppc32elf.em
+++ b/contrib/binutils/ld/emultempl/ppc32elf.em
@@ -1,5 +1,5 @@
# This shell script emits a C file. -*- C -*-
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003, 2005 Free Software Foundation, Inc.
#
# This file is part of GLD, the Gnu Linker.
#
@@ -15,10 +15,10 @@
#
# 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.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#
-# This file is sourced from elf32.em, and defines extra powerpc64-elf
+# This file is sourced from elf32.em, and defines extra powerpc32-elf
# specific routines.
#
cat >>e${EMULATION_NAME}.c <<EOF
@@ -26,17 +26,89 @@ cat >>e${EMULATION_NAME}.c <<EOF
#include "libbfd.h"
#include "elf32-ppc.h"
+extern const bfd_target bfd_elf32_powerpc_vec;
+extern const bfd_target bfd_elf32_powerpcle_vec;
+extern const bfd_target bfd_elf32_powerpc_vxworks_vec;
+
+static inline int
+is_ppc_elf32_vec(const bfd_target * vec)
+{
+ return (vec == &bfd_elf32_powerpc_vec
+ || vec == &bfd_elf32_powerpc_vxworks_vec
+ || vec == &bfd_elf32_powerpcle_vec);
+}
+
/* Whether to run tls optimization. */
static int notlsopt = 0;
+/* Whether to emit symbols for stubs. */
+static int emit_stub_syms = 0;
+
+/* Chooses the correct place for .plt and .got. */
+static int old_plt = 0;
+static int old_got = 0;
+
static void
-ppc_before_allocation (void)
+ppc_after_open (void)
{
- extern const bfd_target bfd_elf32_powerpc_vec;
- extern const bfd_target bfd_elf32_powerpcle_vec;
+ if (is_ppc_elf32_vec (link_info.hash->creator))
+ {
+ int new_plt;
+ int keep_new;
+ unsigned int num_plt;
+ unsigned int num_got;
+ lang_output_section_statement_type *os;
+ lang_output_section_statement_type *plt_os[2];
+ lang_output_section_statement_type *got_os[2];
+
+ emit_stub_syms |= link_info.emitrelocations;
+ new_plt = ppc_elf_select_plt_layout (output_bfd, &link_info, old_plt,
+ emit_stub_syms);
+ if (new_plt < 0)
+ einfo ("%X%P: select_plt_layout problem %E\n");
- if (link_info.hash->creator == &bfd_elf32_powerpc_vec
- || link_info.hash->creator == &bfd_elf32_powerpcle_vec)
+ num_got = 0;
+ num_plt = 0;
+ for (os = &lang_output_section_statement.head->output_section_statement;
+ os != NULL;
+ os = os->next)
+ {
+ if (os->constraint == SPECIAL && strcmp (os->name, ".plt") == 0)
+ {
+ if (num_plt < 2)
+ plt_os[num_plt] = os;
+ ++num_plt;
+ }
+ if (os->constraint == SPECIAL && strcmp (os->name, ".got") == 0)
+ {
+ if (num_got < 2)
+ got_os[num_got] = os;
+ ++num_got;
+ }
+ }
+
+ keep_new = new_plt == 1 ? 0 : -1;
+ if (num_plt == 2)
+ {
+ plt_os[0]->constraint = keep_new;
+ plt_os[1]->constraint = ~keep_new;
+ }
+ if (num_got == 2)
+ {
+ if (old_got)
+ keep_new = -1;
+ got_os[0]->constraint = keep_new;
+ got_os[1]->constraint = ~keep_new;
+ }
+ }
+
+ gld${EMULATION_NAME}_after_open ();
+}
+
+static void
+ppc_before_allocation (void)
+{
+ if (is_ppc_elf32_vec (link_info.hash->creator))
{
if (ppc_elf_tls_setup (output_bfd, &link_info) && !notlsopt)
{
@@ -57,24 +129,46 @@ EOF
#
PARSE_AND_LIST_PROLOGUE='
#define OPTION_NO_TLS_OPT 301
+#define OPTION_OLD_PLT 302
+#define OPTION_OLD_GOT 303
+#define OPTION_STUBSYMS 304
'
PARSE_AND_LIST_LONGOPTS='
+ { "emit-stub-syms", no_argument, NULL, OPTION_STUBSYMS },
{ "no-tls-optimize", no_argument, NULL, OPTION_NO_TLS_OPT },
+ { "bss-plt", no_argument, NULL, OPTION_OLD_PLT },
+ { "sdata-got", no_argument, NULL, OPTION_OLD_GOT },
'
PARSE_AND_LIST_OPTIONS='
fprintf (file, _("\
- --no-tls-optimize Don'\''t try to optimize TLS accesses.\n"
+ --emit-stub-syms Label linker stubs with a symbol.\n\
+ --no-tls-optimize Don'\''t try to optimize TLS accesses.\n\
+ --bss-plt Force old-style BSS PLT.\n\
+ --sdata-got Force GOT location just before .sdata.\n"
));
'
PARSE_AND_LIST_ARGS_CASES='
+ case OPTION_STUBSYMS:
+ emit_stub_syms = 1;
+ break;
+
case OPTION_NO_TLS_OPT:
notlsopt = 1;
break;
+
+ case OPTION_OLD_PLT:
+ old_plt = 1;
+ break;
+
+ case OPTION_OLD_GOT:
+ old_got = 1;
+ break;
'
-# Put these extra ppc64elf routines in ld_${EMULATION_NAME}_emulation
+# Put these extra ppc32elf routines in ld_${EMULATION_NAME}_emulation
#
+LDEMUL_AFTER_OPEN=ppc_after_open
LDEMUL_BEFORE_ALLOCATION=ppc_before_allocation
diff --git a/contrib/binutils/ld/emultempl/ppc64elf.em b/contrib/binutils/ld/emultempl/ppc64elf.em
index 4f408a9..ea33771 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, 2003, 2004 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
#
# This file is part of GLD, the Gnu Linker.
#
@@ -15,7 +15,7 @@
#
# 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.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#
# This file is sourced from elf32.em, and defines extra powerpc64-elf
@@ -44,13 +44,25 @@ static bfd_signed_vma group_size = 1;
static int dotsyms = 1;
/* Whether to run tls optimization. */
-static int notlsopt = 0;
+static int no_tls_opt = 0;
+
+/* Whether to run opd optimization. */
+static int no_opd_opt = 0;
+
+/* Whether to run toc optimization. */
+static int no_toc_opt = 0;
+
+/* Whether to allow multiple toc sections. */
+static int no_multi_toc = 0;
/* Whether to emit symbols for stubs. */
static int emit_stub_syms = 0;
static asection *toc_section = 0;
+/* Whether to canonicalize .opd so that there are no overlapping
+ .opd entries. */
+static int non_overlapping_opd = 0;
/* This is called before the input files are opened. We create a new
fake input file to hold the stub sections. */
@@ -76,54 +88,43 @@ ppc_create_output_section_statements (void)
bfd_get_arch (output_bfd),
bfd_get_mach (output_bfd)))
{
- einfo ("%X%P: can not create BFD %E\n");
+ einfo ("%F%P: can not create BFD %E\n");
return;
}
+ stub_file->the_bfd->flags |= BFD_LINKER_CREATED;
ldlang_add_file (stub_file);
ppc64_elf_init_stub_bfd (stub_file->the_bfd, &link_info);
}
static void
-ppc_after_open (void)
-{
- if (!ppc64_elf_mark_entry_syms (&link_info))
- {
- einfo ("%X%P: can not mark entry symbols %E\n");
- return;
- }
-
- 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_edit_opd (output_bfd, &link_info, no_opd_opt,
+ non_overlapping_opd))
+ einfo ("%X%P: can not edit %s %E\n", "opd");
- if (ppc64_elf_tls_setup (output_bfd, &link_info) && !notlsopt)
+ if (ppc64_elf_tls_setup (output_bfd, &link_info) && !no_tls_opt)
{
/* 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);
+ expld.phase = lang_mark_phase_enum;
+ expld.dataseg.phase = exp_dataseg_none;
+ one_lang_size_sections_pass (NULL, TRUE);
if (!ppc64_elf_tls_optimize (output_bfd, &link_info))
- {
- einfo ("%X%P: TLS problem %E\n");
- return;
- }
+ einfo ("%X%P: TLS problem %E\n");
/* We must not cache anything from the preliminary sizing. */
- elf_tdata (output_bfd)->program_header_size = 0;
lang_reset_memory_regions ();
}
+
+ if (!no_toc_opt
+ && !link_info.relocatable
+ && !ppc64_elf_edit_toc (output_bfd, &link_info))
+ einfo ("%X%P: can not edit %s %E\n", "toc");
}
gld${EMULATION_NAME}_before_allocation ();
@@ -234,7 +235,7 @@ ppc_add_stub_section (const char *stub_sec_name, asection *input_section)
info.input_section = input_section;
lang_list_init (&info.add);
- lang_add_section (&info.add, stub_sec, os, stub_file);
+ lang_add_section (&info.add, stub_sec, os);
if (info.add.head == NULL)
goto err_ret;
@@ -259,17 +260,7 @@ ppc_layout_sections_again (void)
add even more stubs. */
need_laying_out = 0;
- lang_reset_memory_regions ();
-
- /* Resize the sections. */
- lang_size_sections (stat_ptr->head, abs_output_section,
- &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, NULL, 0);
+ gld${EMULATION_NAME}_layout_sections_again ();
}
@@ -286,24 +277,33 @@ gld${EMULATION_NAME}_after_allocation (void)
static void
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);
+ if (statement->header.type == lang_input_section_enum)
+ {
+ asection *i = statement->input_section.section;
+
+ if (!((lang_input_statement_type *) i->owner->usrdata)->just_syms_flag
+ && (i->flags & SEC_EXCLUDE) == 0
+ && i->output_section == toc_section)
+ ppc64_elf_next_toc_section (&link_info, i);
+ }
}
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)
+ if (statement->header.type == lang_input_section_enum)
{
- if (!ppc64_elf_next_input_section (&link_info,
- statement->input_section.section))
- einfo ("%X%P: can not size stub section: %E\n");
+ asection *i = statement->input_section.section;
+
+ if (!((lang_input_statement_type *) i->owner->usrdata)->just_syms_flag
+ && (i->flags & SEC_EXCLUDE) == 0
+ && i->output_section != NULL
+ && i->output_section->owner == output_bfd)
+ {
+ if (!ppc64_elf_next_input_section (&link_info, i))
+ einfo ("%X%P: can not size stub section: %E\n");
+ }
}
}
@@ -311,7 +311,7 @@ build_section_lists (lang_statement_union_type *statement)
/* Final emulation specific call. */
static void
-gld${EMULATION_NAME}_finish (void)
+ppc_finish (void)
{
/* e_entry on PowerPC64 points to the function descriptor for
_start. If _start is missing, default to the first function
@@ -329,15 +329,12 @@ gld${EMULATION_NAME}_finish (void)
stubs. */
if (stub_file != NULL && !link_info.relocatable)
{
- int ret = ppc64_elf_setup_section_lists (output_bfd, &link_info);
- if (ret != 0)
+ int ret = ppc64_elf_setup_section_lists (output_bfd, &link_info,
+ no_multi_toc);
+ if (ret < 0)
+ einfo ("%X%P: can not size stub section: %E\n");
+ else if (ret > 0)
{
- if (ret < 0)
- {
- einfo ("%X%P: can not size stub section: %E\n");
- return;
- }
-
toc_section = bfd_get_section_by_name (output_bfd, ".got");
if (toc_section != NULL)
lang_for_each_statement (build_toc_list);
@@ -352,21 +349,27 @@ gld${EMULATION_NAME}_finish (void)
group_size,
&ppc_add_stub_section,
&ppc_layout_sections_again))
- {
- einfo ("%X%P: can not size stub section: %E\n");
- return;
- }
+ einfo ("%X%P: can not size stub section: %E\n");
}
}
if (need_laying_out)
ppc_layout_sections_again ();
+ if (link_info.relocatable)
+ {
+ asection *toc = bfd_get_section_by_name (output_bfd, ".toc");
+ if (toc != NULL
+ && bfd_section_size (output_bfd, toc) > 0x10000)
+ einfo ("%X%P: TOC section size exceeds 64k\n");
+ }
+
if (stub_added)
{
char *msg = NULL;
char *line, *endline;
+ emit_stub_syms |= link_info.emitrelocations;
if (!ppc64_elf_build_stubs (emit_stub_syms, &link_info,
config.stats ? &msg : NULL))
einfo ("%X%P: can not build stubs: %E\n");
@@ -381,6 +384,9 @@ gld${EMULATION_NAME}_finish (void)
if (msg != NULL)
free (msg);
}
+
+ ppc64_elf_restore_symbols (&link_info);
+ finish_default ();
}
@@ -420,6 +426,14 @@ gld${EMULATION_NAME}_new_vers_pattern (struct bfd_elf_version_expr *entry)
dot_pat[0] = '.';
memcpy (dot_pat + 1, entry->pattern, len - 1);
dot_entry->pattern = dot_pat;
+ if (entry->symbol != NULL)
+ {
+ len = strlen (entry->symbol) + 2;
+ dot_pat = xmalloc (len);
+ dot_pat[0] = '.';
+ memcpy (dot_pat + 1, entry->symbol, len - 1);
+ dot_entry->symbol = dot_pat;
+ }
return dot_entry;
}
@@ -455,6 +469,10 @@ PARSE_AND_LIST_PROLOGUE='
#define OPTION_DOTSYMS (OPTION_STUBSYMS + 1)
#define OPTION_NO_DOTSYMS (OPTION_DOTSYMS + 1)
#define OPTION_NO_TLS_OPT (OPTION_NO_DOTSYMS + 1)
+#define OPTION_NO_OPD_OPT (OPTION_NO_TLS_OPT + 1)
+#define OPTION_NO_TOC_OPT (OPTION_NO_OPD_OPT + 1)
+#define OPTION_NO_MULTI_TOC (OPTION_NO_TOC_OPT + 1)
+#define OPTION_NON_OVERLAPPING_OPD (OPTION_NO_MULTI_TOC + 1)
'
PARSE_AND_LIST_LONGOPTS='
@@ -463,6 +481,10 @@ PARSE_AND_LIST_LONGOPTS='
{ "dotsyms", no_argument, NULL, OPTION_DOTSYMS },
{ "no-dotsyms", no_argument, NULL, OPTION_NO_DOTSYMS },
{ "no-tls-optimize", no_argument, NULL, OPTION_NO_TLS_OPT },
+ { "no-opd-optimize", no_argument, NULL, OPTION_NO_OPD_OPT },
+ { "no-toc-optimize", no_argument, NULL, OPTION_NO_TOC_OPT },
+ { "no-multi-toc", no_argument, NULL, OPTION_NO_MULTI_TOC },
+ { "non-overlapping-opd", no_argument, NULL, OPTION_NON_OVERLAPPING_OPD },
'
PARSE_AND_LIST_OPTIONS='
@@ -490,6 +512,19 @@ PARSE_AND_LIST_OPTIONS='
fprintf (file, _("\
--no-tls-optimize Don'\''t try to optimize TLS accesses.\n"
));
+ fprintf (file, _("\
+ --no-opd-optimize Don'\''t optimize the OPD section.\n"
+ ));
+ fprintf (file, _("\
+ --no-toc-optimize Don'\''t optimize the TOC section.\n"
+ ));
+ fprintf (file, _("\
+ --no-multi-toc Disallow automatic multiple toc sections.\n"
+ ));
+ fprintf (file, _("\
+ --non-overlapping-opd Canonicalize .opd, so that there are no overlapping\n\
+ .opd entries.\n"
+ ));
'
PARSE_AND_LIST_ARGS_CASES='
@@ -515,15 +550,30 @@ PARSE_AND_LIST_ARGS_CASES='
break;
case OPTION_NO_TLS_OPT:
- notlsopt = 1;
+ no_tls_opt = 1;
+ break;
+
+ case OPTION_NO_OPD_OPT:
+ no_opd_opt = 1;
+ break;
+
+ case OPTION_NO_TOC_OPT:
+ no_toc_opt = 1;
+ break;
+
+ case OPTION_NO_MULTI_TOC:
+ no_multi_toc = 1;
+ break;
+
+ case OPTION_NON_OVERLAPPING_OPD:
+ non_overlapping_opd = 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_FINISH=ppc_finish
LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=ppc_create_output_section_statements
LDEMUL_NEW_VERS_PATTERN=gld${EMULATION_NAME}_new_vers_pattern
diff --git a/contrib/binutils/ld/emultempl/sunos.em b/contrib/binutils/ld/emultempl/sunos.em
index 358bc9a..a480558 100644
--- a/contrib/binutils/ld/emultempl/sunos.em
+++ b/contrib/binutils/ld/emultempl/sunos.em
@@ -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, 2002,
- 2003, 2004 Free Software Foundation, Inc.
+ Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
SunOS shared library support by Ian Lance Taylor <ian@cygnus.com>
@@ -28,7 +28,7 @@ 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. */
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#define TARGET_IS_${EMULATION_NAME}
@@ -671,7 +671,7 @@ gld${EMULATION_NAME}_before_allocation (void)
{
struct bfd_link_hash_entry *h;
- for (h = link_info.hash->undefs; h != NULL; h = h->und_next)
+ for (h = link_info.hash->undefs; h != NULL; h = h->u.undef.next)
{
if (h->type == bfd_link_hash_undefined
&& h->u.undef.abfd != NULL
@@ -744,7 +744,7 @@ gld${EMULATION_NAME}_before_allocation (void)
dynamic object. */
ASSERT (need_entries != 0);
- sneed->_raw_size = need_size;
+ sneed->size = need_size;
sneed->contents = (bfd_byte *) xmalloc (need_size);
need_contents = sneed->contents;
@@ -764,7 +764,7 @@ gld${EMULATION_NAME}_before_allocation (void)
option. */
if (command_line.rpath)
{
- srules->_raw_size = strlen (command_line.rpath);
+ srules->size = strlen (command_line.rpath);
srules->contents = (bfd_byte *) command_line.rpath;
}
else
@@ -776,7 +776,7 @@ gld${EMULATION_NAME}_before_allocation (void)
for (search = search_head; search != NULL; search = search->next)
if (search->cmdline)
size += strlen (search->name) + 1;
- srules->_raw_size = size;
+ srules->size = size;
if (size > 0)
{
char *p;
@@ -810,6 +810,8 @@ gld${EMULATION_NAME}_before_allocation (void)
else
hdyn->u.def.section = bfd_abs_section_ptr;
}
+
+ before_allocation_default ();
}
/* This is called by the before_allocation routine via
@@ -917,7 +919,7 @@ gld${EMULATION_NAME}_set_need (lang_input_statement_type *inp)
bfd_put_32 (output_bfd, (bfd_vma) 0, need_pinfo + 4);
bfd_put_16 (output_bfd, (bfd_vma) 0, need_pinfo + 8);
bfd_put_16 (output_bfd, (bfd_vma) 0, need_pinfo + 10);
- strcpy (need_pnames, inp->filename);
+ strcpy ((char *) need_pnames, inp->filename);
}
else
{
@@ -932,7 +934,7 @@ gld${EMULATION_NAME}_set_need (lang_input_statement_type *inp)
sscanf (verstr, ".so.%d.%d", &maj, &min);
bfd_put_16 (output_bfd, (bfd_vma) maj, need_pinfo + 8);
bfd_put_16 (output_bfd, (bfd_vma) min, need_pinfo + 10);
- strcpy (need_pnames, inp->local_sym_name + 2);
+ strcpy ((char *) need_pnames, inp->local_sym_name + 2);
}
c = (need_pinfo - need_contents) / NEED_ENTRY_SIZE;
@@ -943,7 +945,7 @@ gld${EMULATION_NAME}_set_need (lang_input_statement_type *inp)
need_pinfo + 12);
need_pinfo += NEED_ENTRY_SIZE;
- need_pnames += strlen (need_pnames) + 1;
+ need_pnames += strlen ((char *) need_pnames) + 1;
}
}
@@ -1014,7 +1016,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
gld${EMULATION_NAME}_get_script,
"${EMULATION_NAME}",
"${OUTPUT_FORMAT}",
- NULL, /* finish */
+ finish_default,
gld${EMULATION_NAME}_create_output_section_statements,
NULL, /* open dynamic archive */
NULL, /* place orphan */
diff --git a/contrib/binutils/ld/emultempl/ticoff.em b/contrib/binutils/ld/emultempl/ticoff.em
index 8f86b04..0382bbd 100644
--- a/contrib/binutils/ld/emultempl/ticoff.em
+++ b/contrib/binutils/ld/emultempl/ticoff.em
@@ -17,7 +17,7 @@ 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. */
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
/* For TI COFF */
/* Need to determine load and run pages for output sections */
@@ -165,7 +165,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
gld_${EMULATION_NAME}_get_script,
"${EMULATION_NAME}",
"${OUTPUT_FORMAT}",
- NULL, /* finish */
+ finish_default,
NULL, /* create output section statements */
NULL, /* open dynamic archive */
NULL, /* place orphan */
diff --git a/contrib/binutils/ld/emultempl/vanilla.em b/contrib/binutils/ld/emultempl/vanilla.em
index 2141083..2124852 100644
--- a/contrib/binutils/ld/emultempl/vanilla.em
+++ b/contrib/binutils/ld/emultempl/vanilla.em
@@ -20,7 +20,7 @@ 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. */
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -68,7 +68,7 @@ struct ld_emulation_xfer_struct ld_vanilla_emulation =
vanilla_get_script,
"vanilla",
"a.out-sunos-big",
- NULL, /* finish */
+ finish_default,
NULL, /* create output section statements */
NULL, /* open dynamic archive */
NULL, /* place orphan */
diff --git a/contrib/binutils/ld/fdl.texi b/contrib/binutils/ld/fdl.texi
index c6409a3..cc3cd01 100644
--- a/contrib/binutils/ld/fdl.texi
+++ b/contrib/binutils/ld/fdl.texi
@@ -4,8 +4,8 @@
@center Version 1.1, March 2000
@display
-Copyright (C) 2000, Free Software Foundation, Inc.
-59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Copyright (C) 2000, 2003 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
diff --git a/contrib/binutils/ld/gen-doc.texi b/contrib/binutils/ld/gen-doc.texi
index 5add195..800f64e 100644
--- a/contrib/binutils/ld/gen-doc.texi
+++ b/contrib/binutils/ld/gen-doc.texi
@@ -9,6 +9,8 @@
@set HPPA
@set MMIX
@set MSP430
+@set POWERPC
+@set POWERPC64
@set TICOFF
@set WIN32
@set XTENSA
diff --git a/contrib/binutils/ld/genscripts.sh b/contrib/binutils/ld/genscripts.sh
index 0168203..e9d4f15 100755
--- a/contrib/binutils/ld/genscripts.sh
+++ b/contrib/binutils/ld/genscripts.sh
@@ -4,6 +4,7 @@
# Usage: genscripts_extra.sh \
# srcdir \
# libdir \
+# prefix \
# exec_prefix \
# host \
# target \
@@ -22,6 +23,7 @@
# /sources/ld \
# /usr/local/lib \
# /usr/local \
+# /usr/local \
# sparc-sun-sunos4.1.3 \
# sparc-sun-sunos4.1.3 \
# sparc-sun-sunos4.1.3 \
@@ -59,17 +61,18 @@
srcdir=$1
libdir=$2
-exec_prefix=$3
-host=$4
-target=$5
-target_alias=$6
-EMULATION_LIBPATH=$7
-NATIVE_LIB_DIRS=$8
-use_sysroot=$9
+prefix=$3
+exec_prefix=$4
+host=$5
+target=$6
+target_alias=$7
+EMULATION_LIBPATH=$8
+NATIVE_LIB_DIRS=$9
shift 9
-EMULATION_NAME=$1
-TOOL_LIB=$2
-CUSTOMIZER_SCRIPT=$3
+use_sysroot=$1
+EMULATION_NAME=$2
+TOOL_LIB=$3
+CUSTOMIZER_SCRIPT=$4
# Can't use ${TOOL_LIB:-$target_alias} here due to an Ultrix shell bug.
if [ "x${TOOL_LIB}" = "x" ] ; then
@@ -191,13 +194,12 @@ 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} "*)
+set $EMULATION_LIBPATH
+if [ "x$1" = "x$EMULATION_NAME" ]; then
test -d tmpdir || mkdir tmpdir
- test -f tmpdir/libpath.exp || \
+ rm -f tmpdir/libpath.exp
echo "set libpath \"${LIB_PATH}\"" | sed -e 's/:/ /g' > tmpdir/libpath.exp
- ;;
-esac
+fi
# Generate 5 or 6 script files from a master script template in
# ${srcdir}/scripttempl/${SCRIPT_NAME}.sh. Which one of the 5 or 6
@@ -283,7 +285,16 @@ if test -n "$GENERATE_COMBRELOC_SCRIPT"; then
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xc
rm -f ${COMBRELOC}
+ LD_FLAG=w
+ RELRO_NOW=" "
+ COMBRELOC=ldscripts/${EMULATION_NAME}.xw.tmp
+ ( echo "/* Script for -z combreloc -z now -z relro: combine and sort reloc sections */"
+ . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xw
+ rm -f ${COMBRELOC}
COMBRELOC=
+ unset RELRO_NOW
fi
if test -n "$GENERATE_SHLIB_SCRIPT"; then
@@ -299,13 +310,22 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then
if test -n "$GENERATE_COMBRELOC_SCRIPT"; then
LD_FLAG=cshared
DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}}
- COMBRELOC=ldscripts/${EMULATION_NAME}.xc.tmp
+ COMBRELOC=ldscripts/${EMULATION_NAME}.xsc.tmp
( echo "/* Script for --shared -z combreloc: shared library, combine & sort relocs */"
. ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsc
rm -f ${COMBRELOC}
+ LD_FLAG=wshared
+ RELRO_NOW=" "
+ COMBRELOC=ldscripts/${EMULATION_NAME}.xsw.tmp
+ ( echo "/* Script for --shared -z combreloc -z now -z relro: shared library, combine & sort relocs */"
+ . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsw
+ rm -f ${COMBRELOC}
COMBRELOC=
+ unset RELRO_NOW
fi
unset CREATE_SHLIB
fi
@@ -323,13 +343,22 @@ if test -n "$GENERATE_PIE_SCRIPT"; then
if test -n "$GENERATE_COMBRELOC_SCRIPT"; then
LD_FLAG=cpie
DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}}
- COMBRELOC=ldscripts/${EMULATION_NAME}.xc.tmp
+ COMBRELOC=ldscripts/${EMULATION_NAME}.xdc.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}
+ LD_FLAG=wpie
+ RELRO_NOW=" "
+ COMBRELOC=ldscripts/${EMULATION_NAME}.xdw.tmp
+ ( echo "/* Script for -pie -z combreloc -z now -z relro: position independent executable, combine & sort relocs */"
+ . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdw
+ rm -f ${COMBRELOC}
COMBRELOC=
+ unset RELRO_NOW
fi
unset CREATE_PIE
fi
diff --git a/contrib/binutils/ld/ld.1 b/contrib/binutils/ld/ld.1
index 87ee202..26003aa 100644
--- a/contrib/binutils/ld/ld.1
+++ b/contrib/binutils/ld/ld.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
+.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -25,11 +25,11 @@
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
-.\" double quote, and \*(R" will give a right double quote. | will give a
-.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
-.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
-.\" expand to `' in nroff, nothing in troff, for use with C<>.
-.tr \(*W-|\(bv\*(Tr
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
@@ -128,7 +128,7 @@
.\" ========================================================================
.\"
.IX Title "LD 1"
-.TH LD 1 "2004-05-17" "binutils-2.15" "GNU Development Tools"
+.TH LD 1 "2006-06-23" "binutils-2.17" "GNU Development Tools"
.SH "NAME"
ld \- Using LD, the GNU linker
.SH "SYNOPSIS"
@@ -173,7 +173,7 @@ object files on a standard, supported Unix system. On such a system, to
link a file \f(CW\*(C`hello.o\*(C'\fR:
.PP
.Vb 1
-\& ld -o <output> /lib/crt0.o hello.o -lc
+\& ld \-o <output> /lib/crt0.o hello.o \-lc
.Ve
.PP
This tells \fBld\fR to produce a file called \fIoutput\fR as the
@@ -239,7 +239,7 @@ prefixed by \fB\-Wl,\fR (or whatever is appropriate for the particular
compiler driver) like this:
.PP
.Vb 1
-\& gcc -Wl,--startgroup foo.o bar.o -Wl,--endgroup
+\& gcc \-Wl,\-\-startgroup foo.o bar.o \-Wl,\-\-endgroup
.Ve
.PP
This is important, because otherwise the compiler driver program may
@@ -247,6 +247,19 @@ silently drop the linker options, resulting in a bad link.
.PP
Here is a table of the generic command line switches accepted by the \s-1GNU\s0
linker:
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
.IP "\fB\-a\fR\fIkeyword\fR" 4
.IX Item "-akeyword"
This option is supported for \s-1HP/UX\s0 compatibility. The \fIkeyword\fR
@@ -334,6 +347,16 @@ named \fIentry\fR, the linker will try to parse \fIentry\fR as a number,
and use that as the entry address (the number will be interpreted in
base 10; you may use a leading \fB0x\fR for base 16, or a leading
\&\fB0\fR for base 8).
+.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
+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. This option is available only for the i386 \s-1PE\s0 targeted
+port of the linker and for \s-1ELF\s0 targeted ports. For i386 \s-1PE\s0, symbols
+explicitly listed in a .def file are still exported, regardless of this
+option. For \s-1ELF\s0 targeted ports, symbols affected by this option will
+be treated as hidden.
.IP "\fB\-E\fR" 4
.IX Item "-E"
.PD 0
@@ -355,7 +378,7 @@ linking the program itself.
.Sp
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 \fB\-\-version\-script\fR in \f(CW@ref\fR{\s-1VERSION\s0}.
+See the description of \fB\-\-version\-script\fR in \fB\s-1VERSION\s0\fR.
.IP "\fB\-EB\fR" 4
.IX Item "-EB"
Link big-endian objects. This affects the default output format.
@@ -529,12 +552,40 @@ Print a link map to the standard output. A link map provides
information about the link, including the following:
.RS 4
.IP "*" 4
-Where object files and symbols are mapped into memory.
+Where object files are mapped into memory.
.IP "*" 4
How common symbols are allocated.
.IP "*" 4
All archive members included in the link, with a mention of the symbol
which caused the archive member to be brought in.
+.IP "*" 4
+The values assigned to symbols.
+.Sp
+Note \- symbols whose values are computed by an expression which
+involves a reference to a previous value of the same symbol may not
+have correct result displayed in the link map. This is because the
+linker discards intermediate results and only retains the final value
+of an expression. Under such circumstances the linker will display
+the final value enclosed by square brackets. Thus for example a
+linker script containing:
+.Sp
+.Vb 3
+\& foo = 1
+\& foo = foo * 4
+\& foo = foo + 8
+.Ve
+.Sp
+will produce the following output in the link map if the \fB\-M\fR
+option is used:
+.Sp
+.Vb 3
+\& 0x00000001 foo = 0x1
+\& [0x0000000c] foo = (foo * 0x4)
+\& [0x0000000c] foo = (foo + 0x8)
+.Ve
+.Sp
+See \fBExpressions\fR for more information about expressions in linker
+scripts.
.RE
.RS 4
.RE
@@ -590,6 +641,10 @@ order to perform correct modifications of executables. This results
in larger executables.
.Sp
This option is currently only supported on \s-1ELF\s0 platforms.
+.IP "\fB\-\-force\-dynamic\fR" 4
+.IX Item "--force-dynamic"
+Force the output file to have dynamic sections. This option is specific
+to VxWorks targets.
.IP "\fB\-r\fR" 4
.IX Item "-r"
.PD 0
@@ -743,6 +798,9 @@ lookup caching possible.
.IX Item "defs"
Disallows undefined symbols in object files. Undefined symbols in
shared libraries are still allowed.
+.IP "\fBexecstack\fR" 4
+.IX Item "execstack"
+Marks the object as requiring executable stack.
.IP "\fBinitfirst\fR" 4
.IX Item "initfirst"
This option is only meaningful when building a shared object.
@@ -781,6 +839,12 @@ 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 "\fBnoexecstack\fR" 4
+.IX Item "noexecstack"
+Marks the object as not requiring executable stack.
+.IP "\fBnorelro\fR" 4
+.IX Item "norelro"
+Don't create an \s-1ELF\s0 \f(CW\*(C`PT_GNU_RELRO\*(C'\fR segment header in the object.
.IP "\fBnow\fR" 4
.IX Item "now"
When generating an executable or shared library, mark it to tell the
@@ -791,6 +855,9 @@ first called.
.IP "\fBorigin\fR" 4
.IX Item "origin"
Marks the object may contain \f(CW$ORIGIN\fR.
+.IP "\fBrelro\fR" 4
+.IX Item "relro"
+Create an \s-1ELF\s0 \f(CW\*(C`PT_GNU_RELRO\*(C'\fR segment header in the object.
.RE
.RS 4
.Sp
@@ -840,9 +907,23 @@ This option affects \s-1ELF\s0 \s-1DT_NEEDED\s0 tags for dynamic libraries menti
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.
+needed. \fB\-\-as\-needed\fR causes \s-1DT_NEEDED\s0 tags to only be emitted
+for libraries that satisfy some symbol reference from regular objects
+which is undefined at the point that the library was linked.
\&\fB\-\-no\-as\-needed\fR restores the default behaviour.
+.IP "\fB\-\-add\-needed\fR" 4
+.IX Item "--add-needed"
+.PD 0
+.IP "\fB\-\-no\-add\-needed\fR" 4
+.IX Item "--no-add-needed"
+.PD
+This option affects the treatment of dynamic libraries from \s-1ELF\s0
+\&\s-1DT_NEEDED\s0 tags in dynamic libraries mentioned on the command line after
+the \fB\-\-no\-add\-needed\fR option. Normally, the linker will add
+a \s-1DT_NEEDED\s0 tag for each dynamic library from \s-1DT_NEEDED\s0 tags.
+\&\fB\-\-no\-add\-needed\fR causes \s-1DT_NEEDED\s0 tags will never be emitted
+for those libraries from \s-1DT_NEEDED\s0 tags. \fB\-\-add\-needed\fR restores
+the default behaviour.
.IP "\fB\-assert\fR \fIkeyword\fR" 4
.IX Item "-assert keyword"
This option is ignored for SunOS compatibility.
@@ -882,7 +963,11 @@ 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. This
-option also implies \fB\-\-unresolved\-symbols=report\-all\fR.
+option also implies \fB\-\-unresolved\-symbols=report\-all\fR. This
+option can be used with \fB\-shared\fR. Doing so means that a
+shared library is being created but that all of the library's external
+references must be resolved by pulling in entries from static
+libraries.
.IP "\fB\-Bsymbolic\fR" 4
.IX Item "-Bsymbolic"
When creating a shared library, bind references to global symbols to the
@@ -897,7 +982,7 @@ platforms which support shared libraries.
.IX Item "--no-check-sections"
.PD
Asks the linker \fInot\fR to check section addresses after they have
-been assigned to see if there any overlaps. Normally the linker will
+been assigned to see if there are 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
@@ -938,7 +1023,7 @@ context: you may give a hexadecimal constant or the name of an existing
symbol, or use \f(CW\*(C`+\*(C'\fR and \f(CW\*(C`\-\*(C'\fR to add or subtract hexadecimal
constants or symbols. If you need more elaborate expressions, consider
using the linker command language from a script. \fINote:\fR there should be no white
-space between \fIsymbol\fR, the equals sign (``\fB=\fR''), and
+space between \fIsymbol\fR, the equals sign ("\fB=\fR"), and
\&\fIexpression\fR.
.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4
.IX Item "--demangle[=style]"
@@ -961,13 +1046,6 @@ Set the name of the dynamic linker. This is only meaningful when
generating dynamically linked \s-1ELF\s0 executables. The default dynamic
linker is normally correct; don't use this unless you know what you are
doing.
-.IP "\fB\-\-embedded\-relocs\fR" 4
-.IX Item "--embedded-relocs"
-This option is only meaningful when linking \s-1MIPS\s0 embedded \s-1PIC\s0 code,
-generated by the \-membedded\-pic option to the \s-1GNU\s0 compiler and
-assembler. It causes the linker to create a table which may be used at
-runtime to relocate any data which was statically initialized to pointer
-values. See the code in testsuite/ld\-empic for details.
.IP "\fB\-\-fatal\-warnings\fR" 4
.IX Item "--fatal-warnings"
Treat all warnings as errors.
@@ -989,9 +1067,9 @@ it ends in a \f(CW\*(C`.exe\*(C'\fR suffix.
.PD
Enable garbage collection of unused input sections. It is ignored on
targets that do not support this option. This option is not compatible
-with \fB\-r\fR, nor should it be used with dynamic linking. The default
-behaviour (of not performing this garbage collection) can be restored by
-specifying \fB\-\-no\-gc\-sections\fR on the command line.
+with \fB\-r\fR. The default behaviour (of not performing this garbage
+collection) can be restored by specifying \fB\-\-no\-gc\-sections\fR on
+the command line.
.IP "\fB\-\-help\fR" 4
.IX Item "--help"
Print a summary of the command-line options on the standard output and exit.
@@ -1055,6 +1133,14 @@ for \s-1HPPA\s0 shared libraries to have undefined symbols.
Normally when a symbol has an undefined version, the linker will ignore
it. This option disallows symbols with undefined version and a fatal error
will be issued instead.
+.IP "\fB\-\-default\-symver\fR" 4
+.IX Item "--default-symver"
+Create and use a default symbol version (the soname) for unversioned
+exported symbols.
+.IP "\fB\-\-default\-imported\-symver\fR" 4
+.IX Item "--default-imported-symver"
+Create and use a default symbol version (the soname) for unversioned
+imported symbols.
.IP "\fB\-\-no\-warn\-mismatch\fR" 4
.IX Item "--no-warn-mismatch"
Normally \fBld\fR will give an error if you try to link together input
@@ -1238,6 +1324,14 @@ places them in the appropriate output sections. First come all the one
byte symbols, then all the two byte, then all the four byte, and then
everything else. This is to prevent gaps between symbols due to
alignment constraints.
+.IP "\fB\-\-sort\-section name\fR" 4
+.IX Item "--sort-section name"
+This option will apply \f(CW\*(C`SORT_BY_NAME\*(C'\fR to all wildcard section
+patterns in the linker script.
+.IP "\fB\-\-sort\-section alignment\fR" 4
+.IX Item "--sort-section alignment"
+This option will apply \f(CW\*(C`SORT_BY_ALIGNMENT\*(C'\fR to all wildcard section
+patterns in the linker script.
.IP "\fB\-\-split\-by\-file [\fR\fIsize\fR\fB]\fR" 4
.IX Item "--split-by-file [size]"
Similar to \fB\-\-split\-by\-reloc\fR but creates a new output section for
@@ -1259,6 +1353,11 @@ many relocations. \fIcount\fR defaults to a value of 32768.
.IX Item "--stats"
Compute and display statistics about the operation of the linker, such
as execution time and memory usage.
+.IP "\fB\-\-sysroot=\fR\fIdirectory\fR" 4
+.IX Item "--sysroot=directory"
+Use \fIdirectory\fR as the location of the sysroot, overriding the
+configure-time default. This option is only supported by linkers
+that were configured using \fB\-\-with\-sysroot\fR.
.IP "\fB\-\-traditional\-format\fR" 4
.IX Item "--traditional-format"
For some targets, the output of \fBld\fR is different in some ways from
@@ -1281,7 +1380,7 @@ line.
for compatibility with other linkers, you may omit the leading
\&\fB0x\fR usually associated with hexadecimal values. \fINote:\fR there
should be no white space between \fIsectionname\fR, the equals
-sign (``\fB=\fR''), and \fIorg\fR.
+sign ("\fB=\fR"), and \fIorg\fR.
.IP "\fB\-Tbss\fR \fIorg\fR" 4
.IX Item "-Tbss org"
.PD 0
@@ -1452,6 +1551,9 @@ 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\-shared\-textrel\fR" 4
+.IX Item "--warn-shared-textrel"
+Warn if the linker adds a \s-1DT_TEXTREL\s0 to a shared object.
.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
@@ -1508,6 +1610,10 @@ links without the \fB\-\-wrap\fR option will succeed. If you do this,
you should not put the definition of \f(CW\*(C`_\|_real_malloc\*(C'\fR in the same
file as \f(CW\*(C`_\|_wrap_malloc\*(C'\fR; if you do, the assembler may resolve the
call before the linker has a chance to wrap it to \f(CW\*(C`malloc\*(C'\fR.
+.IP "\fB\-\-eh\-frame\-hdr\fR" 4
+.IX Item "--eh-frame-hdr"
+Request creation of \f(CW\*(C`.eh_frame_hdr\*(C'\fR section and \s-1ELF\s0
+\&\f(CW\*(C`PT_GNU_EH_FRAME\*(C'\fR segment header.
.IP "\fB\-\-enable\-new\-dtags\fR" 4
.IX Item "--enable-new-dtags"
.PD 0
@@ -1520,6 +1626,27 @@ systems may not understand them. If you specify
If you specify \fB\-\-disable\-new\-dtags\fR, no new dynamic tags will be
created. By default, the new dynamic tags are not created. Note that
those options are only available for \s-1ELF\s0 systems.
+.IP "\fB\-\-hash\-size=\fR\fInumber\fR" 4
+.IX Item "--hash-size=number"
+Set the default size of the linker's hash tables to a prime number
+close to \fInumber\fR. Increasing this value can reduce the length of
+time it takes the linker to perform its tasks, at the expense of
+increasing the linker's memory requirements. Similarly reducing this
+value can reduce the memory requirements at the expense of speed.
+.IP "\fB\-\-reduce\-memory\-overheads\fR" 4
+.IX Item "--reduce-memory-overheads"
+This option reduces memory requirements at ld runtime, at the expense of
+linking speed. This was introduced to select the old O(n^2) algorithm
+for link map file generation, rather than the new O(n) algorithm which uses
+about 40% more memory for symbol storage.
+.Sp
+Another effect of the switch is to set the default hash table size to
+1021, which again saves memory at the cost of lengthening the linker's
+run time. This is not done however if the \fB\-\-hash\-size\fR switch
+has been used.
+.Sp
+The \fB\-\-reduce\-memory\-overheads\fR switch may be also be used to
+enable other tradeoffs in future versions of the linker.
.PP
The i386 \s-1PE\s0 linker supports the \fB\-shared\fR option, which causes
the output to be a dynamically linked library (\s-1DLL\s0) instead of a
@@ -1558,7 +1685,7 @@ file.
.IX Item "--disable-stdcall-fixup"
.PD
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 \*(L"fuzzy linking\*(R" 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
@@ -1601,14 +1728,6 @@ These cygwin-excludes are: \f(CW\*(C`_cygwin_dll_entry@12\*(C'\fR,
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
-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
@@ -1639,29 +1758,37 @@ for dlls.
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\-\-large\-address\-aware\fR" 4
+.IX Item "--large-address-aware"
+If given, the appropriate bit in the \*(L"Charateristics\*(R" field of the \s-1COFF\s0
+header is set to indicate that this executable supports virtual addresses
+greater than 2 gigabytes. This should be used in conjuction with the /3GB
+or /USERVA=\fIvalue\fR megabytes switch in the \*(L"[operating systems]\*(R"
+section of the \s-1BOOT\s0.INI. Otherwise, this bit has no effect.
+[This option is specific to \s-1PE\s0 targeted ports of the linker]
.IP "\fB\-\-major\-image\-version\fR \fIvalue\fR" 4
.IX Item "--major-image-version value"
-Sets the major number of the ``image version''. Defaults to 1.
+Sets the major number of the \*(L"image version\*(R". 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 ``os version''. Defaults to 4.
+Sets the major number of the \*(L"os version\*(R". 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 ``subsystem version''. Defaults to 4.
+Sets the major number of the \*(L"subsystem version\*(R". 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 ``image version''. Defaults to 0.
+Sets the minor number of the \*(L"image version\*(R". 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 ``os version''. Defaults to 0.
+Sets the minor number of the \*(L"os version\*(R". 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 ``subsystem version''. Defaults to 0.
+Sets the minor number of the \*(L"subsystem version\*(R". 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"
@@ -1742,7 +1869,7 @@ a variable, or b) make the 'constant' index a variable. Thus:
.Sp
.Vb 3
\& extern type extern_array[];
-\& extern_array[1] -->
+\& extern_array[1] \-\->
\& { volatile type *t=extern_array; t[1] }
.Ve
.Sp
@@ -1750,7 +1877,7 @@ or
.Sp
.Vb 3
\& extern type extern_array[];
-\& extern_array[1] -->
+\& extern_array[1] \-\->
\& { volatile int t=1; extern_array[t] }
.Ve
.Sp
@@ -1759,15 +1886,15 @@ is to make the struct itself (or the long long, or the ...) variable:
.Sp
.Vb 3
\& extern struct s extern_struct;
-\& extern_struct.field -->
-\& { volatile struct s *t=&extern_struct; t->field }
+\& extern_struct.field \-\->
+\& { volatile struct s *t=&extern_struct; t\->field }
.Ve
.Sp
or
.Sp
.Vb 3
\& extern long long extern_ll;
-\& extern_ll -->
+\& extern_ll \-\->
\& { volatile long long * local_ll=&extern_ll; *local_ll }
.Ve
.Sp
@@ -1783,9 +1910,9 @@ constant offset' problem, you should consider typical real-world usage:
Original:
.Sp
.Vb 7
-\& --foo.h
+\& \-\-foo.h
\& extern int arr[];
-\& --foo.c
+\& \-\-foo.c
\& #include "foo.h"
\& void main(int argc, char **argv){
\& printf("%d\en",arr[1]);
@@ -1795,9 +1922,9 @@ Original:
Solution 1:
.Sp
.Vb 9
-\& --foo.h
+\& \-\-foo.h
\& extern int arr[];
-\& --foo.c
+\& \-\-foo.c
\& #include "foo.h"
\& void main(int argc, char **argv){
\& /* This workaround is for win32 and cygwin; do not "optimize" */
@@ -1809,8 +1936,8 @@ Solution 1:
Solution 2:
.Sp
.Vb 14
-\& --foo.h
-\& /* Note: auto-export is assumed (no __declspec(dllexport)) */
+\& \-\-foo.h
+\& /* Note: auto\-export is assumed (no __declspec(dllexport)) */
\& #if (defined(_WIN32) || defined(__CYGWIN__)) && \e
\& !(defined(FOO_BUILD_DLL) || defined(FOO_STATIC))
\& #define FOO_IMPORT __declspec(dllimport)
@@ -1818,7 +1945,7 @@ Solution 2:
\& #define FOO_IMPORT
\& #endif
\& extern FOO_IMPORT int arr[];
-\& --foo.c
+\& \-\-foo.c
\& #include "foo.h"
\& void main(int argc, char **argv){
\& printf("%d\en",arr[1]);
@@ -1876,9 +2003,24 @@ committed.
.PD
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.
+\&\f(CW\*(C`console\*(C'\fR, \f(CW\*(C`posix\*(C'\fR, and \f(CW\*(C`xbox\*(C'\fR. You may optionally set
+the subsystem version also. Numeric values are also accepted for
+\&\fIwhich\fR.
[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.PP
+The 68HC11 and 68HC12 linkers support specific options to control the
+memory bank switching mapping and trampoline code generation.
+.IP "\fB\-\-no\-trampoline\fR" 4
+.IX Item "--no-trampoline"
+This option disables the generation of trampoline. By default a trampoline
+is generated for each far function which is called using a \f(CW\*(C`jsr\*(C'\fR
+instruction (this happens when a pointer to a far function is taken).
+.IP "\fB\-\-bank\-window\fR \fIname\fR" 4
+.IX Item "--bank-window name"
+This option indicates to the linker the name of the memory region in
+the \fB\s-1MEMORY\s0\fR specification that describes the memory bank window.
+The definition of such region is then used by the linker to compute
+paging and addresses within the memory window.
.SH "ENVIRONMENT"
.IX Header "ENVIRONMENT"
You can change the behaviour of \fBld\fR with the environment variables
@@ -1926,4 +2068,4 @@ 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 ``\s-1GNU\s0 Free Documentation License''.
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/contrib/binutils/ld/ld.h b/contrib/binutils/ld/ld.h
index dde4cfe..b5a4f55 100644
--- a/contrib/binutils/ld/ld.h
+++ b/contrib/binutils/ld/ld.h
@@ -1,5 +1,6 @@
/* ld.h -- general linker header file
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -16,13 +17,49 @@
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. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#ifndef LD_H
#define LD_H
#ifdef HAVE_LOCALE_H
+#endif
+#ifndef SEEK_CUR
+#define SEEK_CUR 1
+#endif
+#ifndef SEEK_END
+#define SEEK_END 2
+#endif
+
+#if defined(__GNUC__) && !defined(C_ALLOCA)
+# undef alloca
+# define alloca __builtin_alloca
+#else
+# if defined(HAVE_ALLOCA_H) && !defined(C_ALLOCA)
+# include <alloca.h>
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+# if !defined (__STDC__) && !defined (__hpux)
+char *alloca ();
+# else
+void *alloca ();
+# endif /* __STDC__, __hpux */
+# endif /* alloca */
+# endif /* HAVE_ALLOCA_H */
+#endif
+
+
+#ifdef HAVE_LOCALE_H
+# ifndef ENABLE_NLS
+ /* The Solaris version of locale.h always includes libintl.h. If we have
+ been configured with --disable-nls then ENABLE_NLS will not be defined
+ and the dummy definitions of bindtextdomain (et al) below will conflict
+ with the defintions in libintl.h. So we define these values to prevent
+ the bogus inclusion of libintl.h. */
+# define _LIBINTL_H
+# define _LIBGETTEXT_H
+# endif
# include <locale.h>
#endif
@@ -64,13 +101,18 @@ typedef struct name_list {
}
name_list;
-/* A wildcard specification. This is only used in ldgram.y, but it
- winds up in ldgram.h, so we need to define it outside. */
+/* A wildcard specification. */
+
+typedef enum {
+ none, by_name, by_alignment, by_name_alignment, by_alignment_name
+} sort_type;
+
+extern sort_type sort_section;
struct wildcard_spec {
const char *name;
struct name_list *exclude_name_list;
- bfd_boolean sorted;
+ sort_type sorted;
};
struct wildcard_list {
@@ -78,11 +120,19 @@ struct wildcard_list {
struct wildcard_spec spec;
};
-/* Extra information we hold on sections */
-typedef struct user_section_struct {
- /* Pointer to the section where this data will go */
- struct lang_input_statement_struct *file;
-} section_userdata_type;
+struct map_symbol_def {
+ struct bfd_link_hash_entry *entry;
+ struct map_symbol_def *next;
+};
+
+/* The initial part of fat_user_section_struct has to be idential with
+ lean_user_section_struct. */
+typedef struct fat_user_section_struct {
+ /* For input sections, when writing a map file: head / tail of a linked
+ list of hash table entries for symbols defined in this section. */
+ struct map_symbol_def *map_symbol_def_head;
+ struct map_symbol_def **map_symbol_def_tail;
+} fat_section_userdata_type;
#define get_userdata(x) ((x)->userdata)
@@ -129,9 +179,6 @@ typedef struct {
files. */
bfd_boolean warn_mismatch;
- /* Remove unreferenced sections? */
- bfd_boolean gc_sections;
-
/* Name of shared object whose symbol table should be filtered with
this shared object. From the --filter option. */
char *filter_shlib;
@@ -154,6 +201,10 @@ typedef struct {
input files. */
bfd_boolean accept_unknown_input_arch;
+ /* If TRUE reduce memory overheads, at the expense of speed.
+ This will cause map file generation to use an O(N^2) algorithm. */
+ bfd_boolean reduce_memory_overheads;
+
} args_type;
extern args_type command_line;
@@ -216,16 +267,13 @@ typedef struct {
/* If set, only search library directories explicitly selected
on the command line. */
bfd_boolean only_cmd_line_lib_dirs;
+
+ /* The size of the hash table to use. */
+ bfd_size_type hash_table_size;
} ld_config_type;
extern ld_config_type config;
-typedef enum {
- lang_first_phase_enum,
- lang_allocating_phase_enum,
- lang_final_phase_enum
-} lang_phase_type;
-
extern FILE * saved_script_handle;
extern bfd_boolean force_make_executable;
@@ -234,6 +282,7 @@ extern int parsing_defsym;
extern int yyparse (void);
extern void add_cref (const char *, bfd *, asection *, bfd_vma);
+extern bfd_boolean handle_asneeded_cref (bfd *, enum notice_asneeded_action);
extern void output_cref (FILE *);
extern void check_nocrossrefs (void);
extern void ld_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
diff --git a/contrib/binutils/ld/ld.texinfo b/contrib/binutils/ld/ld.texinfo
index 4310c12..07bb0c3 100644
--- a/contrib/binutils/ld/ld.texinfo
+++ b/contrib/binutils/ld/ld.texinfo
@@ -1,11 +1,13 @@
\input texinfo
@setfilename ld.info
@c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-@c 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+@c 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
@syncodeindex ky cp
+@c man begin INCLUDE
@include configdoc.texi
@c (configdoc.texi is generated by the Makefile)
@include ldver.texi
+@c man end
@c @smallbook
@@ -18,7 +20,6 @@
@c Configure for the generation of man pages
@set UsesEnvVars
@set GENERIC
-@set A29K
@set ARC
@set ARM
@set D10V
@@ -39,6 +40,8 @@
@set MSP430
@set PDP11
@set PJ
+@set POWERPC
+@set POWERPC64
@set SH
@set SPARC
@set TIC54X
@@ -152,6 +155,15 @@ section entitled ``GNU Free Documentation License''.
@ifset HPPA
* HPPA ELF32:: ld and HPPA 32-bit ELF
@end ifset
+@ifset M68HC11
+* M68HC11/68HC12:: ld and the Motorola 68HC11 and 68HC12 families
+@end ifset
+@ifset POWERPC
+* PowerPC ELF32:: ld and PowerPC 32-bit ELF Support
+@end ifset
+@ifset POWERPC64
+* PowerPC64 ELF64:: ld and PowerPC64 64-bit ELF Support
+@end ifset
@ifset TICOFF
* TI COFF:: ld and the TI COFF
@end ifset
@@ -338,6 +350,8 @@ Here is a table of the generic command line switches accepted by the GNU
linker:
@table @gcctabopt
+@include at-file.texi
+
@kindex -a@var{keyword}
@item -a@var{keyword}
This option is supported for HP/UX compatibility. The @var{keyword}
@@ -446,6 +460,17 @@ base 10; you may use a leading @samp{0x} for base 16, or a leading
@samp{0} for base 8). @xref{Entry Point}, for a discussion of defaults
and other ways of specifying the entry point.
+@kindex --exclude-libs
+@item --exclude-libs @var{lib},@var{lib},...
+Specifies a list of archive libraries from which symbols should not be automatically
+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. This option is available only for the i386 PE targeted
+port of the linker and for ELF targeted ports. For i386 PE, symbols
+explicitly listed in a .def file are still exported, regardless of this
+option. For ELF targeted ports, symbols affected by this option will
+be treated as hidden.
+
@cindex dynamic symbol table
@kindex -E
@kindex --export-dynamic
@@ -661,12 +686,40 @@ information about the link, including the following:
@itemize @bullet
@item
-Where object files and symbols are mapped into memory.
+Where object files are mapped into memory.
@item
How common symbols are allocated.
@item
All archive members included in the link, with a mention of the symbol
which caused the archive member to be brought in.
+@item
+The values assigned to symbols.
+
+Note - symbols whose values are computed by an expression which
+involves a reference to a previous value of the same symbol may not
+have correct result displayed in the link map. This is because the
+linker discards intermediate results and only retains the final value
+of an expression. Under such circumstances the linker will display
+the final value enclosed by square brackets. Thus for example a
+linker script containing:
+
+@smallexample
+ foo = 1
+ foo = foo * 4
+ foo = foo + 8
+@end smallexample
+
+will produce the following output in the link map if the @option{-M}
+option is used:
+
+@smallexample
+ 0x00000001 foo = 0x1
+ [0x0000000c] foo = (foo * 0x4)
+ [0x0000000c] foo = (foo + 0x8)
+@end smallexample
+
+See @ref{Expressions} for more information about expressions in linker
+scripts.
@end itemize
@kindex -n
@@ -727,6 +780,12 @@ in larger executables.
This option is currently only supported on ELF platforms.
+@kindex --force-dynamic
+@cindex forcing the creation of dynamic sections
+@item --force-dynamic
+Force the output file to have dynamic sections. This option is specific
+to VxWorks targets.
+
@cindex partial link
@cindex relocatable output
@kindex -r
@@ -888,6 +947,9 @@ lookup caching possible.
Disallows undefined symbols in object files. Undefined symbols in
shared libraries are still allowed.
+@item execstack
+Marks the object as requiring executable stack.
+
@item initfirst
This option is only meaningful when building a shared object.
It marks the object so that its runtime initialization will occur
@@ -926,6 +988,12 @@ Marks the object not available to @code{dlopen}.
@item nodump
Marks the object can not be dumped by @code{dldump}.
+@item noexecstack
+Marks the object as not requiring executable stack.
+
+@item norelro
+Don't create an ELF @code{PT_GNU_RELRO} segment header in the object.
+
@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
@@ -936,6 +1004,9 @@ first called.
@item origin
Marks the object may contain $ORIGIN.
+@item relro
+Create an ELF @code{PT_GNU_RELRO} segment header in the object.
+
@end table
Other keywords are ignored for Solaris compatibility.
@@ -980,10 +1051,23 @@ 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.
+needed. @option{--as-needed} causes DT_NEEDED tags to only be emitted
+for libraries that satisfy some symbol reference from regular objects
+which is undefined at the point that the library was linked.
@option{--no-as-needed} restores the default behaviour.
+@kindex --add-needed
+@kindex --no-add-needed
+@item --add-needed
+@itemx --no-add-needed
+This option affects the treatment of dynamic libraries from ELF
+DT_NEEDED tags in dynamic libraries mentioned on the command line after
+the @option{--no-add-needed} option. Normally, the linker will add
+a DT_NEEDED tag for each dynamic library from DT_NEEDED tags.
+@option{--no-add-needed} causes DT_NEEDED tags will never be emitted
+for those libraries from DT_NEEDED tags. @option{--add-needed} restores
+the default behaviour.
+
@kindex -assert @var{keyword}
@item -assert @var{keyword}
This option is ignored for SunOS compatibility.
@@ -1022,7 +1106,11 @@ 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. This
-option also implies @option{--unresolved-symbols=report-all}.
+option also implies @option{--unresolved-symbols=report-all}. This
+option can be used with @option{-shared}. Doing so means that a
+shared library is being created but that all of the library's external
+references must be resolved by pulling in entries from static
+libraries.
@kindex -Bsymbolic
@item -Bsymbolic
@@ -1037,7 +1125,7 @@ platforms which support shared libraries.
@item --check-sections
@itemx --no-check-sections
Asks the linker @emph{not} to check section addresses after they have
-been assigned to see if there any overlaps. Normally the linker will
+been assigned to see if there are 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
@@ -1113,15 +1201,6 @@ generating dynamically linked ELF executables. The default dynamic
linker is normally correct; don't use this unless you know what you are
doing.
-@cindex MIPS embedded PIC code
-@kindex --embedded-relocs
-@item --embedded-relocs
-This option is only meaningful when linking MIPS embedded PIC code,
-generated by the -membedded-pic option to the @sc{gnu} compiler and
-assembler. It causes the linker to create a table which may be used at
-runtime to relocate any data which was statically initialized to pointer
-values. See the code in testsuite/ld-empic for details.
-
@kindex --fatal-warnings
@item --fatal-warnings
@@ -1145,9 +1224,9 @@ it ends in a @code{.exe} suffix.
@itemx --gc-sections
Enable garbage collection of unused input sections. It is ignored on
targets that do not support this option. This option is not compatible
-with @samp{-r}, nor should it be used with dynamic linking. The default
-behaviour (of not performing this garbage collection) can be restored by
-specifying @samp{--no-gc-sections} on the command line.
+with @samp{-r}. The default behaviour (of not performing this garbage
+collection) can be restored by specifying @samp{--no-gc-sections} on
+the command line.
@cindex help
@cindex usage
@@ -1217,6 +1296,16 @@ Normally when a symbol has an undefined version, the linker will ignore
it. This option disallows symbols with undefined version and a fatal error
will be issued instead.
+@kindex --default-symver
+@item --default-symver
+Create and use a default symbol version (the soname) for unversioned
+exported symbols.
+
+@kindex --default-imported-symver
+@item --default-imported-symver
+Create and use a default symbol version (the soname) for unversioned
+imported symbols.
+
@kindex --no-warn-mismatch
@item --no-warn-mismatch
Normally @command{ld} will give an error if you try to link together input
@@ -1299,6 +1388,12 @@ This option is only supported on a few targets.
@ifset XTENSA
@xref{Xtensa,, @command{ld} and Xtensa Processors}.
@end ifset
+@ifset M68HC11
+@xref{M68HC11/68HC12,,@command{ld} and the 68HC11 and 68HC12}.
+@end ifset
+@ifset POWERPC
+@xref{PowerPC ELF32,,@command{ld} and PowerPC 32-bit ELF Support}.
+@end ifset
On some platforms, the @samp{--relax} option performs global
optimizations that become possible when the linker resolves addressing
@@ -1440,6 +1535,16 @@ byte symbols, then all the two byte, then all the four byte, and then
everything else. This is to prevent gaps between symbols due to
alignment constraints.
+@kindex --sort-section name
+@item --sort-section name
+This option will apply @code{SORT_BY_NAME} to all wildcard section
+patterns in the linker script.
+
+@kindex --sort-section alignment
+@item --sort-section alignment
+This option will apply @code{SORT_BY_ALIGNMENT} to all wildcard section
+patterns in the linker script.
+
@kindex --split-by-file
@item --split-by-file [@var{size}]
Similar to @option{--split-by-reloc} but creates a new output section for
@@ -1464,6 +1569,12 @@ many relocations. @var{count} defaults to a value of 32768.
Compute and display statistics about the operation of the linker, such
as execution time and memory usage.
+@kindex --sysroot
+@item --sysroot=@var{directory}
+Use @var{directory} as the location of the sysroot, overriding the
+configure-time default. This option is only supported by linkers
+that were configured using @option{--with-sysroot}.
+
@kindex --traditional-format
@cindex traditional format
@item --traditional-format
@@ -1671,6 +1782,10 @@ 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-shared-textrel
+@item --warn-shared-textrel
+Warn if the linker adds a DT_TEXTREL to a shared object.
+
@kindex --warn-unresolved-symbols
@item --warn-unresolved-symbols
If the linker is going to report an unresolved symbol (see the option
@@ -1732,6 +1847,11 @@ you should not put the definition of @code{__real_malloc} in the same
file as @code{__wrap_malloc}; if you do, the assembler may resolve the
call before the linker has a chance to wrap it to @code{malloc}.
+@kindex --eh-frame-hdr
+@item --eh-frame-hdr
+Request creation of @code{.eh_frame_hdr} section and ELF
+@code{PT_GNU_EH_FRAME} segment header.
+
@kindex --enable-new-dtags
@kindex --disable-new-dtags
@item --enable-new-dtags
@@ -1743,6 +1863,29 @@ If you specify @option{--disable-new-dtags}, no new dynamic tags will be
created. By default, the new dynamic tags are not created. Note that
those options are only available for ELF systems.
+@kindex --hash-size=@var{number}
+@item --hash-size=@var{number}
+Set the default size of the linker's hash tables to a prime number
+close to @var{number}. Increasing this value can reduce the length of
+time it takes the linker to perform its tasks, at the expense of
+increasing the linker's memory requirements. Similarly reducing this
+value can reduce the memory requirements at the expense of speed.
+
+@kindex --reduce-memory-overheads
+@item --reduce-memory-overheads
+This option reduces memory requirements at ld runtime, at the expense of
+linking speed. This was introduced to select the old O(n^2) algorithm
+for link map file generation, rather than the new O(n) algorithm which uses
+about 40% more memory for symbol storage.
+
+Another effect of the switch is to set the default hash table size to
+1021, which again saves memory at the cost of lengthening the linker's
+run time. This is not done however if the @option{--hash-size} switch
+has been used.
+
+The @option{--reduce-memory-overheads} switch may be also be used to
+enable other tradeoffs in future versions of the linker.
+
@end table
@c man end
@@ -1839,15 +1982,6 @@ 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},...
-Specifies a list of archive libraries from which symbols should not be automatically
-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
@@ -1881,6 +2015,15 @@ 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 --large-address-aware
+@item --large-address-aware
+If given, the appropriate bit in the ``Charateristics'' field of the COFF
+header is set to indicate that this executable supports virtual addresses
+greater than 2 gigabytes. This should be used in conjuction with the /3GB
+or /USERVA=@var{value} megabytes switch in the ``[operating systems]''
+section of the BOOT.INI. Otherwise, this bit has no effect.
+[This option is specific to PE targeted ports of the linker]
+
@kindex --major-image-version
@item --major-image-version @var{value}
Sets the major number of the ``image version''. Defaults to 1.
@@ -2131,14 +2274,43 @@ committed.
@itemx --subsystem @var{which}:@var{major}.@var{minor}
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.
+@code{console}, @code{posix}, and @code{xbox}. You may optionally set
+the subsystem version also. Numeric values are also accepted for
+@var{which}.
[This option is specific to the i386 PE targeted port of the linker]
@end table
@c man end
+@ifset M68HC11
+@subsection Options specific to Motorola 68HC11 and 68HC12 targets
+
+@c man begin OPTIONS
+
+The 68HC11 and 68HC12 linkers support specific options to control the
+memory bank switching mapping and trampoline code generation.
+
+@table @gcctabopt
+
+@kindex --no-trampoline
+@item --no-trampoline
+This option disables the generation of trampoline. By default a trampoline
+is generated for each far function which is called using a @code{jsr}
+instruction (this happens when a pointer to a far function is taken).
+
+@kindex --bank-window
+@item --bank-window @var{name}
+This option indicates to the linker the name of the memory region in
+the @samp{MEMORY} specification that describes the memory bank window.
+The definition of such region is then used by the linker to compute
+paging and addresses within the memory window.
+
+@end table
+
+@c man end
+@end ifset
+
@ifset UsesEnvVars
@node Environment
@section Environment Variables
@@ -2365,7 +2537,7 @@ at address @samp{0x8000000}. After the linker places the @samp{.data}
output section, the value of the location counter will be
@samp{0x8000000} plus the size of the @samp{.data} output section. The
effect is that the linker will place the @samp{.bss} output section
-immediately after the @samp{.data} output section in memory
+immediately after the @samp{.data} output section in memory.
The linker will ensure that each output section has the required
alignment, by increasing the location counter if necessary. In this
@@ -2475,6 +2647,18 @@ files should all be archives, and they are searched repeatedly until no
new undefined references are created. See the description of @samp{-(}
in @ref{Options,,Command Line Options}.
+@item AS_NEEDED(@var{file}, @var{file}, @dots{})
+@itemx AS_NEEDED(@var{file} @var{file} @dots{})
+@kindex AS_NEEDED(@var{files})
+This construct can appear only inside of the @code{INPUT} or @code{GROUP}
+commands, among other filenames. The files listed will be handled
+as if they appear directly in the @code{INPUT} or @code{GROUP} commands,
+with the exception of ELF shared libraries, that will be added only
+when they are actually needed. This construct essentially enables
+@option{--as-needed} option for all the files listed inside of it
+and restores previous @option{--as-needed} resp. @option{--no-as-needed}
+setting afterwards.
+
@item OUTPUT(@var{filename})
@kindex OUTPUT(@var{filename})
@cindex output file name in linker scripot
@@ -2627,11 +2811,13 @@ the @samp{-f} option.
@cindex symbol definition, scripts
@cindex variables, defining
You may assign a value to a symbol in a linker script. This will define
-the symbol as a global symbol.
+the symbol and place it into the symbol table with a global scope.
@menu
* Simple Assignments:: Simple Assignments
* PROVIDE:: PROVIDE
+* PROVIDE_HIDDEN:: PROVIDE_HIDDEN
+* Source Code Reference:: How to use a linker script defined symbol in source code
@end menu
@node Simple Assignments
@@ -2656,7 +2842,7 @@ The first case will define @var{symbol} to the value of
defined, and the value will be adjusted accordingly.
The special symbol name @samp{.} indicates the location counter. You
-may only use this within a @code{SECTIONS} command.
+may only use this within a @code{SECTIONS} command. @xref{Location Counter}.
The semicolon after @var{expression} is required.
@@ -2724,6 +2910,119 @@ underscore), the linker will silently use the definition in the program.
If the program references @samp{etext} but does not define it, the
linker will use the definition in the linker script.
+@node PROVIDE_HIDDEN
+@subsection PROVIDE_HIDDEN
+@cindex PROVIDE_HIDDEN
+Similar to @code{PROVIDE}. For ELF targeted ports, the symbol will be
+hidden and won't be exported.
+
+@node Source Code Reference
+@subsection Source Code Reference
+
+Accessing a linker script defined variable from source code is not
+intuitive. In particular a linker script symbol is not equivalent to
+a variable declaration in a high level language, it is instead a
+symbol that does not have a value.
+
+Before going further, it is important to note that compilers often
+transform names in the source code into different names when they are
+stored in the symbol table. For example, Fortran compilers commonly
+prepend or append an underscore, and C++ performs extensive @samp{name
+mangling}. Therefore there might be a discrepancy between the name
+of a variable as it is used in source code and the name of the same
+variable as it is defined in a linker script. For example in C a
+linker script variable might be referred to as:
+
+@smallexample
+ extern int foo;
+@end smallexample
+
+But in the linker script it might be defined as:
+
+@smallexample
+ _foo = 1000;
+@end smallexample
+
+In the remaining examples however it is assumed that no name
+transformation has taken place.
+
+When a symbol is declared in a high level language such as C, two
+things happen. The first is that the compiler reserves enough space
+in the program's memory to hold the @emph{value} of the symbol. The
+second is that the compiler creates an entry in the program's symbol
+table which holds the symbol's @emph{address}. ie the symbol table
+contains the address of the block of memory holding the symbol's
+value. So for example the following C declaration, at file scope:
+
+@smallexample
+ int foo = 1000;
+@end smallexample
+
+creates a entry called @samp{foo} in the symbol table. This entry
+holds the address of an @samp{int} sized block of memory where the
+number 1000 is initially stored.
+
+When a program references a symbol the compiler generates code that
+first accesses the symbol table to find the address of the symbol's
+memory block and then code to read the value from that memory block.
+So:
+
+@smallexample
+ foo = 1;
+@end smallexample
+
+looks up the symbol @samp{foo} in the symbol table, gets the address
+associated with this symbol and then writes the value 1 into that
+address. Whereas:
+
+@smallexample
+ int * a = & foo;
+@end smallexample
+
+looks up the symbol @samp{foo} in the symbol table, gets it address
+and then copies this address into the block of memory associated with
+the variable @samp{a}.
+
+Linker scripts symbol declarations, by contrast, create an entry in
+the symbol table but do not assign any memory to them. Thus they are
+an address without a value. So for example the linker script definition:
+
+@smallexample
+ foo = 1000;
+@end smallexample
+
+creates an entry in the symbol table called @samp{foo} which holds
+the address of memory location 1000, but nothing special is stored at
+address 1000. This means that you cannot access the @emph{value} of a
+linker script defined symbol - it has no value - all you can do is
+access the @emph{address} of a linker script defined symbol.
+
+Hence when you are using a linker script defined symbol in source code
+you should always take the address of the symbol, and never attempt to
+use its value. For example suppose you want to copy the contents of a
+section of memory called .ROM into a section called .FLASH and the
+linker script contains these declarations:
+
+@smallexample
+@group
+ start_of_ROM = .ROM;
+ end_of_ROM = .ROM + sizeof (.ROM) - 1;
+ start_of_FLASH = .FLASH;
+@end group
+@end smallexample
+
+Then the C source code to perform the copy would be:
+
+@smallexample
+@group
+ extern char start_of_ROM, end_of_ROM, start_of_FLASH;
+
+ memcpy (& start_of_FLASH, & start_of_ROM, & end_of_ROM - & start_of_ROM);
+@end group
+@end smallexample
+
+Note the use of the @samp{&} operators. These are correct.
+
@node SECTIONS
@section SECTIONS Command
@kindex SECTIONS
@@ -2787,7 +3086,7 @@ The full description of an output section looks like this:
@smallexample
@group
@var{section} [@var{address}] [(@var{type})] :
- [AT(@var{lma})] [SUBALIGN(@var{subsection_align})]
+ [AT(@var{lma})] [ALIGN(@var{section_align})] [SUBALIGN(@var{subsection_align})]
@{
@var{output-section-command}
@var{output-section-command}
@@ -2834,7 +3133,7 @@ The output section name @samp{/DISCARD/} is special; @ref{Output Section
Discarding}.
@node Output Section Address
-@subsection Output Section Description
+@subsection Output Section Address
@cindex address, section
@cindex section address
The @var{address} is an expression for the VMA (the virtual memory
@@ -3008,14 +3307,66 @@ sequence of input section descriptions is probably in error, because the
.data1 : @{ data.o(.data) @}
@end smallexample
-@cindex SORT
+@cindex SORT_BY_NAME
Normally, the linker will place files and sections matched by wildcards
in the order in which they are seen during the link. You can change
-this by using the @code{SORT} keyword, which appears before a wildcard
-pattern in parentheses (e.g., @code{SORT(.text*)}). When the
-@code{SORT} keyword is used, the linker will sort the files or sections
+this by using the @code{SORT_BY_NAME} keyword, which appears before a wildcard
+pattern in parentheses (e.g., @code{SORT_BY_NAME(.text*)}). When the
+@code{SORT_BY_NAME} keyword is used, the linker will sort the files or sections
into ascending order by name before placing them in the output file.
+@cindex SORT_BY_ALIGNMENT
+@code{SORT_BY_ALIGNMENT} is very similar to @code{SORT_BY_NAME}. The
+difference is @code{SORT_BY_ALIGNMENT} will sort sections into
+ascending order by alignment before placing them in the output file.
+
+@cindex SORT
+@code{SORT} is an alias for @code{SORT_BY_NAME}.
+
+When there are nested section sorting commands in linker script, there
+can be at most 1 level of nesting for section sorting commands.
+
+@enumerate
+@item
+@code{SORT_BY_NAME} (@code{SORT_BY_ALIGNMENT} (wildcard section pattern)).
+It will sort the input sections by name first, then by alignment if 2
+sections have the same name.
+@item
+@code{SORT_BY_ALIGNMENT} (@code{SORT_BY_NAME} (wildcard section pattern)).
+It will sort the input sections by alignment first, then by name if 2
+sections have the same alignment.
+@item
+@code{SORT_BY_NAME} (@code{SORT_BY_NAME} (wildcard section pattern)) is
+treated the same as @code{SORT_BY_NAME} (wildcard section pattern).
+@item
+@code{SORT_BY_ALIGNMENT} (@code{SORT_BY_ALIGNMENT} (wildcard section pattern))
+is treated the same as @code{SORT_BY_ALIGNMENT} (wildcard section pattern).
+@item
+All other nested section sorting commands are invalid.
+@end enumerate
+
+When both command line section sorting option and linker script
+section sorting command are used, section sorting command always
+takes precedence over the command line option.
+
+If the section sorting command in linker script isn't nested, the
+command line option will make the section sorting command to be
+treated as nested sorting command.
+
+@enumerate
+@item
+@code{SORT_BY_NAME} (wildcard section pattern ) with
+@option{--sort-sections alignment} is equivalent to
+@code{SORT_BY_NAME} (@code{SORT_BY_ALIGNMENT} (wildcard section pattern)).
+@item
+@code{SORT_BY_ALIGNMENT} (wildcard section pattern) with
+@option{--sort-section name} is equivalent to
+@code{SORT_BY_ALIGNMENT} (@code{SORT_BY_NAME} (wildcard section pattern)).
+@end enumerate
+
+If the section sorting command in linker script is nested, the
+command line option will be ignored.
+
If you ever get confused about where input sections are going, use the
@samp{-M} linker option to generate a map file. The map file shows
precisely how input sections are mapped to output sections.
@@ -3081,7 +3432,7 @@ When link-time garbage collection is in use (@samp{--gc-sections}),
it is often useful to mark sections that should not be eliminated.
This is accomplished by surrounding an input section's wildcard entry
with @code{KEEP()}, as in @code{KEEP(*(.init))} or
-@code{KEEP(SORT(*)(.ctors))}.
+@code{KEEP(SORT_BY_NAME(*)(.ctors))}.
@node Input Section Example
@subsubsection Input Section Example
@@ -3231,7 +3582,9 @@ linker to place constructor information in the output section where the
ignored for other object file formats.
The symbol @w{@code{__CTOR_LIST__}} marks the start of the global
-constructors, and the symbol @w{@code{__DTOR_LIST}} marks the end. The
+constructors, and the symbol @w{@code{__CTOR_END__}} marks the end.
+Similarly, @w{@code{__DTOR_LIST__}} and @w{@code{__DTOR_END__}} mark
+the start and end of the global destructors. The
first word in the list is the number of entries, followed by the address
of each constructor or destructor, followed by a zero word. The
compiler must arrange to actually run the code. For these object file
@@ -3265,9 +3618,9 @@ If you are using the @sc{gnu} C++ support for initialization priority,
which provides some control over the order in which global constructors
are run, you must sort the constructors at link time to ensure that they
are executed in the correct order. When using the @code{CONSTRUCTORS}
-command, use @samp{SORT(CONSTRUCTORS)} instead. When using the
-@code{.ctors} and @code{.dtors} sections, use @samp{*(SORT(.ctors))} and
-@samp{*(SORT(.dtors))} instead of just @samp{*(.ctors)} and
+command, use @samp{SORT_BY_NAME(CONSTRUCTORS)} instead. When using the
+@code{.ctors} and @code{.dtors} sections, use @samp{*(SORT_BY_NAME(.ctors))} and
+@samp{*(SORT_BY_NAME(.dtors))} instead of just @samp{*(.ctors)} and
@samp{*(.dtors)}.
Normally the compiler and linker will handle these issues automatically,
@@ -3309,7 +3662,7 @@ like this:
@smallexample
@group
@var{section} [@var{address}] [(@var{type})] :
- [AT(@var{lma})] [SUBALIGN(@var{subsection_align})]
+ [AT(@var{lma})] [ALIGN(@var{section_align})] [SUBALIGN(@var{subsection_align})]
@{
@var{output-section-command}
@var{output-section-command}
@@ -3324,6 +3677,7 @@ remaining section attributes.
@menu
* Output Section Type:: Output section type
* Output Section LMA:: Output section LMA
+* Forced Output Alignment:: Forced Output Alignment
* Forced Input Alignment:: Forced Input Alignment
* Output Section Region:: Output section region
* Output Section Phdr:: Output section phdr
@@ -3437,6 +3791,13 @@ for (dst = &_bstart; dst< &_bend; dst++)
@end group
@end smallexample
+@node Forced Output Alignment
+@subsubsection Forced Output Alignment
+@kindex ALIGN(@var{section_align})
+@cindex forcing output section alignment
+@cindex output section alignment
+You can increase an output section's alignment by using ALIGN.
+
@node Forced Input Alignment
@subsubsection Forced Input Alignment
@kindex SUBALIGN(@var{subsection_align})
@@ -3697,19 +4058,19 @@ attributes.
@kindex ORIGIN =
@kindex o =
@kindex org =
-The @var{origin} is an expression for the start address of the memory
-region. The expression must evaluate to a constant before memory
-allocation is performed, which means that you may not use any section
-relative symbols. The keyword @code{ORIGIN} may be abbreviated to
-@code{org} or @code{o} (but not, for example, @code{ORG}).
+The @var{origin} is an numerical expression for the start address of
+the memory region. The expression must evaluate to a constant and it
+cannot involve any symbols. The keyword @code{ORIGIN} may be
+abbreviated to @code{org} or @code{o} (but not, for example,
+@code{ORG}).
@kindex LENGTH =
@kindex len =
@kindex l =
The @var{len} is an expression for the size in bytes of the memory
region. As with the @var{origin} expression, the expression must
-evaluate to a constant before memory allocation is performed. The
-keyword @code{LENGTH} may be abbreviated to @code{len} or @code{l}.
+be numerical only and must evaluate to a constant. The keyword
+@code{LENGTH} may be abbreviated to @code{len} or @code{l}.
In the following example, we specify that there are two memory regions
available for allocation: one starting at @samp{0} for 256 kilobytes,
@@ -3740,6 +4101,16 @@ the next available address within the memory region. If the combined
output sections directed to a memory region are too large for the
region, the linker will issue an error message.
+It is possible to access the origin and length of a memory in an
+expression via the @code{ORIGIN(@var{memory})} and
+@code{LENGTH(@var{memory})} functions:
+
+@smallexample
+@group
+ _fstack = ORIGIN(ram) + LENGTH(ram) - 4;
+@end group
+@end smallexample
+
@node PHDRS
@section PHDRS Command
@kindex PHDRS
@@ -3937,6 +4308,10 @@ VERS_1.2 @{
VERS_2.0 @{
bar1; bar2;
+ extern "C++" @{
+ ns::*;
+ "int f(int, double)";
+ @}
@} VERS_1.2;
@end smallexample
@@ -3948,6 +4323,8 @@ of the shared library; this is done using wildcard patterns, so that any
symbol whose name begins with @samp{old}, @samp{original}, or @samp{new}
is matched. The wildcard patterns available are the same as those used
in the shell when matching filenames (also known as ``globbing'').
+However, if you specify the symbol name inside double quotes, then the
+name is treated as literal, rather than as a glob pattern.
Next, the version script defines node @samp{VERS_1.2}. This node
depends upon @samp{VERS_1.1}. The script binds the symbol @samp{foo2}
@@ -4057,6 +4434,16 @@ The linker will iterate over the list of symbols at the link time and
demangle them according to @samp{lang} before matching them to the
patterns specified in @samp{version-script-commands}.
+Demangled names may contains spaces and other special characters. As
+described above, you can use a glob pattern to match demangled names,
+or you can use a double-quoted string to match the string exactly. In
+the latter case, be aware that minor differences (such as differing
+whitespace) between the version script and the demangler output will
+cause a mismatch. As the exact string generated by the demangler
+might change in the future, even if the mangled name does not, you
+should check that all of your version directives are behaving as you
+expect when you upgrade.
+
@node Expressions
@section Expressions in Linker Scripts
@cindex expressions
@@ -4074,6 +4461,7 @@ expressions.
@menu
* Constants:: Constants
* Symbols:: Symbol Names
+* Orphan Sections:: Orphan Sections
* Location Counter:: The Location Counter
* Operators:: Operators
* Evaluation:: Evaluation
@@ -4135,6 +4523,22 @@ Since symbols can contain many non-alphabetic characters, it is safest
to delimit symbols with spaces. For example, @samp{A-B} is one symbol,
whereas @samp{A - B} is an expression involving subtraction.
+@node Orphan Sections
+@subsection Orphan Sections
+@cindex orphan
+Orphan sections are sections present in the input files which
+are not explicitly placed into the output file by the linker
+script. The linker will still copy these sections into the
+output file, but it has to guess as to where they should be
+placed. The linker uses a simple heuristic to do this. It
+attempts to place orphan sections after non-orphan sections of the
+same attribute, such as code vs data, loadable vs non-loadable, etc.
+If there is not enough room to do this then it places
+at the end of the file.
+
+For ELF targets, the attribute of the section includes section type as
+well as section flag.
+
@node Location Counter
@subsection The Location Counter
@kindex .
@@ -4206,6 +4610,74 @@ and it will have an extra 0x600 bytes worth of space after the end of
the values from the @samp{.data} input sections and before the end of
the @samp{.data} output section itself.
+@cindex dot outside sections
+Setting symbols to the value of the location counter outside of an
+output section statement can result in unexpected values if the linker
+needs to place orphan sections. For example, given the following:
+
+@smallexample
+SECTIONS
+@{
+ start_of_text = . ;
+ .text: @{ *(.text) @}
+ end_of_text = . ;
+
+ start_of_data = . ;
+ .data: @{ *(.data) @}
+ end_of_data = . ;
+@}
+@end smallexample
+
+If the linker needs to place some input section, e.g. @code{.rodata},
+not mentioned in the script, it might choose to place that section
+between @code{.text} and @code{.data}. You might think the linker
+should place @code{.rodata} on the blank line in the above script, but
+blank lines are of no particular significance to the linker. As well,
+the linker doesn't associate the above symbol names with their
+sections. Instead, it assumes that all assignments or other
+statements belong to the previous output section, except for the
+special case of an assignment to @code{.}. I.e., the linker will
+place the orphan @code{.rodata} section as if the script was written
+as follows:
+
+@smallexample
+SECTIONS
+@{
+ start_of_text = . ;
+ .text: @{ *(.text) @}
+ end_of_text = . ;
+
+ start_of_data = . ;
+ .rodata: @{ *(.rodata) @}
+ .data: @{ *(.data) @}
+ end_of_data = . ;
+@}
+@end smallexample
+
+This may or may not be the script author's intention for the value of
+@code{start_of_data}. One way to influence the orphan section
+placement is to assign the location counter to itself, as the linker
+assumes that an assignment to @code{.} is setting the start address of
+a following output section and thus should be grouped with that
+section. So you could write:
+
+@smallexample
+SECTIONS
+@{
+ start_of_text = . ;
+ .text: @{ *(.text) @}
+ end_of_text = . ;
+
+ . = . ;
+ start_of_data = . ;
+ .data: @{ *(.data) @}
+ end_of_data = . ;
+@}
+@end smallexample
+
+Now, the orphan @code{.rodata} section will be placed between
+@code{end_of_text} and @code{start_of_data}.
+
@need 2000
@node Operators
@subsection Operators
@@ -4477,6 +4949,21 @@ evaluation purposes.
. = DATA_SEGMENT_END(.);
@end smallexample
+@item DATA_SEGMENT_RELRO_END(@var{offset}, @var{exp})
+@kindex DATA_SEGMENT_RELRO_END(@var{offset}, @var{exp})
+This defines the end of the @code{PT_GNU_RELRO} segment when
+@samp{-z relro} option is used. Second argument is returned.
+When @samp{-z relro} option is not present, @code{DATA_SEGMENT_RELRO_END}
+does nothing, otherwise @code{DATA_SEGMENT_ALIGN} is padded so that
+@var{exp} + @var{offset} is aligned to the most commonly used page
+boundary for particular target. If present in the linker script,
+it must always come in between @code{DATA_SEGMENT_ALIGN} and
+@code{DATA_SEGMENT_END}.
+
+@smallexample
+ . = DATA_SEGMENT_RELRO_END(24, .);
+@end smallexample
+
@item DEFINED(@var{symbol})
@kindex DEFINED(@var{symbol})
@cindex symbol defaults
@@ -4500,6 +4987,10 @@ SECTIONS @{ @dots{}
@end group
@end smallexample
+@item LENGTH(@var{memory})
+@kindex LENGTH(@var{memory})
+Return the length of the memory region named @var{memory}.
+
@item LOADADDR(@var{section})
@kindex LOADADDR(@var{section})
@cindex section load address in expression
@@ -4524,6 +5015,20 @@ This function is closely related to @code{ALIGN(@var{exp})}; unless you
use the @code{MEMORY} command to define discontinuous memory for the
output file, the two functions are equivalent.
+@item ORIGIN(@var{memory})
+@kindex ORIGIN(@var{memory})
+Return the origin of the memory region named @var{memory}.
+
+@item SEGMENT_START(@var{segment}, @var{default})
+@kindex SEGMENT_START(@var{segment}, @var{default})
+Return the base address of the named @var{segment}. If an explicit
+value has been given for this segment (with a command-line @samp{-T}
+option) that value will be returned; otherwise the value will be
+@var{default}. At present, the @samp{-T} command-line option can only
+be used to set the base address for the ``text'', ``data'', and
+``bss'' sections, but you use @code{SEGMENT_START} with any segment
+name.
+
@item SIZEOF(@var{section})
@kindex SIZEOF(@var{section})
@cindex section size
@@ -4614,6 +5119,15 @@ functionality are not listed.
@ifset MSP430
* MSP430:: @command{ld} and MSP430
@end ifset
+@ifset M68HC11
+* M68HC11/68HC12:: @code{ld} and the Motorola 68HC11 and 68HC12 families
+@end ifset
+@ifset POWERPC
+* PowerPC ELF32:: @command{ld} and PowerPC 32-bit ELF Support
+@end ifset
+@ifset POWERPC64
+* PowerPC64 ELF64:: @command{ld} and PowerPC64 64-bit ELF Support
+@end ifset
@ifset TICOFF
* TI COFF:: @command{ld} and TI COFF
@end ifset
@@ -4655,6 +5169,23 @@ page of memory, and changes them to use the eight-bit address form.
(That is: the linker turns @samp{mov.b @code{@@}@var{aa}:16} into
@samp{mov.b @code{@@}@var{aa}:8} whenever the address @var{aa} is in the
top page of memory).
+
+@item bit manipulation instructions
+@command{ld} finds all bit manipulation instructions like @code{band, bclr,
+biand, bild, bior, bist, bixor, bld, bnot, bor, bset, bst, btst, bxor}
+which use 32 bit and 16 bit absolute address form, but refer to the top
+page of memory, and changes them to use the 8 bit address form.
+(That is: the linker turns @samp{bset #xx:3,@code{@@}@var{aa}:32} into
+@samp{bset #xx:3,@code{@@}@var{aa}:8} whenever the address @var{aa} is in
+the top page of memory).
+
+@item system control instructions
+@command{ld} finds all @code{ldc.w, stc.w} instrcutions which use the
+32 bit absolute address form, but refer to the top page of memory, and
+changes them to use 16 bit address form.
+(That is: the linker turns @samp{ldc.w @code{@@}@var{aa}:32,ccr} into
+@samp{ldc.w @code{@@}@var{aa}:16,ccr} whenever the address @var{aa} is in
+the top page of memory).
@end table
@ifclear GENERIC
@@ -4737,8 +5268,59 @@ not itself call any subroutines).
@raisesections
@end ifclear
+@ifset M68HC11
+@ifclear GENERIC
+@raisesections
+@end ifclear
+
+@node M68HC11/68HC12
+@section @command{ld} and the Motorola 68HC11 and 68HC12 families
+
+@cindex M68HC11 and 68HC12 support
+
+@subsection Linker Relaxation
+
+For the Motorola 68HC11, @command{ld} can perform these global
+optimizations when you specify the @samp{--relax} command-line option.
+
+@table @emph
+@cindex relaxing on M68HC11
+@item relaxing address modes
+@command{ld} finds all @code{jsr} and @code{jmp} instructions whose
+targets are within eight bits, and turns them into eight-bit
+program-counter relative @code{bsr} and @code{bra} instructions,
+respectively.
+
+@command{ld} also looks at all 16-bit extended addressing modes and
+transforms them in a direct addressing mode when the address is in
+page 0 (between 0 and 0x0ff).
+
+@item relaxing gcc instruction group
+When @command{gcc} is called with @option{-mrelax}, it can emit group
+of instructions that the linker can optimize to use a 68HC11 direct
+addressing mode. These instructions consists of @code{bclr} or
+@code{bset} instructions.
+
+@end table
+
+@subsection Trampoline Generation
+
+@cindex trampoline generation on M68HC11
+@cindex trampoline generation on M68HC12
+For 68HC11 and 68HC12, @command{ld} can generate trampoline code to
+call a far function using a normal @code{jsr} instruction. The linker
+will also change the relocation to some far function to use the
+trampoline address instead of the function address. This is typically the
+case when a pointer to a function is taken. The pointer will in fact
+point to the function trampoline.
+
+@ifclear GENERIC
+@lowersections
+@end ifclear
+@end ifset
+
@node ARM
-@section @command{ld}'s Support for Interworking Between ARM and Thumb Code
+@section @command{ld} and the ARM family
@cindex ARM interworking support
@kindex --support-old-code
@@ -4762,6 +5344,59 @@ 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.
+@cindex BE8
+@kindex --be8
+The @samp{--be8} switch instructs @command{ld} to generate BE8 format
+executables. This option is only valid when linking big-endian objects.
+The resulting image will contain big-endian data and little-endian code.
+
+@cindex TARGET1
+@kindex --target1-rel
+@kindex --target1-abs
+The @samp{R_ARM_TARGET1} relocation is typically used for entries in the
+@samp{.init_array} section. It is interpreted as either @samp{R_ARM_REL32}
+or @samp{R_ARM_ABS32}, depending on the target. The @samp{--target1-rel}
+and @samp{--target1-abs} switches override the default.
+
+@cindex TARGET2
+@kindex --target2=@var{type}
+The @samp{--target2=type} switch overrides the default definition of the
+@samp{R_ARM_TARGET2} relocation. Valid values for @samp{type}, their
+meanings, and target defaults are as follows:
+@table @samp
+@item rel
+@samp{R_ARM_REL32} (arm*-*-elf, arm*-*-eabi)
+@item abs
+@samp{R_ARM_ABS32} (arm*-*-symbianelf)
+@item got-rel
+@samp{R_ARM_GOT_PREL} (arm*-*-linux, arm*-*-*bsd)
+@end table
+
+@cindex FIX_V4BX
+@kindex --fix-v4bx
+The @samp{R_ARM_V4BX} relocation (defined by the ARM AAELF
+specification) enables objects compiled for the ARMv4 architecture to be
+interworking-safe when linked with other objects compiled for ARMv4t, but
+also allows pure ARMv4 binaries to be built from the same ARMv4 objects.
+
+In the latter case, the switch @option{--fix-v4bx} must be passed to the
+linker, which causes v4t @code{BX rM} instructions to be rewritten as
+@code{MOV PC,rM}, since v4 processors do not have a @code{BX} instruction.
+
+In the former case, the switch should not be used, and @samp{R_ARM_V4BX}
+relocations are ignored.
+
+@cindex USE_BLX
+@kindex --use-blx
+The @samp{--use-blx} switch enables the linker to use ARM/Thumb
+BLX instructions (available on ARMv5t and above) in various
+situations. Currently it is used to perform calls via the PLT from Thumb
+code using BLX rather than using BX and a mode-switching stub before
+each PLT entry. This should lead to such calls executing slightly faster.
+
+This option is enabled implicitly for SymbianOS, so there is no need to
+specify it if you are using that target.
+
@ifclear GENERIC
@lowersections
@end ifclear
@@ -4884,6 +5519,183 @@ The last two sections are used by gcc.
@end ifclear
@end ifset
+@ifset POWERPC
+@ifclear GENERIC
+@raisesections
+@end ifclear
+
+@node PowerPC ELF32
+@section @command{ld} and PowerPC 32-bit ELF Support
+@cindex PowerPC long branches
+@kindex --relax on PowerPC
+Branches on PowerPC processors are limited to a signed 26-bit
+displacement, which may result in @command{ld} giving
+@samp{relocation truncated to fit} errors with very large programs.
+@samp{--relax} enables the generation of trampolines that can access
+the entire 32-bit address space. These trampolines are inserted at
+section boundaries, so may not themselves be reachable if an input
+section exceeds 33M in size.
+
+@cindex PowerPC ELF32 options
+@table @option
+@cindex PowerPC PLT
+@kindex --bss-plt
+@item --bss-plt
+Current PowerPC GCC accepts a @samp{-msecure-plt} option that
+generates code capable of using a newer PLT and GOT layout that has
+the security advantage of no executable section ever needing to be
+writable and no writable section ever being executable. PowerPC
+@command{ld} will generate this layout, including stubs to access the
+PLT, if all input files (including startup and static libraries) were
+compiled with @samp{-msecure-plt}. @samp{--bss-plt} forces the old
+BSS PLT (and GOT layout) which can give slightly better performance.
+
+@cindex PowerPC GOT
+@kindex --sdata-got
+@item --sdata-got
+The new secure PLT and GOT are placed differently relative to other
+sections compared to older BSS PLT and GOT placement. The location of
+@code{.plt} must change because the new secure PLT is an initialized
+section while the old PLT is uninitialized. The reason for the
+@code{.got} change is more subtle: The new placement allows
+@code{.got} to be read-only in applications linked with
+@samp{-z relro -z now}. However, this placement means that
+@code{.sdata} cannot always be used in shared libraries, because the
+PowerPC ABI accesses @code{.sdata} in shared libraries from the GOT
+pointer. @samp{--sdata-got} forces the old GOT placement. PowerPC
+GCC doesn't use @code{.sdata} in shared libraries, so this option is
+really only useful for other compilers that may do so.
+
+@cindex PowerPC stub symbols
+@kindex --emit-stub-syms
+@item --emit-stub-syms
+This option causes @command{ld} to label linker stubs with a local
+symbol that encodes the stub type and destination.
+
+@cindex PowerPC TLS optimization
+@kindex --no-tls-optimize
+@item --no-tls-optimize
+PowerPC @command{ld} normally performs some optimization of code
+sequences used to access Thread-Local Storage. Use this option to
+disable the optimization.
+@end table
+
+@ifclear GENERIC
+@lowersections
+@end ifclear
+@end ifset
+
+@ifset POWERPC64
+@ifclear GENERIC
+@raisesections
+@end ifclear
+
+@node PowerPC64 ELF64
+@section @command{ld} and PowerPC64 64-bit ELF Support
+
+@cindex PowerPC64 ELF64 options
+@table @option
+@cindex PowerPC64 stub grouping
+@kindex --stub-group-size
+@item --stub-group-size
+Long branch stubs, PLT call stubs and TOC adjusting stubs are placed
+by @command{ld} in stub sections located between groups of input sections.
+@samp{--stub-group-size} specifies the maximum size of a group of input
+sections handled by one stub section. Since branch offsets are signed,
+a stub section may serve two groups of input sections, one group before
+the stub section, and one group after it. However, when using
+conditional branches that require stubs, it may be better (for branch
+prediction) that stub sections only serve one group of input sections.
+A negative value for @samp{N} chooses this scheme, ensuring that
+branches to stubs always use a negative offset. Two special values of
+@samp{N} are recognized, @samp{1} and @samp{-1}. These both instruct
+@command{ld} to automatically size input section groups for the branch types
+detected, with the same behaviour regarding stub placement as other
+positive or negative values of @samp{N} respectively.
+
+Note that @samp{--stub-group-size} does not split input sections. A
+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.
+
+@cindex PowerPC64 stub symbols
+@kindex --emit-stub-syms
+@item --emit-stub-syms
+This option causes @command{ld} to label linker stubs with a local
+symbol that encodes the stub type and destination.
+
+@cindex PowerPC64 dot symbols
+@kindex --dotsyms
+@kindex --no-dotsyms
+@item --dotsyms, --no-dotsyms
+These two options control how @command{ld} interprets version patterns
+in a version script. Older PowerPC64 compilers emitted both a
+function descriptor symbol with the same name as the function, and a
+code entry symbol with the name prefixed by a dot (@samp{.}). To
+properly version a function @samp{foo}, the version script thus needs
+to control both @samp{foo} and @samp{.foo}. The option
+@samp{--dotsyms}, on by default, automatically adds the required
+dot-prefixed patterns. Use @samp{--no-dotsyms} to disable this
+feature.
+
+@cindex PowerPC64 TLS optimization
+@kindex --no-tls-optimize
+@item --no-tls-optimize
+PowerPC64 @command{ld} normally performs some optimization of code
+sequences used to access Thread-Local Storage. Use this option to
+disable the optimization.
+
+@cindex PowerPC64 OPD optimization
+@kindex --no-opd-optimize
+@item --no-opd-optimize
+PowerPC64 @command{ld} normally removes @code{.opd} section entries
+corresponding to deleted link-once functions, or functions removed by
+the action of @samp{--gc-sections} or linker scrip @code{/DISCARD/}.
+Use this option to disable @code{.opd} optimization.
+
+@cindex PowerPC64 OPD spacing
+@kindex --non-overlapping-opd
+@item --non-overlapping-opd
+Some PowerPC64 compilers have an option to generate compressed
+@code{.opd} entries spaced 16 bytes apart, overlapping the third word,
+the static chain pointer (unused in C) with the first word of the next
+entry. This option expands such entries to the full 24 bytes.
+
+@cindex PowerPC64 TOC optimization
+@kindex --no-toc-optimize
+@item --no-toc-optimize
+PowerPC64 @command{ld} normally removes unused @code{.toc} section
+entries. Such entries are detected by examining relocations that
+reference the TOC in code sections. A reloc in a deleted code section
+marks a TOC word as unneeded, while a reloc in a kept code section
+marks a TOC word as needed. Since the TOC may reference itself, TOC
+relocs are also examined. TOC words marked as both needed and
+unneeded will of course be kept. TOC words without any referencing
+reloc are assumed to be part of a multi-word entry, and are kept or
+discarded as per the nearest marked preceding word. This works
+reliably for compiler generated code, but may be incorrect if assembly
+code is used to insert TOC entries. Use this option to disable the
+optimization.
+
+@cindex PowerPC64 multi-TOC
+@kindex --no-multi-toc
+@item --no-multi-toc
+By default, PowerPC64 GCC generates code for a TOC model where TOC
+entries are accessed with a 16-bit offset from r2. This limits the
+total TOC size to 64K. PowerPC64 @command{ld} extends this limit by
+grouping code sections such that each group uses less than 64K for its
+TOC entries, then inserts r2 adjusting stubs between inter-group
+calls. @command{ld} does not split apart input sections, so cannot
+help if a single input file has a @code{.toc} section that exceeds
+64K, most likely from linking multiple files with @command{ld -r}.
+Use this option to turn off this feature.
+@end table
+
+@ifclear GENERIC
+@lowersections
+@end ifclear
+@end ifset
+
@ifset TICOFF
@ifclear GENERIC
@raisesections
@@ -4969,17 +5781,85 @@ Using a DEF file turns off the normal auto-export behavior, unless the
Here is an example of a DEF file for a shared library called @samp{xyz.dll}:
@example
-LIBRARY "xyz.dll" BASE=0x10000000
+LIBRARY "xyz.dll" BASE=0x20000000
EXPORTS
foo
bar
_bar = bar
+another_foo = abc.dll.afoo
+var1 DATA
@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.
+This example defines a DLL with a non-default base address and five
+symbols in the export table. The third exported symbol @code{_bar} is an
+alias for the second. The fourth symbol, @code{another_foo} is resolved
+by "forwarding" to another module and treating it as an alias for
+@code{afoo} exported from the DLL @samp{abc.dll}. The final symbol
+@code{var1} is declared to be a data object.
+
+The optional @code{LIBRARY <name>} command indicates the @emph{internal}
+name of the output DLL. If @samp{<name>} does not include a suffix,
+the default library suffix, @samp{.DLL} is appended.
+
+When the .DEF file is used to build an application. rather than a
+library, the @code{NAME <name>} command shoud be used instead of
+@code{LIBRARY}. If @samp{<name>} does not include a suffix, the default
+executable suffix, @samp{.EXE} is appended.
+
+With either @code{LIBRARY <name>} or @code{NAME <name>} the optional
+specification @code{BASE = <number>} may be used to specify a
+non-default base address for the image.
+
+If neither @code{LIBRARY <name>} nor @code{NAME <name>} is specified,
+or they specify an empty string, the internal name is the same as the
+filename specified on the command line.
+
+The complete specification of an export symbol is:
+
+@example
+EXPORTS
+ ( ( ( <name1> [ = <name2> ] )
+ | ( <name1> = <module-name> . <external-name>))
+ [ @@ <integer> ] [NONAME] [DATA] [CONSTANT] [PRIVATE] ) *
+@end example
+
+Declares @samp{<name1>} as an exported symbol from the DLL, or declares
+@samp{<name1>} as an exported alias for @samp{<name2>}; or declares
+@samp{<name1>} as a "forward" alias for the symbol
+@samp{<external-name>} in the DLL @samp{<module-name>}.
+Optionally, the symbol may be exported by the specified ordinal
+@samp{<integer>} alias.
+
+The optional keywords that follow the declaration indicate:
+
+@code{NONAME}: Do not put the symbol name in the DLL's export table. It
+will still be exported by its ordinal alias (either the value specified
+by the .def specification or, otherwise, the value assigned by the
+linker). The symbol name, however, does remain visible in the import
+library (if any), unless @code{PRIVATE} is also specified.
+
+@code{DATA}: The symbol is a variable or object, rather than a function.
+The import lib will export only an indirect reference to @code{foo} as
+the symbol @code{_imp__foo} (ie, @code{foo} must be resolved as
+@code{*_imp__foo}).
+
+@code{CONSTANT}: Like @code{DATA}, but put the undecorated @code{foo} as
+well as @code{_imp__foo} into the import library. Both refer to the
+read-only import address table's pointer to the variable, not to the
+variable itself. This can be dangerous. If the user code fails to add
+the @code{dllimport} attribute and also fails to explicitly add the
+extra indirection that the use of the attribute enforces, the
+application will behave unexpectedly.
+
+@code{PRIVATE}: Put the symbol in the DLL's export table, but do not put
+it into the static import library used to resolve imports at link time. The
+symbol can still be imported using the @code{LoadLibrary/GetProcAddress}
+API at runtime or by by using the GNU ld extension of linking directly to
+the DLL without an import library.
+
+See ld/deffilep.y in the binutils sources for the full specification of
+other DEF file statements
@cindex creating a DEF file
While linking a shared dll, @command{ld} is able to create a DEF file
@@ -5247,6 +6127,24 @@ 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.
+
+@cindex weak externals
+@item weak externals
+The Windows object format, PE, specifies a form of weak symbols called
+weak externals. When a weak symbol is linked and the symbol is not
+defined, the weak symbol becomes an alias for some other symbol. There
+are three variants of weak externals:
+@itemize
+@item Definition is searched for in objects and libraries, historically
+called lazy externals.
+@item Definition is searched for only in other objects, not in libraries.
+This form is not presently implemented.
+@item No search; the symbol is an alias. This form is not presently
+implemented.
+@end itemize
+As a GNU extension, weak symbols that do not specify an alternate symbol
+are supported. If the symbol is undefined when linking, the symbol
+uses a default value.
@end table
@ifclear GENERIC
@@ -5286,34 +6184,53 @@ 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 @option{--relax} on Xtensa
@cindex relaxing on Xtensa
+Relaxation is enabled by default for the Xtensa version of @command{ld} and
+provides two important link-time optimizations. The first optimization
+is to combine identical literal values to reduce code size. A redundant
+literal will be removed and all the @code{L32R} instructions that use it
+will be changed to reference an identical literal, as long as the
+location of the replacement literal is within the offset range of all
+the @code{L32R} instructions. The second optimization is to remove
+unnecessary overhead from assembler-generated ``longcall'' sequences of
+@code{L32R}/@code{CALLX@var{n}} when the target functions are within
+range of direct @code{CALL@var{n}} instructions.
+
+For each of these cases where an indirect call sequence can be optimized
+to a direct call, the linker will change the @code{CALLX@var{n}}
+instruction to a @code{CALL@var{n}} instruction, remove the @code{L32R}
+instruction, and remove the literal referenced by the @code{L32R}
+instruction if it is not used for anything else. Removing the
+@code{L32R} instruction always reduces code size but can potentially
+hurt performance by changing the alignment of subsequent branch targets.
+By default, the linker will always preserve alignments, either by
+switching some instructions between 24-bit encodings and the equivalent
+density instructions or by inserting a no-op in place of the @code{L32R}
+instruction that was removed. If code size is more important than
+performance, the @option{--size-opt} option can be used to prevent the
+linker from widening density instructions or inserting no-ops, except in
+a few cases where no-ops are required for correctness.
+
+The following Xtensa-specific command-line options can be used to
+control the linker:
+
+@cindex Xtensa options
+@table @option
@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.
+@item --no-relax
+Since the Xtensa version of @code{ld} enables the @option{--relax} option
+by default, the @option{--no-relax} option is provided to disable
+relaxation.
+
+@item --size-opt
+When optimizing indirect calls to direct calls, optimize for code size
+more than performance. With this option, the linker will not insert
+no-ops or widen density instructions to preserve branch target
+alignment. There may still be some cases where no-ops are required to
+preserve the correctness of the code.
+@end table
@ifclear GENERIC
@lowersections
diff --git a/contrib/binutils/ld/ldcref.c b/contrib/binutils/ld/ldcref.c
index 3094735..ed9f869 100644
--- a/contrib/binutils/ld/ldcref.c
+++ b/contrib/binutils/ld/ldcref.c
@@ -1,5 +1,5 @@
/* ldcref.c -- output a cross reference table
- Copyright 1996, 1997, 1998, 2000, 2002, 2003
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006
Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>
@@ -17,7 +17,7 @@ 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. */
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
/* This file holds routines that manage the cross reference table.
The table is used to generate cross reference reports. It is also
@@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "bfdlink.h"
#include "libiberty.h"
+#include "objalloc.h"
#include "ld.h"
#include "ldmain.h"
@@ -69,9 +70,9 @@ struct cref_hash_table {
/* Forward declarations. */
static void output_one_cref (FILE *, struct cref_hash_entry *);
-static void check_section_sym_xref (lang_input_statement_type *);
+static void check_local_sym_xref (lang_input_statement_type *);
static bfd_boolean check_nocrossref (struct cref_hash_entry *, void *);
-static void check_refs (const char *, asection *, bfd *,
+static void check_refs (const char *, bfd_boolean, asection *, bfd *,
struct lang_nocrossrefs *);
static void check_reloc_refs (bfd *, asection *, void *);
@@ -101,6 +102,15 @@ static bfd_boolean cref_initialized;
static size_t cref_symcount;
+/* Used to take a snapshot of the cref hash table when starting to
+ add syms from an as-needed library. */
+static struct bfd_hash_entry **old_table;
+static unsigned int old_size;
+static void *old_tab;
+static void *alloc_mark;
+static size_t tabsize, entsize, refsize;
+static size_t old_symcount;
+
/* Create an entry in a cref hash table. */
static struct bfd_hash_entry *
@@ -136,7 +146,7 @@ cref_hash_newfunc (struct bfd_hash_entry *entry,
}
/* Add a symbol to the cref hash table. This is called for every
- symbol that is seen during the link. */
+ global symbol that is seen during the link. */
void
add_cref (const char *name,
@@ -149,7 +159,8 @@ add_cref (const char *name,
if (! cref_initialized)
{
- if (! bfd_hash_table_init (&cref_table.root, cref_hash_newfunc))
+ if (!bfd_hash_table_init (&cref_table.root, cref_hash_newfunc,
+ sizeof (struct cref_hash_entry)))
einfo (_("%X%P: bfd_hash_table_init of cref table failed: %E\n"));
cref_initialized = TRUE;
}
@@ -164,7 +175,9 @@ add_cref (const char *name,
if (r == NULL)
{
- r = xmalloc (sizeof *r);
+ r = bfd_hash_allocate (&cref_table.root, sizeof *r);
+ if (r == NULL)
+ einfo (_("%X%P: cref alloc failed: %E\n"));
r->next = h->refs;
h->refs = r;
r->abfd = abfd;
@@ -181,6 +194,123 @@ add_cref (const char *name,
r->def = TRUE;
}
+/* Called before loading an as-needed library to take a snapshot of
+ the cref hash table, and after we have loaded or found that the
+ library was not needed. */
+
+bfd_boolean
+handle_asneeded_cref (bfd *abfd ATTRIBUTE_UNUSED,
+ enum notice_asneeded_action act)
+{
+ unsigned int i;
+
+ if (!cref_initialized)
+ return TRUE;
+
+ if (act == notice_as_needed)
+ {
+ char *old_ent, *old_ref;
+
+ for (i = 0; i < cref_table.root.size; i++)
+ {
+ struct bfd_hash_entry *p;
+ struct cref_hash_entry *c;
+ struct cref_ref *r;
+
+ for (p = cref_table.root.table[i]; p != NULL; p = p->next)
+ {
+ entsize += cref_table.root.entsize;
+ c = (struct cref_hash_entry *) p;
+ for (r = c->refs; r != NULL; r = r->next)
+ refsize += sizeof (struct cref_hash_entry);
+ }
+ }
+
+ tabsize = cref_table.root.size * sizeof (struct bfd_hash_entry *);
+ old_tab = xmalloc (tabsize + entsize + refsize);
+
+ alloc_mark = bfd_hash_allocate (&cref_table.root, 1);
+ if (alloc_mark == NULL)
+ return FALSE;
+
+ memcpy (old_tab, cref_table.root.table, tabsize);
+ old_ent = (char *) old_tab + tabsize;
+ old_ref = (char *) old_ent + entsize;
+ old_table = cref_table.root.table;
+ old_size = cref_table.root.size;
+ old_symcount = cref_symcount;
+
+ for (i = 0; i < cref_table.root.size; i++)
+ {
+ struct bfd_hash_entry *p;
+ struct cref_hash_entry *c;
+ struct cref_ref *r;
+
+ for (p = cref_table.root.table[i]; p != NULL; p = p->next)
+ {
+ memcpy (old_ent, p, cref_table.root.entsize);
+ old_ent = (char *) old_ent + cref_table.root.entsize;
+ c = (struct cref_hash_entry *) p;
+ for (r = c->refs; r != NULL; r = r->next)
+ {
+ memcpy (old_ref, r, sizeof (struct cref_hash_entry));
+ old_ref = (char *) old_ref + sizeof (struct cref_hash_entry);
+ }
+ }
+ }
+ return TRUE;
+ }
+
+ if (act == notice_not_needed)
+ {
+ char *old_ent, *old_ref;
+
+ if (old_tab == NULL)
+ {
+ /* The only way old_tab can be NULL is if the cref hash table
+ had not been initialised when notice_as_needed. */
+ bfd_hash_table_free (&cref_table.root);
+ cref_initialized = FALSE;
+ return TRUE;
+ }
+
+ old_ent = (char *) old_tab + tabsize;
+ old_ref = (char *) old_ent + entsize;
+ cref_table.root.table = old_table;
+ cref_table.root.size = old_size;
+ memcpy (cref_table.root.table, old_tab, tabsize);
+ cref_symcount = old_symcount;
+
+ for (i = 0; i < cref_table.root.size; i++)
+ {
+ struct bfd_hash_entry *p;
+ struct cref_hash_entry *c;
+ struct cref_ref *r;
+
+ for (p = cref_table.root.table[i]; p != NULL; p = p->next)
+ {
+ memcpy (p, old_ent, cref_table.root.entsize);
+ old_ent = (char *) old_ent + cref_table.root.entsize;
+ c = (struct cref_hash_entry *) p;
+ for (r = c->refs; r != NULL; r = r->next)
+ {
+ memcpy (r, old_ref, sizeof (struct cref_hash_entry));
+ old_ref = (char *) old_ref + sizeof (struct cref_hash_entry);
+ }
+ }
+ }
+
+ objalloc_free_block ((struct objalloc *) cref_table.root.memory,
+ alloc_mark);
+ }
+ else if (act != notice_needed)
+ return FALSE;
+
+ free (old_tab);
+ old_tab = NULL;
+ return 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. */
@@ -330,39 +460,69 @@ check_nocrossrefs (void)
cref_hash_traverse (&cref_table, check_nocrossref, NULL);
- lang_for_each_file (check_section_sym_xref);
+ lang_for_each_file (check_local_sym_xref);
}
-/* Checks for prohibited cross references to section symbols. */
+/* Check for prohibited cross references to local and section symbols. */
static void
-check_section_sym_xref (lang_input_statement_type *statement)
+check_local_sym_xref (lang_input_statement_type *statement)
{
bfd *abfd;
- asection *sec;
+ lang_input_statement_type *li;
+ asymbol **asymbols, **syms;
abfd = statement->the_bfd;
if (abfd == NULL)
return;
- for (sec = abfd->sections; sec != NULL; sec = sec->next)
+ li = abfd->usrdata;
+ if (li != NULL && li->asymbols != NULL)
+ asymbols = li->asymbols;
+ else
{
- asection *outsec;
+ long symsize;
+ long symbol_count;
- outsec = sec->output_section;
- if (outsec != NULL)
+ symsize = bfd_get_symtab_upper_bound (abfd);
+ if (symsize < 0)
+ einfo (_("%B%F: could not read symbols; %E\n"), abfd);
+ asymbols = xmalloc (symsize);
+ symbol_count = bfd_canonicalize_symtab (abfd, asymbols);
+ if (symbol_count < 0)
+ einfo (_("%B%F: could not read symbols: %E\n"), abfd);
+ if (li != NULL)
+ {
+ li->asymbols = asymbols;
+ li->symbol_count = symbol_count;
+ }
+ }
+
+ for (syms = asymbols; *syms; ++syms)
+ {
+ asymbol *sym = *syms;
+ if (sym->flags & (BSF_GLOBAL | BSF_WARNING | BSF_INDIRECT | BSF_FILE))
+ continue;
+ if ((sym->flags & (BSF_LOCAL | BSF_SECTION_SYM)) != 0
+ && sym->section->output_section != NULL)
{
- const char *outsecname;
+ const char *outsecname, *symname;
struct lang_nocrossrefs *ncrs;
struct lang_nocrossref *ncr;
- outsecname = outsec->name;
+ outsecname = sym->section->output_section->name;
+ symname = NULL;
+ if ((sym->flags & BSF_SECTION_SYM) == 0)
+ symname = sym->name;
for (ncrs = nocrossref_list; ncrs != NULL; ncrs = ncrs->next)
for (ncr = ncrs->list; ncr != NULL; ncr = ncr->next)
if (strcmp (ncr->name, outsecname) == 0)
- check_refs (NULL, sec, abfd, ncrs);
+ check_refs (symname, FALSE, sym->section, abfd, ncrs);
}
}
+
+ if (li == NULL)
+ free (asymbols);
}
/* Check one symbol to see if it is a prohibited cross reference. */
@@ -399,7 +559,8 @@ check_nocrossref (struct cref_hash_entry *h, void *ignore ATTRIBUTE_UNUSED)
for (ncr = ncrs->list; ncr != NULL; ncr = ncr->next)
if (strcmp (ncr->name, defsecname) == 0)
for (ref = h->refs; ref != NULL; ref = ref->next)
- check_refs (hl->root.string, hl->u.def.section, ref->abfd, ncrs);
+ check_refs (hl->root.string, TRUE, hl->u.def.section,
+ ref->abfd, ncrs);
return TRUE;
}
@@ -412,6 +573,7 @@ struct check_refs_info {
asection *defsec;
struct lang_nocrossrefs *ncrs;
asymbol **asymbols;
+ bfd_boolean global;
};
/* This function is called for each symbol defined in a section which
@@ -421,6 +583,7 @@ struct check_refs_info {
static void
check_refs (const char *name,
+ bfd_boolean global,
asection *sec,
bfd *abfd,
struct lang_nocrossrefs *ncrs)
@@ -458,6 +621,7 @@ check_refs (const char *name,
}
info.sym_name = name;
+ info.global = global;
info.defsec = sec;
info.ncrs = ncrs;
info.asymbols = asymbols;
@@ -483,6 +647,7 @@ check_reloc_refs (bfd *abfd, asection *sec, void *iarg)
const char *outdefsecname;
struct lang_nocrossref *ncr;
const char *symname;
+ bfd_boolean global;
long relsize;
arelent **relpp;
long relcount;
@@ -508,9 +673,13 @@ check_reloc_refs (bfd *abfd, asection *sec, void *iarg)
/* This section is one for which cross references are prohibited.
Look through the relocations, and see if any of them are to
INFO->SYM_NAME. If INFO->SYMNAME is NULL, check for relocations
- against the section symbol. */
+ against the section symbol. If INFO->GLOBAL is TRUE, the
+ definition is global, check for relocations against the global
+ symbols. Otherwise check for relocations against the local and
+ section symbols. */
symname = info->sym_name;
+ global = info->global;
relsize = bfd_get_reloc_upper_bound (abfd, sec);
if (relsize < 0)
@@ -531,6 +700,14 @@ check_reloc_refs (bfd *abfd, asection *sec, void *iarg)
if (q->sym_ptr_ptr != NULL
&& *q->sym_ptr_ptr != NULL
+ && ((global
+ && (bfd_is_und_section (bfd_get_section (*q->sym_ptr_ptr))
+ || bfd_is_com_section (bfd_get_section (*q->sym_ptr_ptr))
+ || ((*q->sym_ptr_ptr)->flags & (BSF_GLOBAL
+ | BSF_WEAK)) != 0))
+ || (!global
+ && ((*q->sym_ptr_ptr)->flags & (BSF_LOCAL
+ | BSF_SECTION_SYM)) != 0))
&& (symname != NULL
? strcmp (bfd_asymbol_name (*q->sym_ptr_ptr), symname) == 0
: (((*q->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0
diff --git a/contrib/binutils/ld/ldctor.c b/contrib/binutils/ld/ldctor.c
index 34d5e52..3de4ef1 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,
- 2002, 2003 Free Software Foundation, Inc.
+ 2002, 2003, 2004 Free Software Foundation, Inc.
By Steve Chamberlain <sac@cygnus.com>
This file is part of GLD, the Gnu Linker.
@@ -17,8 +17,8 @@ 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. */
+Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -49,7 +49,7 @@ struct set_info *sets;
RELOC is the relocation to use for an entry in the set. SECTION
and VALUE are the value to add. This is called during the first
phase of the link, when we are still gathering symbols together.
- We just record the information now. The ldctor_find_constructors
+ We just record the information now. The ldctor_build_sets
function will construct the sets. */
void
diff --git a/contrib/binutils/ld/ldctor.h b/contrib/binutils/ld/ldctor.h
index 436df6c0..5608ff7 100644
--- a/contrib/binutils/ld/ldctor.h
+++ b/contrib/binutils/ld/ldctor.h
@@ -16,8 +16,8 @@ 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. */
+Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+02110-1301, USA. */
#ifndef LDCTOR_H
#define LDCTOR_H
diff --git a/contrib/binutils/ld/ldemul.c b/contrib/binutils/ld/ldemul.c
index 760c55d..fad1f18 100644
--- a/contrib/binutils/ld/ldemul.c
+++ b/contrib/binutils/ld/ldemul.c
@@ -1,5 +1,6 @@
/* ldemul.c -- clearing house for ld emulation states
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2003
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001, 2002, 2003, 2005
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -16,12 +17,14 @@ 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. */
+Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+02110-1301, USA. */
+#include "config.h"
#include "bfd.h"
#include "sysdep.h"
#include "getopt.h"
+#include "bfdlink.h"
#include "ld.h"
#include "ldmisc.h"
@@ -32,7 +35,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ldmain.h"
#include "ldemul-list.h"
-ld_emulation_xfer_type *ld_emulation;
+static ld_emulation_xfer_type *ld_emulation;
void
ldemul_hll (char *name)
@@ -73,8 +76,7 @@ ldemul_after_allocation (void)
void
ldemul_before_allocation (void)
{
- if (ld_emulation->before_allocation)
- ld_emulation->before_allocation ();
+ ld_emulation->before_allocation ();
}
void
@@ -86,8 +88,7 @@ ldemul_set_output_arch (void)
void
ldemul_finish (void)
{
- if (ld_emulation->finish)
- ld_emulation->finish ();
+ ld_emulation->finish ();
}
void
@@ -120,10 +121,10 @@ ldemul_open_dynamic_archive (const char *arch, search_dirs_type *search,
}
bfd_boolean
-ldemul_place_orphan (lang_input_statement_type *file, asection *s)
+ldemul_place_orphan (asection *s)
{
if (ld_emulation->place_orphan)
- return (*ld_emulation->place_orphan) (file, s);
+ return (*ld_emulation->place_orphan) (s);
return FALSE;
}
@@ -210,6 +211,15 @@ after_allocation_default (void)
void
before_allocation_default (void)
{
+ if (!link_info.relocatable)
+ strip_excluded_output_sections ();
+}
+
+void
+finish_default (void)
+{
+ if (!link_info.relocatable)
+ _bfd_fix_excluded_sec_syms (output_bfd, &link_info);
}
void
diff --git a/contrib/binutils/ld/ldemul.h b/contrib/binutils/ld/ldemul.h
index 8feef67..1b9b79b 100644
--- a/contrib/binutils/ld/ldemul.h
+++ b/contrib/binutils/ld/ldemul.h
@@ -1,5 +1,6 @@
/* ld-emul.h - Linker emulation header file
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2003
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001,
+ 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -17,6 +18,9 @@
#ifndef LDEMUL_H
#define LDEMUL_H
+/* Forward declaration for ldemul_add_options() and others. */
+struct option;
+
extern void ldemul_hll
(char *);
extern void ldemul_syslib
@@ -50,7 +54,7 @@ extern void ldemul_set_symbols
extern void ldemul_create_output_section_statements
(void);
extern bfd_boolean ldemul_place_orphan
- (struct lang_input_statement_struct *, asection *);
+ (asection *);
extern bfd_boolean ldemul_parse_args
(int, char **);
extern void ldemul_add_options
@@ -73,6 +77,10 @@ extern void after_allocation_default
(void);
extern void before_allocation_default
(void);
+extern void finish_default
+ (void);
+extern void finish_default
+ (void);
extern void set_output_arch_default
(void);
extern void syslib_default
@@ -139,7 +147,7 @@ typedef struct ld_emulation_xfer_struct {
the default action should be taken. This field may be NULL, in
which case the default action will always be taken. */
bfd_boolean (*place_orphan)
- (struct lang_input_statement_struct *, asection *);
+ (asection *);
/* Run after assigning parsing with the args, but before
reading the script. Used to initialize symbols used in the script. */
diff --git a/contrib/binutils/ld/ldexp.c b/contrib/binutils/ld/ldexp.c
index 4d9a857..c9d707e 100644
--- a/contrib/binutils/ld/ldexp.c
+++ b/contrib/binutils/ld/ldexp.c
@@ -1,25 +1,25 @@
/* This module handles expression trees.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004
+ 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@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, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
/* This module is in charge of working out the contents of expressions.
@@ -41,12 +41,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "libiberty.h"
#include "safe-ctype.h"
-static etree_value_type exp_fold_tree_no_dot
- (etree_type *, lang_output_section_statement_type *, lang_phase_type);
-static bfd_vma align_n
- (bfd_vma, bfd_vma);
+static void exp_fold_tree_1 (etree_type *);
+static void exp_fold_tree_no_dot (etree_type *);
+static bfd_vma align_n (bfd_vma, bfd_vma);
-struct exp_data_seg exp_data_seg;
+segment_type *segments;
+
+struct ldexp_control expld;
/* Print the string representation of the given token. Surround it
with spaces if INFIX_P is TRUE. */
@@ -101,7 +102,11 @@ exp_print_token (token_code_type code, int infix_p)
{ MAX_K, "MAX_K" },
{ REL, "relocatable" },
{ DATA_SEGMENT_ALIGN, "DATA_SEGMENT_ALIGN" },
- { DATA_SEGMENT_END, "DATA_SEGMENT_END" }
+ { DATA_SEGMENT_RELRO_END, "DATA_SEGMENT_RELRO_END" },
+ { DATA_SEGMENT_END, "DATA_SEGMENT_END" },
+ { ORIGIN, "ORIGIN" },
+ { LENGTH, "LENGTH" },
+ { SEGMENT_START, "SEGMENT_START" }
};
unsigned int idx;
@@ -124,21 +129,19 @@ exp_print_token (token_code_type code, int infix_p)
}
static void
-make_abs (etree_value_type *ptr)
+make_abs (void)
{
- asection *s = ptr->section->bfd_section;
- ptr->value += s->vma;
- ptr->section = abs_output_section;
+ expld.result.value += expld.result.section->vma;
+ expld.result.section = bfd_abs_section_ptr;
}
-static etree_value_type
+static void
new_abs (bfd_vma value)
{
- etree_value_type new;
- new.valid_p = TRUE;
- new.section = abs_output_section;
- new.value = value;
- return new;
+ expld.result.valid_p = TRUE;
+ expld.result.section = bfd_abs_section_ptr;
+ expld.result.value = value;
+ expld.result.str = NULL;
}
etree_type *
@@ -176,109 +179,87 @@ exp_relop (asection *section, bfd_vma value)
return new;
}
-static etree_value_type
-new_rel (bfd_vma value,
- char *str,
- lang_output_section_statement_type *section)
+static void
+new_rel (bfd_vma value, char *str, asection *section)
{
- etree_value_type new;
- new.valid_p = TRUE;
- new.value = value;
- new.str = str;
- new.section = section;
- return new;
+ expld.result.valid_p = TRUE;
+ expld.result.value = value;
+ expld.result.str = str;
+ expld.result.section = section;
}
-static etree_value_type
-new_rel_from_section (bfd_vma value,
- lang_output_section_statement_type *section)
+static void
+new_rel_from_abs (bfd_vma value)
{
- etree_value_type new;
- new.valid_p = TRUE;
- new.value = value;
- new.str = NULL;
- new.section = section;
-
- new.value -= section->bfd_section->vma;
-
- return new;
+ expld.result.valid_p = TRUE;
+ expld.result.value = value - expld.section->vma;
+ expld.result.str = NULL;
+ expld.result.section = expld.section;
}
-static etree_value_type
-fold_unary (etree_type *tree,
- lang_output_section_statement_type *current_section,
- lang_phase_type allocation_done,
- bfd_vma dot,
- bfd_vma *dotp)
+static void
+fold_unary (etree_type *tree)
{
- etree_value_type result;
-
- result = exp_fold_tree (tree->unary.child,
- current_section,
- allocation_done, dot, dotp);
- if (result.valid_p)
+ exp_fold_tree_1 (tree->unary.child);
+ if (expld.result.valid_p)
{
switch (tree->type.node_code)
{
case ALIGN_K:
- if (allocation_done != lang_first_phase_enum)
- result = new_rel_from_section (align_n (dot, result.value),
- current_section);
+ if (expld.phase != lang_first_phase_enum)
+ new_rel_from_abs (align_n (expld.dot, expld.result.value));
else
- result.valid_p = FALSE;
+ expld.result.valid_p = FALSE;
break;
case ABSOLUTE:
- if (allocation_done != lang_first_phase_enum)
- {
- result.value += result.section->bfd_section->vma;
- result.section = abs_output_section;
- }
- else
- result.valid_p = FALSE;
+ make_abs ();
break;
case '~':
- make_abs (&result);
- result.value = ~result.value;
+ make_abs ();
+ expld.result.value = ~expld.result.value;
break;
case '!':
- make_abs (&result);
- result.value = !result.value;
+ make_abs ();
+ expld.result.value = !expld.result.value;
break;
case '-':
- make_abs (&result);
- result.value = -result.value;
+ make_abs ();
+ expld.result.value = -expld.result.value;
break;
case NEXT:
/* Return next place aligned to value. */
- if (allocation_done == lang_allocating_phase_enum)
+ if (expld.phase != lang_first_phase_enum)
{
- make_abs (&result);
- result.value = align_n (dot, result.value);
+ make_abs ();
+ expld.result.value = align_n (expld.dot, expld.result.value);
}
else
- result.valid_p = FALSE;
+ expld.result.valid_p = FALSE;
break;
case DATA_SEGMENT_END:
- if (allocation_done != lang_first_phase_enum
- && current_section == abs_output_section
- && (exp_data_seg.phase == exp_dataseg_align_seen
- || exp_data_seg.phase == exp_dataseg_adjust
- || allocation_done != lang_allocating_phase_enum))
+ if (expld.phase != lang_first_phase_enum
+ && expld.section == bfd_abs_section_ptr
+ && (expld.dataseg.phase == exp_dataseg_align_seen
+ || expld.dataseg.phase == exp_dataseg_relro_seen
+ || expld.dataseg.phase == exp_dataseg_adjust
+ || expld.dataseg.phase == exp_dataseg_relro_adjust
+ || expld.phase == lang_final_phase_enum))
{
- if (exp_data_seg.phase == exp_dataseg_align_seen)
+ if (expld.dataseg.phase == exp_dataseg_align_seen
+ || expld.dataseg.phase == exp_dataseg_relro_seen)
{
- exp_data_seg.phase = exp_dataseg_end_seen;
- exp_data_seg.end = result.value;
+ expld.dataseg.phase = exp_dataseg_end_seen;
+ expld.dataseg.end = expld.result.value;
}
}
else
- result.valid_p = FALSE;
+ expld.result.valid_p = FALSE;
break;
default:
@@ -286,76 +267,90 @@ fold_unary (etree_type *tree,
break;
}
}
-
- return result;
}
-static etree_value_type
-fold_binary (etree_type *tree,
- lang_output_section_statement_type *current_section,
- lang_phase_type allocation_done,
- bfd_vma dot,
- bfd_vma *dotp)
+static void
+fold_binary (etree_type *tree)
{
- etree_value_type result;
+ exp_fold_tree_1 (tree->binary.lhs);
- result = exp_fold_tree (tree->binary.lhs, current_section,
- allocation_done, dot, dotp);
- if (result.valid_p)
+ /* The SEGMENT_START operator is special because its first
+ operand is a string, not the name of a symbol. */
+ if (expld.result.valid_p && tree->type.node_code == SEGMENT_START)
+ {
+ const char *segment_name;
+ segment_type *seg;
+ /* Check to see if the user has overridden the default
+ value. */
+ segment_name = tree->binary.rhs->name.name;
+ for (seg = segments; seg; seg = seg->next)
+ if (strcmp (seg->name, segment_name) == 0)
+ {
+ seg->used = TRUE;
+ expld.result.value = seg->value;
+ expld.result.str = NULL;
+ expld.result.section = NULL;
+ break;
+ }
+ }
+ else if (expld.result.valid_p)
{
- etree_value_type other;
+ etree_value_type lhs = expld.result;
- other = exp_fold_tree (tree->binary.rhs,
- current_section,
- allocation_done, dot, dotp);
- if (other.valid_p)
+ exp_fold_tree_1 (tree->binary.rhs);
+ if (expld.result.valid_p)
{
/* If the values are from different sections, or this is an
absolute expression, make both the source arguments
absolute. However, adding or subtracting an absolute
value from a relative value is meaningful, and is an
exception. */
- if (current_section != abs_output_section
- && (other.section == abs_output_section
- || (result.section == abs_output_section
- && tree->type.node_code == '+'))
+ if (expld.section != bfd_abs_section_ptr
+ && lhs.section == bfd_abs_section_ptr
+ && tree->type.node_code == '+')
+ {
+ /* Keep the section of the rhs term. */
+ expld.result.value = lhs.value + expld.result.value;
+ return;
+ }
+ else if (expld.section != bfd_abs_section_ptr
+ && expld.result.section == bfd_abs_section_ptr
&& (tree->type.node_code == '+'
|| tree->type.node_code == '-'))
{
- if (other.section != abs_output_section)
- {
- /* Keep the section of the other term. */
- if (tree->type.node_code == '+')
- other.value = result.value + other.value;
- else
- other.value = result.value - other.value;
- return other;
- }
+ /* Keep the section of the lhs term. */
+ expld.result.section = lhs.section;
}
- else if (result.section != other.section
- || current_section == abs_output_section)
+ else if (expld.result.section != lhs.section
+ || expld.section == bfd_abs_section_ptr)
{
- make_abs (&result);
- make_abs (&other);
+ make_abs ();
+ lhs.value += lhs.section->vma;
}
switch (tree->type.node_code)
{
case '%':
- if (other.value == 0)
+ if (expld.result.value != 0)
+ expld.result.value = ((bfd_signed_vma) lhs.value
+ % (bfd_signed_vma) expld.result.value);
+ else if (expld.phase != lang_mark_phase_enum)
einfo (_("%F%S %% by zero\n"));
- result.value = ((bfd_signed_vma) result.value
- % (bfd_signed_vma) other.value);
break;
case '/':
- if (other.value == 0)
+ if (expld.result.value != 0)
+ expld.result.value = ((bfd_signed_vma) lhs.value
+ / (bfd_signed_vma) expld.result.value);
+ else if (expld.phase != lang_mark_phase_enum)
einfo (_("%F%S / by zero\n"));
- result.value = ((bfd_signed_vma) result.value
- / (bfd_signed_vma) other.value);
break;
-#define BOP(x,y) case x : result.value = result.value y other.value; break;
+#define BOP(x, y) \
+ case x: \
+ expld.result.value = lhs.value y expld.result.value; \
+ break;
+
BOP ('+', +);
BOP ('*', *);
BOP ('-', -);
@@ -374,45 +369,82 @@ fold_binary (etree_type *tree,
BOP (OROR, ||);
case MAX_K:
- if (result.value < other.value)
- result = other;
+ if (lhs.value > expld.result.value)
+ expld.result.value = lhs.value;
break;
case MIN_K:
- if (result.value > other.value)
- result = other;
+ if (lhs.value < expld.result.value)
+ expld.result.value = lhs.value;
break;
case ALIGN_K:
- result.value = align_n (result.value, other.value);
+ expld.result.value = align_n (lhs.value, expld.result.value);
break;
-
+
case DATA_SEGMENT_ALIGN:
- if (allocation_done != lang_first_phase_enum
- && current_section == abs_output_section
- && (exp_data_seg.phase == exp_dataseg_none
- || exp_data_seg.phase == exp_dataseg_adjust
- || allocation_done != lang_allocating_phase_enum))
+ if (expld.phase != lang_first_phase_enum
+ && expld.section == bfd_abs_section_ptr
+ && (expld.dataseg.phase == exp_dataseg_none
+ || expld.dataseg.phase == exp_dataseg_adjust
+ || expld.dataseg.phase == exp_dataseg_relro_adjust
+ || expld.phase == lang_final_phase_enum))
{
- bfd_vma maxpage = result.value;
+ bfd_vma maxpage = lhs.value;
+ bfd_vma commonpage = expld.result.value;
- result.value = align_n (dot, maxpage);
- if (exp_data_seg.phase != exp_dataseg_adjust)
+ expld.result.value = align_n (expld.dot, maxpage);
+ if (expld.dataseg.phase == exp_dataseg_relro_adjust)
+ expld.result.value = expld.dataseg.base;
+ else if (expld.dataseg.phase != exp_dataseg_adjust)
{
- result.value += dot & (maxpage - 1);
- if (allocation_done == lang_allocating_phase_enum)
+ expld.result.value += expld.dot & (maxpage - 1);
+ if (expld.phase == lang_allocating_phase_enum)
{
- exp_data_seg.phase = exp_dataseg_align_seen;
- exp_data_seg.base = result.value;
- exp_data_seg.pagesize = other.value;
+ expld.dataseg.phase = exp_dataseg_align_seen;
+ expld.dataseg.min_base = align_n (expld.dot, maxpage);
+ expld.dataseg.base = expld.result.value;
+ expld.dataseg.pagesize = commonpage;
+ expld.dataseg.maxpagesize = maxpage;
+ expld.dataseg.relro_end = 0;
}
}
- else if (other.value < maxpage)
- result.value += (dot + other.value - 1)
- & (maxpage - other.value);
+ else if (commonpage < maxpage)
+ expld.result.value += ((expld.dot + commonpage - 1)
+ & (maxpage - commonpage));
+ }
+ else
+ expld.result.valid_p = FALSE;
+ break;
+
+ case DATA_SEGMENT_RELRO_END:
+ if (expld.phase != lang_first_phase_enum
+ && (expld.dataseg.phase == exp_dataseg_align_seen
+ || expld.dataseg.phase == exp_dataseg_adjust
+ || expld.dataseg.phase == exp_dataseg_relro_adjust
+ || expld.phase == lang_final_phase_enum))
+ {
+ if (expld.dataseg.phase == exp_dataseg_align_seen
+ || expld.dataseg.phase == exp_dataseg_relro_adjust)
+ expld.dataseg.relro_end = lhs.value + expld.result.value;
+
+ if (expld.dataseg.phase == exp_dataseg_relro_adjust
+ && (expld.dataseg.relro_end
+ & (expld.dataseg.pagesize - 1)))
+ {
+ expld.dataseg.relro_end += expld.dataseg.pagesize - 1;
+ expld.dataseg.relro_end &= ~(expld.dataseg.pagesize - 1);
+ expld.result.value = (expld.dataseg.relro_end
+ - expld.result.value);
+ }
+ else
+ expld.result.value = lhs.value;
+
+ if (expld.dataseg.phase == exp_dataseg_align_seen)
+ expld.dataseg.phase = exp_dataseg_relro_seen;
}
else
- result.valid_p = FALSE;
+ expld.result.valid_p = FALSE;
break;
default:
@@ -420,54 +452,40 @@ fold_binary (etree_type *tree,
}
}
else
- {
- result.valid_p = FALSE;
- }
+ expld.result.valid_p = FALSE;
}
-
- return result;
}
-static etree_value_type
-fold_trinary (etree_type *tree,
- lang_output_section_statement_type *current_section,
- lang_phase_type allocation_done,
- bfd_vma dot,
- bfd_vma *dotp)
+static void
+fold_trinary (etree_type *tree)
{
- etree_value_type result;
-
- result = exp_fold_tree (tree->trinary.cond, current_section,
- allocation_done, dot, dotp);
- if (result.valid_p)
- result = exp_fold_tree ((result.value
- ? tree->trinary.lhs
- : tree->trinary.rhs),
- current_section,
- allocation_done, dot, dotp);
-
- return result;
+ exp_fold_tree_1 (tree->trinary.cond);
+ if (expld.result.valid_p)
+ exp_fold_tree_1 (expld.result.value
+ ? tree->trinary.lhs
+ : tree->trinary.rhs);
}
-static etree_value_type
-fold_name (etree_type *tree,
- lang_output_section_statement_type *current_section,
- lang_phase_type allocation_done,
- bfd_vma dot)
+static void
+fold_name (etree_type *tree)
{
- etree_value_type result;
+ memset (&expld.result, 0, sizeof (expld.result));
- result.valid_p = FALSE;
-
switch (tree->type.node_code)
{
case SIZEOF_HEADERS:
- if (allocation_done != lang_first_phase_enum)
- result = new_abs (bfd_sizeof_headers (output_bfd,
- link_info.relocatable));
+ if (expld.phase != lang_first_phase_enum)
+ {
+ bfd_vma hdr_size = 0;
+ /* Don't find the real header size if only marking sections;
+ The bfd function may cache incorrect data. */
+ if (expld.phase != lang_mark_phase_enum)
+ hdr_size = bfd_sizeof_headers (output_bfd, link_info.relocatable);
+ new_abs (hdr_size);
+ }
break;
case DEFINED:
- if (allocation_done == lang_first_phase_enum)
+ if (expld.phase == lang_first_phase_enum)
lang_track_definedness (tree->name.name);
else
{
@@ -478,23 +496,22 @@ fold_name (etree_type *tree,
h = bfd_wrapped_link_hash_lookup (output_bfd, &link_info,
tree->name.name,
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)
- && (def_iteration == lang_statement_iteration
- || def_iteration == -1));
- result.section = abs_output_section;
- result.valid_p = TRUE;
+ expld.result.value = (h != NULL
+ && (h->type == bfd_link_hash_defined
+ || h->type == bfd_link_hash_defweak
+ || h->type == bfd_link_hash_common)
+ && (def_iteration == lang_statement_iteration
+ || def_iteration == -1));
+ expld.result.section = bfd_abs_section_ptr;
+ expld.result.valid_p = TRUE;
}
break;
case NAME:
- 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 if (allocation_done != lang_first_phase_enum)
+ if (expld.phase == lang_first_phase_enum)
+ ;
+ else if (tree->name.name[0] == '.' && tree->name.name[1] == 0)
+ new_rel_from_abs (expld.dot);
+ else
{
struct bfd_link_hash_entry *h;
@@ -507,151 +524,153 @@ fold_name (etree_type *tree,
|| h->type == bfd_link_hash_defweak)
{
if (bfd_is_abs_section (h->u.def.section))
- result = new_abs (h->u.def.value);
- else if (allocation_done == lang_final_phase_enum
- || allocation_done == lang_allocating_phase_enum)
+ new_abs (h->u.def.value);
+ else
{
asection *output_section;
output_section = h->u.def.section->output_section;
if (output_section == NULL)
- einfo (_("%X%S: unresolvable symbol `%s' referenced in expression\n"),
- tree->name.name);
- else
{
- lang_output_section_statement_type *os;
-
- os = (lang_output_section_statement_lookup
- (bfd_get_section_name (output_bfd,
- output_section)));
-
- /* FIXME: Is this correct if this section is
- being linked with -R? */
- result = new_rel ((h->u.def.value
- + h->u.def.section->output_offset),
- NULL,
- os);
+ if (expld.phase != lang_mark_phase_enum)
+ einfo (_("%X%S: unresolvable symbol `%s'"
+ " referenced in expression\n"),
+ tree->name.name);
}
+ else
+ new_rel (h->u.def.value + h->u.def.section->output_offset,
+ NULL, output_section);
}
}
- else if (allocation_done == lang_final_phase_enum)
+ else if (expld.phase == lang_final_phase_enum
+ || expld.assigning_to_dot)
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);
+ if (h->u.undef.next == NULL && h != link_info.hash->undefs_tail)
+ bfd_link_add_undef (link_info.hash, h);
}
}
break;
case ADDR:
- if (allocation_done != lang_first_phase_enum)
+ if (expld.phase != lang_first_phase_enum)
{
lang_output_section_statement_type *os;
os = lang_output_section_find (tree->name.name);
- if (os && os->processed > 0)
- result = new_rel (0, NULL, os);
+ if (os != NULL && os->processed)
+ new_rel (0, NULL, os->bfd_section);
}
break;
case LOADADDR:
- if (allocation_done != lang_first_phase_enum)
+ if (expld.phase != lang_first_phase_enum)
{
lang_output_section_statement_type *os;
os = lang_output_section_find (tree->name.name);
- if (os && os->processed != 0)
+ if (os != NULL && os->processed)
{
if (os->load_base == NULL)
- result = new_rel (0, NULL, os);
+ new_rel (0, NULL, os->bfd_section);
else
- result = exp_fold_tree_no_dot (os->load_base,
- abs_output_section,
- allocation_done);
+ exp_fold_tree_1 (os->load_base);
}
}
break;
case SIZEOF:
- if (allocation_done != lang_first_phase_enum)
+ if (expld.phase != lang_first_phase_enum)
{
int opb = bfd_octets_per_byte (output_bfd);
lang_output_section_statement_type *os;
os = lang_output_section_find (tree->name.name);
- if (os && os->processed > 0)
- result = new_abs (os->bfd_section->_raw_size / opb);
+ if (os == NULL)
+ new_abs (0);
+ else if (os->processed)
+ new_abs (os->bfd_section->size / opb);
}
break;
+ case LENGTH:
+ {
+ lang_memory_region_type *mem;
+
+ mem = lang_memory_region_lookup (tree->name.name, FALSE);
+ if (mem != NULL)
+ new_abs (mem->length);
+ else
+ einfo (_("%F%S: undefined MEMORY region `%s'"
+ " referenced in expression\n"), tree->name.name);
+ }
+ break;
+
+ case ORIGIN:
+ {
+ lang_memory_region_type *mem;
+
+ mem = lang_memory_region_lookup (tree->name.name, FALSE);
+ if (mem != NULL)
+ new_abs (mem->origin);
+ else
+ einfo (_("%F%S: undefined MEMORY region `%s'"
+ " referenced in expression\n"), tree->name.name);
+ }
+ break;
+
default:
FAIL ();
break;
}
-
- return result;
}
-etree_value_type
-exp_fold_tree (etree_type *tree,
- lang_output_section_statement_type *current_section,
- lang_phase_type allocation_done,
- bfd_vma dot,
- bfd_vma *dotp)
+static void
+exp_fold_tree_1 (etree_type *tree)
{
- etree_value_type result;
-
if (tree == NULL)
{
- result.valid_p = FALSE;
- return result;
+ memset (&expld.result, 0, sizeof (expld.result));
+ return;
}
switch (tree->type.node_class)
{
case etree_value:
- result = new_rel (tree->value.value, tree->value.str, current_section);
+ new_rel (tree->value.value, tree->value.str, expld.section);
break;
case etree_rel:
- if (allocation_done != lang_final_phase_enum)
- result.valid_p = FALSE;
+ if (expld.phase != lang_first_phase_enum)
+ {
+ asection *output_section = tree->rel.section->output_section;
+ new_rel (tree->rel.value + tree->rel.section->output_offset,
+ NULL, output_section);
+ }
else
- result = new_rel ((tree->rel.value
- + tree->rel.section->output_section->vma
- + tree->rel.section->output_offset),
- NULL,
- current_section);
+ memset (&expld.result, 0, sizeof (expld.result));
break;
case etree_assert:
- result = exp_fold_tree (tree->assert_s.child,
- current_section,
- allocation_done, dot, dotp);
- if (result.valid_p)
- {
- if (! result.value)
- einfo ("%F%P: %s\n", tree->assert_s.message);
- return result;
- }
+ exp_fold_tree_1 (tree->assert_s.child);
+ if (expld.phase == lang_final_phase_enum && !expld.result.value)
+ einfo ("%X%P: %s\n", tree->assert_s.message);
break;
case etree_unary:
- result = fold_unary (tree, current_section, allocation_done,
- dot, dotp);
+ fold_unary (tree);
break;
case etree_binary:
- result = fold_binary (tree, current_section, allocation_done,
- dot, dotp);
+ fold_binary (tree);
break;
case etree_trinary:
- result = fold_trinary (tree, current_section, allocation_done,
- dot, dotp);
+ fold_trinary (tree);
break;
case etree_assign:
@@ -662,118 +681,128 @@ exp_fold_tree (etree_type *tree,
/* Assignment to dot can only be done during allocation. */
if (tree->type.node_class != etree_assign)
einfo (_("%F%S can not PROVIDE assignment to location counter\n"));
- if (allocation_done == lang_allocating_phase_enum
- || (allocation_done == lang_final_phase_enum
- && current_section == abs_output_section))
+ if (expld.phase == lang_mark_phase_enum
+ || expld.phase == lang_allocating_phase_enum
+ || (expld.phase == lang_final_phase_enum
+ && expld.section == bfd_abs_section_ptr))
{
- result = exp_fold_tree (tree->assign.src,
- current_section,
- allocation_done, dot,
- dotp);
- if (! result.valid_p)
- einfo (_("%F%S invalid assignment to location counter\n"));
+ /* Notify the folder that this is an assignment to dot. */
+ expld.assigning_to_dot = TRUE;
+ exp_fold_tree_1 (tree->assign.src);
+ expld.assigning_to_dot = FALSE;
+
+ if (!expld.result.valid_p)
+ {
+ if (expld.phase != lang_mark_phase_enum)
+ einfo (_("%F%S invalid assignment to location counter\n"));
+ }
+ else if (expld.dotp == NULL)
+ einfo (_("%F%S assignment to location counter"
+ " invalid outside of SECTION\n"));
else
{
- if (current_section == NULL)
- einfo (_("%F%S assignment to location counter invalid outside of SECTION\n"));
+ bfd_vma nextdot;
+
+ nextdot = expld.result.value + expld.section->vma;
+ if (nextdot < expld.dot
+ && expld.section != bfd_abs_section_ptr)
+ einfo (_("%F%S cannot move location counter backwards"
+ " (from %V to %V)\n"), expld.dot, nextdot);
else
{
- bfd_vma nextdot;
-
- nextdot = (result.value
- + current_section->bfd_section->vma);
- if (nextdot < dot
- && current_section != abs_output_section)
- einfo (_("%F%S cannot move location counter backwards (from %V to %V)\n"),
- dot, nextdot);
- else
- *dotp = nextdot;
+ expld.dot = nextdot;
+ *expld.dotp = nextdot;
}
}
}
+ else
+ memset (&expld.result, 0, sizeof (expld.result));
}
else
{
- result = exp_fold_tree (tree->assign.src,
- current_section, allocation_done,
- dot, dotp);
- if (result.valid_p)
- {
- bfd_boolean create;
- struct bfd_link_hash_entry *h;
+ struct bfd_link_hash_entry *h = NULL;
- if (tree->type.node_class == etree_assign)
- create = TRUE;
- else
- create = FALSE;
+ if (tree->type.node_class == etree_provide)
+ {
h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst,
- create, FALSE, TRUE);
+ FALSE, FALSE, TRUE);
+ if (h == NULL
+ || (h->type != bfd_link_hash_new
+ && h->type != bfd_link_hash_undefined
+ && h->type != bfd_link_hash_common))
+ {
+ /* Do nothing. The symbol was never referenced, or was
+ defined by some object. */
+ break;
+ }
+ }
+
+ exp_fold_tree_1 (tree->assign.src);
+ if (expld.result.valid_p)
+ {
if (h == NULL)
{
- if (create)
+ h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst,
+ TRUE, FALSE, TRUE);
+ if (h == NULL)
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)
- {
- /* Do nothing. The symbol was defined by some
- object. */
- }
- else
- {
- /* 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;
- if (tree->type.node_class == etree_provide)
- tree->type.node_class = etree_provided;
- }
+
+ /* 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 = expld.result.value;
+ h->u.def.section = expld.result.section;
+ if (tree->type.node_class == etree_provide)
+ tree->type.node_class = etree_provided;
}
}
break;
case etree_name:
- result = fold_name (tree, current_section, allocation_done, dot);
+ fold_name (tree);
break;
default:
FAIL ();
+ memset (&expld.result, 0, sizeof (expld.result));
break;
}
+}
- return result;
+void
+exp_fold_tree (etree_type *tree, asection *current_section, bfd_vma *dotp)
+{
+ expld.dot = *dotp;
+ expld.dotp = dotp;
+ expld.section = current_section;
+ exp_fold_tree_1 (tree);
}
-static etree_value_type
-exp_fold_tree_no_dot (etree_type *tree,
- lang_output_section_statement_type *current_section,
- lang_phase_type allocation_done)
+static void
+exp_fold_tree_no_dot (etree_type *tree)
{
- return exp_fold_tree (tree, current_section, allocation_done, 0, NULL);
+ expld.dot = 0;
+ expld.dotp = NULL;
+ expld.section = bfd_abs_section_ptr;
+ exp_fold_tree_1 (tree);
}
etree_type *
exp_binop (int code, etree_type *lhs, etree_type *rhs)
{
etree_type value, *new;
- etree_value_type r;
value.type.node_code = code;
value.binary.lhs = lhs;
value.binary.rhs = rhs;
value.type.node_class = etree_binary;
- r = exp_fold_tree_no_dot (&value,
- abs_output_section,
- lang_first_phase_enum);
- if (r.valid_p)
- {
- return exp_intop (r.value);
- }
+ exp_fold_tree_no_dot (&value);
+ if (expld.result.valid_p)
+ return exp_intop (expld.result.value);
+
new = stat_alloc (sizeof (new->binary));
memcpy (new, &value, sizeof (new->binary));
return new;
@@ -783,15 +812,15 @@ etree_type *
exp_trinop (int code, etree_type *cond, etree_type *lhs, etree_type *rhs)
{
etree_type value, *new;
- etree_value_type r;
+
value.type.node_code = code;
value.trinary.lhs = lhs;
value.trinary.cond = cond;
value.trinary.rhs = rhs;
value.type.node_class = etree_trinary;
- r = exp_fold_tree_no_dot (&value, NULL, lang_first_phase_enum);
- if (r.valid_p)
- return exp_intop (r.value);
+ exp_fold_tree_no_dot (&value);
+ if (expld.result.valid_p)
+ return exp_intop (expld.result.value);
new = stat_alloc (sizeof (new->trinary));
memcpy (new, &value, sizeof (new->trinary));
@@ -803,14 +832,12 @@ exp_unop (int code, etree_type *child)
{
etree_type value, *new;
- etree_value_type r;
value.unary.type.node_code = code;
value.unary.child = child;
value.unary.type.node_class = etree_unary;
- r = exp_fold_tree_no_dot (&value, abs_output_section,
- lang_first_phase_enum);
- if (r.valid_p)
- return exp_intop (r.value);
+ exp_fold_tree_no_dot (&value);
+ if (expld.result.valid_p)
+ return exp_intop (expld.result.value);
new = stat_alloc (sizeof (new->unary));
memcpy (new, &value, sizeof (new->unary));
@@ -821,14 +848,14 @@ etree_type *
exp_nameop (int code, const char *name)
{
etree_type value, *new;
- etree_value_type r;
+
value.name.type.node_code = code;
value.name.name = name;
value.name.type.node_class = etree_name;
- r = exp_fold_tree_no_dot (&value, NULL, lang_first_phase_enum);
- if (r.valid_p)
- return exp_intop (r.value);
+ exp_fold_tree_no_dot (&value);
+ if (expld.result.valid_p)
+ return exp_intop (expld.result.value);
new = stat_alloc (sizeof (new->name));
memcpy (new, &value, sizeof (new->name));
@@ -839,27 +866,20 @@ exp_nameop (int code, const char *name)
etree_type *
exp_assop (int code, const char *dst, etree_type *src)
{
- etree_type value, *new;
-
- value.assign.type.node_code = code;
+ etree_type *new;
- value.assign.src = src;
- value.assign.dst = dst;
- value.assign.type.node_class = etree_assign;
-
-#if 0
- if (exp_fold_tree_no_dot (&value, &result))
- return exp_intop (result);
-#endif
new = stat_alloc (sizeof (new->assign));
- memcpy (new, &value, sizeof (new->assign));
+ new->type.node_code = code;
+ new->type.node_class = etree_assign;
+ new->assign.src = src;
+ new->assign.dst = dst;
return new;
}
/* Handle PROVIDE. */
etree_type *
-exp_provide (const char *dst, etree_type *src)
+exp_provide (const char *dst, etree_type *src, bfd_boolean hidden)
{
etree_type *n;
@@ -868,6 +888,7 @@ exp_provide (const char *dst, etree_type *src)
n->assign.type.node_class = etree_provide;
n->assign.src = src;
n->assign.dst = dst;
+ n->assign.hidden = hidden;
return n;
}
@@ -909,13 +930,6 @@ exp_print_tree (etree_type *tree)
minfo ("%s+0x%v", tree->rel.section->name, tree->rel.value);
return;
case etree_assign:
-#if 0
- 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_tree (tree->assign.src);
@@ -956,9 +970,6 @@ exp_print_tree (etree_type *tree)
fprintf (config.map_file, ", %s)", tree->assert_s.message);
break;
- case etree_undef:
- fprintf (config.map_file, "????????");
- break;
case etree_name:
if (tree->type.node_code == NAME)
{
@@ -978,59 +989,51 @@ exp_print_tree (etree_type *tree)
}
bfd_vma
-exp_get_vma (etree_type *tree,
- bfd_vma def,
- char *name,
- lang_phase_type allocation_done)
+exp_get_vma (etree_type *tree, bfd_vma def, char *name)
{
- etree_value_type r;
-
if (tree != NULL)
{
- r = exp_fold_tree_no_dot (tree, abs_output_section, allocation_done);
- if (! r.valid_p && name != NULL)
+ exp_fold_tree_no_dot (tree);
+ if (expld.result.valid_p)
+ return expld.result.value;
+ else if (name != NULL && expld.phase != lang_mark_phase_enum)
einfo (_("%F%S nonconstant expression for %s\n"), name);
- return r.value;
}
- else
- return def;
+ return def;
}
int
-exp_get_value_int (etree_type *tree,
- int def,
- char *name,
- lang_phase_type allocation_done)
+exp_get_value_int (etree_type *tree, int def, char *name)
{
- return exp_get_vma (tree, def, name, allocation_done);
+ return exp_get_vma (tree, def, name);
}
fill_type *
-exp_get_fill (etree_type *tree,
- fill_type *def,
- char *name,
- lang_phase_type allocation_done)
+exp_get_fill (etree_type *tree, fill_type *def, char *name)
{
fill_type *fill;
- etree_value_type r;
size_t len;
unsigned int val;
if (tree == NULL)
return def;
- r = exp_fold_tree_no_dot (tree, abs_output_section, allocation_done);
- if (! r.valid_p && name != NULL)
- einfo (_("%F%S nonconstant expression for %s\n"), name);
+ exp_fold_tree_no_dot (tree);
+ if (!expld.result.valid_p)
+ {
+ if (name != NULL && expld.phase != lang_mark_phase_enum)
+ einfo (_("%F%S nonconstant expression for %s\n"), name);
+ return def;
+ }
- if (r.str != NULL && (len = strlen (r.str)) != 0)
+ if (expld.result.str != NULL && (len = strlen (expld.result.str)) != 0)
{
unsigned char *dst;
unsigned char *s;
fill = xmalloc ((len + 1) / 2 + sizeof (*fill) - 1);
fill->size = (len + 1) / 2;
dst = fill->data;
- s = r.str;
+ s = (unsigned char *) expld.result.str;
val = 0;
do
{
@@ -1053,7 +1056,7 @@ exp_get_fill (etree_type *tree,
else
{
fill = xmalloc (4 + sizeof (*fill) - 1);
- val = r.value;
+ val = expld.result.value;
fill->data[0] = (val >> 24) & 0xff;
fill->data[1] = (val >> 16) & 0xff;
fill->data[2] = (val >> 8) & 0xff;
@@ -1064,20 +1067,21 @@ exp_get_fill (etree_type *tree,
}
bfd_vma
-exp_get_abs_int (etree_type *tree,
- int def ATTRIBUTE_UNUSED,
- char *name,
- lang_phase_type allocation_done)
+exp_get_abs_int (etree_type *tree, int def, char *name)
{
- etree_value_type res;
- res = exp_fold_tree_no_dot (tree, abs_output_section, allocation_done);
-
- if (res.valid_p)
- res.value += res.section->bfd_section->vma;
- else
- einfo (_("%F%S non constant expression for %s\n"), name);
+ if (tree != NULL)
+ {
+ exp_fold_tree_no_dot (tree);
- return res.value;
+ if (expld.result.valid_p)
+ {
+ expld.result.value += expld.result.section->vma;
+ return expld.result.value;
+ }
+ else if (name != NULL && expld.phase != lang_mark_phase_enum)
+ einfo (_("%F%S non constant expression for %s\n"), name);
+ }
+ return def;
}
static bfd_vma
diff --git a/contrib/binutils/ld/ldexp.h b/contrib/binutils/ld/ldexp.h
index 99e7073..fed3a0d 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,
- 2003, 2004 Free Software Foundation, Inc.
+ 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -16,8 +16,8 @@
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. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#ifndef LDEXP_H
#define LDEXP_H
@@ -26,7 +26,7 @@
typedef struct {
bfd_vma value;
char *str;
- struct lang_output_section_statement_struct *section;
+ asection *section;
bfd_boolean valid_p;
} etree_value_type;
@@ -40,8 +40,6 @@ typedef struct {
etree_assign,
etree_provide,
etree_provided,
- etree_undef,
- etree_unspec,
etree_value,
etree_assert,
etree_rel
@@ -65,6 +63,7 @@ typedef union etree_union {
node_type type;
const char *dst;
union etree_union *src;
+ bfd_boolean hidden;
} assign;
struct {
node_type type;
@@ -91,15 +90,60 @@ typedef union etree_union {
} assert_s;
} etree_type;
-extern struct exp_data_seg {
- enum {
- exp_dataseg_none,
- exp_dataseg_align_seen,
- exp_dataseg_end_seen,
- exp_dataseg_adjust
- } phase;
- bfd_vma base, end, pagesize;
-} exp_data_seg;
+typedef enum {
+ lang_first_phase_enum,
+ lang_mark_phase_enum,
+ lang_allocating_phase_enum,
+ lang_final_phase_enum
+} lang_phase_type;
+
+struct ldexp_control {
+ /* Modify expression evaluation depending on this. */
+ lang_phase_type phase;
+
+ /* Principally used for diagnostics. */
+ bfd_boolean assigning_to_dot;
+
+ /* Working results. */
+ etree_value_type result;
+ bfd_vma dot;
+
+ /* Current dot and section passed to ldexp folder. */
+ bfd_vma *dotp;
+ asection *section;
+
+ /* State machine and results for DATASEG. */
+ struct {
+ enum {
+ exp_dataseg_none,
+ exp_dataseg_align_seen,
+ exp_dataseg_relro_seen,
+ exp_dataseg_end_seen,
+ exp_dataseg_relro_adjust,
+ exp_dataseg_adjust
+ } phase;
+
+ bfd_vma base, min_base, relro_end, end, pagesize, maxpagesize;
+ } dataseg;
+};
+
+extern struct ldexp_control expld;
+
+/* A maps from a segment name to a base address. */
+typedef struct segment_struct {
+ /* The next segment in the linked list. */
+ struct segment_struct *next;
+ /* The name of the sgement. */
+ const char *name;
+ /* The base address for the segment. */
+ bfd_vma value;
+ /* True if a SEGMENT_START directive corresponding to this segment
+ has been seen. */
+ bfd_boolean used;
+} segment_type;
+
+/* The segments specified by the user on the command-line. */
+extern segment_type *segments;
typedef struct _fill_type fill_type;
@@ -109,11 +153,8 @@ 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 *);
+void exp_fold_tree
+ (etree_type *, asection *, bfd_vma *);
etree_type *exp_binop
(int, etree_type *, etree_type *);
etree_type *exp_trinop
@@ -125,18 +166,18 @@ etree_type *exp_nameop
etree_type *exp_assop
(int, const char *, etree_type *);
etree_type *exp_provide
- (const char *, etree_type *);
+ (const char *, etree_type *, bfd_boolean);
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);
+ (etree_type *, bfd_vma, char *);
int exp_get_value_int
- (etree_type *, int, char *, lang_phase_type);
+ (etree_type *, int, char *);
fill_type *exp_get_fill
- (etree_type *, fill_type *, char *, lang_phase_type);
+ (etree_type *, fill_type *, char *);
bfd_vma exp_get_abs_int
- (etree_type *, int, char *, lang_phase_type);
+ (etree_type *, int, char *);
#endif
diff --git a/contrib/binutils/ld/ldfile.c b/contrib/binutils/ld/ldfile.c
index a6f0d60..69d8fd9 100644
--- a/contrib/binutils/ld/ldfile.c
+++ b/contrib/binutils/ld/ldfile.c
@@ -1,6 +1,6 @@
/* Linker file opening and searching.
Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004 Free Software Foundation, Inc.
+ 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -16,8 +16,8 @@
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. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
/* ldfile.c: look after all the file stuff. */
@@ -44,20 +44,15 @@ unsigned long ldfile_output_machine;
enum bfd_architecture ldfile_output_architecture;
search_dirs_type * search_head;
-#ifndef MPW
#ifdef VMS
-char * slash = "";
+static char * slash = "";
#else
#if defined (_WIN32) && ! defined (__CYGWIN32__)
-char * slash = "\\";
+static char * slash = "\\";
#else
-char * slash = "/";
+static char * slash = "/";
#endif
#endif
-#else /* MPW */
-/* The MPW path char is a colon. */
-char * slash = ":";
-#endif /* MPW */
typedef struct search_arch
{
@@ -156,9 +151,10 @@ ldfile_try_open_bfd (const char *attempt,
/* If we are searching for this file, see if the architecture is
compatible with the output file. If it isn't, keep searching.
If we can't open the file as an object file, stop the search
- here. */
+ here. If we are statically linking, ensure that we don't link
+ a dynamic object. */
- if (entry->search_dirs_flag)
+ if (entry->search_dirs_flag || !entry->dynamic)
{
bfd *check;
@@ -172,6 +168,7 @@ ldfile_try_open_bfd (const char *attempt,
if (! bfd_check_format (check, bfd_object))
{
if (check == entry->the_bfd
+ && entry->search_dirs_flag
&& bfd_get_error () == bfd_error_file_not_recognized
&& ! ldemul_unrecognized_file (entry))
{
@@ -265,8 +262,18 @@ ldfile_try_open_bfd (const char *attempt,
return TRUE;
}
- if ((bfd_arch_get_compatible (check, output_bfd,
- command_line.accept_unknown_input_arch) == NULL)
+ if (!entry->dynamic && (entry->the_bfd->flags & DYNAMIC) != 0)
+ {
+ einfo (_("%F%P: attempted static link of dynamic object `%s'\n"),
+ attempt);
+ bfd_close (entry->the_bfd);
+ entry->the_bfd = NULL;
+ return FALSE;
+ }
+
+ if (entry->search_dirs_flag
+ && !bfd_arch_get_compatible (check, output_bfd,
+ command_line.accept_unknown_input_arch)
/* 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
@@ -455,7 +462,7 @@ try_open (const char *name, const char *exten)
/* Try to open NAME; if that fails, look for it in any directories
specified with -L, without and with EXTEND appended. */
-FILE *
+static FILE *
ldfile_find_command_file (const char *name, const char *extend)
{
search_dirs_type *search;
@@ -500,61 +507,6 @@ ldfile_open_command_file (const char *name)
saved_script_handle = ldlex_input_stack;
}
-#ifdef GNU960
-static char *
-gnu960_map_archname (char *name)
-{
- struct tabentry { char *cmd_switch; char *arch; };
- static struct tabentry arch_tab[] =
- {
- "", "",
- "KA", "ka",
- "KB", "kb",
- "KC", "mc", /* Synonym for MC */
- "MC", "mc",
- "CA", "ca",
- "SA", "ka", /* Functionally equivalent to KA */
- "SB", "kb", /* Functionally equivalent to KB */
- NULL, ""
- };
- struct tabentry *tp;
-
- for (tp = arch_tab; tp->cmd_switch != NULL; tp++)
- {
- if (! strcmp (name,tp->cmd_switch))
- break;
- }
-
- if (tp->cmd_switch == NULL)
- einfo (_("%P%F: unknown architecture: %s\n"), name);
-
- return tp->arch;
-}
-
-void
-ldfile_add_arch (char *name)
-{
- search_arch_type *new = xmalloc (sizeof (search_arch_type));
-
- if (*name != '\0')
- {
- if (ldfile_output_machine_name[0] != '\0')
- {
- einfo (_("%P%F: target architecture respecified\n"));
- return;
- }
-
- ldfile_output_machine_name = name;
- }
-
- new->next = NULL;
- new->name = gnu960_map_archname (name);
- *search_arch_tail_ptr = new;
- search_arch_tail_ptr = &new->next;
-}
-
-#else /* not GNU960 */
-
void
ldfile_add_arch (const char *in_name)
{
@@ -574,7 +526,6 @@ ldfile_add_arch (const char *in_name)
search_arch_tail_ptr = &new->next;
}
-#endif
/* Set the output architecture. */
diff --git a/contrib/binutils/ld/ldfile.h b/contrib/binutils/ld/ldfile.h
index 6d5f09d..b9ace6b 100644
--- a/contrib/binutils/ld/ldfile.h
+++ b/contrib/binutils/ld/ldfile.h
@@ -16,8 +16,8 @@
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, 51 Franklin Street - Fifth Floor,
+ Boston, MA 02110-1301, USA. */
#ifndef LDFILE_H
#define LDFILE_H
@@ -54,8 +54,6 @@ 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
- (const char *name, const char *extend);
extern void ldfile_set_output_arch
(const char *, enum bfd_architecture);
extern bfd_boolean ldfile_open_file_search
diff --git a/contrib/binutils/ld/ldgram.y b/contrib/binutils/ld/ldgram.y
index 6c46c85..3829e6a 100644
--- a/contrib/binutils/ld/ldgram.y
+++ b/contrib/binutils/ld/ldgram.y
@@ -1,23 +1,23 @@
/* 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, 2003 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
-This file is part of GNU ld.
+ This file is part of GNU ld.
-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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
%{
/*
@@ -46,10 +46,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#endif
static enum section_type sectype;
+static lang_memory_region_type *region;
-lang_memory_region_type *region;
-
-bfd_boolean ldgram_want_filename = TRUE;
FILE *saved_script_handle = NULL;
bfd_boolean force_make_executable = FALSE;
@@ -94,7 +92,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 opt_subalign
+%type <etree> opt_exp_without_type opt_subalign opt_align
%type <fill> fill_opt fill_exp
%type <name_list> exclude_name_list
%type <wildcard_list> file_NAME_list
@@ -128,11 +126,13 @@ static int error_index;
%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
+%token SECTIONS PHDRS DATA_SEGMENT_ALIGN DATA_SEGMENT_RELRO_END DATA_SEGMENT_END
+%token SORT_BY_NAME SORT_BY_ALIGNMENT
%token '{' '}'
%token SIZEOF_HEADERS OUTPUT_FORMAT FORCE_COMMON_ALLOCATION OUTPUT_ARCH
%token INHIBIT_COMMON_ALLOCATION
%token SIZEOF_HEADERS
+%token SEGMENT_START
%token INCLUDE
%token MEMORY DEFSYMEND
%token NOLOAD DSECT COPY INFO OVERLAY
@@ -142,15 +142,15 @@ 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 SUBALIGN PROVIDE
-%type <token> assign_op atype attributes_opt
+%token ALIGNMOD AT SUBALIGN PROVIDE PROVIDE_HIDDEN AS_NEEDED
+%type <token> assign_op atype attributes_opt sect_constraint
%type <name> filename
%token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD ASSERT_K
%token FORMAT PUBLIC DEFSYMEND BASE ALIAS TRUNCATE REL
%token INPUT_SCRIPT INPUT_MRI_SCRIPT INPUT_DEFSYM CASE EXTERN START
%token <name> VERS_TAG VERS_IDENTIFIER
%token GLOBAL LOCAL VERSIONK INPUT_VERSION_SCRIPT
-%token KEEP
+%token KEEP ONLY_IF_RO ONLY_IF_RW SPECIAL
%token EXCLUDE_FILE
%type <versyms> vers_defns
%type <versnode> vers_tag
@@ -370,6 +370,18 @@ input_list:
| input_list LNAME
{ lang_add_input_file($2,lang_input_file_is_l_enum,
(char *)NULL); }
+ | AS_NEEDED '('
+ { $<integer>$ = as_needed; as_needed = TRUE; }
+ input_list ')'
+ { as_needed = $<integer>3; }
+ | input_list ',' AS_NEEDED '('
+ { $<integer>$ = as_needed; as_needed = TRUE; }
+ input_list ')'
+ { as_needed = $<integer>5; }
+ | input_list AS_NEEDED '('
+ { $<integer>$ = as_needed; as_needed = TRUE; }
+ input_list ')'
+ { as_needed = $<integer>4; }
;
sections:
@@ -412,25 +424,55 @@ wildcard_spec:
wildcard_name
{
$$.name = $1;
- $$.sorted = FALSE;
+ $$.sorted = none;
$$.exclude_name_list = NULL;
}
| EXCLUDE_FILE '(' exclude_name_list ')' wildcard_name
{
$$.name = $5;
- $$.sorted = FALSE;
+ $$.sorted = none;
$$.exclude_name_list = $3;
}
- | SORT '(' wildcard_name ')'
+ | SORT_BY_NAME '(' wildcard_name ')'
{
$$.name = $3;
- $$.sorted = TRUE;
+ $$.sorted = by_name;
+ $$.exclude_name_list = NULL;
+ }
+ | SORT_BY_ALIGNMENT '(' wildcard_name ')'
+ {
+ $$.name = $3;
+ $$.sorted = by_alignment;
+ $$.exclude_name_list = NULL;
+ }
+ | SORT_BY_NAME '(' SORT_BY_ALIGNMENT '(' wildcard_name ')' ')'
+ {
+ $$.name = $5;
+ $$.sorted = by_name_alignment;
+ $$.exclude_name_list = NULL;
+ }
+ | SORT_BY_NAME '(' SORT_BY_NAME '(' wildcard_name ')' ')'
+ {
+ $$.name = $5;
+ $$.sorted = by_name;
$$.exclude_name_list = NULL;
}
- | SORT '(' EXCLUDE_FILE '(' exclude_name_list ')' wildcard_name ')'
+ | SORT_BY_ALIGNMENT '(' SORT_BY_NAME '(' wildcard_name ')' ')'
+ {
+ $$.name = $5;
+ $$.sorted = by_alignment_name;
+ $$.exclude_name_list = NULL;
+ }
+ | SORT_BY_ALIGNMENT '(' SORT_BY_ALIGNMENT '(' wildcard_name ')' ')'
+ {
+ $$.name = $5;
+ $$.sorted = by_alignment;
+ $$.exclude_name_list = NULL;
+ }
+ | SORT_BY_NAME '(' EXCLUDE_FILE '(' exclude_name_list ')' wildcard_name ')'
{
$$.name = $7;
- $$.sorted = TRUE;
+ $$.sorted = by_name;
$$.exclude_name_list = $5;
}
;
@@ -481,7 +523,7 @@ input_section_spec_no_keep:
struct wildcard_spec tmp;
tmp.name = $1;
tmp.exclude_name_list = NULL;
- tmp.sorted = FALSE;
+ tmp.sorted = none;
lang_add_wild (&tmp, NULL, ldgram_had_keep);
}
| '[' file_NAME_list ']'
@@ -514,7 +556,7 @@ statement:
lang_add_attribute(lang_constructors_statement_enum);
}
- | SORT '(' CONSTRUCTORS ')'
+ | SORT_BY_NAME '(' CONSTRUCTORS ')'
{
constructors_sorted = TRUE;
lang_add_attribute (lang_constructors_statement_enum);
@@ -557,10 +599,7 @@ length:
fill_exp:
mustbe_exp
{
- $$ = exp_get_fill ($1,
- 0,
- "fill value",
- lang_first_phase_enum);
+ $$ = exp_get_fill ($1, 0, "fill value");
}
;
@@ -609,7 +648,11 @@ assignment:
}
| PROVIDE '(' NAME '=' mustbe_exp ')'
{
- lang_add_assignment (exp_provide ($3, $5));
+ lang_add_assignment (exp_provide ($3, $5, FALSE));
+ }
+ | PROVIDE_HIDDEN '(' NAME '=' mustbe_exp ')'
+ {
+ lang_add_assignment (exp_provide ($3, $5, TRUE));
}
;
@@ -638,18 +681,16 @@ memory_spec: NAME
origin_spec:
ORIGIN '=' mustbe_exp
- { region->current =
- region->origin =
- exp_get_vma($3, 0L,"origin", lang_first_phase_enum);
-}
+ {
+ region->origin = exp_get_vma ($3, 0, "origin");
+ region->current = region->origin;
+ }
;
length_spec:
LENGTH '=' mustbe_exp
- { region->length = exp_get_vma($3,
- ~((bfd_vma)0),
- "length",
- lang_first_phase_enum);
+ {
+ region->length = exp_get_vma ($3, -1, "length");
}
;
@@ -730,96 +771,111 @@ nocrossref_list:
}
;
-mustbe_exp: { ldlex_expression(); }
+mustbe_exp: { ldlex_expression (); }
exp
- { ldlex_popstate(); $$=$2;}
+ { ldlex_popstate (); $$=$2;}
;
exp :
'-' exp %prec UNARY
- { $$ = exp_unop('-', $2); }
+ { $$ = exp_unop ('-', $2); }
| '(' exp ')'
{ $$ = $2; }
| NEXT '(' exp ')' %prec UNARY
- { $$ = exp_unop((int) $1,$3); }
+ { $$ = exp_unop ((int) $1,$3); }
| '!' exp %prec UNARY
- { $$ = exp_unop('!', $2); }
+ { $$ = exp_unop ('!', $2); }
| '+' exp %prec UNARY
{ $$ = $2; }
| '~' exp %prec UNARY
- { $$ = exp_unop('~', $2);}
+ { $$ = exp_unop ('~', $2);}
| exp '*' exp
- { $$ = exp_binop('*', $1, $3); }
+ { $$ = exp_binop ('*', $1, $3); }
| exp '/' exp
- { $$ = exp_binop('/', $1, $3); }
+ { $$ = exp_binop ('/', $1, $3); }
| exp '%' exp
- { $$ = exp_binop('%', $1, $3); }
+ { $$ = exp_binop ('%', $1, $3); }
| exp '+' exp
- { $$ = exp_binop('+', $1, $3); }
+ { $$ = exp_binop ('+', $1, $3); }
| exp '-' exp
- { $$ = exp_binop('-' , $1, $3); }
+ { $$ = exp_binop ('-' , $1, $3); }
| exp LSHIFT exp
- { $$ = exp_binop(LSHIFT , $1, $3); }
+ { $$ = exp_binop (LSHIFT , $1, $3); }
| exp RSHIFT exp
- { $$ = exp_binop(RSHIFT , $1, $3); }
+ { $$ = exp_binop (RSHIFT , $1, $3); }
| exp EQ exp
- { $$ = exp_binop(EQ , $1, $3); }
+ { $$ = exp_binop (EQ , $1, $3); }
| exp NE exp
- { $$ = exp_binop(NE , $1, $3); }
+ { $$ = exp_binop (NE , $1, $3); }
| exp LE exp
- { $$ = exp_binop(LE , $1, $3); }
+ { $$ = exp_binop (LE , $1, $3); }
| exp GE exp
- { $$ = exp_binop(GE , $1, $3); }
+ { $$ = exp_binop (GE , $1, $3); }
| exp '<' exp
- { $$ = exp_binop('<' , $1, $3); }
+ { $$ = exp_binop ('<' , $1, $3); }
| exp '>' exp
- { $$ = exp_binop('>' , $1, $3); }
+ { $$ = exp_binop ('>' , $1, $3); }
| exp '&' exp
- { $$ = exp_binop('&' , $1, $3); }
+ { $$ = exp_binop ('&' , $1, $3); }
| exp '^' exp
- { $$ = exp_binop('^' , $1, $3); }
+ { $$ = exp_binop ('^' , $1, $3); }
| exp '|' exp
- { $$ = exp_binop('|' , $1, $3); }
+ { $$ = exp_binop ('|' , $1, $3); }
| exp '?' exp ':' exp
- { $$ = exp_trinop('?' , $1, $3, $5); }
+ { $$ = exp_trinop ('?' , $1, $3, $5); }
| exp ANDAND exp
- { $$ = exp_binop(ANDAND , $1, $3); }
+ { $$ = exp_binop (ANDAND , $1, $3); }
| exp OROR exp
- { $$ = exp_binop(OROR , $1, $3); }
+ { $$ = exp_binop (OROR , $1, $3); }
| DEFINED '(' NAME ')'
- { $$ = exp_nameop(DEFINED, $3); }
+ { $$ = exp_nameop (DEFINED, $3); }
| INT
{ $$ = exp_bigintop ($1.integer, $1.str); }
| SIZEOF_HEADERS
- { $$ = exp_nameop(SIZEOF_HEADERS,0); }
+ { $$ = exp_nameop (SIZEOF_HEADERS,0); }
| SIZEOF '(' NAME ')'
- { $$ = exp_nameop(SIZEOF,$3); }
+ { $$ = exp_nameop (SIZEOF,$3); }
| ADDR '(' NAME ')'
- { $$ = exp_nameop(ADDR,$3); }
+ { $$ = exp_nameop (ADDR,$3); }
| LOADADDR '(' NAME ')'
- { $$ = exp_nameop(LOADADDR,$3); }
+ { $$ = exp_nameop (LOADADDR,$3); }
| ABSOLUTE '(' exp ')'
- { $$ = exp_unop(ABSOLUTE, $3); }
+ { $$ = exp_unop (ABSOLUTE, $3); }
| ALIGN_K '(' exp ')'
- { $$ = exp_unop(ALIGN_K,$3); }
+ { $$ = exp_unop (ALIGN_K,$3); }
| ALIGN_K '(' exp ',' exp ')'
- { $$ = exp_binop(ALIGN_K,$3,$5); }
+ { $$ = exp_binop (ALIGN_K,$3,$5); }
| DATA_SEGMENT_ALIGN '(' exp ',' exp ')'
{ $$ = exp_binop (DATA_SEGMENT_ALIGN, $3, $5); }
+ | DATA_SEGMENT_RELRO_END '(' exp ',' exp ')'
+ { $$ = exp_binop (DATA_SEGMENT_RELRO_END, $5, $3); }
| DATA_SEGMENT_END '(' exp ')'
- { $$ = exp_unop(DATA_SEGMENT_END, $3); }
+ { $$ = exp_unop (DATA_SEGMENT_END, $3); }
+ | SEGMENT_START '(' NAME ',' exp ')'
+ { /* The operands to the expression node are
+ placed in the opposite order from the way
+ in which they appear in the script as
+ that allows us to reuse more code in
+ fold_binary. */
+ $$ = exp_binop (SEGMENT_START,
+ $5,
+ exp_nameop (NAME, $3)); }
| BLOCK '(' exp ')'
- { $$ = exp_unop(ALIGN_K,$3); }
+ { $$ = exp_unop (ALIGN_K,$3); }
| NAME
- { $$ = exp_nameop(NAME,$1); }
+ { $$ = exp_nameop (NAME,$1); }
| MAX_K '(' exp ',' exp ')'
{ $$ = exp_binop (MAX_K, $3, $5 ); }
| MIN_K '(' exp ',' exp ')'
{ $$ = exp_binop (MIN_K, $3, $5 ); }
| ASSERT_K '(' exp ',' NAME ')'
{ $$ = exp_assert ($3, $5); }
+ | ORIGIN '(' NAME ')'
+ { $$ = exp_nameop (ORIGIN, $3); }
+ | LENGTH '(' NAME ')'
+ { $$ = exp_nameop (LENGTH, $3); }
;
@@ -833,27 +889,41 @@ opt_at:
| { $$ = 0; }
;
+opt_align:
+ ALIGN_K '(' exp ')' { $$ = $3; }
+ | { $$ = 0; }
+ ;
+
opt_subalign:
SUBALIGN '(' exp ')' { $$ = $3; }
| { $$ = 0; }
;
+sect_constraint:
+ ONLY_IF_RO { $$ = ONLY_IF_RO; }
+ | ONLY_IF_RW { $$ = ONLY_IF_RW; }
+ | SPECIAL { $$ = SPECIAL; }
+ | { $$ = 0; }
+ ;
+
section: NAME { ldlex_expression(); }
opt_exp_with_type
opt_at
+ opt_align
opt_subalign { ldlex_popstate (); ldlex_script (); }
+ sect_constraint
'{'
{
lang_enter_output_section_statement($1, $3,
sectype,
- 0, $5, $4);
+ $5, $6, $4, $8);
}
statement_list_opt
'}' { ldlex_popstate (); ldlex_expression (); }
memspec_opt memspec_at_opt phdr_opt fill_opt
{
ldlex_popstate ();
- lang_leave_output_section_statement ($15, $12, $14, $13);
+ lang_leave_output_section_statement ($17, $14, $16, $15);
}
opt_comma
{}
@@ -1149,11 +1219,19 @@ vers_tag:
vers_defns:
VERS_IDENTIFIER
{
- $$ = lang_new_vers_pattern (NULL, $1, ldgram_vers_current_lang);
+ $$ = lang_new_vers_pattern (NULL, $1, ldgram_vers_current_lang, FALSE);
+ }
+ | NAME
+ {
+ $$ = lang_new_vers_pattern (NULL, $1, ldgram_vers_current_lang, TRUE);
}
| vers_defns ';' VERS_IDENTIFIER
{
- $$ = lang_new_vers_pattern ($1, $3, ldgram_vers_current_lang);
+ $$ = lang_new_vers_pattern ($1, $3, ldgram_vers_current_lang, FALSE);
+ }
+ | vers_defns ';' NAME
+ {
+ $$ = lang_new_vers_pattern ($1, $3, ldgram_vers_current_lang, TRUE);
}
| vers_defns ';' EXTERN NAME '{'
{
@@ -1162,6 +1240,9 @@ vers_defns:
}
vers_defns opt_semicolon '}'
{
+ struct bfd_elf_version_expr *pat;
+ for (pat = $7; pat->next != NULL; pat = pat->next);
+ pat->next = $1;
$$ = $7;
ldgram_vers_current_lang = $<name>6;
}
@@ -1175,6 +1256,30 @@ vers_defns:
$$ = $5;
ldgram_vers_current_lang = $<name>4;
}
+ | GLOBAL
+ {
+ $$ = lang_new_vers_pattern (NULL, "global", ldgram_vers_current_lang, FALSE);
+ }
+ | vers_defns ';' GLOBAL
+ {
+ $$ = lang_new_vers_pattern ($1, "global", ldgram_vers_current_lang, FALSE);
+ }
+ | LOCAL
+ {
+ $$ = lang_new_vers_pattern (NULL, "local", ldgram_vers_current_lang, FALSE);
+ }
+ | vers_defns ';' LOCAL
+ {
+ $$ = lang_new_vers_pattern ($1, "local", ldgram_vers_current_lang, FALSE);
+ }
+ | EXTERN
+ {
+ $$ = lang_new_vers_pattern (NULL, "extern", ldgram_vers_current_lang, FALSE);
+ }
+ | vers_defns ';' EXTERN
+ {
+ $$ = lang_new_vers_pattern ($1, "extern", ldgram_vers_current_lang, FALSE);
+ }
;
opt_semicolon:
diff --git a/contrib/binutils/ld/ldint.texinfo b/contrib/binutils/ld/ldint.texinfo
index 5486764..dc6e9a6 100644
--- a/contrib/binutils/ld/ldint.texinfo
+++ b/contrib/binutils/ld/ldint.texinfo
@@ -699,7 +699,7 @@ require more work on behalf of loader than not doing it.
Version 1.1, March 2000
Copyright (C) 2000 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
diff --git a/contrib/binutils/ld/ldlang.c b/contrib/binutils/ld/ldlang.c
index 0c08601..b0a28d5 100644
--- a/contrib/binutils/ld/ldlang.c
+++ b/contrib/binutils/ld/ldlang.c
@@ -1,6 +1,6 @@
/* Linker command language support.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004
+ 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -17,8 +17,8 @@
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. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -47,12 +47,14 @@
/* Locals variables. */
static struct obstack stat_obstack;
+static struct obstack map_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 bfd_boolean placed_commons = FALSE;
+static bfd_boolean stripped_excluded_sections = FALSE;
static lang_output_section_statement_type *default_common_section;
static bfd_boolean map_option_f;
static bfd_vma print_dot;
@@ -65,31 +67,32 @@ static struct bfd_hash_table lang_definedness_table;
/* Forward declarations. */
static void exp_init_os (etree_type *);
-static bfd_boolean wildcardp (const char *);
+static void init_map_userdata (bfd *, asection *, void *);
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_all_symbols (asection *);
+static bfd_boolean sort_def_symbol (struct bfd_link_hash_entry *, void *);
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 void print_input_section (asection *);
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 };
+static const char *entry_symbol_default = "start";
const char *entry_section = ".text";
bfd_boolean entry_from_cmdline;
bfd_boolean lang_has_input_file = FALSE;
@@ -97,12 +100,22 @@ 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 struct unique_sections *unique_section_list;
static bfd_boolean ldlang_sysrooted_script = FALSE;
+
+ /* Functions that traverse the linker script and might evaluate
+ DEFINED() need to increment this. */
int lang_statement_iteration = 0;
etree_type *base; /* Relocation base - or null */
+/* 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. */
+#define wildcardp(pattern) (strpbrk ((pattern), "?*[") != NULL)
+
#define new_stat(x, y) \
(x##_type *) new_statement (x##_enum, sizeof (x##_type), y)
@@ -121,10 +134,17 @@ stat_alloc (size_t size)
}
bfd_boolean
-unique_section_p (const char *secnam)
+unique_section_p (const asection *sec)
{
struct unique_sections *unam;
+ const char *secnam;
+ if (link_info.relocatable
+ && sec->owner != NULL
+ && bfd_is_group_section (sec->owner, sec))
+ return TRUE;
+
+ secnam = sec->name;
for (unam = unique_section_list; unam; unam = unam->next)
if (wildcardp (unam->name)
? fnmatch (unam->name, secnam, 0) == 0
@@ -138,21 +158,71 @@ unique_section_p (const char *secnam)
/* Generic traversal routines for finding matching sections. */
+/* Try processing a section against a wildcard. This just calls
+ the callback unless the filename exclusion list is present
+ and excludes the file. It's hardly ever present so this
+ function is very fast. */
+
static void
-walk_wild_section (lang_wild_statement_type *ptr,
- lang_input_statement_type *file,
- callback_t callback,
- void *data)
+walk_wild_consider_section (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ asection *s,
+ struct wildcard_list *sec,
+ callback_t callback,
+ void *data)
+{
+ bfd_boolean skip = FALSE;
+ struct name_list *list_tmp;
+
+ /* Don't process sections from files which were
+ excluded. */
+ for (list_tmp = sec->spec.exclude_name_list;
+ list_tmp;
+ list_tmp = list_tmp->next)
+ {
+ bfd_boolean is_wildcard = wildcardp (list_tmp->name);
+ if (is_wildcard)
+ skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
+ else
+ skip = strcmp (list_tmp->name, file->filename) == 0;
+
+ /* If this file is part of an archive, and the archive is
+ excluded, exclude this file. */
+ if (! skip && file->the_bfd != NULL
+ && file->the_bfd->my_archive != NULL
+ && file->the_bfd->my_archive->filename != NULL)
+ {
+ if (is_wildcard)
+ skip = fnmatch (list_tmp->name,
+ file->the_bfd->my_archive->filename,
+ 0) == 0;
+ else
+ skip = strcmp (list_tmp->name,
+ file->the_bfd->my_archive->filename) == 0;
+ }
+
+ if (skip)
+ break;
+ }
+
+ if (!skip)
+ (*callback) (ptr, sec, s, file, data);
+}
+
+/* Lowest common denominator routine that can handle everything correctly,
+ but slowly. */
+
+static void
+walk_wild_section_general (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ callback_t callback,
+ void *data)
{
asection *s;
-
- if (file->just_syms_flag)
- return;
+ struct wildcard_list *sec;
for (s = file->the_bfd->sections; s != NULL; s = s->next)
{
- struct wildcard_list *sec;
-
sec = ptr->section_list;
if (sec == NULL)
(*callback) (ptr, sec, s, file, data);
@@ -160,39 +230,8 @@ walk_wild_section (lang_wild_statement_type *ptr,
while (sec != NULL)
{
bfd_boolean skip = FALSE;
- struct name_list *list_tmp;
-
- /* Don't process sections from files which were
- excluded. */
- for (list_tmp = sec->spec.exclude_name_list;
- list_tmp;
- list_tmp = list_tmp->next)
- {
- if (wildcardp (list_tmp->name))
- skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
- else
- skip = strcmp (list_tmp->name, file->filename) == 0;
-
- /* If this file is part of an archive, and the archive is
- excluded, exclude this file. */
- if (! skip && file->the_bfd != NULL
- && file->the_bfd->my_archive != NULL
- && file->the_bfd->my_archive->filename != NULL)
- {
- if (wildcardp (list_tmp->name))
- skip = fnmatch (list_tmp->name,
- file->the_bfd->my_archive->filename,
- 0) == 0;
- else
- skip = strcmp (list_tmp->name,
- file->the_bfd->my_archive->filename) == 0;
- }
-
- if (skip)
- break;
- }
- if (!skip && sec->spec.name != NULL)
+ if (sec->spec.name != NULL)
{
const char *sname = bfd_get_section_name (file->the_bfd, s);
@@ -203,13 +242,381 @@ walk_wild_section (lang_wild_statement_type *ptr,
}
if (!skip)
- (*callback) (ptr, sec, s, file, data);
+ walk_wild_consider_section (ptr, file, s, sec, callback, data);
sec = sec->next;
}
}
}
+/* Routines to find a single section given its name. If there's more
+ than one section with that name, we report that. */
+
+typedef struct
+{
+ asection *found_section;
+ bfd_boolean multiple_sections_found;
+} section_iterator_callback_data;
+
+static bfd_boolean
+section_iterator_callback (bfd *bfd ATTRIBUTE_UNUSED, asection *s, void *data)
+{
+ section_iterator_callback_data *d = data;
+
+ if (d->found_section != NULL)
+ {
+ d->multiple_sections_found = TRUE;
+ return TRUE;
+ }
+
+ d->found_section = s;
+ return FALSE;
+}
+
+static asection *
+find_section (lang_input_statement_type *file,
+ struct wildcard_list *sec,
+ bfd_boolean *multiple_sections_found)
+{
+ section_iterator_callback_data cb_data = { NULL, FALSE };
+
+ bfd_get_section_by_name_if (file->the_bfd, sec->spec.name,
+ section_iterator_callback, &cb_data);
+ *multiple_sections_found = cb_data.multiple_sections_found;
+ return cb_data.found_section;
+}
+
+/* Code for handling simple wildcards without going through fnmatch,
+ which can be expensive because of charset translations etc. */
+
+/* A simple wild is a literal string followed by a single '*',
+ where the literal part is at least 4 characters long. */
+
+static bfd_boolean
+is_simple_wild (const char *name)
+{
+ size_t len = strcspn (name, "*?[");
+ return len >= 4 && name[len] == '*' && name[len + 1] == '\0';
+}
+
+static bfd_boolean
+match_simple_wild (const char *pattern, const char *name)
+{
+ /* The first four characters of the pattern are guaranteed valid
+ non-wildcard characters. So we can go faster. */
+ if (pattern[0] != name[0] || pattern[1] != name[1]
+ || pattern[2] != name[2] || pattern[3] != name[3])
+ return FALSE;
+
+ pattern += 4;
+ name += 4;
+ while (*pattern != '*')
+ if (*name++ != *pattern++)
+ return FALSE;
+
+ return TRUE;
+}
+
+/* Specialized, optimized routines for handling different kinds of
+ wildcards */
+
+static void
+walk_wild_section_specs1_wild0 (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ callback_t callback,
+ void *data)
+{
+ /* We can just do a hash lookup for the section with the right name.
+ But if that lookup discovers more than one section with the name
+ (should be rare), we fall back to the general algorithm because
+ we would otherwise have to sort the sections to make sure they
+ get processed in the bfd's order. */
+ bfd_boolean multiple_sections_found;
+ struct wildcard_list *sec0 = ptr->handler_data[0];
+ asection *s0 = find_section (file, sec0, &multiple_sections_found);
+
+ if (multiple_sections_found)
+ walk_wild_section_general (ptr, file, callback, data);
+ else if (s0)
+ walk_wild_consider_section (ptr, file, s0, sec0, callback, data);
+}
+
+static void
+walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ callback_t callback,
+ void *data)
+{
+ asection *s;
+ struct wildcard_list *wildsec0 = ptr->handler_data[0];
+
+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
+ {
+ const char *sname = bfd_get_section_name (file->the_bfd, s);
+ bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname);
+
+ if (!skip)
+ walk_wild_consider_section (ptr, file, s, wildsec0, callback, data);
+ }
+}
+
+static void
+walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ callback_t callback,
+ void *data)
+{
+ asection *s;
+ struct wildcard_list *sec0 = ptr->handler_data[0];
+ struct wildcard_list *wildsec1 = ptr->handler_data[1];
+ bfd_boolean multiple_sections_found;
+ asection *s0 = find_section (file, sec0, &multiple_sections_found);
+
+ if (multiple_sections_found)
+ {
+ walk_wild_section_general (ptr, file, callback, data);
+ return;
+ }
+
+ /* Note that if the section was not found, s0 is NULL and
+ we'll simply never succeed the s == s0 test below. */
+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
+ {
+ /* Recall that in this code path, a section cannot satisfy more
+ than one spec, so if s == s0 then it cannot match
+ wildspec1. */
+ if (s == s0)
+ walk_wild_consider_section (ptr, file, s, sec0, callback, data);
+ else
+ {
+ const char *sname = bfd_get_section_name (file->the_bfd, s);
+ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
+
+ if (!skip)
+ walk_wild_consider_section (ptr, file, s, wildsec1, callback,
+ data);
+ }
+ }
+}
+
+static void
+walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ callback_t callback,
+ void *data)
+{
+ asection *s;
+ struct wildcard_list *sec0 = ptr->handler_data[0];
+ struct wildcard_list *wildsec1 = ptr->handler_data[1];
+ struct wildcard_list *wildsec2 = ptr->handler_data[2];
+ bfd_boolean multiple_sections_found;
+ asection *s0 = find_section (file, sec0, &multiple_sections_found);
+
+ if (multiple_sections_found)
+ {
+ walk_wild_section_general (ptr, file, callback, data);
+ return;
+ }
+
+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
+ {
+ if (s == s0)
+ walk_wild_consider_section (ptr, file, s, sec0, callback, data);
+ else
+ {
+ const char *sname = bfd_get_section_name (file->the_bfd, s);
+ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
+
+ if (!skip)
+ walk_wild_consider_section (ptr, file, s, wildsec1, callback, data);
+ else
+ {
+ skip = !match_simple_wild (wildsec2->spec.name, sname);
+ if (!skip)
+ walk_wild_consider_section (ptr, file, s, wildsec2, callback,
+ data);
+ }
+ }
+ }
+}
+
+static void
+walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ callback_t callback,
+ void *data)
+{
+ asection *s;
+ struct wildcard_list *sec0 = ptr->handler_data[0];
+ struct wildcard_list *sec1 = ptr->handler_data[1];
+ struct wildcard_list *wildsec2 = ptr->handler_data[2];
+ struct wildcard_list *wildsec3 = ptr->handler_data[3];
+ bfd_boolean multiple_sections_found;
+ asection *s0 = find_section (file, sec0, &multiple_sections_found), *s1;
+
+ if (multiple_sections_found)
+ {
+ walk_wild_section_general (ptr, file, callback, data);
+ return;
+ }
+
+ s1 = find_section (file, sec1, &multiple_sections_found);
+ if (multiple_sections_found)
+ {
+ walk_wild_section_general (ptr, file, callback, data);
+ return;
+ }
+
+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
+ {
+ if (s == s0)
+ walk_wild_consider_section (ptr, file, s, sec0, callback, data);
+ else
+ if (s == s1)
+ walk_wild_consider_section (ptr, file, s, sec1, callback, data);
+ else
+ {
+ const char *sname = bfd_get_section_name (file->the_bfd, s);
+ bfd_boolean skip = !match_simple_wild (wildsec2->spec.name,
+ sname);
+
+ if (!skip)
+ walk_wild_consider_section (ptr, file, s, wildsec2, callback,
+ data);
+ else
+ {
+ skip = !match_simple_wild (wildsec3->spec.name, sname);
+ if (!skip)
+ walk_wild_consider_section (ptr, file, s, wildsec3,
+ callback, data);
+ }
+ }
+ }
+}
+
+static void
+walk_wild_section (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ callback_t callback,
+ void *data)
+{
+ if (file->just_syms_flag)
+ return;
+
+ (*ptr->walk_wild_section_handler) (ptr, file, callback, data);
+}
+
+/* Returns TRUE when name1 is a wildcard spec that might match
+ something name2 can match. We're conservative: we return FALSE
+ only if the prefixes of name1 and name2 are different up to the
+ first wildcard character. */
+
+static bfd_boolean
+wild_spec_can_overlap (const char *name1, const char *name2)
+{
+ size_t prefix1_len = strcspn (name1, "?*[");
+ size_t prefix2_len = strcspn (name2, "?*[");
+ size_t min_prefix_len;
+
+ /* Note that if there is no wildcard character, then we treat the
+ terminating 0 as part of the prefix. Thus ".text" won't match
+ ".text." or ".text.*", for example. */
+ if (name1[prefix1_len] == '\0')
+ prefix1_len++;
+ if (name2[prefix2_len] == '\0')
+ prefix2_len++;
+
+ min_prefix_len = prefix1_len < prefix2_len ? prefix1_len : prefix2_len;
+
+ return memcmp (name1, name2, min_prefix_len) == 0;
+}
+
+/* Select specialized code to handle various kinds of wildcard
+ statements. */
+
+static void
+analyze_walk_wild_section_handler (lang_wild_statement_type *ptr)
+{
+ int sec_count = 0;
+ int wild_name_count = 0;
+ struct wildcard_list *sec;
+ int signature;
+ int data_counter;
+
+ ptr->walk_wild_section_handler = walk_wild_section_general;
+
+ /* Count how many wildcard_specs there are, and how many of those
+ actually use wildcards in the name. Also, bail out if any of the
+ wildcard names are NULL. (Can this actually happen?
+ walk_wild_section used to test for it.) And bail out if any
+ of the wildcards are more complex than a simple string
+ ending in a single '*'. */
+ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
+ {
+ ++sec_count;
+ if (sec->spec.name == NULL)
+ return;
+ if (wildcardp (sec->spec.name))
+ {
+ ++wild_name_count;
+ if (!is_simple_wild (sec->spec.name))
+ return;
+ }
+ }
+
+ /* The zero-spec case would be easy to optimize but it doesn't
+ happen in practice. Likewise, more than 4 specs doesn't
+ happen in practice. */
+ if (sec_count == 0 || sec_count > 4)
+ return;
+
+ /* Check that no two specs can match the same section. */
+ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
+ {
+ struct wildcard_list *sec2;
+ for (sec2 = sec->next; sec2 != NULL; sec2 = sec2->next)
+ {
+ if (wild_spec_can_overlap (sec->spec.name, sec2->spec.name))
+ return;
+ }
+ }
+
+ signature = (sec_count << 8) + wild_name_count;
+ switch (signature)
+ {
+ case 0x0100:
+ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild0;
+ break;
+ case 0x0101:
+ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild1;
+ break;
+ case 0x0201:
+ ptr->walk_wild_section_handler = walk_wild_section_specs2_wild1;
+ break;
+ case 0x0302:
+ ptr->walk_wild_section_handler = walk_wild_section_specs3_wild2;
+ break;
+ case 0x0402:
+ ptr->walk_wild_section_handler = walk_wild_section_specs4_wild2;
+ break;
+ default:
+ return;
+ }
+
+ /* Now fill the data array with pointers to the specs, first the
+ specs with non-wildcard names, then the specs with wildcard
+ names. It's OK to process the specs in different order from the
+ given order, because we've already determined that no section
+ will match more than one spec. */
+ data_counter = 0;
+ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
+ if (!wildcardp (sec->spec.name))
+ ptr->handler_data[data_counter++] = sec;
+ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
+ if (wildcardp (sec->spec.name))
+ ptr->handler_data[data_counter++] = sec;
+}
+
/* Handle a wild statement for a single file F. */
static void
@@ -295,13 +702,11 @@ lang_for_each_statement_worker (void (*func) (lang_statement_union_type *),
break;
case lang_output_section_statement_enum:
lang_for_each_statement_worker
- (func,
- s->output_section_statement.children.head);
+ (func, s->output_section_statement.children.head);
break;
case lang_wild_statement_enum:
- lang_for_each_statement_worker
- (func,
- s->wild_statement.children.head);
+ lang_for_each_statement_worker (func,
+ s->wild_statement.children.head);
break;
case lang_group_statement_enum:
lang_for_each_statement_worker (func,
@@ -379,6 +784,7 @@ new_afile (const char *name,
else
{
p = stat_alloc (sizeof (lang_input_statement_type));
+ p->header.type = lang_input_statement_enum;
p->header.next = NULL;
}
@@ -445,6 +851,7 @@ new_afile (const char *name,
p->next = NULL;
p->symbol_count = 0;
p->dynamic = config.dynamic_link;
+ p->add_needed = add_needed;
p->as_needed = as_needed;
p->whole_archive = whole_archive;
p->loaded = FALSE;
@@ -463,6 +870,82 @@ lang_add_input_file (const char *name,
return new_afile (name, file_type, target, TRUE);
}
+struct out_section_hash_entry
+{
+ struct bfd_hash_entry root;
+ lang_statement_union_type s;
+};
+
+/* The hash table. */
+
+static struct bfd_hash_table output_section_statement_table;
+
+/* Support routines for the hash table used by lang_output_section_find,
+ initialize the table, fill in an entry and remove the table. */
+
+static struct bfd_hash_entry *
+output_section_statement_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
+{
+ lang_output_section_statement_type **nextp;
+ struct out_section_hash_entry *ret;
+
+ if (entry == NULL)
+ {
+ entry = bfd_hash_allocate (table, sizeof (*ret));
+ if (entry == NULL)
+ return entry;
+ }
+
+ entry = bfd_hash_newfunc (entry, table, string);
+ if (entry == NULL)
+ return entry;
+
+ ret = (struct out_section_hash_entry *) entry;
+ memset (&ret->s, 0, sizeof (ret->s));
+ ret->s.header.type = lang_output_section_statement_enum;
+ ret->s.output_section_statement.subsection_alignment = -1;
+ ret->s.output_section_statement.section_alignment = -1;
+ ret->s.output_section_statement.block_value = 1;
+ lang_list_init (&ret->s.output_section_statement.children);
+ lang_statement_append (stat_ptr, &ret->s, &ret->s.header.next);
+
+ /* For every output section statement added to the list, except the
+ first one, lang_output_section_statement.tail points to the "next"
+ field of the last element of the list. */
+ if (lang_output_section_statement.head != NULL)
+ ret->s.output_section_statement.prev
+ = ((lang_output_section_statement_type *)
+ ((char *) lang_output_section_statement.tail
+ - offsetof (lang_output_section_statement_type, next)));
+
+ /* GCC's strict aliasing rules prevent us from just casting the
+ address, so we store the pointer in a variable and cast that
+ instead. */
+ nextp = &ret->s.output_section_statement.next;
+ lang_statement_append (&lang_output_section_statement,
+ &ret->s,
+ (lang_statement_union_type **) nextp);
+ return &ret->root;
+}
+
+static void
+output_section_statement_table_init (void)
+{
+ if (!bfd_hash_table_init_n (&output_section_statement_table,
+ output_section_statement_newfunc,
+ sizeof (struct out_section_hash_entry),
+ 61))
+ einfo (_("%P%F: can not create hash table: %E\n"));
+}
+
+static void
+output_section_statement_table_free (void)
+{
+ bfd_hash_table_free (&output_section_statement_table);
+}
+
/* Build enough state so that the parser can build its tree. */
void
@@ -472,6 +955,8 @@ lang_init (void)
stat_ptr = &statement_list;
+ output_section_statement_table_init ();
+
lang_list_init (stat_ptr);
lang_list_init (&input_file_chain);
@@ -490,12 +975,17 @@ lang_init (void)
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"));
+ if (!bfd_hash_table_init_n (&lang_definedness_table,
+ lang_definedness_newfunc,
+ sizeof (struct lang_definedness_hash_entry),
+ 3))
+ einfo (_("%P%F: can not create hash table: %E\n"));
+}
- /* Callers of exp_fold_tree need to increment this. */
- lang_statement_iteration = 0;
+void
+lang_finish (void)
+{
+ output_section_statement_table_free ();
}
/*----------------------------------------------------------------------
@@ -515,7 +1005,8 @@ lang_init (void)
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;
+static lang_memory_region_type **lang_memory_region_list_tail
+ = &lang_memory_region_list;
lang_memory_region_type *
lang_memory_region_lookup (const char *const name, bfd_boolean create)
@@ -531,24 +1022,11 @@ lang_memory_region_lookup (const char *const name, bfd_boolean create)
if (strcmp (p->name, name) == 0)
{
if (create)
- einfo (_("%P:%S: warning: redeclaration of memory region '%s'\n"), name);
+ 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
- default region. I changed it to instead use a region
- encompassing all of memory as the default region. This permits
- 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_MEMORY_REGION) == 0)
- {
- if (lang_memory_region_list != NULL)
- return lang_memory_region_list;
- }
-#endif
-
if (!create && strcmp (name, DEFAULT_MEMORY_REGION))
einfo (_("%P:%S: warning: memory region %s not declared\n"), name);
@@ -594,53 +1072,510 @@ lang_memory_default (asection *section)
lang_output_section_statement_type *
lang_output_section_find (const char *const name)
{
- lang_statement_union_type *u;
- lang_output_section_statement_type *lookup;
+ struct out_section_hash_entry *entry;
+ unsigned long hash;
+
+ entry = ((struct out_section_hash_entry *)
+ bfd_hash_lookup (&output_section_statement_table, name,
+ FALSE, FALSE));
+ if (entry == NULL)
+ return NULL;
- for (u = lang_output_section_statement.head; u != NULL; u = lookup->next)
+ hash = entry->root.hash;
+ do
{
- lookup = &u->output_section_statement;
- if (strcmp (name, lookup->name) == 0)
- return lookup;
+ if (entry->s.output_section_statement.constraint != -1)
+ return &entry->s.output_section_statement;
+ entry = (struct out_section_hash_entry *) entry->root.next;
}
+ while (entry != NULL
+ && entry->root.hash == hash
+ && strcmp (name, entry->s.output_section_statement.name) == 0);
+
return NULL;
}
+static lang_output_section_statement_type *
+lang_output_section_statement_lookup_1 (const char *const name, int constraint)
+{
+ struct out_section_hash_entry *entry;
+ struct out_section_hash_entry *last_ent;
+ unsigned long hash;
+
+ entry = ((struct out_section_hash_entry *)
+ bfd_hash_lookup (&output_section_statement_table, name,
+ TRUE, FALSE));
+ if (entry == NULL)
+ {
+ einfo (_("%P%F: failed creating section `%s': %E\n"), name);
+ return NULL;
+ }
+
+ if (entry->s.output_section_statement.name != NULL)
+ {
+ /* We have a section of this name, but it might not have the correct
+ constraint. */
+ hash = entry->root.hash;
+ do
+ {
+ if (entry->s.output_section_statement.constraint != -1
+ && (constraint == 0
+ || (constraint == entry->s.output_section_statement.constraint
+ && constraint != SPECIAL)))
+ return &entry->s.output_section_statement;
+ last_ent = entry;
+ entry = (struct out_section_hash_entry *) entry->root.next;
+ }
+ while (entry != NULL
+ && entry->root.hash == hash
+ && strcmp (name, entry->s.output_section_statement.name) == 0);
+
+ entry
+ = ((struct out_section_hash_entry *)
+ output_section_statement_newfunc (NULL,
+ &output_section_statement_table,
+ name));
+ if (entry == NULL)
+ {
+ einfo (_("%P%F: failed creating section `%s': %E\n"), name);
+ return NULL;
+ }
+ entry->root = last_ent->root;
+ last_ent->root.next = &entry->root;
+ }
+
+ entry->s.output_section_statement.name = name;
+ entry->s.output_section_statement.constraint = constraint;
+ return &entry->s.output_section_statement;
+}
+
lang_output_section_statement_type *
lang_output_section_statement_lookup (const char *const name)
{
+ return lang_output_section_statement_lookup_1 (name, 0);
+}
+
+/* A variant of lang_output_section_find used by place_orphan.
+ Returns the output statement that should precede a new output
+ statement for SEC. If an exact match is found on certain flags,
+ sets *EXACT too. */
+
+lang_output_section_statement_type *
+lang_output_section_find_by_flags (const asection *sec,
+ lang_output_section_statement_type **exact,
+ lang_match_sec_type_func match_type)
+{
+ lang_output_section_statement_type *first, *look, *found;
+ flagword flags;
+
+ /* We know the first statement on this list is *ABS*. May as well
+ skip it. */
+ first = &lang_output_section_statement.head->output_section_statement;
+ first = first->next;
+
+ /* First try for an exact match. */
+ found = NULL;
+ for (look = first; look; look = look->next)
+ {
+ flags = look->flags;
+ if (look->bfd_section != NULL)
+ {
+ flags = look->bfd_section->flags;
+ if (match_type && !match_type (output_bfd, look->bfd_section,
+ sec->owner, sec))
+ continue;
+ }
+ flags ^= sec->flags;
+ if (!(flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY
+ | SEC_CODE | SEC_SMALL_DATA | SEC_THREAD_LOCAL)))
+ found = look;
+ }
+ if (found != NULL)
+ {
+ if (exact != NULL)
+ *exact = found;
+ return found;
+ }
+
+ if (sec->flags & SEC_CODE)
+ {
+ /* Try for a rw code section. */
+ for (look = first; look; look = look->next)
+ {
+ flags = look->flags;
+ if (look->bfd_section != NULL)
+ {
+ flags = look->bfd_section->flags;
+ if (match_type && !match_type (output_bfd, look->bfd_section,
+ sec->owner, sec))
+ continue;
+ }
+ flags ^= sec->flags;
+ if (!(flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD
+ | SEC_CODE | SEC_SMALL_DATA | SEC_THREAD_LOCAL)))
+ found = look;
+ }
+ }
+ else if (sec->flags & (SEC_READONLY | SEC_THREAD_LOCAL))
+ {
+ /* .rodata can go after .text, .sdata2 after .rodata. */
+ for (look = first; look; look = look->next)
+ {
+ flags = look->flags;
+ if (look->bfd_section != NULL)
+ {
+ flags = look->bfd_section->flags;
+ if (match_type && !match_type (output_bfd, look->bfd_section,
+ sec->owner, sec))
+ continue;
+ }
+ flags ^= sec->flags;
+ if (!(flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD
+ | SEC_READONLY))
+ && !(look->flags & (SEC_SMALL_DATA | SEC_THREAD_LOCAL)))
+ found = look;
+ }
+ }
+ else if (sec->flags & SEC_SMALL_DATA)
+ {
+ /* .sdata goes after .data, .sbss after .sdata. */
+ for (look = first; look; look = look->next)
+ {
+ flags = look->flags;
+ if (look->bfd_section != NULL)
+ {
+ flags = look->bfd_section->flags;
+ if (match_type && !match_type (output_bfd, look->bfd_section,
+ sec->owner, sec))
+ continue;
+ }
+ flags ^= sec->flags;
+ if (!(flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD
+ | SEC_THREAD_LOCAL))
+ || ((look->flags & SEC_SMALL_DATA)
+ && !(sec->flags & SEC_HAS_CONTENTS)))
+ found = look;
+ }
+ }
+ else if (sec->flags & SEC_HAS_CONTENTS)
+ {
+ /* .data goes after .rodata. */
+ for (look = first; look; look = look->next)
+ {
+ flags = look->flags;
+ if (look->bfd_section != NULL)
+ {
+ flags = look->bfd_section->flags;
+ if (match_type && !match_type (output_bfd, look->bfd_section,
+ sec->owner, sec))
+ continue;
+ }
+ flags ^= sec->flags;
+ if (!(flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD
+ | SEC_SMALL_DATA | SEC_THREAD_LOCAL)))
+ found = look;
+ }
+ }
+ else
+ {
+ /* .bss goes last. */
+ for (look = first; look; look = look->next)
+ {
+ flags = look->flags;
+ if (look->bfd_section != NULL)
+ {
+ flags = look->bfd_section->flags;
+ if (match_type && !match_type (output_bfd, look->bfd_section,
+ sec->owner, sec))
+ continue;
+ }
+ flags ^= sec->flags;
+ if (!(flags & SEC_ALLOC))
+ found = look;
+ }
+ }
+
+ if (found || !match_type)
+ return found;
+
+ return lang_output_section_find_by_flags (sec, NULL, NULL);
+}
+
+/* Find the last output section before given output statement.
+ Used by place_orphan. */
+
+static asection *
+output_prev_sec_find (lang_output_section_statement_type *os)
+{
lang_output_section_statement_type *lookup;
- lookup = lang_output_section_find (name);
- if (lookup == NULL)
+ for (lookup = os->prev; lookup != NULL; lookup = lookup->prev)
{
- 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;
+ if (lookup->constraint == -1)
+ continue;
- lookup->next = NULL;
- lookup->bfd_section = NULL;
- lookup->processed = 0;
- lookup->sectype = normal_section;
- lookup->addr_tree = NULL;
- lang_list_init (&lookup->children);
+ if (lookup->bfd_section != NULL && lookup->bfd_section->owner != NULL)
+ return lookup->bfd_section;
+ }
- lookup->memspec = NULL;
- lookup->flags = 0;
- lookup->subsection_alignment = -1;
- lookup->section_alignment = -1;
- lookup->load_base = NULL;
- lookup->update_dot_tree = NULL;
- lookup->phdrs = NULL;
+ return NULL;
+}
- lang_statement_append (&lang_output_section_statement,
- (lang_statement_union_type *) lookup,
- &lookup->next);
+lang_output_section_statement_type *
+lang_insert_orphan (asection *s,
+ const char *secname,
+ lang_output_section_statement_type *after,
+ struct orphan_save *place,
+ etree_type *address,
+ lang_statement_list_type *add_child)
+{
+ lang_statement_list_type *old;
+ lang_statement_list_type add;
+ const char *ps;
+ etree_type *load_base;
+ lang_output_section_statement_type *os;
+ lang_output_section_statement_type **os_tail;
+
+ /* Start building a list of statements for this section.
+ First save the current statement pointer. */
+ old = stat_ptr;
+
+ /* If we have found an appropriate place for the output section
+ statements for this orphan, add them to our own private list,
+ inserting them later into the global statement list. */
+ if (after != NULL)
+ {
+ stat_ptr = &add;
+ lang_list_init (stat_ptr);
}
- return lookup;
+
+ ps = NULL;
+ if (config.build_constructors)
+ {
+ /* 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 = secname; *ps != '\0'; ps++)
+ if (! ISALNUM ((unsigned char) *ps) && *ps != '_')
+ break;
+ if (*ps == '\0')
+ {
+ char *symname;
+ etree_type *e_align;
+
+ symname = (char *) xmalloc (ps - secname + sizeof "__start_" + 1);
+ symname[0] = bfd_get_symbol_leading_char (output_bfd);
+ sprintf (symname + (symname[0] != 0), "__start_%s", secname);
+ e_align = exp_unop (ALIGN_K,
+ exp_intop ((bfd_vma) 1 << s->alignment_power));
+ lang_add_assignment (exp_assop ('=', ".", e_align));
+ lang_add_assignment (exp_assop ('=', symname,
+ exp_nameop (NAME, ".")));
+ }
+ }
+
+ if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
+ address = exp_intop (0);
+
+ load_base = NULL;
+ if (after != NULL && after->load_base != NULL)
+ {
+ etree_type *lma_from_vma;
+ lma_from_vma = exp_binop ('-', after->load_base,
+ exp_nameop (ADDR, after->name));
+ load_base = exp_binop ('+', lma_from_vma,
+ exp_nameop (ADDR, secname));
+ }
+
+ os_tail = ((lang_output_section_statement_type **)
+ lang_output_section_statement.tail);
+ os = lang_enter_output_section_statement (secname, address, 0, NULL, NULL,
+ load_base, 0);
+
+ if (add_child == NULL)
+ add_child = &os->children;
+ lang_add_section (add_child, s, os);
+
+ lang_leave_output_section_statement (0, "*default*", NULL, NULL);
+
+ if (config.build_constructors && *ps == '\0')
+ {
+ char *symname;
+
+ /* lang_leave_ouput_section_statement resets stat_ptr.
+ Put stat_ptr back where we want it. */
+ if (after != NULL)
+ stat_ptr = &add;
+
+ symname = (char *) xmalloc (ps - secname + sizeof "__stop_" + 1);
+ symname[0] = bfd_get_symbol_leading_char (output_bfd);
+ sprintf (symname + (symname[0] != 0), "__stop_%s", secname);
+ lang_add_assignment (exp_assop ('=', symname,
+ exp_nameop (NAME, ".")));
+ }
+
+ /* Restore the global list pointer. */
+ if (after != NULL)
+ stat_ptr = old;
+
+ if (after != NULL && os->bfd_section != NULL)
+ {
+ asection *snew, *as;
+
+ snew = os->bfd_section;
+
+ /* Shuffle the bfd section list to make the output file look
+ neater. This is really only cosmetic. */
+ if (place->section == NULL
+ && after != (&lang_output_section_statement.head
+ ->output_section_statement))
+ {
+ asection *bfd_section = after->bfd_section;
+
+ /* If the output statement hasn't been used to place any input
+ sections (and thus doesn't have an output bfd_section),
+ look for the closest prior output statement having an
+ output section. */
+ if (bfd_section == NULL)
+ bfd_section = output_prev_sec_find (after);
+
+ if (bfd_section != NULL && bfd_section != snew)
+ place->section = &bfd_section->next;
+ }
+
+ if (place->section == NULL)
+ place->section = &output_bfd->sections;
+
+ as = *place->section;
+ if (as != snew && as->prev != snew)
+ {
+ /* Unlink the section. */
+ bfd_section_list_remove (output_bfd, snew);
+
+ /* Now tack it back on in the right place. */
+ bfd_section_list_insert_before (output_bfd, as, snew);
+ }
+
+ /* Save the end of this list. Further ophans of this type will
+ follow the one we've just added. */
+ place->section = &snew->next;
+
+ /* The following is non-cosmetic. We try to put the output
+ statements in some sort of reasonable order here, because they
+ determine the final load addresses of the orphan sections.
+ In addition, placing output statements in the wrong order may
+ require extra segments. For instance, given a typical
+ situation of all read-only sections placed in one segment and
+ following that a segment containing all the read-write
+ sections, we wouldn't want to place an orphan read/write
+ section before or amongst the read-only ones. */
+ if (add.head != NULL)
+ {
+ lang_output_section_statement_type *newly_added_os;
+
+ if (place->stmt == NULL)
+ {
+ lang_statement_union_type **where;
+ lang_statement_union_type **assign = NULL;
+ bfd_boolean ignore_first;
+
+ /* Look for a suitable place for the new statement list.
+ The idea is to skip over anything that might be inside
+ a SECTIONS {} statement in a script, before we find
+ another output_section_statement. Assignments to "dot"
+ before an output section statement are assumed to
+ belong to it. An exception to this rule is made for
+ the first assignment to dot, otherwise we might put an
+ orphan before . = . + SIZEOF_HEADERS or similar
+ assignments that set the initial address. */
+
+ ignore_first = after == (&lang_output_section_statement.head
+ ->output_section_statement);
+ for (where = &after->header.next;
+ *where != NULL;
+ where = &(*where)->header.next)
+ {
+ switch ((*where)->header.type)
+ {
+ case lang_assignment_statement_enum:
+ if (assign == NULL)
+ {
+ lang_assignment_statement_type *ass;
+ ass = &(*where)->assignment_statement;
+ if (ass->exp->type.node_class != etree_assert
+ && ass->exp->assign.dst[0] == '.'
+ && ass->exp->assign.dst[1] == 0
+ && !ignore_first)
+ assign = where;
+ }
+ ignore_first = FALSE;
+ continue;
+ case lang_wild_statement_enum:
+ case lang_input_section_enum:
+ case lang_object_symbols_statement_enum:
+ case lang_fill_statement_enum:
+ case lang_data_statement_enum:
+ case lang_reloc_statement_enum:
+ case lang_padding_statement_enum:
+ case lang_constructors_statement_enum:
+ assign = NULL;
+ continue;
+ case lang_output_section_statement_enum:
+ if (assign != NULL)
+ where = assign;
+ case lang_input_statement_enum:
+ case lang_address_statement_enum:
+ case lang_target_statement_enum:
+ case lang_output_statement_enum:
+ case lang_group_statement_enum:
+ case lang_afile_asection_pair_statement_enum:
+ break;
+ }
+ break;
+ }
+
+ *add.tail = *where;
+ *where = add.head;
+
+ place->os_tail = &after->next;
+ }
+ else
+ {
+ /* Put it after the last orphan statement we added. */
+ *add.tail = *place->stmt;
+ *place->stmt = add.head;
+ }
+
+ /* Fix the global list pointer if we happened to tack our
+ new list at the tail. */
+ if (*old->tail == add.head)
+ old->tail = add.tail;
+
+ /* 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->prev = (lang_output_section_statement_type *)
+ ((char *) place->os_tail
+ - offsetof (lang_output_section_statement_type, next));
+ newly_added_os->next = *place->os_tail;
+ if (newly_added_os->next != NULL)
+ newly_added_os->next->prev = newly_added_os;
+ *place->os_tail = newly_added_os;
+ place->os_tail = &newly_added_os->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
+ = (lang_statement_union_type **) os_tail;
+ }
+ }
+ return os;
}
static void
@@ -666,6 +1601,30 @@ void
lang_map (void)
{
lang_memory_region_type *m;
+ bfd_boolean dis_header_printed = FALSE;
+ bfd *p;
+
+ LANG_FOR_EACH_INPUT_STATEMENT (file)
+ {
+ asection *s;
+
+ if ((file->the_bfd->flags & (BFD_LINKER_CREATED | DYNAMIC)) != 0
+ || file->just_syms_flag)
+ continue;
+
+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
+ if (s->output_section == NULL
+ || s->output_section->owner != output_bfd)
+ {
+ if (! dis_header_printed)
+ {
+ fprintf (config.map_file, _("\nDiscarded input sections\n\n"));
+ dis_header_printed = TRUE;
+ }
+
+ print_input_section (s);
+ }
+ }
minfo (_("\nMemory Configuration\n\n"));
fprintf (config.map_file, "%-16s %-18s %-18s %s\n",
@@ -711,24 +1670,72 @@ lang_map (void)
fprintf (config.map_file, _("\nLinker script and memory map\n\n"));
+ if (! command_line.reduce_memory_overheads)
+ {
+ obstack_begin (&map_obstack, 1000);
+ for (p = link_info.input_bfds; p != (bfd *) NULL; p = p->link_next)
+ bfd_map_over_sections (p, init_map_userdata, 0);
+ bfd_link_hash_traverse (link_info.hash, sort_def_symbol, 0);
+ }
print_statements ();
}
+static void
+init_map_userdata (abfd, sec, data)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *sec;
+ void *data ATTRIBUTE_UNUSED;
+{
+ fat_section_userdata_type *new_data
+ = ((fat_section_userdata_type *) (stat_alloc
+ (sizeof (fat_section_userdata_type))));
+
+ ASSERT (get_userdata (sec) == NULL);
+ get_userdata (sec) = new_data;
+ new_data->map_symbol_def_tail = &new_data->map_symbol_def_head;
+}
+
+static bfd_boolean
+sort_def_symbol (hash_entry, info)
+ struct bfd_link_hash_entry *hash_entry;
+ void *info ATTRIBUTE_UNUSED;
+{
+ if (hash_entry->type == bfd_link_hash_defined
+ || hash_entry->type == bfd_link_hash_defweak)
+ {
+ struct fat_user_section_struct *ud;
+ struct map_symbol_def *def;
+
+ ud = get_userdata (hash_entry->u.def.section);
+ if (! ud)
+ {
+ /* ??? What do we have to do to initialize this beforehand? */
+ /* The first time we get here is bfd_abs_section... */
+ init_map_userdata (0, hash_entry->u.def.section, 0);
+ ud = get_userdata (hash_entry->u.def.section);
+ }
+ else if (!ud->map_symbol_def_tail)
+ ud->map_symbol_def_tail = &ud->map_symbol_def_head;
+
+ def = obstack_alloc (&map_obstack, sizeof *def);
+ def->entry = hash_entry;
+ *(ud->map_symbol_def_tail) = def;
+ ud->map_symbol_def_tail = &def->next;
+ }
+ return TRUE;
+}
+
/* Initialize an output section. */
static void
-init_os (lang_output_section_statement_type *s)
+init_os (lang_output_section_statement_type *s, asection *isec)
{
- section_userdata_type *new;
-
if (s->bfd_section != NULL)
return;
if (strcmp (s->name, DISCARD_SECTION_NAME) == 0)
einfo (_("%P%F: Illegal use of `%s' section\n"), DISCARD_SECTION_NAME);
- new = stat_alloc (sizeof (section_userdata_type));
-
s->bfd_section = bfd_get_section_by_name (output_bfd, s->name);
if (s->bfd_section == NULL)
s->bfd_section = bfd_make_section (output_bfd, s->name);
@@ -738,11 +1745,15 @@ init_os (lang_output_section_statement_type *s)
output_bfd->xvec->name, s->name);
}
s->bfd_section->output_section = s->bfd_section;
-
- /* 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) = new;
+ if (!command_line.reduce_memory_overheads)
+ {
+ fat_section_userdata_type *new
+ = stat_alloc (sizeof (fat_section_userdata_type));
+ memset (new, 0, sizeof (fat_section_userdata_type));
+ get_userdata (s->bfd_section) = new;
+ }
+
/* If there is a base address, make sure that any sections it might
mention are initialized. */
@@ -751,6 +1762,15 @@ init_os (lang_output_section_statement_type *s)
if (s->load_base != NULL)
exp_init_os (s->load_base);
+
+ /* If supplied an alignment, set it. */
+ if (s->section_alignment != -1)
+ s->bfd_section->alignment_power = s->section_alignment;
+
+ if (isec)
+ bfd_init_private_section_data (isec->owner, isec,
+ output_bfd, s->bfd_section,
+ &link_info);
}
/* Make sure that all output sections mentioned in an expression are
@@ -762,6 +1782,7 @@ exp_init_os (etree_type *exp)
switch (exp->type.node_class)
{
case etree_assign:
+ case etree_provide:
exp_init_os (exp->assign.src);
break;
@@ -779,7 +1800,7 @@ exp_init_os (etree_type *exp)
case etree_assert:
exp_init_os (exp->assert_s.child);
break;
-
+
case etree_unary:
exp_init_os (exp->unary.child);
break;
@@ -795,7 +1816,7 @@ exp_init_os (etree_type *exp)
os = lang_output_section_find (exp->name.name);
if (os != NULL && os->bfd_section == NULL)
- init_os (os);
+ init_os (os, NULL);
}
}
break;
@@ -805,175 +1826,21 @@ exp_init_os (etree_type *exp)
}
}
-/* Sections marked with the SEC_LINK_ONCE flag should only be linked
- once into the output. This routine checks each section, and
- arrange to discard it if a section of the same name has already
- been linked. If the section has COMDAT information, then it uses
- that to decide whether the section should be included. This code
- assumes that all relevant sections have the SEC_LINK_ONCE flag set;
- that is, it does not depend solely upon the section name.
- section_already_linked is called via bfd_map_over_sections. */
-
-/* This is the shape of the elements inside the already_linked hash
- table. It maps a name onto a list of already_linked elements with
- the same name. It's possible to get more than one element in a
- list if the COMDAT sections have different names. */
-
-struct already_linked_hash_entry
-{
- struct bfd_hash_entry root;
- struct already_linked *entry;
-};
-
-struct already_linked
-{
- struct already_linked *next;
- asection *sec;
-};
-
-/* The hash table. */
-
-static struct bfd_hash_table already_linked_table;
-
static void
section_already_linked (bfd *abfd, asection *sec, void *data)
{
lang_input_statement_type *entry = data;
- flagword flags;
- const char *name;
- struct already_linked *l;
- struct already_linked_hash_entry *already_linked_list;
/* If we are only reading symbols from this object, then we want to
discard all sections. */
if (entry->just_syms_flag)
{
- bfd_link_just_syms (sec, &link_info);
+ bfd_link_just_syms (abfd, sec, &link_info);
return;
}
- flags = bfd_get_section_flags (abfd, sec);
-
- if ((flags & SEC_LINK_ONCE) == 0)
- return;
-
- /* FIXME: When doing a relocatable link, we may have trouble
- copying relocations in other sections that refer to local symbols
- in the section being discarded. Those relocations will have to
- be converted somehow; as of this writing I'm not sure that any of
- the backends handle that correctly.
-
- It is tempting to instead not discard link once sections when
- doing a relocatable link (technically, they should be discarded
- whenever we are building constructors). However, that fails,
- because the linker winds up combining all the link once sections
- into a single large link once section, which defeats the purpose
- of having link once sections in the first place.
-
- Also, not merging link once sections in a relocatable link
- causes trouble for MIPS ELF, which relies on link once semantics
- to handle the .reginfo section correctly. */
-
- name = bfd_get_section_name (abfd, sec);
-
- already_linked_list =
- ((struct already_linked_hash_entry *)
- bfd_hash_lookup (&already_linked_table, name, TRUE, FALSE));
-
- for (l = already_linked_list->entry; l != NULL; l = l->next)
- {
- if (sec->comdat == NULL
- || l->sec->comdat == NULL
- || strcmp (sec->comdat->name, l->sec->comdat->name) == 0)
- {
- /* The section has already been linked. See if we should
- issue a warning. */
- switch (flags & SEC_LINK_DUPLICATES)
- {
- default:
- abort ();
-
- case SEC_LINK_DUPLICATES_DISCARD:
- break;
-
- case SEC_LINK_DUPLICATES_ONE_ONLY:
- if (sec->comdat == NULL)
- einfo (_("%P: %B: warning: ignoring duplicate section `%s'\n"),
- abfd, name);
- else
- einfo (_("%P: %B: warning: ignoring duplicate `%s' section symbol `%s'\n"),
- abfd, name, sec->comdat->name);
- break;
-
- case SEC_LINK_DUPLICATES_SAME_CONTENTS:
- /* FIXME: We should really dig out the contents of both
- sections and memcmp them. The COFF/PE spec says that
- the Microsoft linker does not implement this
- correctly, so I'm not going to bother doing it
- either. */
- /* Fall through. */
- case SEC_LINK_DUPLICATES_SAME_SIZE:
- if (bfd_section_size (abfd, sec)
- != bfd_section_size (l->sec->owner, l->sec))
- einfo (_("%P: %B: warning: duplicate section `%s' has different size\n"),
- abfd, name);
- break;
- }
-
- /* Set the output_section field so that lang_add_section
- does not create a lang_input_section structure for this
- 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);
-
- return;
- }
- }
-
- /* 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 = bfd_hash_allocate (&already_linked_table, sizeof *l);
-
- l->sec = sec;
- l->next = already_linked_list->entry;
- already_linked_list->entry = l;
-}
-
-/* Support routines for the hash table used by section_already_linked,
- initialize the table, fill in an entry and remove the table. */
-
-static struct bfd_hash_entry *
-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 &ret->root;
-}
-
-static void
-already_linked_table_init (void)
-{
- if (! bfd_hash_table_init_n (&already_linked_table,
- already_linked_newfunc,
- 42))
- einfo (_("%P%F: Failed to create hash table\n"));
-}
-
-static void
-already_linked_table_free (void)
-{
- bfd_hash_table_free (&already_linked_table);
+ if (!(abfd->flags & DYNAMIC))
+ bfd_section_already_linked (abfd, sec);
}
/* The wild routines.
@@ -982,25 +1849,6 @@ already_linked_table_free (void)
explicit actions, like foo.o(.text), bar.o(.text) and
foo.o(.text, .data). */
-/* 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 bfd_boolean
-wildcardp (const char *pattern)
-{
- const char *s;
-
- for (s = pattern; *s != '\0'; ++s)
- if (*s == '?'
- || *s == '*'
- || *s == '[')
- return TRUE;
- return FALSE;
-}
-
/* Add SECTION to the output section OUTPUT. Do this by creating a
lang_input_section statement which is placed at PTR. FILE is the
input file which holds SECTION. */
@@ -1008,22 +1856,13 @@ wildcardp (const char *pattern)
void
lang_add_section (lang_statement_list_type *ptr,
asection *section,
- lang_output_section_statement_type *output,
- lang_input_statement_type *file)
+ lang_output_section_statement_type *output)
{
- flagword flags;
+ flagword flags = section->flags;
bfd_boolean discard;
- flags = bfd_get_section_flags (section->owner, section);
-
- discard = FALSE;
-
- /* 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 sections marked with SEC_EXCLUDE. */
+ discard = (flags & SEC_EXCLUDE) != 0;
/* Discard input sections which are assigned to a section named
DISCARD_SECTION_NAME. */
@@ -1053,16 +1892,28 @@ lang_add_section (lang_statement_list_type *ptr,
flagword flags;
if (output->bfd_section == NULL)
- init_os (output);
+ init_os (output, section);
first = ! output->bfd_section->linker_has_input;
output->bfd_section->linker_has_input = 1;
+ if (!link_info.relocatable
+ && !stripped_excluded_sections)
+ {
+ asection *s = output->bfd_section->map_tail.s;
+ output->bfd_section->map_tail.s = section;
+ section->map_head.s = NULL;
+ section->map_tail.s = s;
+ if (s != NULL)
+ s->map_head.s = section;
+ else
+ output->bfd_section->map_head.s = section;
+ }
+
/* Add a section reference to the list. */
new = new_stat (lang_input_section, ptr);
new->section = section;
- new->ifile = file;
section->output_section = output->bfd_section;
flags = section->flags;
@@ -1085,32 +1936,32 @@ lang_add_section (lang_statement_list_type *ptr,
flags &= ~ (SEC_LINK_ONCE | SEC_LINK_DUPLICATES);
/* If this is not the first input section, and the SEC_READONLY
- flag is not currently set, then don't set it just because the
- input section has it set. */
+ flag is not currently set, then don't set it just because the
+ input section has it set. */
- if (! first && (section->output_section->flags & SEC_READONLY) == 0)
+ if (! first && (output->bfd_section->flags & SEC_READONLY) == 0)
flags &= ~ SEC_READONLY;
/* Keep SEC_MERGE and SEC_STRINGS only if they are the same. */
if (! first
- && ((section->output_section->flags & (SEC_MERGE | SEC_STRINGS))
+ && ((output->bfd_section->flags & (SEC_MERGE | SEC_STRINGS))
!= (flags & (SEC_MERGE | SEC_STRINGS))
|| ((flags & SEC_MERGE)
- && section->output_section->entsize != section->entsize)))
+ && output->bfd_section->entsize != section->entsize)))
{
- section->output_section->flags &= ~ (SEC_MERGE | SEC_STRINGS);
+ output->bfd_section->flags &= ~ (SEC_MERGE | SEC_STRINGS);
flags &= ~ (SEC_MERGE | SEC_STRINGS);
}
- section->output_section->flags |= flags;
+ output->bfd_section->flags |= flags;
if (flags & SEC_MERGE)
- section->output_section->entsize = section->entsize;
+ output->bfd_section->entsize = section->entsize;
/* If SEC_READONLY is not set in the input section, then clear
- it from the output section. */
+ it from the output section. */
if ((section->flags & SEC_READONLY) == 0)
- section->output_section->flags &= ~SEC_READONLY;
+ output->bfd_section->flags &= ~SEC_READONLY;
switch (output->sectype)
{
@@ -1130,24 +1981,61 @@ lang_add_section (lang_statement_list_type *ptr,
/* Copy over SEC_SMALL_DATA. */
if (section->flags & SEC_SMALL_DATA)
- section->output_section->flags |= SEC_SMALL_DATA;
+ output->bfd_section->flags |= SEC_SMALL_DATA;
if (section->alignment_power > output->bfd_section->alignment_power)
output->bfd_section->alignment_power = section->alignment_power;
- /* If supplied an alignment, then force it. */
- if (output->section_alignment != -1)
- output->bfd_section->alignment_power = output->section_alignment;
-
- if (section->flags & SEC_BLOCK)
+ if (bfd_get_arch (section->owner) == bfd_arch_tic54x
+ && (section->flags & SEC_TIC54X_BLOCK) != 0)
{
- section->output_section->flags |= SEC_BLOCK;
+ output->bfd_section->flags |= SEC_TIC54X_BLOCK;
/* FIXME: This value should really be obtained from the bfd... */
output->block_value = 128;
}
}
}
+/* Compare sections ASEC and BSEC according to SORT. */
+
+static int
+compare_section (sort_type sort, asection *asec, asection *bsec)
+{
+ int ret;
+
+ switch (sort)
+ {
+ default:
+ abort ();
+
+ case by_alignment_name:
+ ret = (bfd_section_alignment (bsec->owner, bsec)
+ - bfd_section_alignment (asec->owner, asec));
+ if (ret)
+ break;
+ /* Fall through. */
+
+ case by_name:
+ ret = strcmp (bfd_get_section_name (asec->owner, asec),
+ bfd_get_section_name (bsec->owner, bsec));
+ break;
+
+ case by_name_alignment:
+ ret = strcmp (bfd_get_section_name (asec->owner, asec),
+ bfd_get_section_name (bsec->owner, bsec));
+ if (ret)
+ break;
+ /* Fall through. */
+
+ case by_alignment:
+ ret = (bfd_section_alignment (bsec->owner, bsec)
+ - bfd_section_alignment (asec->owner, asec));
+ break;
+ }
+
+ return ret;
+}
+
/* Handle wildcard sorting. This returns the lang_input_section which
should follow the one we are going to create for SECTION and FILE,
based on the sorting requirements of WILD. It returns NULL if the
@@ -1162,7 +2050,8 @@ wild_sort (lang_wild_statement_type *wild,
const char *section_name;
lang_statement_union_type *l;
- if (!wild->filenames_sorted && (sec == NULL || !sec->spec.sorted))
+ if (!wild->filenames_sorted
+ && (sec == NULL || sec->spec.sorted == none))
return NULL;
section_name = bfd_get_section_name (file->the_bfd, section);
@@ -1175,7 +2064,7 @@ wild_sort (lang_wild_statement_type *wild,
ls = &l->input_section;
/* Sorting by filename takes precedence over sorting by section
- name. */
+ name. */
if (wild->filenames_sorted)
{
@@ -1184,9 +2073,9 @@ wild_sort (lang_wild_statement_type *wild,
int i;
/* The PE support for the .idata section as generated by
- dlltool assumes that files will be sorted by the name of
- the archive and then the name of the file within the
- archive. */
+ dlltool assumes that files will be sorted by the name of
+ the archive and then the name of the file within the
+ archive. */
if (file->the_bfd != NULL
&& bfd_my_archive (file->the_bfd) != NULL)
@@ -1200,15 +2089,14 @@ wild_sort (lang_wild_statement_type *wild,
fa = FALSE;
}
- if (ls->ifile->the_bfd != NULL
- && bfd_my_archive (ls->ifile->the_bfd) != NULL)
+ if (bfd_my_archive (ls->section->owner) != NULL)
{
- ln = bfd_get_filename (bfd_my_archive (ls->ifile->the_bfd));
+ ln = bfd_get_filename (bfd_my_archive (ls->section->owner));
la = TRUE;
}
else
{
- ln = ls->ifile->filename;
+ ln = ls->section->owner->filename;
la = FALSE;
}
@@ -1223,7 +2111,7 @@ wild_sort (lang_wild_statement_type *wild,
if (fa)
fn = file->filename;
if (la)
- ln = ls->ifile->filename;
+ ln = ls->section->owner->filename;
i = strcmp (fn, ln);
if (i > 0)
@@ -1234,16 +2122,11 @@ wild_sort (lang_wild_statement_type *wild,
}
/* Here either the files are not sorted by name, or we are
- looking at the sections for this file. */
+ looking at the sections for this file. */
- if (sec != NULL && sec->spec.sorted)
- {
- if (strcmp (section_name,
- bfd_get_section_name (ls->ifile->the_bfd,
- ls->section))
- < 0)
- break;
- }
+ if (sec != NULL && sec->spec.sorted != none)
+ if (compare_section (sec->spec.sorted, section, ls->section) < 0)
+ break;
}
return l;
@@ -1262,14 +2145,9 @@ output_section_callback (lang_wild_statement_type *ptr,
lang_statement_union_type *before;
/* Exclude sections that match UNIQUE_SECTION_LIST. */
- if (unique_section_p (bfd_get_section_name (file->the_bfd, section)))
+ if (unique_section_p (section))
return;
- /* If the wild pattern was marked KEEP, the member sections
- should be as well. */
- if (ptr->keep_sections)
- section->flags |= SEC_KEEP;
-
before = wild_sort (ptr, sec, file, section);
/* Here BEFORE points to the lang_input_section which
@@ -1279,8 +2157,7 @@ output_section_callback (lang_wild_statement_type *ptr,
if (before == NULL)
lang_add_section (&ptr->children, section,
- (lang_output_section_statement_type *) output,
- file);
+ (lang_output_section_statement_type *) output);
else
{
lang_statement_list_type list;
@@ -1288,8 +2165,7 @@ output_section_callback (lang_wild_statement_type *ptr,
lang_list_init (&list);
lang_add_section (&list, section,
- (lang_output_section_statement_type *) output,
- file);
+ (lang_output_section_statement_type *) output);
/* If we are discarding the section, LIST.HEAD will
be NULL. */
@@ -1308,6 +2184,24 @@ output_section_callback (lang_wild_statement_type *ptr,
}
}
+/* Check if all sections in a wild statement for a particular FILE
+ are readonly. */
+
+static void
+check_section_callback (lang_wild_statement_type *ptr ATTRIBUTE_UNUSED,
+ struct wildcard_list *sec ATTRIBUTE_UNUSED,
+ asection *section,
+ lang_input_statement_type *file ATTRIBUTE_UNUSED,
+ void *data)
+{
+ /* Exclude sections that match UNIQUE_SECTION_LIST. */
+ if (unique_section_p (section))
+ return;
+
+ if (section->output_section == NULL && (section->flags & SEC_READONLY) == 0)
+ ((lang_output_section_statement_type *) data)->all_input_readonly = FALSE;
+}
+
/* This is passed a file name which must have been seen already and
added to the statement tree. We will see if it has been opened
already and had its symbols read. If not then we'll read it. */
@@ -1335,8 +2229,8 @@ lookup_name (const char *name)
}
if (search == NULL)
- search = new_afile (name, lang_input_file_is_search_file_enum, default_target,
- FALSE);
+ 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
@@ -1352,6 +2246,67 @@ lookup_name (const char *name)
return search;
}
+/* Save LIST as a list of libraries whose symbols should not be exported. */
+
+struct excluded_lib
+{
+ char *name;
+ struct excluded_lib *next;
+};
+static struct excluded_lib *excluded_libs;
+
+void
+add_excluded_libs (const char *list)
+{
+ const char *p = list, *end;
+
+ while (*p != '\0')
+ {
+ struct excluded_lib *entry;
+ end = strpbrk (p, ",:");
+ if (end == NULL)
+ end = p + strlen (p);
+ entry = xmalloc (sizeof (*entry));
+ entry->next = excluded_libs;
+ entry->name = xmalloc (end - p + 1);
+ memcpy (entry->name, p, end - p);
+ entry->name[end - p] = '\0';
+ excluded_libs = entry;
+ if (*end == '\0')
+ break;
+ p = end + 1;
+ }
+}
+
+static void
+check_excluded_libs (bfd *abfd)
+{
+ struct excluded_lib *lib = excluded_libs;
+
+ while (lib)
+ {
+ int len = strlen (lib->name);
+ const char *filename = lbasename (abfd->filename);
+
+ if (strcmp (lib->name, "ALL") == 0)
+ {
+ abfd->no_export = TRUE;
+ return;
+ }
+
+ if (strncmp (lib->name, filename, len) == 0
+ && (filename[len] == '\0'
+ || (filename[len] == '.' && filename[len + 1] == 'a'
+ && filename[len + 2] == '\0')))
+ {
+ abfd->no_export = TRUE;
+ return;
+ }
+
+ lib = lib->next;
+ }
+}
+
/* Get the symbols for an input file. */
static bfd_boolean
@@ -1372,6 +2327,7 @@ load_symbols (lang_input_statement_type *entry,
lang_statement_list_type *hold;
bfd_boolean bad_load = TRUE;
bfd_boolean save_ldlang_sysrooted_script;
+ bfd_boolean save_as_needed, save_add_needed;
err = bfd_get_error ();
@@ -1405,13 +2361,22 @@ load_symbols (lang_input_statement_type *entry,
stat_ptr = place;
save_ldlang_sysrooted_script = ldlang_sysrooted_script;
ldlang_sysrooted_script = entry->sysrooted;
+ save_as_needed = as_needed;
+ as_needed = entry->as_needed;
+ save_add_needed = add_needed;
+ add_needed = entry->add_needed;
ldfile_assumed_script = TRUE;
parser_input = input_script;
+ /* We want to use the same -Bdynamic/-Bstatic as the one for
+ ENTRY. */
+ config.dynamic_link = entry->dynamic;
yyparse ();
ldfile_assumed_script = FALSE;
ldlang_sysrooted_script = save_ldlang_sysrooted_script;
+ as_needed = save_as_needed;
+ add_needed = save_add_needed;
stat_ptr = hold;
return ! bad_load;
@@ -1436,6 +2401,8 @@ load_symbols (lang_input_statement_type *entry,
break;
case bfd_archive:
+ check_excluded_libs (entry->the_bfd);
+
if (entry->whole_archive)
{
bfd *member = NULL;
@@ -1730,7 +2697,8 @@ open_output (const char *name)
/* Oh dear - we could not find any targets that
satisfy our requirements. */
if (winner == NULL)
- einfo (_("%P: warning: could not find any targets that match endianness requirement\n"));
+ einfo (_("%P: warning: could not find any targets"
+ " that match endianness requirement\n"));
else
output_target = winner->name;
}
@@ -1750,10 +2718,6 @@ open_output (const char *name)
delete_output_file_on_failure = TRUE;
-#if 0
- output->flags |= D_PAGED;
-#endif
-
if (! bfd_set_format (output, bfd_object))
einfo (_("%P%F:%s: can not make object file: %E\n"), name);
if (! bfd_set_arch_mach (output,
@@ -1763,7 +2727,7 @@ open_output (const char *name)
link_info.hash = bfd_link_hash_table_create (output);
if (link_info.hash == NULL)
- einfo (_("%P%F: can not create link hash table: %E\n"));
+ einfo (_("%P%F: can not create hash table: %E\n"));
bfd_set_gp_size (output, g_switch_value);
return output;
@@ -1873,8 +2837,8 @@ open_input_bfds (lang_statement_union_type *s, bfd_boolean force)
s->input_statement.target = current_target;
/* If we are being called from within a group, and this
- is an archive which has already been searched, then
- force it to be researched unless the whole archive
+ is an archive which has already been searched, then
+ force it to be researched unless the whole archive
has been loaded already. */
if (force
&& !s->input_statement.whole_archive
@@ -1901,31 +2865,6 @@ open_input_bfds (lang_statement_union_type *s, bfd_boolean force)
}
}
-/* If there are [COMMONS] statements, put a wild one into the bss
- section. */
-
-static void
-lang_reasonable_defaults (void)
-{
-#if 0
- lang_output_section_statement_lookup (".text");
- lang_output_section_statement_lookup (".data");
-
- default_common_section = lang_output_section_statement_lookup (".bss");
-
- if (!placed_commons)
- {
- lang_wild_statement_type *new =
- new_stat (lang_wild_statement,
- &default_common_section->children);
-
- new->section_name = "COMMON";
- new->filename = NULL;
- lang_list_init (&new->children);
- }
-#endif
-}
-
/* Add a symbol to a hash of symbols used in DEFINED (NAME) expressions. */
void
@@ -2061,26 +3000,144 @@ lang_place_undefineds (void)
insert_undefined (ptr->name);
}
+/* Check for all readonly or some readwrite sections. */
+
+static void
+check_input_sections
+ (lang_statement_union_type *s,
+ lang_output_section_statement_type *output_section_statement)
+{
+ for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
+ {
+ switch (s->header.type)
+ {
+ case lang_wild_statement_enum:
+ walk_wild (&s->wild_statement, check_section_callback,
+ output_section_statement);
+ if (! output_section_statement->all_input_readonly)
+ return;
+ break;
+ case lang_constructors_statement_enum:
+ check_input_sections (constructor_list.head,
+ output_section_statement);
+ if (! output_section_statement->all_input_readonly)
+ return;
+ break;
+ case lang_group_statement_enum:
+ check_input_sections (s->group_statement.children.head,
+ output_section_statement);
+ if (! output_section_statement->all_input_readonly)
+ return;
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+/* Update wildcard statements if needed. */
+
+static void
+update_wild_statements (lang_statement_union_type *s)
+{
+ struct wildcard_list *sec;
+
+ switch (sort_section)
+ {
+ default:
+ FAIL ();
+
+ case none:
+ break;
+
+ case by_name:
+ case by_alignment:
+ for (; s != NULL; s = s->header.next)
+ {
+ switch (s->header.type)
+ {
+ default:
+ break;
+
+ case lang_wild_statement_enum:
+ sec = s->wild_statement.section_list;
+ if (sec != NULL)
+ {
+ switch (sec->spec.sorted)
+ {
+ case none:
+ sec->spec.sorted = sort_section;
+ break;
+ case by_name:
+ if (sort_section == by_alignment)
+ sec->spec.sorted = by_name_alignment;
+ break;
+ case by_alignment:
+ if (sort_section == by_name)
+ sec->spec.sorted = by_alignment_name;
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+
+ case lang_constructors_statement_enum:
+ update_wild_statements (constructor_list.head);
+ break;
+
+ case lang_output_section_statement_enum:
+ update_wild_statements
+ (s->output_section_statement.children.head);
+ break;
+
+ case lang_group_statement_enum:
+ update_wild_statements (s->group_statement.children.head);
+ break;
+ }
+ }
+ break;
+ }
+}
+
/* Open input files and attach to output sections. */
static void
map_input_to_output_sections
(lang_statement_union_type *s, const char *target,
- lang_output_section_statement_type *output_section_statement)
+ lang_output_section_statement_type *os)
{
for (; s != NULL; s = s->header.next)
{
switch (s->header.type)
{
case lang_wild_statement_enum:
- wild (&s->wild_statement, target, output_section_statement);
+ wild (&s->wild_statement, target, os);
break;
case lang_constructors_statement_enum:
map_input_to_output_sections (constructor_list.head,
target,
- output_section_statement);
+ os);
break;
case lang_output_section_statement_enum:
+ if (s->output_section_statement.constraint)
+ {
+ if (s->output_section_statement.constraint != ONLY_IF_RW
+ && s->output_section_statement.constraint != ONLY_IF_RO)
+ break;
+ s->output_section_statement.all_input_readonly = TRUE;
+ check_input_sections (s->output_section_statement.children.head,
+ &s->output_section_statement);
+ if ((s->output_section_statement.all_input_readonly
+ && s->output_section_statement.constraint == ONLY_IF_RW)
+ || (!s->output_section_statement.all_input_readonly
+ && s->output_section_statement.constraint == ONLY_IF_RO))
+ {
+ s->output_section_statement.constraint = -1;
+ break;
+ }
+ }
+
map_input_to_output_sections (s->output_section_statement.children.head,
target,
&s->output_section_statement);
@@ -2093,27 +3150,32 @@ map_input_to_output_sections
case lang_group_statement_enum:
map_input_to_output_sections (s->group_statement.children.head,
target,
- output_section_statement);
+ os);
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 */
+ if (os != NULL && os->bfd_section == NULL)
+ init_os (os, NULL);
+ /* The output section gets contents, and then we inspect for
+ any flags set in the input script which override any ALLOC. */
+ os->bfd_section->flags |= SEC_HAS_CONTENTS;
+ if (!(os->flags & SEC_NEVER_LOAD))
+ os->bfd_section->flags |= SEC_ALLOC | SEC_LOAD;
+ break;
case lang_fill_statement_enum:
case lang_input_section_enum:
case lang_object_symbols_statement_enum:
case lang_reloc_statement_enum:
case lang_padding_statement_enum:
case lang_input_statement_enum:
- if (output_section_statement != NULL
- && output_section_statement->bfd_section == NULL)
- init_os (output_section_statement);
+ if (os != NULL && os->bfd_section == NULL)
+ init_os (os, NULL);
break;
case lang_assignment_statement_enum:
- if (output_section_statement != NULL
- && output_section_statement->bfd_section == NULL)
- init_os (output_section_statement);
+ if (os != NULL && os->bfd_section == NULL)
+ init_os (os, NULL);
/* Make sure that any sections mentioned in the assignment
are initialized. */
@@ -2123,16 +3185,27 @@ map_input_to_output_sections
FAIL ();
break;
case lang_address_statement_enum:
- /* Mark the specified section with the supplied address. */
- {
- lang_output_section_statement_type *os =
- lang_output_section_statement_lookup
- (s->address_statement.section_name);
-
- if (os->bfd_section == NULL)
- init_os (os);
- os->addr_tree = s->address_statement.address;
- }
+ /* Mark the specified section with the supplied address.
+
+ If this section was actually a segment marker, then the
+ directive is ignored if the linker script explicitly
+ processed the segment marker. Originally, the linker
+ treated segment directives (like -Ttext on the
+ command-line) as section directives. We honor the
+ section directive semantics for backwards compatibilty;
+ linker scripts that do not specifically check for
+ SEGMENT_START automatically get the old semantics. */
+ if (!s->address_statement.segment
+ || !s->address_statement.segment->used)
+ {
+ lang_output_section_statement_type *aos
+ = (lang_output_section_statement_lookup
+ (s->address_statement.section_name));
+
+ if (aos->bfd_section == NULL)
+ init_os (aos, NULL);
+ aos->addr_tree = s->address_statement.address;
+ }
break;
}
}
@@ -2142,35 +3215,74 @@ map_input_to_output_sections
added. For example, ldemul_before_allocation can remove dynamic
sections if they turn out to be not needed. Clean them up here. */
-static void
+void
strip_excluded_output_sections (void)
{
- lang_statement_union_type *u;
+ lang_output_section_statement_type *os;
- for (u = lang_output_section_statement.head;
- u != NULL;
- u = u->output_section_statement.next)
+ /* Run lang_size_sections (if not already done). */
+ if (expld.phase != lang_mark_phase_enum)
{
- lang_output_section_statement_type *os;
- asection *s;
+ expld.phase = lang_mark_phase_enum;
+ expld.dataseg.phase = exp_dataseg_none;
+ one_lang_size_sections_pass (NULL, FALSE);
+ lang_reset_memory_regions ();
+ }
- os = &u->output_section_statement;
- s = os->bfd_section;
- if (s != NULL && (s->flags & SEC_EXCLUDE) != 0)
- {
- asection **p;
+ for (os = &lang_output_section_statement.head->output_section_statement;
+ os != NULL;
+ os = os->next)
+ {
+ asection *output_section;
+ bfd_boolean exclude;
- os->bfd_section = NULL;
+ if (os->constraint == -1)
+ continue;
- for (p = &output_bfd->sections; *p; p = &(*p)->next)
- if (*p == s)
+ output_section = os->bfd_section;
+ if (output_section == NULL)
+ continue;
+
+ exclude = (output_section->rawsize == 0
+ && (output_section->flags & SEC_KEEP) == 0
+ && !bfd_section_removed_from_list (output_bfd,
+ output_section));
+
+ /* Some sections have not yet been sized, notably .gnu.version,
+ .dynsym, .dynstr and .hash. These all have SEC_LINKER_CREATED
+ input sections, so don't drop output sections that have such
+ input sections unless they are also marked SEC_EXCLUDE. */
+ if (exclude && output_section->map_head.s != NULL)
+ {
+ asection *s;
+
+ for (s = output_section->map_head.s; s != NULL; s = s->map_head.s)
+ if ((s->flags & SEC_LINKER_CREATED) != 0
+ && (s->flags & SEC_EXCLUDE) == 0)
{
- bfd_section_list_remove (output_bfd, p);
- output_bfd->section_count--;
+ exclude = FALSE;
break;
}
}
+
+ /* TODO: Don't just junk map_head.s, turn them into link_orders. */
+ output_section->map_head.link_order = NULL;
+ output_section->map_tail.link_order = NULL;
+
+ if (exclude)
+ {
+ /* We don't set bfd_section to NULL since bfd_section of the
+ removed output section statement may still be used. */
+ os->ignored = TRUE;
+ output_section->flags |= SEC_EXCLUDE;
+ bfd_section_list_remove (output_bfd, output_section);
+ output_bfd->section_count--;
+ }
}
+
+ /* Stop future calls to lang_add_section from messing with map_head
+ and map_tail link_order fields. */
+ stripped_excluded_sections = TRUE;
}
static void
@@ -2200,14 +3312,14 @@ print_output_section_statement
++len;
}
- minfo ("0x%V %W", section->vma, section->_raw_size);
+ minfo ("0x%V %W", section->vma, section->size);
if (output_section_statement->load_base != NULL)
{
bfd_vma addr;
addr = exp_get_abs_int (output_section_statement->load_base, 0,
- "load base", lang_final_phase_enum);
+ "load base");
minfo (_(" load address 0x%V"), addr);
}
}
@@ -2219,29 +3331,117 @@ print_output_section_statement
output_section_statement);
}
+/* Scan for the use of the destination in the right hand side
+ of an expression. In such cases we will not compute the
+ correct expression, since the value of DST that is used on
+ the right hand side will be its final value, not its value
+ just before this expression is evaluated. */
+
+static bfd_boolean
+scan_for_self_assignment (const char * dst, etree_type * rhs)
+{
+ if (rhs == NULL || dst == NULL)
+ return FALSE;
+
+ switch (rhs->type.node_class)
+ {
+ case etree_binary:
+ return scan_for_self_assignment (dst, rhs->binary.lhs)
+ || scan_for_self_assignment (dst, rhs->binary.rhs);
+
+ case etree_trinary:
+ return scan_for_self_assignment (dst, rhs->trinary.lhs)
+ || scan_for_self_assignment (dst, rhs->trinary.rhs);
+
+ case etree_assign:
+ case etree_provided:
+ case etree_provide:
+ if (strcmp (dst, rhs->assign.dst) == 0)
+ return TRUE;
+ return scan_for_self_assignment (dst, rhs->assign.src);
+
+ case etree_unary:
+ return scan_for_self_assignment (dst, rhs->unary.child);
+
+ case etree_value:
+ if (rhs->value.str)
+ return strcmp (dst, rhs->value.str) == 0;
+ return FALSE;
+
+ case etree_name:
+ if (rhs->name.name)
+ return strcmp (dst, rhs->name.name) == 0;
+ return FALSE;
+
+ default:
+ break;
+ }
+
+ return FALSE;
+}
+
+
static void
print_assignment (lang_assignment_statement_type *assignment,
lang_output_section_statement_type *output_section)
{
- int i;
- etree_value_type result;
+ unsigned int i;
+ bfd_boolean is_dot;
+ bfd_boolean computation_is_valid = TRUE;
+ etree_type *tree;
for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++)
print_space ();
- result = exp_fold_tree (assignment->exp->assign.src, output_section,
- lang_final_phase_enum, print_dot, &print_dot);
- if (result.valid_p)
+ if (assignment->exp->type.node_class == etree_assert)
+ {
+ is_dot = FALSE;
+ tree = assignment->exp->assert_s.child;
+ computation_is_valid = TRUE;
+ }
+ else
+ {
+ const char *dst = assignment->exp->assign.dst;
+
+ is_dot = (dst[0] == '.' && dst[1] == 0);
+ tree = assignment->exp->assign.src;
+ computation_is_valid = is_dot || (scan_for_self_assignment (dst, tree) == FALSE);
+ }
+
+ exp_fold_tree (tree, output_section->bfd_section, &print_dot);
+ if (expld.result.valid_p)
{
- const char *dst;
bfd_vma value;
- value = result.value + result.section->bfd_section->vma;
- dst = assignment->exp->assign.dst;
+ if (computation_is_valid)
+ {
+ value = expld.result.value;
+
+ if (expld.result.section)
+ value += expld.result.section->vma;
- minfo ("0x%V", value);
- if (dst[0] == '.' && dst[1] == 0)
- print_dot = value;
+ minfo ("0x%V", value);
+ if (is_dot)
+ print_dot = value;
+ }
+ else
+ {
+ struct bfd_link_hash_entry *h;
+
+ h = bfd_link_hash_lookup (link_info.hash, assignment->exp->assign.dst,
+ FALSE, FALSE, TRUE);
+ if (h)
+ {
+ value = h->u.def.value;
+
+ if (expld.result.section)
+ value += expld.result.section->vma;
+
+ minfo ("[0x%V]", value);
+ }
+ else
+ minfo ("[unresolved]");
+ }
}
else
{
@@ -2252,9 +3452,7 @@ print_assignment (lang_assignment_statement_type *assignment,
}
minfo (" ");
-
exp_print_tree (assignment->exp);
-
print_nl ();
}
@@ -2268,7 +3466,7 @@ print_input_statement (lang_input_statement_type *statm)
}
/* Print all symbols defined in a particular section. This is called
- via bfd_link_hash_traverse. */
+ via bfd_link_hash_traverse, or by print_all_symbols. */
static bfd_boolean
print_one_symbol (struct bfd_link_hash_entry *hash_entry, void *ptr)
@@ -2294,62 +3492,84 @@ print_one_symbol (struct bfd_link_hash_entry *hash_entry, void *ptr)
return TRUE;
}
+static void
+print_all_symbols (sec)
+ asection *sec;
+{
+ struct fat_user_section_struct *ud = get_userdata (sec);
+ struct map_symbol_def *def;
+
+ if (!ud)
+ return;
+
+ *ud->map_symbol_def_tail = 0;
+ for (def = ud->map_symbol_def_head; def; def = def->next)
+ print_one_symbol (def->entry, sec);
+}
+
/* Print information about an input section to the map file. */
static void
-print_input_section (lang_input_section_type *in)
+print_input_section (asection *i)
{
- asection *i = in->section;
- bfd_size_type size = i->_cooked_size != 0 ? i->_cooked_size : i->_raw_size;
+ bfd_size_type size = i->size;
init_opb ();
- if (size != 0)
+
{
- print_space ();
+ int len;
+ bfd_vma addr;
+ print_space ();
minfo ("%s", i->name);
- if (i->output_section != NULL)
+ len = 1 + strlen (i->name);
+ if (len >= SECTION_NAME_MAP_LENGTH - 1)
{
- int len;
+ print_nl ();
+ len = 0;
+ }
+ while (len < SECTION_NAME_MAP_LENGTH)
+ {
+ print_space ();
+ ++len;
+ }
- len = 1 + strlen (i->name);
- if (len >= SECTION_NAME_MAP_LENGTH - 1)
- {
- print_nl ();
- len = 0;
- }
- while (len < SECTION_NAME_MAP_LENGTH)
- {
- print_space ();
- ++len;
- }
+ if (i->output_section != NULL && i->output_section->owner == output_bfd)
+ addr = i->output_section->vma + i->output_offset;
+ else
+ {
+ addr = print_dot;
+ size = 0;
+ }
- minfo ("0x%V %W %B\n",
- i->output_section->vma + i->output_offset, TO_ADDR (size),
- i->owner);
+ minfo ("0x%V %W %B\n", addr, TO_ADDR (size), i->owner);
- if (i->_cooked_size != 0 && i->_cooked_size != i->_raw_size)
- {
- len = SECTION_NAME_MAP_LENGTH + 3;
+ if (size != i->rawsize && i->rawsize != 0)
+ {
+ len = SECTION_NAME_MAP_LENGTH + 3;
#ifdef BFD64
- len += 16;
+ len += 16;
#else
- len += 8;
+ len += 8;
#endif
- while (len > 0)
- {
- print_space ();
- --len;
- }
-
- minfo (_("%W (size before relaxing)\n"), i->_raw_size);
+ while (len > 0)
+ {
+ print_space ();
+ --len;
}
- bfd_link_hash_traverse (link_info.hash, print_one_symbol, i);
+ minfo (_("%W (size before relaxing)\n"), i->rawsize);
+ }
- print_dot = (i->output_section->vma + i->output_offset
- + TO_ADDR (size));
+ if (i->output_section != NULL && i->output_section->owner == output_bfd)
+ {
+ if (command_line.reduce_memory_overheads)
+ bfd_link_hash_traverse (link_info.hash, print_one_symbol, i);
+ else
+ print_all_symbols (i);
+
+ print_dot = addr + TO_ADDR (size);
}
}
}
@@ -2377,7 +3597,7 @@ print_data_statement (lang_data_statement_type *data)
for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++)
print_space ();
- addr = data->output_vma;
+ addr = data->output_offset;
if (data->output_section != NULL)
addr += data->output_section->vma;
@@ -2444,7 +3664,7 @@ print_reloc_statement (lang_reloc_statement_type *reloc)
for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++)
print_space ();
- addr = reloc->output_vma;
+ addr = reloc->output_offset;
if (reloc->output_section != NULL)
addr += reloc->output_section->vma;
@@ -2483,7 +3703,7 @@ print_padding_statement (lang_padding_statement_type *s)
addr = s->output_offset;
if (s->output_section != NULL)
addr += s->output_section->vma;
- minfo ("0x%V %W ", addr, s->size);
+ minfo ("0x%V %W ", addr, (bfd_vma) s->size);
if (s->fill->size != 0)
{
@@ -2611,7 +3831,7 @@ print_statement (lang_statement_union_type *s,
print_reloc_statement (&s->reloc_statement);
break;
case lang_input_section_enum:
- print_input_section (&s->input_section);
+ print_input_section (s->input_section.section);
break;
case lang_padding_statement_enum:
print_padding_statement (&s->padding_statement);
@@ -2683,16 +3903,22 @@ insert_pad (lang_statement_union_type **ptr,
bfd_vma dot)
{
static fill_type zero_fill = { 1, { 0 } };
- lang_statement_union_type *pad;
+ lang_statement_union_type *pad = NULL;
- pad = ((lang_statement_union_type *)
- ((char *) ptr - offsetof (lang_statement_union_type, header.next)));
- if (ptr != &statement_list.head
+ if (ptr != &statement_list.head)
+ pad = ((lang_statement_union_type *)
+ ((char *) ptr - offsetof (lang_statement_union_type, header.next)));
+ if (pad != NULL
&& pad->header.type == lang_padding_statement_enum
&& pad->padding_statement.output_section == output_section)
{
- /* Use the existing pad statement. The above test on output
- section is probably redundant, but it doesn't hurt to check. */
+ /* Use the existing pad statement. */
+ }
+ else if ((pad = *ptr) != NULL
+ && pad->header.type == lang_padding_statement_enum
+ && pad->padding_statement.output_section == output_section)
+ {
+ /* Use the existing pad statement. */
}
else
{
@@ -2708,21 +3934,23 @@ insert_pad (lang_statement_union_type **ptr,
}
pad->padding_statement.output_offset = dot - output_section->vma;
pad->padding_statement.size = alignment_needed;
- output_section->_raw_size += alignment_needed;
+ output_section->size += alignment_needed;
}
/* Work out how much this section will move the dot point. */
static bfd_vma
-size_input_section (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)
+ if (!((lang_input_statement_type *) i->owner->usrdata)->just_syms_flag
+ && (i->flags & SEC_EXCLUDE) == 0)
{
unsigned int alignment_needed;
asection *o;
@@ -2752,11 +3980,8 @@ size_input_section (lang_statement_union_type **this_ptr,
i->output_offset = dot - o->vma;
/* Mark how big the output section must be to contain this now. */
- if (i->_cooked_size != 0)
- dot += TO_ADDR (i->_cooked_size);
- else
- dot += TO_ADDR (i->_raw_size);
- o->_raw_size = TO_SIZE (dot - o->vma);
+ dot += TO_ADDR (i->size);
+ o->size = TO_SIZE (dot - o->vma);
}
else
{
@@ -2766,67 +3991,91 @@ size_input_section (lang_statement_union_type **this_ptr,
return dot;
}
-#define IGNORE_SECTION(bfd, s) \
- (((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)
+static int
+sort_sections_by_lma (const void *arg1, const void *arg2)
+{
+ const asection *sec1 = *(const asection **) arg1;
+ const asection *sec2 = *(const asection **) arg2;
+
+ if (bfd_section_lma (sec1->owner, sec1)
+ < bfd_section_lma (sec2->owner, sec2))
+ return -1;
+ else if (bfd_section_lma (sec1->owner, sec1)
+ > bfd_section_lma (sec2->owner, sec2))
+ return 1;
+
+ return 0;
+}
+
+#define IGNORE_SECTION(s) \
+ ((s->flags & SEC_NEVER_LOAD) != 0 \
+ || (s->flags & SEC_ALLOC) == 0 \
+ || ((s->flags & SEC_THREAD_LOCAL) != 0 \
+ && (s->flags & SEC_LOAD) == 0))
/* Check to see if any allocated sections overlap with other allocated
- sections. This can happen when the linker script specifically specifies
- the output section addresses of the two sections. */
+ sections. This can happen if a linker script specifies the output
+ section addresses of the two sections. */
static void
lang_check_section_addresses (void)
{
- asection *s;
+ asection *s, *os;
+ asection **sections, **spp;
+ unsigned int count;
+ bfd_vma s_start;
+ bfd_vma s_end;
+ bfd_vma os_start;
+ bfd_vma os_end;
+ bfd_size_type amt;
+
+ if (bfd_count_sections (output_bfd) <= 1)
+ return;
+
+ amt = bfd_count_sections (output_bfd) * sizeof (asection *);
+ sections = xmalloc (amt);
/* Scan all sections in the output list. */
+ count = 0;
for (s = output_bfd->sections; s != NULL; s = s->next)
{
- asection *os;
-
- /* Ignore sections which are not loaded or which have no contents. */
- if (IGNORE_SECTION (output_bfd, s))
+ /* Only consider loadable sections with real contents. */
+ if (IGNORE_SECTION (s) || s->size == 0)
continue;
- /* Once we reach section 's' stop our seach. This prevents two
- warning messages from being produced, one for 'section A overlaps
- section B' and one for 'section B overlaps section A'. */
- for (os = output_bfd->sections; os != s; os = os->next)
- {
- bfd_vma s_start;
- bfd_vma s_end;
- bfd_vma os_start;
- bfd_vma os_end;
-
- /* Only consider loadable sections with real contents. */
- if (IGNORE_SECTION (output_bfd, os))
- continue;
-
- /* 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);
- os_start = bfd_section_lma (output_bfd, os);
- 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))
- continue;
+ sections[count] = s;
+ count++;
+ }
+
+ if (count <= 1)
+ return;
- einfo (
-_("%X%P: section %s [%V -> %V] overlaps section %s [%V -> %V]\n"),
- s->name, s_start, s_end, os->name, os_start, os_end);
+ qsort (sections, (size_t) count, sizeof (asection *),
+ sort_sections_by_lma);
- /* Once we have found one overlap for this section,
- stop looking for others. */
- break;
- }
+ spp = sections;
+ s = *spp++;
+ s_start = bfd_section_lma (output_bfd, s);
+ s_end = s_start + TO_ADDR (s->size) - 1;
+ for (count--; count; count--)
+ {
+ /* We must check the sections' LMA addresses not their VMA
+ addresses because overlay sections can have overlapping VMAs
+ but they must have distinct LMAs. */
+ os = s;
+ os_start = s_start;
+ os_end = s_end;
+ s = *spp++;
+ s_start = bfd_section_lma (output_bfd, s);
+ s_end = s_start + TO_ADDR (s->size) - 1;
+
+ /* Look for an overlap. */
+ if (s_end >= os_start && s_start <= os_end)
+ einfo (_("%X%P: section %s [%V -> %V] overlaps section %s [%V -> %V]\n"),
+ s->name, s_start, s_end, os->name, os_start, os_end);
}
+
+ free (sections);
}
/* Make sure the new address is within the region. We explicitly permit the
@@ -2847,7 +4096,8 @@ os_region_check (lang_output_section_statement_type *os,
{
if (tree != NULL)
{
- einfo (_("%X%P: address 0x%v of %B section %s is not within region %s\n"),
+ einfo (_("%X%P: address 0x%v of %B section %s"
+ " is not within region %s\n"),
region->current,
os->bfd_section->owner,
os->bfd_section->name,
@@ -2884,36 +4134,54 @@ lang_size_sections_1
{
case lang_output_section_statement_enum:
{
- bfd_vma after;
+ bfd_vma newdot, after;
lang_output_section_statement_type *os;
os = &s->output_section_statement;
+ if (os->addr_tree != NULL)
+ {
+ os->processed = FALSE;
+ exp_fold_tree (os->addr_tree, bfd_abs_section_ptr, &dot);
+
+ if (!expld.result.valid_p
+ && expld.phase != lang_mark_phase_enum)
+ einfo (_("%F%S: non constant or forward reference"
+ " address expression for section %s\n"),
+ os->name);
+
+ dot = expld.result.value + expld.result.section->vma;
+ }
+
if (os->bfd_section == NULL)
- /* This section was never actually created. */
+ /* This section was removed or never actually created. */
break;
/* If this is a COFF shared library section, use the size and
address from the input section. FIXME: This is COFF
specific; it would be cleaner if there were some other way
to do this, but nothing simple comes to mind. */
- if ((os->bfd_section->flags & SEC_COFF_SHARED_LIBRARY) != 0)
+ if ((bfd_get_flavour (output_bfd) == bfd_target_ecoff_flavour
+ || bfd_get_flavour (output_bfd) == bfd_target_coff_flavour)
+ && (os->bfd_section->flags & SEC_COFF_SHARED_LIBRARY) != 0)
{
asection *input;
if (os->children.head == NULL
|| os->children.head->header.next != NULL
- || os->children.head->header.type != lang_input_section_enum)
- einfo (_("%P%X: Internal error on COFF shared library section %s\n"),
- os->name);
+ || (os->children.head->header.type
+ != lang_input_section_enum))
+ einfo (_("%P%X: Internal error on COFF shared library"
+ " section %s\n"), os->name);
input = os->children.head->input_section.section;
bfd_set_section_vma (os->bfd_section->owner,
os->bfd_section,
bfd_section_vma (input->owner, input));
- os->bfd_section->_raw_size = input->_raw_size;
+ os->bfd_section->size = input->size;
break;
}
+ newdot = dot;
if (bfd_is_abs_section (os->bfd_section))
{
/* No matter what happens, an abs section starts at zero. */
@@ -2921,15 +4189,17 @@ lang_size_sections_1
}
else
{
+ int align;
+
if (os->addr_tree == NULL)
{
/* No address specified for this section, get one
from the region specification. */
if (os->region == NULL
- || (((bfd_get_section_flags (output_bfd, os->bfd_section)
- & (SEC_ALLOC | SEC_LOAD)) != 0)
+ || ((os->bfd_section->flags & (SEC_ALLOC | SEC_LOAD))
&& os->region->name[0] == '*'
- && strcmp (os->region->name, DEFAULT_MEMORY_REGION) == 0))
+ && strcmp (os->region->name,
+ DEFAULT_MEMORY_REGION) == 0))
{
os->region = lang_memory_default (os->bfd_section);
}
@@ -2937,106 +4207,95 @@ lang_size_sections_1
/* If a loadable section is using the default memory
region, and some non default memory regions were
defined, issue an error message. */
- if (!IGNORE_SECTION (output_bfd, os->bfd_section)
+ if (!os->ignored
+ && !IGNORE_SECTION (os->bfd_section)
&& ! link_info.relocatable
&& check_regions
- && strcmp (os->region->name, DEFAULT_MEMORY_REGION) == 0
+ && strcmp (os->region->name,
+ DEFAULT_MEMORY_REGION) == 0
&& lang_memory_region_list != NULL
&& (strcmp (lang_memory_region_list->name,
DEFAULT_MEMORY_REGION) != 0
- || lang_memory_region_list->next != NULL))
+ || lang_memory_region_list->next != NULL)
+ && expld.phase != lang_mark_phase_enum)
{
/* 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
+ 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"),
+ 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"),
+ 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;
-
- if (os->section_alignment == -1)
- {
- bfd_vma olddot;
-
- olddot = dot;
- dot = align_power (dot,
- os->bfd_section->alignment_power);
-
- if (dot != olddot && config.warn_section_align)
- einfo (_("%P: warning: changing start of section %s by %u bytes\n"),
- os->name, (unsigned int) (dot - olddot));
- }
+ newdot = os->region->current;
+ align = os->bfd_section->alignment_power;
}
else
+ align = os->section_alignment;
+
+ /* Align to what the section needs. */
+ if (align > 0)
{
- 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 or forward reference address expression for section %s\n"),
- os->name);
-
- dot = r.value + r.section->bfd_section->vma;
+ bfd_vma savedot = newdot;
+ newdot = align_power (newdot, align);
+
+ if (newdot != savedot
+ && (config.warn_section_align
+ || os->addr_tree != NULL)
+ && expld.phase != lang_mark_phase_enum)
+ einfo (_("%P: warning: changing start of section"
+ " %s by %lu bytes\n"),
+ os->name, (unsigned long) (newdot - savedot));
}
- /* The section starts here.
- First, align to what the section needs. */
-
- if (os->section_alignment != -1)
- dot = align_power (dot, os->section_alignment);
-
- bfd_set_section_vma (0, os->bfd_section, dot);
+ bfd_set_section_vma (0, os->bfd_section, newdot);
os->bfd_section->output_offset = 0;
}
lang_size_sections_1 (os->children.head, os, &os->children.head,
- os->fill, dot, relax, check_regions);
+ os->fill, newdot, relax, check_regions);
+
+ os->processed = TRUE;
+
+ if (bfd_is_abs_section (os->bfd_section) || os->ignored)
+ {
+ ASSERT (os->bfd_section->size == 0);
+ break;
+ }
+
+ dot = os->bfd_section->vma;
/* Put the section within the requested block size, or
align at the block boundary. */
- after = ((os->bfd_section->vma
- + TO_ADDR (os->bfd_section->_raw_size)
+ after = ((dot
+ + TO_ADDR (os->bfd_section->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
- os->bfd_section->_raw_size
- = TO_SIZE (after - os->bfd_section->vma);
+ os->bfd_section->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);
-
- os->processed = 1;
+ dot += TO_ADDR (os->bfd_section->size);
if (os->update_dot_tree != 0)
- exp_fold_tree (os->update_dot_tree, abs_output_section,
- lang_allocating_phase_enum, dot, &dot);
+ exp_fold_tree (os->update_dot_tree, bfd_abs_section_ptr, &dot);
/* Update dot in the region ?
We only do this if the section is going to be allocated,
@@ -3047,10 +4306,8 @@ lang_size_sections_1
addresses of sections after it. We have to update
dot. */
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)
- & (SEC_ALLOC | SEC_LOAD))))
+ && ((os->bfd_section->flags & SEC_NEVER_LOAD) == 0
+ || (os->bfd_section->flags & (SEC_ALLOC | SEC_LOAD))))
{
os->region->current = dot;
@@ -3069,7 +4326,7 @@ lang_size_sections_1
/* Set load_base, which will be handled later. */
os->load_base = exp_intop (os->lma_region->current);
os->lma_region->current +=
- TO_ADDR (os->bfd_section->_raw_size);
+ TO_ADDR (os->bfd_section->size);
if (check_regions)
os_region_check (os, os->lma_region, NULL,
os->bfd_section->lma);
@@ -3089,15 +4346,14 @@ lang_size_sections_1
{
unsigned int size = 0;
- s->data_statement.output_vma =
+ s->data_statement.output_offset =
dot - output_section_statement->bfd_section->vma;
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);
+ exp_fold_tree (s->data_statement.exp, bfd_abs_section_ptr, &dot);
switch (s->data_statement.type)
{
@@ -3120,15 +4376,7 @@ lang_size_sections_1
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. */
- output_section_statement->bfd_section->flags |= SEC_HAS_CONTENTS;
- if (!(output_section_statement->flags & SEC_NEVER_LOAD))
- {
- output_section_statement->bfd_section->flags |=
- SEC_ALLOC | SEC_LOAD;
- }
+ output_section_statement->bfd_section->size += size;
}
break;
@@ -3136,43 +4384,38 @@ lang_size_sections_1
{
int size;
- s->reloc_statement.output_vma =
+ s->reloc_statement.output_offset =
dot - output_section_statement->bfd_section->vma;
s->reloc_statement.output_section =
output_section_statement->bfd_section;
size = bfd_get_reloc_size (s->reloc_statement.howto);
dot += TO_ADDR (size);
- output_section_statement->bfd_section->_raw_size += size;
+ output_section_statement->bfd_section->size += size;
}
break;
case lang_wild_statement_enum:
-
dot = lang_size_sections_1 (s->wild_statement.children.head,
output_section_statement,
&s->wild_statement.children.head,
fill, dot, relax, check_regions);
-
break;
case lang_object_symbols_statement_enum:
link_info.create_object_symbols_section =
output_section_statement->bfd_section;
break;
+
case lang_output_statement_enum:
case lang_target_statement_enum:
break;
+
case lang_input_section_enum:
{
asection *i;
i = (*prev)->input_section.section;
- if (! relax)
- {
- if (i->_cooked_size == 0)
- i->_cooked_size = i->_raw_size;
- }
- else
+ if (relax)
{
bfd_boolean again;
@@ -3185,31 +4428,33 @@ lang_size_sections_1
output_section_statement->fill, dot);
}
break;
+
case lang_input_statement_enum:
break;
+
case lang_fill_statement_enum:
s->fill_statement.output_section =
output_section_statement->bfd_section;
fill = s->fill_statement.fill;
break;
+
case lang_assignment_statement_enum:
{
bfd_vma newdot = dot;
exp_fold_tree (s->assignment_statement.exp,
- output_section_statement,
- lang_allocating_phase_enum,
- dot,
+ output_section_statement->bfd_section,
&newdot);
- if (newdot != dot)
+ if (newdot != dot && !output_section_statement->ignored)
{
if (output_section_statement == abs_output_section)
{
/* If we don't have an output section, then just adjust
the default memory address. */
- lang_memory_region_lookup (DEFAULT_MEMORY_REGION, FALSE)->current = newdot;
+ lang_memory_region_lookup (DEFAULT_MEMORY_REGION,
+ FALSE)->current = newdot;
}
else
{
@@ -3221,14 +4466,15 @@ lang_size_sections_1
/* 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;
+ /* 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;
}
}
@@ -3271,54 +4517,89 @@ lang_size_sections_1
return dot;
}
-bfd_vma
-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)
+void
+one_lang_size_sections_pass (bfd_boolean *relax, bfd_boolean check_regions)
{
- bfd_vma result;
- asection *o;
-
- /* Callers of exp_fold_tree need to increment this. */
lang_statement_iteration++;
+ lang_size_sections_1 (statement_list.head, abs_output_section,
+ &statement_list.head, 0, 0, relax, check_regions);
+}
- exp_data_seg.phase = exp_dataseg_none;
- result = lang_size_sections_1 (s, output_section_statement, prev, fill,
- dot, relax, check_regions);
- if (exp_data_seg.phase == exp_dataseg_end_seen)
+void
+lang_size_sections (bfd_boolean *relax, bfd_boolean check_regions)
+{
+ expld.phase = lang_allocating_phase_enum;
+ expld.dataseg.phase = exp_dataseg_none;
+
+ one_lang_size_sections_pass (relax, check_regions);
+ if (expld.dataseg.phase == exp_dataseg_end_seen
+ && link_info.relro && expld.dataseg.relro_end)
+ {
+ /* If DATA_SEGMENT_ALIGN DATA_SEGMENT_RELRO_END pair was seen, try
+ to put expld.dataseg.relro on a (common) page boundary. */
+ bfd_vma old_min_base, relro_end, maxpage;
+
+ expld.dataseg.phase = exp_dataseg_relro_adjust;
+ old_min_base = expld.dataseg.min_base;
+ maxpage = expld.dataseg.maxpagesize;
+ expld.dataseg.base += (-expld.dataseg.relro_end
+ & (expld.dataseg.pagesize - 1));
+ /* Compute the expected PT_GNU_RELRO segment end. */
+ relro_end = (expld.dataseg.relro_end + expld.dataseg.pagesize - 1)
+ & ~(expld.dataseg.pagesize - 1);
+ if (old_min_base + maxpage < expld.dataseg.base)
+ {
+ expld.dataseg.base -= maxpage;
+ relro_end -= maxpage;
+ }
+ one_lang_size_sections_pass (relax, check_regions);
+ if (expld.dataseg.relro_end > relro_end)
+ {
+ /* The alignment of sections between DATA_SEGMENT_ALIGN
+ and DATA_SEGMENT_RELRO_END caused huge padding to be
+ inserted at DATA_SEGMENT_RELRO_END. Try some other base. */
+ asection *sec;
+ unsigned int max_alignment_power = 0;
+
+ /* Find maximum alignment power of sections between
+ DATA_SEGMENT_ALIGN and DATA_SEGMENT_RELRO_END. */
+ for (sec = output_bfd->sections; sec; sec = sec->next)
+ if (sec->vma >= expld.dataseg.base
+ && sec->vma < expld.dataseg.relro_end
+ && sec->alignment_power > max_alignment_power)
+ max_alignment_power = sec->alignment_power;
+
+ if (((bfd_vma) 1 << max_alignment_power) < expld.dataseg.pagesize)
+ {
+ if (expld.dataseg.base - (1 << max_alignment_power)
+ < old_min_base)
+ expld.dataseg.base += expld.dataseg.pagesize;
+ expld.dataseg.base -= (1 << max_alignment_power);
+ one_lang_size_sections_pass (relax, check_regions);
+ }
+ }
+ link_info.relro_start = expld.dataseg.base;
+ link_info.relro_end = expld.dataseg.relro_end;
+ }
+ else if (expld.dataseg.phase == exp_dataseg_end_seen)
{
/* If DATA_SEGMENT_ALIGN DATA_SEGMENT_END pair was seen, check whether
a page could be saved in the data segment. */
bfd_vma first, last;
- first = -exp_data_seg.base & (exp_data_seg.pagesize - 1);
- last = exp_data_seg.end & (exp_data_seg.pagesize - 1);
+ first = -expld.dataseg.base & (expld.dataseg.pagesize - 1);
+ last = expld.dataseg.end & (expld.dataseg.pagesize - 1);
if (first && last
- && ((exp_data_seg.base & ~(exp_data_seg.pagesize - 1))
- != (exp_data_seg.end & ~(exp_data_seg.pagesize - 1)))
- && first + last <= exp_data_seg.pagesize)
+ && ((expld.dataseg.base & ~(expld.dataseg.pagesize - 1))
+ != (expld.dataseg.end & ~(expld.dataseg.pagesize - 1)))
+ && first + last <= expld.dataseg.pagesize)
{
- exp_data_seg.phase = exp_dataseg_adjust;
- lang_statement_iteration++;
- result = lang_size_sections_1 (s, output_section_statement, prev,
- fill, dot, relax, check_regions);
+ expld.dataseg.phase = exp_dataseg_adjust;
+ one_lang_size_sections_pass (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;
+ expld.phase = lang_final_phase_enum;
}
/* Worker function for lang_do_assignments. Recursiveness goes here. */
@@ -3346,54 +4627,48 @@ lang_do_assignments_1
lang_output_section_statement_type *os;
os = &(s->output_section_statement);
- if (os->bfd_section != NULL)
+ if (os->bfd_section != NULL && !os->ignored)
{
dot = os->bfd_section->vma;
lang_do_assignments_1 (os->children.head, os, os->fill, dot);
- dot = (os->bfd_section->vma
- + TO_ADDR (os->bfd_section->_raw_size));
-
+ /* .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->size);
}
if (os->load_base)
{
/* If nothing has been placed into the output section then
it won't have a bfd_section. */
- if (os->bfd_section)
+ if (os->bfd_section && !os->ignored)
{
os->bfd_section->lma
- = exp_get_abs_int (os->load_base, 0, "load base",
- lang_final_phase_enum);
+ = exp_get_abs_int (os->load_base, 0, "load base");
}
}
}
break;
+
case lang_wild_statement_enum:
dot = lang_do_assignments_1 (s->wild_statement.children.head,
output_section_statement,
fill, dot);
-
break;
case lang_object_symbols_statement_enum:
case lang_output_statement_enum:
case lang_target_statement_enum:
-#if 0
- case lang_common_statement_enum:
-#endif
break;
+
case lang_data_statement_enum:
- {
- etree_value_type value;
-
- value = exp_fold_tree (s->data_statement.exp,
- abs_output_section,
- lang_final_phase_enum, dot, &dot);
- if (!value.valid_p)
- einfo (_("%F%P: invalid data statement\n"));
- s->data_statement.value
- = value.value + value.section->bfd_section->vma;
- }
+ exp_fold_tree (s->data_statement.exp, bfd_abs_section_ptr, &dot);
+ if (expld.result.valid_p)
+ s->data_statement.value = (expld.result.value
+ + expld.result.section->vma);
+ else
+ einfo (_("%F%P: invalid data statement\n"));
{
unsigned int size;
switch (s->data_statement.type)
@@ -3421,16 +4696,12 @@ lang_do_assignments_1
break;
case lang_reloc_statement_enum:
- {
- etree_value_type value;
-
- value = exp_fold_tree (s->reloc_statement.addend_exp,
- abs_output_section,
- lang_final_phase_enum, dot, &dot);
- s->reloc_statement.addend_value = value.value;
- if (!value.valid_p)
- einfo (_("%F%P: invalid reloc statement\n"));
- }
+ exp_fold_tree (s->reloc_statement.addend_exp,
+ bfd_abs_section_ptr, &dot);
+ if (expld.result.valid_p)
+ s->reloc_statement.addend_value = expld.result.value;
+ else
+ einfo (_("%F%P: invalid reloc statement\n"));
dot += TO_ADDR (bfd_get_reloc_size (s->reloc_statement.howto));
break;
@@ -3438,28 +4709,24 @@ lang_do_assignments_1
{
asection *in = s->input_section.section;
- if (in->_cooked_size != 0)
- dot += TO_ADDR (in->_cooked_size);
- else
- dot += TO_ADDR (in->_raw_size);
+ if ((in->flags & SEC_EXCLUDE) == 0)
+ dot += TO_ADDR (in->size);
}
break;
case lang_input_statement_enum:
break;
+
case lang_fill_statement_enum:
fill = s->fill_statement.fill;
break;
- case lang_assignment_statement_enum:
- {
- exp_fold_tree (s->assignment_statement.exp,
- output_section_statement,
- lang_final_phase_enum,
- dot,
- &dot);
- }
+ case lang_assignment_statement_enum:
+ exp_fold_tree (s->assignment_statement.exp,
+ output_section_statement->bfd_section,
+ &dot);
break;
+
case lang_padding_statement_enum:
dot += TO_ADDR (s->padding_statement.size);
break;
@@ -3468,29 +4735,24 @@ lang_do_assignments_1
dot = lang_do_assignments_1 (s->group_statement.children.head,
output_section_statement,
fill, dot);
-
break;
default:
FAIL ();
break;
+
case lang_address_statement_enum:
break;
}
-
}
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)
+lang_do_assignments (void)
{
- /* Callers of exp_fold_tree need to increment this. */
lang_statement_iteration++;
- lang_do_assignments_1 (s, output_section_statement, fill, dot);
+ lang_do_assignments_1 (statement_list.head, abs_output_section, NULL, 0);
}
/* Fix any .startof. or .sizeof. symbols. When the assemblers see the
@@ -3531,10 +4793,7 @@ lang_set_startof (void)
if (h != NULL && h->type == bfd_link_hash_undefined)
{
h->type = bfd_link_hash_defined;
- if (s->_cooked_size != 0)
- h->u.def.value = TO_ADDR (s->_cooked_size);
- else
- h->u.def.value = TO_ADDR (s->_raw_size);
+ h->u.def.value = TO_ADDR (s->size);
h->u.def.section = bfd_abs_section_ptr;
}
@@ -3543,7 +4802,7 @@ lang_set_startof (void)
}
static void
-lang_finish (void)
+lang_end (void)
{
struct bfd_link_hash_entry *h;
bfd_boolean warn;
@@ -3555,9 +4814,9 @@ lang_finish (void)
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";
+ /* No entry has been specified. Look for the default entry, but
+ don't warn if we don't find it. */
+ entry_symbol.name = entry_symbol_default;
warn = FALSE;
}
@@ -3583,7 +4842,7 @@ lang_finish (void)
const char *send;
/* We couldn't find the entry symbol. Try parsing it as a
- number. */
+ number. */
val = bfd_scan_vma (entry_symbol.name, &send, 0);
if (*send == '\0')
{
@@ -3600,7 +4859,8 @@ lang_finish (void)
if (ts != NULL)
{
if (warn)
- einfo (_("%P: warning: cannot find entry symbol %s; defaulting to %V\n"),
+ einfo (_("%P: warning: cannot find entry symbol %s;"
+ " defaulting to %V\n"),
entry_symbol.name,
bfd_get_section_vma (output_bfd, ts));
if (! bfd_set_start_address (output_bfd,
@@ -3611,13 +4871,15 @@ lang_finish (void)
else
{
if (warn)
- einfo (_("%P: warning: cannot find entry symbol %s; not setting start address\n"),
+ einfo (_("%P: warning: cannot find entry symbol %s;"
+ " not setting start address\n"),
entry_symbol.name);
}
}
}
- bfd_hash_table_free (&lang_definedness_table);
+ /* Don't bfd_hash_table_free (&lang_definedness_table);
+ map file output may result in a call of lang_track_definedness. */
}
/* This is a small function used when we want to ignore errors from
@@ -3643,8 +4905,9 @@ lang_check (void)
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,
- command_line.accept_unknown_input_arch);
+ 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 +4920,8 @@ lang_check (void)
|| bfd_get_flavour (input_bfd) != bfd_get_flavour (output_bfd))
&& (bfd_get_file_flags (input_bfd) & HAS_RELOC) != 0)
{
- einfo (_("%P%F: Relocatable linking with relocations from format %s (%B) to format %s (%B) is not supported\n"),
+ einfo (_("%P%F: Relocatable linking with relocations from"
+ " format %s (%B) to format %s (%B) is not supported\n"),
bfd_get_target (input_bfd), input_bfd,
bfd_get_target (output_bfd), output_bfd);
/* einfo with %F exits. */
@@ -3666,7 +4930,8 @@ lang_check (void)
if (compatible == NULL)
{
if (command_line.warn_mismatch)
- einfo (_("%P: warning: %s architecture of input file `%B' is incompatible with %s output\n"),
+ einfo (_("%P: warning: %s architecture of input file `%B'"
+ " is incompatible with %s output\n"),
bfd_printable_name (input_bfd), input_bfd,
bfd_printable_name (output_bfd));
}
@@ -3678,17 +4943,17 @@ lang_check (void)
bfd_error_handler_type pfn = NULL;
/* If we aren't supposed to warn about mismatched input
- files, temporarily set the BFD error handler to a
- function which will do nothing. We still want to call
- bfd_merge_private_bfd_data, since it may set up
- information which is needed in the output file. */
+ files, temporarily set the BFD error handler to a
+ function which will do nothing. We still want to call
+ bfd_merge_private_bfd_data, since it may set up
+ information which is needed in the output file. */
if (! command_line.warn_mismatch)
pfn = bfd_set_error_handler (ignore_bfd_errors);
if (! bfd_merge_private_bfd_data (input_bfd, output_bfd))
{
if (command_line.warn_mismatch)
- einfo (_("%P%X: failed to merge target specific data of file %B\n"),
- input_bfd);
+ einfo (_("%P%X: failed to merge target specific data"
+ " of file %B\n"), input_bfd);
}
if (! command_line.warn_mismatch)
bfd_set_error_handler (pfn);
@@ -3742,8 +5007,8 @@ lang_one_common (struct bfd_link_hash_entry *h, void *info)
section = h->u.c.p->section;
/* 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));
+ section->size += ((bfd_vma) 1 << (power_of_two + opb_shift)) - 1;
+ section->size &= (- (bfd_vma) 1 << (power_of_two + opb_shift));
/* Adjust the alignment if necessary. */
if (power_of_two > section->alignment_power)
@@ -3752,10 +5017,10 @@ lang_one_common (struct bfd_link_hash_entry *h, void *info)
/* Change the symbol from common to defined. */
h->type = bfd_link_hash_defined;
h->u.def.section = section;
- h->u.def.value = section->_cooked_size;
+ h->u.def.value = section->size;
/* Increase the size of the section. */
- section->_cooked_size += size;
+ section->size += size;
/* Make sure the section is allocated in memory, and make sure that
it is no longer a common section. */
@@ -3828,12 +5093,12 @@ lang_place_orphans (void)
if (s->output_section == NULL)
{
/* This section of the file is not attached, root
- around for a sensible place for it to go. */
+ around for a sensible place for it to go. */
if (file->just_syms_flag)
- {
- abort ();
- }
+ bfd_link_just_syms (file->the_bfd, s, &link_info);
+ else if ((s->flags & SEC_EXCLUDE) != 0)
+ s->output_section = bfd_abs_section_ptr;
else if (strcmp (s->name, "COMMON") == 0)
{
/* This is a lonely common section which must have
@@ -3844,28 +5109,22 @@ lang_place_orphans (void)
{
if (default_common_section == NULL)
{
-#if 0
- /* This message happens when using the
- svr3.ifile linker script, so I have
- disabled it. */
- info_msg (_("%P: no [COMMON] command, defaulting to .bss\n"));
-#endif
default_common_section =
lang_output_section_statement_lookup (".bss");
}
lang_add_section (&default_common_section->children, s,
- default_common_section, file);
+ default_common_section);
}
}
- else if (ldemul_place_orphan (file, s))
+ else if (ldemul_place_orphan (s))
;
else
{
lang_output_section_statement_type *os;
os = lang_output_section_statement_lookup (s->name);
- lang_add_section (&os->children, s, os, file);
+ lang_add_section (&os->children, s, os);
}
}
}
@@ -4008,19 +5267,15 @@ lang_enter_output_section_statement (const char *output_section_statement_name,
enum section_type sectype,
etree_type *align,
etree_type *subalign,
- etree_type *ebase)
+ etree_type *ebase,
+ int constraint)
{
lang_output_section_statement_type *os;
- current_section =
- os =
- lang_output_section_statement_lookup (output_section_statement_name);
+ os = lang_output_section_statement_lookup_1 (output_section_statement_name,
+ constraint);
+ current_section = os;
- /* Add this statement to tree. */
-#if 0
- add_statement (lang_output_section_statement_enum,
- output_section_statement);
-#endif
/* Make next things chain into subchain of this. */
if (os->addr_tree == NULL)
@@ -4036,9 +5291,9 @@ lang_enter_output_section_statement (const char *output_section_statement_name,
stat_ptr = &os->children;
os->subsection_alignment =
- topower (exp_get_value_int (subalign, -1, "subsection alignment", 0));
+ topower (exp_get_value_int (subalign, -1, "subsection alignment"));
os->section_alignment =
- topower (exp_get_value_int (align, -1, "section alignment", 0));
+ topower (exp_get_value_int (align, -1, "section alignment"));
os->load_base = ebase;
return os;
@@ -4047,9 +5302,9 @@ lang_enter_output_section_statement (const char *output_section_statement_name,
void
lang_final (void)
{
- lang_output_statement_type *new =
- new_stat (lang_output_statement, stat_ptr);
+ lang_output_statement_type *new;
+ new = new_stat (lang_output_statement, stat_ptr);
new->name = output_filename;
}
@@ -4060,6 +5315,7 @@ lang_reset_memory_regions (void)
{
lang_memory_region_type *p = lang_memory_region_list;
asection *o;
+ lang_output_section_statement_type *os;
for (p = lang_memory_region_list; p != NULL; p = p->next)
{
@@ -4067,12 +5323,20 @@ lang_reset_memory_regions (void)
p->current = p->origin;
}
+ for (os = &lang_output_section_statement.head->output_section_statement;
+ os != NULL;
+ os = os->next)
+ os->processed = FALSE;
+
for (o = output_bfd->sections; o != NULL; o = o->next)
- o->_raw_size = 0;
+ {
+ /* Save the last size for possible use by bfd_relax_section. */
+ o->rawsize = o->size;
+ o->size = 0;
+ }
}
-/* If the wild pattern was marked KEEP, the member sections
- should be as well. */
+/* Worker for lang_gc_sections_1. */
static void
gc_section_callback (lang_wild_statement_type *ptr,
@@ -4081,18 +5345,12 @@ gc_section_callback (lang_wild_statement_type *ptr,
lang_input_statement_type *file ATTRIBUTE_UNUSED,
void *data ATTRIBUTE_UNUSED)
{
+ /* If the wild pattern was marked KEEP, the member sections
+ should be as well. */
if (ptr->keep_sections)
section->flags |= SEC_KEEP;
}
-/* Handle a wild statement, marking it against GC. */
-
-static void
-lang_gc_wild (lang_wild_statement_type *s)
-{
- walk_wild (s, gc_section_callback, NULL);
-}
-
/* Iterate over sections marking them against GC. */
static void
@@ -4103,7 +5361,7 @@ lang_gc_sections_1 (lang_statement_union_type *s)
switch (s->header.type)
{
case lang_wild_statement_enum:
- lang_gc_wild (&s->wild_statement);
+ walk_wild (&s->wild_statement, gc_section_callback, NULL);
break;
case lang_constructors_statement_enum:
lang_gc_sections_1 (constructor_list.head);
@@ -4147,13 +5405,58 @@ lang_gc_sections (void)
}
}
- bfd_gc_sections (output_bfd, &link_info);
+ /* SEC_EXCLUDE is ignored when doing a relocatable link, except in
+ the special case of debug info. (See bfd/stabs.c)
+ Twiddle the flag here, to simplify later linker code. */
+ if (link_info.relocatable)
+ {
+ LANG_FOR_EACH_INPUT_STATEMENT (f)
+ {
+ asection *sec;
+ for (sec = f->the_bfd->sections; sec != NULL; sec = sec->next)
+ if ((sec->flags & SEC_DEBUGGING) == 0)
+ sec->flags &= ~SEC_EXCLUDE;
+ }
+ }
+
+ if (link_info.gc_sections)
+ bfd_gc_sections (output_bfd, &link_info);
+}
+
+/* Relax all sections until bfd_relax_section gives up. */
+
+static void
+relax_sections (void)
+{
+ /* Keep relaxing until bfd_relax_section gives up. */
+ bfd_boolean relax_again;
+
+ do
+ {
+ 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
+ pe-dll.c also. DJ */
+
+ /* Do all the assignments with our current guesses as to
+ section sizes. */
+ lang_do_assignments ();
+
+ /* We must do this after lang_do_assignments, because it uses
+ 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 (&relax_again, FALSE);
+ }
+ while (relax_again);
}
void
lang_process (void)
{
- lang_reasonable_defaults ();
current_target = default_target;
/* Open the output file. */
@@ -4165,7 +5468,8 @@ lang_process (void)
/* Add to the hash table all undefineds on the command line. */
lang_place_undefineds ();
- already_linked_table_init ();
+ if (!bfd_section_already_linked_table_init ())
+ einfo (_("%P%F: Failed to create hash table\n"));
/* Create a bfd for each input file. */
current_target = default_target;
@@ -4177,7 +5481,7 @@ lang_process (void)
ldemul_after_open ();
- already_linked_table_free ();
+ bfd_section_already_linked_table_free ();
/* Make sure that we're not mixing architectures. We call this
after all the input files have been opened, but before we do any
@@ -4195,18 +5499,14 @@ lang_process (void)
ldctor_build_sets ();
/* Remove unreferenced sections if asked to. */
- if (command_line.gc_sections)
- lang_gc_sections ();
-
- /* If there were any SEC_MERGE sections, finish their merging, so that
- section sizes can be computed. This has to be done after GC of sections,
- so that GCed sections are not merged, but before assigning output
- sections, since removing whole input sections is hard then. */
- bfd_merge_sections (output_bfd, &link_info);
+ lang_gc_sections ();
/* Size up the common data. */
lang_common ();
+ /* Update wild statements. */
+ update_wild_statements (statement_list.head);
+
/* Run through the contours of the script and attach input sections
to the correct output sections. */
map_input_to_output_sections (statement_list.head, NULL, NULL);
@@ -4216,8 +5516,16 @@ lang_process (void)
if (! link_info.relocatable)
{
+ asection *found;
+
+ /* Merge SEC_MERGE sections. This has to be done after GC of
+ sections, so that GCed sections are not merged, but before
+ assigning dynamic symbols, since removing whole input sections
+ is hard then. */
+ bfd_merge_sections (output_bfd, &link_info);
+
/* Look for a text section and set the readonly attribute in it. */
- asection *found = bfd_get_section_by_name (output_bfd, ".text");
+ found = bfd_get_section_by_name (output_bfd, ".text");
if (found != NULL)
{
@@ -4232,61 +5540,32 @@ lang_process (void)
and other back-ends size dynamic sections. */
ldemul_before_allocation ();
- if (!link_info.relocatable)
- strip_excluded_output_sections ();
-
/* We must record the program headers before we try to fix the
section positions, since they will affect SIZEOF_HEADERS. */
lang_record_phdrs ();
/* Size up the sections. */
- lang_size_sections (statement_list.head, abs_output_section,
- &statement_list.head, 0, 0, NULL,
- command_line.relax ? FALSE : TRUE);
+ lang_size_sections (NULL, !command_line.relax);
/* Now run around and relax if we can. */
if (command_line.relax)
{
- /* Keep relaxing until bfd_relax_section gives up. */
- bfd_boolean relax_again;
-
- do
- {
- relax_again = FALSE;
+ /* We may need more than one relaxation pass. */
+ int i = link_info.relax_pass;
- /* Note: pe-dll.c does something like this also. If you find
- you need to change this code, you probably need to change
- pe-dll.c also. DJ */
+ /* The backend can use it to determine the current pass. */
+ link_info.relax_pass = 0;
- /* Do all the assignments with our current guesses as to
- section sizes. */
- 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, 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 (i--)
+ {
+ relax_sections ();
+ link_info.relax_pass++;
}
- while (relax_again);
/* Final extra sizing to report errors. */
- lang_do_assignments (statement_list.head, abs_output_section, NULL, 0);
+ lang_do_assignments ();
lang_reset_memory_regions ();
- lang_size_sections (statement_list.head, abs_output_section,
- &statement_list.head, 0, 0, NULL, TRUE);
+ lang_size_sections (NULL, TRUE);
}
/* See if anything special should be done now we know how big
@@ -4299,7 +5578,7 @@ lang_process (void)
/* 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, NULL, 0);
+ lang_do_assignments ();
/* Make sure that the section addresses make sense. */
if (! link_info.relocatable
@@ -4307,9 +5586,8 @@ lang_process (void)
lang_check_section_addresses ();
/* Final stuffs. */
-
ldemul_finish ();
- lang_finish ();
+ lang_end ();
}
/* EXPORTED TO YACC */
@@ -4348,21 +5626,24 @@ lang_add_wild (struct wildcard_spec *filespec,
if (filespec != NULL)
{
new->filename = filespec->name;
- new->filenames_sorted = filespec->sorted;
+ new->filenames_sorted = filespec->sorted == by_name;
}
new->section_list = section_list;
new->keep_sections = keep_sections;
lang_list_init (&new->children);
+ analyze_walk_wild_section_handler (new);
}
void
-lang_section_start (const char *name, etree_type *address)
+lang_section_start (const char *name, etree_type *address,
+ const segment_type *segment)
{
lang_address_statement_type *ad;
ad = new_stat (lang_address_statement, stat_ptr);
ad->section_name = name;
ad->address = address;
+ ad->segment = segment;
}
/* Set the start symbol to NAME. CMDLINE is nonzero if this is called
@@ -4382,14 +5663,23 @@ lang_add_entry (const char *name, bfd_boolean cmdline)
}
}
+/* Set the default start symbol to NAME. .em files should use this,
+ not lang_add_entry, to override the use of "start" if neither the
+ linker script nor the command line specifies an entry point. NAME
+ must be permanently allocated. */
+void
+lang_default_entry (const char *name)
+{
+ entry_symbol_default = name;
+}
+
void
lang_add_target (const char *name)
{
- lang_target_statement_type *new = new_stat (lang_target_statement,
- stat_ptr);
+ lang_target_statement_type *new;
+ new = new_stat (lang_target_statement, stat_ptr);
new->target = name;
-
}
void
@@ -4410,22 +5700,20 @@ lang_add_map (const char *name)
void
lang_add_fill (fill_type *fill)
{
- lang_fill_statement_type *new = new_stat (lang_fill_statement,
- stat_ptr);
+ lang_fill_statement_type *new;
+ new = new_stat (lang_fill_statement, stat_ptr);
new->fill = fill;
}
void
lang_add_data (int type, union etree_union *exp)
{
+ lang_data_statement_type *new;
- lang_data_statement_type *new = new_stat (lang_data_statement,
- stat_ptr);
-
+ new = new_stat (lang_data_statement, stat_ptr);
new->exp = exp;
new->type = type;
-
}
/* Create a new reloc statement. RELOC is the BFD relocation type to
@@ -4452,15 +5740,15 @@ lang_add_reloc (bfd_reloc_code_real_type reloc,
p->addend_value = 0;
p->output_section = NULL;
- p->output_vma = 0;
+ p->output_offset = 0;
}
lang_assignment_statement_type *
lang_add_assignment (etree_type *exp)
{
- lang_assignment_statement_type *new = new_stat (lang_assignment_statement,
- stat_ptr);
+ lang_assignment_statement_type *new;
+ new = new_stat (lang_assignment_statement, stat_ptr);
new->exp = exp;
return new;
}
@@ -4468,7 +5756,7 @@ lang_add_assignment (etree_type *exp)
void
lang_add_attribute (enum statement_enum attribute)
{
- new_statement (attribute, sizeof (lang_statement_union_type), stat_ptr);
+ new_statement (attribute, sizeof (lang_statement_header_type), stat_ptr);
}
void
@@ -4476,7 +5764,7 @@ lang_startup (const char *name)
{
if (startup_file != NULL)
{
- einfo (_("%P%Fmultiple STARTUP files\n"));
+ einfo (_("%P%F: multiple STARTUP files\n"));
}
first_file->filename = name;
first_file->local_sym_name = name;
@@ -4513,8 +5801,9 @@ lang_get_regions (lang_memory_region_type **region,
{
*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 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)
@@ -4598,7 +5887,7 @@ lang_abs_symbol_at_end_of (const char *secname, const char *name)
h->u.def.value = 0;
else
h->u.def.value = (bfd_get_section_vma (output_bfd, sec)
- + TO_ADDR (bfd_section_size (output_bfd, sec)));
+ + TO_ADDR (sec->size));
h->u.def.section = bfd_abs_section_ptr;
}
@@ -4674,8 +5963,7 @@ lang_new_phdr (const char *name,
n = stat_alloc (sizeof (struct lang_phdr));
n->next = NULL;
n->name = name;
- n->type = exp_get_value_int (type, 0, "program header type",
- lang_final_phase_enum);
+ n->type = exp_get_value_int (type, 0, "program header type");
n->filehdr = filehdr;
n->phdrs = phdrs;
n->at = at;
@@ -4696,7 +5984,7 @@ lang_record_phdrs (void)
asection **secs;
lang_output_section_phdr_list *last;
struct lang_phdr *l;
- lang_statement_union_type *u;
+ lang_output_section_statement_type *os;
alc = 10;
secs = xmalloc (alc * sizeof (asection *));
@@ -4708,14 +5996,14 @@ lang_record_phdrs (void)
bfd_vma at;
c = 0;
- for (u = lang_output_section_statement.head;
- u != NULL;
- u = u->output_section_statement.next)
+ for (os = &lang_output_section_statement.head->output_section_statement;
+ os != NULL;
+ os = os->next)
{
- lang_output_section_statement_type *os;
lang_output_section_phdr_list *pl;
- os = &u->output_section_statement;
+ if (os->constraint == -1)
+ continue;
pl = os->phdrs;
if (pl != NULL)
@@ -4751,14 +6039,12 @@ lang_record_phdrs (void)
if (l->flags == NULL)
flags = 0;
else
- flags = exp_get_vma (l->flags, 0, "phdr flags",
- lang_final_phase_enum);
+ flags = exp_get_vma (l->flags, 0, "phdr flags");
if (l->at == NULL)
at = 0;
else
- at = exp_get_vma (l->at, 0, "phdr load address",
- lang_final_phase_enum);
+ at = exp_get_vma (l->at, 0, "phdr load address");
if (! bfd_record_phdr (output_bfd, l->type,
l->flags != NULL, flags, l->at != NULL,
@@ -4769,21 +6055,22 @@ lang_record_phdrs (void)
free (secs);
/* Make sure all the phdr assignments succeeded. */
- for (u = lang_output_section_statement.head;
- u != NULL;
- u = u->output_section_statement.next)
+ for (os = &lang_output_section_statement.head->output_section_statement;
+ os != NULL;
+ os = os->next)
{
lang_output_section_phdr_list *pl;
- if (u->output_section_statement.bfd_section == NULL)
+ if (os->constraint == -1
+ || os->bfd_section == NULL)
continue;
- for (pl = u->output_section_statement.phdrs;
+ for (pl = os->phdrs;
pl != NULL;
pl = pl->next)
if (! pl->used && strcmp (pl->name, "NONE") != 0)
einfo (_("%X%P: section `%s' assigned to non-existent phdr `%s'\n"),
- u->output_section_statement.name, pl->name);
+ os->name, pl->name);
}
}
@@ -4847,7 +6134,7 @@ lang_enter_overlay_section (const char *name)
etree_type *size;
lang_enter_output_section_statement (name, overlay_vma, normal_section,
- 0, overlay_subalign, 0);
+ 0, overlay_subalign, 0, 0);
/* If this is the first section, then base the VMA of future
sections on this one. This will work correctly even if `.' is
@@ -5036,8 +6323,8 @@ lang_vers_match (struct bfd_elf_version_expr_head *head,
while (expr && strcmp (expr->symbol, sym) == 0)
if (expr->mask == BFD_ELF_VERSION_C_TYPE)
goto out_ret;
- else
- expr = expr->next;
+ else
+ expr = expr->next;
}
/* Fallthrough */
case BFD_ELF_VERSION_C_TYPE:
@@ -5048,8 +6335,8 @@ lang_vers_match (struct bfd_elf_version_expr_head *head,
while (expr && strcmp (expr->symbol, cxx_sym) == 0)
if (expr->mask == BFD_ELF_VERSION_CXX_TYPE)
goto out_ret;
- else
- expr = expr->next;
+ else
+ expr = expr->next;
}
/* Fallthrough */
case BFD_ELF_VERSION_CXX_TYPE:
@@ -5060,8 +6347,8 @@ lang_vers_match (struct bfd_elf_version_expr_head *head,
while (expr && strcmp (expr->symbol, java_sym) == 0)
if (expr->mask == BFD_ELF_VERSION_JAVA_TYPE)
goto out_ret;
- else
- expr = expr->next;
+ else
+ expr = expr->next;
}
/* Fallthrough */
default:
@@ -5074,10 +6361,13 @@ lang_vers_match (struct bfd_elf_version_expr_head *head,
expr = head->remaining;
else
expr = prev->next;
- while (expr)
+ for (; expr; expr = expr->next)
{
const char *s;
+ if (!expr->pattern)
+ continue;
+
if (expr->pattern[0] == '*' && expr->pattern[1] == '\0')
break;
@@ -5089,7 +6379,6 @@ lang_vers_match (struct bfd_elf_version_expr_head *head,
s = sym;
if (fnmatch (expr->pattern, s, 0) == 0)
break;
- expr = expr->next;
}
out_ret:
@@ -5144,21 +6433,24 @@ realsymbol (const char *pattern)
}
}
-/* This is called for each variable name or match expression. */
+/* This is called for each variable name or match expression. NEW is
+ the name of the symbol to match, or, if LITERAL_P is FALSE, a glob
+ pattern to be matched against symbol names. */
struct bfd_elf_version_expr *
lang_new_vers_pattern (struct bfd_elf_version_expr *orig,
const char *new,
- const char *lang)
+ const char *lang,
+ bfd_boolean literal_p)
{
struct bfd_elf_version_expr *ret;
ret = xmalloc (sizeof *ret);
ret->next = orig;
- ret->pattern = new;
+ ret->pattern = literal_p ? NULL : new;
ret->symver = 0;
ret->script = 0;
- ret->symbol = realsymbol (new);
+ ret->symbol = literal_p ? new : realsymbol (new);
if (lang == NULL || strcasecmp (lang, "C") == 0)
ret->mask = BFD_ELF_VERSION_C_TYPE;
@@ -5310,7 +6602,8 @@ lang_register_vers_node (const char *name,
if ((name[0] == '\0' && lang_elf_version_info != NULL)
|| (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"));
+ einfo (_("%X%P: anonymous version tag cannot be combined"
+ " with other version tags\n"));
free (version);
return;
}
@@ -5338,16 +6631,17 @@ lang_register_vers_node (const char *name,
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);
+ 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);
+ if (strcmp (e1->pattern, e2->pattern) == 0
+ && e1->mask == e2->mask)
+ einfo (_("%X%P: duplicate expression `%s'"
+ " in version information\n"), e1->pattern);
}
}
@@ -5363,16 +6657,18 @@ lang_register_vers_node (const char *name,
while (e2 && strcmp (e1->symbol, e2->symbol) == 0)
{
if (e1->mask == e2->mask)
- einfo (_("%X%P: duplicate expression `%s' in version information\n"),
+ 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);
+ if (strcmp (e1->pattern, e2->pattern) == 0
+ && e1->mask == e2->mask)
+ einfo (_("%X%P: duplicate expression `%s'"
+ " in version information\n"), e1->pattern);
}
}
@@ -5430,7 +6726,7 @@ lang_do_version_exports_section (void)
if (sec == NULL)
continue;
- len = bfd_section_size (is->the_bfd, sec);
+ len = sec->size;
contents = xmalloc (len);
if (!bfd_get_section_contents (is->the_bfd, sec, contents, 0, len))
einfo (_("%X%P: unable to read .exports section contents\n"), sec);
@@ -5438,18 +6734,17 @@ lang_do_version_exports_section (void)
p = contents;
while (p < contents + len)
{
- greg = lang_new_vers_pattern (greg, p, NULL);
+ greg = lang_new_vers_pattern (greg, p, NULL, FALSE);
p = strchr (p, '\0') + 1;
}
/* Do not free the contents, as we used them creating the regex. */
/* Do not include this section in the link. */
- bfd_set_section_flags (is->the_bfd, sec,
- bfd_get_section_flags (is->the_bfd, sec) | SEC_EXCLUDE);
+ sec->flags |= SEC_EXCLUDE;
}
- lreg = lang_new_vers_pattern (NULL, "*", NULL);
+ lreg = lang_new_vers_pattern (NULL, "*", NULL, FALSE);
lang_register_vers_node (command_line.version_exports_section,
lang_new_vers_node (greg, lreg), NULL);
}
diff --git a/contrib/binutils/ld/ldlang.h b/contrib/binutils/ld/ldlang.h
index 649fea1..8b0d492 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, 2003, 2004
+ 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -17,8 +17,8 @@
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. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#ifndef LDLANG_H
#define LDLANG_H
@@ -128,25 +128,15 @@ typedef struct lang_output_section_phdr_list
typedef struct lang_output_section_statement_struct
{
lang_statement_header_type header;
- union etree_union *addr_tree;
lang_statement_list_type children;
- const char *memspec;
- union lang_statement_union *next;
+ struct lang_output_section_statement_struct *next;
+ struct lang_output_section_statement_struct *prev;
const char *name;
-
- int processed;
-
asection *bfd_section;
- flagword flags; /* Or together of all input sections. */
- enum section_type sectype;
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. */
-
+ union etree_union *addr_tree;
union etree_union *load_base;
/* If non-null, an expression to evaluate after setting the section's
@@ -156,6 +146,16 @@ typedef struct lang_output_section_statement_struct
union etree_union *update_dot_tree;
lang_output_section_phdr_list *phdrs;
+
+ unsigned int block_value;
+ int subsection_alignment; /* Alignment of components. */
+ int section_alignment; /* Alignment of start of section. */
+ int constraint;
+ flagword flags;
+ enum section_type sectype;
+ unsigned int processed : 1;
+ unsigned int all_input_readonly : 1;
+ unsigned int ignored : 1;
} lang_output_section_statement_type;
typedef struct
@@ -183,7 +183,7 @@ typedef struct
union etree_union *exp;
bfd_vma value;
asection *output_section;
- bfd_vma output_vma;
+ bfd_vma output_offset;
} lang_data_statement_type;
/* Generate a reloc in the output file. */
@@ -215,8 +215,8 @@ typedef struct
/* Output section where reloc should be performed. */
asection *output_section;
- /* VMA within output section. */
- bfd_vma output_vma;
+ /* Offset within output section. */
+ bfd_vma output_offset;
} lang_reloc_statement_type;
typedef struct lang_input_statement_struct
@@ -231,7 +231,6 @@ typedef struct lang_input_statement_struct
bfd *the_bfd;
- bfd_boolean closed;
file_ptr passive_position;
/* Symbol table of the file. */
@@ -245,47 +244,48 @@ typedef struct lang_input_statement_struct
/* Point to the next file, but skips archive contents. */
union lang_statement_union *next_real_file;
- bfd_boolean is_archive;
+ const char *target;
+
+ unsigned int closed : 1;
+ unsigned int is_archive : 1;
/* 1 means search a set of directories for this file. */
- bfd_boolean search_dirs_flag;
+ unsigned int search_dirs_flag : 1;
/* 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;
+ unsigned int sysrooted : 1;
/* 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. */
- bfd_boolean just_syms_flag;
+ unsigned int just_syms_flag : 1;
/* Whether to search for this entry as a dynamic archive. */
- bfd_boolean dynamic;
+ unsigned int dynamic : 1;
+
+ /* Whether DT_NEEDED tags should be added for dynamic libraries in
+ DT_NEEDED tags from this entry. */
+ unsigned int add_needed : 1;
/* Whether this entry should cause a DT_NEEDED tag only when
satisfying references from regular files, or always. */
- bfd_boolean as_needed;
+ unsigned int as_needed : 1;
/* Whether to include the entire contents of an archive. */
- bfd_boolean whole_archive;
+ unsigned int whole_archive : 1;
- bfd_boolean loaded;
+ unsigned int loaded : 1;
-#if 0
- unsigned int globals_in_this_file;
-#endif
- const char *target;
- bfd_boolean real;
+ unsigned int real : 1;
} lang_input_statement_type;
typedef struct
{
lang_statement_header_type header;
asection *section;
- lang_input_statement_type *ifile;
-
} lang_input_section_type;
typedef struct
@@ -295,7 +295,20 @@ typedef struct
union lang_statement_union *file;
} lang_afile_asection_pair_statement_type;
-typedef struct lang_wild_statement_struct
+typedef struct lang_wild_statement_struct lang_wild_statement_type;
+
+typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
+ asection *, lang_input_statement_type *, void *);
+
+typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *,
+ lang_input_statement_type *,
+ callback_t callback,
+ void *data);
+
+typedef bfd_boolean (*lang_match_sec_type_func) (bfd *, const asection *,
+ bfd *, const asection *);
+
+struct lang_wild_statement_struct
{
lang_statement_header_type header;
const char *filename;
@@ -303,13 +316,17 @@ typedef struct lang_wild_statement_struct
struct wildcard_list *section_list;
bfd_boolean keep_sections;
lang_statement_list_type children;
-} lang_wild_statement_type;
+
+ walk_wild_section_handler_t walk_wild_section_handler;
+ struct wildcard_list *handler_data[4];
+};
typedef struct lang_address_statement_struct
{
lang_statement_header_type header;
const char *section_name;
union etree_union *address;
+ const segment_type *segment;
} lang_address_statement_type;
typedef struct
@@ -404,7 +421,16 @@ struct lang_definedness_hash_entry
int iteration;
};
-extern struct unique_sections *unique_section_list;
+/* Used by place_orphan to keep track of orphan sections and statements. */
+
+struct orphan_save {
+ const char *name;
+ flagword flags;
+ lang_output_section_statement_type *os;
+ asection **section;
+ lang_statement_union_type **stmt;
+ lang_output_section_statement_type **os_tail;
+};
extern lang_output_section_statement_type *abs_output_section;
extern lang_statement_list_type lang_output_section_statement;
@@ -422,6 +448,8 @@ extern int lang_statement_iteration;
extern void lang_init
(void);
+extern void lang_finish
+ (void);
extern lang_memory_region_type *lang_memory_region_lookup
(const char *const, bfd_boolean);
extern lang_memory_region_type *lang_memory_region_default
@@ -438,15 +466,17 @@ extern lang_output_section_statement_type *lang_enter_output_section_statement
enum section_type sectype,
etree_type *align,
etree_type *subalign,
- etree_type *);
+ etree_type *, int);
extern void lang_final
(void);
extern void lang_process
(void);
extern void lang_section_start
- (const char *, union etree_union *);
+ (const char *, union etree_union *, const segment_type *);
extern void lang_add_entry
(const char *, bfd_boolean);
+extern void lang_default_entry
+ (const char *);
extern void lang_add_target
(const char *);
extern void lang_add_wild
@@ -480,8 +510,7 @@ extern void lang_for_each_file
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);
+ (void);
#define LANG_FOR_EACH_INPUT_STATEMENT(statement) \
lang_input_statement_type *statement; \
@@ -495,6 +524,12 @@ extern void ldlang_add_file
(lang_input_statement_type *);
extern lang_output_section_statement_type *lang_output_section_find
(const char * const);
+extern lang_output_section_statement_type *lang_output_section_find_by_flags
+ (const asection *, lang_output_section_statement_type **,
+ lang_match_sec_type_func);
+extern lang_output_section_statement_type *lang_insert_orphan
+ (asection *, const char *, lang_output_section_statement_type *,
+ struct orphan_save *, etree_type *, lang_statement_list_type *);
extern lang_input_statement_type *lang_add_input_file
(const char *, lang_input_file_enum_type, const char *);
extern void lang_add_keepsyms_file
@@ -517,19 +552,21 @@ extern void lang_for_each_statement
(void (*) (lang_statement_union_type *));
extern void *stat_alloc
(size_t);
+extern void strip_excluded_output_sections
+ (void);
extern void dprint_statement
(lang_statement_union_type *, int);
-extern bfd_vma lang_size_sections
- (lang_statement_union_type *, lang_output_section_statement_type *,
- lang_statement_union_type **, fill_type *, bfd_vma, bfd_boolean *,
- bfd_boolean);
+extern void lang_size_sections
+ (bfd_boolean *, bfd_boolean);
+extern void one_lang_size_sections_pass
+ (bfd_boolean *, bfd_boolean);
extern void lang_enter_group
(void);
extern void lang_leave_group
(void);
extern void lang_add_section
(lang_statement_list_type *, asection *,
- lang_output_section_statement_type *, lang_input_statement_type *);
+ lang_output_section_statement_type *);
extern void lang_new_phdr
(const char *, etree_type *, bfd_boolean, bfd_boolean, etree_type *,
etree_type *);
@@ -548,7 +585,7 @@ extern void lang_leave_overlay
extern struct bfd_elf_version_tree *lang_elf_version_info;
extern struct bfd_elf_version_expr *lang_new_vers_pattern
- (struct bfd_elf_version_expr *, const char *, const char *);
+ (struct bfd_elf_version_expr *, const char *, const char *, bfd_boolean);
extern struct bfd_elf_version_tree *lang_new_vers_node
(struct bfd_elf_version_expr *, struct bfd_elf_version_expr *);
extern struct bfd_elf_version_deps *lang_add_vers_depend
@@ -556,7 +593,7 @@ extern struct bfd_elf_version_deps *lang_add_vers_depend
extern void lang_register_vers_node
(const char *, struct bfd_elf_version_tree *, struct bfd_elf_version_deps *);
bfd_boolean unique_section_p
- (const char *);
+ (const asection *);
extern void lang_add_unique
(const char *);
extern const char *lang_get_output_target
@@ -566,4 +603,6 @@ extern int lang_symbol_definition_iteration (const char *);
extern void lang_update_definedness
(const char *, struct bfd_link_hash_entry *);
+extern void add_excluded_libs (const char *);
+
#endif
diff --git a/contrib/binutils/ld/ldlex.h b/contrib/binutils/ld/ldlex.h
index f956e9c..d35ead6 100644
--- a/contrib/binutils/ld/ldlex.h
+++ b/contrib/binutils/ld/ldlex.h
@@ -16,8 +16,8 @@
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. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#ifndef LDLEX_H
#define LDLEX_H
diff --git a/contrib/binutils/ld/ldlex.l b/contrib/binutils/ld/ldlex.l
index aeac817..56ec391 100644
--- a/contrib/binutils/ld/ldlex.l
+++ b/contrib/binutils/ld/ldlex.l
@@ -1,24 +1,24 @@
%{
/* Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004, 2005 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, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
/*
This was written by steve chamberlain
@@ -28,11 +28,6 @@ This was written by steve chamberlain
#include <stdio.h>
-#ifdef MPW
-/* Prevent enum redefinition problems. */
-#define TRUE_FALSE_ALREADY_DEFINED
-#endif /* MPW */
-
#include "bfd.h"
#include "sysdep.h"
#include "safe-ctype.h"
@@ -70,6 +65,8 @@ const char *lex_string = NULL;
#undef YY_INPUT
#define YY_INPUT(buf,result,max_size) yy_input (buf, &result, max_size)
+#define YY_NO_UNPUT
+
#define MAX_INCLUDE_DEPTH 10
static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
static const char *file_name_stack[MAX_INCLUDE_DEPTH];
@@ -239,88 +236,97 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
<BOTH,SCRIPT,EXPRESSION,MRI>"/" { RTOKEN('/');}
<BOTH,SCRIPT,EXPRESSION,MRI>"%" { RTOKEN('%');}
<BOTH,SCRIPT,EXPRESSION,MRI>"<" { RTOKEN('<');}
-<BOTH,SCRIPT,EXPRESSION,MRI>"=" { RTOKEN('=');}
-<BOTH,SCRIPT,EXPRESSION,MRI>"}" { RTOKEN('}') ; }
-<BOTH,SCRIPT,EXPRESSION,MRI>"{" { RTOKEN('{'); }
-<BOTH,SCRIPT,EXPRESSION,MRI>")" { RTOKEN(')');}
-<BOTH,SCRIPT,EXPRESSION,MRI>"(" { RTOKEN('(');}
+<BOTH,SCRIPT,EXPRESSION,MRI>"=" { RTOKEN('=');}
+<BOTH,SCRIPT,EXPRESSION,MRI>"}" { RTOKEN('}') ; }
+<BOTH,SCRIPT,EXPRESSION,MRI>"{" { RTOKEN('{'); }
+<BOTH,SCRIPT,EXPRESSION,MRI>")" { RTOKEN(')');}
+<BOTH,SCRIPT,EXPRESSION,MRI>"(" { RTOKEN('(');}
<BOTH,SCRIPT,EXPRESSION,MRI>":" { RTOKEN(':'); }
<BOTH,SCRIPT,EXPRESSION,MRI>";" { RTOKEN(';');}
-<BOTH,SCRIPT>"MEMORY" { RTOKEN(MEMORY);}
-<BOTH,SCRIPT>"ORIGIN" { RTOKEN(ORIGIN);}
-<BOTH,SCRIPT>"VERSION" { RTOKEN(VERSIONK);}
+<BOTH,SCRIPT>"MEMORY" { RTOKEN(MEMORY);}
+<BOTH,SCRIPT,EXPRESSION>"ORIGIN" { RTOKEN(ORIGIN);}
+<BOTH,SCRIPT>"VERSION" { RTOKEN(VERSIONK);}
<EXPRESSION,BOTH,SCRIPT>"BLOCK" { RTOKEN(BLOCK);}
<EXPRESSION,BOTH,SCRIPT>"BIND" { RTOKEN(BIND);}
-<BOTH,SCRIPT>"LENGTH" { RTOKEN(LENGTH);}
-<EXPRESSION,BOTH,SCRIPT>"ALIGN" { RTOKEN(ALIGN_K);}
+<BOTH,SCRIPT,EXPRESSION>"LENGTH" { RTOKEN(LENGTH);}
+<EXPRESSION,BOTH,SCRIPT>"ALIGN" { RTOKEN(ALIGN_K);}
<EXPRESSION,BOTH,SCRIPT>"DATA_SEGMENT_ALIGN" { RTOKEN(DATA_SEGMENT_ALIGN);}
+<EXPRESSION,BOTH,SCRIPT>"DATA_SEGMENT_RELRO_END" { RTOKEN(DATA_SEGMENT_RELRO_END);}
<EXPRESSION,BOTH,SCRIPT>"DATA_SEGMENT_END" { RTOKEN(DATA_SEGMENT_END);}
-<EXPRESSION,BOTH,SCRIPT>"ADDR" { RTOKEN(ADDR);}
-<EXPRESSION,BOTH,SCRIPT>"LOADADDR" { RTOKEN(LOADADDR);}
+<EXPRESSION,BOTH,SCRIPT>"ADDR" { RTOKEN(ADDR);}
+<EXPRESSION,BOTH,SCRIPT>"LOADADDR" { RTOKEN(LOADADDR);}
<EXPRESSION,BOTH>"MAX" { RTOKEN(MAX_K); }
<EXPRESSION,BOTH>"MIN" { RTOKEN(MIN_K); }
<EXPRESSION,BOTH>"ASSERT" { RTOKEN(ASSERT_K); }
<BOTH,SCRIPT>"ENTRY" { RTOKEN(ENTRY);}
<BOTH,SCRIPT,MRI>"EXTERN" { RTOKEN(EXTERN);}
-<EXPRESSION,BOTH,SCRIPT>"NEXT" { RTOKEN(NEXT);}
+<EXPRESSION,BOTH,SCRIPT>"NEXT" { RTOKEN(NEXT);}
<EXPRESSION,BOTH,SCRIPT>"sizeof_headers" { RTOKEN(SIZEOF_HEADERS);}
<EXPRESSION,BOTH,SCRIPT>"SIZEOF_HEADERS" { RTOKEN(SIZEOF_HEADERS);}
+<EXPRESSION,BOTH,SCRIPT>"SEGMENT_START" { RTOKEN(SEGMENT_START);}
<BOTH,SCRIPT>"MAP" { RTOKEN(MAP);}
-<EXPRESSION,BOTH,SCRIPT>"SIZEOF" { RTOKEN(SIZEOF);}
-<BOTH,SCRIPT>"TARGET" { RTOKEN(TARGET_K);}
+<EXPRESSION,BOTH,SCRIPT>"SIZEOF" { RTOKEN(SIZEOF);}
+<BOTH,SCRIPT>"TARGET" { RTOKEN(TARGET_K);}
<BOTH,SCRIPT>"SEARCH_DIR" { RTOKEN(SEARCH_DIR);}
-<BOTH,SCRIPT>"OUTPUT" { RTOKEN(OUTPUT);}
+<BOTH,SCRIPT>"OUTPUT" { RTOKEN(OUTPUT);}
<BOTH,SCRIPT>"INPUT" { RTOKEN(INPUT);}
<EXPRESSION,BOTH,SCRIPT>"GROUP" { RTOKEN(GROUP);}
-<EXPRESSION,BOTH,SCRIPT>"DEFINED" { RTOKEN(DEFINED);}
+<EXPRESSION,BOTH,SCRIPT>"AS_NEEDED" { RTOKEN(AS_NEEDED);}
+<EXPRESSION,BOTH,SCRIPT>"DEFINED" { RTOKEN(DEFINED);}
<BOTH,SCRIPT>"CREATE_OBJECT_SYMBOLS" { RTOKEN(CREATE_OBJECT_SYMBOLS);}
<BOTH,SCRIPT>"CONSTRUCTORS" { RTOKEN( CONSTRUCTORS);}
-<BOTH,SCRIPT>"FORCE_COMMON_ALLOCATION" { RTOKEN(FORCE_COMMON_ALLOCATION);}
+<BOTH,SCRIPT>"FORCE_COMMON_ALLOCATION" { RTOKEN(FORCE_COMMON_ALLOCATION);}
<BOTH,SCRIPT>"INHIBIT_COMMON_ALLOCATION" { RTOKEN(INHIBIT_COMMON_ALLOCATION);}
-<BOTH,SCRIPT>"SECTIONS" { RTOKEN(SECTIONS);}
+<BOTH,SCRIPT>"SECTIONS" { RTOKEN(SECTIONS);}
<BOTH,SCRIPT>"FILL" { RTOKEN(FILL);}
-<BOTH,SCRIPT>"STARTUP" { RTOKEN(STARTUP);}
+<BOTH,SCRIPT>"STARTUP" { RTOKEN(STARTUP);}
<BOTH,SCRIPT>"OUTPUT_FORMAT" { RTOKEN(OUTPUT_FORMAT);}
<BOTH,SCRIPT>"OUTPUT_ARCH" { RTOKEN( OUTPUT_ARCH);}
<BOTH,SCRIPT>"HLL" { RTOKEN(HLL);}
-<BOTH,SCRIPT>"SYSLIB" { RTOKEN(SYSLIB);}
+<BOTH,SCRIPT>"SYSLIB" { RTOKEN(SYSLIB);}
<BOTH,SCRIPT>"FLOAT" { RTOKEN(FLOAT);}
<BOTH,SCRIPT>"QUAD" { RTOKEN( QUAD);}
<BOTH,SCRIPT>"SQUAD" { RTOKEN( SQUAD);}
<BOTH,SCRIPT>"LONG" { RTOKEN( LONG);}
<BOTH,SCRIPT>"SHORT" { RTOKEN( SHORT);}
<BOTH,SCRIPT>"BYTE" { RTOKEN( BYTE);}
-<BOTH,SCRIPT>"NOFLOAT" { RTOKEN(NOFLOAT);}
+<BOTH,SCRIPT>"NOFLOAT" { RTOKEN(NOFLOAT);}
<EXPRESSION,BOTH,SCRIPT>"NOCROSSREFS" { RTOKEN(NOCROSSREFS);}
<BOTH,SCRIPT>"OVERLAY" { RTOKEN(OVERLAY); }
-<BOTH,SCRIPT>"SORT" { RTOKEN(SORT); }
+<BOTH,SCRIPT>"SORT_BY_NAME" { RTOKEN(SORT_BY_NAME); }
+<BOTH,SCRIPT>"SORT_BY_ALIGNMENT" { RTOKEN(SORT_BY_ALIGNMENT); }
+<BOTH,SCRIPT>"SORT" { RTOKEN(SORT_BY_NAME); }
<EXPRESSION,BOTH,SCRIPT>"NOLOAD" { RTOKEN(NOLOAD);}
<EXPRESSION,BOTH,SCRIPT>"DSECT" { RTOKEN(DSECT);}
<EXPRESSION,BOTH,SCRIPT>"COPY" { RTOKEN(COPY);}
<EXPRESSION,BOTH,SCRIPT>"INFO" { RTOKEN(INFO);}
<EXPRESSION,BOTH,SCRIPT>"OVERLAY" { RTOKEN(OVERLAY);}
+<EXPRESSION,BOTH,SCRIPT>"ONLY_IF_RO" { RTOKEN(ONLY_IF_RO); }
+<EXPRESSION,BOTH,SCRIPT>"ONLY_IF_RW" { RTOKEN(ONLY_IF_RW); }
+<EXPRESSION,BOTH,SCRIPT>"SPECIAL" { RTOKEN(SPECIAL); }
<BOTH,SCRIPT>"o" { RTOKEN(ORIGIN);}
<BOTH,SCRIPT>"org" { RTOKEN(ORIGIN);}
<BOTH,SCRIPT>"l" { RTOKEN( LENGTH);}
<BOTH,SCRIPT>"len" { RTOKEN( LENGTH);}
<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>"AT" { RTOKEN(AT);}
+<EXPRESSION,BOTH,SCRIPT>"SUBALIGN" { RTOKEN(SUBALIGN);}
+<EXPRESSION,BOTH,SCRIPT>"PROVIDE" { RTOKEN(PROVIDE); }
+<EXPRESSION,BOTH,SCRIPT>"PROVIDE_HIDDEN" { RTOKEN(PROVIDE_HIDDEN); }
<EXPRESSION,BOTH,SCRIPT>"KEEP" { RTOKEN(KEEP); }
-<EXPRESSION,BOTH,SCRIPT>"EXCLUDE_FILE" { RTOKEN(EXCLUDE_FILE); }
+<EXPRESSION,BOTH,SCRIPT>"EXCLUDE_FILE" { RTOKEN(EXCLUDE_FILE); }
<MRI>"#".*\n? { ++ lineno; }
<MRI>"\n" { ++ lineno; RTOKEN(NEWLINE); }
<MRI>"*".* { /* Mri comment line */ }
<MRI>";".* { /* Mri comment line */ }
<MRI>"END" { RTOKEN(ENDWORD); }
-<MRI>"ALIGNMOD" { RTOKEN(ALIGNMOD);}
-<MRI>"ALIGN" { RTOKEN(ALIGN_K);}
+<MRI>"ALIGNMOD" { RTOKEN(ALIGNMOD);}
+<MRI>"ALIGN" { RTOKEN(ALIGN_K);}
<MRI>"CHIP" { RTOKEN(CHIP); }
<MRI>"BASE" { RTOKEN(BASE); }
-<MRI>"ALIAS" { RTOKEN(ALIAS); }
-<MRI>"TRUNCATE" { RTOKEN(TRUNCATE); }
+<MRI>"ALIAS" { RTOKEN(ALIAS); }
+<MRI>"TRUNCATE" { RTOKEN(TRUNCATE); }
<MRI>"LOAD" { RTOKEN(LOAD); }
<MRI>"PUBLIC" { RTOKEN(PUBLIC); }
<MRI>"ORDER" { RTOKEN(ORDER); }
@@ -332,12 +338,12 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
<MRI>"SECT" { RTOKEN(SECT); }
<EXPRESSION,BOTH,SCRIPT,MRI>"ABSOLUTE" { RTOKEN(ABSOLUTE); }
<MRI>"end" { RTOKEN(ENDWORD); }
-<MRI>"alignmod" { RTOKEN(ALIGNMOD);}
-<MRI>"align" { RTOKEN(ALIGN_K);}
+<MRI>"alignmod" { RTOKEN(ALIGNMOD);}
+<MRI>"align" { RTOKEN(ALIGN_K);}
<MRI>"chip" { RTOKEN(CHIP); }
<MRI>"base" { RTOKEN(BASE); }
-<MRI>"alias" { RTOKEN(ALIAS); }
-<MRI>"truncate" { RTOKEN(TRUNCATE); }
+<MRI>"alias" { RTOKEN(ALIAS); }
+<MRI>"truncate" { RTOKEN(TRUNCATE); }
<MRI>"load" { RTOKEN(LOAD); }
<MRI>"public" { RTOKEN(PUBLIC); }
<MRI>"order" { RTOKEN(ORDER); }
diff --git a/contrib/binutils/ld/ldmain.c b/contrib/binutils/ld/ldmain.c
index d0e0b12..fbc3081 100644
--- a/contrib/binutils/ld/ldmain.c
+++ b/contrib/binutils/ld/ldmain.c
@@ -1,6 +1,6 @@
/* Main program of GNU linker.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004
+ 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
@@ -18,8 +18,8 @@
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. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -50,7 +50,7 @@
#include <string.h>
#ifdef HAVE_SBRK
-#ifdef NEED_DECLARATION_SBRK
+#if !HAVE_DECL_SBRK
extern void *sbrk ();
#endif
#endif
@@ -68,7 +68,7 @@ const char *output_filename = "a.out";
char *program_name;
/* The prefix for system library directories. */
-char *ld_sysroot;
+const char *ld_sysroot;
/* The canonical representation of ld_sysroot. */
char * ld_canon_sysroot;
@@ -97,6 +97,10 @@ bfd_boolean whole_archive;
actually satisfies some reference in a regular object. */
bfd_boolean as_needed;
+/* Nonzero means never create DT_NEEDED entries for dynamic libraries
+ in DT_NEEDED tags. */
+bfd_boolean add_needed = TRUE;
+
/* TRUE if we should demangle symbol names. */
bfd_boolean demangling;
@@ -104,6 +108,10 @@ args_type command_line;
ld_config_type config;
+sort_type sort_section;
+
+static const char *get_sysroot
+ (int, char **);
static char *get_emulation
(int, char **);
static void set_scripts_dir
@@ -131,8 +139,8 @@ 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);
+ (struct bfd_link_info *, struct bfd_link_hash_entry *, 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
@@ -153,7 +161,7 @@ static struct bfd_link_callbacks link_callbacks =
reloc_dangerous,
unattached_reloc,
notice,
- error_handler
+ einfo
};
struct bfd_link_info link_info;
@@ -166,7 +174,7 @@ remove_output (void)
if (output_bfd)
bfd_cache_close (output_bfd);
if (delete_output_file_on_failure)
- unlink (output_filename);
+ unlink_if_ordinary (output_filename);
}
}
@@ -190,53 +198,26 @@ main (int argc, char **argv)
START_PROGRESS (program_name, 0);
+ expandargv (&argc, &argv);
+
bfd_init ();
bfd_set_error_program_name (program_name);
xatexit (remove_output);
-#ifdef TARGET_SYSTEM_ROOT_RELOCATABLE
- ld_sysroot = make_relative_prefix (program_name, BINDIR,
- TARGET_SYSTEM_ROOT);
-
- if (ld_sysroot)
+ /* Set up the sysroot directory. */
+ ld_sysroot = get_sysroot (argc, argv);
+ if (*ld_sysroot)
{
- struct stat s;
- int res = stat (ld_sysroot, &s) == 0 && S_ISDIR (s.st_mode);
-
- if (!res)
+ if (*TARGET_SYSTEM_ROOT == 0)
{
- 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;
- }
+ einfo ("%P%F: this linker was not configured to use sysroots\n");
+ ld_sysroot = "";
}
+ else
+ ld_canon_sysroot = lrealpath (ld_sysroot);
}
-
- 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
@@ -267,6 +248,7 @@ main (int argc, char **argv)
config.has_shared = FALSE;
config.split_by_reloc = (unsigned) -1;
config.split_by_file = (bfd_size_type) -1;
+ config.hash_table_size = 0;
command_line.force_common_definition = FALSE;
command_line.inhibit_common_definition = FALSE;
command_line.interpreter = NULL;
@@ -274,6 +256,9 @@ main (int argc, char **argv)
command_line.warn_mismatch = TRUE;
command_line.check_section_addresses = TRUE;
command_line.accept_unknown_input_arch = FALSE;
+ command_line.reduce_memory_overheads = FALSE;
+
+ sort_section = none;
/* We initialize DEMANGLING based on the environment variable
COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
@@ -297,12 +282,15 @@ main (int argc, char **argv)
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.create_default_symver = FALSE;
+ link_info.default_imported_symver = FALSE;
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.relro = FALSE;
link_info.strip_discarded = TRUE;
link_info.strip = strip_none;
link_info.discard = discard_sec_merge;
@@ -325,7 +313,9 @@ main (int argc, char **argv)
link_info.spare_dynamic_tags = 5;
link_info.flags = 0;
link_info.flags_1 = 0;
- link_info.need_relax_finalize = FALSE;
+ link_info.relax_pass = 1;
+ link_info.warn_shared_textrel = FALSE;
+ link_info.gc_sections = FALSE;
ldfile_add_arch ("");
@@ -342,11 +332,14 @@ main (int argc, char **argv)
lang_has_input_file = FALSE;
parse_args (argc, argv);
+ if (config.hash_table_size != 0)
+ bfd_hash_set_default_size (config.hash_table_size);
+
ldemul_set_symbols ();
if (link_info.relocatable)
{
- if (command_line.gc_sections)
+ if (link_info.gc_sections)
einfo ("%P%F: --gc-sections and -r may not be used together\n");
else if (command_line.relax)
einfo (_("%P%F: --relax and -r may not be used together\n"));
@@ -481,6 +474,8 @@ main (int argc, char **argv)
if (nocrossref_list != NULL)
check_nocrossrefs ();
+ lang_finish ();
+
/* 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 relocatable output?) */
@@ -568,6 +563,51 @@ main (int argc, char **argv)
return 0;
}
+/* If the configured sysroot is relocatable, try relocating it based on
+ default prefix FROM. Return the relocated directory if it exists,
+ otherwise return null. */
+
+static char *
+get_relative_sysroot (const char *from ATTRIBUTE_UNUSED)
+{
+#ifdef TARGET_SYSTEM_ROOT_RELOCATABLE
+ char *path;
+ struct stat s;
+
+ path = make_relative_prefix (program_name, from, TARGET_SYSTEM_ROOT);
+ if (path)
+ {
+ if (stat (path, &s) == 0 && S_ISDIR (s.st_mode))
+ return path;
+ free (path);
+ }
+#endif
+ return 0;
+}
+
+/* Return the sysroot directory. Return "" if no sysroot is being used. */
+
+static const char *
+get_sysroot (int argc, char **argv)
+{
+ int i;
+ const char *path;
+
+ for (i = 1; i < argc; i++)
+ if (strncmp (argv[i], "--sysroot=", strlen ("--sysroot=")) == 0)
+ return argv[i] + strlen ("--sysroot=");
+
+ path = get_relative_sysroot (BINDIR);
+ if (path)
+ return path;
+
+ path = get_relative_sysroot (TOOLBINDIR);
+ if (path)
+ return path;
+
+ return TARGET_SYSTEM_ROOT;
+}
+
/* We need to find any explicitly given emulation in order to initialize the
state that's needed by the lex&yacc argument parser (parse_args). */
@@ -737,9 +777,10 @@ add_ysym (const char *name)
if (link_info.notice_hash == NULL)
{
link_info.notice_hash = xmalloc (sizeof (struct bfd_hash_table));
- if (! bfd_hash_table_init_n (link_info.notice_hash,
- bfd_hash_newfunc,
- 61))
+ if (!bfd_hash_table_init_n (link_info.notice_hash,
+ bfd_hash_newfunc,
+ sizeof (struct bfd_hash_entry),
+ 61))
einfo (_("%P%F: bfd_hash_table_init failed: %E\n"));
}
@@ -755,9 +796,10 @@ add_wrap (const char *name)
if (link_info.wrap_hash == NULL)
{
link_info.wrap_hash = xmalloc (sizeof (struct bfd_hash_table));
- if (! bfd_hash_table_init_n (link_info.wrap_hash,
- bfd_hash_newfunc,
- 61))
+ if (!bfd_hash_table_init_n (link_info.wrap_hash,
+ bfd_hash_newfunc,
+ sizeof (struct bfd_hash_entry),
+ 61))
einfo (_("%P%F: bfd_hash_table_init failed: %E\n"));
}
@@ -787,7 +829,8 @@ add_keepsyms_file (const char *filename)
}
link_info.keep_hash = xmalloc (sizeof (struct bfd_hash_table));
- if (! bfd_hash_table_init (link_info.keep_hash, bfd_hash_newfunc))
+ if (!bfd_hash_table_init (link_info.keep_hash, bfd_hash_newfunc,
+ sizeof (struct bfd_hash_entry)))
einfo (_("%P%F: bfd_hash_table_init failed: %E\n"));
bufsize = 100;
@@ -835,7 +878,7 @@ add_keepsyms_file (const char *filename)
a link. */
static bfd_boolean
-add_archive_element (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+add_archive_element (struct bfd_link_info *info,
bfd *abfd,
const char *name)
{
@@ -866,7 +909,7 @@ add_archive_element (struct bfd_link_info *info ATTRIBUTE_UNUSED,
bfd *from;
int len;
- h = bfd_link_hash_lookup (link_info.hash, name, FALSE, FALSE, TRUE);
+ h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE);
if (h == NULL)
from = NULL;
@@ -1107,7 +1150,7 @@ constructor_callback (struct bfd_link_info *info,
/* 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.relocatable
+ && (info->relocatable
|| bfd_reloc_type_lookup (abfd, BFD_RELOC_CTOR) == NULL))
einfo (_("%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n"));
@@ -1163,11 +1206,11 @@ warning_callback (struct bfd_link_info *info ATTRIBUTE_UNUSED,
return TRUE;
if (section != NULL)
- einfo ("%C: %s\n", abfd, section, address, warning);
+ einfo ("%C: %s%s\n", abfd, section, address, _("warning: "), warning);
else if (abfd == NULL)
- einfo ("%P: %s\n", warning);
+ einfo ("%P: %s%s\n", _("warning: "), warning);
else if (symbol == NULL)
- einfo ("%B: %s\n", abfd, warning);
+ einfo ("%B: %s%s\n", abfd, _("warning: "), warning);
else
{
lang_input_statement_type *entry;
@@ -1205,7 +1248,7 @@ warning_callback (struct bfd_link_info *info ATTRIBUTE_UNUSED,
bfd_map_over_sections (abfd, warning_find_reloc, &info);
if (! info.found)
- einfo ("%B: %s\n", abfd, warning);
+ einfo ("%B: %s%s\n", abfd, _("warning: "), warning);
if (entry == NULL)
free (asymbols);
@@ -1253,7 +1296,8 @@ warning_find_reloc (bfd *abfd, asection *sec, void *iarg)
&& strcmp (bfd_asymbol_name (*q->sym_ptr_ptr), info->symbol) == 0)
{
/* We found a reloc for the symbol we are looking for. */
- einfo ("%C: %s\n", abfd, sec, q->address, info->warning);
+ einfo ("%C: %s%s\n", abfd, sec, q->address, _("warning: "),
+ info->warning);
info->found = TRUE;
break;
}
@@ -1285,7 +1329,8 @@ undefined_symbol (struct bfd_link_info *info ATTRIBUTE_UNUSED,
if (hash == NULL)
{
hash = xmalloc (sizeof (struct bfd_hash_table));
- if (! bfd_hash_table_init (hash, bfd_hash_newfunc))
+ if (!bfd_hash_table_init (hash, bfd_hash_newfunc,
+ sizeof (struct bfd_hash_entry)))
einfo (_("%F%P: bfd_hash_table_init failed: %E\n"));
}
@@ -1372,6 +1417,7 @@ int overflow_cutoff_limit = 10;
static bfd_boolean
reloc_overflow (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ struct bfd_link_hash_entry *entry,
const char *name,
const char *reloc_name,
bfd_vma addend,
@@ -1382,10 +1428,7 @@ reloc_overflow (struct bfd_link_info *info ATTRIBUTE_UNUSED,
if (overflow_cutoff_limit == -1)
return TRUE;
- if (abfd == NULL)
- einfo (_("%P%X: generated"));
- else
- einfo ("%X%C:", abfd, section, address);
+ einfo ("%X%C:", abfd, section, address);
if (overflow_cutoff_limit >= 0
&& overflow_cutoff_limit-- == 0)
@@ -1394,7 +1437,34 @@ reloc_overflow (struct bfd_link_info *info ATTRIBUTE_UNUSED,
return TRUE;
}
- einfo (_(" relocation truncated to fit: %s %T"), reloc_name, name);
+ if (entry)
+ {
+ while (entry->type == bfd_link_hash_indirect
+ || entry->type == bfd_link_hash_warning)
+ entry = entry->u.i.link;
+ switch (entry->type)
+ {
+ case bfd_link_hash_undefined:
+ case bfd_link_hash_undefweak:
+ einfo (_(" relocation truncated to fit: %s against undefined symbol `%T'"),
+ reloc_name, entry->root.string);
+ break;
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ einfo (_(" relocation truncated to fit: %s against symbol `%T' defined in %A section in %B"),
+ reloc_name, entry->root.string,
+ entry->u.def.section,
+ entry->u.def.section == bfd_abs_section_ptr
+ ? output_bfd : entry->u.def.section->owner);
+ break;
+ default:
+ abort ();
+ break;
+ }
+ }
+ else
+ einfo (_(" relocation truncated to fit: %s against `%T'"),
+ reloc_name, name);
if (addend != 0)
einfo ("+%v", addend);
einfo ("\n");
@@ -1410,11 +1480,8 @@ reloc_dangerous (struct bfd_link_info *info ATTRIBUTE_UNUSED,
asection *section,
bfd_vma address)
{
- if (abfd == NULL)
- einfo (_("%P%X: generated"));
- else
- einfo ("%X%C:", abfd, section, address);
- einfo (_("dangerous relocation: %s\n"), message);
+ einfo (_("%X%C: dangerous relocation: %s\n"),
+ abfd, section, address, message);
return TRUE;
}
@@ -1428,11 +1495,8 @@ unattached_reloc (struct bfd_link_info *info ATTRIBUTE_UNUSED,
asection *section,
bfd_vma address)
{
- 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);
+ einfo (_("%X%C: reloc refers to symbol `%T' which is not being output\n"),
+ abfd, section, address, name);
return TRUE;
}
@@ -1447,6 +1511,13 @@ notice (struct bfd_link_info *info,
asection *section,
bfd_vma value)
{
+ if (name == NULL)
+ {
+ if (command_line.cref || nocrossref_list != NULL)
+ return handle_asneeded_cref (abfd, value);
+ return TRUE;
+ }
+
if (! info->notice_all
|| (info->notice_hash != NULL
&& bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) != NULL))
diff --git a/contrib/binutils/ld/ldmain.h b/contrib/binutils/ld/ldmain.h
index 8cab5fe..4f15d55 100644
--- a/contrib/binutils/ld/ldmain.h
+++ b/contrib/binutils/ld/ldmain.h
@@ -1,6 +1,6 @@
/* ldmain.h -
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2002, 2003, 2004
- Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2002, 2003, 2004,
+ 2005 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -16,14 +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. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#ifndef LDMAIN_H
#define LDMAIN_H
extern char *program_name;
-extern char *ld_sysroot;
+extern const char *ld_sysroot;
extern char *ld_canon_sysroot;
extern int ld_canon_sysroot_len;
extern bfd *output_bfd;
@@ -33,6 +33,7 @@ extern bfd_boolean trace_file_tries;
extern bfd_boolean version_printed;
extern bfd_boolean whole_archive;
extern bfd_boolean as_needed;
+extern bfd_boolean add_needed;
extern bfd_boolean demangling;
extern int g_switch_value;
extern const char *output_filename;
diff --git a/contrib/binutils/ld/ldmisc.c b/contrib/binutils/ld/ldmisc.c
index def598d..8af043a 100644
--- a/contrib/binutils/ld/ldmisc.c
+++ b/contrib/binutils/ld/ldmisc.c
@@ -1,6 +1,6 @@
/* ldmisc.c
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2002, 2003
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
@@ -18,8 +18,8 @@
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. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#include "bfd.h"
#include "bfdlink.h"
@@ -35,31 +35,35 @@
#include "ldlex.h"
#include "ldmain.h"
#include "ldfile.h"
+#include "elf-bfd.h"
/*
%% literal %
+ %A section name from a section
+ %B filename from a bfd
+ %C clever filename:linenumber with function
+ %D like %C, but no function name
+ %E current bfd error or errno
%F error is fatal
+ %G like %D, but only function name
+ %I filename from a lang_input_statement_type
%P print program name
+ %R info about a relent
%S print script file and linenumber
- %E current bfd error or errno
- %I filename from a lang_input_statement_type
- %B filename from a bfd
%T symbol name
- %X no object output, fail return
%V hex bfd_vma
- %v hex bfd_vma, no leading zeros
%W hex bfd_vma with 0x with no leading zeros taking up 8 spaces
- %C clever filename:linenumber with function
- %D like %C, but no function name
- %G like %D, but only function name
- %R info about a relent
- %s arbitrary string, like printf
+ %X no object output, fail return
%d integer, like printf
+ %ld long, like printf
+ %lu unsigned long, like printf
+ %s arbitrary string, like printf
%u integer, like printf
+ %v hex bfd_vma, no leading zeros
*/
static void
-vfinfo (FILE *fp, const char *fmt, va_list arg)
+vfinfo (FILE *fp, const char *fmt, va_list arg, bfd_boolean is_warning)
{
bfd_boolean fatal = FALSE;
@@ -76,10 +80,6 @@ vfinfo (FILE *fp, const char *fmt, va_list arg)
fmt++;
switch (*fmt++)
{
- default:
- fprintf (fp, "%%%c", fmt[-1]);
- break;
-
case '%':
/* literal % */
putc ('%', fp);
@@ -158,11 +158,38 @@ vfinfo (FILE *fp, const char *fmt, va_list arg)
}
break;
+ case 'A':
+ /* section name from a section */
+ {
+ asection *sec = va_arg (arg, asection *);
+ bfd *abfd = sec->owner;
+ const char *group = NULL;
+ struct coff_comdat_info *ci;
+
+ fprintf (fp, "%s", sec->name);
+ if (abfd != NULL
+ && bfd_get_flavour (abfd) == bfd_target_elf_flavour
+ && elf_next_in_group (sec) != NULL
+ && (sec->flags & SEC_GROUP) == 0)
+ group = elf_group_name (sec);
+ else if (abfd != NULL
+ && bfd_get_flavour (abfd) == bfd_target_coff_flavour
+ && (ci = bfd_coff_get_comdat_section (sec->owner,
+ sec)) != NULL)
+ group = ci->name;
+ if (group != NULL)
+ fprintf (fp, "[%s]", group);
+ }
+ break;
+
case 'B':
/* filename from a bfd */
{
bfd *abfd = va_arg (arg, bfd *);
- if (abfd->my_archive)
+
+ if (abfd == NULL)
+ fprintf (fp, "%s generated", program_name);
+ else if (abfd->my_archive)
fprintf (fp, "%s(%s)", abfd->my_archive->filename,
abfd->filename);
else
@@ -246,40 +273,62 @@ vfinfo (FILE *fp, const char *fmt, va_list arg)
section = va_arg (arg, asection *);
offset = va_arg (arg, bfd_vma);
- entry = (lang_input_statement_type *) abfd->usrdata;
- if (entry != (lang_input_statement_type *) NULL
- && entry->asymbols != (asymbol **) NULL)
- asymbols = entry->asymbols;
+ if (abfd == NULL)
+ {
+ entry = NULL;
+ asymbols = NULL;
+ }
else
{
- long symsize;
- long symbol_count;
-
- symsize = bfd_get_symtab_upper_bound (abfd);
- if (symsize < 0)
- einfo (_("%B%F: could not read symbols\n"), abfd);
- asymbols = xmalloc (symsize);
- symbol_count = bfd_canonicalize_symtab (abfd, asymbols);
- if (symbol_count < 0)
- einfo (_("%B%F: could not read symbols\n"), abfd);
- if (entry != (lang_input_statement_type *) NULL)
+ entry = (lang_input_statement_type *) abfd->usrdata;
+ if (entry != (lang_input_statement_type *) NULL
+ && entry->asymbols != (asymbol **) NULL)
+ asymbols = entry->asymbols;
+ else
{
- entry->asymbols = asymbols;
- entry->symbol_count = symbol_count;
+ long symsize;
+ long sym_count;
+
+ symsize = bfd_get_symtab_upper_bound (abfd);
+ if (symsize < 0)
+ einfo (_("%B%F: could not read symbols\n"), abfd);
+ asymbols = xmalloc (symsize);
+ sym_count = bfd_canonicalize_symtab (abfd, asymbols);
+ if (sym_count < 0)
+ einfo (_("%B%F: could not read symbols\n"), abfd);
+ if (entry != (lang_input_statement_type *) NULL)
+ {
+ entry->asymbols = asymbols;
+ entry->symbol_count = sym_count;
+ }
}
}
- lfinfo (fp, "%B(%s+0x%v)", abfd, section->name, offset);
+ /* The GNU Coding Standard requires that error messages
+ be of the form:
+
+ source-file-name:lineno: message
+ We do not always have a line number available so if
+ we cannot find them we print out the section name and
+ offset instread. */
discard_last = TRUE;
- if (bfd_find_nearest_line (abfd, section, asymbols, offset,
- &filename, &functionname,
- &linenumber))
+ if (abfd != NULL
+ && bfd_find_nearest_line (abfd, section, asymbols, offset,
+ &filename, &functionname,
+ &linenumber))
{
- bfd_boolean need_colon = TRUE;
-
if (functionname != NULL && fmt[-1] == 'C')
{
+ /* Detect the case where we are printing out a
+ message for the same function as the last
+ call to vinfo ("%C"). In this situation do
+ not print out the ABFD filename or the
+ function name again. Note - we do still
+ print out the source filename, as this will
+ allow programs that parse the linker's output
+ (eg emacs) to correctly locate multiple
+ errors in the same source file. */
if (last_bfd == NULL
|| last_file == NULL
|| last_function == NULL
@@ -288,9 +337,8 @@ vfinfo (FILE *fp, const char *fmt, va_list arg)
&& strcmp (last_file, filename) != 0)
|| strcmp (last_function, functionname) != 0)
{
- lfinfo (fp, _(": In function `%T':\n"),
- functionname);
- need_colon = FALSE;
+ lfinfo (fp, _("%B: In function `%T':\n"),
+ abfd, functionname);
last_bfd = abfd;
if (last_file != NULL)
@@ -304,19 +352,21 @@ vfinfo (FILE *fp, const char *fmt, va_list arg)
}
discard_last = FALSE;
}
+ else
+ lfinfo (fp, "%B:", abfd);
if (filename != NULL)
- {
- if (need_colon)
- putc (':', fp);
- fputs (filename, fp);
- }
+ fprintf (fp, "%s:", filename);
if (functionname != NULL && fmt[-1] == 'G')
- lfinfo (fp, ":%T", functionname);
+ lfinfo (fp, "%T", functionname);
else if (filename != NULL && linenumber != 0)
- fprintf (fp, ":%u", linenumber);
+ fprintf (fp, "%u", linenumber);
+ else
+ lfinfo (fp, "(%A+0x%v)", section, offset);
}
+ else
+ lfinfo (fp, "%B:(%A+0x%v)", abfd, section, offset);
if (asymbols != NULL && entry == NULL)
free (asymbols);
@@ -352,11 +402,30 @@ vfinfo (FILE *fp, const char *fmt, va_list arg)
/* unsigned integer, like printf */
fprintf (fp, "%u", va_arg (arg, unsigned int));
break;
+
+ case 'l':
+ if (*fmt == 'd')
+ {
+ fprintf (fp, "%ld", va_arg (arg, long));
+ ++fmt;
+ break;
+ }
+ else if (*fmt == 'u')
+ {
+ fprintf (fp, "%lu", va_arg (arg, unsigned long));
+ ++fmt;
+ break;
+ }
+ /* Fall thru */
+
+ default:
+ fprintf (fp, "%%%c", fmt[-1]);
+ break;
}
}
}
- if (config.fatal_warnings)
+ if (is_warning && config.fatal_warnings)
config.make_executable = FALSE;
if (fatal)
@@ -416,7 +485,7 @@ info_msg (const char *fmt, ...)
va_list arg;
va_start (arg, fmt);
- vfinfo (stdout, fmt, arg);
+ vfinfo (stdout, fmt, arg, FALSE);
va_end (arg);
}
@@ -428,7 +497,7 @@ einfo (const char *fmt, ...)
va_list arg;
va_start (arg, fmt);
- vfinfo (stderr, fmt, arg);
+ vfinfo (stderr, fmt, arg, TRUE);
va_end (arg);
}
@@ -446,7 +515,7 @@ minfo (const char *fmt, ...)
va_list arg;
va_start (arg, fmt);
- vfinfo (config.map_file, fmt, arg);
+ vfinfo (config.map_file, fmt, arg, FALSE);
va_end (arg);
}
@@ -456,7 +525,7 @@ lfinfo (FILE *file, const char *fmt, ...)
va_list arg;
va_start (arg, fmt);
- vfinfo (file, fmt, arg);
+ vfinfo (file, fmt, arg, FALSE);
va_end (arg);
}
@@ -489,64 +558,3 @@ ld_abort (const char *file, int line, const char *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 b2812fb..cf70433 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, 2003
+ Copyright 1991, 1992, 1993, 1994, 1996, 1997, 2001, 2003, 2004
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -16,13 +16,12 @@
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. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
+ MA 02110-1301, USA. */
#ifndef LDMISC_H
#define LDMISC_H
-extern bfd_boolean error_handler (int, const char *, ...);
extern void einfo (const char *, ...);
extern void minfo (const char *, ...);
extern void info_msg (const char *, ...);
diff --git a/contrib/binutils/ld/ldver.c b/contrib/binutils/ld/ldver.c
index 710bf90..48b9143 100644
--- a/contrib/binutils/ld/ldver.c
+++ b/contrib/binutils/ld/ldver.c
@@ -1,22 +1,22 @@
/* ldver.c -- Print linker version.
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002
- Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002,
+ 2003 Free Software Foundation, Inc.
-This file is part of GLD, the Gnu Linker.
+ 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 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include "bfd.h"
@@ -39,7 +39,7 @@ ldversion (int noisy)
if (noisy & 2)
{
- printf (_("Copyright 2002 Free Software Foundation, Inc.\n"));
+ printf (_("Copyright 2005 Free Software Foundation, Inc.\n"));
printf (_("\
This program is free software; you may redistribute it under the terms of\n\
the GNU General Public License. This program has absolutely no warranty.\n"));
diff --git a/contrib/binutils/ld/ldver.h b/contrib/binutils/ld/ldver.h
index fd840a8..96e74ce 100644
--- a/contrib/binutils/ld/ldver.h
+++ b/contrib/binutils/ld/ldver.h
@@ -1,5 +1,6 @@
/* ldver.h -- Header file for ldver.c.
- Copyright 1991, 1992, 1993, 1996, 2003 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1996, 2001, 2003
+ Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -15,6 +16,6 @@ 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. */
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
void ldversion (int);
diff --git a/contrib/binutils/ld/ldver.texi b/contrib/binutils/ld/ldver.texi
index 3610a96..11d1801 100644
--- a/contrib/binutils/ld/ldver.texi
+++ b/contrib/binutils/ld/ldver.texi
@@ -1 +1 @@
-@set VERSION 2.15
+@set VERSION 2.17
diff --git a/contrib/binutils/ld/ldwrite.c b/contrib/binutils/ld/ldwrite.c
index e4bec32..ee9d74a 100644
--- a/contrib/binutils/ld/ldwrite.c
+++ b/contrib/binutils/ld/ldwrite.c
@@ -1,6 +1,6 @@
/* ldwrite.c -- write out the linked file
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2003
- Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002,
+ 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Steve Chamberlain sac@cygnus.com
This file is part of GLD, the Gnu Linker.
@@ -17,7 +17,7 @@ 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. */
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -55,7 +55,7 @@ build_link_order (lang_statement_union_type *statement)
einfo (_("%P%F: bfd_new_link_order failed\n"));
link_order->type = bfd_data_link_order;
- link_order->offset = statement->data_statement.output_vma;
+ link_order->offset = statement->data_statement.output_offset;
link_order->u.data.contents = xmalloc (QUAD_SIZE);
value = statement->data_statement.value;
@@ -190,7 +190,7 @@ build_link_order (lang_statement_union_type *statement)
if (link_order == NULL)
einfo (_("%P%F: bfd_new_link_order failed\n"));
- link_order->offset = rs->output_vma;
+ link_order->offset = rs->output_offset;
link_order->size = bfd_get_reloc_size (rs->howto);
link_order->u.reloc.p = xmalloc (sizeof (struct bfd_link_order_reloc));
@@ -218,45 +218,46 @@ build_link_order (lang_statement_union_type *statement)
break;
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)
- {
- asection *i = statement->input_section.section;
- asection *output_section = i->output_section;
+ {
+ /* Create a new link_order in the output section with this
+ attached */
+ asection *i = statement->input_section.section;
- ASSERT (output_section->owner == output_bfd);
+ if (!((lang_input_statement_type *) i->owner->usrdata)->just_syms_flag
+ && (i->flags & SEC_EXCLUDE) == 0)
+ {
+ asection *output_section = i->output_section;
- if ((output_section->flags & SEC_HAS_CONTENTS) != 0
- || ((output_section->flags & SEC_LOAD) != 0
- && (output_section->flags & SEC_THREAD_LOCAL)))
- {
- struct bfd_link_order *link_order;
+ ASSERT (output_section->owner == output_bfd);
- link_order = bfd_new_link_order (output_bfd, output_section);
+ if ((output_section->flags & SEC_HAS_CONTENTS) != 0
+ || ((output_section->flags & SEC_LOAD) != 0
+ && (output_section->flags & SEC_THREAD_LOCAL)))
+ {
+ struct bfd_link_order *link_order;
- if (i->flags & SEC_NEVER_LOAD)
- {
- /* We've got a never load section inside one which
- is going to be output, we'll change it into a
- fill. */
- link_order->type = bfd_data_link_order;
- link_order->u.data.contents = "";
- link_order->u.data.size = 1;
- }
- else
- {
- link_order->type = bfd_indirect_link_order;
- link_order->u.indirect.section = i;
- ASSERT (i->output_section == output_section);
- }
- if (i->_cooked_size)
- link_order->size = i->_cooked_size;
- else
- link_order->size = bfd_get_section_size_before_reloc (i);
- link_order->offset = i->output_offset;
- }
- }
+ link_order = bfd_new_link_order (output_bfd, output_section);
+
+ if (i->flags & SEC_NEVER_LOAD)
+ {
+ /* We've got a never load section inside one which
+ is going to be output, we'll change it into a
+ fill. */
+ link_order->type = bfd_data_link_order;
+ link_order->u.data.contents = (unsigned char *) "";
+ link_order->u.data.size = 1;
+ }
+ else
+ {
+ link_order->type = bfd_indirect_link_order;
+ link_order->u.indirect.section = i;
+ ASSERT (i->output_section == output_section);
+ }
+ link_order->size = i->size;
+ link_order->offset = i->output_offset;
+ }
+ }
+ }
break;
case lang_padding_statement_enum:
@@ -367,8 +368,7 @@ clone_section (bfd *abfd, asection *s, const char *name, int *count)
n->vma = s->vma;
n->user_set_vma = s->user_set_vma;
n->lma = s->lma;
- n->_cooked_size = 0;
- n->_raw_size = 0;
+ n->size = 0;
n->output_offset = s->output_offset;
n->output_section = n;
n->orelocation = 0;
@@ -381,8 +381,8 @@ clone_section (bfd *abfd, asection *s, const char *name, int *count)
static void
ds (asection *s)
{
- struct bfd_link_order *l = s->link_order_head;
- printf ("vma %x size %x\n", s->vma, s->_raw_size);
+ struct bfd_link_order *l = s->map_head.link_order;
+ printf ("vma %x size %x\n", s->vma, s->size);
while (l)
{
if (l->type == bfd_indirect_link_order)
@@ -413,7 +413,7 @@ sanity_check (bfd *abfd)
{
struct bfd_link_order *p;
bfd_vma prev = 0;
- for (p = s->link_order_head; p; p = p->next)
+ for (p = s->map_head.link_order; p; p = p->next)
{
if (p->offset > 100000)
abort ();
@@ -450,7 +450,7 @@ split_sections (bfd *abfd, struct bfd_link_info *info)
/* Count up the relocations and line entries to see if anything
would be too big to fit. Accumulate section size too. */
- for (l = NULL, p = cursor->link_order_head; p != NULL; p = l->next)
+ for (l = NULL, p = cursor->map_head.link_order; p != NULL; p = l->next)
{
unsigned int thislines = 0;
unsigned int thisrelocs = 0;
@@ -468,10 +468,7 @@ split_sections (bfd *abfd, struct bfd_link_info *info)
if (info->relocatable)
thisrelocs = sec->reloc_count;
- if (sec->_cooked_size != 0)
- thissize = sec->_cooked_size;
- else
- thissize = sec->_raw_size;
+ thissize = sec->size;
}
else if (info->relocatable
@@ -494,9 +491,9 @@ split_sections (bfd *abfd, struct bfd_link_info *info)
/* Attach the link orders to the new section and snip
them off from the old section. */
- n->link_order_head = p;
- n->link_order_tail = cursor->link_order_tail;
- cursor->link_order_tail = l;
+ n->map_head.link_order = p;
+ n->map_tail.link_order = cursor->map_tail.link_order;
+ cursor->map_tail.link_order = l;
l->next = NULL;
l = p;
@@ -506,13 +503,8 @@ split_sections (bfd *abfd, struct bfd_link_info *info)
dump ("before snip", cursor, n);
shift_offset = p->offset;
- if (cursor->_cooked_size != 0)
- {
- n->_cooked_size = cursor->_cooked_size - shift_offset;
- cursor->_cooked_size = shift_offset;
- }
- n->_raw_size = cursor->_raw_size - shift_offset;
- cursor->_raw_size = shift_offset;
+ n->size = cursor->size - shift_offset;
+ cursor->size = shift_offset;
vma += shift_offset;
n->lma = n->vma = vma;
diff --git a/contrib/binutils/ld/ldwrite.h b/contrib/binutils/ld/ldwrite.h
index 13617c0..1851a86 100644
--- a/contrib/binutils/ld/ldwrite.h
+++ b/contrib/binutils/ld/ldwrite.h
@@ -15,7 +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, 51 Franklin Street - Fifth Floor,
+ Boston, MA 02110-1301, USA. */
void ldwrite (void);
diff --git a/contrib/binutils/ld/lexsup.c b/contrib/binutils/ld/lexsup.c
index ea3a558..f4c7dda 100644
--- a/contrib/binutils/ld/lexsup.c
+++ b/contrib/binutils/ld/lexsup.c
@@ -1,6 +1,6 @@
/* Parse options for the GNU linker.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004
+ 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -17,9 +17,10 @@
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. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+#include "config.h"
#include "bfd.h"
#include "sysdep.h"
#include "libiberty.h"
@@ -55,6 +56,7 @@
static void set_default_dirlist (char *);
static void set_section_start (char *, char *);
+static void set_segment_start (const char *, char *);
static void help (void);
/* Non-zero if we are processing a --defsym from the command line. */
@@ -70,6 +72,7 @@ enum option_values
OPTION_DEFSYM,
OPTION_DEMANGLE,
OPTION_DYNAMIC_LINKER,
+ OPTION_SYSROOT,
OPTION_EB,
OPTION_EL,
OPTION_EMBEDDED_RELOCS,
@@ -91,6 +94,7 @@ enum option_values
OPTION_SHARED,
OPTION_SONAME,
OPTION_SORT_COMMON,
+ OPTION_SORT_SECTION,
OPTION_STATS,
OPTION_SYMBOLIC,
OPTION_TASK_LINK,
@@ -112,12 +116,15 @@ enum option_values
OPTION_SPLIT_BY_RELOC,
OPTION_SPLIT_BY_FILE ,
OPTION_WHOLE_ARCHIVE,
+ OPTION_ADD_NEEDED,
+ OPTION_NO_ADD_NEEDED,
OPTION_AS_NEEDED,
OPTION_NO_AS_NEEDED,
OPTION_WRAP,
OPTION_FORCE_EXE_SUFFIX,
OPTION_GC_SECTIONS,
OPTION_NO_GC_SECTIONS,
+ OPTION_HASH_SIZE,
OPTION_CHECK_SECTIONS,
OPTION_NO_CHECK_SECTIONS,
OPTION_NO_UNDEFINED,
@@ -130,6 +137,8 @@ enum option_values
OPTION_NO_ALLOW_SHLIB_UNDEFINED,
OPTION_ALLOW_MULTIPLE_DEFINITION,
OPTION_NO_UNDEFINED_VERSION,
+ OPTION_DEFAULT_SYMVER,
+ OPTION_DEFAULT_IMPORTED_SYMVER,
OPTION_DISCARD_NONE,
OPTION_SPARE_DYNAMIC_TAGS,
OPTION_NO_DEFINE_COMMON,
@@ -142,7 +151,9 @@ enum option_values
OPTION_PIE,
OPTION_UNRESOLVED_SYMBOLS,
OPTION_WARN_UNRESOLVED_SYMBOLS,
- OPTION_ERROR_UNRESOLVED_SYMBOLS
+ OPTION_ERROR_UNRESOLVED_SYMBOLS,
+ OPTION_WARN_SHARED_TEXTREL,
+ OPTION_REDUCE_MEMORY_OVERHEADS
};
/* The long options. This structure is used for both the option
@@ -182,270 +193,332 @@ struct ld_option
static const struct ld_option ld_options[] =
{
{ {NULL, required_argument, NULL, '\0'},
- 'a', N_("KEYWORD"), N_("Shared library control for HP/UX compatibility"),
- ONE_DASH },
+ 'a', N_("KEYWORD"), N_("Shared library control for HP/UX compatibility"),
+ ONE_DASH },
{ {"architecture", required_argument, NULL, 'A'},
- 'A', N_("ARCH"), N_("Set architecture") , TWO_DASHES },
+ 'A', N_("ARCH"), N_("Set architecture") , TWO_DASHES },
{ {"format", required_argument, NULL, 'b'},
- 'b', N_("TARGET"), N_("Specify target for following input files"), TWO_DASHES },
+ 'b', N_("TARGET"), N_("Specify target for following input files"),
+ TWO_DASHES },
{ {"mri-script", required_argument, NULL, 'c'},
- 'c', N_("FILE"), N_("Read MRI format linker script"), TWO_DASHES },
+ 'c', N_("FILE"), N_("Read MRI format linker script"), TWO_DASHES },
{ {"dc", no_argument, NULL, 'd'},
- 'd', NULL, N_("Force common symbols to be defined"), ONE_DASH },
+ 'd', NULL, N_("Force common symbols to be defined"), ONE_DASH },
{ {"dp", no_argument, NULL, 'd'},
- '\0', NULL, NULL, ONE_DASH },
+ '\0', NULL, NULL, ONE_DASH },
{ {"entry", required_argument, NULL, 'e'},
- 'e', N_("ADDRESS"), N_("Set start address"), TWO_DASHES },
+ 'e', N_("ADDRESS"), N_("Set start address"), TWO_DASHES },
{ {"export-dynamic", no_argument, NULL, OPTION_EXPORT_DYNAMIC},
- 'E', NULL, N_("Export all dynamic symbols"), TWO_DASHES },
+ 'E', NULL, N_("Export all dynamic symbols"), TWO_DASHES },
{ {"EB", no_argument, NULL, OPTION_EB},
- '\0', NULL, N_("Link big-endian objects"), ONE_DASH },
+ '\0', NULL, N_("Link big-endian objects"), ONE_DASH },
{ {"EL", no_argument, NULL, OPTION_EL},
- '\0', NULL, N_("Link little-endian objects"), ONE_DASH },
+ '\0', NULL, N_("Link little-endian objects"), ONE_DASH },
{ {"auxiliary", required_argument, NULL, 'f'},
- 'f', N_("SHLIB"), N_("Auxiliary filter for shared object symbol table"),
- TWO_DASHES },
+ 'f', N_("SHLIB"), N_("Auxiliary filter for shared object symbol table"),
+ TWO_DASHES },
{ {"filter", required_argument, NULL, 'F'},
- 'F', N_("SHLIB"), N_("Filter for shared object symbol table"), TWO_DASHES },
+ 'F', N_("SHLIB"), N_("Filter for shared object symbol table"),
+ TWO_DASHES },
{ {NULL, no_argument, NULL, '\0'},
- 'g', NULL, N_("Ignored"), ONE_DASH },
+ 'g', NULL, N_("Ignored"), ONE_DASH },
{ {"gpsize", required_argument, NULL, 'G'},
- 'G', N_("SIZE"), N_("Small data size (if no size, same as --shared)"),
- TWO_DASHES },
+ 'G', N_("SIZE"), N_("Small data size (if no size, same as --shared)"),
+ TWO_DASHES },
{ {"soname", required_argument, NULL, OPTION_SONAME},
- 'h', N_("FILENAME"), N_("Set internal name of shared library"), ONE_DASH },
+ 'h', N_("FILENAME"), N_("Set internal name of shared library"), ONE_DASH },
{ {"dynamic-linker", required_argument, NULL, OPTION_DYNAMIC_LINKER},
- 'I', N_("PROGRAM"), N_("Set PROGRAM as the dynamic linker to use"), TWO_DASHES },
+ 'I', N_("PROGRAM"), N_("Set PROGRAM as the dynamic linker to use"),
+ TWO_DASHES },
{ {"library", required_argument, NULL, 'l'},
- 'l', N_("LIBNAME"), N_("Search for library LIBNAME"), TWO_DASHES },
+ 'l', N_("LIBNAME"), N_("Search for library LIBNAME"), TWO_DASHES },
{ {"library-path", required_argument, NULL, 'L'},
- 'L', N_("DIRECTORY"), N_("Add DIRECTORY to library search path"), TWO_DASHES },
+ 'L', N_("DIRECTORY"), N_("Add DIRECTORY to library search path"),
+ TWO_DASHES },
+ { {"sysroot=<DIRECTORY>", required_argument, NULL, OPTION_SYSROOT},
+ '\0', NULL, N_("Override the default sysroot location"), TWO_DASHES },
{ {NULL, required_argument, NULL, '\0'},
- 'm', N_("EMULATION"), N_("Set emulation"), ONE_DASH },
+ 'm', N_("EMULATION"), N_("Set emulation"), ONE_DASH },
{ {"print-map", no_argument, NULL, 'M'},
- 'M', NULL, N_("Print map file on standard output"), TWO_DASHES },
+ 'M', NULL, N_("Print map file on standard output"), TWO_DASHES },
{ {"nmagic", no_argument, NULL, 'n'},
- 'n', NULL, N_("Do not page align data"), TWO_DASHES },
+ 'n', NULL, N_("Do not page align data"), TWO_DASHES },
{ {"omagic", no_argument, NULL, 'N'},
- 'N', NULL, N_("Do not page align data, do not make text readonly"),
- EXACTLY_TWO_DASHES },
+ '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 },
+ '\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 },
+ 'o', N_("FILE"), N_("Set output file name"), EXACTLY_TWO_DASHES },
{ {NULL, required_argument, NULL, '\0'},
- 'O', NULL, N_("Optimize output file"), ONE_DASH },
+ 'O', NULL, N_("Optimize output file"), ONE_DASH },
{ {"Qy", no_argument, NULL, OPTION_IGNORE},
- '\0', NULL, N_("Ignored for SVR4 compatibility"), ONE_DASH },
+ '\0', NULL, N_("Ignored for SVR4 compatibility"), ONE_DASH },
{ {"emit-relocs", no_argument, NULL, 'q'},
- 'q', NULL, "Generate relocations in final output", TWO_DASHES },
+ 'q', NULL, "Generate relocations in final output", TWO_DASHES },
{ {"relocatable", no_argument, NULL, 'r'},
- 'r', NULL, N_("Generate relocatable output"), TWO_DASHES },
+ 'r', NULL, N_("Generate relocatable output"), TWO_DASHES },
{ {NULL, no_argument, NULL, '\0'},
- 'i', NULL, NULL, ONE_DASH },
+ 'i', NULL, NULL, ONE_DASH },
{ {"just-symbols", required_argument, NULL, 'R'},
- 'R', N_("FILE"), N_("Just link symbols (if directory, same as --rpath)"),
- TWO_DASHES },
+ 'R', N_("FILE"), N_("Just link symbols (if directory, same as --rpath)"),
+ TWO_DASHES },
{ {"strip-all", no_argument, NULL, 's'},
- 's', NULL, N_("Strip all symbols"), TWO_DASHES },
+ 's', NULL, N_("Strip all symbols"), TWO_DASHES },
{ {"strip-debug", no_argument, NULL, 'S'},
- 'S', NULL, N_("Strip debugging symbols"), TWO_DASHES },
+ '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 },
+ '\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 },
+ '\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 },
+ 't', NULL, N_("Trace file opens"), TWO_DASHES },
{ {"script", required_argument, NULL, 'T'},
- 'T', N_("FILE"), N_("Read linker script"), TWO_DASHES },
+ 'T', N_("FILE"), N_("Read linker script"), TWO_DASHES },
{ {"undefined", required_argument, NULL, 'u'},
- 'u', N_("SYMBOL"), N_("Start with undefined reference to SYMBOL"), TWO_DASHES },
+ 'u', N_("SYMBOL"), N_("Start with undefined reference to SYMBOL"),
+ TWO_DASHES },
{ {"unique", optional_argument, NULL, OPTION_UNIQUE},
- '\0', N_("[=SECTION]"), N_("Don't merge input [SECTION | orphan] sections"), TWO_DASHES },
+ '\0', N_("[=SECTION]"),
+ N_("Don't merge input [SECTION | orphan] sections"), TWO_DASHES },
{ {"Ur", no_argument, NULL, OPTION_UR},
- '\0', NULL, N_("Build global constructor/destructor tables"), ONE_DASH },
+ '\0', NULL, N_("Build global constructor/destructor tables"), ONE_DASH },
{ {"version", no_argument, NULL, OPTION_VERSION},
- 'v', NULL, N_("Print version information"), TWO_DASHES },
+ 'v', NULL, N_("Print version information"), TWO_DASHES },
{ {NULL, no_argument, NULL, '\0'},
- 'V', NULL, N_("Print version and emulation information"), ONE_DASH },
+ 'V', NULL, N_("Print version and emulation information"), ONE_DASH },
{ {"discard-all", no_argument, NULL, 'x'},
- 'x', NULL, N_("Discard all local symbols"), TWO_DASHES },
+ 'x', NULL, N_("Discard all local symbols"), TWO_DASHES },
{ {"discard-locals", no_argument, NULL, 'X'},
- 'X', NULL, N_("Discard temporary local symbols (default)"), TWO_DASHES },
+ 'X', NULL, N_("Discard temporary local symbols (default)"), TWO_DASHES },
{ {"discard-none", no_argument, NULL, OPTION_DISCARD_NONE},
- '\0', NULL, N_("Don't discard any local symbols"), TWO_DASHES },
+ '\0', NULL, N_("Don't discard any local symbols"), TWO_DASHES },
{ {"trace-symbol", required_argument, NULL, 'y'},
- 'y', N_("SYMBOL"), N_("Trace mentions of SYMBOL"), TWO_DASHES },
+ 'y', N_("SYMBOL"), N_("Trace mentions of SYMBOL"), TWO_DASHES },
{ {NULL, required_argument, NULL, '\0'},
- 'Y', N_("PATH"), N_("Default search path for Solaris compatibility"), ONE_DASH },
+ 'Y', N_("PATH"), N_("Default search path for Solaris compatibility"),
+ ONE_DASH },
{ {"start-group", no_argument, NULL, '('},
- '(', NULL, N_("Start a group"), TWO_DASHES },
+ '(', 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 },
+ ')', 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 },
+ { {"add-needed", no_argument, NULL, OPTION_ADD_NEEDED},
+ '\0', NULL, N_("Set DT_NEEDED tags for DT_NEEDED entries in\n"
+ "\t\t\t\tfollowing dynamic libs"), TWO_DASHES },
+ { {"no-add-needed", no_argument, NULL, OPTION_NO_ADD_NEEDED},
+ '\0', NULL, N_("Do not set DT_NEEDED tags for DT_NEEDED entries\n"
+ "\t\t\t\tin following dynamic libs"), 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 },
{ {"assert", required_argument, NULL, OPTION_ASSERT},
- '\0', N_("KEYWORD"), N_("Ignored for SunOS compatibility"), ONE_DASH },
+ '\0', N_("KEYWORD"), N_("Ignored for SunOS compatibility"), ONE_DASH },
{ {"Bdynamic", no_argument, NULL, OPTION_CALL_SHARED},
- '\0', NULL, N_("Link against shared libraries"), ONE_DASH },
+ '\0', NULL, N_("Link against shared libraries"), ONE_DASH },
{ {"dy", no_argument, NULL, OPTION_CALL_SHARED},
- '\0', NULL, NULL, ONE_DASH },
+ '\0', NULL, NULL, ONE_DASH },
{ {"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
- '\0', NULL, NULL, ONE_DASH },
+ '\0', NULL, NULL, ONE_DASH },
{ {"Bstatic", no_argument, NULL, OPTION_NON_SHARED},
- '\0', NULL, N_("Do not link against shared libraries"), ONE_DASH },
+ '\0', NULL, N_("Do not link against shared libraries"), ONE_DASH },
{ {"dn", no_argument, NULL, OPTION_NON_SHARED},
- '\0', NULL, NULL, ONE_DASH },
+ '\0', NULL, NULL, ONE_DASH },
{ {"non_shared", no_argument, NULL, OPTION_NON_SHARED},
- '\0', NULL, NULL, ONE_DASH },
+ '\0', NULL, NULL, ONE_DASH },
{ {"static", no_argument, NULL, OPTION_NON_SHARED},
- '\0', NULL, NULL, ONE_DASH },
+ '\0', NULL, NULL, ONE_DASH },
{ {"Bsymbolic", no_argument, NULL, OPTION_SYMBOLIC},
- '\0', NULL, N_("Bind global references locally"), ONE_DASH },
+ '\0', NULL, N_("Bind global references locally"), ONE_DASH },
{ {"check-sections", no_argument, NULL, OPTION_CHECK_SECTIONS},
- '\0', NULL, N_("Check section addresses for overlaps (default)"), TWO_DASHES },
+ '\0', NULL, N_("Check section addresses for overlaps (default)"),
+ TWO_DASHES },
{ {"no-check-sections", no_argument, NULL, OPTION_NO_CHECK_SECTIONS},
- '\0', NULL, N_("Do not check section addresses for overlaps"),
- TWO_DASHES },
+ '\0', NULL, N_("Do not check section addresses for overlaps"),
+ TWO_DASHES },
{ {"cref", no_argument, NULL, OPTION_CREF},
- '\0', NULL, N_("Output cross reference table"), TWO_DASHES },
+ '\0', NULL, N_("Output cross reference table"), TWO_DASHES },
{ {"defsym", required_argument, NULL, OPTION_DEFSYM},
- '\0', N_("SYMBOL=EXPRESSION"), N_("Define a symbol"), TWO_DASHES },
+ '\0', N_("SYMBOL=EXPRESSION"), N_("Define a symbol"), TWO_DASHES },
{ {"demangle", optional_argument, NULL, OPTION_DEMANGLE},
- '\0', N_("[=STYLE]"), N_("Demangle symbol names [using STYLE]"), TWO_DASHES },
+ '\0', N_("[=STYLE]"), N_("Demangle symbol names [using STYLE]"),
+ TWO_DASHES },
{ {"embedded-relocs", no_argument, NULL, OPTION_EMBEDDED_RELOCS},
- '\0', NULL, N_("Generate embedded relocs"), TWO_DASHES},
+ '\0', NULL, N_("Generate embedded relocs"), TWO_DASHES},
+ { {"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL},
+ '\0', NULL, N_("Treat warnings as errors"),
+ TWO_DASHES },
{ {"fini", required_argument, NULL, OPTION_FINI},
- '\0', N_("SYMBOL"), N_("Call SYMBOL at unload-time"), ONE_DASH },
+ '\0', N_("SYMBOL"), N_("Call SYMBOL at unload-time"), ONE_DASH },
{ {"force-exe-suffix", no_argument, NULL, OPTION_FORCE_EXE_SUFFIX},
- '\0', NULL, N_("Force generation of file with .exe suffix"), TWO_DASHES},
+ '\0', NULL, N_("Force generation of file with .exe suffix"), TWO_DASHES},
{ {"gc-sections", no_argument, NULL, OPTION_GC_SECTIONS},
- '\0', NULL, N_("Remove unused sections (on some targets)"),
- TWO_DASHES },
+ '\0', NULL, N_("Remove unused sections (on some targets)"),
+ TWO_DASHES },
{ {"no-gc-sections", no_argument, NULL, OPTION_NO_GC_SECTIONS},
- '\0', NULL, N_("Don't remove unused sections (default)"),
- TWO_DASHES },
+ '\0', NULL, N_("Don't remove unused sections (default)"),
+ TWO_DASHES },
+ { {"hash-size=<NUMBER>", required_argument, NULL, OPTION_HASH_SIZE},
+ '\0', NULL, N_("Set default hash table size close to <NUMBER>"),
+ TWO_DASHES },
{ {"help", no_argument, NULL, OPTION_HELP},
- '\0', NULL, N_("Print option help"), TWO_DASHES },
+ '\0', NULL, N_("Print option help"), TWO_DASHES },
{ {"init", required_argument, NULL, OPTION_INIT},
- '\0', N_("SYMBOL"), N_("Call SYMBOL at load-time"), ONE_DASH },
+ '\0', N_("SYMBOL"), N_("Call SYMBOL at load-time"), ONE_DASH },
{ {"Map", required_argument, NULL, OPTION_MAP},
- '\0', N_("FILE"), N_("Write a map file"), ONE_DASH },
+ '\0', N_("FILE"), N_("Write a map file"), ONE_DASH },
{ {"no-define-common", no_argument, NULL, OPTION_NO_DEFINE_COMMON},
- '\0', NULL, N_("Do not define Common storage"), TWO_DASHES },
+ '\0', NULL, N_("Do not define Common storage"), TWO_DASHES },
{ {"no-demangle", no_argument, NULL, OPTION_NO_DEMANGLE },
- '\0', NULL, N_("Do not demangle symbol names"), TWO_DASHES },
+ '\0', NULL, N_("Do not demangle symbol names"), TWO_DASHES },
{ {"no-keep-memory", no_argument, NULL, OPTION_NO_KEEP_MEMORY},
- '\0', NULL, N_("Use less memory and more disk I/O"), TWO_DASHES },
+ '\0', NULL, N_("Use less memory and more disk I/O"), TWO_DASHES },
{ {"no-undefined", no_argument, NULL, OPTION_NO_UNDEFINED},
- '\0', NULL, N_("Do not allow unresolved references in object files"), 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 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 },
+ '\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},
- '\0', NULL, N_("Disallow undefined version"), TWO_DASHES },
+ '\0', NULL, N_("Disallow undefined version"), TWO_DASHES },
+ { {"default-symver", no_argument, NULL, OPTION_DEFAULT_SYMVER},
+ '\0', NULL, N_("Create default symbol version"), TWO_DASHES },
+ { {"default-imported-symver", no_argument, NULL,
+ OPTION_DEFAULT_IMPORTED_SYMVER},
+ '\0', NULL, N_("Create default symbol version for imported symbols"),
+ TWO_DASHES },
{ {"no-warn-mismatch", no_argument, NULL, OPTION_NO_WARN_MISMATCH},
- '\0', NULL, N_("Don't warn about mismatched input files"), TWO_DASHES},
+ '\0', NULL, N_("Don't warn about mismatched input files"), TWO_DASHES},
{ {"no-whole-archive", no_argument, NULL, OPTION_NO_WHOLE_ARCHIVE},
- '\0', NULL, N_("Turn off --whole-archive"), TWO_DASHES },
+ '\0', NULL, N_("Turn off --whole-archive"), TWO_DASHES },
{ {"noinhibit-exec", no_argument, NULL, OPTION_NOINHIBIT_EXEC},
- '\0', NULL, N_("Create an output file even if errors occur"), TWO_DASHES },
+ '\0', NULL, N_("Create an output file even if errors occur"),
+ TWO_DASHES },
{ {"noinhibit_exec", no_argument, NULL, OPTION_NOINHIBIT_EXEC},
- '\0', NULL, NULL, NO_HELP },
+ '\0', NULL, NULL, NO_HELP },
{ {"nostdlib", no_argument, NULL, OPTION_NOSTDLIB},
- '\0', NULL, N_("Only use library directories specified on\n\t\t\t\tthe command line"), ONE_DASH },
+ '\0', NULL, N_("Only use library directories specified on\n"
+ "\t\t\t\tthe command line"), ONE_DASH },
{ {"oformat", required_argument, NULL, OPTION_OFORMAT},
- '\0', N_("TARGET"), N_("Specify target of output file"), EXACTLY_TWO_DASHES },
+ '\0', N_("TARGET"), N_("Specify target of output file"),
+ EXACTLY_TWO_DASHES },
{ {"qmagic", no_argument, NULL, OPTION_IGNORE},
- '\0', NULL, N_("Ignored for Linux compatibility"), ONE_DASH },
+ '\0', NULL, N_("Ignored for Linux compatibility"), ONE_DASH },
+ { {"reduce-memory-overheads", no_argument, NULL,
+ OPTION_REDUCE_MEMORY_OVERHEADS},
+ '\0', NULL, N_("Reduce memory overheads, possibly taking much longer"),
+ TWO_DASHES },
{ {"relax", no_argument, NULL, OPTION_RELAX},
- '\0', NULL, N_("Relax branches on certain targets"), TWO_DASHES },
+ '\0', NULL, N_("Relax branches on certain targets"), TWO_DASHES },
{ {"retain-symbols-file", required_argument, NULL,
- OPTION_RETAIN_SYMBOLS_FILE},
- '\0', N_("FILE"), N_("Keep only symbols listed in FILE"), TWO_DASHES },
+ OPTION_RETAIN_SYMBOLS_FILE},
+ '\0', N_("FILE"), N_("Keep only symbols listed in FILE"), TWO_DASHES },
{ {"rpath", required_argument, NULL, OPTION_RPATH},
- '\0', N_("PATH"), N_("Set runtime shared library search path"), ONE_DASH },
+ '\0', N_("PATH"), N_("Set runtime shared library search path"), ONE_DASH },
{ {"rpath-link", required_argument, NULL, OPTION_RPATH_LINK},
- '\0', N_("PATH"), N_("Set link time shared library search path"), ONE_DASH },
+ '\0', N_("PATH"), N_("Set link time shared library search path"),
+ ONE_DASH },
{ {"shared", no_argument, NULL, OPTION_SHARED},
- '\0', NULL, N_("Create a shared library"), ONE_DASH },
+ '\0', NULL, N_("Create a shared library"), ONE_DASH },
{ {"Bshareable", no_argument, NULL, OPTION_SHARED }, /* FreeBSD. */
- '\0', NULL, NULL, ONE_DASH },
+ '\0', NULL, NULL, ONE_DASH },
{ {"pie", no_argument, NULL, OPTION_PIE},
- '\0', NULL, N_("Create a position independent executable"), ONE_DASH },
+ '\0', NULL, N_("Create a position independent executable"), ONE_DASH },
{ {"pic-executable", no_argument, NULL, OPTION_PIE},
- '\0', NULL, NULL, TWO_DASHES },
+ '\0', NULL, NULL, TWO_DASHES },
{ {"sort-common", no_argument, NULL, OPTION_SORT_COMMON},
- '\0', NULL, N_("Sort common symbols by size"), TWO_DASHES },
+ '\0', NULL, N_("Sort common symbols by size"), TWO_DASHES },
{ {"sort_common", no_argument, NULL, OPTION_SORT_COMMON},
- '\0', NULL, NULL, NO_HELP },
+ '\0', NULL, NULL, NO_HELP },
+ { {"sort-section", required_argument, NULL, OPTION_SORT_SECTION},
+ '\0', N_("name|alignment"),
+ N_("Sort sections by name or maximum alignment"), TWO_DASHES },
{ {"spare-dynamic-tags", required_argument, NULL, OPTION_SPARE_DYNAMIC_TAGS},
- '\0', N_("COUNT"), N_("How many tags to reserve in .dynamic section"), TWO_DASHES },
+ '\0', N_("COUNT"), N_("How many tags to reserve in .dynamic section"),
+ TWO_DASHES },
{ {"split-by-file", optional_argument, NULL, OPTION_SPLIT_BY_FILE},
- '\0', N_("[=SIZE]"), N_("Split output sections every SIZE octets"), TWO_DASHES },
+ '\0', N_("[=SIZE]"), N_("Split output sections every SIZE octets"),
+ TWO_DASHES },
{ {"split-by-reloc", optional_argument, NULL, OPTION_SPLIT_BY_RELOC},
- '\0', N_("[=COUNT]"), N_("Split output sections every COUNT relocs"), TWO_DASHES },
+ '\0', N_("[=COUNT]"), N_("Split output sections every COUNT relocs"),
+ TWO_DASHES },
{ {"stats", no_argument, NULL, OPTION_STATS},
- '\0', NULL, N_("Print memory usage statistics"), TWO_DASHES },
+ '\0', NULL, N_("Print memory usage statistics"), TWO_DASHES },
{ {"target-help", no_argument, NULL, OPTION_TARGET_HELP},
- '\0', NULL, N_("Display target specific options"), TWO_DASHES },
+ '\0', NULL, N_("Display target specific options"), TWO_DASHES },
{ {"task-link", required_argument, NULL, OPTION_TASK_LINK},
- '\0', N_("SYMBOL"), N_("Do task level linking"), TWO_DASHES },
+ '\0', N_("SYMBOL"), N_("Do task level linking"), TWO_DASHES },
{ {"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT},
- '\0', NULL, N_("Use same format as native linker"), TWO_DASHES },
+ '\0', NULL, N_("Use same format as native linker"), TWO_DASHES },
{ {"section-start", required_argument, NULL, OPTION_SECTION_START},
- '\0', N_("SECTION=ADDRESS"), N_("Set address of named section"), TWO_DASHES },
+ '\0', N_("SECTION=ADDRESS"), N_("Set address of named section"),
+ TWO_DASHES },
{ {"Tbss", required_argument, NULL, OPTION_TBSS},
- '\0', N_("ADDRESS"), N_("Set address of .bss section"), ONE_DASH },
+ '\0', N_("ADDRESS"), N_("Set address of .bss section"), ONE_DASH },
{ {"Tdata", required_argument, NULL, OPTION_TDATA},
- '\0', N_("ADDRESS"), N_("Set address of .data section"), ONE_DASH },
+ '\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 },
+ '\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 },
+ '\0', NULL, N_("Output lots of information during link"), TWO_DASHES },
{ {"dll-verbose", no_argument, NULL, OPTION_VERBOSE}, /* Linux. */
- '\0', NULL, NULL, NO_HELP },
+ '\0', NULL, NULL, NO_HELP },
{ {"version-script", required_argument, NULL, OPTION_VERSION_SCRIPT },
- '\0', N_("FILE"), N_("Read version information script"), TWO_DASHES },
+ '\0', N_("FILE"), N_("Read version information script"), TWO_DASHES },
{ {"version-exports-section", required_argument, NULL,
OPTION_VERSION_EXPORTS_SECTION },
- '\0', N_("SYMBOL"), N_("Take export symbols list from .exports, using\n\t\t\t\tSYMBOL as the version."),
- TWO_DASHES },
+ '\0', N_("SYMBOL"), N_("Take export symbols list from .exports, using\n"
+ "\t\t\t\tSYMBOL as the version."), TWO_DASHES },
{ {"warn-common", no_argument, NULL, OPTION_WARN_COMMON},
- '\0', NULL, N_("Warn about duplicate common symbols"), TWO_DASHES },
+ '\0', NULL, N_("Warn about duplicate common symbols"), TWO_DASHES },
{ {"warn-constructors", no_argument, NULL, OPTION_WARN_CONSTRUCTORS},
- '\0', NULL, N_("Warn if global constructors/destructors are seen"),
- TWO_DASHES },
+ '\0', NULL, N_("Warn if global constructors/destructors are seen"),
+ TWO_DASHES },
{ {"warn-multiple-gp", no_argument, NULL, OPTION_WARN_MULTIPLE_GP},
- '\0', NULL, N_("Warn if the multiple GP values are used"), TWO_DASHES },
+ '\0', NULL, N_("Warn if the multiple GP values are used"), TWO_DASHES },
{ {"warn-once", no_argument, NULL, OPTION_WARN_ONCE},
- '\0', NULL, N_("Warn only once per undefined symbol"), TWO_DASHES },
+ '\0', NULL, N_("Warn only once per undefined symbol"), TWO_DASHES },
{ {"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_("Warn if start of section changes due to alignment"),
+ TWO_DASHES },
+ { {"warn-shared-textrel", no_argument, NULL, OPTION_WARN_SHARED_TEXTREL},
+ '\0', NULL, N_("Warn if shared object has DT_TEXTREL"),
+ 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},
+ { {"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 },
+ '\0', NULL, N_("Include all objects from following archives"),
+ TWO_DASHES },
{ {"wrap", required_argument, NULL, OPTION_WRAP},
- '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES }
+ '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES },
};
#define OPTION_COUNT ARRAY_SIZE (ld_options)
@@ -678,6 +751,9 @@ parse_args (unsigned argc, char **argv)
case OPTION_DYNAMIC_LINKER:
command_line.interpreter = optarg;
break;
+ case OPTION_SYSROOT:
+ /* Already handled in ldmain.c. */
+ break;
case OPTION_EB:
command_line.endian = ENDIAN_BIG;
break;
@@ -734,7 +810,7 @@ parse_args (unsigned argc, char **argv)
/* Ignore. */
break;
case OPTION_GC_SECTIONS:
- command_line.gc_sections = TRUE;
+ link_info.gc_sections = TRUE;
break;
case OPTION_HELP:
help ();
@@ -777,19 +853,21 @@ parse_args (unsigned argc, char **argv)
demangling = FALSE;
break;
case OPTION_NO_GC_SECTIONS:
- command_line.gc_sections = FALSE;
+ link_info.gc_sections = FALSE;
break;
case OPTION_NO_KEEP_MEMORY:
link_info.keep_memory = FALSE;
break;
case OPTION_NO_UNDEFINED:
- link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols;
+ link_info.unresolved_syms_in_objects
+ = how_to_report_unresolved_symbols;
break;
case OPTION_ALLOW_SHLIB_UNDEFINED:
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;
+ link_info.unresolved_syms_in_shared_libs
+ = how_to_report_unresolved_symbols;
break;
case OPTION_UNRESOLVED_SYMBOLS:
if (strcmp (optarg, "ignore-all") == 0)
@@ -799,17 +877,21 @@ parse_args (unsigned argc, char **argv)
}
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;
+ 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;
+ 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_objects
+ = how_to_report_unresolved_symbols;
link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
}
else
@@ -822,20 +904,26 @@ parse_args (unsigned argc, char **argv)
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;
+ break;
case OPTION_ALLOW_MULTIPLE_DEFINITION:
link_info.allow_multiple_definition = TRUE;
break;
case OPTION_NO_UNDEFINED_VERSION:
link_info.allow_undefined_version = FALSE;
break;
+ case OPTION_DEFAULT_SYMVER:
+ link_info.create_default_symver = TRUE;
+ break;
+ case OPTION_DEFAULT_IMPORTED_SYMVER:
+ link_info.default_imported_symver = TRUE;
+ break;
case OPTION_NO_WARN_MISMATCH:
command_line.warn_mismatch = FALSE;
break;
@@ -1008,6 +1096,15 @@ parse_args (unsigned argc, char **argv)
case OPTION_SORT_COMMON:
config.sort_common = TRUE;
break;
+ case OPTION_SORT_SECTION:
+ if (strcmp (optarg, N_("name")) == 0)
+ sort_section = by_name;
+ else if (strcmp (optarg, N_("alignment")) == 0)
+ sort_section = by_alignment;
+ else
+ einfo (_("%P%F: invalid section sorting option: %s\n"),
+ optarg);
+ break;
case OPTION_STATS:
config.stats = TRUE;
break;
@@ -1031,13 +1128,15 @@ parse_args (unsigned argc, char **argv)
/* Check for <something>=<somthing>... */
optarg2 = strchr (optarg, '=');
if (optarg2 == NULL)
- einfo (_("%P%F: invalid argument to option \"--section-start\"\n"));
+ einfo (_("%P%F: invalid argument to option"
+ " \"--section-start\"\n"));
optarg2++;
/* So far so good. Are all the args present? */
if ((*optarg == '\0') || (*optarg2 == '\0'))
- einfo (_("%P%F: missing argument(s) to option \"--section-start\"\n"));
+ einfo (_("%P%F: missing argument(s) to option"
+ " \"--section-start\"\n"));
/* We must copy the section name as set_section_start
doesn't do it for us. */
@@ -1055,13 +1154,13 @@ parse_args (unsigned argc, char **argv)
ldemul_list_emulation_options (stdout);
exit (0);
case OPTION_TBSS:
- set_section_start (".bss", optarg);
+ set_segment_start (".bss", optarg);
break;
case OPTION_TDATA:
- set_section_start (".data", optarg);
+ set_segment_start (".data", optarg);
break;
case OPTION_TTEXT:
- set_section_start (".text", optarg);
+ set_segment_start (".text", optarg);
break;
case OPTION_TRADITIONAL_FORMAT:
link_info.traditional_format = TRUE;
@@ -1141,9 +1240,18 @@ parse_args (unsigned argc, char **argv)
case OPTION_WARN_SECTION_ALIGN:
config.warn_section_align = TRUE;
break;
+ case OPTION_WARN_SHARED_TEXTREL:
+ link_info.warn_shared_textrel = TRUE;
+ break;
case OPTION_WHOLE_ARCHIVE:
whole_archive = TRUE;
break;
+ case OPTION_ADD_NEEDED:
+ add_needed = TRUE;
+ break;
+ case OPTION_NO_ADD_NEEDED:
+ add_needed = FALSE;
+ break;
case OPTION_AS_NEEDED:
/* XXX: --as-needed is broken on powerpc64 */
#ifndef __powerpc64__
@@ -1224,6 +1332,24 @@ parse_args (unsigned argc, char **argv)
case OPTION_FINI:
link_info.fini_function = optarg;
break;
+
+ case OPTION_REDUCE_MEMORY_OVERHEADS:
+ command_line.reduce_memory_overheads = TRUE;
+ if (config.hash_table_size == 0)
+ config.hash_table_size = 1021;
+ break;
+
+ case OPTION_HASH_SIZE:
+ {
+ bfd_size_type new_size;
+
+ new_size = strtoul (optarg, NULL, 0);
+ if (new_size)
+ config.hash_table_size = new_size;
+ else
+ einfo (_("%P%X: --hash-size needs a numeric argument\n"));
+ }
+ break;
}
}
@@ -1239,7 +1365,7 @@ parse_args (unsigned argc, char **argv)
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;
@@ -1273,8 +1399,44 @@ set_section_start (char *sect, char *valstr)
bfd_vma val = bfd_scan_vma (valstr, &end, 16);
if (*end)
einfo (_("%P%F: invalid hex number `%s'\n"), valstr);
- lang_section_start (sect, exp_intop (val));
+ lang_section_start (sect, exp_intop (val), NULL);
+}
+
+static void
+set_segment_start (const char *section, char *valstr)
+{
+ const char *name;
+ const char *end;
+ segment_type *seg;
+
+ bfd_vma val = bfd_scan_vma (valstr, &end, 16);
+ if (*end)
+ einfo (_("%P%F: invalid hex number `%s'\n"), valstr);
+ /* If we already have an entry for this segment, update the existing
+ value. */
+ name = section + 1;
+ for (seg = segments; seg; seg = seg->next)
+ if (strcmp (seg->name, name) == 0)
+ {
+ seg->value = val;
+ return;
+ }
+ /* There was no existing value so we must create a new segment
+ entry. */
+ seg = stat_alloc (sizeof (*seg));
+ seg->name = name;
+ seg->value = val;
+ seg->used = FALSE;
+ /* Add it to the linked list of segments. */
+ seg->next = segments;
+ segments = seg;
+ /* Historically, -Ttext and friends set the base address of a
+ particular section. For backwards compatibility, we still do
+ that. If a SEGMENT_START directive is seen, the section address
+ assignment will be disabled. */
+ lang_section_start (section, exp_intop (val), seg);
}
+
/* Print help messages for the options. */
@@ -1283,6 +1445,7 @@ help (void)
{
unsigned i;
const char **targets, **pp;
+ int len;
printf (_("Usage: %s [options] file...\n"), program_name);
@@ -1292,7 +1455,6 @@ help (void)
if (ld_options[i].doc != NULL)
{
bfd_boolean comma;
- int len;
unsigned j;
printf (" ");
@@ -1365,6 +1527,10 @@ help (void)
printf ("%s\n", _(ld_options[i].doc));
}
}
+ printf (_(" @FILE"));
+ for (len = strlen (" @FILE"); len < 30; len++)
+ putchar (' ');
+ printf (_("Read options from FILE\n"));
/* Note: Various tools (such as libtool) depend upon the
format of the listings below - do not change them. */
diff --git a/contrib/binutils/ld/mri.c b/contrib/binutils/ld/mri.c
index f7edd88..5330df3 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,
- 2003, 2004 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001,
+ 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -16,8 +16,8 @@ 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.
+Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+02110-1301, USA.
This bit does the tree decoration when MRI style link scripts
are parsed.
@@ -44,14 +44,14 @@ struct section_name_struct {
int ok_to_load;
};
-unsigned int symbol_truncate = 10000;
-struct section_name_struct *order;
-struct section_name_struct *only_load;
-struct section_name_struct *address;
-struct section_name_struct *alias;
+static unsigned int symbol_truncate = 10000;
+static struct section_name_struct *order;
+static struct section_name_struct *only_load;
+static struct section_name_struct *address;
+static struct section_name_struct *alias;
-struct section_name_struct *alignment;
-struct section_name_struct *subalignment;
+static struct section_name_struct *alignment;
+static struct section_name_struct *subalignment;
static struct section_name_struct **
lookup (const char *name, struct section_name_struct **list)
@@ -120,19 +120,6 @@ mri_draw_tree (void)
if (done_tree)
return;
-#if 0 /* We don't bother with memory regions. */
- /* Create the regions. */
- {
- lang_memory_region_type *r;
-
- 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) 0, "length",
- lang_first_phase_enum);
- }
-#endif
-
/* Now build the statements for the ldlang machine. */
/* Attach the addresses of any which have addresses,
@@ -220,13 +207,13 @@ mri_draw_tree (void)
lang_enter_output_section_statement (p->name, base,
p->ok_to_load ? 0 : noload_section,
- align, subalign, NULL);
+ align, subalign, NULL, 0);
base = 0;
tmp = xmalloc (sizeof *tmp);
tmp->next = NULL;
tmp->spec.name = p->name;
tmp->spec.exclude_name_list = NULL;
- tmp->spec.sorted = FALSE;
+ tmp->spec.sorted = none;
lang_add_wild (NULL, tmp, FALSE);
/* If there is an alias for this section, add it too. */
@@ -237,7 +224,7 @@ mri_draw_tree (void)
tmp->next = NULL;
tmp->spec.name = aptr->name;
tmp->spec.exclude_name_list = NULL;
- tmp->spec.sorted = FALSE;
+ tmp->spec.sorted = none;
lang_add_wild (NULL, tmp, FALSE);
}
@@ -255,9 +242,6 @@ mri_load (const char *name)
{
base = 0;
lang_add_input_file (name, lang_input_file_is_file_enum, NULL);
-#if 0
- lang_leave_output_section_statement (0, "*default*");
-#endif
}
void
diff --git a/contrib/binutils/ld/mri.h b/contrib/binutils/ld/mri.h
index b430d20..fcfba78 100644
--- a/contrib/binutils/ld/mri.h
+++ b/contrib/binutils/ld/mri.h
@@ -15,13 +15,11 @@ 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. */
+Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef MRI_H
#define MRI_H
-extern unsigned int symbol_truncate;
-
extern void mri_output_section (const char *, etree_type *);
extern void mri_only_load (const char *);
extern void mri_base (etree_type *);
diff --git a/contrib/binutils/ld/pe-dll.c b/contrib/binutils/ld/pe-dll.c
index 45d00ae..d4d42e4 100644
--- a/contrib/binutils/ld/pe-dll.c
+++ b/contrib/binutils/ld/pe-dll.c
@@ -1,5 +1,5 @@
/* Routines to help build PEI-format DLLs (Win32 etc)
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by DJ Delorie <dj@cygnus.com>
@@ -17,8 +17,8 @@
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. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -398,7 +398,7 @@ auto_export (bfd *abfd, def_file *d, const char *n)
libname = lbasename (abfd->my_archive->filename);
/* We should not re-export imported stuff. */
- if (strncmp (n, "_imp__", 6) == 0)
+ if (strncmp (n, "_imp_", 5) == 0)
return 0;
for (i = 0; i < d->num_exports; i++)
@@ -515,7 +515,7 @@ process_def_file (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
s = bfd_get_section_by_name (b, ".drectve");
if (s)
{
- int size = bfd_get_section_size_before_reloc (s);
+ long size = s->size;
char *buf = xmalloc (size);
bfd_get_section_contents (b, s, buf, 0, size);
@@ -527,7 +527,7 @@ process_def_file (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *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)
+ && info->executable)
return;
/* Now, maybe export everything else the default way. */
@@ -596,8 +596,13 @@ process_def_file (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
have. */
int lead_at = (*pe_def_file->exports[i].name == '@');
char *tmp = xstrdup (pe_def_file->exports[i].name + lead_at);
+ char *tmp_at = strchr (tmp, '@');
- *(strchr (tmp, '@')) = 0;
+ if (tmp_at)
+ *tmp_at = 0;
+ else
+ einfo (_("%XCannot export %s: invalid export name\n"),
+ pe_def_file->exports[i].name);
pe_def_file->exports[i].name = tmp;
}
}
@@ -680,6 +685,27 @@ process_def_file (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
{
char *name;
+ /* Check for forward exports */
+ if (strchr (pe_def_file->exports[i].internal_name, '.'))
+ {
+ count_exported++;
+ if (!pe_def_file->exports[i].flag_noname)
+ count_exported_byname++;
+
+ pe_def_file->exports[i].flag_forward = 1;
+
+ if (pe_def_file->exports[i].ordinal != -1)
+ {
+ if (max_ordinal < pe_def_file->exports[i].ordinal)
+ max_ordinal = pe_def_file->exports[i].ordinal;
+ if (min_ordinal > pe_def_file->exports[i].ordinal)
+ min_ordinal = pe_def_file->exports[i].ordinal;
+ count_with_ordinals++;
+ }
+
+ continue;
+ }
+
name = xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2);
if (pe_details->underscored
&& (*pe_def_file->exports[i].internal_name != '@'))
@@ -757,7 +783,7 @@ build_filler_bfd (int include_edata)
bfd_get_arch (output_bfd),
bfd_get_mach (output_bfd)))
{
- einfo ("%X%P: can not create BFD %E\n");
+ einfo ("%X%P: can not create BFD: %E\n");
return;
}
@@ -837,7 +863,8 @@ generate_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
/* Now we need to assign ordinals to those that don't have them. */
for (i = 0; i < NE; i++)
{
- if (exported_symbol_sections[i])
+ if (exported_symbol_sections[i] ||
+ pe_def_file->exports[i].flag_forward)
{
if (pe_def_file->exports[i].ordinal != -1)
{
@@ -856,19 +883,26 @@ generate_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
}
name_table_size += strlen (pe_def_file->exports[i].name) + 1;
}
+
+ /* Reserve space for the forward name. */
+ if (pe_def_file->exports[i].flag_forward)
+ {
+ name_table_size += strlen (pe_def_file->exports[i].internal_name) + 1;
+ }
}
next_ordinal = min_ordinal;
for (i = 0; i < NE; i++)
- if (exported_symbol_sections[i])
- if (pe_def_file->exports[i].ordinal == -1)
- {
- while (exported_symbols[next_ordinal - min_ordinal] != -1)
- next_ordinal++;
+ if ((exported_symbol_sections[i] ||
+ pe_def_file->exports[i].flag_forward) &&
+ pe_def_file->exports[i].ordinal == -1)
+ {
+ while (exported_symbols[next_ordinal - min_ordinal] != -1)
+ next_ordinal++;
- exported_symbols[next_ordinal - min_ordinal] = i;
- pe_def_file->exports[i].ordinal = next_ordinal;
- }
+ exported_symbols[next_ordinal - min_ordinal] = i;
+ pe_def_file->exports[i].ordinal = next_ordinal;
+ }
/* OK, now we can allocate some memory. */
edata_sz = (40 /* directory */
@@ -920,7 +954,7 @@ fill_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
unsigned char *eaddresses;
unsigned char *enameptrs;
unsigned char *eordinals;
- unsigned char *enamestr;
+ char *enamestr;
time_t now;
time (&now);
@@ -932,7 +966,7 @@ fill_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
eaddresses = edata_d + 40;
enameptrs = eaddresses + 4 * export_table_size;
eordinals = enameptrs + 4 * count_exported_byname;
- enamestr = eordinals + 2 * count_exported_byname;
+ enamestr = (char *) eordinals + 2 * count_exported_byname;
#define ERVA(ptr) (((unsigned char *)(ptr) - edata_d) \
+ edata_s->output_section->vma - image_base)
@@ -967,15 +1001,28 @@ fill_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
for (s = 0; s < NE; s++)
{
struct bfd_section *ssec = exported_symbol_sections[s];
- if (ssec && pe_def_file->exports[s].ordinal != -1)
+ if (pe_def_file->exports[s].ordinal != -1 &&
+ (pe_def_file->exports[s].flag_forward || ssec != NULL))
{
- 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,
- eaddresses + 4 * (ord - min_ordinal));
+ if (pe_def_file->exports[s].flag_forward)
+ {
+ bfd_put_32 (abfd, ERVA (enamestr),
+ eaddresses + 4 * (ord - min_ordinal));
+
+ strcpy (enamestr, pe_def_file->exports[s].internal_name);
+ enamestr += strlen (pe_def_file->exports[s].internal_name) + 1;
+ }
+ else
+ {
+ unsigned long srva = (exported_symbol_offsets[s]
+ + ssec->output_section->vma
+ + ssec->output_offset);
+
+ bfd_put_32 (abfd, srva - image_base,
+ eaddresses + 4 * (ord - min_ordinal));
+ }
if (!pe_def_file->exports[s].flag_noname)
{
@@ -1178,9 +1225,6 @@ generate_reloc (bfd *abfd, struct bfd_link_info *info)
free (relocs);
/* Warning: the allocated symbols are remembered in BFD and
reused later, so don't free them! */
-#if 0
- free (symbol);
-#endif
}
}
@@ -1252,7 +1296,7 @@ generate_reloc (bfd *abfd, struct bfd_link_info *info)
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)
+ while (reloc_sz < reloc_s->size)
reloc_d[reloc_sz++] = 0;
}
@@ -1674,7 +1718,7 @@ make_tail (bfd *parent)
bfd_set_section_size (abfd, id7, len);
d7 = xmalloc (len);
id7->contents = d7;
- strcpy (d7, dll_filename);
+ strcpy ((char *) d7, dll_filename);
bfd_set_symtab (abfd, symtab, symptr);
@@ -1897,7 +1941,7 @@ make_one (def_file_export *exp, bfd *parent)
memset (d6, 0, len);
d6[0] = exp->hint & 0xff;
d6[1] = exp->hint >> 8;
- strcpy (d6 + 2, exp->name);
+ strcpy ((char *) d6 + 2, exp->name);
}
bfd_set_symtab (abfd, symtab, symptr);
@@ -2037,9 +2081,6 @@ make_import_fixup_entry (const char *name,
symtab = xmalloc (6 * sizeof (asymbol *));
id3 = quick_section (abfd, ".idata$3", SEC_HAS_CONTENTS, 2);
-#if 0
- quick_symbol (abfd, U ("_head_"), dll_symname, "", id2, BSF_GLOBAL, 0);
-#endif
quick_symbol (abfd, U ("_nm_thnk_"), name, "", UNDSEC, BSF_GLOBAL, 0);
quick_symbol (abfd, U (""), dll_symname, "_iname", UNDSEC, BSF_GLOBAL, 0);
quick_symbol (abfd, "", fixup_name, "", UNDSEC, BSF_GLOBAL, 0);
@@ -2231,7 +2272,7 @@ pe_dll_generate_implib (def_file *def, const char *impfilename)
if (!ISALNUM (dll_symname[i]))
dll_symname[i] = '_';
- unlink (impfilename);
+ unlink_if_ordinary (impfilename);
outarch = bfd_openw (impfilename, 0);
@@ -2243,8 +2284,8 @@ pe_dll_generate_implib (def_file *def, const char *impfilename)
}
/* xgettext:c-format */
- einfo (_("Creating library file: %s\n"), impfilename);
-
+ info_msg (_("Creating library file: %s\n"), impfilename);
+
bfd_set_format (outarch, bfd_archive);
outarch->has_armap = 1;
@@ -2278,10 +2319,10 @@ pe_dll_generate_implib (def_file *def, const char *impfilename)
head = ar_tail;
if (! bfd_set_archive_head (outarch, head))
- einfo ("%Xbfd_set_archive_head: %s\n", bfd_errmsg (bfd_get_error ()));
+ einfo ("%Xbfd_set_archive_head: %E\n");
if (! bfd_close (outarch))
- einfo ("%Xbfd_close %s: %s\n", impfilename, bfd_errmsg (bfd_get_error ()));
+ einfo ("%Xbfd_close %s: %E\n", impfilename);
while (head != NULL)
{
@@ -2303,7 +2344,7 @@ add_bfd_to_link (bfd *abfd, const char *name, struct bfd_link_info *link_info)
ldlang_add_file (fake_file);
if (!bfd_link_add_symbols (abfd, link_info))
- einfo ("%Xaddsym %s: %s\n", name, bfd_errmsg (bfd_get_error ()));
+ einfo ("%Xaddsym %s: %E\n", name);
}
void
@@ -2418,18 +2459,6 @@ pe_get32 (bfd *abfd, int where)
return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24);
}
-#if 0 /* This is not currently used. */
-
-static unsigned int
-pe_as16 (void *ptr)
-{
- unsigned char *b = ptr;
-
- return b[0] + (b[1] << 8);
-}
-
-#endif
-
static unsigned int
pe_as32 (void *ptr)
{
@@ -2445,7 +2474,8 @@ pe_implied_import_dll (const char *filename)
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 char *expdata;
+ char *erva;
unsigned long name_rvas, ordinals, nexp, ordbase;
const char *dll_name;
/* Initialization with start > end guarantees that is_data
@@ -2462,7 +2492,7 @@ pe_implied_import_dll (const char *filename)
dll = bfd_openr (filename, pe_details->target_name);
if (!dll)
{
- einfo ("%Xopen %s: %s\n", filename, bfd_errmsg (bfd_get_error ()));
+ einfo ("%Xopen %s: %E\n", filename);
return FALSE;
}
@@ -2555,7 +2585,7 @@ pe_implied_import_dll (const char *filename)
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;
+ erva = (char *) expdata - export_rva;
if (pe_def_file == 0)
pe_def_file = def_file_empty ();
@@ -2568,7 +2598,7 @@ pe_implied_import_dll (const char *filename)
/* Use internal dll name instead of filename
to enable symbolic dll linking. */
- dll_name = pe_as32 (expdata + 12) + erva;
+ dll_name = erva + pe_as32 (expdata + 12);
/* Check to see if the dll has already been added to
the definition list and if so return without error.
@@ -2653,19 +2683,19 @@ pe_dll_fill_sections (bfd *abfd, struct bfd_link_info *info)
bfd_set_section_size (filler_bfd, reloc_s, reloc_sz);
/* Resize the sections. */
- lang_size_sections (stat_ptr->head, abs_output_section,
- &stat_ptr->head, 0, 0, NULL, TRUE);
+ lang_reset_memory_regions ();
+ lang_size_sections (NULL, TRUE);
/* Redo special stuff. */
ldemul_after_allocation ();
/* Do the assignments again. */
- lang_do_assignments (stat_ptr->head, abs_output_section, NULL, 0);
+ lang_do_assignments ();
}
fill_edata (abfd, info);
- if (info->shared)
+ if (info->shared && !info->pie)
pe_data (abfd)->dll = 1;
edata_s->contents = edata_d;
@@ -2684,14 +2714,14 @@ pe_exe_fill_sections (bfd *abfd, struct bfd_link_info *info)
bfd_set_section_size (filler_bfd, reloc_s, reloc_sz);
/* Resize the sections. */
- lang_size_sections (stat_ptr->head, abs_output_section,
- &stat_ptr->head, 0, 0, NULL, TRUE);
+ lang_reset_memory_regions ();
+ lang_size_sections (NULL, TRUE);
/* Redo special stuff. */
ldemul_after_allocation ();
/* Do the assignments again. */
- lang_do_assignments (stat_ptr->head, abs_output_section, NULL, 0);
+ lang_do_assignments ();
}
reloc_s->contents = reloc_d;
}
diff --git a/contrib/binutils/ld/pe-dll.h b/contrib/binutils/ld/pe-dll.h
index 029bf33..c79e563 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, 2003 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -15,8 +15,8 @@
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. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#ifndef PE_DLL_H
#define PE_DLL_H
diff --git a/contrib/binutils/ld/po/Make-in b/contrib/binutils/ld/po/Make-in
index 6b6cfda..dcd8cba 100644
--- a/contrib/binutils/ld/po/Make-in
+++ b/contrib/binutils/ld/po/Make-in
@@ -1,7 +1,8 @@
# Makefile for program source directory in GNU NLS utilities package.
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+# Copyright 2003, 2006 Free Software Foundation, Inc.
#
-# This file file be copied and used freely without restrictions. It can
+# This file may be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
@@ -109,6 +110,7 @@ $(srcdir)/stamp-cat-id: $(PACKAGE).pot
install: install-exec install-data
install-exec:
install-info:
+install-html:
install-data: install-data-@USE_NLS@
install-data-no: all
install-data-yes: all
@@ -184,7 +186,7 @@ check: all
cat-id-tbl.o: ../intl/libgettext.h
-dvi info tags TAGS ID:
+html dvi pdf ps info tags TAGS ID:
mostlyclean:
rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
diff --git a/contrib/binutils/ld/po/POTFILES.in b/contrib/binutils/ld/po/POTFILES.in
index 55ae6ff..5bb2e11 100644
--- a/contrib/binutils/ld/po/POTFILES.in
+++ b/contrib/binutils/ld/po/POTFILES.in
@@ -1,4 +1,5 @@
deffile.h
+elf-hints-local.h
emultempl/armcoff.em
emultempl/pe.em
ldcref.c
diff --git a/contrib/binutils/ld/po/ld.pot b/contrib/binutils/ld/po/ld.pot
index 371423c..549ecf4 100644
--- a/contrib/binutils/ld/po/ld.pot
+++ b/contrib/binutils/ld/po/ld.pot
@@ -7,7 +7,8 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2003-07-11 13:58+0930\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-03-25 18:36+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,10 +17,12 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
#: emultempl/armcoff.em:72
+#, c-format
msgid " --support-old-code Support interworking with old code\n"
msgstr ""
#: emultempl/armcoff.em:73
+#, c-format
msgid " --thumb-entry=<sym> Set the entry point to be Thumb symbol <sym>\n"
msgstr ""
@@ -28,161 +31,191 @@ msgstr ""
msgid "Errors encountered processing file %s"
msgstr ""
-#: emultempl/armcoff.em:188 emultempl/pe.em:1396
+#: emultempl/armcoff.em:190 emultempl/pe.em:1460
msgid "%P: warning: '--thumb-entry %s' is overriding '-e %s'\n"
msgstr ""
-#: emultempl/armcoff.em:193 emultempl/pe.em:1401
+#: emultempl/armcoff.em:195 emultempl/pe.em:1465
msgid "%P: warning: connot find thumb start symbol %s\n"
msgstr ""
-#: emultempl/pe.em:300
+#: emultempl/pe.em:304
+#, c-format
msgid ""
" --base_file <basefile> Generate a base file for relocatable "
"DLLs\n"
msgstr ""
-#: emultempl/pe.em:301
+#: emultempl/pe.em:305
+#, c-format
msgid ""
" --dll Set image base to the default for DLLs\n"
msgstr ""
-#: emultempl/pe.em:302
+#: emultempl/pe.em:306
+#, c-format
msgid " --file-alignment <size> Set file alignment\n"
msgstr ""
-#: emultempl/pe.em:303
+#: emultempl/pe.em:307
+#, c-format
msgid " --heap <size> Set initial size of the heap\n"
msgstr ""
-#: emultempl/pe.em:304
+#: emultempl/pe.em:308
+#, c-format
msgid ""
" --image-base <address> Set start address of the executable\n"
msgstr ""
-#: emultempl/pe.em:305
+#: emultempl/pe.em:309
+#, c-format
msgid ""
" --major-image-version <number> Set version number of the executable\n"
msgstr ""
-#: emultempl/pe.em:306
+#: emultempl/pe.em:310
+#, c-format
msgid " --major-os-version <number> Set minimum required OS version\n"
msgstr ""
-#: emultempl/pe.em:307
+#: emultempl/pe.em:311
+#, c-format
msgid ""
" --major-subsystem-version <number> Set minimum required OS subsystem "
"version\n"
msgstr ""
-#: emultempl/pe.em:308
+#: emultempl/pe.em:312
+#, c-format
msgid ""
" --minor-image-version <number> Set revision number of the executable\n"
msgstr ""
-#: emultempl/pe.em:309
+#: emultempl/pe.em:313
+#, c-format
msgid " --minor-os-version <number> Set minimum required OS revision\n"
msgstr ""
-#: emultempl/pe.em:310
+#: emultempl/pe.em:314
+#, c-format
msgid ""
" --minor-subsystem-version <number> Set minimum required OS subsystem "
"revision\n"
msgstr ""
-#: emultempl/pe.em:311
+#: emultempl/pe.em:315
+#, c-format
msgid " --section-alignment <size> Set section alignment\n"
msgstr ""
-#: emultempl/pe.em:312
+#: emultempl/pe.em:316
+#, c-format
msgid " --stack <size> Set size of the initial stack\n"
msgstr ""
-#: emultempl/pe.em:313
+#: emultempl/pe.em:317
+#, c-format
msgid ""
" --subsystem <name>[:<version>] Set required OS subsystem [& version]\n"
msgstr ""
-#: emultempl/pe.em:314
+#: emultempl/pe.em:318
+#, c-format
msgid ""
" --support-old-code Support interworking with old code\n"
msgstr ""
-#: emultempl/pe.em:315
+#: emultempl/pe.em:319
+#, c-format
msgid ""
" --thumb-entry=<symbol> Set the entry point to be Thumb "
"<symbol>\n"
msgstr ""
-#: emultempl/pe.em:317
+#: emultempl/pe.em:321
+#, c-format
msgid ""
" --add-stdcall-alias Export symbols with and without @nn\n"
msgstr ""
-#: emultempl/pe.em:318
+#: emultempl/pe.em:322
+#, c-format
msgid " --disable-stdcall-fixup Don't link _sym to _sym@nn\n"
msgstr ""
-#: emultempl/pe.em:319
+#: emultempl/pe.em:323
+#, c-format
msgid ""
" --enable-stdcall-fixup Link _sym to _sym@nn without warnings\n"
msgstr ""
-#: emultempl/pe.em:320
+#: emultempl/pe.em:324
+#, c-format
msgid ""
" --exclude-symbols sym,sym,... Exclude symbols from automatic export\n"
msgstr ""
-#: emultempl/pe.em:321
+#: emultempl/pe.em:325
+#, c-format
msgid ""
" --exclude-libs lib,lib,... Exclude libraries from automatic "
"export\n"
msgstr ""
-#: emultempl/pe.em:322
+#: emultempl/pe.em:326
+#, c-format
msgid ""
" --export-all-symbols Automatically export all globals to "
"DLL\n"
msgstr ""
-#: emultempl/pe.em:323
+#: emultempl/pe.em:327
+#, c-format
msgid " --kill-at Remove @nn from exported symbols\n"
msgstr ""
-#: emultempl/pe.em:324
+#: emultempl/pe.em:328
+#, c-format
msgid " --out-implib <file> Generate import library\n"
msgstr ""
-#: emultempl/pe.em:325
+#: emultempl/pe.em:329
+#, c-format
msgid ""
" --output-def <file> Generate a .DEF file for the built DLL\n"
msgstr ""
-#: emultempl/pe.em:326
+#: emultempl/pe.em:330
+#, c-format
msgid " --warn-duplicate-exports Warn about duplicate exports.\n"
msgstr ""
-#: emultempl/pe.em:327
+#: emultempl/pe.em:331
+#, c-format
msgid ""
" --compat-implib Create backward compatible import "
"libs;\n"
" create __imp_<SYMBOL> as well.\n"
msgstr ""
-#: emultempl/pe.em:329
+#: emultempl/pe.em:333
+#, c-format
msgid ""
" --enable-auto-image-base Automatically choose image base for "
"DLLs\n"
" unless user specifies one\n"
msgstr ""
-#: emultempl/pe.em:331
+#: emultempl/pe.em:335
+#, c-format
msgid ""
" --disable-auto-image-base Do not auto-choose image base. "
"(default)\n"
msgstr ""
-#: emultempl/pe.em:332
+#: emultempl/pe.em:336
+#, c-format
msgid ""
" --dll-search-prefix=<string> When linking dynamically to a dll "
"without\n"
@@ -191,19 +224,22 @@ msgid ""
" in preference to lib<basename>.dll \n"
msgstr ""
-#: emultempl/pe.em:335
+#: emultempl/pe.em:339
+#, c-format
msgid ""
" --enable-auto-import Do sophistcated linking of _sym to\n"
" __imp_sym for DATA references\n"
msgstr ""
-#: emultempl/pe.em:337
+#: emultempl/pe.em:341
+#, c-format
msgid ""
" --disable-auto-import Do not auto-import DATA items from "
"DLLs\n"
msgstr ""
-#: emultempl/pe.em:338
+#: emultempl/pe.em:342
+#, c-format
msgid ""
" --enable-runtime-pseudo-reloc Work around auto-import limitations by\n"
" adding pseudo-relocations resolved "
@@ -211,14 +247,16 @@ msgid ""
" runtime.\n"
msgstr ""
-#: emultempl/pe.em:341
+#: emultempl/pe.em:345
+#, c-format
msgid ""
" --disable-runtime-pseudo-reloc Do not add runtime pseudo-relocations "
"for\n"
" auto-imported DATA.\n"
msgstr ""
-#: emultempl/pe.em:343
+#: emultempl/pe.em:347
+#, c-format
msgid ""
" --enable-extra-pe-debug Enable verbose debug output when "
"building\n"
@@ -226,7 +264,14 @@ msgid ""
"import)\n"
msgstr ""
-#: emultempl/pe.em:412
+#: emultempl/pe.em:350
+#, c-format
+msgid ""
+" --large-address-aware Executable supports virtual addresses\n"
+" greater than 2 gigabytes\n"
+msgstr ""
+
+#: emultempl/pe.em:417
msgid "%P: warning: bad version number in -subsystem option\n"
msgstr ""
@@ -234,105 +279,108 @@ msgstr ""
msgid "%P%F: invalid subsystem type %s\n"
msgstr ""
-#: emultempl/pe.em:460
+#: emultempl/pe.em:487
msgid "%P%F: invalid hex number for PE parameter '%s'\n"
msgstr ""
-#: emultempl/pe.em:477
+#: emultempl/pe.em:504
msgid "%P%F: strange hex info for PE parameter '%s'\n"
msgstr ""
-#: emultempl/pe.em:494
+#: emultempl/pe.em:521
#, c-format
msgid "%s: Can't open base file %s\n"
msgstr ""
-#: emultempl/pe.em:707
+#: emultempl/pe.em:737
msgid "%P: warning, file alignment > section alignment.\n"
msgstr ""
-#: emultempl/pe.em:794 emultempl/pe.em:821
+#: emultempl/pe.em:824 emultempl/pe.em:851
#, c-format
msgid "Warning: resolving %s by linking to %s\n"
msgstr ""
-#: emultempl/pe.em:799 emultempl/pe.em:826
+#: emultempl/pe.em:829 emultempl/pe.em:856
msgid "Use --enable-stdcall-fixup to disable these warnings\n"
msgstr ""
-#: emultempl/pe.em:800 emultempl/pe.em:827
+#: emultempl/pe.em:830 emultempl/pe.em:857
msgid "Use --disable-stdcall-fixup to disable these fixups\n"
msgstr ""
-#: emultempl/pe.em:846
+#: emultempl/pe.em:876
#, c-format
msgid "%C: Cannot get section contents - auto-import exception\n"
msgstr ""
-#: emultempl/pe.em:883
+#: emultempl/pe.em:913
#, c-format
msgid "Info: resolving %s by linking to %s (auto-import)\n"
msgstr ""
-#: emultempl/pe.em:954
+#: emultempl/pe.em:986
msgid "%F%P: PE operations on non PE file.\n"
msgstr ""
-#: emultempl/pe.em:1188
+#: emultempl/pe.em:1261
#, c-format
msgid "Errors encountered processing file %s\n"
msgstr ""
-#: emultempl/pe.em:1211
+#: emultempl/pe.em:1284
#, c-format
msgid "Errors encountered processing file %s for interworking"
msgstr ""
-#: emultempl/pe.em:1273 ldlang.c:1904 ldlang.c:4397 ldlang.c:4428
-#: ldmain.c:1122
+#: emultempl/pe.em:1345 ldexp.c:522 ldlang.c:2946 ldlang.c:5800 ldlang.c:5831
+#: ldmain.c:1167
msgid "%P%F: bfd_link_hash_lookup failed: %E\n"
msgstr ""
-#: ldcref.c:153
+#: ldcref.c:154
msgid "%X%P: bfd_hash_table_init of cref table failed: %E\n"
msgstr ""
-#: ldcref.c:159
+#: ldcref.c:160
msgid "%X%P: cref_hash_lookup failed: %E\n"
msgstr ""
-#: ldcref.c:225
+#: ldcref.c:226
+#, c-format
msgid ""
"\n"
"Cross Reference Table\n"
"\n"
msgstr ""
-#: ldcref.c:226
+#: ldcref.c:227
msgid "Symbol"
msgstr ""
-#: ldcref.c:234
+#: ldcref.c:235
+#, c-format
msgid "File\n"
msgstr ""
-#: ldcref.c:238
+#: ldcref.c:239
+#, c-format
msgid "No symbols\n"
msgstr ""
-#: ldcref.c:384
-msgid "%P: symbol `%T' missing from main hash table\n"
-msgstr ""
-
-#: ldcref.c:448
+#: ldcref.c:360 ldcref.c:482
msgid "%B%F: could not read symbols; %E\n"
msgstr ""
-#: ldcref.c:452 ldmain.c:1187 ldmain.c:1191
+#: ldcref.c:364 ldcref.c:486 ldmain.c:1232 ldmain.c:1236
msgid "%B%F: could not read symbols: %E\n"
msgstr ""
-#: ldcref.c:517 ldcref.c:524 ldmain.c:1234 ldmain.c:1241
+#: ldcref.c:415
+msgid "%P: symbol `%T' missing from main hash table\n"
+msgstr ""
+
+#: ldcref.c:557 ldcref.c:564 ldmain.c:1279 ldmain.c:1286
msgid "%B%F: could not read relocs: %E\n"
msgstr ""
@@ -340,7 +388,7 @@ msgstr ""
#. 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.
-#: ldcref.c:543
+#: ldcref.c:591
msgid "%X%C: prohibited cross reference from %s to `%T' in %s\n"
msgstr ""
@@ -367,1243 +415,1333 @@ msgid ""
"\n"
msgstr ""
-#: ldemul.c:247
+#: ldemul.c:236
#, c-format
msgid "%S SYSLIB ignored\n"
msgstr ""
-#: ldemul.c:254
+#: ldemul.c:242
#, c-format
msgid "%S HLL ignored\n"
msgstr ""
-#: ldemul.c:275
+#: ldemul.c:262
msgid "%P: unrecognised emulation mode: %s\n"
msgstr ""
-#: ldemul.c:276
+#: ldemul.c:263
msgid "Supported emulations: "
msgstr ""
-#: ldemul.c:320
+#: ldemul.c:305
+#, c-format
msgid " no emulation specific options.\n"
msgstr ""
-#: ldexp.c:148
-msgid "%F%P: %s uses undefined section %s\n"
-msgstr ""
-
-#: ldexp.c:150
-msgid "%F%P: %s forward reference of section %s\n"
-msgstr ""
-
-#: ldexp.c:355
+#: ldexp.c:338
#, c-format
msgid "%F%S %% by zero\n"
msgstr ""
-#: ldexp.c:362
+#: ldexp.c:346
#, c-format
msgid "%F%S / by zero\n"
msgstr ""
-#: ldexp.c:533
+#: ldexp.c:536
#, c-format
msgid "%X%S: unresolvable symbol `%s' referenced in expression\n"
msgstr ""
-#: ldexp.c:553
+#: ldexp.c:547
#, c-format
msgid "%F%S: undefined symbol `%s' referenced in expression\n"
msgstr ""
-#: ldexp.c:677
+#: ldexp.c:608 ldexp.c:621
+#, c-format
+msgid "%F%S: undefined MEMORY region `%s' referenced in expression\n"
+msgstr ""
+
+#: ldexp.c:683
#, c-format
msgid "%F%S can not PROVIDE assignment to location counter\n"
msgstr ""
-#: ldexp.c:687
+#: ldexp.c:697
#, c-format
msgid "%F%S invalid assignment to location counter\n"
msgstr ""
-#: ldexp.c:691
+#: ldexp.c:700
#, c-format
msgid "%F%S assignment to location counter invalid outside of SECTION\n"
msgstr ""
-#: ldexp.c:700
+#: ldexp.c:709
msgid "%F%S cannot move location counter backwards (from %V to %V)\n"
msgstr ""
-#: ldexp.c:727
+#: ldexp.c:748
msgid "%P%F:%s: hash creation failed\n"
msgstr ""
-#: ldexp.c:1003 ldexp.c:1035
+#: ldexp.c:1000 ldexp.c:1025
#, c-format
msgid "%F%S nonconstant expression for %s\n"
msgstr ""
-#: ldexp.c:1089
+#: ldexp.c:1082
#, c-format
msgid "%F%S non constant expression for %s\n"
msgstr ""
-#: ldfile.c:144
+#: ldfile.c:139
#, c-format
msgid "attempt to open %s failed\n"
msgstr ""
-#: ldfile.c:146
+#: ldfile.c:141
#, c-format
msgid "attempt to open %s succeeded\n"
msgstr ""
-#: ldfile.c:152
+#: ldfile.c:147
msgid "%F%P: invalid BFD target `%s'\n"
msgstr ""
-#: ldfile.c:258 ldfile.c:275
+#: ldfile.c:255 ldfile.c:282
msgid "%P: skipping incompatible %s when searching for %s\n"
msgstr ""
-#: ldfile.c:377
-msgid "%F%P: cannot open %s for %s: %E\n"
+#: ldfile.c:267
+msgid "%F%P: attempted static link of dynamic object `%s'\n"
msgstr ""
-#: ldfile.c:380
-msgid "%F%P: cannot open %s: %E\n"
+#: ldfile.c:384
+msgid "%F%P: %s (%s): No such file: %E\n"
msgstr ""
-#: ldfile.c:410
+#: ldfile.c:387
+msgid "%F%P: %s: No such file: %E\n"
+msgstr ""
+
+#: ldfile.c:417
msgid "%F%P: cannot find %s inside %s\n"
msgstr ""
-#: ldfile.c:413
+#: ldfile.c:420
msgid "%F%P: cannot find %s\n"
msgstr ""
-#: ldfile.c:430 ldfile.c:446
+#: ldfile.c:437 ldfile.c:453
#, c-format
msgid "cannot find script file %s\n"
msgstr ""
-#: ldfile.c:432 ldfile.c:448
+#: ldfile.c:439 ldfile.c:455
#, c-format
msgid "opened script file %s\n"
msgstr ""
-#: ldfile.c:492
+#: ldfile.c:499
msgid "%P%F: cannot open linker script file %s: %E\n"
msgstr ""
-#: ldfile.c:529
-msgid "%P%F: unknown architecture: %s\n"
+#: ldfile.c:546
+msgid "%P%F: cannot represent machine `%s'\n"
+msgstr ""
+
+#: ldlang.c:940 ldlang.c:982 ldlang.c:2695
+msgid "%P%F: can not create hash table: %E\n"
msgstr ""
-#: ldfile.c:543
-msgid "%P%F: target architecture respecified\n"
+#: ldlang.c:1025
+msgid "%P:%S: warning: redeclaration of memory region '%s'\n"
msgstr ""
-#: ldfile.c:594
-msgid "%P%F: cannot represent machine `%s'\n"
+#: ldlang.c:1031
+msgid "%P:%S: warning: memory region %s not declared\n"
+msgstr ""
+
+#: ldlang.c:1108 ldlang.c:1135
+msgid "%P%F: failed creating section `%s': %E\n"
msgstr ""
-#: ldlang.c:640
+#: ldlang.c:1601
msgid ""
"\n"
"Memory Configuration\n"
"\n"
msgstr ""
-#: ldlang.c:642
+#: ldlang.c:1603
msgid "Name"
msgstr ""
-#: ldlang.c:642
+#: ldlang.c:1603
msgid "Origin"
msgstr ""
-#: ldlang.c:642
+#: ldlang.c:1603
msgid "Length"
msgstr ""
-#: ldlang.c:642
+#: ldlang.c:1603
msgid "Attributes"
msgstr ""
-#: ldlang.c:682
+#: ldlang.c:1643
+#, c-format
msgid ""
"\n"
"Linker script and memory map\n"
"\n"
msgstr ""
-#: ldlang.c:698
+#: ldlang.c:1709
msgid "%P%F: Illegal use of `%s' section\n"
msgstr ""
-#: ldlang.c:707
+#: ldlang.c:1716
msgid "%P%F: output format %s cannot represent section called %s\n"
msgstr ""
-#: ldlang.c:867
-msgid "%P: %B: warning: ignoring duplicate section `%s'\n"
-msgstr ""
-
-#: ldlang.c:870
-msgid "%P: %B: warning: ignoring duplicate `%s' section symbol `%s'\n"
-msgstr ""
-
-#: ldlang.c:884
-msgid "%P: %B: warning: duplicate section `%s' has different size\n"
-msgstr ""
-
-#: ldlang.c:936
-msgid "%P%F: Failed to create hash table\n"
-msgstr ""
-
-#: ldlang.c:1351
+#: ldlang.c:2313
msgid "%B: file not recognized: %E\n"
msgstr ""
-#: ldlang.c:1352
+#: ldlang.c:2314
msgid "%B: matching formats:"
msgstr ""
-#: ldlang.c:1359
+#: ldlang.c:2321
msgid "%F%B: file not recognized: %E\n"
msgstr ""
-#: ldlang.c:1418
+#: ldlang.c:2385
msgid "%F%B: member %B in archive is not an object\n"
msgstr ""
-#: ldlang.c:1429 ldlang.c:1443
+#: ldlang.c:2396 ldlang.c:2410
msgid "%F%B: could not read symbols: %E\n"
msgstr ""
-#: ldlang.c:1698
+#: ldlang.c:2665
msgid ""
"%P: warning: could not find any targets that match endianness requirement\n"
msgstr ""
-#: ldlang.c:1711
+#: ldlang.c:2679
msgid "%P%F: target %s not found\n"
msgstr ""
-#: ldlang.c:1713
+#: ldlang.c:2681
msgid "%P%F: cannot open output file %s: %E\n"
msgstr ""
-#: ldlang.c:1723
+#: ldlang.c:2687
msgid "%P%F:%s: can not make object file: %E\n"
msgstr ""
-#: ldlang.c:1727
+#: ldlang.c:2691
msgid "%P%F:%s: can not set architecture: %E\n"
msgstr ""
-#: ldlang.c:1731
-msgid "%P%F: can not create link hash table: %E\n"
+#: ldlang.c:2839
+msgid "%P%F: bfd_hash_lookup failed creating symbol %s\n"
msgstr ""
-#: ldlang.c:2069
+#: ldlang.c:2857
+msgid "%P%F: bfd_hash_allocate failed creating symbol %s\n"
+msgstr ""
+
+#: ldlang.c:3288
msgid " load address 0x%V"
msgstr ""
-#: ldlang.c:2204
+#: ldlang.c:3528
msgid "%W (size before relaxing)\n"
msgstr ""
-#: ldlang.c:2288
+#: ldlang.c:3615
#, c-format
msgid "Address of section %s set to "
msgstr ""
-#: ldlang.c:2443
+#: ldlang.c:3768
#, c-format
msgid "Fail with %d\n"
msgstr ""
-#: ldlang.c:2683
+#: ldlang.c:4040
msgid "%X%P: section %s [%V -> %V] overlaps section %s [%V -> %V]\n"
msgstr ""
-#: ldlang.c:2711
+#: ldlang.c:4065
msgid "%X%P: address 0x%v of %B section %s is not within region %s\n"
msgstr ""
-#: ldlang.c:2719
+#: ldlang.c:4074
msgid "%X%P: region %s is full (%B section %s)\n"
msgstr ""
-#: ldlang.c:2770
+#: ldlang.c:4114
+#, c-format
+msgid ""
+"%F%S: non constant or forward reference address expression for section %s\n"
+msgstr ""
+
+#: ldlang.c:4139
msgid "%P%X: Internal error on COFF shared library section %s\n"
msgstr ""
-#: ldlang.c:2826
+#: ldlang.c:4197
msgid "%P%F: error: no memory region specified for loadable section `%s'\n"
msgstr ""
-#: ldlang.c:2830
+#: ldlang.c:4202
msgid "%P: warning: no memory region specified for loadable section `%s'\n"
msgstr ""
-#: ldlang.c:2846
-msgid "%P: warning: changing start of section %s by %u bytes\n"
+#: ldlang.c:4224
+msgid "%P: warning: changing start of section %s by %lu bytes\n"
msgstr ""
-#: ldlang.c:2859
-#, c-format
-msgid "%F%S: non constant address expression for section %s\n"
-msgstr ""
-
-#: ldlang.c:3036
+#: ldlang.c:4388
msgid "%P%F: can't relax section: %E\n"
msgstr ""
-#: ldlang.c:3232
+#: ldlang.c:4636
msgid "%F%P: invalid data statement\n"
msgstr ""
-#: ldlang.c:3269
+#: ldlang.c:4669
msgid "%F%P: invalid reloc statement\n"
msgstr ""
-#: ldlang.c:3408
+#: ldlang.c:4802
msgid "%P%F:%s: can't set start address\n"
msgstr ""
-#: ldlang.c:3421 ldlang.c:3439
+#: ldlang.c:4815 ldlang.c:4834
msgid "%P%F: can't set start address\n"
msgstr ""
-#: ldlang.c:3433
+#: ldlang.c:4827
msgid "%P: warning: cannot find entry symbol %s; defaulting to %V\n"
msgstr ""
-#: ldlang.c:3444
+#: ldlang.c:4839
msgid "%P: warning: cannot find entry symbol %s; not setting start address\n"
msgstr ""
-#: ldlang.c:3488
+#: ldlang.c:4888
msgid ""
"%P%F: Relocatable linking with relocations from format %s (%B) to format %s "
"(%B) is not supported\n"
msgstr ""
-#: ldlang.c:3497
+#: ldlang.c:4898
msgid ""
"%P: warning: %s architecture of input file `%B' is incompatible with %s "
"output\n"
msgstr ""
-#: ldlang.c:3518
-msgid "%E%X: failed to merge target specific data of file %B\n"
+#: ldlang.c:4920
+msgid "%P%X: failed to merge target specific data of file %B\n"
msgstr ""
-#: ldlang.c:3604
+#: ldlang.c:5004
msgid ""
"\n"
"Allocating common symbols\n"
msgstr ""
-#: ldlang.c:3605
+#: ldlang.c:5005
msgid ""
"Common symbol size file\n"
"\n"
msgstr ""
-#. This message happens when using the
-#. svr3.ifile linker script, so I have
-#. disabled it.
-#: ldlang.c:3681
-msgid "%P: no [COMMON] command, defaulting to .bss\n"
+#: ldlang.c:5131
+msgid "%P%F: invalid syntax in flags\n"
msgstr ""
-#: ldlang.c:3737
-msgid "%P%F: invalid syntax in flags\n"
+#: ldlang.c:5406
+msgid "%P%F: Failed to create hash table\n"
msgstr ""
-#: ldlang.c:4325
-msgid "%P%Fmultiple STARTUP files\n"
+#: ldlang.c:5722
+msgid "%P%F: multiple STARTUP files\n"
msgstr ""
-#: ldlang.c:4368
+#: ldlang.c:5770
msgid "%X%P:%S: section has both a load address and a load region\n"
msgstr ""
-#: ldlang.c:4608
+#: ldlang.c:6007
msgid "%F%P: bfd_record_phdr failed: %E\n"
msgstr ""
-#: ldlang.c:4627
+#: ldlang.c:6027
msgid "%X%P: section `%s' assigned to non-existent phdr `%s'\n"
msgstr ""
-#: ldlang.c:4919
+#: ldlang.c:6418
msgid "%X%P: unknown language `%s' in version information\n"
msgstr ""
-#: ldlang.c:4969
+#: ldlang.c:6560
msgid ""
"%X%P: anonymous version tag cannot be combined with other version tags\n"
msgstr ""
-#: ldlang.c:4977
+#: ldlang.c:6569
msgid "%X%P: duplicate version tag `%s'\n"
msgstr ""
-#: ldlang.c:4990 ldlang.c:5003
+#: ldlang.c:6589 ldlang.c:6598 ldlang.c:6615 ldlang.c:6625
msgid "%X%P: duplicate expression `%s' in version information\n"
msgstr ""
-#: ldlang.c:5043
+#: ldlang.c:6665
msgid "%X%P: unable to find version dependency `%s'\n"
msgstr ""
-#: ldlang.c:5065
+#: ldlang.c:6687
msgid "%X%P: unable to read .exports section contents\n"
msgstr ""
-#: ldmain.c:247
+#: ldmain.c:232
msgid "%X%P: can't set BFD default target to `%s': %E\n"
msgstr ""
-#: ldmain.c:349
-msgid "%P%F: -r and --mpc860c0 may not be used together\n"
-msgstr ""
-
-#: ldmain.c:351
+#: ldmain.c:345
msgid "%P%F: --relax and -r may not be used together\n"
msgstr ""
-#: ldmain.c:353
+#: ldmain.c:347
msgid "%P%F: -r and -shared may not be used together\n"
msgstr ""
-#: ldmain.c:359
+#: ldmain.c:353
msgid "%P%F: -F may not be used without -shared\n"
msgstr ""
-#: ldmain.c:361
+#: ldmain.c:355
msgid "%P%F: -f may not be used without -shared\n"
msgstr ""
-#: ldmain.c:403
+#: ldmain.c:397
msgid "using external linker script:"
msgstr ""
-#: ldmain.c:405
+#: ldmain.c:399
msgid "using internal linker script:"
msgstr ""
-#: ldmain.c:439
+#: ldmain.c:433
msgid "%P%F: no input files\n"
msgstr ""
-#: ldmain.c:443
+#: ldmain.c:437
msgid "%P: mode %s\n"
msgstr ""
-#: ldmain.c:459
+#: ldmain.c:453
msgid "%P%F: cannot open map file %s: %E\n"
msgstr ""
-#: ldmain.c:489
+#: ldmain.c:485
msgid "%P: link errors found, deleting executable `%s'\n"
msgstr ""
-#: ldmain.c:498
+#: ldmain.c:494
msgid "%F%B: final close failed: %E\n"
msgstr ""
-#: ldmain.c:524
+#: ldmain.c:520
msgid "%X%P: unable to open for source of copy `%s'\n"
msgstr ""
-#: ldmain.c:527
+#: ldmain.c:523
msgid "%X%P: unable to open for destination of copy `%s'\n"
msgstr ""
-#: ldmain.c:534
+#: ldmain.c:530
msgid "%P: Error writing file `%s'\n"
msgstr ""
-#: ldmain.c:539 pe-dll.c:1443
+#: ldmain.c:535 pe-dll.c:1494
#, c-format
msgid "%P: Error closing file `%s'\n"
msgstr ""
-#: ldmain.c:555
+#: ldmain.c:551
#, c-format
msgid "%s: total time in link: %ld.%06ld\n"
msgstr ""
-#: ldmain.c:558
+#: ldmain.c:554
#, c-format
msgid "%s: data size %ld\n"
msgstr ""
-#: ldmain.c:596
+#: ldmain.c:637
msgid "%P%F: missing argument to -m\n"
msgstr ""
-#: ldmain.c:741 ldmain.c:759 ldmain.c:789
+#: ldmain.c:784 ldmain.c:803 ldmain.c:834
msgid "%P%F: bfd_hash_table_init failed: %E\n"
msgstr ""
-#: ldmain.c:745 ldmain.c:763
+#: ldmain.c:788 ldmain.c:807
msgid "%P%F: bfd_hash_lookup failed: %E\n"
msgstr ""
-#: ldmain.c:777
+#: ldmain.c:821
msgid "%X%P: error: duplicate retain-symbols-file\n"
msgstr ""
-#: ldmain.c:819
+#: ldmain.c:864
msgid "%P%F: bfd_hash_lookup for insertion failed: %E\n"
msgstr ""
-#: ldmain.c:824
+#: ldmain.c:869
msgid "%P: `-retain-symbols-file' overrides `-s' and `-S'\n"
msgstr ""
-#: ldmain.c:899
+#: ldmain.c:944
+#, c-format
msgid ""
"Archive member included because of file (symbol)\n"
"\n"
msgstr ""
-#: ldmain.c:969
+#: ldmain.c:1014
msgid "%X%C: multiple definition of `%T'\n"
msgstr ""
-#: ldmain.c:972
+#: ldmain.c:1017
msgid "%D: first defined here\n"
msgstr ""
-#: ldmain.c:976
+#: ldmain.c:1021
msgid "%P: Disabling relaxation: it will not work with multiple definitions\n"
msgstr ""
-#: ldmain.c:1006
+#: ldmain.c:1051
msgid "%B: warning: definition of `%T' overriding common\n"
msgstr ""
-#: ldmain.c:1009
+#: ldmain.c:1054
msgid "%B: warning: common is here\n"
msgstr ""
-#: ldmain.c:1016
+#: ldmain.c:1061
msgid "%B: warning: common of `%T' overridden by definition\n"
msgstr ""
-#: ldmain.c:1019
+#: ldmain.c:1064
msgid "%B: warning: defined here\n"
msgstr ""
-#: ldmain.c:1026
+#: ldmain.c:1071
msgid "%B: warning: common of `%T' overridden by larger common\n"
msgstr ""
-#: ldmain.c:1029
+#: ldmain.c:1074
msgid "%B: warning: larger common is here\n"
msgstr ""
-#: ldmain.c:1033
+#: ldmain.c:1078
msgid "%B: warning: common of `%T' overriding smaller common\n"
msgstr ""
-#: ldmain.c:1036
+#: ldmain.c:1081
msgid "%B: warning: smaller common is here\n"
msgstr ""
-#: ldmain.c:1040
+#: ldmain.c:1085
msgid "%B: warning: multiple common of `%T'\n"
msgstr ""
-#: ldmain.c:1042
+#: ldmain.c:1087
msgid "%B: warning: previous common is here\n"
msgstr ""
-#: ldmain.c:1062 ldmain.c:1100
+#: ldmain.c:1107 ldmain.c:1145
msgid "%P: warning: global constructor %s used\n"
msgstr ""
-#: ldmain.c:1110
+#: ldmain.c:1155
msgid "%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n"
msgstr ""
-#: ldmain.c:1287 ldmisc.c:533
+#. We found a reloc for the symbol we are looking for.
+#: ldmain.c:1209 ldmain.c:1211 ldmain.c:1213 ldmain.c:1251 ldmain.c:1299
+msgid "warning: "
+msgstr ""
+
+#: ldmain.c:1334
msgid "%F%P: bfd_hash_table_init failed: %E\n"
msgstr ""
-#: ldmain.c:1294 ldmisc.c:540
+#: ldmain.c:1341
msgid "%F%P: bfd_hash_lookup failed: %E\n"
msgstr ""
-#: ldmain.c:1314
-msgid "%C: undefined reference to `%T'\n"
+#: ldmain.c:1362
+msgid "%X%C: undefined reference to `%T'\n"
+msgstr ""
+
+#: ldmain.c:1365
+msgid "%C: warning: undefined reference to `%T'\n"
msgstr ""
-#: ldmain.c:1320
-msgid "%D: more undefined references to `%T' follow\n"
+#: ldmain.c:1371
+msgid "%X%D: more undefined references to `%T' follow\n"
msgstr ""
-#: ldmain.c:1327
-msgid "%B: undefined reference to `%T'\n"
+#: ldmain.c:1374
+msgid "%D: warning: more undefined references to `%T' follow\n"
msgstr ""
-#: ldmain.c:1333
-msgid "%B: more undefined references to `%T' follow\n"
+#: ldmain.c:1385
+msgid "%X%B: undefined reference to `%T'\n"
msgstr ""
-#: ldmain.c:1364 ldmain.c:1392 ldmain.c:1410
-msgid "%P%X: generated"
+#: ldmain.c:1388
+msgid "%B: warning: undefined reference to `%T'\n"
msgstr ""
-#: ldmain.c:1371
+#: ldmain.c:1394
+msgid "%X%B: more undefined references to `%T' follow\n"
+msgstr ""
+
+#: ldmain.c:1397
+msgid "%B: warning: more undefined references to `%T' follow\n"
+msgstr ""
+
+#: ldmain.c:1436
msgid " additional relocation overflows omitted from the output\n"
msgstr ""
-#: ldmain.c:1375
-msgid " relocation truncated to fit: %s %T"
+#: ldmain.c:1449
+msgid " relocation truncated to fit: %s against undefined symbol `%T'"
+msgstr ""
+
+#: ldmain.c:1454
+msgid ""
+" relocation truncated to fit: %s against symbol `%T' defined in %A section "
+"in %B"
msgstr ""
-#: ldmain.c:1395
+#: ldmain.c:1466
+msgid " relocation truncated to fit: %s against `%T'"
+msgstr ""
+
+#: ldmain.c:1483
#, c-format
-msgid "dangerous relocation: %s\n"
+msgid "%X%C: dangerous relocation: %s\n"
msgstr ""
-#: ldmain.c:1413
-msgid " reloc refers to symbol `%T' which is not being output\n"
+#: ldmain.c:1498
+msgid "%X%C: reloc refers to symbol `%T' which is not being output\n"
msgstr ""
#: ldmisc.c:147
+#, c-format
msgid "no symbol"
msgstr ""
-#: ldmisc.c:211
+#: ldmisc.c:238
#, c-format
msgid "built in linker script:%u"
msgstr ""
-#: ldmisc.c:260 ldmisc.c:264
+#: ldmisc.c:294 ldmisc.c:298
msgid "%B%F: could not read symbols\n"
msgstr ""
-#: ldmisc.c:291
-msgid ": In function `%T':\n"
+#: ldmisc.c:340
+msgid "%B: In function `%T'"
msgstr ""
-#: ldmisc.c:438
+#: ldmisc.c:510
msgid "%F%P: internal error %s %d\n"
msgstr ""
-#: ldmisc.c:484
+#: ldmisc.c:556
msgid "%P: internal error: aborting at %s line %d in %s\n"
msgstr ""
-#: ldmisc.c:487
+#: ldmisc.c:559
msgid "%P: internal error: aborting at %s line %d\n"
msgstr ""
-#: ldmisc.c:489
+#: ldmisc.c:561
msgid "%P%F: please report this bug\n"
msgstr ""
#. Output for noisy == 2 is intended to follow the GNU standards.
-#: ldver.c:39
+#: ldver.c:38
#, c-format
msgid "GNU ld version %s\n"
msgstr ""
-#: ldver.c:43
-msgid "Copyright 2002 Free Software Foundation, Inc.\n"
+#: ldver.c:42
+#, c-format
+msgid "Copyright 2005 Free Software Foundation, Inc.\n"
msgstr ""
-#: ldver.c:44
+#: ldver.c:43
+#, c-format
msgid ""
"This program is free software; you may redistribute it under the terms of\n"
"the GNU General Public License. This program has absolutely no warranty.\n"
msgstr ""
-#: ldver.c:53
+#: ldver.c:52
+#, c-format
msgid " Supported emulations:\n"
msgstr ""
-#: ldwrite.c:54 ldwrite.c:190
+#: ldwrite.c:55 ldwrite.c:191
msgid "%P%F: bfd_new_link_order failed\n"
msgstr ""
-#: ldwrite.c:310
+#: ldwrite.c:344
+msgid "%F%P: cannot create split section name for %s\n"
+msgstr ""
+
+#: ldwrite.c:356
msgid "%F%P: clone section failed: %E\n"
msgstr ""
-#: ldwrite.c:348
+#: ldwrite.c:394
#, c-format
msgid "%8x something else\n"
msgstr ""
-#: ldwrite.c:525
+#: ldwrite.c:564
msgid "%F%P: final link failed: %E\n"
msgstr ""
-#: lexsup.c:179 lexsup.c:284
+#: lexsup.c:196 lexsup.c:328
msgid "KEYWORD"
msgstr ""
-#: lexsup.c:179
+#: lexsup.c:196
msgid "Shared library control for HP/UX compatibility"
msgstr ""
-#: lexsup.c:182
+#: lexsup.c:199
msgid "ARCH"
msgstr ""
-#: lexsup.c:182
+#: lexsup.c:199
msgid "Set architecture"
msgstr ""
-#: lexsup.c:184 lexsup.c:357
+#: lexsup.c:201 lexsup.c:422
msgid "TARGET"
msgstr ""
-#: lexsup.c:184
+#: lexsup.c:201
msgid "Specify target for following input files"
msgstr ""
-#: lexsup.c:186 lexsup.c:229 lexsup.c:241 lexsup.c:254 lexsup.c:329
-#: lexsup.c:364 lexsup.c:408
+#: lexsup.c:204 lexsup.c:253 lexsup.c:265 lexsup.c:278 lexsup.c:381
+#: lexsup.c:434 lexsup.c:491
msgid "FILE"
msgstr ""
-#: lexsup.c:186
+#: lexsup.c:204
msgid "Read MRI format linker script"
msgstr ""
-#: lexsup.c:188
+#: lexsup.c:206
msgid "Force common symbols to be defined"
msgstr ""
-#: lexsup.c:192 lexsup.c:398 lexsup.c:400 lexsup.c:402
+#: lexsup.c:210 lexsup.c:476 lexsup.c:478 lexsup.c:480
msgid "ADDRESS"
msgstr ""
-#: lexsup.c:192
+#: lexsup.c:210
msgid "Set start address"
msgstr ""
-#: lexsup.c:194
+#: lexsup.c:212
msgid "Export all dynamic symbols"
msgstr ""
-#: lexsup.c:196
+#: lexsup.c:214
msgid "Link big-endian objects"
msgstr ""
-#: lexsup.c:198
+#: lexsup.c:216
msgid "Link little-endian objects"
msgstr ""
-#: lexsup.c:200 lexsup.c:203
+#: lexsup.c:218 lexsup.c:221
msgid "SHLIB"
msgstr ""
-#: lexsup.c:200
+#: lexsup.c:218
msgid "Auxiliary filter for shared object symbol table"
msgstr ""
-#: lexsup.c:203
+#: lexsup.c:221
msgid "Filter for shared object symbol table"
msgstr ""
-#: lexsup.c:205
+#: lexsup.c:224
msgid "Ignored"
msgstr ""
-#: lexsup.c:207
+#: lexsup.c:226
msgid "SIZE"
msgstr ""
-#: lexsup.c:207
+#: lexsup.c:226
msgid "Small data size (if no size, same as --shared)"
msgstr ""
-#: lexsup.c:210
+#: lexsup.c:229
msgid "FILENAME"
msgstr ""
-#: lexsup.c:210
+#: lexsup.c:229
msgid "Set internal name of shared library"
msgstr ""
-#: lexsup.c:212
+#: lexsup.c:231
msgid "PROGRAM"
msgstr ""
-#: lexsup.c:212
+#: lexsup.c:231
msgid "Set PROGRAM as the dynamic linker to use"
msgstr ""
-#: lexsup.c:214
+#: lexsup.c:234
msgid "LIBNAME"
msgstr ""
-#: lexsup.c:214
+#: lexsup.c:234
msgid "Search for library LIBNAME"
msgstr ""
-#: lexsup.c:216
+#: lexsup.c:236
msgid "DIRECTORY"
msgstr ""
-#: lexsup.c:216
+#: lexsup.c:236
msgid "Add DIRECTORY to library search path"
msgstr ""
-#: lexsup.c:218
+#: lexsup.c:239
+msgid "Override the default sysroot location"
+msgstr ""
+
+#: lexsup.c:241
msgid "EMULATION"
msgstr ""
-#: lexsup.c:218
+#: lexsup.c:241
msgid "Set emulation"
msgstr ""
-#: lexsup.c:220
+#: lexsup.c:243
msgid "Print map file on standard output"
msgstr ""
-#: lexsup.c:222
+#: lexsup.c:245
msgid "Do not page align data"
msgstr ""
-#: lexsup.c:224
+#: lexsup.c:247
msgid "Do not page align data, do not make text readonly"
msgstr ""
-#: lexsup.c:227
+#: lexsup.c:250
msgid "Page align data, make text readonly"
msgstr ""
-#: lexsup.c:229
+#: lexsup.c:253
msgid "Set output file name"
msgstr ""
-#: lexsup.c:231
+#: lexsup.c:255
msgid "Optimize output file"
msgstr ""
-#: lexsup.c:233
+#: lexsup.c:257
msgid "Ignored for SVR4 compatibility"
msgstr ""
-#: lexsup.c:237
+#: lexsup.c:261
msgid "Generate relocatable output"
msgstr ""
-#: lexsup.c:241
+#: lexsup.c:265
msgid "Just link symbols (if directory, same as --rpath)"
msgstr ""
-#: lexsup.c:244
+#: lexsup.c:268
msgid "Strip all symbols"
msgstr ""
-#: lexsup.c:246
+#: lexsup.c:270
msgid "Strip debugging symbols"
msgstr ""
-#: lexsup.c:248
+#: lexsup.c:272
msgid "Strip symbols in discarded sections"
msgstr ""
-#: lexsup.c:250
+#: lexsup.c:274
msgid "Do not strip symbols in discarded sections"
msgstr ""
-#: lexsup.c:252
+#: lexsup.c:276
msgid "Trace file opens"
msgstr ""
-#: lexsup.c:254
+#: lexsup.c:278
msgid "Read linker script"
msgstr ""
-#: lexsup.c:256 lexsup.c:272 lexsup.c:315 lexsup.c:327 lexsup.c:392
-#: lexsup.c:411 lexsup.c:431
+#: lexsup.c:280 lexsup.c:298 lexsup.c:364 lexsup.c:379 lexsup.c:469
+#: lexsup.c:494 lexsup.c:521
msgid "SYMBOL"
msgstr ""
-#: lexsup.c:256
+#: lexsup.c:280
msgid "Start with undefined reference to SYMBOL"
msgstr ""
-#: lexsup.c:258
+#: lexsup.c:283
msgid "[=SECTION]"
msgstr ""
-#: lexsup.c:258
+#: lexsup.c:284
msgid "Don't merge input [SECTION | orphan] sections"
msgstr ""
-#: lexsup.c:260
+#: lexsup.c:286
msgid "Build global constructor/destructor tables"
msgstr ""
-#: lexsup.c:262
+#: lexsup.c:288
msgid "Print version information"
msgstr ""
-#: lexsup.c:264
+#: lexsup.c:290
msgid "Print version and emulation information"
msgstr ""
-#: lexsup.c:266
+#: lexsup.c:292
msgid "Discard all local symbols"
msgstr ""
-#: lexsup.c:268
+#: lexsup.c:294
msgid "Discard temporary local symbols (default)"
msgstr ""
-#: lexsup.c:270
+#: lexsup.c:296
msgid "Don't discard any local symbols"
msgstr ""
-#: lexsup.c:272
+#: lexsup.c:298
msgid "Trace mentions of SYMBOL"
msgstr ""
-#: lexsup.c:274 lexsup.c:366 lexsup.c:368
+#: lexsup.c:300 lexsup.c:436 lexsup.c:438
msgid "PATH"
msgstr ""
-#: lexsup.c:274
+#: lexsup.c:300
msgid "Default search path for Solaris compatibility"
msgstr ""
-#: lexsup.c:276
+#: lexsup.c:303
msgid "Start a group"
msgstr ""
-#: lexsup.c:278
+#: lexsup.c:305
msgid "End a group"
msgstr ""
-#: lexsup.c:280
+#: lexsup.c:309
msgid "Accept input files whose architecture cannot be determined"
msgstr ""
-#: lexsup.c:282
+#: lexsup.c:313
msgid "Reject input files whose architecture is unknown"
msgstr ""
-#: lexsup.c:284
+#: lexsup.c:316
+msgid ""
+"Set DT_NEEDED tags for DT_NEEDED entries in\n"
+"\t\t\t\tfollowing dynamic libs"
+msgstr ""
+
+#: lexsup.c:319
+msgid ""
+"Do not set DT_NEEDED tags for DT_NEEDED entries\n"
+"\t\t\t\tin following dynamic libs"
+msgstr ""
+
+#: lexsup.c:322
+msgid "Only set DT_NEEDED for following dynamic libs if used"
+msgstr ""
+
+#: lexsup.c:325
+msgid "Always set DT_NEEDED for following dynamic libs"
+msgstr ""
+
+#: lexsup.c:328
msgid "Ignored for SunOS compatibility"
msgstr ""
-#: lexsup.c:286
+#: lexsup.c:330
msgid "Link against shared libraries"
msgstr ""
-#: lexsup.c:292
+#: lexsup.c:336
msgid "Do not link against shared libraries"
msgstr ""
-#: lexsup.c:300
+#: lexsup.c:344
msgid "Bind global references locally"
msgstr ""
-#: lexsup.c:302
+#: lexsup.c:346
msgid "Check section addresses for overlaps (default)"
msgstr ""
-#: lexsup.c:304
+#: lexsup.c:349
msgid "Do not check section addresses for overlaps"
msgstr ""
-#: lexsup.c:307
+#: lexsup.c:352
msgid "Output cross reference table"
msgstr ""
-#: lexsup.c:309
+#: lexsup.c:354
msgid "SYMBOL=EXPRESSION"
msgstr ""
-#: lexsup.c:309
+#: lexsup.c:354
msgid "Define a symbol"
msgstr ""
-#: lexsup.c:311
+#: lexsup.c:356
msgid "[=STYLE]"
msgstr ""
-#: lexsup.c:311
+#: lexsup.c:356
msgid "Demangle symbol names [using STYLE]"
msgstr ""
-#: lexsup.c:313
+#: lexsup.c:359
msgid "Generate embedded relocs"
msgstr ""
-#: lexsup.c:315
+#: lexsup.c:361
+msgid "Treat warnings as errors"
+msgstr ""
+
+#: lexsup.c:364
msgid "Call SYMBOL at unload-time"
msgstr ""
-#: lexsup.c:317
+#: lexsup.c:366
msgid "Force generation of file with .exe suffix"
msgstr ""
-#: lexsup.c:319
+#: lexsup.c:368
msgid "Remove unused sections (on some targets)"
msgstr ""
-#: lexsup.c:322
+#: lexsup.c:371
msgid "Don't remove unused sections (default)"
msgstr ""
-#: lexsup.c:325
+#: lexsup.c:374
+msgid "Set default hash table size close to <NUMBER>"
+msgstr ""
+
+#: lexsup.c:377
msgid "Print option help"
msgstr ""
-#: lexsup.c:327
+#: lexsup.c:379
msgid "Call SYMBOL at load-time"
msgstr ""
-#: lexsup.c:329
+#: lexsup.c:381
msgid "Write a map file"
msgstr ""
-#: lexsup.c:331
+#: lexsup.c:383
msgid "Do not define Common storage"
msgstr ""
-#: lexsup.c:333
+#: lexsup.c:385
msgid "Do not demangle symbol names"
msgstr ""
-#: lexsup.c:335
+#: lexsup.c:387
msgid "Use less memory and more disk I/O"
msgstr ""
-#: lexsup.c:337
-msgid "Allow no undefined symbols"
+#: lexsup.c:389
+msgid "Do not allow unresolved references in object files"
msgstr ""
-#: lexsup.c:339
-msgid "Allow undefined symbols in shared objects (the default)"
+#: lexsup.c:392
+msgid "Allow unresolved references in shared libaries"
msgstr ""
-#: lexsup.c:341
-msgid "Do not allow undefined symbols in shared objects"
+#: lexsup.c:396
+msgid "Do not allow unresolved references in shared libs"
msgstr ""
-#: lexsup.c:343
+#: lexsup.c:400
msgid "Allow multiple definitions"
msgstr ""
-#: lexsup.c:345
+#: lexsup.c:402
msgid "Disallow undefined version"
msgstr ""
-#: lexsup.c:347
+#: lexsup.c:404
+msgid "Create default symbol version"
+msgstr ""
+
+#: lexsup.c:407
+msgid "Create default symbol version for imported symbols"
+msgstr ""
+
+#: lexsup.c:410
msgid "Don't warn about mismatched input files"
msgstr ""
-#: lexsup.c:349
+#: lexsup.c:412
msgid "Turn off --whole-archive"
msgstr ""
-#: lexsup.c:351
+#: lexsup.c:414
msgid "Create an output file even if errors occur"
msgstr ""
-#: lexsup.c:355
+#: lexsup.c:419
msgid ""
"Only use library directories specified on\n"
"\t\t\t\tthe command line"
msgstr ""
-#: lexsup.c:357
+#: lexsup.c:422
msgid "Specify target of output file"
msgstr ""
-#: lexsup.c:359
+#: lexsup.c:425
msgid "Ignored for Linux compatibility"
msgstr ""
-#: lexsup.c:361
+#: lexsup.c:428
+msgid "Reduce memory overheads, possibly taking much longer"
+msgstr ""
+
+#: lexsup.c:431
msgid "Relax branches on certain targets"
msgstr ""
-#: lexsup.c:364
+#: lexsup.c:434
msgid "Keep only symbols listed in FILE"
msgstr ""
-#: lexsup.c:366
+#: lexsup.c:436
msgid "Set runtime shared library search path"
msgstr ""
-#: lexsup.c:368
+#: lexsup.c:438
msgid "Set link time shared library search path"
msgstr ""
-#: lexsup.c:370
+#: lexsup.c:441
msgid "Create a shared library"
msgstr ""
-#: lexsup.c:374
+#: lexsup.c:445
msgid "Create a position independent executable"
msgstr ""
-#: lexsup.c:378
+#: lexsup.c:449
msgid "Sort common symbols by size"
msgstr ""
-#: lexsup.c:382
+#: lexsup.c:453
+msgid "name|alignment"
+msgstr ""
+
+#: lexsup.c:454
+msgid "Sort sections by name or maximum alignment"
+msgstr ""
+
+#: lexsup.c:456
msgid "COUNT"
msgstr ""
-#: lexsup.c:382
+#: lexsup.c:456
msgid "How many tags to reserve in .dynamic section"
msgstr ""
-#: lexsup.c:384
+#: lexsup.c:459
msgid "[=SIZE]"
msgstr ""
-#: lexsup.c:384
+#: lexsup.c:459
msgid "Split output sections every SIZE octets"
msgstr ""
-#: lexsup.c:386
+#: lexsup.c:462
msgid "[=COUNT]"
msgstr ""
-#: lexsup.c:386
+#: lexsup.c:462
msgid "Split output sections every COUNT relocs"
msgstr ""
-#: lexsup.c:388
+#: lexsup.c:465
msgid "Print memory usage statistics"
msgstr ""
-#: lexsup.c:390
+#: lexsup.c:467
msgid "Display target specific options"
msgstr ""
-#: lexsup.c:392
+#: lexsup.c:469
msgid "Do task level linking"
msgstr ""
-#: lexsup.c:394
+#: lexsup.c:471
msgid "Use same format as native linker"
msgstr ""
-#: lexsup.c:396
+#: lexsup.c:473
msgid "SECTION=ADDRESS"
msgstr ""
-#: lexsup.c:396
+#: lexsup.c:473
msgid "Set address of named section"
msgstr ""
-#: lexsup.c:398
+#: lexsup.c:476
msgid "Set address of .bss section"
msgstr ""
-#: lexsup.c:400
+#: lexsup.c:478
msgid "Set address of .data section"
msgstr ""
-#: lexsup.c:402
+#: lexsup.c:480
msgid "Set address of .text section"
msgstr ""
-#: lexsup.c:404
+#: lexsup.c:483
+msgid ""
+"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"
+msgstr ""
+
+#: lexsup.c:487
msgid "Output lots of information during link"
msgstr ""
-#: lexsup.c:408
+#: lexsup.c:491
msgid "Read version information script"
msgstr ""
-#: lexsup.c:411
+#: lexsup.c:494
msgid ""
"Take export symbols list from .exports, using\n"
"\t\t\t\tSYMBOL as the version."
msgstr ""
-#: lexsup.c:414
+#: lexsup.c:497
msgid "Warn about duplicate common symbols"
msgstr ""
-#: lexsup.c:416
+#: lexsup.c:499
msgid "Warn if global constructors/destructors are seen"
msgstr ""
-#: lexsup.c:419
+#: lexsup.c:502
msgid "Warn if the multiple GP values are used"
msgstr ""
-#: lexsup.c:421
+#: lexsup.c:504
msgid "Warn only once per undefined symbol"
msgstr ""
-#: lexsup.c:423
+#: lexsup.c:506
msgid "Warn if start of section changes due to alignment"
msgstr ""
-#: lexsup.c:426
-msgid "Treat warnings as errors"
+#: lexsup.c:509
+msgid "Warn if shared object has DT_TEXTREL"
msgstr ""
-#: lexsup.c:429
-msgid "Include all objects from following archives"
+#: lexsup.c:513
+msgid "Report unresolved symbols as warnings"
msgstr ""
-#: lexsup.c:431
-msgid "Use wrapper functions for SYMBOL"
+#: lexsup.c:516
+msgid "Report unresolved symbols as errors"
msgstr ""
-#: lexsup.c:433
-msgid "[=WORDS]"
+#: lexsup.c:518
+msgid "Include all objects from following archives"
msgstr ""
-#: lexsup.c:433
-msgid ""
-"Modify problematic branches in last WORDS (1-10,\n"
-"\t\t\t\tdefault 5) words of a page"
+#: lexsup.c:521
+msgid "Use wrapper functions for SYMBOL"
msgstr ""
-#: lexsup.c:602
+#: lexsup.c:668
msgid "%P: unrecognized option '%s'\n"
msgstr ""
-#: lexsup.c:604
+#: lexsup.c:670
msgid "%P%F: use the --help option for usage information\n"
msgstr ""
-#: lexsup.c:622
+#: lexsup.c:688
msgid "%P%F: unrecognized -a option `%s'\n"
msgstr ""
-#: lexsup.c:635
+#: lexsup.c:701
msgid "%P%F: unrecognized -assert option `%s'\n"
msgstr ""
-#: lexsup.c:678
+#: lexsup.c:744
msgid "%F%P: unknown demangling style `%s'"
msgstr ""
-#: lexsup.c:737
+#: lexsup.c:806
msgid "%P%F: invalid number `%s'\n"
msgstr ""
+#: lexsup.c:898
+msgid "%P%F: bad --unresolved-symbols option: %s\n"
+msgstr ""
+
#. This can happen if the user put "-rpath,a" on the command
#. line. (Or something similar. The comma is important).
#. Getopt becomes confused and thinks that this is a -r option
@@ -1612,138 +1750,167 @@ msgstr ""
#. an error message here. We cannot just make this a warning,
#. increment optind, and continue because getopt is too confused
#. and will seg-fault the next time around.
-#: lexsup.c:849
+#: lexsup.c:969
msgid "%P%F: bad -rpath option\n"
msgstr ""
-#: lexsup.c:953
+#: lexsup.c:1081
msgid "%P%F: -shared not supported\n"
msgstr ""
-#: lexsup.c:962
+#: lexsup.c:1090
msgid "%P%F: -pie not supported\n"
msgstr ""
-#: lexsup.c:994
+#: lexsup.c:1100
+msgid "name"
+msgstr ""
+
+#: lexsup.c:1102
+msgid "alignment"
+msgstr ""
+
+#: lexsup.c:1105
+msgid "%P%F: invalid section sorting option: %s\n"
+msgstr ""
+
+#: lexsup.c:1131
msgid "%P%F: invalid argument to option \"--section-start\"\n"
msgstr ""
-#: lexsup.c:1000
+#: lexsup.c:1138
msgid "%P%F: missing argument(s) to option \"--section-start\"\n"
msgstr ""
-#: lexsup.c:1158
+#: lexsup.c:1312
msgid "%P%F: may not nest groups (--help for usage)\n"
msgstr ""
-#: lexsup.c:1165
+#: lexsup.c:1319
msgid "%P%F: group ended before it began (--help for usage)\n"
msgstr ""
-#: lexsup.c:1179
-msgid "%P%F: invalid argument to option \"mpc860c0\"\n"
+#: lexsup.c:1347
+msgid "%P%X: --hash-size needs a numeric argument\n"
msgstr ""
-#: lexsup.c:1234
+#: lexsup.c:1398 lexsup.c:1411
msgid "%P%F: invalid hex number `%s'\n"
msgstr ""
-#: lexsup.c:1246
+#: lexsup.c:1447
#, c-format
msgid "Usage: %s [options] file...\n"
msgstr ""
-#: lexsup.c:1248
+#: lexsup.c:1449
+#, c-format
msgid "Options:\n"
msgstr ""
+#: lexsup.c:1527
+#, c-format
+msgid " @FILE"
+msgstr ""
+
+#: lexsup.c:1530
+#, c-format
+msgid "Read options from FILE\n"
+msgstr ""
+
#. Note: Various tools (such as libtool) depend upon the
#. format of the listings below - do not change them.
-#: lexsup.c:1331
+#: lexsup.c:1535
#, c-format
msgid "%s: supported targets:"
msgstr ""
-#: lexsup.c:1339
+#: lexsup.c:1543
#, c-format
msgid "%s: supported emulations: "
msgstr ""
-#: lexsup.c:1344
+#: lexsup.c:1548
#, c-format
msgid "%s: emulation specific options:\n"
msgstr ""
-#: lexsup.c:1348
+#: lexsup.c:1552
#, c-format
msgid "Report bugs to %s\n"
msgstr ""
-#: mri.c:307
+#: mri.c:291
msgid "%P%F: unknown format type %s\n"
msgstr ""
-#: pe-dll.c:301
+#: pe-dll.c:303
#, c-format
msgid "%XUnsupported PEI architecture: %s\n"
msgstr ""
-#: pe-dll.c:650
+#: pe-dll.c:604
#, c-format
-msgid "%XError, duplicate EXPORT with ordinals: %s (%d vs %d)\n"
+msgid "%XCannot export %s: invalid export name\n"
msgstr ""
#: pe-dll.c:657
#, c-format
+msgid "%XError, duplicate EXPORT with ordinals: %s (%d vs %d)\n"
+msgstr ""
+
+#: pe-dll.c:664
+#, c-format
msgid "Warning, duplicate EXPORT: %s\n"
msgstr ""
-#: pe-dll.c:723
+#: pe-dll.c:751
#, c-format
msgid "%XCannot export %s: symbol not defined\n"
msgstr ""
-#: pe-dll.c:729
+#: pe-dll.c:757
#, c-format
msgid "%XCannot export %s: symbol wrong type (%d vs %d)\n"
msgstr ""
-#: pe-dll.c:736
+#: pe-dll.c:764
#, c-format
msgid "%XCannot export %s: symbol not found\n"
msgstr ""
-#: pe-dll.c:848
+#: pe-dll.c:877
#, c-format
msgid "%XError, ordinal used twice: %d (%s vs %s)\n"
msgstr ""
-#: pe-dll.c:1165
+#: pe-dll.c:1219
#, c-format
msgid "%XError: %d-bit reloc in dll\n"
msgstr ""
-#: pe-dll.c:1296
+#: pe-dll.c:1347
#, c-format
msgid "%s: Can't open output def file %s\n"
msgstr ""
-#: pe-dll.c:1439
+#: pe-dll.c:1490
+#, c-format
msgid "; no contents available\n"
msgstr ""
-#: pe-dll.c:2203
+#: pe-dll.c:2252
msgid ""
"%C: variable '%T' can't be auto-imported. Please read the documentation for "
"ld's --enable-auto-import for details.\n"
msgstr ""
-#: pe-dll.c:2233
+#: pe-dll.c:2282
#, c-format
msgid "%XCan't open .lib file: %s\n"
msgstr ""
-#: pe-dll.c:2238
+#: pe-dll.c:2287
#, c-format
msgid "Creating library file: %s\n"
msgstr ""
diff --git a/contrib/binutils/ld/scripttempl/elf.sc b/contrib/binutils/ld/scripttempl/elf.sc
index 187a289..ac0c725 100644
--- a/contrib/binutils/ld/scripttempl/elf.sc
+++ b/contrib/binutils/ld/scripttempl/elf.sc
@@ -3,6 +3,8 @@
# NOP - four byte opcode for no-op (defaults to 0)
# NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not
# empty.
+# SMALL_DATA_CTOR - .ctors contains small data.
+# SMALL_DATA_DTOR - .dtors contains small data.
# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
# INITIAL_READONLY_SECTIONS - at start of text segment
# OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
@@ -10,20 +12,27 @@
# OTHER_TEXT_SECTIONS - these get put in .text when relocating
# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
# (e.g., .PARISC.global)
-# OTHER_BSS_SECTIONS - other than .bss .sbss ...
+# OTHER_RELRO_SECTIONS - other than .data.rel.ro ...
+# (e.g. PPC32 .fixup, .got[12])
# OTHER_SECTIONS - at the end
# EXECUTABLE_SYMBOLS - symbols that must be defined for an
# executable (e.g., _DYNAMIC_LINK)
+# TEXT_START_ADDR - the first byte of the text segment, after any
+# headers.
+# TEXT_BASE_ADDRESS - the first byte of the text segment.
# TEXT_START_SYMBOLS - symbols that appear at the start of the
# .text section.
# DATA_START_SYMBOLS - symbols that appear at the start of the
# .data section.
+# DATA_END_SYMBOLS - symbols that appear at the end of the
+# writeable data sections.
# OTHER_GOT_SYMBOLS - symbols defined just before .got.
# OTHER_GOT_SECTIONS - sections just after .got.
# OTHER_SDATA_SECTIONS - sections just after .sdata.
# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
# .bss section besides __bss_start.
# DATA_PLT - .plt should be in data segment, not text segment.
+# PLT_BEFORE_GOT - .plt just before .got when .plt is in data segement.
# BSS_PLT - .plt should be in bss segment
# TEXT_DYNAMIC - .dynamic in text segment, not data segment.
# EMBEDDED - whether this is for an embedded system.
@@ -36,7 +45,13 @@
# FINI_START, FINI_END - statements just before and just after
# combination of .fini sections.
# STACK_ADDR - start of a .stack section.
-# OTHER_END_SYMBOLS - symbols to place right at the end of the script.
+# OTHER_SYMBOLS - symbols to place right at the end of the script.
+# ETEXT_NAME - name of a symbol for the end of the text section,
+# normally etext.
+# SEPARATE_GOTPLT - if set, .got.plt should be separate output section,
+# so that .got can be in the RELRO area. It should be set to
+# the number of bytes in the beginning of .got.plt which can be
+# in the RELRO area as well.
#
# When adding sections, do note that the names of some sections are used
# when specifying the start address of the next.
@@ -62,6 +77,9 @@
# .debug_info .gnu.linkonce.wi.foo
# .tdata .gnu.linkonce.td.foo
# .tbss .gnu.linkonce.tb.foo
+# .lrodata .gnu.linkonce.lr.foo
+# .ldata .gnu.linkonce.l.foo
+# .lbss .gnu.linkonce.lb.foo
#
# Each of these can also have corresponding .rel.* and .rela.* sections.
@@ -72,30 +90,44 @@ 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 -z "${ETEXT_NAME}" && ETEXT_NAME=etext
test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE=""
test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE=""
+test -n "$RELRO_NOW" && unset SEPARATE_GOTPLT
DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))"
+DATA_SEGMENT_RELRO_END=""
DATA_SEGMENT_END=""
if test -n "${COMMONPAGESIZE}"; then
DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})"
DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
+ DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
fi
INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
-PLT=".plt ${RELOCATING-0} : { *(.plt) }"
-test -z "$GOT" && GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }"
+if test -z "$PLT"; then
+ PLT=".plt ${RELOCATING-0} : { *(.plt) }"
+fi
+test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes
+if test -z "$GOT"; then
+ if test -z "$SEPARATE_GOTPLT"; then
+ GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }"
+ else
+ GOT=".got ${RELOCATING-0} : { *(.got) }"
+ GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) }"
+ fi
+fi
DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
+DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }"
STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
if test -z "${NO_SMALL_DATA}"; then
SBSS=".sbss ${RELOCATING-0} :
{
- ${RELOCATING+PROVIDE (__sbss_start = .);}
- ${RELOCATING+PROVIDE (___sbss_start = .);}
+ ${RELOCATING+${SBSS_START_SYMBOLS}}
+ ${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
*(.dynsbss)
*(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
*(.scommon)
- ${RELOCATING+PROVIDE (__sbss_end = .);}
- ${RELOCATING+PROVIDE (___sbss_end = .);}
+ ${RELOCATING+${SBSS_END_SYMBOLS}}
}"
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
SDATA="/* We want the small data sections together, so single-instruction offsets
@@ -104,9 +136,14 @@ if test -z "${NO_SMALL_DATA}"; then
.sdata ${RELOCATING-0} :
{
${RELOCATING+${SDATA_START_SYMBOLS}}
+ ${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)}
*(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
}"
- SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
+ SDATA2=".sdata2 ${RELOCATING-0} :
+ {
+ ${RELOCATING+${SDATA2_START_SYMBOLS}}
+ *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*})
+ }"
REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
@@ -115,7 +152,43 @@ if test -z "${NO_SMALL_DATA}"; then
.rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
.rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
+else
+ NO_SMALL_DATA=" "
fi
+if test -z "${DATA_GOT}"; then
+ if test -n "${NO_SMALL_DATA}"; then
+ DATA_GOT=" "
+ fi
+fi
+if test -z "${SDATA_GOT}"; then
+ if test -z "${NO_SMALL_DATA}"; then
+ SDATA_GOT=" "
+ fi
+fi
+test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
+test "${LARGE_SECTIONS}" = "yes" && REL_LARGE="
+ .rel.ldata ${RELOCATING-0} : { *(.rel.ldata${RELOCATING+ .rel.ldata.* .rel.gnu.linkonce.l.*}) }
+ .rela.ldata ${RELOCATING-0} : { *(.rela.ldata${RELOCATING+ .rela.ldata.* .rela.gnu.linkonce.l.*}) }
+ .rel.lbss ${RELOCATING-0} : { *(.rel.lbss${RELOCATING+ .rel.lbss.* .rel.gnu.linkonce.lb.*}) }
+ .rela.lbss ${RELOCATING-0} : { *(.rela.lbss${RELOCATING+ .rela.lbss.* .rela.gnu.linkonce.lb.*}) }
+ .rel.lrodata ${RELOCATING-0} : { *(.rel.lrodata${RELOCATING+ .rel.lrodata.* .rel.gnu.linkonce.lr.*}) }
+ .rela.lrodata ${RELOCATING-0} : { *(.rela.lrodata${RELOCATING+ .rela.lrodata.* .rela.gnu.linkonce.lr.*}) }"
+test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
+ .lbss ${RELOCATING-0} :
+ {
+ *(.dynlbss)
+ *(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*})
+ *(LARGE_COMMON)
+ }
+ .lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
+ {
+ *(.lrodata${RELOCATING+ .lrodata.* .gnu.linkonce.lr.*})
+ }
+ .ldata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
+ {
+ *(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*})
+ ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
+ }"
CTOR=".ctors ${CONSTRUCTING-0} :
{
${CONSTRUCTING+${CTOR_START}}
@@ -132,7 +205,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
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 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 */
@@ -170,8 +243,6 @@ OUTPUT_ARCH(${OUTPUT_ARCH})
ENTRY(${ENTRY})
${RELOCATING+${LIB_SEARCH_DIRS}}
-${RELOCATING+/* Do we need any of these for elf?
- __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING+${INPUT_FILES}}
${RELOCATING- /* For some reason, the Solaris linker makes bad executables
@@ -211,6 +282,8 @@ eval $COMBRELOCCAT <<EOF
.rel.rodata ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
.rela.rodata ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
${OTHER_READONLY_RELOC_SECTIONS}
+ .rel.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+* .rel.gnu.linkonce.d.rel.ro.*}) }
+ .rela.data.rel.ro ${RELOCATING-0} : { *(.rela.data.rel.ro${RELOCATING+* .rela.gnu.linkonce.d.rel.ro.*}) }
.rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
.rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
.rel.tdata ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
@@ -230,6 +303,7 @@ eval $COMBRELOCCAT <<EOF
${REL_SBSS2}
.rel.bss ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
+ ${REL_LARGE}
EOF
if [ -n "$COMBRELOC" ]; then
cat <<EOF
@@ -259,11 +333,13 @@ cat <<EOF
${RELOCATING+${INIT_END}}
} =${NOP-0}
- ${DATA_PLT-${BSS_PLT-${PLT}}}
+ ${TEXT_PLT+${PLT}}
+ ${TINY_READONLY_SECTION}
.text ${RELOCATING-0} :
{
${RELOCATING+${TEXT_START_SYMBOLS}}
*(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
+ KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
${RELOCATING+${OTHER_TEXT_SECTIONS}}
@@ -274,15 +350,17 @@ cat <<EOF
KEEP (*(.fini))
${RELOCATING+${FINI_END}}
} =${NOP-0}
- ${RELOCATING+PROVIDE (__etext = .);}
- ${RELOCATING+PROVIDE (_etext = .);}
- ${RELOCATING+PROVIDE (etext = .);}
+ ${RELOCATING+PROVIDE (__${ETEXT_NAME} = .);}
+ ${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);}
+ ${RELOCATING+PROVIDE (${ETEXT_NAME} = .);}
${WRITABLE_RODATA-${RODATA}}
.rodata1 ${RELOCATING-0} : { *(.rodata1) }
${CREATE_SHLIB-${SDATA2}}
${CREATE_SHLIB-${SBSS2}}
${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
@@ -290,50 +368,69 @@ cat <<EOF
${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
- the linker would then create the section even if it turns out to
- be empty, which isn't pretty. */
- ${RELOCATING+. = ALIGN(${ALIGNMENT});}
- ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
- .preinit_array ${RELOCATING-0} : { *(.preinit_array) }
- ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
+ /* Exception handling */
+ .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+
+ /* Thread Local Storage sections */
+ .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
+ .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
+
+ .preinit_array ${RELOCATING-0} :
+ {
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__preinit_array_start = .);}}
+ KEEP (*(.preinit_array))
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__preinit_array_end = .);}}
+ }
+ .init_array ${RELOCATING-0} :
+ {
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_start = .);}}
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_end = .);}}
+ }
+ .fini_array ${RELOCATING-0} :
+ {
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_start = .);}}
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_end = .);}}
+ }
+ ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
+ ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
+ .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) }
- ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_start = .);}}
- .init_array ${RELOCATING-0} : { *(.init_array) }
- ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_end = .);}}
+ ${RELOCATING+${DATARELRO}}
+ ${OTHER_RELRO_SECTIONS}
+ ${TEXT_DYNAMIC-${DYNAMIC}}
+ ${DATA_GOT+${RELRO_NOW+${GOT}}}
+ ${DATA_GOT+${RELRO_NOW+${GOTPLT}}}
+ ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}}
+ ${RELOCATING+${DATA_SEGMENT_RELRO_END}}
+ ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT-${GOT}}}}
+ ${DATA_GOT+${RELRO_NOW-${GOTPLT}}}
- ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_start = .);}}
- .fini_array ${RELOCATING-0} : { *(.fini_array) }
- ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_end = .);}}
+ ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
.data ${RELOCATING-0} :
{
${RELOCATING+${DATA_START_SYMBOLS}}
*(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
+ KEEP (*(.gnu.linkonce.d.*personality*))
${CONSTRUCTING+SORT(CONSTRUCTORS)}
}
.data1 ${RELOCATING-0} : { *(.data1) }
- .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
- .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
- .eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) }
${WRITABLE_RODATA+${RODATA}}
${OTHER_READWRITE_SECTIONS}
- ${TEXT_DYNAMIC-${DYNAMIC}}
- ${RELOCATING+${CTOR}}
- ${RELOCATING+${DTOR}}
- .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) }
- ${DATA_PLT+${PLT}}
- ${RELOCATING+${OTHER_GOT_SYMBOLS}}
- ${GOT}
- ${OTHER_GOT_SECTIONS}
- ${CREATE_SHLIB+${SDATA2}}
- ${CREATE_SHLIB+${SBSS2}}
+ ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
+ ${SMALL_DATA_DTOR+${RELOCATING+${DTOR}}}
+ ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
+ ${SDATA_GOT+${RELOCATING+${OTHER_GOT_SYMBOLS}}}
+ ${SDATA_GOT+${GOT}}
+ ${SDATA_GOT+${OTHER_GOT_SECTIONS}}
${SDATA}
${OTHER_SDATA_SECTIONS}
- ${RELOCATING+_edata = .;}
- ${RELOCATING+PROVIDE (edata = .);}
+ ${RELOCATING+${DATA_END_SYMBOLS-_edata = .; PROVIDE (edata = .);}}
${RELOCATING+__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
${SBSS}
@@ -345,14 +442,17 @@ cat <<EOF
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
- .bss section disappears because there are no input sections. */
- ${RELOCATING+. = ALIGN(${ALIGNMENT});}
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
}
- ${OTHER_BSS_SECTIONS}
- ${RELOCATING+. = ALIGN(${ALIGNMENT});}
- ${RELOCATING+_end = .;}
${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
- ${RELOCATING+PROVIDE (end = .);}
+ ${RELOCATING+. = ALIGN(${ALIGNMENT});}
+ ${LARGE_SECTIONS}
+ ${RELOCATING+. = ALIGN(${ALIGNMENT});}
+ ${RELOCATING+${OTHER_END_SYMBOLS}}
+ ${RELOCATING+${END_SYMBOLS-_end = .; PROVIDE (end = .);}}
${RELOCATING+${DATA_SEGMENT_END}}
/* Stabs debugging sections. */
@@ -396,9 +496,12 @@ cat <<EOF
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
+ ${TINY_DATA_SECTION}
+ ${TINY_BSS_SECTION}
+
${STACK_ADDR+${STACK}}
${OTHER_SECTIONS}
- ${RELOCATING+${OTHER_END_SYMBOLS}}
+ ${RELOCATING+${OTHER_SYMBOLS}}
${RELOCATING+${STACKNOTE}}
}
EOF
diff --git a/contrib/binutils/ld/scripttempl/mips.sc b/contrib/binutils/ld/scripttempl/mips.sc
index d60aeed..972351f 100644
--- a/contrib/binutils/ld/scripttempl/mips.sc
+++ b/contrib/binutils/ld/scripttempl/mips.sc
@@ -29,9 +29,6 @@ SECTIONS
*(.init)
${RELOCATING+ eprol = .};
*(.text)
- ${RELOCATING+PROVIDE (__runtime_reloc_start = .);}
- *(.rel.sdata)
- ${RELOCATING+PROVIDE (__runtime_reloc_stop = .);}
*(.fini)
${RELOCATING+ etext = .};
${RELOCATING+ _etext = .};
diff --git a/contrib/binutils/ld/scripttempl/pe.sc b/contrib/binutils/ld/scripttempl/pe.sc
index da09eb4..c9931b5 100644
--- a/contrib/binutils/ld/scripttempl/pe.sc
+++ b/contrib/binutils/ld/scripttempl/pe.sc
@@ -24,7 +24,11 @@ if test "${RELOCATING}"; then
SORT(*)(.idata$5)
SORT(*)(.idata$6)
SORT(*)(.idata$7)'
- R_CRT='*(SORT(.CRT$*))'
+ R_CRT_XC='*(SORT(.CRT$XC*)) /* C initialization */'
+ R_CRT_XI='*(SORT(.CRT$XI*)) /* C++ initialization */'
+ R_CRT_XL='*(SORT(.CRT$XL*)) /* TLS callbacks */'
+ R_CRT_XP='*(SORT(.CRT$XP*)) /* Pre-termination */'
+ R_CRT_XT='*(SORT(.CRT$XT*)) /* Termination */'
R_TLS='
*(.tls)
*(.tls$)
@@ -46,11 +50,13 @@ ${OUTPUT_ARCH+OUTPUT_ARCH(${OUTPUT_ARCH})}
${LIB_SEARCH_DIRS}
-ENTRY(${ENTRY})
-
SECTIONS
{
- .text ${RELOCATING+ __image_base__ + __section_alignment__ } :
+ ${RELOCATING+/* Make the virtual address and file offset synced if the alignment is}
+ ${RELOCATING+ lower than the target page size. */}
+ ${RELOCATING+. = SIZEOF_HEADERS;}
+ ${RELOCATING+. = ALIGN(__section_alignment__);}
+ .text ${RELOCATING+ __image_base__ + ( __section_alignment__ < ${TARGET_PAGE_SIZE} ? . : __section_alignment__ )} :
{
${RELOCATING+ *(.init)}
*(.text)
@@ -58,9 +64,9 @@ SECTIONS
*(.glue_7t)
*(.glue_7)
${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
- LONG (-1); *(SORT(.ctors.*)); *(.ctors); *(.ctor); LONG (0); }
+ LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*)); LONG (0); }
${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
- LONG (-1); *(SORT(.dtors.*)); *(.dtors); *(.dtor); LONG (0); }
+ LONG (-1); *(.dtors); *(.dtor); *(SORT(.dtors.*)); LONG (0); }
${RELOCATING+ *(.fini)}
/* ??? Why is .gcc_exc here? */
${RELOCATING+ *(.gcc_exc)}
@@ -80,6 +86,7 @@ SECTIONS
*(.data)
*(.data2)
${R_DATA}
+ *(.jcr)
${RELOCATING+__data_end__ = . ;}
${RELOCATING+*(.data_cygwin_nocopy)}
}
@@ -130,12 +137,28 @@ SECTIONS
}
.CRT ${RELOCATING+BLOCK(__section_alignment__)} :
{
- ${R_CRT}
+ ${RELOCATING+___crt_xc_start__ = . ;}
+ ${R_CRT_XC}
+ ${RELOCATING+___crt_xc_end__ = . ;}
+ ${RELOCATING+___crt_xi_start__ = . ;}
+ ${R_CRT_XI}
+ ${RELOCATING+___crt_xi_end__ = . ;}
+ ${RELOCATING+___crt_xl_start__ = . ;}
+ ${R_CRT_XL}
+ /* ___crt_xl_end__ is defined in the TLS Directory support code */
+ ${RELOCATING+___crt_xp_start__ = . ;}
+ ${R_CRT_XP}
+ ${RELOCATING+___crt_xp_end__ = . ;}
+ ${RELOCATING+___crt_xt_start__ = . ;}
+ ${R_CRT_XT}
+ ${RELOCATING+___crt_xt_end__ = . ;}
}
.tls ${RELOCATING+BLOCK(__section_alignment__)} :
{
+ ${RELOCATING+___tls_start__ = . ;}
${R_TLS}
+ ${RELOCATING+___tls_end__ = . ;}
}
.endjunk ${RELOCATING+BLOCK(__section_alignment__)} :
@@ -159,13 +182,91 @@ SECTIONS
.stab ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
{
- [ .stab ]
+ *(.stab)
}
.stabstr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
{
- [ .stabstr ]
+ *(.stabstr)
+ }
+
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section. Unlike other targets that fake this by putting the
+ section VMA at 0, the PE format will not allow it. */
+
+ /* DWARF 1.1 and DWARF 2. */
+ .debug_aranges ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ *(.debug_aranges)
+ }
+
+ .debug_pubnames ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ *(.debug_pubnames)
+ }
+
+ /* DWARF 2. */
+ .debug_info ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ *(.debug_info) *(.gnu.linkonce.wi.*)
+ }
+
+ .debug_abbrev ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ *(.debug_abbrev)
+ }
+
+ .debug_line ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ *(.debug_line)
+ }
+
+ .debug_frame ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ *(.debug_frame)
+ }
+
+ .debug_str ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ *(.debug_str)
+ }
+
+ .debug_loc ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ *(.debug_loc)
}
+ .debug_macinfo ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ *(.debug_macinfo)
+ }
+
+ /* SGI/MIPS DWARF 2 extensions. */
+ .debug_weaknames ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ *(.debug_weaknames)
+ }
+
+ .debug_funcnames ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ *(.debug_funcnames)
+ }
+
+ .debug_typenames ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ *(.debug_typenames)
+ }
+
+ .debug_varnames ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ *(.debug_varnames)
+ }
+
+ /* DWARF 3. */
+ .debug_ranges ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ *(.debug_ranges)
+ }
}
EOF
diff --git a/contrib/binutils/ld/sysdep.h b/contrib/binutils/ld/sysdep.h
index f164e74..4c5e994 100644
--- a/contrib/binutils/ld/sysdep.h
+++ b/contrib/binutils/ld/sysdep.h
@@ -16,8 +16,8 @@
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. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#ifndef LD_SYSDEP_H
#define LD_SYSDEP_H
@@ -77,19 +77,19 @@ extern char *strrchr ();
#include "fopen-same.h"
#endif
-#ifdef NEED_DECLARATION_STRSTR
+#if !HAVE_DECL_STRSTR
extern char *strstr ();
#endif
-#ifdef NEED_DECLARATION_FREE
+#if !HAVE_DECL_FREE
extern void free ();
#endif
-#ifdef NEED_DECLARATION_GETENV
+#if !HAVE_DECL_GETENV
extern char *getenv ();
#endif
-#ifdef NEED_DECLARATION_ENVIRON
+#if !HAVE_DECL_ENVIRON
extern char **environ;
#endif
OpenPOWER on IntegriCloud