diff options
author | obrien <obrien@FreeBSD.org> | 2002-01-27 12:00:11 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2002-01-27 12:00:11 +0000 |
commit | fc89183cdc6be5afa8deb7250fd15a20832ab528 (patch) | |
tree | 5c493199a70976c54e1b9c6a7804a3de85b43e84 /contrib/binutils/ld | |
parent | 94820fd8060f6f43089d1a3ddb8a482402e7e494 (diff) | |
download | FreeBSD-src-fc89183cdc6be5afa8deb7250fd15a20832ab528.zip FreeBSD-src-fc89183cdc6be5afa8deb7250fd15a20832ab528.tar.gz |
Enlist the FreeBSD-CURRENT users as testers of what is to become Binutils
version 2.12.0. These bits are taken from the FSF anoncvs repo on
27-January-2002 03:41 PST.
Diffstat (limited to 'contrib/binutils/ld')
77 files changed, 6913 insertions, 3079 deletions
diff --git a/contrib/binutils/ld/ChangeLog b/contrib/binutils/ld/ChangeLog index 0399c95..de96a89 100644 --- a/contrib/binutils/ld/ChangeLog +++ b/contrib/binutils/ld/ChangeLog @@ -1,23 +1,1032 @@ -2001-10-17 Nick Clifton <nickc@cambridge.redhat.com> +2002-01-26 Hans-Peter Nilsson <hp@bitrange.com> - * ld.1: Remove .TP macro from SYNOPSIS section - it prevents - successful translation to DocBook format. + * Makefile.am (install): Depend on install-info. + * Makefile.in: Regenerate. -2001-09-30 Stephane Carrez <Stephane.Carrez@worldnet.fr> +2002-01-26 Christian Rose <menthos@menthos.com> - Report 2001-08-03 Stephane Carrez <Stephane.Carrez@worldnet.fr> + * ldmain.c (main): Use full sentences to ease translation. - * scripttempl/elfm68hc12.sc (FINISH_CODE, FINISH_RELOC): New to handle - .fini[0-4] sections used by _exit - (CTOR, DTOR): Export ctor/dtor symbols; move them to ROM. - (*.text,*.data,*.bss): Take into account .text.*, .data.*, .bss.*. - * scripttempl/elfm68hc11.sc: Likewise. +2002-01-26 Nick Clifton <nickc@cambridge.redhat.com> + + * po/fr.po: Updated version. + +2002-01-25 Nick Clifton <nickc@cambridge.redhat.com> + + * po/es.po: Updated version. + +2002-01-25 Andreas Jaeger <aj@suse.de> + + * ldlex.l (yy_input): Correct error check. + +2002-01-25 Alan Modra <amodra@bigpond.net.au> + + * ldmisc.c (demangle): Put back dots when string not demangled. + +2002-01-22 Richard Henderson <rth@redhat.com> + + * emulparams/elf64alpha.sh (NOP): Use unop. + +2002-01-21 Andreas Jaeger <aj@suse.de> + + * ldlex.l: Use fread instead of read. + +2002-01-21 Jason Thorpe <thorpej@wasabisystems.com> + + * configure.tgt (ia64-*-netbsd*): New target. + +2002-01-21 H.J. Lu <hjl@gnu.org> + + * emulparams/elf32btsmip.sh (SHLIB_TEXT_START_ADDR): Change to + 0. + * emulparams/elf64btsmip.sh (SHLIB_TEXT_START_ADDR): Likewise. + +2002-01-18 Andreas Jaeger <aj@suse.de> + + * ldver.c (ldversion): Update year. + +2002-01-17 Nick Clifton <nickc@cambridge.redhat.com> + + * po/ld.pot: Regenerate. + +2002-01-16 Alan Modra <amodra@bigpond.net.au> + + * Makefile.am (eelf64ppc.c, eelf64lppc.c): Depend on ppc64elf.em. + * Makefile.in: Regenerate. + * emulparams/elf64ppc.sh (EXTRA_EM_FILE): Define. + * emultempl/ppc64elf.em: New file. + +2002-01-15 DJ Delorie <dj@redhat.com> + + * scripttempl/pe.sc: Add support for constructor priorities. + +2002-01-07 Marek Michalkiewicz <marekm@amelek.gda.pl> + + * emulparams/avr1200.sh (DATA_START): Define as 0x60. + * emulparams/avr23xx.sh: Likewise. + * emulparams/avr4433.sh: Likewise. + * emulparams/avr44x4.sh: Likewise. + * emulparams/avr85xx.sh: Likewise. + * emulparams/avrmega103.sh: Likewise. + * emulparams/avrmega161.sh: Likewise. + * emulparams/avrmega603.sh: Likewise. + * scripttempl/elf32avr.sc: Use DATA_START instead of 0x60. + +2002-01-08 Alexandre Oliva <aoliva@redhat.com> + + * ldlang.c (walk_wild_section): Exclude object file if enclosing + archive is excluded. + +2002-01-07 Jason Thorpe <thorpej@wasabisystems.com> + + * Makefile.am (ALL_EMULATIONS): Add eshelf_nbsd.o and eshlelf_nbsd.o. + (eshelf_nbsd.c): New rule. + (eshlelf_nbsd.c): New rule. + * Makefile.in: Regenerate. + * configure.tgt (sh*le-*-netbsdelf*): New target. + (sh*-*-netbsdelf*): New target. + * emulparams/shelf.sh: Document that shelf_nbsd.sh sources this file. + * ld/emulparams/shelf_nbsd.sh: New emulation. + * ld/emulparams/shlelf_nbsd.sh: New emulation. + +2002-01-07 Nick Clifton <nickc@cambridge.redhat.com> + + * po/es.po: New file: Spanish translation. + * configure.in (ALL_LINGUAS): Add es. + * configure: Regenerate. + +2002-01-06 John Marshall <jmarshall@acm.org> + + * ld.texinfo: Note that --emit-relocs is currently only + implemented for ELF. + +2002-01-05 Alan Modra <amodra@bigpond.net.au> + + * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Make use + of bfd_section_list_remove and bfd_section_list_insert macros. + * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise. + * emultempl/mmo.em (mmo_place_orphan): Likewise. + +2002-01-04 Jason Thorpe <thorpej@wasabisystems.com> + + * configure.tgt (x86_64-*-netbsd*): New target. + +2001-12-21 Tom Rix <trix@redhat.com> + + (gld*_create_output_section_statements): New function. + For -binitfini support. + * emultempl/aix.em (gld*_before_parse): Fix comment. + * emultempl/aix.em (gld*_parse_args): Fix comment. + +2001-12-20 Jason Thorpe <thorpej@wasabisystems.com> + + * configure.tgt (mips*-dec-netbsd*): Delete alias for + mips*el-*-netbsd*. + (sparc64-*-netbsd*): Add elf32_sparc to targ_extra_emuls. + + * configure.tgt (arm-*-netbsdelf*): Add target. + (arm-*-netbsd*): Add armelf and armelf_nbsd to targ_extra_emuls. + * emulparams/armelf_nbsd.sh: Added. + * Makefile.am: Add rules for earmelf_nbsd. + * Makefile.in: Regenerate. + +2001-12-19 Andreas Jaeger <aj@suse.de>, + Susanne Oberhauser <froh@suse.de> + + * configure.host: Add rules for x86_64-*linux-gnu. Change + s390x-linux entry to use gcc to report configuration, replace gcc + with $CC in s390-linux + +2001-12-19 Andreas Jaeger <aj@suse.de> + + * ld.texinfo (VERSION): Fix markup. + +2001-12-18 matthew green <mrg@eterna.com.au> + + * Makefile.am (ALL_EMULATIONS): Add m68kelfnbsd.o. + (m68kelfnbsd.c): New rule. + * Makefile.in: Regenerate. + * configure.tgt (m68*-hp-netbsd*): Renamed to .. + (m68*-*-netbsd*4k*): .. this. + (m68*-*-netbsdelf*): New target. + (m68*-*-netbsd*): Also include ELF support. + (m68*-*-netbsdaout*): New alias for m68*-*-netbsd*. + * emulparams/m68kelfnbsd.sh: New emulation. + +2001-12-18 Jakub Jelinek <jakub@redhat.com> + + * ldgram.y (vers_node): Support anonymous version tags. + * ldlang.c (lang_register_vers_node): Ensure anonymous version + tag is not defined together with non-anonymous versions. + * ld.texinfo: Document it. + +2001-12-18 Nick Clifton <nickc@cambridge.redhat.com> + + * po/tr.po: New file: Turkish translation. + * configure.in (ALL_LINGUAS): Add tr. + * configure: Regenerate. + +2001-12-17 Jason Thorpe <thorpej@wasabisystems.com> + + * Makefile.am: Add rules for eelf64alpha_nbsd. + * Makefile.in: Regenerate. + * configure.tgt (alpha*-*-netbsd*): Set + targ_emul to elf64alpha_nbsd. + * emulparams/elf64alpha_nbsd.sh: Added. + +2001-12-17 Alan Modra <amodra@bigpond.net.au> + + * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Adjust + section_tail when fiddling with section list. + (gld${EMULATION_NAME}_list_options): Ensure sentences aren't + broken into separate strings to make translation easier. + * emultempl/mmo.em (mmo_place_orphan): Adjust section_tail when + fiddling with section list. + * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise. + +2001-12-16 Hans-Peter Nilsson <hp@bitrange.com> + + * scripttempl/mmo.sc: Add .debug_ranges to listed sections. + +2001-12-15 Alan Modra <amodra@bigpond.net.au> + + * ldmain.c (main): Initialise link_info.eh_frame_hdr. + +2001-12-13 Jakub Jelinek <jakub@redhat.com> + + * emultempl/elf32.em (finish): Supply output_bfd + to bfd_elf*_discard_info. + (OPTION_EH_FRAME_HDR): Define. + (longopts): Add --eh-frame-hdr. + (parse_args): Handle it. + (list_options): Add --eh-frame-hdr to help. + * emultempl/hppaelf.em (finish): Supply output_bfd + to bfd_elf*_discard_info. + * scripttempl/elf.sc (.eh_frame_hdr): Add. + +2001-12-13 Alan Modra <amodra@bigpond.net.au> + + * lexsup.c (parse_args): Don't pass shortopts to second call to + getopt functions. Restore optind rather than decrementing before + second call. Remove errind as it now duplicates last_optind. + +2001-12-11 Christopher Faylor <cgf@redhat.com> + + * emultempl/pe.em (gld_${EMULATION_NAME}_list_options): Fix typo. + +2001-12-07 Geoffrey Keating <geoffk@redhat.com> + Richard Henderson <rth@redhat.com> + + * Makefile.am: Add support for xstormy16. + * configure.tgt: Add support for xstormy16. + * Makefile.in: Regenerate. + * emulparams/elf32xstormy16.sh: New file. + * scripttempl/xstormy16.sc: New file. + +2001-10-01 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in (LIB_PATH): Make configurable. + (GENSCRIPTS): Set LIB_PATH in environment. + * configure.in: Substitute LIB_PATH. + * configure: Regenerate. + * configure.tgt (*cygwin): Set LIB_PATH for cross build. + * configure.host (*cygwin): Add /usr/lib/w32api to NATIVE_LIB_DIRS. + +2001-12-07 Nick Clifton <nickc@cambridge.redhat.com> + + * lexsup.c (ld_options): Insert 'PROGRAM' into the text string + describing the -N option so that it is easier to translate into + foreign languages. + +2001-12-05 Nick Clifton <nickc@cambridge.redhat.com> + + * emultempl/pe.em (..._list_options): Replace multiple fprintf + statements describing a single option with a single, newline + escaped fprintf. This allows better translation into other + languages. + + * ldmain.c (add_archive_element): Combine multiple strings + into a single string to permit better translation into other + languages. + +2001-12-05 Tom Rix <trix@redhat.com> + + * Makefile.am: Remove eaixppc64. + * Makefile.in: Regenerate. + +2001-12-04 Tom Rix <trix@redhat.com> + + * emultempl/aix.em (choose_target): Change default target to + OUTPUT_FORMAT for ppcmacos. Add braces to remove compiler + warning. + (gld*_read_file): Fix typo. + (change_symbol_mode): Add prototype. + (is_syscall): Same. + + * emulparams/aixppc.sh (SYSCALL_MASK, SYMBOL_MODE_MASK): Delete. + * emulparams/aixrs6.sh : Same. + * emulparams/ppcmacos.sh : Same. + * emulparams/aixppc64.sh : Delete file. + * emultempl/aix.em : Formatting changes. + +2001-12-04 Hans-Peter Nilsson <hp@axis.com> + + * emulparams/criself.sh (NO_SMALL_DATA): Set, to yes. + (OTHER_BSS_END_SYMBOLS): Don't refer to .sbss when setting + __Sbss. + (OTHER_END_SYMBOLS): Fix formatting. + * emulparams/crislinux.sh (NO_SMALL_DATA): Set, to yes. + (OTHER_END_SYMBOLS): Fix formatting. + +2001-12-04 Alan Modra <amodra@bigpond.net.au> + + * ldexp.c (exp_print_token): Correct "table" entry for RSHIFT. + +2001-12-02 Tom Rix <trix@redhat.com> + + * configure.tgt : Remove eaixppc64 emulations. + * Makefile.in : Remove eaixppc64.c + * ldemul.c (ldemul_choose_target): New parameters argc, argv. + (ldemul_default_target): Same. + * emultempl/gld960.em (gld960_choose_target): Same. + * emultempl/gld960c.em (gld960_choose_target): Same. + * scripttempl/aix.sc: Remove OUTPUT_FORMAT. + * emultempl/aix.em (is_syscall): syscall_mask now a variable. + * emultempl/aix.em (gld*_read_file): symbol_mode_mask now a variable. + * emultempl/aix.em (gld*_parse_args): Handle -b32 -b64 emulation. + * emultempl/aix.em (choose_target): New function. Handle emulation of + -b32 and -b64. + +2001-11-27 H.J. Lu <hjl@gnu.org> + + * emulparams/elf_i386.sh (NO_SMALL_DATA): Set to yes. + * emulparams/elf_i386_be.sh (NO_SMALL_DATA): Likewise. + * emulparams/elf_i386_chaos.sh (NO_SMALL_DATA): Likewise. + * emulparams/elf_i386_ldso.sh (NO_SMALL_DATA): Likewise. + * emulparams/elf_x86_64.sh (NO_SMALL_DATA): Likewise. + * emulparams/m68kelf.sh (NO_SMALL_DATA): Likewise. + * emulparams/elf32_sparc.sh (NO_SMALL_DATA): Likewise. + * emulparams/elf64_sparc.sh (NO_SMALL_DATA): Likewise. + + * scripttempl/elf.sc (SBSS): New. Define if ${NO_SMALL_DATA} + is not empty. + (SDATA): Likewise. + (REL_SDATA): Likewise. + (REL_SBSS): Likewise. + (REL_SDATA2): Likewise. + (REL_SBSS2): Likewise. + (SBSS2): Define if ${NO_SMALL_DATA} is not empty. + (SDATA2): Likewise. + +2001-11-25 Stephane Carrez <Stephane.Carrez@worldnet.fr> + + * scripttempl/elfm68hc11.sc (CTOR, DTOR): Put constructor and + destructor in rom. + * scripttempl/elfm68hc12.sc (CTOR, DTOR): Likewise. + +2001-11-22 H.J. Lu <hjl@gnu.org> + + * Makefile.in: Regenerated with automake based on automake + 1.4-8 in RedHat 7.1. + +2001-11-22 Alan Modra <amodra@bigpond.net.au> + + * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Define. + (config.status): Delete rule. + Add extra dependencies to cover sourced emulparams files. + * Makefile.in: Regenerate. + + * scripttempl/elf.sc: Order <section>, <section>.* and + corresponding linkonce sections as seen in input files. + Formatting fixes. Zero vma of all sections if not relocating. + (STACK): Define and insert if STACK_ADDR defined. + (OTHER_RELOCATING_SECTIONS): Delete. + (OTHER_END_SYMBOLS): Define. + (OTHER_READONLY_SECTIONS): Always insert, not just when relocating. + (OTHER_READWRITE_SECTIONS): Likewise. + (OTHER_GOT_SECTIONS): Likewise. + (OTHER_SDATA_SECTIONS): Likewise. + (OTHER_BSS_SECTIONS): Likewise. + * scripttempl/elfi370.sc (OTHER_READONLY_SECTIONS): Likewise. + (OTHER_READWRITE_SECTIONS): Likewise. + * scripttempl/nw.sc (OTHER_READONLY_SECTIONS): Likewise. + (OTHER_READWRITE_SECTIONS): Likewise + + * emulparams/armelf.sh (OTHER_RELOCATING_SECTIONS): Delete. + (STACK_ADDR): Define. + * emulparams/armelf_oabi.sh: As for armelf.sh. + * emulparams/elf32mcore.sh: As for armelf.sh. + * emulparams/h8300elf.sh: As for armelf.sh. + * emulparams/mn10200.sh: As for armelf.sh. + * emulparams/shelf.sh: As for armelf.sh. + + * emulparams/elf32fr30.sh (OTHER_RELOCATING_SECTIONS): Delete. + (OTHER_END_SYMBOLS): Define. + * emulparams/m32relf.sh: As for elf32fr30.sh. + * emulparams/h8300helf.sh: As for elf32fr30.sh. + * emulparams/h8300self.sh: As for elf32fr30.sh. + + * emulparams/criself.sh (OTHER_READONLY_SECTIONS): Protect symbol + defines with RELOCATING test. + (OTHER_SDATA_SECTIONS): Likewise. + (OTHER_RELOCATING_SECTIONS): Delete, replacing with.. + (OTHER_END_SYMBOLS): ..this. + * emulparams/crislinux.sh: As for criself.sh. + + * emulparams/elf32bmipn32.sh (OTHER_SDATA_SECTIONS): Zero vma + if not relocating. + (OTHER_RELOCATING_SECTIONS): Delete, replacing with.. + (OTHER_SECTIONS): ..this. Zero vma if not relocating. Order + normal and linkonce sections as seen in input files. + * emulparams/elf32bmip.sh (DATA_ADDR): Don't define if EMBEDDED. + (TEXT_DYNAMIC): Likewise. + (INITIAL_READONLY_SECTIONS): Zero vma if not relocating. + (OTHER_SDATA_SECTIONS): Likewise. + * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Likewise. + * emulparams/shlelf_linux.sh (OTHER_READWRITE_SECTIONS): Likewise. + * emulparams/elf64alpha.sh (OTHER_READONLY_SECTIONS): Likewise. + * emulparams/hppalinux.sh (OTHER_READONLY_SECTIONS): Likewise. + * emulparams/elf64_aix.sh (OTHER_GOT_SECTIONS): Likewise. + (OTHER_PLT_RELOC_SECTIONS): Likewise. + (OTHER_READONLY_SECTIONS): Likewise. Order normal and linkonce + sections as seen in input files. + * emulparams/elf64_ia64.sh: As for emulparams/elf64_aix.sh. + * emulparams/hppa64linux.sh (OTHER_READONLY_SECTIONS): Zero vma + if not relocating. + (OTHER_READWRITE_SECTIONS, OTHER_BSS_SECTIONS): Likewise. + (OTHER_BSS_END_SYMBOLS): Merge from elf64hppa.sh. + * emulparams/elf64mmix.sh (OTHER_RELOCATING_SECTIONS): Delete. + (OTHER_SECTIONS): Instead, use this.. + (OTHER_END_SYMBOLS): ..and this. + + * emulparams/elf32b4300.sh: Source elf32bmip.sh, remove duplicates. + * emulparams/elf32bsmip.sh: Likewise. + * emulparams/elf32btsmip.sh: Likewise. + * emulparams/elf32ebmip.sh: Likewise. + * emulparams/elf32lmip.sh: Likewise. + * emulparams/elf32elmip.sh: Source elf32lmip.sh, remove duplicates. + * emulparams/elf32lsmip.sh: Likewise. + * emulparams/elf32ltsmip.sh: Source elf32btsmip.sh, remove duplicates. + * emulparams/elf32l4300.sh: Source elf32b4300.sh, remove duplicates. + * emulparams/elf64bmip.sh: Source elf32bmipn32.sh, remove duplicates. + * emulparams/elf64btsmip.sh: Likewise. + * emulparams/elf64ltsmip.sh: Source elf64btsmip.sh, remove duplicates. + * emulparams/elf32lppc.sh: Source elf32ppc.sh, remove duplicates. + * emulparams/elf32ppclinux.sh: Likewise. + * emulparams/elf32ppcsim.sh: Likewise. + * emulparams/elf32lppcsim.sh: Source elf32lppc.sh, remove duplicates. + * emulparams/elf64hppa.sh: Source hppa64linux.sh, remove duplicates. + * emulparams/h8300helf.sh: Source h8300elf.sh, remove duplicates. + * emulparams/h8300self.sh: Likewise. + * emulparams/mn10300.sh: Source mn10200.sh, remove duplicates. + * emulparams/sh.sh: Comment. + * emulparams/shl.sh: Source sh.sh, remove duplicates. + * emulparams/shlelf.sh: Source shelf.sh, remove duplicates. + * emulparams/shelf_linux.sh: Source shlelf_linux.sh, remove duplicates. + +2001-11-21 David Heine <dlheine@tensilica.com> + Alan Modra <amodra@bigpond.net.au> + + * ldlang.c (map_input_to_output_sections): Replace "break" + accidentally removed with 2001-08-03 change. + (lang_gc_sections_1): Likewise. + +2001-11-21 Alan Modra <amodra@bigpond.net.au> + + * ldlang.c (walk_wild_section): Move sec == NULL case out of loop. + +2001-11-20 Angela Marie Thomas <angela@redhat.com> + + * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Use NULL instead + of false when calling lang_size_sections. + * emultempl/hppaelf.em (hppaelf_layout_sections_again): Likewise. + +2001-11-15 Alan Modra <amodra@bigpond.net.au> + + * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Only emit this + function when LDEMUL_FINISH isn't set to the same name. Don't + call ${LDEMUL_FINISH}. + (ld_${EMULATION_NAME}_emulation): Call $LDEMUL_FINISH if defined. + * emultempl/armelf.em (arm_elf_finish): Call + gld${EMULATION_NAME}_finish. + * emultempl/hppaelf.em (hppaelf_finish): Rename to + gld${EMULATION_NAME}_finish. Call bfd_elf32_discard_info and + hppaelf_layout_sections_again if necessary. + (need_laying_out): New var. + (hppaelf_layaout_sections_again): Rename to + hppaelf_layout_sections_again. Clear need_laying_out. + (PARSE_AND_LIST_OPTIONS): Format text. + +2001-11-14 H.J. Lu <hjl@gnu.org> + + * emultempl/armelf.em (arm_elf_finish): Renamed from + gld${EMULATION_NAME}_finish. + (LDEMUL_FINISH): Set to arm_elf_finish. + +2001-11-14 Daniel Jacobowitz <drow@mvista.com> + + * emultempl/elf32.em (gld${EMULATION_NAME}_finish): New. + (struct ld_emulation_xfer_struct): Use it. + +Tue Nov 13 11:27:14 2001 Ross Alexander <ross.alexander@uk.neceur.com> + + * emulparams/elf64hppa.sh (OTHER_BSS_END_SYMBOLS): Add + additional symbols referenced by newer crt0.o files from HP. + +2001-11-12 Anthony Green <green@redhat.com> + + * emulparams/armelf.sh (DATA_START_SYMBOLS): New symbol. + +2001-11-12 Alfred M. Szmidt <ams@kemisten.nu> + + * Makefile.am (GENSCRIPTS): Quote ${exec_prefix}. + * Makefile.in: Regenerate. + +2001-11-02 Stephane Carrez <Stephane.Carrez@worldnet.fr> + + * ld.texinfo: Use @command for commands, @option for options. + * Makefile.am (POD2MAN): Use 'GNU Development Tools' for + the page man title. + * Makefile.in: Rebuild. + +2001-11-04 Chris Demetriou <cgd@broadcom.com> + + * configure.tgt (mips*el-*-netbsd*, mips*-*-netbsd*): + Add support for targets. + +2001-11-02 Nick Clifton <nickc@cambridge.redhat.com> + + * configure.in (ALL_LINGUAS): Add "fr" and "sv" + * configure: Regernate. + * po/fr.po: New file. + * po/sv.po: New file. + +2001-11-01 NIIBE Yutaka <gniibe@m17n.org> + + * configure.tgt (sh-*-linux): Set targ_emul, targ_extra_emuls + as little endian default and to support big endian. + +2001-11-01 Chris Demetriou <cgd@broadcom.com> + + * ld.texinfo (Options): Document new option, -nostdlib. + * lexsup.c (OPTION_NOSTDLIB): New definition. + (ld_options): Add entry for "nostdlib". + (parse_args): Handle OPTIONS_NOSTDLIB. + * ldfile.c (ldfile_add_library_path): Don't add directories + to the search path if they weren't specified on the command line + and -nostdlib was specified. + * ld.h (ld_config_type): New member only_cmd_line_lib_dirs. + +2001-10-31 Nick Clifton <nickc@cambridge.redhat.com> + + * lexsup.c (parse_args): Prevent infinite parsing loop when + "-rpath.a" is specified on the command line. + Replace calls to fprintf with calls to einfo. + +2001-10-31 John Marshall <jmarshall@acm.org> + + * ld.texinfo: A historical requirement that MEMORY and SECTIONS + appear only once across all the linker scripts involved in a link + invocation no longer applies. Make the documentation reflect + that. + +2001-10-31 NIIBE Yutaka <gniibe@m17n.org> + + * configure.tgt: Supports sh3/sh4/sh3eb/sh4eb-unknown-linux-gnu + targets. + (sh-*-linux*): Added targ_extra_libpath. + +2001-10-31 David Heine <dlheine@tensilica.com> + + * ldlang.c (lang_size_sections): Keep a valid output_offset field + for padding statements. + +2001-10-30 Hans-Peter Nilsson <hp@bitrange.com> + + * configure.tgt (mmix-*-*): New target. + * Makefile.am (ALL_EMULATIONS): Add eelf64mmix.o and emmo.o. + Add dependencies to match. + * emulparams/mmo.sh, emulparams/elf64mmix.sh, emultempl/mmo.em, + emultempl/mmix-elfnmmo.em, emultempl/mmixelf.em, + scripttempl/mmo.sc: New files. + * gen-doc.texi: @set MMIX. + * ld.texinfo: Ditto. + [MMIX] Add MMIX node. + * Makefile.in: Regenerate. + +2001-10-29 Kazu Hirata <kazu@hxi.com> + + * ldlang.c: Fix a comment typo. + +2001-10-23 Alan Modra <amodra@bigpond.net.au> + + * configure.host: Move alpha*-*-linux-gnu* entry to generic + entries, and match *-*-linux*. + +2001-10-20 Alan Modra <amodra@bigpond.net.au> + + * ldgram.y (mri_script_command): Surround processing of INCLUDE + with ldlex_script, ldlex_popstate. + (ifile_p1): Likewise. + * ldlex.l (EOF): Don't BEGIN(SCRIPT). Restore lineno from the + correct slot. + (lex_push_file): Save current lineno to lineno_stack. Set lineno + to 1. Don't BEGIN(SCRIPT). + (lex_redirect): Similarly. + * ldmain.c (main): Set yydebug non-zero if YYDEBUG. + +2001-10-20 Nick Clifton <nickc@cambridge.redhat.com> + + * scripttempl/armcoff.sc: Define __EH_FRAME_BEGIN__ and + __EH_FRAME_END__ and accept eh frames into data section. + Add ctor and dtor sections. + +2001-10-19 Danny Smith <danny_r_smith_2001@yahoo.co.nz> + + * pe-dll.c (autofilter_objectlist): Add gcrt0.o. + (auto-export): Fix indentation. + +2001-10-18 Danny Smith <danny_r_smith_2001@yahoo.co.nz> + + * pe-dll.c (autofilter_objectlist): Add startup objects + for profiling. + (auto-export): Constify char * p. + Extract file basename and use strcmp rather than ststr + for object lookup. + +2001-10-18 Chris Demetriou <cgd@broadcom.com> + + * ldmain.c (get_emulation): Improve comment about the handling + of -mipsN options. + +2001-10-17 Alan Modra <amodra@bigpond.net.au> + + * po/POTFILES.in: Regenerate. + +2001-10-16 Vassili Karpov <malc@pulsesoft.com> + + * emultempl/elf32.em (gld*_list_options): Remove extra '\t' from + -z nocopyreloc and -z nocombreloc usage strings. + +2001-10-12 Vassili Karpov <malc@pulsesoft.com> + + * emultempl/elf32.em (gld*_list_options): Include -z nocopyreloc + in usage. + +2001-10-11 Aleksey Romanov <aromanov@ennovatenetworks.com> + + * scripttempl/armaout.sc: Place .bss section after end of aligned + data section to match behaviour of aout code in constructrion of + header. + +2001-10-11 Danny Smith <danny_r_smith_2001@yahoo.co.nz> + + * pe-dll.c (autofilter_entry_type autofilter_liblist: Add + startup files for mingw32 dlls to list. + +2001-10-10 Chris Demetriou <cgd@broadcom.com> + + * emultempl/elf32.em: Fix shell 'if' usage for portability. + +2001-10-08 Aldy Hernandez <aldyh@redhat.com> + + * configure.tgt (targ): Add arm9e-*-elf. + +2001-10-05 H.J. Lu <hjl@gnu.org> + + * genscripts.sh: Fix a typo in the last change. + +2001-10-05 Jakub Jelinek <jakub@redhat.com> + + * emultempl/elf32.em (gld_*_list_options): Include -z combreloc and + -z nocombreloc in usage. + +2001-10-03 Jim Blandy <jimb@redhat.com> + + * genscripts.sh: Include a comment at the top of each generated + script, explaining its purpose. + +2001-10-03 Vassili Karpov <malc@pulsesoft.com> + + * emultempl/elf32.em (parse_args): Handle -z nocopyreloc. + * NEWS: Mention -z nocopyreloc. + * ld.texinfo (Options): Describe nocopyreloc. + +2001-10-03 Alan Modra <amodra@bigpond.net.au> + + * configure: Regenerate. + +2001-10-02 Alan Modra <amodra@bigpond.net.au> + + * ldver.h (ld_program_version): Remove declaration. + * lexsup.c (parse_args): Move printing of copyright message.. + * ldver.c (ldversion): .. to here. + Use BFD_VERSION_STRING in place of BFD_VERSION. + (ld_program_version): Remove. + * Makefile.am (Makefile): Depend on bfd/configure.in. + Run "make dep-am". + * Makefile.in: Regenerate. + +2001-09-30 Hans-Peter Nilsson <hp@bitrange.com> + + * Makefile.am: Update dependencies with "make dep-am". + * Makefile.in: Regenerate. + +2001-09-29 John Reiser <jreiser@BitWagon.com> + + * ldlang.c (lang_common): Conditionally inhibit Common allocation. + * lexsup.c: Add --no-define-common commandline option. + * ldgram.y: Add INHIBIT_COMMON_ALLOCATION script command. + * ldlex.l: Likewise. + * ld.h: Add command_line.inhibit_common_definition. + * ldmain.c (main): Initialize. + * ld.texinfo: Document. + +2001-09-26 Alan Modra <amodra@bigpond.net.au> + + * ldmisc.c (USE_STDARG): Remove. + (info_msg): Define using VPARAMS, VA_OPEN, VA_FIXEDARG, VA_CLOSE. + (einfo): Likewise. + (minfo): Likewise. + (lfinfo): Likewise. + + * ldmisc.h: Remove #ifdef ANSI_PROTOTYPES and non-ansi + declarations. Update copyright. + +2001-09-24 Charles Wilson <cwilson@ece.gatech.edu> + + * pe-dll.c: Remove obsoleted declaration of + pe_get_data_import_dll_name. + (pe_create_import_fixup): Fix thinko. + + * ld.texinfo(enable-auto-import): Clarify the explanation. + +2001-09-24 Nick Clifton <nickc@cambridge.redhat.com> + + * pe-dll.c (pe_create_import_fixup): Revert previous patch. + * emultemp/pe.em (pe_data_import_dll): Move definition outside of + DLL_SUPPORT controlled code. + +2001-09-24 Charles Wilson <cwilson@ece.gatech.edu> + + * emultempl/pe.em(pe_data_import_dll): Make static. + (pe_get_data_import_dll_name): New accessor function. + * pe-dll.c(pe_create_import_fixup): call + pe_get_data_import_dll_name() from pe.em, instead of + directly accessing pe_data_import_dll variable from pe.em. + +2001-09-18 Bruno Haible <haible@clisp.cons.org> + + * deffilep.y: Include "safe-ctype.h" instead of <ctype.h>. + (def_file_add_directive): Use ISSPACE instead of isspace. + (def_lex): Use ISDIGIT/ISXDIGIT/ISALPHA/ISALNUM instead of + isdigit/isxdigit/isalpha/isalnum. + * emultempl/aix.em: Include "safe-ctype.h" instead of <ctype.h>. + (gld${EMULATION_NAME}_read_file): Use ISSPACE instead of isspace. + * emultempl/elf32.em: Include "safe-ctype.h" instead of <ctype.h>. + (gld${EMULATION_NAME}_place_orphan): Use ISALNUM instead of + isalnum. + * emultempl/gld960c.em: Include "safe-ctype.h" instead of <ctype.h>. + (gld960_set_output_arch): Use ISUPPER/TOLOWER instead of + isupper/tolower. + * emultempl/sunos.em: Include "safe-ctype.h" instead of <ctype.h>. + (gld${EMULATION_NAME}_search_dir): Use ISDIGIT instead of isdigit. + * ldctor.c: Include "safe-ctype.h" instead of <ctype.h>. + (ctor_prio): Use ISDIGIT instead of isdigit. + * ldfile.c: Include "safe-ctype.h" instead of <ctype.h>. + (ldfile_open_file_search): Use ISALPHA instead of isalpha. + (ldfile_add_arch): Use ISUPPER/TOLOWER instead of + isupper/tolower. + * ldlang.c: Include "safe-ctype.h" instead of <ctype.h>. + (stricpy): Use TOLOWER instead of isupper/tolower. + (lang_leave_overlay_section): Use ISALNUM instead of isalnum. + * ldlex.l: Include "safe-ctype.h" instead of <ctype.h>. + (lex_warn_invalid): Use ISPRINT instead of isprint. + * ldmain.c: Include "safe-ctype.h" instead of <ctype.h>. + (main): For gettext, also set the LC_CTYPE locate facet. + (add_keepsyms_file): Use ISSPACE instead of isspace. + * lexsup.c: Include "safe-ctype.h" instead of <ctype.h>. + (is_num, parse_args): Use ISDIGIT instead of isdigit. + * mpw-elfmips.c: Include "safe-ctype.h" instead of <ctype.h>. + (gldelf32ebmip_place_orphan): Use ISALNUM instead of isalnum. + * mpw-eppcmac.c: Include "safe-ctype.h" instead of <ctype.h>. + (gldppcmacos_read_file): Use ISSPACE instead of isspace. + * pe-dll.c: Include "safe-ctype.h" instead of <ctype.h>. + (quoteput): Use ISSPACE instead of isspace. + (pe_dll_generate_implib, pe_process_import_defs): Use ISALNUM + instead of isalnum. + +2001-09-18 Alan Modra <amodra@bigpond.net.au> + + * deffilep.y (def_stash_module): Constify "name" param. + + * pe-dll.c: Replace CONST with const throughout. + (quick_symbol): Constify "n1", "n2", "n3" params. + (make_singleton_name_thunk): Constify "import" param. Make + "buffer_len" a size_t. + (make_import_fixup_entry): Constify "name", "fixup_name", + "dll_symname" params. + (pe_get16): Cast args of bfd_seek. Replace bfd_read with bfd_bread. + (pe_get32): Likewise. + (pe_implied_import_dll): Likewise. + + * emultempl/beos.em (sort_by_file_name): Constify "ra", "rb". + (sort_by_section_name): Likewise. + + * emultempl/pe.em: Move defines for arm_epoc_pe before bfd.h included. + (make_import_fixup): Cast printf arg, rel->address to long rather + than int. + (gld_${EMULATION_NAME}_after_open): Don't compare NULL against int. + +2001-09-15 Alan Modra <amodra@bigpond.net.au> + + * ldmain.c (main): Rename BufferSize to ld_bufsz because HPUX + defines BufferSize. Increase buffer size by one. + +2001-09-14 Ralf Habacker <Ralf.Habacker@freenet.de> + + * pe-dll.c (pe_walk_relocs_of_symbol): Fix memory leak. + +2001-09-14 Kevin Lo <kevlo@openbsd.org> + + * configure.tgt: Add arm-openbsd target. + +2001-09-12 H.J. Lu <hjl@gnu.org> + + * Makefile.am (ALL_EMULATIONS): Move eelf64ppc.o and + eelf64lppc.o to ... + (ALL_64_EMULATIONS): Here. + * Makefile.in: Regenerated. + +2001-09-12 Paul Sokolovsky <Paul.Sokolovsky@technologist.com> + + * emultempl/pe.em(make_import_fixup): change signature to + take asection as well as arelec; we need this for proper + error reporting. Only call pe_create_import_fixup() if + there is no attempt to add a constant addend to the reloc; + otherwise, report error condition. + * pe-dll.c(pe_walk_relocs_of_symbol): change signature, + since final argument is a pointer to make_import_fixup(). + Change call to cb() to match make_import_fixup() signature. + (make_import_fixup_mark): make buffer_len unsigned. + * pe-dll.h: change signature of pe_walk_relocs_of_symbol. + +2001-09-12 Charles Wilson <cwilson@ece.gatech.edu> + + * ld.texinfo: add verbose documentation for auto-import + direct-addressing workaround, to compliment the terse + error message. + +2001-09-12 Andrew MacLeod <amacleod@redhat.com> + + * scripttempl/v850.sc: Add gcc_except_table sections. + +Fri Sep 7 11:34:24 2001 Jeffrey A Law (law@cygnus.com) + + * emulparams/h8300helf.sh: Move stack to a much higher memory address. + * emulparams/h8300self.sh: Similarly. + +2001-09-05 Danny Smith <dannysmith@users.souceforge.net> + + * ld.texinfo (Options, --stack): Correct default value for stack + reserve. + +2001-09-05 Tom Rix <trix@redhat.com> + + * emultempl/aix.em : Handle import file XMC_XO and syscall symbols. + +2001-09-03 Andreas Jaeger <aj@suse.de> + + * emultempl/beos.em: Declare prototypes for comparions functions, + adjust definitions. + +2001-09-02 Andreas Jaeger <aj@suse.de> + + * emultempl/aix.em: Add missing prototype. + * emultempl/lnk960.em: Likewise. + * emultempl/vanilla.em: Likewise. + * emultempl/armcoff.em: Likewise. + * emultempl/armelf_oabi.em: Likewise. + * emultempl/beos.em: Likewise. + * emultempl/gld960c.em: Likewise. + * emultempl/gld960.em: Likewise. + + * emulparams/elf64alpha.sh (PARSE_AND_LIST_PROLOGUE): Add parameter + for prototype declaration. + +2001-08-31 Eric Christopher <echristo@redhat.com> + Jason Eckhardt <jle@redhat.com> + + * ldmain.c (get_emulation): Add support for -mips32 and -mips64. + +2001-08-31 Andreas Jaeger <aj@suse.de> + + * emultempl/pe.em: Add missing prototypes. + (gld_${EMULATION_NAME}_after_open): Remove extra args to + pe_find_data_imports. + (pr_sym): Add unused attribute. 2001-08-29 Joel Sherrill <joel@OARcorp.com> - * configure.tgt (i[3456]86-*-rtems*, m68*-*-rtems*): Change + * configure.tgt (i[3456]86-*-rtems*, m68*-*-rtems*): Change default from coff to elf. +2001-08-29 Jeff Law <law@redhat.com> + + * emulparams/h8300helf.sh: Resync with h8300elf.sh. Update + ARCH specification. + * emulparams/h8300self.sh: Similarly. + +Wed Aug 28 13:37:20 2001 J"orn Rennecke <amylaar@redhat.com> + + * Makefile.am (ALL_EMULATIONS): Add eh8300elf.o, eh8300elf.o and + eh8300self.o . + (eh8300elf.c, eh8300helf.c, eh8300self.c): New targets. + * configure.tgt (h8300-*-elf*): New case. + * emulparams/h8300elf.sh, emulparams/h8300helf.sh: New files. + * emulparams/h8300self.sh: New file. + * Makefile.in: Regenerated. + +2001-08-28 Nick Clifton <nickc@cambridge.redhat.com> + + * ldmain.c (main): Rename BSIZE to BufferSize to avoid collision + with macro name. + +2001-08-27 Linus Nordberg <linus@swox.com> + Alan Modra <amodra@bigpond.net.au> + + * Makefile.am (ALL_EMULATIONS): Add eelf64ppc.o and eelf64lppc.o. + (eelf64ppc.c, eelf64lppc.c): Add make targets. + Run "make dep-am" + * Makefile.in: Regenerate. + * configure.tgt: Add powerpc64 support. Move pdp11, pjl, pj + entries to correct alphabetical position. + * emulparams/elf64ppc.sh: New. + * emulparams/elf64lppc.sh: New. + +2001-08-27 Nick Clifton <nickc@cambridge.redhat.com> + + * ldmain.c (main): Declare BSIZE as static. + +2001-08-23 Jakub Jelinek <jakub@redhat.com> + + * emultempl/elf32.em (place_orphan): Place orphan .rel* sections + into .rel.dyn resp. .rela.dyn if combreloc. + (get_script): If .x linker script is equal to .xn, only put it + once into the binary. + Add .xc and .xsc scripts. + (parse_args): Handle -z combreloc and -z nocombreloc. + * scripttempl/elf.sc (.rela.sbss): Fix a typo. + For .xc and .xsc scripts put all .rel* or .rela* input sections + but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn. + * genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME + is elf. + Strip trailing whitespace from script. + Generate .xc and .xsc scripts if requested. + * ldmain.c (main): Initialize link_info.combreloc and + link_info.spare_dynamic_tags. + * lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define. + (ld_options): Add --spare-dynamic-tags option. + (parse_args): Likewise. + * ld.texinfo: Document -z combreloc and -z nocombreloc. + * ldint.texinfo: Document .xc and .xsc linker scripts. + * NEWS: Add notes about -z combreloc and SHF_MERGE. + +2001-08-22 H.J. Lu <hjl@gnu.org> + + * emulparams/elf32fr30.sh: Add a newline. + +2001-08-21 Andreas Jaeger <aj@suse.de> + + * deffilep.y: Add missing prototypes. + * pe-dll.c: Likewise. + +2001-08-20 Alan Modra <amodra@bigpond.net.au> + + * ldlang.c (insert_pad): Fix typos in last patch. + + * ldlang.c: When traversing lang_statement_union_type lists, + consistently use "header.next" rather than "next". + * mpw-eppcmac.c: Likewise. + * emultempl/beos.em: Likewise. + * emultempl/hppaelf.em: Likewise. + * emultempl/pe.em: Likewise. + * ldlang.h (union lang_statement_union): Remove "next" field. + + * ldlang.c (insert_pad): Use offsetof macro. + (lang_size_sections): Always neuter padding statements. + * emultempl/hppaelf.em (hppaelf_delete_padding_statements): Delete. + + * pe-dll.c (pe_dll_fill_sections): Correct type of "relax" param + passed to lang_size_sections. + (pe_exe_fill_sections): Likewise. + * emultempl/pe.em (output_prev_sec_find): Copied from elf32.em. + (gld_${EMULATION_NAME}_place_orphan): Merge from elf32.em. + +2001-08-18 Alan Modra <amodra@bigpond.net.au> + + * emultempl/aix.em: Formatting fixes. + +2001-08-18 Alan Modra <amodra@bigpond.net.au> + + * ldlang.c (insert_pad): Make use of an existing pad statement if + available. Move code calculating alignment, adjusting section + alignment power, and adjusting dot to .. + (size_input_section): .. here. Remove unused relax param. + (lang_size_sections): Change boolean `relax' param to boolean *. + Adjust call to size_input_section. Make use of insert_pad to + place pad after the assignment statement. If relaxing, zap + padding statements. + (reset_memory_regions): Reset output_bfd section sizes too. + (relax_again): Move to.. + (lang_process): ..here. Adjust call to lang_size_sections, and + remove duplicated code. + * ldlang.h (lang_size_sections): Change `relax' param to boolean *. + +2001-08-17 Alan Modra <amodra@bigpond.net.au> + + * ld.texinfo: Document that fill values now use the four least + significant bytes. + * emulparams/elf32fr30.sh (NOP): Update. + * emulparams/elf32mcore.sh: Likewise. + * emulparams/elf64_s390.sh: Likewise. + * emulparams/elf_i386.sh: Likewise. + * emulparams/elf_i386_be.sh: Likewise. + * emulparams/elf_i386_chaos.sh: Likewise. + * emulparams/elf_i386_ldso.sh: Likewise. + * emulparams/elf_s390.sh: Likewise. + * emulparams/elf_x86_64.sh: Likewise. + * emulparams/i386moss.sh: Likewise. + * emulparams/i386nw.sh: Likewise. + * emulparams/m68kelf.sh: Likewise. + * scripttempl/elf.sc: Update NOP comment. + * scripttempl/elfi370.sc: Likewise. + * scripttempl/elfm68hc11.sc: Likewise. + * scripttempl/elfm68hc12.sc: Likewise. + * scripttempl/nw.sc: Likewise. + +2001-08-15 Tom Rix <trix@redhat.com> + + * ldgram.y (saved_script_handle): Initialize to NULL. + * ldmain.c (main): Change check on saved_script_handle. + +2001-08-14 Alan Modra <amodra@bigpond.net.au> + + * emultempl/elf32.em: Formatting fixes. + (output_prev_sec_find): Test for bfd_ind_section too; do so by + looking at sec->owner. + (output_rel_find): Move function inside LDEMUL_PLACE_ORPHAN test. + (gld${EMULATION_NAME}_place_orphan): Add a few comments. Remove + unused code, and reorganize orphan section placement code. + + * ldlang.c (wild_doit): Rename to lang_add_section. + * ldlang.h: Here too. + * mpw-elfmips.c: And here. + * emultempl/beos.em: And here. + * emultempl/elf32.em: And here. + * emultempl/hppaelf.em: And here. + * emultempl/pe.em: And here. + 2001-08-13 Richard Henderson <rth@redhat.com> * emultempl/needrelax.em: New file. @@ -25,28 +1034,284 @@ * Makefile.am (eelf64_ia64.c): Depend on it. * Makefile.in: Rebuild. +2001-08-13 Alan Modra <amodra@bigpond.net.au> + + * emultempl/elf32.em: For SEC_EXCLUDE sections, ensure that + output_section is set non-NULL. + + * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Return + `true' for SEC_EXCLUDE sections so that the generic code doesn't + needlessly create an output_section_statement. Treat a correctly + named output_section_statement with NULL bfd_section as compatible. + +2001-08-13 Hans-Peter Nilsson <hp@bitrange.com> + + * emultempl/generic.em: Support EXTRA_EM_FILE. + (ld_${EMULATION_NAME}_emulation): Support emulation parameters + LDEMUL_BEFORE_PARSE, LDEMUL_SYSLIB, LDEMUL_HLL, + LDEMUL_AFTER_PARSE, LDEMUL_AFTER_OPEN, LDEMUL_AFTER_ALLOCATION, + LDEMUL_SET_OUTPUT_ARCH, LDEMUL_CHOOSE_TARGET, + LDEMUL_BEFORE_ALLOCATION, LDEMUL_GET_SCRIPT, LDEMUL_FINISH, + LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS, + LDEMUL_OPEN_DYNAMIC_ARCHIVE, LDEMUL_PLACE_ORPHAN, + LDEMUL_SET_SYMBOLS, LDEMUL_PARSE_ARGS, LDEMUL_UNRECOGNIZED_FILE, + LDEMUL_LIST_OPTIONS, LDEMUL_RECOGNIZED_FILE, + LDEMUL_FIND_POTENTIAL_LIBRARIES. + +2001-08-12 Richard Henderson <rth@redhat.com> + + * scripttempl/elf.sc, scripttempl/elfd30v.sc, + scripttempl/elfm68hc11.sc, scripttempl/elfm68hc12.sc, + scripttempl/v850.sc: Keep .jcr data. + +2001-08-12 H.J. Lu <hjl@gnu.org> + Andrew Haley <aph@cambridge.redhat.com> + Nick Clifton <nickc@redhat.com> + + * ldgram.y (had_script): Change name to saved_script_handle. + Change type to file handle. + * ld.h (had_script): Rename and retype. + * ldfile.c (ldfile_open_command_file): Save the file handle + used in saved_script_handle. + * lexsup.c (parse_args): Do not allow -c option to alter + saved_script_handle. + * ldmain.c (main): Print out the linker script used if + --verbose is given. Check saved_script_handle to obtain the + external linker script used, or if NULL, dump the builtin + script. + * ld.texinfo: Document that --verbose now dumps the linker + script used, regardless of whether it was an internal or an + external script. + +2001-08-10 Andreas Jaeger <aj@suse.de> + + * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes + to build warnings. + * configure: Regenerate. + +2001-08-09 Alan Modra <amodra@bigpond.net.au> + + * emultempl/elf32.em (output_prev_sec_find): Add missing prototype. + + * scripttempl/elf.sc: Move non-text .dynamic section before + .plt/.got/.sdata* group. + (OTHER_GOT_SECTIONS): Move to immediately after .got. + (OTHER_SDATA_SECTIONS): Add. + * emulparams/criself.sh: Use OTHER_SDATA_SECTIONS rather than + OTHER_GOT_SECTIONS. + * emulparams/crislinux.sh: Likewise. + * emulparams/elf32b4300.sh: Likewise. + * emulparams/elf32bmip.sh: Likewise. + * emulparams/elf32bmipn32.sh: Likewise. + * emulparams/elf32bsmip.sh: Likewise. + * emulparams/elf32btsmip.sh: Likewise. + * emulparams/elf32ebmip.sh: Likewise. + * emulparams/elf32elmip.sh: Likewise. + * emulparams/elf32l4300.sh: Likewise. + * emulparams/elf32lmip.sh: Likewise. + * emulparams/elf32lsmip.sh: Likewise. + * emulparams/elf32ltsmip.sh: Likewise. + * emulparams/elf64bmip.sh: Likewise. + * emulparams/elf64btsmip.sh: Likewise. + * emulparams/elf64ltsmip.sh: Likewise. + +2001-08-08 Alan Modra <amodra@bigpond.net.au> + + * genscripts.sh: Source the emulparams script before each output + script is generated so that variables like `RELOCATING' may affect + variables defined in the emulparams script. + +2001-08-04 Alan Modra <amodra@bigpond.net.au> + + * emultempl/aix.em: ldexp.h,ldlang.h,ldfile.h,ldemul.h go in this + order. + + * emultempl/beos.em (sort_sections): Modify for 2001-08-03 change, + ie. iterate over wild_statement.section_list. + (gld${EMULATION_NAME}_place_orphan): Likewise. + +2001-08-03 Stephane Carrez <Stephane.Carrez@worldnet.fr> + + * scripttempl/elfm68hc12.sc (FINISH_CODE, FINISH_RELOC): New to handle + .fini[0-4] sections used by _exit + (CTOR, DTOR): Export ctor/dtor symbols; move them to ROM. + (*.text,*.data,*.bss): Take into account .text.*, .data.*, .bss.*. + * scripttempl/elfm68hc11.sc: Likewise. + +2001-08-03 H.J. Lu <hjl@gnu.org> + + * emultempl/beos.em (init): Add the missing initialization. + +2001-08-03 Alan Modra <amodra@bigpond.net.au> + + * ld.texinfo (Input Section Basics): Clarify ordering of output + sections. + * ldlang.c (callback_t): Add wildcard_list param. + (walk_wild_section): Remove "section" param. Rewrite for + lang_wild_statement_type change. Remove unique_section_p test. + (walk_wild_file): Remove "section" param. + (walk_wild): Remove "section" and "file" params. + (lang_gc_wild): Likewise. + (wild): Likewise. Modify for lang_wild_statement_type change. + (wild_sort): Likewise. Add "sec" param. + (gc_section_callback): Likewise. + (output_section_callback): Likewise. Do unique_section_p test. + (map_input_to_output_sections): Modify call to wild. + (lang_gc_sections_1): Likewise. + (print_wild_statement): Modify for lang_wild_statement_type + change. + (lang_add_wild): Replace filename, filenames_sorted param with + filespec. Replace section_name, sections_sorted, + exclude_filename_list with section_list. + * ldlang.h (lang_add_wild): Here too. + (lang_wild_statement_type): Replace section_name, sections_sorted, + and exclude_filename_list with section_list. + * ldgram.y (current_file): Delete. + (%union): Add wildcard_list. + (file_NAME_list): Set type to wildcard_list. Build a linked list + rather than calling lang_add_wild for each entry. + (input_section_spec_no_keep): Call lang_add_wild here instead. + * ld.h (struct wildcard_list): Declare. + * mri.c (mri_draw_tree): Modify to suit new lang_add_wild. + +2001-08-02 Charles Wilson <cwilson@ece.gatech.edu> + + * ldmain.c (main): initialize link_info.pei386_auto_import + * pe-dll.c: new tables for auto-export filtering + (auto_export): change API, pass abfd for contextual filtering. + Loop thru tables of excluded symbols instead of comparing + "by hand". + +2001-08-02 Paul Sokolovsky <paul.sokolovsky@technologist.com> + + * pe-dll.c: new variable pe_dll_enable_extra_debug. New + static variable current_sec (static struct sec *). Add + forward declaration for add_bfd_to_link. + (process_def_file): Don't export undefined symbols. Do not + export symbols starting with "_imp__". Call auto_export() + with new API. + (pe_walk_relocs_of_symbol): New function. + (generate_reloc): add optional extra debugging + (pe_dll_generate_def_file): eliminate extraneous initial blank + line in output + (make_one): enlarge symtab to make room for __nm__ symbols + (DATA auto-import support). + (make_singleton_name_thunk): New function. + (make_import_fixup_mark): New function. + (make_import_fixup_entry): New function. + (pe_create_import_fixup): New function. + (add_bfd_to_link): Specify that 'name' argument is a CONST + char *. + * pe-dll.h: declare new variable pe_dll_extra_pe_debug; + declare new functions pe_walk_relocs_of_symbol and + pe_create_import_fixup. + * emultempl/pe.em: add new options --enable-auto-import, + --disable-auto-import, and --enable-extra-pe-debug. + (make_import_fixup): New function. + (pe_find_data_imports): New function. + (pr_sym): New function. + (gld_${EMULATION_NAME}_after_open): Add optional extra pe + debugging. Call pe_find_data_imports. Mark .idata as DATA, not + CODE. + +2001-08-02 Charles Wilson <cwilson@ece.gatech.edu> + + * ld.texinfo: add additional documentation for + --export-all-symbols. Document --out-implib, + --enable-auto-image-base, --disable-auto-image-base, + --dll-search-prefix, --enable-auto-import, and + --disable-auto-import. + * ldint.texinfo: Add detailed documentation on auto-import + implementation. + 2001-07-30 Nick Clifton <nickc@cambridge.redhat.com> * ld.texinfo (Simple Assignments): Fix computation in SECTIONS example. -2001-07-19 David O'Brien <obrien@FreeBSD.org> +2001-07-24 Alan Modra <amodra@bigpond.net.au> - * emultempl/elf32.em: Do not assuming that contents of the buffer - returned from basename function will remain unchanged accross other - function calls. + * Makefile.am: Update dependencies with "make dep-am". + * Makefile.in: Regenerate + +2001-07-23 Alan Modra <amodra@bigpond.net.au> + + * ldcref.c (check_section_sym_xref): New function. + (check_nocrossrefs): Call it. + (check_nocrossref): Interate over h->refs here instead of.. + (check_refs): ..here. Pass in the symbol name, section, and bfd + rather than hash_entry pointers. + (struct check_refs_info): Keep symbol name rather than hash entry. + Remove "same". + (check_reloc_refs): Tweak for above changes in check_refs_info. + Only report references to section syms when symname is NULL to + prevent duplicate messages for the same reloc. 2001-07-19 Nick Clifton <nickc@cambridge.redhat.com> + * ldexp.c (exp_print_tree): Use stderr if config.map_file is not + available. Do not print NULL trees. + (exp_print_token): Print unknown tokens with values > 126 as + decimal values not ASCII characters. + * ldlang.c (lang_leave_overlay): If a region is specified assign it to all sections inside the overlay unless they have been assigned to the own, non-default, memory region. + * README: Add header for consistency with other README files. + +2001-07-14 H.J. Lu <hjl@gnu.org> + + * emultempl/elf32.em (output_prev_sec_find): Never return + bfd_abs_section_ptr, bfd_com_section_ptr nor + bfd_und_section_ptr. + +2001-07-14 Nick Clifton <nickc@cambridge.redhat.com> + + * Makefile.am (em32relf.c): Change dependency from generic.em to + elf32.em. + * Makefile.in: Regenerate. + 2001-07-14 matthew green <mrg@eterna.com.au> * configure.tgt (i386-*-netbsdelf*): New target. (i386-*-netbsd*): Set targ_extra_emuls to `elf_i386' +2001-07-13 Jakub Jelinek <jakub@redhat.com> + + * emultempl/elf32.em (output_prev_sec_find): New. + (place_orphan): Use it. + +2001-07-11 H.J. Lu <hjl@gnu.org> + + * ldmain.c (main): Fix typos in the last change. + +2001-07-11 Jakub Jelinek <jakub@redhat.com> + + * ldmain.c (main): Disallow -F and -f without -shared. + +2001-07-11 Nick Clifton <nickc@cambridge.redhat.com> + + * emultempl/pe.em (after_open): Check for the output_bfd not + having any coff_data structure allocated to it. + +2001-07-09 David O'Brien <obrien@FreeBSD.org> + + * emultempl/elf32.em: Do not assuming that contents of the buffer + returned from basename function will remain unchanged accross other + function calls. + +2001-07-03 H.J. Lu <hjl@gnu.org> + + * scripttempl/elf.sc (DYNAMIC_PAD): Revert the change made on + 2001-07-03. It creates dynamic entries even for static binaries. + +2001-07-03 Jakub Jelinek <jakub@redhat.com> + + * scripttempl/elf.sc (DYNAMIC_PAD): New variable. + (DYNAMIC): Use it to reserve few dynamic entries for + post-linking tools. + 2001-06-27 Alan Modra <amodra@bigpond.net.au> * emulparams/hppa64linux.sh: New file. @@ -56,87 +1321,236 @@ Run "make dep-am". * Makefile.in: Regenerate. -2001-06-07 Andreas Jaeger <aj@suse.de> +2001-06-21 Hans-Peter Nilsson <hp@axis.com> - * elf_x86_64.sh (NONPAGED_TEXT_START_ADDR): Increase. - (TEXT_START_ADDR): Likewise. + * ld.texinfo (Options, -r): Mention restrictions when using + different object formats. -2001-06-11 Alan Modra <amodra@bigpond.net.au> +2001-06-19 Hans-Peter Nilsson <hp@axis.com> - Merge from mainline. - 2001-06-05 Danny Smith <danny_r_smith_2001@yahoo.co.nz> - * emultempl/pe.em (init): Reduce default stack reserve to 0x200000. + * ldlang.c (lang_check): Emit fatal error if relocatable link + between different object flavours with relocations in input. - 2001-05-25 Alan Modra <amodra@one.net.au> - * configure.host: Replace linuxoldld with linux*oldld. - * configure.tgt: Likewise. +2001-06-19 H.J. Lu <hjl@gnu.org> - 2001-05-14 DJ Delorie <dj@delorie.com> - * Makefile.am (ld.dvi): Search bfd/doc for texinfo files. - * Makefile.in: Ditto. + * ld.texinfo (-E, --export-dynamic): Mention --version-script. + (--version-script): Mention the language support. - 2001-04-05 Steven J. Hill <sjhill@cotw.com> - * Makefile.am (ALL_EMULATIONS): Add eelf32ltsmip.o. - (ALL_64_EMULATIONS): Add eelf64btsmip.o and eelf64ltsmip.o. - (eelf32ltsmip.c): New target. - (eelf64btsmip.c): Likewise. - (eelf64ltsmip.c): Likewise. +2001-06-19 H.J. Lu <hjl@gnu.org> + + * ldlang.c (lang_check): Revert the change mode on 2001-06-15. + +2001-06-18 H.J. Lu <hjl@gnu.org> + + * Makefile.am (ld.1): Remove the prefix `$(srcdir)/'. + (diststuff): Add $(MANS). * Makefile.in: Regenerated. - * configure.tgt (mips*el-*-linux-gnu): Uses traditional MIPS - target. - (mips*-*-linux-gnu*): Likewise. - * emulparams/elf32ltsmip.sh: New. Traditional little endian - MIPS taget. - * emulparams/elf64btsmip.sh: New. Traditional 64bit big endian - target. - * emulparams/elf64ltsmip.sh: New. Traditional 64bit little - endian target. - 2001-02-27 Alan Modra <alan@linuxcare.com.au> - * configure.in (BFD_VERSION): New. - (AM_INIT_AUTOMAKE): Use $BFD_VERSION. - * configure: Regenerate. + * ld.1: Removed. - 2001-02-13 H.J. Lu <hjl@gnu.org> - * ldexp.h (node_type): Add etree_provided. - * ldexp.c (exp_fold_tree): Handle etree_provided. Set the node - type to etree_provided if defined by PROVIDE. Allow updating - for etree_provided. - (exp_print_tree): Handle etree_provided. - * mpw-elfmips.c (gldelf32ebmip_find_exp_assignment): Handle - etree_provided. +2001-06-18 Hans-Peter Nilsson <hp@axis.com> -2001-06-10 Philip Blundell <philb@gnu.org> + * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): + Update for API change in bfd_elf${ELFSIZE}_size_dynamic_sections. + * mpw-elfmips.c (gldelf32ebmip_before_allocation): Ditto. + * ld.h (args_type): Remove member export_dynamic. All users + changed to use struct bfd_link_info member. - * configure.in: Set version to 2.11.1. - * configure: Regenerate. + * Makefile.am (ecriself.c, ed10velf.c, ei386moss.c): Depend on + $(srcdir)/emultempl/elf32.em, not $(srcdir)/emultempl/generic.em. + * Makefile.in: Regenerate. + +2001-06-18 H.J. Lu <hjl@gnu.org> + + * ldlang.c (init_os): Add the newline to the einfo call. + (lang_check): Likewise. + (lang_do_version_exports_section): Likewise. + +2001-06-15 H.J. Lu <hjl@gnu.org> + + * lexsup.c (parse_args); Save optind to report unrecognized + option. + +2001-06-15 Hans-Peter Nilsson <hp@axis.com> + + * ldlang.c (lang_check): Emit fatal error if relocatable link + between different object flavours. + + * lexsup.c (parse_args) <case OPTION_EXPORT_DYNAMIC, case 'E'>: + Set new link_info member export_dynamic. + * ldmain.c (main): Initialize new link_info member export_dynamic. + +2001-06-12 Nick Clifton <nickc@cambridge.redhat.com> + + * ldlang.c (walk_wild): Only call walk_wild_file if + lookup_name returns something. + (lookup_name): If load_symbols fails, return NULL. + (load_symbols): Change to a boolean function. + (open_input_bfds): If load_symbols fails then do not make the + executable. 2001-06-08 Alan Modra <amodra@bigpond.net.au> * ldlang.c (record_bfd_errors): Remove. - Merge from mainline. - 2001-05-31 H.J. Lu <hjl@gnu.org> + * emultempl/aix.em: Fix copyright dates. + +2001-06-07 Andreas Jaeger <aj@suse.de> + + * elf_x86_64.sh (NONPAGED_TEXT_START_ADDR): Increase. + (TEXT_START_ADDR): Likewise. + +2001-06-06 Martin Schwidefsky <schwidefsky@de.ibm.com> + + * configure.host: Set HOSTING_CRT0/HOSTING_LIBS correctly for s/390. + +2001-06-05 Danny Smith <danny_r_smith_2001@yahoo.co.nz> + + * emultempl/pe.em (init): Reduce default stack reserve to 0x200000. + +2001-05-31 H.J. Lu <hjl@gnu.org> + * ldlang.c (open_input_bfds): Don't change the bfd error handler whilst loading symbols. - 2001-05-02 Nick Clifton <nickc@redhat.com> - * emultempl/aix.em: Replace buystring with xstrdup. - * emultempl/beos.em: Replace buystring with xstrdup. +2001-05-28 Nick Clifton <nickc@cambridge.redhat.com> + + * configure.tgt: Remove i370-mvs architecture, it is not currently + supported. + +2001-05-25 H.J. Lu <hjl@gnu.org> + + * emulparams/ppcmacos.sh: Add SYSCALL_MASK and SYMBOL_MODE_MASK + like emulparams/aixppc.sh. + +2001-05-25 H.J. Lu <hjl@gnu.org> + + * emultempl/beos.em (gld${EMULATION_NAME}_before_parse): Move + setting of output_filename after bfd_scan_arch. + * emultempl/pe.em: Likewise. + +2001-05-25 H.J. Lu <hjl@gnu.org> + + * emulparams/aixrs6.sh: Add SYSCALL_MASK and SYMBOL_MODE_MASK + like emulparams/aixppc.sh. + + * emultempl/aix.em (sc): Use ${srcdir}/emultempl/ostring.sed + instead of ${srcdir}/emultempl/stringify.sed. + +2001-05-25 Timothy Wall <twall@oculustech.com> -2001-06-07 Alan Modra <amodra@bigpond.net.au> + * emulparams/elf64_aix.sh: Change settings to match IBM linker + output. - * Many files: Update copyright notices. +2001-05-25 Alan Modra <amodra@one.net.au> -2001-05-23 Alan Modra <amodra@one.net.au> + * configure.host: Replace linuxoldld with linux*oldld. + * configure.tgt: Likewise. + +2001-05-24 H.J. Lu <hjl@gnu.org> + + * emultempl/stringify.sed: Removed again. + +2001-05-24 H.J. Lu <hjl@gnu.org> + + * emultempl/aix.em (OUTPUT_ARCH): Defined. + (gld${EMULATION_NAME}_before_parse): Initialize + ldfile_output_architecture, ldfile_output_machine and + ldfile_output_machine_name from ${OUTPUT_ARCH} if possible. + * emultempl/beos.em: Likewise. + * emultempl/elf32.em: Likewise. + * emultempl/linux.em: Likewise. + * emultempl/mipsecoff.em: Likewise. + * emultempl/pe.em: Likewise. + * emultempl/sunos.em: Likewise. + +2001-05-24 Tom Rix <trix@redhat.com> + + * emultempl/aix.em : (gld${EMULATION_NAME}_read_file) + udate import file format. + (change_symbol_mode) New, same + (is_syscall) New, same + * emulparams/aixppc.sh : add SYSCALL_MASK and SYMBOL_MODE_MASK + * emulparams/aixppc64.sh : same + * emulparams/aixrs6.sh : same + * emulparams/ppcmacos.sh : same + * emultempl/aix.em : use strtoull to parse options + * Makefile.am : add eaixppc64 emulation for xcoff64 + * Makefile.in : same + * configure.tgt : same + + * scripttempl/aix.sc : default text section offset to 0x10000000 + default data section offset to 0x20000000 + add .sv3264 and .sv64 pseudo sections + loader and debug sections use the currect section offset. + + * emultempl/aix.em : Add xcoff64 support + Add -binitfini support + (gld${EMULATION_NAME}_before_parse) -binitfini + (gld${EMULATION_NAME}_parse_args) same + (gld${EMULATION_NAME}_before_allocation) format change for special + sections + + * emulparams/aixppc64.sh : New file for xcoff64 support + +2001-05-23 Alexandre Oliva <aoliva@redhat.com> + + * emultempl/elf32.em (ELF_INTERPRETER_SET_DEFAULT): Use this new + variable to avoid non-portable shell construct. + +2001-05-23 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + + * ldmain.c (get_emulation): Add -mips5 command line argument. + +2001-05-22 Alexandre Oliva <aoliva@redhat.com> + + * emulparams/elf_i386_ldso.sh: New, copied from elf_i386.sh. + (ELF_INTERPRETER_NAME): Define it. + * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Use + it. + * configure.tgt (targ_emul, targ_extra_emuls) + [i[3456]86-*-solaris2*, i[3456]86-*-solaris*]: Use elf_i386_ldso + as primary, elf_i386 as extra. + * Makefile.am (ALL_EMULATIONS): Added eelf_i386_ldso.o. + (eelf_i386_ldso.c): New rule. + * Makefile.in: Rebuilt. + +2001-05-22 Nick Clifton <nickc@redhat.com> + + * lexsup.c (ld_options): Allow -I to be an alias for + --dynamic-linker. This is for Solaris compatability. + * ld.texinfo: Document that -I can be used. + * ld.1: Regenerate. + +2001-05-16 Alan Modra <amodra@one.net.au> * ldlang.c (wild_doit): Use linker_has_input to reliably determine whether an input section is the first one assigned to an output section. Assorted formatting fixes. - Merge from mainline. - 2001-05-03 H.J. Lu <hjl@gnu.org> +2001-05-14 DJ Delorie <dj@delorie.com> + + * Makefile.am (ld.dvi): Search bfd/doc for texinfo files. + * Makefile.in: Ditto. + +2001-05-11 Jakub Jelinek <jakub@redhat.com> + + * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Put + .gnu.linkonce.ia64unw{,i} sections into corresponding .IA_64.unwind* + output sections. + * emulparams/elf64_aix.sh (OTHER_READONLY_SECTIONS): Likewise. + +2001-05-11 Jakub Jelinek <jakub@redhat.com> + + * ldlang.c (lang_process): Call bfd_merge_sections. + +2001-05-07 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + + * ldgram.y: Fix typo. + +2001-05-03 H.J. Lu <hjl@gnu.org> + * emultempl/elf32.em: Include "libiberty.h". (gld${EMULATION_NAME}_vercheck): Call basename () to get the basename of the bfd filename. @@ -144,22 +1558,32 @@ (gld${EMULATION_NAME}_try_needed): Likewise. (gld${EMULATION_NAME}_open_dynamic_archive): Likewise. - 2001-03-17 Ulrich Drepper <drepper@redhat.com> - * emultmpl/elf32.em (OPTION_GROUP): New macro. - Add new option Bgroup to longopts. - (gld*_parse_args): Handle GROUP_OPTION and recognize -z defs. - (gld*_list_options): Add -Bgroup and -z defs. - * ld.1: Document -Bgroup and -z defs. - * ld.texinfo: Likewise. +2001-05-02 H.J. Lu <hjl@gnu.org> - 2001-02-01 Nick Clifton <nickc@redhat.com> - * ld.1: Replace occurances of -oformat with --oformat. + * emultempl/pe.em: Include <ctype.h>. + +2001-05-02 Johan Rydberg <jrydberg@opencores.org> + + * emulparams/elf32openrisc.sh: New file. + + * Makefile.am: Add OpenRISC target. + * Makefile.in: Regenerated. + + * configure.tgt: Add openrisc-*-* mapping. + +2001-05-02 Nick Clifton <nickc@redhat.com> + + * emultempl/aix.em: Replace buystring with xstrdup. + * emultempl/beos.em: Replace buystring with xstrdup. + +2001-05-02 H.J. Lu <hjl@gnu.org> - 2001-05-02 H.J. Lu <hjl@gnu.org> * ldfile.c: Include "libiberty.h". * ldlex.l: Likewise. + * ldmisc.c (buystring): Removed. * ldmisc.h: Likewise. + * ldfile.c: Replace buystring with xstrdup. * ldlang.c: Likewise. * ldlex.l: Likewise. @@ -168,16 +1592,73 @@ * lexsup.c: Likewise. * mpw-eppcmac.c: Likewise. - 2001-04-28 Paul Sokolovsky <Paul.Sokolovsky@technologist.com> +2001-04-30 Andreas Jaeger <aj@suse.de> + + * emulparms/elf_x86_64.sh (MAXPAGESIZE): Fix value. + +2001-04-28 Paul Sokolovsky <Paul.Sokolovsky@technologist.com> + * ldlang.c (load_symbols): Give emulation a chance to process unrecognized file before fatal error is reported, not after. - 2001-02-26 H.J. Lu <hjl@gnu.org> - * ldlang.c (open_input_bfds): Set the bfd error handler so - that problems can be caught whilst loading symbols. - (record_bfd_errors): New function: Report BFD errors and mark - the executable output as being invalid. +2001-04-27 Sean McNeil <sean@mcneil.com> + + * configure.tgt: Add arm-vxworks target. + * scripttempl/armcoff.sc: Support .text or .data as a section name + prefix. + Define _etext. + +2001-04-13 J.T. Conklin <jtc@redback.com> + + * ld.texinfo: Document --fatal-warnings. + * ld.1: Regenerate. + + * ldmisc.c (vfinfo): Set flag to inhibit making executable if + warnings have been turned into errors. + * lexsup.c (OPTION_WARN_FATAL): Define. + (ld_options): Entry for --fatal-warnings. + (parse_args): Handle OPTION_WARN_FATAL. + * ld.h (ld_config_type): Add fatal_warnings field. + +2001-04-13 Jakub Jelinek <jakub@redhat.com> + + * ldmain.c (main): Default to discard_sec_merge. + * lexsup.c (OPTION_DISCARD_NONE): Define. + (ld_options): Add --discard-none. + (parse_args): Handle OPTION_DISCARD_NONE. + * ldlang.c (wild_doit): SEC_MERGE should be set in the output + section only if SEC_MERGE and SEC_STRINGS flags and entsize of + all its input sections match. + +2001-04-05 Steven J. Hill <sjhill@cotw.com> + + * Makefile.am (ALL_EMULATIONS): Add eelf32ltsmip.o. + (ALL_64_EMULATIONS): Add eelf64btsmip.o and eelf64ltsmip.o. + (eelf32ltsmip.c): New target. + (eelf64btsmip.c): Likewise. + (eelf64ltsmip.c): Likewise. + * Makefile.in: Regenerated. + + * configure.tgt (mips*el-*-linux-gnu): Uses traditional MIPS + target. + (mips*-*-linux-gnu*): Likewise. + + * emulparams/elf32ltsmip.sh: New. Traditional little endian + MIPS taget. + * emulparams/elf64btsmip.sh: New. Traditional 64bit big endian + target. + * emulparams/elf64ltsmip.sh: New. Traditional 64bit little + endian target. + +2001-04-05 Hans-Peter Nilsson <hp@axis.com> + + * emulparams/criself.sh (EXECUTABLE_SYMBOLS): Cannot provide + correct value of __Stext here. + (TEXT_START_SYMBOLS): Define; always define __Stext, to start of + .startup section. + + * emulparams/crislinux.sh: Remove FIXME. 2001-04-02 Alan Modra <alan@linuxcare.com.au> @@ -194,45 +1675,118 @@ * emulparams/hppalinux.sh (MAXPAGESIZE): Set to 0x4000. (TEXT_START_ADDR, TARGET_PAGE_SIZE): Ditto. +2001-03-26 Andreas Jaeger <aj@suse.de> + + * ld.texinfo (Overview): Fix syntax in texi code. + +2001-03-25 Stephane Carrez <Stephane.Carrez@worldnet.fr> + + * ld.texinfo: Put @c man indications to generate the ld man page. + When generating man, define all the variables. Define SEEALSO + and SYNOPSIS. Re-organize some lines to avoid the cross references. + * Makefile.am (MANCONF, TEXI2POD, POD2MAN): New variables. + (ld.1): Generate from ld.texinfo. + * Makefile.in: Regenerate. + +2001-03-23 Mark Elbrecht <snowball3@bigfoot.com> + + * scripttempl/i386go32.sc: Support the GCC flags '-ffunction-sections' + and '-fdata-sections'. Set the VMA of STABS sections to zero. + 2001-03-17 Ulrich Drepper <drepper@redhat.com> * emultmpl/elf32.em (gld${EMULATION_NAME}_search_needed): If NAME is an absolute path look only for this file and not along the path. -2001-03-16 Philip Blundell <philb@gnu.org> +2001-03-17 Ulrich Drepper <drepper@redhat.com> - * configure: Regenerate. + * emultempl/elf32.em (OPTION_GROUP): New macro. + Add new option Bgroup to longopts. + (gld*_parse_args): Handle GROUP_OPTION and recognize -z defs. + (gld*_list_options): Add -Bgroup and -z defs. + * ld.1: Document -Bgroup and -z defs. + * ld.texinfo: Likewise. -2001-03-11 Philip Blundell <philb@gnu.org> +2001-03-07 Michael Meissner <meissner@redhat.com> - * configure.in: Set version to 2.11. + * scripttempl/elfd10v.sc (.rodata,.rodata1,.data1,.sdata): Deal + with sections created by -fdata-sections. + (.dynbss,.bss): Ditto. 2001-03-05 Alan Modra <alan@linuxcare.com.au> * emultempl/m68kelf.em (m68k_elf_after_allocation): Call after_allocation_default, not gld..._before_allocation. -001-02-18 David O'Brien <obrien@FreeBSD.org> +2001-02-27 Alan Modra <alan@linuxcare.com.au> + + * configure.in (BFD_VERSION): New. + (AM_INIT_AUTOMAKE): Use $BFD_VERSION. + * configure: Regenerate. + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + +2001-02-26 Timothy Wall <twall@cygnus.com> + + * emulparams/elf64_aix.sh: Add additional read-only sections; + uncomment lines which are now required. + +2001-02-26 H.J. Lu <hjl@gnu.org> + + * ldlang.c (open_input_bfds): Set the bfd error handler so + that problems can be caught whilst loading symbols. + (record_bfd_errors): New function: Report BFD errors and mark + the executable output as being invalid. + +2001-02-22 Timothy Wall <twall@cygnus.com> + + * configure.host: Add configuration for ia64-*-aix*. + * Makefile.am (ALL_64_EMULATIONS): Add emulation for ia64-*-aix*. + Add dependencies for eelf64_aix.c. + * Makefile.in: Regenerate. + * configure.tgt: Add ia64-*-aix* mapping. + * emulparams/elf64_aix.sh: Add settings for elf64 on aix5. + * testsuite/ld-bootstrap/bootstrap.exp: Exclude ia64 flavor from + AIX-specific test. + +2001-02-20 H.J. Lu <hjl@gnu.org> + + * ldfile.c (ldfile_open_file): Set entry->search_dirs_flag to + false if we found the file. + +2001-02-18 David O'Brien <obrien@FreeBSD.org> * configure.tgt: Add FreeBSD/Alpha, FreeBSD/x86-64, FreeBSD/ia64, FreeBSD/PowerPC, FreeBSD/arm, and FreeBSD/sparc64 entries. +2001-02-18 lars brinkhoff <lars@nocrew.org> + + * Makefile.am: Add PDP-11 target. + * configure.tgt: Likewise. + * emulparams/pdp11.sh: New file. + 2001-02-17 David O'Brien <obrien@FreeBSD.org> * configure.host: Add a generic FreeBSD configuration entry such that all [modern] FreeBSD systems on all platforms will look the same. +2001-02-14 H.J. Lu <hjl@gnu.org> + + * configure.tgt: Remove mention of earmelf_linux26. + 2001-02-13 Richard Henderson <rth@redhat.com> * emulparams/elf64_ia64.sh (OTHER_GOT_SYMBOLS): Remove. -2001-02-11 Philip Blundell <philb@gnu.org> +2001-02-13 H.J. Lu <hjl@gnu.org> - * Makefile.am: Remove mention of earmelf_linux26.o. - * Makefile.in: Regenerate. - * emulparams/armelf_linux.sh (TEXT_START_ADDR): Set to 0x8000. - * emulparams/armelf_linux26.sh: Delete. - * configure.tgt: Remove mention of armelf_linux26 emulation. + * ldexp.h (node_type): Add etree_provided. + * ldexp.c (exp_fold_tree): Handle etree_provided. Set the node + type to etree_provided if defined by PROVIDE. Allow updating + for etree_provided. + (exp_print_tree): Handle etree_provided. + * mpw-elfmips.c (gldelf32ebmip_find_exp_assignment): Handle + etree_provided. 2001-02-09 David Mosberger <davidm@hpl.hp.com> @@ -240,6 +1794,36 @@ .IA_64.unwind.* pattern to unwind table section and .IA_64.unwind_info* pattern to unwind info section. +2001-02-09 Martin Schwidefsky <schwidefsky@de.ibm.com> + + * Makefile.am: Add linux target for S/390. + * Makefile.in: Likewise. + * configure.host: Likewise. + * configure.tgt: Likewise. + * emulparams/elf64_s390.sh: New file. + * emulparams/elf_s390.sh: New file. + +2001-02-09 Jakub Jelinek <jakub@redhat.com> + + * configure.tgt (sparc64-*-linux-gnu*): Add elf32_sparc into + targ_extra_libpath. + (sparc-*-linux-gnu*): Add elf64_sparc into targ_extra_libpath. + +2001-02-06 Philip Blundell <philb@gnu.org> + + * Makefile.am: Remove mention of earmelf_linux26. + * Makefile.in: Regenerate. + +2001-02-04 Philip Blundell <philb@gnu.org> + + * emulparams/armelf_linux.sh (TEXT_START_ADDR): Set to 0x8000. + * emulparams/armelf_linux26.sh: Delete. + * configure.tgt: Remove mention of armelf_linux26 emulation. + +2001-02-01 Nick Clifton <nickc@redhat.com> + + * ld.1: Replace occurances of -oformat with --oformat. + 2001-01-25 Jim Driftmyer <jdrift@stny.rr.com> * ldlang.c (lang_leave_overlay): Don't set lma_region when diff --git a/contrib/binutils/ld/ChangeLog-9197 b/contrib/binutils/ld/ChangeLog-9197 index a89a4ca..291326d 100644 --- a/contrib/binutils/ld/ChangeLog-9197 +++ b/contrib/binutils/ld/ChangeLog-9197 @@ -16,8 +16,8 @@ Thu Dec 11 09:00:15 1997 Michael Meissner <meissner@cygnus.com> d30velf_o to d30v_o to work in DOS environments. * Makefile.{am,in}: Ditto. - * emulparams/d30v_{o,e}: Rename from d30velf_{o,e}. - * emulparams/d30velf_{o,e}: Deleted. + * emulparams/d30v_{o,e}.sh: Rename from d30velf_{o,e}. + * emulparams/d30velf_{o,e}.sh: Deleted. Wed Dec 10 17:40:08 1997 Nick Clifton <nickc@cygnus.com> @@ -907,7 +907,7 @@ Fri Nov 1 10:01:27 1996 Ian Lance Taylor <ian@cygnus.com> Thu Oct 31 09:28:59 1996 Jeffrey A Law (law@cygnus.com) - * scriptempl/v850.sc (zdata): Handle reszdata, romzdata and + * scripttempl/v850.sc (zdata): Handle reszdata, romzdata and romzbss too. Tue Oct 29 12:33:05 1996 Martin M. Hunt <hunt@pizza.cygnus.com> @@ -925,9 +925,9 @@ Mon Oct 28 15:37:00 1996 Doug Evans <dje@canuck.cygnus.com> Wed Oct 23 16:17:22 1996 Jeffrey A Law (law@cygnus.com) - * scriptempl/v850.sc (zdata): Fix typo "zrodata" -> "rozdata". + * scripttempl/v850.sc (zdata): Fix typo "zrodata" -> "rozdata". - * scriptempl/v850.sc (zdata): Make sure this stays + * scripttempl/v850.sc (zdata): Make sure this stays in lo-memory. Tue Oct 22 11:36:47 1996 Jeffrey A Law (law@cygnus.com) @@ -935,7 +935,7 @@ Tue Oct 22 11:36:47 1996 Jeffrey A Law (law@cygnus.com) * scripttempl/v850.sc (__ep): Put it at the start of the tda section. - * scriptempl/v850.sc: Move all "normal" sections into + * scripttempl/v850.sc: Move all "normal" sections into the external memory region (0x100000 - 0x200000). Mon Oct 21 17:16:59 1996 Michael Meissner <meissner@wogglebug.tiac.net> @@ -1050,7 +1050,7 @@ Thu Oct 3 15:41:24 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) Wed Oct 2 23:45:25 1996 Geoffrey Noer <noer@cygnus.com> - * emultmpl/pe.em: increase size of stack reserve to 0x2000000 + * emultempl/pe.em: increase size of stack reserve to 0x2000000 (necessary in order to compile parse.c in gcc sources under NT) Wed Oct 2 14:49:10 1996 Ian Lance Taylor <ian@cygnus.com> @@ -1690,7 +1690,7 @@ Thu May 9 08:52:23 1996 Rob Savoye <rob@chinadoll.cygnus.com> Tue May 7 10:56:11 1996 Doug Evans <dje@canuck.cygnus.com> - * scripttempl/pe.em (gld${EMULATION_NAME}_place_orphan): New function. + * emultempl/pe.em (gld${EMULATION_NAME}_place_orphan): New function. (gld${EMULATION_NAME}_place_section): New function. (hold_{section,use,text,rdata,data}): New static locals. (ld_${EMULATION_NAME}_emulation): Update orphan field. @@ -2036,8 +2036,8 @@ Wed Mar 6 18:08:18 1996 Ian Lance Taylor <ian@cygnus.com> * ldemul.c (ldemul_unrecognized_file): New function. * ldlang.c (load_symbols): If a file can not be recognized, call ldemul_unrecognized_file before trying it as a linker script. - * aix.em (gld${EMULATION_NAME}_unrecognized_file): New static - function. + * emultempl/aix.em (gld${EMULATION_NAME}_unrecognized_file): New + static function. (gld${EMULATION_NAME}_read_file): Use FOPEN_RT, not "r". (ld_${EMULATION_NAME}_emulation): Initialize unrecognized_file. @@ -2787,9 +2787,9 @@ Mon Oct 16 19:11:13 1995 Ian Lance Taylor <ian@cygnus.com> * Makefile.in (ALL_EMULATIONS): Add eaixppc.o and eaixrs6.o. (eaixppc.c, eaixrs6.c): New targets. -Fri Oct 13 14:00:37 1995 steve chamberlain <sac@slash.cygnus.com> +Fri Oct 13 14:00:37 1995 Steve Chamberlain <sac@slash.cygnus.com> - * scripttemp/pe.sc (.reloc): Move to the end. + * scripttempl/pe.sc (.reloc): Move to the end. Tue Oct 10 17:53:22 1995 Ian Lance Taylor <ian@cygnus.com> @@ -2819,7 +2819,7 @@ Fri Oct 6 16:26:16 1995 Ken Raeburn <raeburn@cygnus.com> Mon Sep 25 22:49:32 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - * ld/ld.1: Fix formatting bugs. + * ld.1: Fix formatting bugs. Wed Oct 4 17:37:46 1995 Ian Lance Taylor <ian@cygnus.com> @@ -2947,7 +2947,7 @@ Fri Sep 15 23:28:05 1995 Andrew Cagney <cagney@highland.com.au> Thu Sep 12 12:50:49 1995 steve chamberlain <sac@slash.cygnus.com> - * scripttemp/pe.sc: Allow both spellings of .ctors/.dtors. + * scripttempl/pe.sc: Allow both spellings of .ctors/.dtors. Start .text section on the right boundary. Always align stabs. @@ -3026,7 +3026,7 @@ Wed Sep 6 14:42:11 1995 Ian Lance Taylor <ian@cygnus.com> * dep-in.sed: Use @SRCDIR@, not @srcdir@. * genscripts.sh: Create ldscripts if it does not exist. * ldemul.c, lexsup.c, mpw-emipsidt.c: Don't include "config.h". - * mpw-esh.c, emultemp/*.em: Likewise. + * mpw-esh.c, emultempl/*.em: Likewise. * ldmain.c: Likewise. Include <ctype.h>. Don't try to set HAVE_SBRK here. * config/*.mt, config/*.mh: Remove. @@ -3408,7 +3408,7 @@ Sun Jun 11 15:20:46 1995 Ken Raeburn <raeburn@cujo.cygnus.com> Thu Jun 8 14:17:33 1995 Steve Chamberlain <sac@slash.cygnus.com> - * emulparams/armpe.sh, scriptempl/armpe.sc: Add end and stack. + * emulparams/armpe.sh, scripttempl/armpe.sc: Add end and stack. Mon Jun 5 02:16:24 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com> @@ -4060,8 +4060,11 @@ Tue Sep 27 14:56:20 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) instead of RUNTEST_CC, and likewise for CXX. (cdtest targets): Comment out. * config/solaris2.mh (HOSTING_LIBS): Only mention crtend.o once. - * cdtest-bar.cc, cdtest-foo.cc, cdtest-foo.h: Remove. - * cdtest-main.cc, cdtest.exp: Remove. + * testsuite/ld-cdtest/cdtest-bar.cc, + testsuite/ld-cdtest/cdtest-foo.cc, + testsuite/ld-cdtest/cdtest-foo.h, + testsuite/ld-cdtest/cdtest-main.cc, + testsuite/ld-cdtest/cdtest.exp: Remove. Mon Sep 26 11:40:30 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) @@ -4659,8 +4662,8 @@ Thu Jun 9 00:17:20 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Thu Jun 2 17:24:08 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Add support for SunOS shared libraries. - * aout.sc: Don't define __DYNAMIC here. Add new sections used by - shared library support code. + * scripttempl/aout.sc: Don't define __DYNAMIC here. Add new + sections used by shared library support code. * emultempl/sunos.em: New file. * emulparams/sun4.sh (TEMPLATE_NAME): Define as sunos. * emulparams/sun3.sh (TEMPLATE_NAME): Likewise. @@ -4709,7 +4712,7 @@ Fri May 27 12:25:33 1994 Ken Raeburn (raeburn@cujo.cygnus.com) * emultempl/generic.em: Find emultempl/stringify.sed in ${srcdir}. - * cdtest-bar.cc: Renamed from cdtest-func.cc. + * testsuite/ld-cdtest/cdtest-bar.cc: Renamed from cdtest-func.cc. * Makefile.in: Noted change. * scripttempl/a29k.sc: Don't include /lab3/u3/..../segments.o; I @@ -4718,14 +4721,14 @@ Fri May 27 12:25:33 1994 Ken Raeburn (raeburn@cujo.cygnus.com) Wed May 11 22:32:00 1994 DJ Delorie (dj@ctron.com) - * configure.bat: update to latest makefile.in - * emulpara/go32.sh: set to coff-go32 not aout - * emultemp/generic.em: strength-reduce the structure of + * configure.bat: update to latest Makefile.in + * emulparams/go32.sh: set to coff-go32 not aout + * emultempl/generic.em: strength-reduce the structure of this shell script, since the only available shell for DOS can't handle complex syntax. - * emultemp/stringify.sed: for "sed -f" instead of inline. - * makefile.in: depend on stringify.sed as well as genscripts.sh - * scripttemp/go32coff.sc: correct for djgpp 1.11's COFF format + * emultempl/stringify.sed: for "sed -f" instead of inline. + * Makefile.in: depend on stringify.sed as well as genscripts.sh + * scripttempl/go32coff.sc: correct for djgpp 1.11's COFF format * genscripts.sh: empty variables aren't always considered "set", so set them to "y" instead. @@ -4799,8 +4802,9 @@ Wed May 11 18:16:46 1994 Ken Raeburn (raeburn@cujo.cygnus.com) * ldver.c (ldversion): Updated version number. - * cdtest-foo.cc: Use explicit "#pragma implementation". - * cdtest-bar.cc: Renamed from cdtest-func.cc. + * testsuite/ld-cdtest/cdtest-foo.cc: Use explicit "#pragma + implementation". + * testsuite/ld-cdtest/cdtest-bar.cc: Renamed from cdtest-func.cc. * Makefile.in: References to cdtest-func.o changed to cdtest-bar.o. @@ -5026,7 +5030,7 @@ Wed Mar 23 14:15:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) lang_do_assignments and lang_size_sections until relax_again becomes false. - * emultemp/gld960.em: Include libiberty.h + * emultempl/gld960.em: Include libiberty.h (gld960_before_parse): Pass NULL as final argument to concat. Tue Mar 22 13:08:28 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) @@ -5074,7 +5078,7 @@ Mon Mar 21 18:28:37 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) (cdtest-ur, cdtest-ur.out): New targets. (check-cdtest): Now also check that -Ur works correctly. - * scripttemp/alpha.sc: Align all sections to 16 byte boundaries. + * scripttempl/alpha.sc: Align all sections to 16 byte boundaries. Thu Mar 17 12:45:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) @@ -5097,8 +5101,8 @@ Tue Mar 8 04:22:27 1994 David J. Mackenzie (djm@rtl.cygnus.com) Mon Mar 7 15:23:24 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - * elf.sc: Permit TEXT_START_SYMBOLS and DATA_START_SYMBOLS to be - defined. + * scripttempl/elf.sc: Permit TEXT_START_SYMBOLS and + DATA_START_SYMBOLS to be defined. * emulparams/elf32mipb.s (TEXT_START_SYMBOLS): Define _ftext. (DATA_START_SYMBOLS): Define _fdata. @@ -5432,7 +5436,7 @@ Mon Jan 10 19:49:05 1994 David J. Mackenzie (djm@thepub.cygnus.com) Fri Jan 7 20:00:24 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - * scripttempl/elf.c: Define __bss_start before the .sbss section. + * scripttempl/elf.sc: Define __bss_start before the .sbss section. Thu Jan 6 00:13:10 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) @@ -5591,10 +5595,10 @@ Thu Dec 16 21:19:57 1993 Jeffrey A. Law (law@snake.cs.utah.edu) * ldsym.c (write_file_locals): Use strncmp rather than a character comparison for lprefix. - * emultmpl/m88kbcs.em (before_parse): Set lprefix and lprefix_len + * emultempl/m88kbcs.em (before_parse): Set lprefix and lprefix_len correctly. - * emultmpl/hppaosf.em: Include ldexp.h. + * emultempl/hppaosf.em: Include ldexp.h. (before_parse): Set lprefix and lprefix_len correctly. Tue Dec 14 17:19:03 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) @@ -6323,10 +6327,12 @@ Wed Jun 16 11:45:32 1993 David J. Mackenzie (djm@thepub.cygnus.com) * Move *.em to emultempl/*.em. Move *.sh to emulparams/*.sh. Move *.sc-sh to scripttempl/*.sc. * {emultempl,emulparams,scripttempl}/README: New files. - * sh.em, st2000.em, z8ksim.em, h8300hms.em, h8500hms.em: Files - removed, replaced with generic.em. - * h8300.sh, h8500.sh, h8300.sc, h8500.sc: Renamed from - h8[35]00hms.s[ch]. Change their contents to omit the "hms". + * emultempl/sh.em, emultempl/st2000.em, emultempl/z8ksim.em, + emultempl/h8300hms.em, emultempl/h8500hms.em: Files removed, + replaced with generic.em. + * emulparams/h8300.sh, emulparams/h8500.sh, scripttempl/h8300.sc, + scripttempl/h8500.sc: Renamed from h8[35]00hms.s[ch]. Change + their contents to omit the "hms". * *.em (*_get_script): Return script name instead of script contents. * ldlang.c (lang_process): Change caller. @@ -6354,9 +6360,10 @@ Tue Jun 15 23:04:46 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) * Makefile.in (INCLUDES): Look in ../include, not ../bfd. - * aout.sc-sh: Add SHLIB_PATH like STACKZERO. Make STACKZERO - dependent on RELOCATING, not RELOCATION. - * hp3hpux.sh (SHLIB_PATH): Define it. + * scripttempl/aout.sc, emulparams/aout.sh: Add SHLIB_PATH like + STACKZERO. Make STACKZERO dependent on RELOCATING, not + RELOCATION. + * emulparams/hp3hpux.sh (SHLIB_PATH): Define it. Mon Jun 14 19:06:15 1993 David J. Mackenzie (djm@thepub.cygnus.com) @@ -6374,10 +6381,12 @@ Thu Jun 10 14:00:06 1993 Ian Lance Taylor (ian@cygnus.com) * ldgram.y (statement_list_opt): New nonterminal, either empty or statement_list. (section): Use statement_list_opt, not statement_list. - * m68kcoff.sc-sh: Gather constructors and destructors and define - __CTOR_LIST__ and __DTOR_LIST__ appropriately. - * sa29200.sc-sh: Gather constructors and destructors and define - ___CTOR_LIST__ and ___DTOR_LIST__ appropriately. + * scripttempl/m68kcoff.sc, emulparams/m68kcoff.sh: Gather + constructors and destructors and define __CTOR_LIST__ and + __DTOR_LIST__ appropriately. + * scripttempl/sa29200.sc, emulparams/sa29200.sh: Gather + constructors and destructors and define ___CTOR_LIST__ and + ___DTOR_LIST__ appropriately. Mon Jun 7 12:53:28 1993 Per Bothner (bothner@rtl.cygnus.com) @@ -6395,7 +6404,8 @@ Fri Jun 4 08:50:14 1993 Ian Lance Taylor (ian@cygnus.com) * configure.in (mips-idt-ecoffl*): New target; use mips-idtl. (mips-idt-ecoff*): Added trailing '*'. * config/mips-idtl.mt: New file; use EMUL of mipsidtl. - * mipsidtl.sh: New file; like mipsidt.sh, but little endian. + * emulparams/mipsidtl.sh: New file; like mipsidt.sh, but little + endian. * Makefile.in (ALL_EMULATIONS): Added em_mipsidtl.o. * config/sun3.mh (HOSTING_LIBS, HOSTING_EMU): Removed obsolete and @@ -6415,16 +6425,17 @@ Tue May 25 15:34:25 1993 Ian Lance Taylor (ian@cygnus.com) Thu May 20 13:56:16 1993 Per Bothner (bothner@deneb.cygnus.com) - * mips.sc-sh: Define _etext, _edata, and _end, in addition - to etext, edata, and end. Needed for IRIX 4.0.5F. - Patch from mwp@iconix.oz.au (Michael Paddon). + * scripttempl/mips.sc, emulparams/mips.sh: Define _etext, _edata, + and _end, in addition to etext, edata, and end. Needed for IRIX + 4.0.5F. Patch from mwp@iconix.oz.au (Michael Paddon). * Version 2.2.1 released. Thu May 20 11:42:06 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) - * mipsbsd.sc-sh: Renamed from aout-mipsbsd.sc-sh. - * mipsbsd.sh (EMULATION_NAME): Use new file name. + * scripttempl/mipsbsd.sc, emulparams/mipsbsd.sh: Renamed from + aout-mipsbsd.sc-sh. + * emulparams/mipsbsd.sh (EMULATION_NAME): Use new file name. Tue May 18 17:10:24 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) @@ -6443,7 +6454,8 @@ Mon May 17 12:44:31 1993 Per Bothner (bothner@cygnus.com) Fri May 14 11:26:24 1993 Ian Lance Taylor (ian@cygnus.com) - * mips.sc-sh: Don't define BSS_VAR unless relocating. + * scripttempl/mips.sc, emulparams/mips.sh: Don't define BSS_VAR + unless relocating. Wed May 12 13:33:29 1993 Ian Lance Taylor (ian@cygnus.com) @@ -6455,11 +6467,12 @@ Tue May 4 21:58:56 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) * configure.in: Look for ${target_makefile_frag} relative to ${srcdir}, not relative to build directory. - * hppaosf.em, hppaosf.sc-sh, hppaosf.sh: New files. + * emultempl/hppaosf.em, scripttempl/hppaosf.sc, + emulparams/hppaosf.sh: New files. * configure.in: Recognize hppa*-hp-osf. * Makefile.in (ALL_EMULATIONS): Include hppaosf emulation. (em_hppaosf.c): Build it. - * config/hppaosf.mh, hppaosf.mt: New files. + * config/hppaosf.mh, config/hppaosf.mt: New files. * ld.h (ALIGN_N): Renamed from ALIGN, because that conflicted with some system header files. All uses changed. @@ -6468,26 +6481,27 @@ Tue May 4 21:58:56 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) targets. * configure.in: Recognize m68*-*-hpux. - * aout.sc-sh: If STACKZERO and RELOCATING are both defined, output + * scripttempl/aout.sc: If STACKZERO and RELOCATING are both defined, output the value of STACKZERO. * Makefile.in (ALL_EMULATIONS): Include hp300-hpux emulation. (em_hp3hpux.c): Build it. - * hp3hpux.sh, config/hp300hpux.mt: New files. + * emulparams/hp3hpux.sh, config/hp300hpux.mt: New files. Tue May 4 12:37:35 1993 Ian Lance Taylor (ian@cygnus.com) - * mips.sc-sh: Put constructors in the .data section. + * scripttempl/mips.sc: Put constructors in the .data section. * Makefile.in (cdtest): Added dependency on ld.new. Mon May 3 19:43:39 1993 Per Bothner (bothner@cygnus.com) * Makefile.in: Change definition of $(tooldir) to match FSF. - * vax.sh, config/vax.mt, configure.in, Makefile.in: + * emulparams/vax.sh, config/vax.mt, configure.in, Makefile.in: Support VAX Ultrix and BSD. Mon Apr 26 18:35:47 1993 Steve Chamberlain (sac@thepub.cygnus.com) - * sh.em, sh.sh, sh.sc-sh: New files supporting Hitachi SH. + * emultempl/sh.em, emulparams/sh.sh, scripttempl/sh.sc: New + files supporting Hitachi SH. Wed Apr 14 21:01:51 1993 John Gilmore (gnu@cygnus.com) @@ -6559,7 +6573,7 @@ Thu Mar 4 12:44:33 1993 Ian Lance Taylor (ian@cygnus.com) * mips.sc-sh: Added variables which may be overridden by a specific emulation. - * mipsidt.sh: New file; emulation for IDT MIPS board. + * emulparams/mipsidt.sh: New file; emulation for IDT MIPS board. * Makefile.in (ALL_EMULATIONS): Added em_mipsidt.o. (em_mipsidt.c): New target. Uses mipsidt.sh and mips.sc-sh. * config/mips-idt.mt: New file; sets EMUL to mipsidt. @@ -6567,9 +6581,9 @@ Thu Mar 4 12:44:33 1993 Ian Lance Taylor (ian@cygnus.com) Sat Feb 27 00:00:14 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) - * aout-mipsbsd.sc-sh, mipsbsd.sh: New files from Ralph Campbell, - ralphc@pyramid.com. - * i386bsd.sh, config/i386bsd.mt: New files. + * aout-mipsbsd.sc-sh, emulparams/mipsbsd.sh: New files from Ralph + Campbell, ralphc@pyramid.com. + * emulparams/i386bsd.sh, config/i386bsd.mt: New files. * configure.in, Makefile.in: Added support for mipsbsd and 386bsd. Thu Feb 25 15:33:10 1993 Per Bothner (bothner@rtl.cygnus.com) @@ -6596,7 +6610,7 @@ Thu Feb 18 17:58:45 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) Wed Feb 3 09:05:56 1993 Ian Lance Taylor (ian@cygnus.com) - * mipsbig.sh: New file. Big endian MIPS emulation. + * emulparams/mipsbig.sh: New file. Big endian MIPS emulation. * config/mips-big.mt: New file. Use mipsbig emulation. * configure.in (mips-sgi-irix*): Use target mips-big. * Makefile.in (ALL_EMULATIONS): Added em_mipsbig.o. @@ -6638,7 +6652,7 @@ Fri Jan 22 14:22:44 1993 Ian Lance Taylor (ian@cygnus.com) * mips.sc-sh: New file. Ultrix, and hopefully other MIPS ECOFF targets, linker script. - * mipslit.sh: New file. Little endian MIPS emulation. + * emulparams/mipslit.sh: New file. Little endian MIPS emulation. * config/mips-lit.mt: New file. Use mipslit emulation. * configure.in (mips-dec-ultrix*): Use target mips-lit. * Makefile.in (ALL_EMULATIONS): Added em_mipslit.o. @@ -6692,8 +6706,8 @@ Wed Jan 6 01:08:37 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) Mon Dec 28 11:15:35 1992 Ian Lance Taylor (ian@cygnus.com) - * m68kcoff.sc-sh: define _end as well as end, for consistency with - aout.sc-sh. + * scripttempl/m68kcoff.sc, emulparams/m68kcoff.sh: define _end as + well as end, for consistency with aout.sc-sh. * configure.in: accept *-ericsson-ose for any m68k CPU. @@ -6705,7 +6719,7 @@ Mon Dec 21 16:06:59 1992 Per Bothner (bothner@rtl.cygnus.com) * ldexp.c, ldlang.c, ldmain.c, ldsym.c, ldwarn.c: Use new macro bfd_asymbol_bfd as appropriate. * Makefile.in: Un-duplicate ldlex.c dependency. - * condigure.in: Replace my_host case table by sourcing + * configure.in: Replace my_host case table by sourcing ../bfd/configure.host. Allow std-host as the default. * ldmisc.c: Change logic for C++ name demangling: There is no initial '_' to remove from stab-derived function names. @@ -6757,8 +6771,8 @@ Thu Nov 5 05:43:01 1992 John Gilmore (gnu@cygnus.com) Tue Oct 20 10:56:06 1992 Ian Lance Taylor (ian@cygnus.com) - * m68kcoff.sc-sh: don't use initial underscores for etext, edata - and end. + * scripttempl/m68kcoff.sc, emulparams/m68kcoff.sh: don't use + initial underscores for etext, edata and end. Mon Oct 19 09:45:38 1992 Ian Lance Taylor (ian@cygnus.com) @@ -6792,8 +6806,9 @@ Tue Oct 6 13:08:54 1992 Ian Lance Taylor (ian@cygnus.com) Mon Oct 5 14:07:37 1992 Ian Lance Taylor (ian@cygnus.com) - * aout.sc-sh, m68kcoff.sc-sh: set __bss_start to the start of the - .bss segment. + * scripttempl/aout.sc, emulparams/aout.sh, + scripttempl/m68kcoff.sc, emulparams/m68kcoff.sh: set __bss_start + to the start of the .bss segment. Mon Oct 5 08:55:14 1992 Steve Chamberlain (sac@thepub.cygnus.com) @@ -6832,7 +6847,8 @@ Fri Sep 25 13:49:52 1992 Ken Raeburn (raeburn@kyriath.cygnus.com) Fri Sep 25 11:08:01 1992 Steve Chamberlain (sac@thepub.cygnus.com) Added initial support for the z8k - * z8ksim.em, z8ksim.sc-sh, z8ksim.sh: new files + * emultempl/z8ksim.em, z8ksim.sc-sh, emulparams/z8ksim.sh: new + files. * configure.in, Makefile.in: modified to reflect above * ldlang.c (lang_check): when linking conflicting architectures, @@ -6850,16 +6866,18 @@ Fri Sep 11 10:24:22 1992 Steve Chamberlain (sac@thepub.cygnus.com) Wed Sep 9 11:52:58 1992 Ian Lance Taylor (ian@cygnus.com) - * Makefile.in, m68kcoff.sh, m68kcoff.sc-sh, config/m68k-coff.mt: - added m68k-coff emulation mode, stolen from a29k emulation. - Almost certainly wrong, but perhaps better than sun3. + * Makefile.in, emulparams/m68kcoff.sh, scripttempl/m68kcoff.sc, + emulparmas/m68kcoff.sh, config/m68k-coff.mt: added m68k-coff + emulation mode, stolen from a29k emulation. Almost certainly + wrong, but perhaps better than sun3. Thu Sep 3 14:19:30 1992 Per Bothner (bothner@rtl.cygnus.com) - * Makefile.in, Makefile.dos, generic.em, genscripts.sh, - gld960.em, h8300hms.em, h8300xray.em, lnk960.em, st2000.em, - vanilla.em: Rename all (generated) ld__*.c files to em_.c. - This is one character shorter, and lets people build on + * Makefile.in, Makefile.dos, emultempl/generic.em, genscripts.sh, + emultempl/gld960.em, emultempl/h8300hms.em, + emultempl/h8300xray.em, emultempl/lnk960.em, emultempl/st2000.em, + emultempl/vanilla.em: Rename all (generated) ld__*.c files to + em_.c. This is one character shorter, and lets people build on SVR3 system. (ld__h8300xray.[co] was the killer there; h8300xray.sc-sh is also overlong, but seems harmless.) Based on a patch from Jonathan Ryshpan <hitachi!amito!jon>. @@ -6904,8 +6922,8 @@ Sun Aug 30 18:12:13 1992 Per Bothner (bothner@rtl.cygnus.com) Thu Aug 27 16:38:42 1992 Ian Lance Taylor (ian@cygnus.com) - * gld960.em (gld960_choose_target): default to little endian, not - big endian. + * emultempl/gld960.em (gld960_choose_target): default to little + endian, not big endian. Wed Aug 26 17:28:51 1992 Steve Chamberlain (sac@thepub.cygnus.com) @@ -6913,7 +6931,7 @@ Wed Aug 26 17:28:51 1992 Steve Chamberlain (sac@thepub.cygnus.com) abs_output_section is what is required. * ldwrite.c (ldwrite): use malloc to allocate the largest space used, and pass that down. - * relax.c,relax.h (write_relaxnorel): use the passed malloc area rather + * relax.c, relax.h (write_relaxnorel): use the passed malloc area rather than alloca. Mon Aug 24 14:42:06 1992 Ian Lance Taylor (ian@cygnus.com) @@ -6951,7 +6969,8 @@ Fri Aug 7 12:31:10 1992 Steve Chamberlain (sac@thepub.cygnus.com) (lang_enter_output_section_statement): set the field from the NOLOAD keyword * ldgram.y: new synax for NOLOAD. Removes a shift/reduce too. - * h8300hms.sc-sh, h8300hms.em: get -r right. + * scripttempl/h8300hms.sc, emulparams/h8300.sh, + emultempl/h8300hms.em: get -r right. Thu Aug 6 18:35:21 1992 Per Bothner (bothner@rtl.cygnus.com) @@ -6960,10 +6979,13 @@ Thu Aug 6 18:35:21 1992 Per Bothner (bothner@rtl.cygnus.com) Tue Aug 4 21:12:29 1992 Per Bothner (bothner@rtl.cygnus.com) - * cdtest-main.cc, cdtest-func.cc, cdtest-foo.h, cdtest-foo.cc, - cdtest.exp: A test program (copied from libg++/test-install) - that tests that constructor and destructors are handled - corrrectly. + * testsuite/ld-cdtest/cdtest-main.cc, + testsuite/ld-cdtest/cdtest-func.cc, + testsuite/ld-cdtest/cdtest-foo.h, + testsuite/ld-cdtest/cdtest-foo.cc, + testsuite/ld-cdtest/cdtest.exp: A test program (copied from + libg++/test-install) that tests that constructor and destructors + are handled corrrectly. Mon Aug 3 14:58:19 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) @@ -7006,8 +7028,9 @@ Wed Jul 1 17:51:19 1992 Steve Chamberlain (sac@thepub.cygnus.com) Thu Jun 18 09:38:56 1992 Steve Chamberlain (sac@thepub.cygnus.com) - * h8300hms.em, h8300hms.sc-sh: do the right thing for -r - * ldexp.c: lint + * emultempl/h8300hms.em, scripttempl/h8300hms.sc, + emulparams/h83000.sh: do the right thing for -r + * ldexp.c: lint * ldlang.c(open_output): set the target arch and machine as soon as we can. (lang_size_sections): use new macros for setting vma * ldwrite.c: lint @@ -7166,11 +7189,12 @@ Sat Apr 4 17:44:06 1992 Steve Chamberlain (sac@thepub.cygnus.com) * ldlex.l, ldgram.y, ldlex.h: Rewrote lexer. Now it's much nicer. * h8300*: fix bit rot and add support for h8300xray target - * go32.sh: target emulation for go32. + * emulparams/go32.sh: target emulation for go32. Mon Mar 16 14:53:29 1992 Steve Chamberlain (sac@rtl.cygnus.com) - * gld960.em, i960.sc-sh. Fix i960 bit rot + * emultempl/gld960.em, scripttempl/i960.sc, + emulparamns/i960.sh. Fix i960 bit rot Fri Mar 13 19:47:22 1992 K. Richard Pixley (rich@cygnus.com) @@ -7375,7 +7399,8 @@ Mon Dec 9 16:26:43 1991 Per Bothner (bothner at cygnus.com) * Makefile.in: Pass -y to bison. (Again; accidentally deleted by Rich.) - * news.sc, ldgld68k.sc: Define __end as well as _end. + * scripttempl/news.sc, scripttempl/ldgld68k.sc: Define __end as + well as _end. Sat Dec 7 17:19:26 1991 Steve Chamberlain (sac at rtl.cygnus.com) @@ -7434,7 +7459,7 @@ Wed Nov 13 15:17:43 1991 Per Bothner (bothner at cygnus.com) Tue Nov 12 18:36:50 1991 Steve Chamberlain (sac at cygnus.com) * Makefile.in: Take out the version number for install - * m88kbcs.sc: put in contructor blocks. + * scripttempl/m88kbcs.sc: put in contructor blocks. Mon Nov 11 18:47:33 1991 Per Bothner (bothner at cygnus.com) @@ -7500,7 +7525,7 @@ Fri Oct 11 22:40:46 1991 John Gilmore (gnu at cygnus.com) Fri Oct 11 16:42:22 1991 Per Bothner (bothner at cygnus.com) - * news.sc: Add alignment for data segment. + * scripttempl/news.sc: Add alignment for data segment. * ldtemplate: Add (yet another) script to get for -n or -N options. (These need different alignment than ZMAGIC files.) * Makefile.in: Add stuff for new foo.xn scripts. @@ -7534,7 +7559,6 @@ Fri Oct 11 04:24:45 1991 John Gilmore (gnu at cygnus.com) Restructure configuration scheme for bfd, binutils, ld. - * include/sys/h-*.h: Move to bfd/hosts/h-*.h. * configure.in: Revise to symlink sysdep.h to ../bfd/hosts/h-xxx.h. Change some config names to match other dirs. * *.c: Include bfd.h before sysdep.h, so ansidecl and PROTO() @@ -7552,8 +7576,9 @@ Tue Oct 8 16:00:57 1991 Per Bothner (bothner at cygnus.com) This is primarily intended for cross-linking, where you would place libaries in a different place than native libraries. Also, emulations made from ldtemplate now use $(srcdir). - * ldglda29k.sc: Change SEARCH_DIR commands to a conventional - form; people can use the Makefile's LIB_PATH to override. + * scripttempl/ldglda29k.sc: Change SEARCH_DIR commands to a + conventional form; people can use the Makefile's LIB_PATH to + override. Tue Oct 8 14:51:21 1991 Roland H. Pesch (pesch at cygnus.com) diff --git a/contrib/binutils/ld/ChangeLog-9899 b/contrib/binutils/ld/ChangeLog-9899 index 1f6533a..866e4a0 100644 --- a/contrib/binutils/ld/ChangeLog-9899 +++ b/contrib/binutils/ld/ChangeLog-9899 @@ -46,7 +46,7 @@ Wed Nov 3 23:31:19 1999 Jeffrey A Law (law@cygnus.com) 1999-10-27 Andreas Jaeger <aj@suse.de> - * ld/configure.host: Added HOSTING_CRT0, HOSTING_LIBS for + * configure.host: Added HOSTING_CRT0, HOSTING_LIBS for target "mips*-*-linux-gnu*". 1999-10-27 Scott Bambrough <scottb@netwinder.org> @@ -187,7 +187,7 @@ Mon Sep 13 00:17:18 1999 Jeffrey A Law (law@cygnus.com) 1999-09-12 Ian Lance Taylor <ian@zembu.com> - * pe.em: Don't include "../bfd/libbfd.h". + * emultempl/pe.em: Don't include "../bfd/libbfd.h". (gld_${EMULATION_NAME}_after_open): Use xmalloc rather than bfd_alloc. @@ -291,7 +291,7 @@ Wed Sep 8 00:07:39 1999 Jeffrey A Law (law@cygnus.com) 1999-09-03 Scott Bambrough <scottb@netwinder.org> - * ld/configure.host: Added HOSTING_CRT0, HOSTING_LIBS for + * configure.host: Added HOSTING_CRT0, HOSTING_LIBS for target "arm*-*-linux-gnu*" 1999-09-04 Steve Chamberlain <sac@pobox.com> @@ -330,7 +330,7 @@ Thu Sep 2 14:32:03 1999 Jeffrey A Law (law@cygnus.com) * configure.tgt (arm-*-netbsd*): New target. * Makefile.am (ALL_EMULATIONS): Add earmnbsd.o. (earmnbsd.c): New rule with deps. - * Makefile.on: Regenerate. + * Makefile.in: Regenerate. * emulparams/armnbsd.sh: New file. 1999-08-23 Nick Clifton <nickc@cygnus.com> @@ -683,7 +683,7 @@ Mon Jun 14 10:38:36 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> (..._before_allocation): Pass the value of the new variable no_pipeline_knowledge to bfd_elf32_arm_process_before_allocation. - * emultemp/armelf_oabi.em (..._before_allocation): Pass zero as + * emultempl/armelf_oabi.em (..._before_allocation): Pass zero as the third parameter to bfd_elf32_arm_process_before_allocation. 1999-05-28 Nick Clifton <nickc@cygnus.com> @@ -1270,7 +1270,7 @@ Wed Nov 4 16:39:18 1998 Nick Clifton <nickc@cygnus.com> * configure.tgt: Add support for FR30 target. * Makefile.in: Regenerate. * emulparams/fr30.sh: New file. - * scripttemp/fr30.sc: New file. + * scripttempl/fr30.sc: New file. Mon Nov 2 14:47:15 1998 Catherine Moore <clm@cygnus.com> @@ -1740,7 +1740,7 @@ Tue Apr 21 23:12:40 1998 Tom Tromey <tromey@scribbles.cygnus.com> (po/POTFILES.in): New target. (ld_new_LDADD): Added INTLLIBS. (ld_new_DEPENDENCIES): Added INTLDEPS. - * po/Make-in, po/POTFILES.in, po/gas.pot: New files. + * po/Make-in, po/POTFILES.in, po/ld.pot: New files. Tue Apr 21 23:07:07 1998 Ian Lance Taylor <ian@cygnus.com> diff --git a/contrib/binutils/ld/Makefile.am b/contrib/binutils/ld/Makefile.am index 0408dfb..1d59e83 100644 --- a/contrib/binutils/ld/Makefile.am +++ b/contrib/binutils/ld/Makefile.am @@ -41,6 +41,14 @@ MKDEP = gcc -MM # What version of the manual to build DOCVER = gen +# Options to extract the man page from ld.texinfo +MANCONF = -Dman + +TEXI2POD = perl $(BASEDIR)/etc/texi2pod.pl + +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@ @@ -110,6 +118,7 @@ ALL_EMULATIONS = \ earmcoff.o \ earmelf.o \ earmelf_linux.o \ + earmelf_nbsd.o \ earmelf_oabi.o \ earmnbsd.o \ earmpe.o \ @@ -148,17 +157,24 @@ ALL_EMULATIONS = \ eelf32lppc.o \ eelf32lppcsim.o \ eelf32mcore.o \ + eelf32openrisc.o \ eelf32ppc.o \ eelf32ppclinux.o \ eelf32ppcsim.o \ + eelf32xstormy16.o \ eelf_i386.o \ eelf_i386_be.o \ eelf_i386_chaos.o \ + eelf_i386_ldso.o \ + eelf_s390.o \ egld960.o \ egld960coff.o \ eh8300.o \ eh8300h.o \ eh8300s.o \ + eh8300elf.o \ + eh8300helf.o \ + eh8300self.o \ eh8500.o \ eh8500b.o \ eh8500c.o \ @@ -192,6 +208,7 @@ ALL_EMULATIONS = \ em68kaux.o \ em68kcoff.o \ em68kelf.o \ + em68kelfnbsd.o \ em68klinux.o \ em68klynx.o \ em68knbsd.o \ @@ -208,6 +225,7 @@ ALL_EMULATIONS = \ enews.o \ ens32knbsd.o \ epc532macha.o \ + epdp11.o \ epjelf.o \ epjlelf.o \ eppcmacos.o \ @@ -219,6 +237,8 @@ ALL_EMULATIONS = \ eshelf.o \ eshelf_linux.o \ eshlelf_linux.o \ + eshelf_nbsd.o \ + eshlelf_nbsd.o \ eshl.o \ eshlelf.o \ eshpe.o \ @@ -241,14 +261,21 @@ ALL_EMULATIONS = \ ez8002.o ALL_64_EMULATIONS = \ + eelf64_aix.o \ eelf64_ia64.o \ eelf_x86_64.o \ + eelf64_s390.o \ eelf64_sparc.o \ eelf64alpha.o \ + eelf64alpha_nbsd.o \ eelf64bmip.o \ eelf64btsmip.o \ eelf64ltsmip.o \ eelf64hppa.o \ + eelf64mmix.o \ + emmo.o \ + eelf64ppc.o \ + eelf64lppc.o \ ehppa64linux.o ALL_EMUL_EXTRA_OFILES = \ @@ -305,7 +332,7 @@ stringify.sed: ${srcdir}/emultempl/$(STRINGIFY) # These all start with e so 'make clean' can find them. -GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${exec_prefix} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" +GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed @TDIRS@ @@ -335,6 +362,11 @@ earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} armelf_linux "$(tdir_armelf_linux)" +earmelf_nbsd.c: $(srcdir)/emulparams/armelf_nbsd.sh \ + $(srcdir)/emulparams/armelf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \ + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} armelf_nbsd "$(tdir_armelf_nbsd)" earmaoutb.c: $(srcdir)/emulparams/armaoutb.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS} ${GENSCRIPTS} armaoutb "$(tdir_armaoutb)" @@ -392,13 +424,13 @@ ecrisaout.c: $(srcdir)/emulparams/crisaout.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/crisaout.sc ${GEN_DEPENDS} ${GENSCRIPTS} crisaout "$(tdir_cris)" ecriself.c: $(srcdir)/emulparams/criself.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} criself "$(tdir_cris)" ecrislinux.c: $(srcdir)/emulparams/crislinux.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} crislinux "$(tdir_cris)" ed10velf.c: $(srcdir)/emulparams/d10velf.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfd10v.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfd10v.sc ${GEN_DEPENDS} ${GENSCRIPTS} d10velf "$(tdir_d10v)" ed30velf.c: $(srcdir)/emulparams/d30velf.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfd30v.sc ${GEN_DEPENDS} @@ -415,6 +447,10 @@ edelta68.c: $(srcdir)/emulparams/delta68.sh \ 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 \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \ + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf32xstormy16 "$(tdir_xstormy16)" eelf32fr30.c: $(srcdir)/emulparams/elf32fr30.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32fr30 "$(tdir_fr30)" @@ -422,7 +458,7 @@ eelf32mcore.c: $(srcdir)/emulparams/elf32mcore.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32mcore "$(tdir_mcore)" em32relf.c: $(srcdir)/emulparams/m32relf.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} m32relf "$(tdir_m32r)" eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} @@ -434,76 +470,121 @@ 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/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)" eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)" eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh \ $(srcdir)/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/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)" eelf32ltsmip.c: $(srcdir)/emulparams/elf32ltsmip.sh \ + $(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ltsmip "$(tdir_elf32ltsmip)" eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)" eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \ + $(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)" eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \ $(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/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)" eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)" eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \ + $(srcdir)/emulparams/elf32ppc.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32lppc "$(tdir_elf32lppc)" eelf32lppcsim.c: $(srcdir)/emulparams/elf32lppcsim.sh \ + $(srcdir)/emulparams/elf32lppc.sh $(srcdir)/emulparams/elf32ppc.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32lppcsim "$(tdir_elf32lppcsim)" eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \ + $(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \ $(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/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)" eelf32ppcsim.c: $(srcdir)/emulparams/elf32ppcsim.sh \ + $(srcdir)/emulparams/elf32ppc.sh \ $(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/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} + ${GENSCRIPTS} elf64ppc "$(tdir_elf64ppc)" +eelf64lppc.c: $(srcdir)/emulparams/elf64lppc.sh \ + $(srcdir)/emulparams/elf64ppc.sh $(srcdir)/emultempl/ppc64elf.em \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64lppc "$(tdir_elf64lppc)" eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfi370.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32i370 "$(tdir_elf32i370)" eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)" +eelf64alpha_nbsd.c: $(srcdir)/emulparams/elf64alpha_nbsd.sh \ + $(srcdir)/emulparams/elf64alpha.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64alpha_nbsd "$(tdir_elf64alpha_nbsd)" eelf64hppa.c: $(srcdir)/emulparams/elf64hppa.sh \ + $(srcdir)/emulparams/hppa64linux.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64hppa "$(tdir_elf64hppa)" +eelf64_aix.c: $(srcdir)/emulparams/elf64_aix.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64_aix "$(tdir_elf64_aix)" eelf64_ia64.c: $(srcdir)/emulparams/elf64_ia64.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_ia64 "$(tdir_elf64_ia64)" +eelf64_s390.c: $(srcdir)/emulparams/elf64_s390.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64_s390 "$(tdir_elf64_s390)" eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_sparc "$(tdir_elf64_sparc)" eelf64bmip.c: $(srcdir)/emulparams/elf64bmip.sh \ + $(srcdir)/emulparams/elf32bmipn32.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64bmip "$(tdir_elf64bmip)" +eelf64mmix.c: $(srcdir)/emulparams/elf64mmix.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/mmix-elfnmmo.em \ + $(srcdir)/emultempl/mmixelf.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64mmix "$(tdir_elf64mmix)" +emmo.c: $(srcdir)/emulparams/mmo.sh $(srcdir)/emultempl/mmix-elfnmmo.em \ + $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/mmo.em \ + $(srcdir)/scripttempl/mmo.sc ${GEN_DEPENDS} + ${GENSCRIPTS} mmo "$(tdir_mmo)" eelf64btsmip.c: $(srcdir)/emulparams/elf64btsmip.sh \ + $(srcdir)/emulparams/elf32bmipn32.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64btsmip "$(tdir_elf64btsmip)" eelf64ltsmip.c: $(srcdir)/emulparams/elf64ltsmip.sh \ + $(srcdir)/emulparams/elf64btsmip.sh $(srcdir)/emulparams/elf32bmipn32.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64ltsmip "$(tdir_elf64ltsmip)" eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \ @@ -518,6 +599,12 @@ eelf_i386_be.c: $(srcdir)/emulparams/elf_i386_be.sh \ eelf_i386_chaos.c: $(srcdir)/emulparams/elf_i386_chaos.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf_i386_chaos "$(tdir_elf_i386_chaos)" +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_s390.c: $(srcdir)/emulparams/elf_s390.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)" egld960.c: $(srcdir)/emulparams/gld960.sh \ $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS} ${GENSCRIPTS} gld960 "$(tdir_gld960)" @@ -533,6 +620,17 @@ eh8300h.c: $(srcdir)/emulparams/h8300h.sh \ eh8300s.c: $(srcdir)/emulparams/h8300s.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300s.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8300s "$(tdir_h8300s)" +eh8300elf.c: $(srcdir)/emulparams/h8300elf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300elf "$(tdir_h8300elf)" +eh8300helf.c: $(srcdir)/emulparams/h8300helf.sh \ + $(srcdir)/emulparams/h8300elf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300helf "$(tdir_h8300helf)" +eh8300self.c: $(srcdir)/emulparams/h8300self.sh \ + $(srcdir)/emulparams/h8300elf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300self "$(tdir_h8300self)" eh8500.c: $(srcdir)/emulparams/h8500.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8500 "$(tdir_h8500)" @@ -590,7 +688,7 @@ ei386mach.c: $(srcdir)/emulparams/i386mach.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} i386mach "$(tdir_i386mach)" ei386moss.c: $(srcdir)/emulparams/i386moss.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} i386moss "$(tdir_i386moss)" ei386msdos.c: $(srcdir)/emulparams/i386msdos.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386msdos.sc ${GEN_DEPENDS} @@ -638,6 +736,11 @@ em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/m68kelf.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68kelf "$(tdir_m68kelf)" +em68kelfnbsd.c: $(srcdir)/emulparams/m68kelfnbsd.sh \ + $(srcdir)/emulparams/m68kelf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/m68kelf.em \ + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} m68kelfnbsd "$(tdir_m68kelfnbsd)" em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \ $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68klinux "$(tdir_m68klinux)" @@ -678,6 +781,7 @@ emipspe.c: $(srcdir)/emulparams/mipspe.sh \ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS} ${GENSCRIPTS} mipspe "$(tdir_mips)" emn10300.c: $(srcdir)/emulparams/mn10300.sh \ + $(srcdir)/emulparams/mn10200.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} mn10300 "$(tdir_mn10300)" emn10200.c: $(srcdir)/emulparams/mn10200.sh \ @@ -692,6 +796,9 @@ ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \ epc532macha.c: $(srcdir)/emulparams/pc532macha.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} pc532macha "$(tdir_pc532macha)" +epdp11.c: $(srcdir)/emulparams/pdp11.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} + ${GENSCRIPTS} pdp11 "$(tdir_pdp11)" epjelf.c: $(srcdir)/emulparams/pjelf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} pjelf "$(tdir_pjelf)" @@ -720,15 +827,27 @@ eshelf.c: $(srcdir)/emulparams/shelf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} shelf "$(tdir_shelf)" eshelf_linux.c: $(srcdir)/emulparams/shelf_linux.sh \ + $(srcdir)/emulparams/shlelf_linux.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} shelf_linux "$(tdir_shelf_linux)" eshlelf_linux.c: $(srcdir)/emulparams/shlelf_linux.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} shlelf_linux "$(tdir_shlelf_linux)" +eshelf_nbsd.c: $(srcdir)/emulparams/shelf_nbsd.sh \ + $(srcdir)/emulparams/shelf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} shelf_nbsd "$(tdir_shelf_nbsd)" +eshlelf_nbsd.c: $(srcdir)/emulparams/shlelf_nbsd.sh \ + $(srcdir)/emulparams/shelf_nbsd.sh \ + $(srcdir)/emulparams/shelf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} shlelf_nbsd "$(tdir_shlelf_nbsd)" eshlelf.c: $(srcdir)/emulparams/shlelf.sh \ + $(srcdir)/emulparams/shelf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} shlelf "$(tdir_shlelf)" eshl.c: $(srcdir)/emulparams/shl.sh \ + $(srcdir)/emulparams/sh.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS} ${GENSCRIPTS} shl "$(tdir_shl)" eshpe.c: $(srcdir)/emulparams/shpe.sh \ @@ -901,11 +1020,22 @@ 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 +# Build the man page from the texinfo file +# The sed command removes the no-adjust Nroff command so that +# the man output looks standard. +ld.1: $(srcdir)/ld.texinfo + touch $@ + -$(TEXI2POD) $(MANCONF) < $(srcdir)/ld.texinfo > ld.pod + -($(POD2MAN) ld.pod | \ + sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || \ + (rm -f $@.T$$$$ && exit 1) + rm -f ld.pod + MAINTAINERCLEANFILES = ldver.texi # We want to reconfigure if configure.host or configure.tgt changes. -config.status: $(srcdir)/configure $(srcdir)/configure.host $(srcdir)/configure.tgt - $(SHELL) ./config.status --recheck +CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \ ldemul-list.h crtbegin.o crtend.o ld.log ld.sum @@ -938,13 +1068,15 @@ install-data-local: # Stuff that should be included in a distribution. The diststuff # target is run by the taz target in ../Makefile.in. -LDDISTSTUFF = ldgram.c ldgram.h ldlex.c -diststuff: $(LDDISTSTUFF) info +EXTRA_DIST = ldgram.c ldgram.h ldlex.c $(man_MANS) +diststuff: info $(EXTRA_DIST) 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 @@ -991,70 +1123,77 @@ dep-am: DEP # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. ldctor.o: ldctor.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \ - ld.h $(INCDIR)/bin-bugs.h ldexp.h ldlang.h ldmisc.h \ - ldgram.h ldmain.h ldctor.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 \ - 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 + $(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 ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \ - ld.h $(INCDIR)/bin-bugs.h ldmain.h ldmisc.h ldexp.h \ - ldgram.h ldlang.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldmain.h \ + ldmisc.h ldexp.h ldgram.h ldlang.h $(INCDIR)/libiberty.h ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \ - ld.h $(INCDIR)/bin-bugs.h ldmisc.h ldexp.h ldlang.h \ - ldfile.h ldmain.h ldgram.h ldlex.h ldemul.h $(INCDIR)/libiberty.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h ld.h $(INCDIR)/bin-bugs.h \ + ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h ldgram.h \ + ldlex.h ldemul.h $(INCDIR)/libiberty.h ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ - $(INCDIR)/obstack.h $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h \ - ldmain.h ldgram.h ldexp.h ldlang.h ldlex.h ldmisc.h \ - ldctor.h ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ + $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldmain.h \ + ldgram.h ldexp.h ldlang.h ldlex.h ldmisc.h ldctor.h \ + ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ - $(INCDIR)/progress.h $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \ - ld.h $(INCDIR)/bin-bugs.h ldmain.h ldmisc.h ldwrite.h \ - ldgram.h ldexp.h ldlang.h ldlex.h ldfile.h ldemul.h \ - ldctor.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h $(INCDIR)/progress.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h ld.h $(INCDIR)/bin-bugs.h \ + ldmain.h ldmisc.h ldwrite.h ldgram.h ldexp.h ldlang.h \ + ldlex.h ldfile.h ldemul.h ldctor.h ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ - $(INCDIR)/demangle.h ld.h $(INCDIR)/bin-bugs.h ldmisc.h \ - ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h ldfile.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/libiberty.h $(INCDIR)/demangle.h ld.h $(INCDIR)/bin-bugs.h \ + ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h \ + ldfile.h ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \ - ldver.h ldexp.h ldlang.h ldfile.h ldemul.h ldmain.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + ld.h $(INCDIR)/bin-bugs.h ldver.h ldexp.h ldlang.h \ + ldfile.h ldemul.h ldmain.h ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \ - ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h \ + ldexp.h ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.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 $(INCDIR)/demangle.h -mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h sysdep.h \ - config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/symcat.h sysdep.h config.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 \ + $(INCDIR)/demangle.h +mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ + sysdep.h config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \ ldexp.h ldlang.h ldmisc.h mri.h ldgram.h $(INCDIR)/libiberty.h ldcref.o: ldcref.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h ldmain.h \ - ldmisc.h ldexp.h ldlang.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h \ + ldmain.h ldmisc.h ldexp.h ldlang.h pe-dll.o: pe-dll.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \ - ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h ldfile.h \ - ldemul.h $(INCDIR)/coff/internal.h ../bfd/libcoff.h \ - deffile.h pe-dll.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.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 ldfile.h ldemul.h $(INCDIR)/coff/internal.h \ + ../bfd/libcoff.h deffile.h pe-dll.h ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \ - ld.h $(INCDIR)/bin-bugs.h ldexp.h ldver.h ldlang.h \ - ldfile.h ldemul.h ldmisc.h ldmain.h mri.h ldctor.h \ - ldlex.h -ldlex.o: ldlex.c ../bfd/bfd.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \ + ldver.h ldlang.h ldfile.h ldemul.h ldmisc.h ldmain.h \ + mri.h ldctor.h ldlex.h +ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/symcat.h sysdep.h \ + config.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h \ ld.h $(INCDIR)/bin-bugs.h ldgram.h ldmisc.h ldexp.h \ ldlang.h ldfile.h ldlex.h ldmain.h $(INCDIR)/libiberty.h deffilep.o: deffilep.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ - ../bfd/bfd.h sysdep.h config.h $(INCDIR)/fopen-same.h \ - ld.h $(INCDIR)/bin-bugs.h ldmisc.h deffile.h + $(INCDIR)/safe-ctype.h ../bfd/bfd.h $(INCDIR)/symcat.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 diff --git a/contrib/binutils/ld/Makefile.in b/contrib/binutils/ld/Makefile.in index 8317908..1518e3f 100644 --- a/contrib/binutils/ld/Makefile.in +++ b/contrib/binutils/ld/Makefile.in @@ -145,6 +145,15 @@ MKDEP = gcc -MM # What version of the manual to build DOCVER = gen +# Options to extract the man page from ld.texinfo +MANCONF = -Dman + +TEXI2POD = perl $(BASEDIR)/etc/texi2pod.pl + +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@ @@ -218,6 +227,7 @@ ALL_EMULATIONS = \ earmcoff.o \ earmelf.o \ earmelf_linux.o \ + earmelf_nbsd.o \ earmelf_oabi.o \ earmnbsd.o \ earmpe.o \ @@ -256,17 +266,24 @@ ALL_EMULATIONS = \ eelf32lppc.o \ eelf32lppcsim.o \ eelf32mcore.o \ + eelf32openrisc.o \ eelf32ppc.o \ eelf32ppclinux.o \ eelf32ppcsim.o \ + eelf32xstormy16.o \ eelf_i386.o \ eelf_i386_be.o \ eelf_i386_chaos.o \ + eelf_i386_ldso.o \ + eelf_s390.o \ egld960.o \ egld960coff.o \ eh8300.o \ eh8300h.o \ eh8300s.o \ + eh8300elf.o \ + eh8300helf.o \ + eh8300self.o \ eh8500.o \ eh8500b.o \ eh8500c.o \ @@ -300,6 +317,7 @@ ALL_EMULATIONS = \ em68kaux.o \ em68kcoff.o \ em68kelf.o \ + em68kelfnbsd.o \ em68klinux.o \ em68klynx.o \ em68knbsd.o \ @@ -316,6 +334,7 @@ ALL_EMULATIONS = \ enews.o \ ens32knbsd.o \ epc532macha.o \ + epdp11.o \ epjelf.o \ epjlelf.o \ eppcmacos.o \ @@ -327,6 +346,8 @@ ALL_EMULATIONS = \ eshelf.o \ eshelf_linux.o \ eshlelf_linux.o \ + eshelf_nbsd.o \ + eshlelf_nbsd.o \ eshl.o \ eshlelf.o \ eshpe.o \ @@ -350,14 +371,21 @@ ALL_EMULATIONS = \ ALL_64_EMULATIONS = \ + eelf64_aix.o \ eelf64_ia64.o \ eelf_x86_64.o \ + eelf64_s390.o \ eelf64_sparc.o \ eelf64alpha.o \ + eelf64alpha_nbsd.o \ eelf64bmip.o \ eelf64btsmip.o \ eelf64ltsmip.o \ eelf64hppa.o \ + eelf64mmix.o \ + emmo.o \ + eelf64ppc.o \ + eelf64lppc.o \ ehppa64linux.o @@ -394,7 +422,7 @@ POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES) # These all start with e so 'make clean' can find them. -GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${exec_prefix} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" +GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed # We need this for automake to use YLWRAP. @@ -411,6 +439,9 @@ 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 + MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \ ldemul-list.h crtbegin.o crtend.o ld.log ld.sum @@ -418,7 +449,7 @@ CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 # Stuff that should be included in a distribution. The diststuff # target is run by the taz target in ../Makefile.in. -LDDISTSTUFF = ldgram.c ldgram.h ldlex.c +EXTRA_DIST = ldgram.c ldgram.h ldlex.c $(man_MANS) DISTCLEANFILES = tdirs site.exp site.bak stringify.sed ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -479,6 +510,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 cd $(srcdir) && $(ACLOCAL) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck $(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) @@ -1049,6 +1083,11 @@ earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} armelf_linux "$(tdir_armelf_linux)" +earmelf_nbsd.c: $(srcdir)/emulparams/armelf_nbsd.sh \ + $(srcdir)/emulparams/armelf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \ + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} armelf_nbsd "$(tdir_armelf_nbsd)" earmaoutb.c: $(srcdir)/emulparams/armaoutb.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS} ${GENSCRIPTS} armaoutb "$(tdir_armaoutb)" @@ -1106,13 +1145,13 @@ ecrisaout.c: $(srcdir)/emulparams/crisaout.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/crisaout.sc ${GEN_DEPENDS} ${GENSCRIPTS} crisaout "$(tdir_cris)" ecriself.c: $(srcdir)/emulparams/criself.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} criself "$(tdir_cris)" ecrislinux.c: $(srcdir)/emulparams/crislinux.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} crislinux "$(tdir_cris)" ed10velf.c: $(srcdir)/emulparams/d10velf.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfd10v.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfd10v.sc ${GEN_DEPENDS} ${GENSCRIPTS} d10velf "$(tdir_d10v)" ed30velf.c: $(srcdir)/emulparams/d30velf.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfd30v.sc ${GEN_DEPENDS} @@ -1129,6 +1168,10 @@ edelta68.c: $(srcdir)/emulparams/delta68.sh \ 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 \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \ + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf32xstormy16 "$(tdir_xstormy16)" eelf32fr30.c: $(srcdir)/emulparams/elf32fr30.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32fr30 "$(tdir_fr30)" @@ -1136,7 +1179,7 @@ eelf32mcore.c: $(srcdir)/emulparams/elf32mcore.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32mcore "$(tdir_mcore)" em32relf.c: $(srcdir)/emulparams/m32relf.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} m32relf "$(tdir_m32r)" eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} @@ -1148,76 +1191,121 @@ 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/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)" eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)" eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh \ $(srcdir)/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/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)" eelf32ltsmip.c: $(srcdir)/emulparams/elf32ltsmip.sh \ + $(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ltsmip "$(tdir_elf32ltsmip)" eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)" eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \ + $(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)" eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \ $(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/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)" eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)" eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \ + $(srcdir)/emulparams/elf32ppc.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32lppc "$(tdir_elf32lppc)" eelf32lppcsim.c: $(srcdir)/emulparams/elf32lppcsim.sh \ + $(srcdir)/emulparams/elf32lppc.sh $(srcdir)/emulparams/elf32ppc.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32lppcsim "$(tdir_elf32lppcsim)" eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \ + $(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \ $(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/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)" eelf32ppcsim.c: $(srcdir)/emulparams/elf32ppcsim.sh \ + $(srcdir)/emulparams/elf32ppc.sh \ $(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/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} + ${GENSCRIPTS} elf64ppc "$(tdir_elf64ppc)" +eelf64lppc.c: $(srcdir)/emulparams/elf64lppc.sh \ + $(srcdir)/emulparams/elf64ppc.sh $(srcdir)/emultempl/ppc64elf.em \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64lppc "$(tdir_elf64lppc)" eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfi370.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32i370 "$(tdir_elf32i370)" eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)" +eelf64alpha_nbsd.c: $(srcdir)/emulparams/elf64alpha_nbsd.sh \ + $(srcdir)/emulparams/elf64alpha.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64alpha_nbsd "$(tdir_elf64alpha_nbsd)" eelf64hppa.c: $(srcdir)/emulparams/elf64hppa.sh \ + $(srcdir)/emulparams/hppa64linux.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64hppa "$(tdir_elf64hppa)" +eelf64_aix.c: $(srcdir)/emulparams/elf64_aix.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64_aix "$(tdir_elf64_aix)" eelf64_ia64.c: $(srcdir)/emulparams/elf64_ia64.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_ia64 "$(tdir_elf64_ia64)" +eelf64_s390.c: $(srcdir)/emulparams/elf64_s390.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64_s390 "$(tdir_elf64_s390)" eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_sparc "$(tdir_elf64_sparc)" eelf64bmip.c: $(srcdir)/emulparams/elf64bmip.sh \ + $(srcdir)/emulparams/elf32bmipn32.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64bmip "$(tdir_elf64bmip)" +eelf64mmix.c: $(srcdir)/emulparams/elf64mmix.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/mmix-elfnmmo.em \ + $(srcdir)/emultempl/mmixelf.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64mmix "$(tdir_elf64mmix)" +emmo.c: $(srcdir)/emulparams/mmo.sh $(srcdir)/emultempl/mmix-elfnmmo.em \ + $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/mmo.em \ + $(srcdir)/scripttempl/mmo.sc ${GEN_DEPENDS} + ${GENSCRIPTS} mmo "$(tdir_mmo)" eelf64btsmip.c: $(srcdir)/emulparams/elf64btsmip.sh \ + $(srcdir)/emulparams/elf32bmipn32.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64btsmip "$(tdir_elf64btsmip)" eelf64ltsmip.c: $(srcdir)/emulparams/elf64ltsmip.sh \ + $(srcdir)/emulparams/elf64btsmip.sh $(srcdir)/emulparams/elf32bmipn32.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64ltsmip "$(tdir_elf64ltsmip)" eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \ @@ -1232,6 +1320,12 @@ eelf_i386_be.c: $(srcdir)/emulparams/elf_i386_be.sh \ eelf_i386_chaos.c: $(srcdir)/emulparams/elf_i386_chaos.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf_i386_chaos "$(tdir_elf_i386_chaos)" +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_s390.c: $(srcdir)/emulparams/elf_s390.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)" egld960.c: $(srcdir)/emulparams/gld960.sh \ $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS} ${GENSCRIPTS} gld960 "$(tdir_gld960)" @@ -1247,6 +1341,17 @@ eh8300h.c: $(srcdir)/emulparams/h8300h.sh \ eh8300s.c: $(srcdir)/emulparams/h8300s.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300s.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8300s "$(tdir_h8300s)" +eh8300elf.c: $(srcdir)/emulparams/h8300elf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300elf "$(tdir_h8300elf)" +eh8300helf.c: $(srcdir)/emulparams/h8300helf.sh \ + $(srcdir)/emulparams/h8300elf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300helf "$(tdir_h8300helf)" +eh8300self.c: $(srcdir)/emulparams/h8300self.sh \ + $(srcdir)/emulparams/h8300elf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300self "$(tdir_h8300self)" eh8500.c: $(srcdir)/emulparams/h8500.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8500 "$(tdir_h8500)" @@ -1304,7 +1409,7 @@ ei386mach.c: $(srcdir)/emulparams/i386mach.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} i386mach "$(tdir_i386mach)" ei386moss.c: $(srcdir)/emulparams/i386moss.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} i386moss "$(tdir_i386moss)" ei386msdos.c: $(srcdir)/emulparams/i386msdos.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386msdos.sc ${GEN_DEPENDS} @@ -1352,6 +1457,11 @@ em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/m68kelf.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68kelf "$(tdir_m68kelf)" +em68kelfnbsd.c: $(srcdir)/emulparams/m68kelfnbsd.sh \ + $(srcdir)/emulparams/m68kelf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/m68kelf.em \ + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} m68kelfnbsd "$(tdir_m68kelfnbsd)" em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \ $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68klinux "$(tdir_m68klinux)" @@ -1392,6 +1502,7 @@ emipspe.c: $(srcdir)/emulparams/mipspe.sh \ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS} ${GENSCRIPTS} mipspe "$(tdir_mips)" emn10300.c: $(srcdir)/emulparams/mn10300.sh \ + $(srcdir)/emulparams/mn10200.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} mn10300 "$(tdir_mn10300)" emn10200.c: $(srcdir)/emulparams/mn10200.sh \ @@ -1406,6 +1517,9 @@ ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \ epc532macha.c: $(srcdir)/emulparams/pc532macha.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} pc532macha "$(tdir_pc532macha)" +epdp11.c: $(srcdir)/emulparams/pdp11.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} + ${GENSCRIPTS} pdp11 "$(tdir_pdp11)" epjelf.c: $(srcdir)/emulparams/pjelf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} pjelf "$(tdir_pjelf)" @@ -1434,15 +1548,27 @@ eshelf.c: $(srcdir)/emulparams/shelf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} shelf "$(tdir_shelf)" eshelf_linux.c: $(srcdir)/emulparams/shelf_linux.sh \ + $(srcdir)/emulparams/shlelf_linux.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} shelf_linux "$(tdir_shelf_linux)" eshlelf_linux.c: $(srcdir)/emulparams/shlelf_linux.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} shlelf_linux "$(tdir_shlelf_linux)" +eshelf_nbsd.c: $(srcdir)/emulparams/shelf_nbsd.sh \ + $(srcdir)/emulparams/shelf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} shelf_nbsd "$(tdir_shelf_nbsd)" +eshlelf_nbsd.c: $(srcdir)/emulparams/shlelf_nbsd.sh \ + $(srcdir)/emulparams/shelf_nbsd.sh \ + $(srcdir)/emulparams/shelf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} shlelf_nbsd "$(tdir_shlelf_nbsd)" eshlelf.c: $(srcdir)/emulparams/shlelf.sh \ + $(srcdir)/emulparams/shelf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} shlelf "$(tdir_shlelf)" eshl.c: $(srcdir)/emulparams/shl.sh \ + $(srcdir)/emulparams/sh.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS} ${GENSCRIPTS} shl "$(tdir_shl)" eshpe.c: $(srcdir)/emulparams/shpe.sh \ @@ -1604,9 +1730,17 @@ 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 -# We want to reconfigure if configure.host or configure.tgt changes. -config.status: $(srcdir)/configure $(srcdir)/configure.host $(srcdir)/configure.tgt - $(SHELL) ./config.status --recheck +# Build the man page from the texinfo file +# The sed command removes the no-adjust Nroff command so that +# the man output looks standard. +ld.1: $(srcdir)/ld.texinfo + touch $@ + -$(TEXI2POD) $(MANCONF) < $(srcdir)/ld.texinfo > ld.pod + -($(POD2MAN) ld.pod | \ + sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || \ + (rm -f $@.T$$$$ && exit 1) + rm -f ld.pod mostlyclean-local: -rm -rf tmpdir @@ -1632,10 +1766,12 @@ install-data-local: for f in ldscripts/*; do \ $(INSTALL_DATA) $$f $(scriptdir)/$$f ; \ done -diststuff: $(LDDISTSTUFF) info +diststuff: info $(EXTRA_DIST) 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 @@ -1682,72 +1818,79 @@ dep-am: DEP # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. ldctor.o: ldctor.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \ - ld.h $(INCDIR)/bin-bugs.h ldexp.h ldlang.h ldmisc.h \ - ldgram.h ldmain.h ldctor.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 \ - 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 + $(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 ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \ - ld.h $(INCDIR)/bin-bugs.h ldmain.h ldmisc.h ldexp.h \ - ldgram.h ldlang.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldmain.h \ + ldmisc.h ldexp.h ldgram.h ldlang.h $(INCDIR)/libiberty.h ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \ - ld.h $(INCDIR)/bin-bugs.h ldmisc.h ldexp.h ldlang.h \ - ldfile.h ldmain.h ldgram.h ldlex.h ldemul.h $(INCDIR)/libiberty.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h ld.h $(INCDIR)/bin-bugs.h \ + ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h ldgram.h \ + ldlex.h ldemul.h $(INCDIR)/libiberty.h ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ - $(INCDIR)/obstack.h $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h \ - ldmain.h ldgram.h ldexp.h ldlang.h ldlex.h ldmisc.h \ - ldctor.h ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ + $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldmain.h \ + ldgram.h ldexp.h ldlang.h ldlex.h ldmisc.h ldctor.h \ + ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ - $(INCDIR)/progress.h $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \ - ld.h $(INCDIR)/bin-bugs.h ldmain.h ldmisc.h ldwrite.h \ - ldgram.h ldexp.h ldlang.h ldlex.h ldfile.h ldemul.h \ - ldctor.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h $(INCDIR)/progress.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h ld.h $(INCDIR)/bin-bugs.h \ + ldmain.h ldmisc.h ldwrite.h ldgram.h ldexp.h ldlang.h \ + ldlex.h ldfile.h ldemul.h ldctor.h ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ - $(INCDIR)/demangle.h ld.h $(INCDIR)/bin-bugs.h ldmisc.h \ - ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h ldfile.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/libiberty.h $(INCDIR)/demangle.h ld.h $(INCDIR)/bin-bugs.h \ + ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h \ + ldfile.h ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \ - ldver.h ldexp.h ldlang.h ldfile.h ldemul.h ldmain.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + ld.h $(INCDIR)/bin-bugs.h ldver.h ldexp.h ldlang.h \ + ldfile.h ldemul.h ldmain.h ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \ - ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h \ + ldexp.h ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.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 $(INCDIR)/demangle.h -mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h sysdep.h \ - config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/symcat.h sysdep.h config.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 \ + $(INCDIR)/demangle.h +mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ + sysdep.h config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \ ldexp.h ldlang.h ldmisc.h mri.h ldgram.h $(INCDIR)/libiberty.h ldcref.o: ldcref.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h ldmain.h \ - ldmisc.h ldexp.h ldlang.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h \ + ldmain.h ldmisc.h ldexp.h ldlang.h pe-dll.o: pe-dll.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \ - ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h ldfile.h \ - ldemul.h $(INCDIR)/coff/internal.h ../bfd/libcoff.h \ - deffile.h pe-dll.h + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.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 ldfile.h ldemul.h $(INCDIR)/coff/internal.h \ + ../bfd/libcoff.h deffile.h pe-dll.h ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \ - ld.h $(INCDIR)/bin-bugs.h ldexp.h ldver.h ldlang.h \ - ldfile.h ldemul.h ldmisc.h ldmain.h mri.h ldctor.h \ - ldlex.h -ldlex.o: ldlex.c ../bfd/bfd.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \ + ldver.h ldlang.h ldfile.h ldemul.h ldmisc.h ldmain.h \ + mri.h ldctor.h ldlex.h +ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/symcat.h sysdep.h \ + config.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h \ ld.h $(INCDIR)/bin-bugs.h ldgram.h ldmisc.h ldexp.h \ ldlang.h ldfile.h ldlex.h ldmain.h $(INCDIR)/libiberty.h deffilep.o: deffilep.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ - ../bfd/bfd.h sysdep.h config.h $(INCDIR)/fopen-same.h \ - ld.h $(INCDIR)/bin-bugs.h ldmisc.h deffile.h + $(INCDIR)/safe-ctype.h ../bfd/bfd.h $(INCDIR)/symcat.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. diff --git a/contrib/binutils/ld/NEWS b/contrib/binutils/ld/NEWS index f1e7ece..70997ef 100644 --- a/contrib/binutils/ld/NEWS +++ b/contrib/binutils/ld/NEWS @@ -1,4 +1,13 @@ -*- text -*- +* Support for -z nocopyreloc in the x86 ELF linker, which disables + production of copy relocs. Warning: using this option may result in + non-sharable applications. + +* Support for -z combreloc in the ELF linker, which puts dynamic + relocations against the same symbol together, so that dynamic linker + can use an one-entry symbol lookup cache. + +* Support for ELF SHF_MERGE section merging, by Jakub Jelinek. * Support for AMD x86-64 architecture, by Jan Hubicka, SuSE Labs. diff --git a/contrib/binutils/ld/README b/contrib/binutils/ld/README index 8947d04..6fef769 100644 --- a/contrib/binutils/ld/README +++ b/contrib/binutils/ld/README @@ -1,3 +1,5 @@ + README for LD + This is the GNU linker. It is distributed with other "binary utilities" which should be in ../binutils. See ../binutils/README for more general notes, including where to send bug reports. diff --git a/contrib/binutils/ld/aclocal.m4 b/contrib/binutils/ld/aclocal.m4 index b468950..e68badb 100644 --- a/contrib/binutils/ld/aclocal.m4 +++ b/contrib/binutils/ld/aclocal.m4 @@ -27,6 +27,24 @@ AC_DEFUN([CY_WITH_NLS],) AC_SUBST(INTLLIBS) ]) +#serial 1 +# This test replaces the one in autoconf. +# Currently this macro should have the same name as the autoconf macro +# because gettext's gettext.m4 (distributed in the automake package) +# still uses it. Otherwise, the use in gettext.m4 makes autoheader +# give these diagnostics: +# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX +# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX + +undefine([AC_ISC_POSIX]) + +AC_DEFUN(AC_ISC_POSIX, + [ + dnl This test replaces the obsolescent AC_ISC_POSIX kludge. + AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) + ] +) + # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. diff --git a/contrib/binutils/ld/config.in b/contrib/binutils/ld/config.in index 5e17bdc..c6c80ee 100644 --- a/contrib/binutils/ld/config.in +++ b/contrib/binutils/ld/config.in @@ -1,174 +1,175 @@ /* config.in. Generated automatically 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 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 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 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 if you have the <argz.h> header file. */ +#undef HAVE_ARGZ_H -/* Define to `long' if <sys/types.h> doesn't define. */ -#undef off_t +/* Define if you have the `dcgettext' function. */ +#undef HAVE_DCGETTEXT -/* Define if you need to in order for stat and other things to work. */ -#undef _POSIX_SOURCE +/* Define if you have the <dirent.h> header file, and it defines `DIR'. */ +#undef HAVE_DIRENT_H -/* Define to `unsigned' if <sys/types.h> doesn't define. */ -#undef size_t +/* Define if you have the `getcwd' function. */ +#undef HAVE_GETCWD -/* 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 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +#undef HAVE_GETTEXT -/* Define if lex declares yytext as a char * by default, not a char[]. */ -#undef YYTEXT_POINTER +/* Define if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H -/* Define if you have the __argz_count function. */ -#undef HAVE___ARGZ_COUNT +/* Define if your locale.h file contains LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES -/* Define if you have the __argz_next function. */ -#undef HAVE___ARGZ_NEXT +/* Define if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H -/* Define if you have the __argz_stringify function. */ -#undef HAVE___ARGZ_STRINGIFY +/* Define if you have the <locale.h> header file. */ +#undef HAVE_LOCALE_H -/* Define if you have the dcgettext function. */ -#undef HAVE_DCGETTEXT +/* Define if you have the <malloc.h> header file. */ +#undef HAVE_MALLOC_H -/* Define if you have the getcwd function. */ -#undef HAVE_GETCWD +/* Define if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H -/* Define if you have the getpagesize function. */ -#undef HAVE_GETPAGESIZE +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP -/* Define if you have the munmap function. */ +/* Define if you have the `munmap' function. */ #undef HAVE_MUNMAP -/* Define if you have the putenv function. */ +/* Define if you have the <ndir.h> header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define if you have the <nl_types.h> header file. */ +#undef HAVE_NL_TYPES_H + +/* Define if you have the `putenv' function. */ #undef HAVE_PUTENV -/* Define if you have the sbrk function. */ +/* Define if you have the `sbrk' function. */ #undef HAVE_SBRK -/* Define if you have the setenv function. */ +/* Define if you have the `setenv' function. */ #undef HAVE_SETENV -/* Define if you have the setlocale function. */ +/* Define if you have the `setlocale' function. */ #undef HAVE_SETLOCALE -/* Define if you have the stpcpy function. */ +/* Define if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the stpcpy function */ #undef HAVE_STPCPY -/* Define if you have the strcasecmp function. */ +/* Define if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP -/* Define if you have the strchr function. */ +/* Define if you have the `strchr' function. */ #undef HAVE_STRCHR -/* Define if you have the <argz.h> header file. */ -#undef HAVE_ARGZ_H - -/* Define if you have the <dirent.h> header file. */ -#undef HAVE_DIRENT_H - -/* Define if you have the <limits.h> header file. */ -#undef HAVE_LIMITS_H - -/* Define if you have the <locale.h> header file. */ -#undef HAVE_LOCALE_H - -/* Define if you have the <malloc.h> header file. */ -#undef HAVE_MALLOC_H - -/* Define if you have the <ndir.h> header file. */ -#undef HAVE_NDIR_H - -/* Define if you have the <nl_types.h> header file. */ -#undef HAVE_NL_TYPES_H - -/* Define if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H +/* Define if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H -/* Define if you have the <string.h> header file. */ +/* Define if you have the <string.h> header file. */ #undef HAVE_STRING_H -/* Define if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the <sys/dir.h> header file. */ +/* Define 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 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 if you have the <sys/param.h> header file. */ #undef HAVE_SYS_PARAM_H -/* Define if you have the <unistd.h> header file. */ +/* Define if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H -/* Define if you have the <values.h> header file. */ +/* Define if you have the <values.h> header file. */ #undef HAVE_VALUES_H -/* Name of package */ -#undef PACKAGE +/* Define if you have the `__argz_count' function. */ +#undef HAVE___ARGZ_COUNT -/* Version number of package */ -#undef VERSION +/* Define if you have the `__argz_next' function. */ +#undef HAVE___ARGZ_NEXT -/* Define if you have the stpcpy function */ -#undef HAVE_STPCPY +/* Define if you have the `__argz_stringify' function. */ +#undef HAVE___ARGZ_STRINGIFY -/* Define if your locale.h file contains LC_MESSAGES. */ -#undef HAVE_LC_MESSAGES +/* Define if environ is not declared in system header files. */ +#undef NEED_DECLARATION_ENVIRON -/* Define to 1 if NLS is requested */ -#undef ENABLE_NLS +/* Define if free is not declared in system header files. */ +#undef NEED_DECLARATION_FREE -/* Define as 1 if you have gettext and don't want to use GNU gettext. */ -#undef HAVE_GETTEXT +/* Define if getenv is not declared in system header files. */ +#undef NEED_DECLARATION_GETENV -/* Use b modifier when opening binary files? */ -#undef USE_BINARY_FOPEN +/* Define if sbrk is not declared in system header files. */ +#undef NEED_DECLARATION_SBRK /* 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 +/* Name of package */ +#undef PACKAGE -/* Define if sbrk is not declared in system header files. */ -#undef NEED_DECLARATION_SBRK +/* 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 if getenv is not declared in system header files. */ -#undef NEED_DECLARATION_GETENV +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS -/* Define if environ is not declared in system header files. */ -#undef NEED_DECLARATION_ENVIRON +/* Use b modifier when opening binary files? */ +#undef USE_BINARY_FOPEN -/* Additional extension a shared object might have. */ -#undef EXTRA_SHLIB_EXTENSION +/* Version number of package */ +#undef VERSION + +/* Define if `lex' declares `yytext' as a `char *' by default, not a `char[]'. + */ +#undef YYTEXT_POINTER +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +#undef inline + +/* 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 2a211e2..4003cf8 100755 --- a/contrib/binutils/ld/configure +++ b/contrib/binutils/ld/configure @@ -53,7 +53,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -168,7 +167,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -339,11 +337,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -509,16 +502,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # 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" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +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 @@ -557,12 +546,12 @@ else fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:561: checking for Cygwin environment" >&5 +echo "configure:550: 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 566 "configure" +#line 555 "configure" #include "confdefs.h" int main() { @@ -573,7 +562,7 @@ int main() { return __CYGWIN__; ; return 0; } EOF -if { (eval echo configure:577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -590,19 +579,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:594: checking for mingw32 environment" >&5 +echo "configure:583: 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 599 "configure" +#line 588 "configure" #include "confdefs.h" int main() { return __MINGW32__; ; return 0; } EOF -if { (eval echo configure:606: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -667,7 +656,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:671: checking host system type" >&5 +echo "configure:660: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -688,7 +677,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:692: checking target system type" >&5 +echo "configure:681: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -706,7 +695,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:710: checking build system type" >&5 +echo "configure:699: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -728,249 +717,49 @@ test "$host_alias" != "$target_alias" && NONENONEs,x,x, && program_prefix=${target_alias}- -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:735: 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:765: 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:816: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6 +echo "configure:723: checking for strerror in -lcposix" >&5 +ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:848: 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 859 "configure" + ac_save_LIBS="$LIBS" +LIBS="-lcposix $LIBS" +cat > conftest.$ac_ext <<EOF +#line 731 "configure" #include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror(); -main(){return(0);} +int main() { +strerror() +; return 0; } EOF -if { (eval echo configure:864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi +if { (eval echo configure:742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:890: 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:895: 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:904: \"$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:923: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* +LIBS="$ac_save_LIBS" fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:955: checking for POSIXized ISC" >&5 -if test -d /etc/conf/kconfig.d && - grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 -then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ISC=yes # If later tests want to check for ISC. - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - if test "$GCC" = yes; then - CC="$CC -posix" - else - CC="$CC -Xp" - fi + LIBS="$LIBS -lcposix" else echo "$ac_t""no" 1>&6 - ISC= fi + + BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in` # Find a good install program. We prefer a C program (faster), @@ -985,7 +774,7 @@ BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:989: checking for a BSD compatible install" >&5 +echo "configure:778: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1038,7 +827,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:1042: checking whether build environment is sane" >&5 +echo "configure:831: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -1095,7 +884,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1099: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:888: 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 @@ -1141,7 +930,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:1145: checking for working aclocal" >&5 +echo "configure:934: 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. @@ -1154,7 +943,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1158: checking for working autoconf" >&5 +echo "configure:947: 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. @@ -1167,7 +956,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1171: checking for working automake" >&5 +echo "configure:960: 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. @@ -1180,7 +969,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1184: checking for working autoheader" >&5 +echo "configure:973: 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. @@ -1193,7 +982,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1197: checking for working makeinfo" >&5 +echo "configure:986: 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. @@ -1211,7 +1000,7 @@ fi if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} -case "$enableval" in +case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) @@ -1234,7 +1023,7 @@ fi if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} -case "$enableval" in +case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) @@ -1257,7 +1046,7 @@ fi if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} -case "$enableval" in +case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) @@ -1276,6 +1065,228 @@ else enable_fast_install=yes fi +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1072: 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:1102: 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:1153: 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:1185: 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 1196 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:1201: \"$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:1227: 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:1232: 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:1241: \"$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:1260: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" @@ -1285,10 +1296,10 @@ else fi ac_prog=ld -if test "$ac_cv_prog_gcc" = yes; then +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:1292: checking for ld used by GCC" >&5 +echo "configure:1303: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1296,7 +1307,7 @@ echo "configure:1292: checking for ld used by GCC" >&5 *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac - case "$ac_prog" in + case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' @@ -1318,12 +1329,12 @@ echo "configure:1292: 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:1322: checking for GNU ld" >&5 +echo "configure:1333: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1325: checking for non-GNU ld" >&5 +echo "configure:1336: checking for non-GNU ld" >&5 fi -if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then +if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -z "$LD"; then @@ -1331,11 +1342,11 @@ else for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - ac_cv_path_LD="$ac_dir/$ac_prog" + lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break @@ -1344,11 +1355,11 @@ else done IFS="$ac_save_ifs" else - ac_cv_path_LD="$LD" # Let the user override the test with a path. + lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi -LD="$ac_cv_path_LD" +LD="$lt_cv_path_LD" if test -n "$LD"; then echo "$ac_t""$LD" 1>&6 else @@ -1356,24 +1367,24 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1360: checking if the linker ($LD) is GNU ld" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then +echo "configure:1371: checking if the linker ($LD) is GNU ld" >&5 +if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # 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 - ac_cv_prog_gnu_ld=yes + lt_cv_prog_gnu_ld=yes else - ac_cv_prog_gnu_ld=no + lt_cv_prog_gnu_ld=no fi fi -echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 -with_gnu_ld=$ac_cv_prog_gnu_ld +echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&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:1377: checking for $LD option to reload object files" >&5 +echo "configure:1388: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1385,13 +1396,13 @@ 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:1389: checking for BSD-compatible nm" >&5 -if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then +echo "configure:1400: checking for BSD-compatible nm" >&5 +if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$NM"; then # Let the user override the test. - ac_cv_path_NM="$NM" + lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do @@ -1403,27 +1414,27 @@ else # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - ac_cv_path_NM="$tmp_nm -B" + lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$tmp_nm -p" + lt_cv_path_NM="$tmp_nm -p" break else - ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi -NM="$ac_cv_path_NM" +NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1427: checking whether ln -s works" >&5 +echo "configure:1438: 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 @@ -1444,7 +1455,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1448: checking how to recognise dependant libraries" >&5 +echo "configure:1459: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1462,8 +1473,8 @@ lt_cv_deplibs_check_method='unknown' # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. -case "$host_os" in -aix4*) +case $host_os in +aix*) lt_cv_deplibs_check_method=pass_all ;; @@ -1472,8 +1483,8 @@ beos*) ;; bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -1482,14 +1493,27 @@ cygwin* | mingw* |pw32*) lt_cv_file_magic_cmd='$OBJDUMP -f' ;; +darwin* | rhapsody*) + 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 + rhapsody* | darwin1.012) + lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System' + ;; + *) # Darwin 1.3 on + lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' + ;; + esac + ;; + freebsd* ) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case "$host_cpu" in + case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -1502,29 +1526,28 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; -hpux10.20*) - # TODO: Does this work for hpux-11 too? - lt_cv_deplibs_check_method='file_magic (s0-90-90-9|PA-RISC0-9.0-9) shared library' +hpux10.20*|hpux11*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) - case "$host_os" in + case $host_os in irix5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) - case "$LD" in + case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" - ;; + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" + ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all @@ -1532,25 +1555,30 @@ irix5* | irix6*) # This must be Linux ELF. linux-gnu*) - case "$host_cpu" in - alpha* | i*86 | powerpc* | sparc* | ia64* ) + case $host_cpu in + alpha* | 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_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` ;; netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then : + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' else - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' fi ;; +newsos6) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' @@ -1567,14 +1595,18 @@ solaris*) lt_cv_file_magic_test_file=/lib/libc.so ;; +sysv5uw[78]* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case "$host_vendor" in + case $host_vendor in ncr) lt_cv_deplibs_check_method=pass_all ;; motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; esac ;; @@ -1587,13 +1619,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1591: checking for object suffix" >&5 +echo "configure:1623: 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:1597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1613,7 +1645,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1617: checking for executable suffix" >&5 +echo "configure:1649: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1623,10 +1655,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1652,15 +1684,15 @@ 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 +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:1660: checking for ${ac_tool_prefix}file" >&5 +echo "configure:1692: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$MAGIC_CMD" in + case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; @@ -1676,7 +1708,7 @@ else if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then - case "$deplibs_check_method" in + case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" @@ -1718,11 +1750,11 @@ 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:1722: checking for file" >&5 +echo "configure:1754: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$MAGIC_CMD" in + case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; @@ -1738,7 +1770,7 @@ else if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then - case "$deplibs_check_method" in + case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" @@ -1789,7 +1821,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1793: checking for $ac_word" >&5 +echo "configure:1825: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1821,7 +1853,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1825: checking for $ac_word" >&5 +echo "configure:1857: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1856,7 +1888,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1860: checking for $ac_word" >&5 +echo "configure:1892: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1888,7 +1920,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1892: checking for $ac_word" >&5 +echo "configure:1924: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1926,8 +1958,8 @@ libtool_flags="--cache-file=$cache_file" test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" -test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" -test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" +test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc" +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. @@ -1952,12 +1984,12 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" # Some flags need to be propagated to the compiler or linker for good # libtool support. -case "$host" in +case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1959 "configure"' > conftest.$ac_ext - if { (eval echo configure:1960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - case "`/usr/bin/file conftest.o`" in + echo '#line 1991 "configure"' > conftest.$ac_ext + if { (eval echo configure:1992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1977,7 +2009,7 @@ case "$host" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:1981: checking whether the C compiler needs -belf" >&5 +echo "configure:2013: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1990,14 +2022,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <<EOF -#line 1994 "configure" +#line 2026 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:2001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2107,7 +2139,6 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' # clobbered by the next message. exec 5>>./config.log - @@ -2136,7 +2167,7 @@ else want64=false fi -build_warnings="-W -Wall" +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" @@ -2175,7 +2206,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2179: checking for $ac_word" >&5 +echo "configure:2210: 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 @@ -2205,7 +2236,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2209: checking for $ac_word" >&5 +echo "configure:2240: 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 @@ -2256,7 +2287,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2260: checking for $ac_word" >&5 +echo "configure:2291: 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 @@ -2288,7 +2319,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2292: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2323: 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. @@ -2299,12 +2330,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2303 "configure" +#line 2334 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2339: \"$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 @@ -2330,12 +2361,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2334: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2365: 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:2339: checking whether we are using GNU C" >&5 +echo "configure:2370: 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 @@ -2344,7 +2375,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2379: \"$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 @@ -2363,7 +2394,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2367: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2398: 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 @@ -2406,7 +2437,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:2410: checking for a BSD compatible install" >&5 +echo "configure:2441: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2459,9 +2490,9 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -ALL_LINGUAS= +ALL_LINGUAS="fr sv tr es" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2465: checking how to run the C preprocessor" >&5 +echo "configure:2496: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2476,13 +2507,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 2480 "configure" +#line 2511 "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:2486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2517: \"$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 : @@ -2493,13 +2524,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 2497 "configure" +#line 2528 "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:2503: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2534: \"$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 : @@ -2510,13 +2541,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 2514 "configure" +#line 2545 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2551: \"$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 : @@ -2543,7 +2574,7 @@ echo "$ac_t""$CPP" 1>&6 # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2547: checking for $ac_word" >&5 +echo "configure:2578: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2571,12 +2602,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2575: checking for ANSI C header files" >&5 +echo "configure:2606: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2580 "configure" +#line 2611 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -2584,7 +2615,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2588: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2619: \"$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* @@ -2601,7 +2632,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 2605 "configure" +#line 2636 "configure" #include "confdefs.h" #include <string.h> EOF @@ -2619,7 +2650,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 2623 "configure" +#line 2654 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -2640,7 +2671,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 2644 "configure" +#line 2675 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2651,7 +2682,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2675,12 +2706,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2679: checking for working const" >&5 +echo "configure:2710: 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 2684 "configure" +#line 2715 "configure" #include "confdefs.h" int main() { @@ -2729,7 +2760,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:2733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2750,21 +2781,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2754: checking for inline" >&5 +echo "configure:2785: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 2761 "configure" +#line 2792 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:2768: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2790,12 +2821,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2794: checking for off_t" >&5 +echo "configure:2825: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2799 "configure" +#line 2830 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -2823,12 +2854,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2827: checking for size_t" >&5 +echo "configure:2858: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2832 "configure" +#line 2863 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -2858,19 +2889,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:2862: checking for working alloca.h" >&5 +echo "configure:2893: 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 2867 "configure" +#line 2898 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2905: \"$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 @@ -2891,12 +2922,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2895: checking for alloca" >&5 +echo "configure:2926: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2900 "configure" +#line 2931 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -2924,7 +2955,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:2928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -2956,12 +2987,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2960: checking whether alloca needs Cray hooks" >&5 +echo "configure:2991: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2965 "configure" +#line 2996 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -2986,12 +3017,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2990: checking for $ac_func" >&5 +echo "configure:3021: 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 2995 "configure" +#line 3026 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3014,7 +3045,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3049: \"$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 @@ -3041,7 +3072,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3045: checking stack direction for C alloca" >&5 +echo "configure:3076: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3049,7 +3080,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 3053 "configure" +#line 3084 "configure" #include "confdefs.h" find_stack_direction () { @@ -3068,7 +3099,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:3072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -3089,21 +3120,21 @@ EOF fi -for ac_hdr in unistd.h +for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3097: checking for $ac_hdr" >&5 +echo "configure:3128: 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 3102 "configure" +#line 3133 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3107: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3138: \"$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* @@ -3132,12 +3163,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3136: checking for $ac_func" >&5 +echo "configure:3167: 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 3141 "configure" +#line 3172 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3160,7 +3191,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3195: \"$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 @@ -3185,7 +3216,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3189: checking for working mmap" >&5 +echo "configure:3220: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3193,7 +3224,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 3197 "configure" +#line 3228 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -3221,11 +3252,24 @@ else #include <fcntl.h> #include <sys/mman.h> +#if HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif + +#if HAVE_STDLIB_H +# include <stdlib.h> +#endif + +#if HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif + +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include <unistd.h> -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -3333,7 +3377,7 @@ main() } EOF -if { (eval echo configure:3337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -3361,17 +3405,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3365: checking for $ac_hdr" >&5 +echo "configure:3409: 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 3370 "configure" +#line 3414 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3375: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3419: \"$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* @@ -3401,12 +3445,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3405: checking for $ac_func" >&5 +echo "configure:3449: 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 3410 "configure" +#line 3454 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3429,7 +3473,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3477: \"$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 @@ -3458,12 +3502,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3462: checking for $ac_func" >&5 +echo "configure:3506: 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 3467 "configure" +#line 3511 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3486,7 +3530,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3534: \"$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 @@ -3520,19 +3564,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3524: checking for LC_MESSAGES" >&5 +echo "configure:3568: 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 3529 "configure" +#line 3573 "configure" #include "confdefs.h" #include <locale.h> int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -3553,7 +3597,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3557: checking whether NLS is requested" >&5 +echo "configure:3601: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -3573,7 +3617,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3577: checking whether included gettext is requested" >&5 +echo "configure:3621: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -3592,17 +3636,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3596: checking for libintl.h" >&5 +echo "configure:3640: 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 3601 "configure" +#line 3645 "configure" #include "confdefs.h" #include <libintl.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3606: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3650: \"$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* @@ -3619,19 +3663,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3623: checking for gettext in libc" >&5 +echo "configure:3667: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3628 "configure" +#line 3672 "configure" #include "confdefs.h" #include <libintl.h> int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3647,7 +3691,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3651: checking for bindtextdomain in -lintl" >&5 +echo "configure:3695: 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 @@ -3655,7 +3699,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 3659 "configure" +#line 3703 "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 @@ -3666,7 +3710,7 @@ int main() { bindtextdomain() ; return 0; } EOF -if { (eval echo configure:3670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3714: \"$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 @@ -3682,19 +3726,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3686: checking for gettext in libintl" >&5 +echo "configure:3730: 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 3691 "configure" +#line 3735 "configure" #include "confdefs.h" int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -3722,7 +3766,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3726: checking for $ac_word" >&5 +echo "configure:3770: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3756,12 +3800,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3760: checking for $ac_func" >&5 +echo "configure:3804: 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 3765 "configure" +#line 3809 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3784,7 +3828,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3832: \"$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 @@ -3811,7 +3855,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3815: checking for $ac_word" >&5 +echo "configure:3859: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3847,7 +3891,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3851: checking for $ac_word" >&5 +echo "configure:3895: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3879,7 +3923,7 @@ else fi cat > conftest.$ac_ext <<EOF -#line 3883 "configure" +#line 3927 "configure" #include "confdefs.h" int main() { @@ -3887,7 +3931,7 @@ extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:3891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -3919,7 +3963,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3923: checking for $ac_word" >&5 +echo "configure:3967: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3953,7 +3997,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3957: checking for $ac_word" >&5 +echo "configure:4001: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3989,7 +4033,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3993: checking for $ac_word" >&5 +echo "configure:4037: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4079,7 +4123,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4083: checking for catalogs to be installed" >&5 +echo "configure:4127: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4107,17 +4151,17 @@ echo "configure:4083: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:4111: checking for linux/version.h" >&5 +echo "configure:4155: 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 4116 "configure" +#line 4160 "configure" #include "confdefs.h" #include <linux/version.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4121: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4165: \"$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* @@ -4162,7 +4206,7 @@ fi l= - if test -d $srcdir/po; then + if test -f $srcdir/po/POTFILES.in; then test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then @@ -4182,7 +4226,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:4186: checking for executable suffix" >&5 +echo "configure:4230: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4192,10 +4236,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:4196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:4240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -4218,7 +4262,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4222: checking for $ac_word" >&5 +echo "configure:4266: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4254,7 +4298,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4258: checking for $ac_word" >&5 +echo "configure:4302: 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 @@ -4287,7 +4331,7 @@ test -n "$LEX" || LEX=""$missing_dir/missing flex"" # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4291: checking for $ac_word" >&5 +echo "configure:4335: 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 @@ -4321,7 +4365,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:4325: checking for yywrap in -l$ac_lib" >&5 +echo "configure:4369: 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 @@ -4329,7 +4373,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <<EOF -#line 4333 "configure" +#line 4377 "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 @@ -4340,7 +4384,7 @@ int main() { yywrap() ; return 0; } EOF -if { (eval echo configure:4344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4388: \"$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 @@ -4363,7 +4407,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:4367: checking lex output file root" >&5 +echo "configure:4411: checking lex output file root" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4384,7 +4428,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:4388: checking whether yytext is a pointer" >&5 +echo "configure:4432: checking whether yytext is a pointer" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4396,14 +4440,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext <<EOF -#line 4400 "configure" +#line 4444 "configure" #include "confdefs.h" `cat $LEX_OUTPUT_ROOT.c` int main() { ; return 0; } EOF -if { (eval echo configure:4407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_prog_lex_yytext_pointer=yes else @@ -4426,7 +4470,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:4430: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:4474: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -4460,17 +4504,17 @@ for ac_hdr in string.h strings.h stdlib.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4464: checking for $ac_hdr" >&5 +echo "configure:4508: 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 4469 "configure" +#line 4513 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4474: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4518: \"$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* @@ -4499,12 +4543,12 @@ done for ac_func in sbrk do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4503: checking for $ac_func" >&5 +echo "configure:4547: 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 4508 "configure" +#line 4552 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4527,7 +4571,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4575: \"$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 @@ -4556,12 +4600,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:4560: checking for $ac_hdr that defines DIR" >&5 +echo "configure:4604: 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 4565 "configure" +#line 4609 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_hdr> @@ -4569,7 +4613,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:4573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -4594,7 +4638,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:4598: checking for opendir in -ldir" >&5 +echo "configure:4642: 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 @@ -4602,7 +4646,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF -#line 4606 "configure" +#line 4650 "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 @@ -4613,7 +4657,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:4617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4661: \"$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 @@ -4635,7 +4679,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4639: checking for opendir in -lx" >&5 +echo "configure:4683: 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 @@ -4643,7 +4687,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF -#line 4647 "configure" +#line 4691 "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 @@ -4654,7 +4698,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:4658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4702: \"$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 @@ -4687,12 +4731,12 @@ EOF esac echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4691: checking whether strstr must be declared" >&5 +echo "configure:4735: 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 4696 "configure" +#line 4740 "configure" #include "confdefs.h" #include <stdio.h> @@ -4713,7 +4757,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4734,12 +4778,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:4738: checking whether free must be declared" >&5 +echo "configure:4782: 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 4743 "configure" +#line 4787 "configure" #include "confdefs.h" #include <stdio.h> @@ -4760,7 +4804,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:4764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -4781,12 +4825,12 @@ EOF fi echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6 -echo "configure:4785: checking whether sbrk must be declared" >&5 +echo "configure:4829: 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 4790 "configure" +#line 4834 "configure" #include "confdefs.h" #include <stdio.h> @@ -4807,7 +4851,7 @@ int main() { char *(*pfn) = (char *(*)) sbrk ; return 0; } EOF -if { (eval echo configure:4811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_sbrk=no else @@ -4828,12 +4872,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:4832: checking whether getenv must be declared" >&5 +echo "configure:4876: checking whether getenv must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4837 "configure" +#line 4881 "configure" #include "confdefs.h" #include <stdio.h> @@ -4854,7 +4898,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:4858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -4875,12 +4919,12 @@ EOF fi echo $ac_n "checking whether environ must be declared""... $ac_c" 1>&6 -echo "configure:4879: checking whether environ must be declared" >&5 +echo "configure:4923: 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 4884 "configure" +#line 4928 "configure" #include "confdefs.h" #include <stdio.h> @@ -4901,7 +4945,7 @@ int main() { char *(*pfn) = (char *(*)) environ ; return 0; } EOF -if { (eval echo configure:4905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4949: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_environ=no else @@ -4929,19 +4973,19 @@ fi # constants, while still supporting pre-ANSI compilers which do not # support string concatenation. echo $ac_n "checking whether ANSI C string concatenation works""... $ac_c" 1>&6 -echo "configure:4933: checking whether ANSI C string concatenation works" >&5 +echo "configure:4977: 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 4938 "configure" +#line 4982 "configure" #include "confdefs.h" int main() { char *a = "a" "a"; ; return 0; } EOF -if { (eval echo configure:4945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ld_cv_string_concatenation=yes else @@ -5215,7 +5259,6 @@ s%@build_alias@%$build_alias%g s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g -s%@CC@%$CC%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g @@ -5227,6 +5270,7 @@ 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 diff --git a/contrib/binutils/ld/configure.host b/contrib/binutils/ld/configure.host index b2dbd8d..fc79d83 100644 --- a/contrib/binutils/ld/configure.host +++ b/contrib/binutils/ld/configure.host @@ -16,11 +16,6 @@ NATIVE_LIB_DIRS= case "${host}" in -alpha*-*-linux-gnu*) - 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_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`' - ;; - alpha*-*-netbsd*) # The new BSD `make' has a bug: it doesn't pass empty arguments in # shell commands. So we need to make this value non-empty in order @@ -115,6 +110,12 @@ ia64-*-linux-gnu*) HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`' ;; +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='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`' + NATIVE_LIB_DIRS=/usr/lib/ia64l64 + ;; + mips*-dec-bsd*) HOSTING_CRT0=/usr/lib/crt0.o ;; @@ -183,6 +184,16 @@ powerpc*-*-linux-gnu*) HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` /usr/lib/crtn.o' ;; +s390x-*-linux-gnu*) + HOSTING_CRT0='-dynamic-linker /lib/ld64.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='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L `dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`' + ;; + +s390-*-linux-gnu*) + HOSTING_CRT0='-dynamic-linker /lib/ld.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; elif [ -f /usr/lib/crtbegin.o ]; then echo /usr/lib/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`' + HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else ${CC} --print-file-name=crtend.o; fi` /usr/lib/crtn.o' + ;; + 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='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `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`' @@ -199,6 +210,11 @@ sparc64-*-linux-gnu*) HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`' ;; +x86_64-*-linux-gnu*) + HOSTING_CRT0='-dynamic-linker /lib64/ld-linux-x86-64.so.2 `${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='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`' + ;; + # # Generic configurations: # @@ -213,6 +229,11 @@ sparc64-*-linux-gnu*) HOSTING_LIBS='`${CC} -print-libgcc-file-name` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `${CC} -print-libgcc-file-name` `${CC} --print-file-name=crtend.o` `${CC} --print-file-name=crtn.o`' ;; +*-*-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_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`' + ;; + alpha*-*-*) HOSTING_CRT0=/usr/ccs/lib/crt0.o NATIVE_LIB_DIRS=/usr/ccs/lib diff --git a/contrib/binutils/ld/configure.in b/contrib/binutils/ld/configure.in index 6a69408..34a6ad2 100644 --- a/contrib/binutils/ld/configure.in +++ b/contrib/binutils/ld/configure.in @@ -29,7 +29,7 @@ AC_ARG_ENABLE(64-bit-bfd, *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;; esac],[want64=false])dnl -build_warnings="-W -Wall" +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 @@ -64,7 +64,7 @@ fi AC_PROG_CC AC_PROG_INSTALL -ALL_LINGUAS= +ALL_LINGUAS="fr sv tr es" CY_GNU_GETTEXT AC_EXEEXT diff --git a/contrib/binutils/ld/configure.tgt b/contrib/binutils/ld/configure.tgt index 478eaca..deca323 100644 --- a/contrib/binutils/ld/configure.tgt +++ b/contrib/binutils/ld/configure.tgt @@ -56,18 +56,22 @@ sparc*-*-linux*aout*) targ_emul=sparclinux ;; 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 ;; 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 ;; sparc*-*-lynxos*) targ_emul=sparclynx ;; -sparc64-*-netbsd*) targ_emul=elf64_sparc ;; +sparc64-*-netbsd*) 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].*) @@ -99,7 +103,9 @@ i960-*-rtems*) targ_emul=gld960coff ;; i960-*-elf*) targ_emul=elf32_i960 ;; ia64-*-elf*) targ_emul=elf64_ia64 ;; ia64-*-freebsd*) targ_emul=elf64_ia64 ;; +ia64-*-netbsd*) targ_emul=elf64_ia64 ;; ia64-*-linux*) targ_emul=elf64_ia64 ;; +ia64-*-aix*) targ_emul=elf64_aix ;; m32r-*-*) targ_emul=m32relf ;; m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;; @@ -111,7 +117,6 @@ 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 ;; -i370-*-mvs*) targ_emul=mvs ;; i[3456]86-*-vsta) targ_emul=vsta ;; i[3456]86-go32-rtems*) targ_emul=i386go32 ;; i[3456]86-*-go32) targ_emul=i386go32 ;; @@ -142,15 +147,31 @@ x86_64-*-linux-gnu*) targ_emul=elf_x86_64 tdir_i386linux=${targ_alias}aout ;; i[3456]86-*-sysv[45]*) targ_emul=elf_i386 ;; -i[3456]86-*-solaris2*) targ_emul=elf_i386 ;; +i[3456]86-*-solaris2*) targ_emul=elf_i386_ldso + targ_extra_emuls="elf_i386" + ;; i[3456]86-*-unixware) targ_emul=elf_i386 ;; -i[3456]86-*-solaris*) targ_emul=elf_i386 ;; +i[3456]86-*-solaris*) targ_emul=elf_i386_ldso + targ_extra_emuls="elf_i386" + ;; i[3456]86-*-netbsdelf*) targ_emul=elf_i386 targ_extra_emuls=i386nbsd ;; i[3456]86-*-netbsd*) targ_emul=i386nbsd 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 + ;; i[3456]86-*-netware) targ_emul=i386nw ;; i[3456]86-*-elf*) targ_emul=elf_i386 ;; i[3456]86-*-freebsdaout* | i[3456]86-*-freebsd[12].* | i[3456]86-*-freebsd[12]) @@ -190,9 +211,14 @@ armeb-*-aout) targ_emul=armaoutb ;; arm-*-coff) targ_emul=armcoff ;; arm-*-vxworks) targ_emul=armcoff ;; arm-*-freebsd*) targ_emul=armelf ;; -arm-*-netbsd*) targ_emul=armnbsd ;; +arm-*-netbsdelf*) targ_emul=armelf_nbsd; + targ_extra_emuls="armelf armnbsd" ;; +arm-*-netbsd*) targ_emul=armnbsd; + targ_extra_emuls="armelf armelf_nbsd" ;; +arm-*-openbsd*) targ_emul=armnbsd ;; arm-*-rtems*) targ_emul=armelf ;; arm-*-elf) targ_emul=armelf ;; +arm9e-*-elf) targ_emul=armelf ;; arm-*-oabi) targ_emul=armelf_oabi ;; arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; @@ -212,13 +238,32 @@ xscale-*-elf) targ_emul=armelf ;; h8300-*-hms* | h8300-*-coff* | h8300-*-rtems*) targ_emul=h8300; targ_extra_emuls="h8300h h8300s" ;; +h8300-*-elf*) + targ_emul=h8300elf; + targ_extra_emuls="h8300helf h8300self" + ;; h8500-*-hms* | h8500-*-coff*) 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 + ;; +sh*eb-*-linux*) targ_emul=shelf_linux - targ_extra_emuls=shlelf_linux + ;; +sh*-*-linux*) + targ_emul=shlelf_linux + ;; +sh*le-*-netbsdelf*) + targ_emul=shlelf_nbsd + targ_extra_emuls=shelf_nbsd + ;; +sh*-*-netbsdelf*) + targ_emul=shelf_nbsd + targ_extra_emuls=shlelf_nbsd ;; sh-*-elf* | sh-*-rtemself*) targ_emul=shelf @@ -244,8 +289,13 @@ m68k-*-linux-gnu*) targ_emul=m68kelf ;; m68*-*-gnu*) targ_emul=m68kelf ;; m68*-*-lynxos*) targ_emul=m68klynx ;; -m68*-hp*-netbsd*) targ_emul=m68k4knbsd ;; -m68*-*-netbsd*) targ_emul=m68knbsd ;; +m68*-*-netbsd*4k*) targ_emul=m68k4knbsd + targ_extra_emuls="m68knbsd m68kelfnbsd" ;; +m68*-*-netbsdelf*) targ_emul=m68kelfnbsd + targ_extra_emuls="m68knbsd m68k4knbsd" ;; +m68*-*-netbsdaout* | m68*-*-netbsd*) + targ_emul=m68knbsd + targ_extra_emuls="m68kelfnbsd m68k4knbsd" ;; m68*-*-psos*) targ_emul=m68kpsos ;; m68*-*-rtemscoff*) targ_emul=m68kcoff ;; m68*-*-rtems*) targ_emul=m68kelf ;; @@ -268,7 +318,12 @@ mips*-sgi-irix*) targ_emul=mipsbig ;; mips*el-*-ecoff*) targ_emul=mipsidtl ;; mips*-*-ecoff*) targ_emul=mipsidt ;; mips*-dec-bsd*) targ_emul=mipsbsd ;; -mips*-dec-netbsd*) targ_emul=elf32lmip ;; +mips*el-*-netbsd*) targ_emul=elf32lmip + targ_extra_emuls="elf32bmip" + ;; +mips*-*-netbsd*) targ_emul=elf32bmip + targ_extra_emuls="elf32lmip" + ;; mips*-*-bsd*) targ_emul=mipsbig ;; mips*vr4300el-*-elf*) targ_emul=elf32l4300 ;; mips*vr4300-*-elf*) targ_emul=elf32b4300 ;; @@ -290,6 +345,9 @@ mips*-*-linux-gnu*) targ_emul=elf32btsmip ;; mips*-*-lnews*) targ_emul=mipslnews ;; mips*-*-sysv4*) targ_emul=elf32btsmip ;; +mmix-*-*) targ_emul=mmo + targ_extra_emuls=elf64mmix + ;; mn10200-*-*) targ_emul=mn10200 ;; mn10300-*-*) targ_emul=mn10300 ;; alpha*-*-freebsd*) targ_emul=elf64alpha @@ -305,26 +363,43 @@ alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha alpha*-*-osf*) targ_emul=alpha ;; alpha*-*-gnu*) targ_emul=elf64alpha ;; alpha*-*-netware*) targ_emul=alpha ;; -alpha*-*-netbsd*) targ_emul=elf64alpha ;; +alpha*-*-netbsd*) targ_emul=elf64alpha_nbsd ;; z8k-*-coff) targ_emul=z8002; targ_extra_emuls=z8001 ;; ns32k-pc532-mach* | ns32k-pc532-ux*) targ_emul=pc532macha ;; ns32k-pc532-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd ;; +openrisc-*-*) targ_emul=elf32openrisc ;; +pdp11-*-*) targ_emul=pdp11 ;; +pjl*-*-*) targ_emul=pjlelf ; targ_extra_emuls="elf_i386" ;; +pj*-*-*) targ_emul=pjelf ;; powerpc-*-freebsd*) targ_emul=elf32ppc; targ_extra_emuls=elf32ppcsim; targ_extra_libpath=elf32ppc; tdir_elf32ppcsim=`echo ${targ_alias} | sed -e 's/ppc/ppcsim/'` ;; -powerpc-*-linux-gnu*) targ_emul=elf32ppclinux; - targ_extra_emuls="elf32ppc elf32ppcsim"; - targ_extra_libpath=elf32ppc ;; -pjl*-*-*) targ_emul=pjlelf ; targ_extra_emuls="elf_i386" ;; -pj*-*-*) targ_emul=pjelf ;; -powerpc-*-elf* | powerpc-*-eabi* | powerpc-*-sysv* \ - | powerpc-*-netbsd* | powerpc-*-vxworks*) - targ_emul=elf32ppc targ_extra_emuls="elf32ppclinux elf32ppcsim";; -powerpcle-*-elf* | powerpcle-*-eabi* | powerpcle-*-solaris* \ - | powerpcle-*-sysv* | powerpcle-*-vxworks*) - targ_emul=elf32lppc targ_extra_emuls="elf32ppcsim";; +powerpc*-*-linux*) + case "${targ}" in + *64*) targ_emul=elf64ppc + targ_extra_emuls="elf32ppclinux elf32ppc elf32ppcsim" ;; + *) targ_emul=elf32ppclinux + targ_extra_emuls="elf32ppc elf32ppcsim" + targ_extra_libpath=elf32ppc ;; + 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 elf32ppcsim" ;; + *) targ_emul=elf32lppc + targ_extra_emuls="elf32ppcsim" ;; + esac ;; +powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \ + | powerpc*-*-netbsd* | powerpc*-*-vxworks*) + case "${targ}" in + *64*) targ_emul=elf64ppc + targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim" ;; + *) targ_emul=elf32ppc + targ_extra_emuls="elf32ppclinux elf32ppcsim" ;; + esac ;; powerpcle-*-rtems*) targ_emul=elf32leppc ;; powerpc-*-rtems*) targ_emul=elf32ppc ;; powerpc-*-macos*) targ_emul=ppcmacos ;; @@ -343,10 +418,13 @@ v850-*-*) targ_emul=v850 ;; v850e-*-*) targ_emul=v850 ;; v850ea-*-*) targ_emul=v850 ;; w65-*-*) targ_emul=w65 ;; +xstormy16-*-*) targ_emul=elf32xstormy16 ;; fr30-*-*) targ_emul=elf32fr30 ;; mcore-*-pe) targ_emul=mcorepe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;; mcore-*-elf) targ_emul=elf32mcore ;; +s390x-*-linux*) targ_emul=elf64_s390 ;; +s390-*-linux*) targ_emul=elf_s390 ;; *-*-ieee*) targ_emul=vanilla ;; *) diff --git a/contrib/binutils/ld/deffilep.y b/contrib/binutils/ld/deffilep.y index d6d32c8..51d17f8 100644 --- a/contrib/binutils/ld/deffilep.y +++ b/contrib/binutils/ld/deffilep.y @@ -1,6 +1,7 @@ %{ /* deffilep.y - parser for .def files */ -/* Copyright 1995, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +/* Copyright 1995, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -19,8 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <stdio.h> -#include <ctype.h> #include "libiberty.h" +#include "safe-ctype.h" #include "bfd.h" #include "sysdep.h" #include "ld.h" @@ -77,14 +78,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define yytable def_yytable #define yycheck def_yycheck -static int def_lex (); - static void def_description PARAMS ((const char *)); static void def_exports PARAMS ((const char *, const char *, int, int)); static void def_heapsize PARAMS ((int, int)); static void def_import PARAMS ((const char *, const char *, const char *, const char *, int)); static void def_library PARAMS ((const char *, int)); +static def_file_module *def_stash_module PARAMS ((def_file *, const char *)); static void def_name PARAMS ((const char *, int)); static void def_section PARAMS ((const char *, int)); static void def_section_alt PARAMS ((const char *, const char *)); @@ -93,6 +93,9 @@ static void def_version PARAMS ((int, int)); static void def_directive PARAMS ((char *)); static int def_parse PARAMS ((void)); static int def_error PARAMS ((const char *)); +static void put_buf PARAMS ((char)); +static int def_getc PARAMS ((void)); +static int def_ungetc PARAMS ((int)); static int def_lex PARAMS ((void)); static int lex_forced_token = 0; @@ -493,7 +496,7 @@ def_file_add_export (def, external_name, internal_name, ordinal) static def_file_module * def_stash_module (def, name) def_file *def; - char *name; + const char *name; { def_file_module *s; for (s=def->modules; s; s=s->next) @@ -530,7 +533,7 @@ def_file_add_import (def, name, module, ordinal, internal_name) if (name) i->name = xstrdup (name); if (module) - i->module = def_stash_module(def, module); + i->module = def_stash_module (def, module); i->ordinal = ordinal; if (internal_name) i->internal_name = xstrdup (internal_name); @@ -569,10 +572,10 @@ def_file_add_directive (my_def, param, len) while (param < pend) { - while (param < pend && isspace (*param)) + while (param < pend && ISSPACE (*param)) param++; for (tend = param + 1; - tend < pend && !(isspace (tend[-1]) && *tend == '-'); + tend < pend && !(ISSPACE (tend[-1]) && *tend == '-'); tend++); for (i = 0; diropts[i].param; i++) @@ -946,10 +949,10 @@ def_lex () /* must be something else */ saw_newline = 0; - if (isdigit (c)) + if (ISDIGIT (c)) { bufptr = 0; - while (c != EOF && (isxdigit (c) || (c == 'x'))) + while (c != EOF && (ISXDIGIT (c) || (c == 'x'))) { put_buf (c); c = def_getc (); @@ -963,10 +966,10 @@ def_lex () return NUMBER; } - if (isalpha (c) || strchr ("$:-_?", c)) + if (ISALPHA (c) || strchr ("$:-_?", c)) { bufptr = 0; - while (c != EOF && (isalnum (c) || strchr ("$:-_?/@", c))) + while (c != EOF && (ISALNUM (c) || strchr ("$:-_?/@", c))) { put_buf (c); c = def_getc (); diff --git a/contrib/binutils/ld/emulparams/armelf.sh b/contrib/binutils/ld/emulparams/armelf.sh index 338b9ce..0e8ebc5 100644 --- a/contrib/binutils/ld/emulparams/armelf.sh +++ b/contrib/binutils/ld/emulparams/armelf.sh @@ -10,6 +10,8 @@ OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)' OTHER_BSS_SYMBOLS='__bss_start__ = .;' OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;' +DATA_START_SYMBOLS='__data_start = . ;'; + GENERATE_SHLIB_SCRIPT=yes ARCH=arm @@ -18,6 +20,5 @@ MAXPAGESIZE=256 ENTRY=_start EMBEDDED=yes -# Hmmm, there's got to be a better way. This sets the stack to the -# top of the simulator memory (2^19 bytes). -OTHER_RELOCATING_SECTIONS='.stack 0x80000 : { _stack = .; *(.stack) }' +# This sets the stack to the top of the simulator memory (2^19 bytes). +STACK_ADDR=0x80000 diff --git a/contrib/binutils/ld/emulparams/armelf_nbsd.sh b/contrib/binutils/ld/emulparams/armelf_nbsd.sh new file mode 100644 index 0000000..571483c --- /dev/null +++ b/contrib/binutils/ld/emulparams/armelf_nbsd.sh @@ -0,0 +1,6 @@ +. ${srcdir}/emulparams/armelf.sh +MAXPAGESIZE=0x8000 +TEXT_START_ADDR=0x00008000 + +unset STACK_ADDR +unset EMBEDDED diff --git a/contrib/binutils/ld/emulparams/armelf_oabi.sh b/contrib/binutils/ld/emulparams/armelf_oabi.sh index d568328..f1c967d 100644 --- a/contrib/binutils/ld/emulparams/armelf_oabi.sh +++ b/contrib/binutils/ld/emulparams/armelf_oabi.sh @@ -16,6 +16,5 @@ MAXPAGESIZE=256 ENTRY=_start EMBEDDED=yes -# Hmmm, there's got to be a better way. This sets the stack to the -# top of the simulator memory (2^19 bytes). -OTHER_RELOCATING_SECTIONS='.stack 0x80000 : { _stack = .; *(.stack) }' +# This sets the stack to the top of the simulator memory (2^19 bytes). +STACK_ADDR=0x80000 diff --git a/contrib/binutils/ld/emulparams/elf32_sparc.sh b/contrib/binutils/ld/emulparams/elf32_sparc.sh index 74e2326..d8b81e7 100644 --- a/contrib/binutils/ld/emulparams/elf32_sparc.sh +++ b/contrib/binutils/ld/emulparams/elf32_sparc.sh @@ -9,3 +9,4 @@ MACHINE= TEMPLATE_NAME=elf32 DATA_PLT= GENERATE_SHLIB_SCRIPT=yes +NO_SMALL_DATA=yes diff --git a/contrib/binutils/ld/emulparams/elf32b4300.sh b/contrib/binutils/ld/emulparams/elf32b4300.sh index 24f8d98..4bfdd6e 100644 --- a/contrib/binutils/ld/emulparams/elf32b4300.sh +++ b/contrib/binutils/ld/emulparams/elf32b4300.sh @@ -1,29 +1,10 @@ -SCRIPT_NAME=elf -OUTPUT_FORMAT="elf32-bigmips" -BIG_OUTPUT_FORMAT="elf32-bigmips" -LITTLE_OUTPUT_FORMAT="elf32-littlemips" +# If you change this file, please also look at files which source this one: +# elf32l4300.sh + +EMBEDDED=yes +. ${srcdir}/emulparams/elf32bmip.sh TEXT_START_ADDR=0xa0020000 -MAXPAGESIZE=0x40000 -INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }' -OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' -OTHER_GOT_SYMBOLS=' - _gp = ALIGN(16) + 0x7ff0; -' -OTHER_GOT_SECTIONS=' - .lit8 : { *(.lit8) } - .lit4 : { *(.lit4) } -' -TEXT_START_SYMBOLS='_ftext = . ;' -DATA_START_SYMBOLS='_fdata = . ;' -OTHER_BSS_SYMBOLS='_fbss = .;' +unset NONPAGED_TEXT_START_ADDR +unset SHLIB_TEXT_START_ADDR EXECUTABLE_SYMBOLS='_DYNAMIC_LINK = 0;' -OTHER_SECTIONS=' - .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } - .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } -' -ARCH=mips -MACHINE= -TEMPLATE_NAME=elf32 -GENERATE_SHLIB_SCRIPT=yes DYNAMIC_LINK=false -EMBEDDED=yes diff --git a/contrib/binutils/ld/emulparams/elf32l4300.sh b/contrib/binutils/ld/emulparams/elf32l4300.sh index 690de88..865792a 100644 --- a/contrib/binutils/ld/emulparams/elf32l4300.sh +++ b/contrib/binutils/ld/emulparams/elf32l4300.sh @@ -1,29 +1,4 @@ -SCRIPT_NAME=elf +. ${srcdir}/emulparams/elf32b4300.sh OUTPUT_FORMAT="elf32-littlemips" BIG_OUTPUT_FORMAT="elf32-bigmips" LITTLE_OUTPUT_FORMAT="elf32-littlemips" -TEXT_START_ADDR=0xa0020000 -MAXPAGESIZE=0x40000 -INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }' -OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' -OTHER_GOT_SYMBOLS=' - _gp = ALIGN(16) + 0x7ff0; -' -OTHER_GOT_SECTIONS=' - .lit8 : { *(.lit8) } - .lit4 : { *(.lit4) } -' -TEXT_START_SYMBOLS='_ftext = . ;' -DATA_START_SYMBOLS='_fdata = . ;' -OTHER_BSS_SYMBOLS='_fbss = .;' -EXECUTABLE_SYMBOLS='_DYNAMIC_LINK = 0;' -OTHER_SECTIONS=' - .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } - .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } -' -ARCH=mips -MACHINE= -TEMPLATE_NAME=elf32 -GENERATE_SHLIB_SCRIPT=yes -DYNAMIC_LINK=false -EMBEDDED=yes diff --git a/contrib/binutils/ld/emulparams/elf32lppc.sh b/contrib/binutils/ld/emulparams/elf32lppc.sh index bc9125d..18cce48 100644 --- a/contrib/binutils/ld/emulparams/elf32lppc.sh +++ b/contrib/binutils/ld/emulparams/elf32lppc.sh @@ -1,18 +1,5 @@ -TEMPLATE_NAME=elf32 -# If you change this, please also look at: -# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh -GENERATE_SHLIB_SCRIPT=yes -SCRIPT_NAME=elf +# If you change this file, please also look at files which source this one: +# elf32lppcsim.sh + +. ${srcdir}/emulparams/elf32ppc.sh OUTPUT_FORMAT="elf32-powerpcle" -TEXT_START_ADDR=0x01800000 -MAXPAGESIZE=0x10000 -ARCH=powerpc -MACHINE= -BSS_PLT= -EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);' -OTHER_BSS_END_SYMBOLS='__end = .;' -OTHER_READWRITE_SECTIONS=' - .fixup : { *(.fixup) } - .got1 : { *(.got1) } - .got2 : { *(.got2) } -' diff --git a/contrib/binutils/ld/emulparams/elf32lppcsim.sh b/contrib/binutils/ld/emulparams/elf32lppcsim.sh index 74959f8..e743852 100644 --- a/contrib/binutils/ld/emulparams/elf32lppcsim.sh +++ b/contrib/binutils/ld/emulparams/elf32lppcsim.sh @@ -1,18 +1,2 @@ -TEMPLATE_NAME=elf32 -# If you change this, please also look at: -# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh -GENERATE_SHLIB_SCRIPT=yes -SCRIPT_NAME=elf -OUTPUT_FORMAT="elf32-powerpcle" +. ${srcdir}/emulparams/elf32lppc.sh TEXT_START_ADDR=0x10000000 -MAXPAGESIZE=0x10000 -ARCH=powerpc -MACHINE= -BSS_PLT= -EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);' -OTHER_BSS_END_SYMBOLS='__end = .;' -OTHER_READWRITE_SECTIONS=' - .fixup : { *(.fixup) } - .got1 : { *(.got1) } - .got2 : { *(.got2) } -' diff --git a/contrib/binutils/ld/emulparams/elf32ppc.sh b/contrib/binutils/ld/emulparams/elf32ppc.sh index 2220810..261e4bf 100644 --- a/contrib/binutils/ld/emulparams/elf32ppc.sh +++ b/contrib/binutils/ld/emulparams/elf32ppc.sh @@ -1,6 +1,7 @@ +# If you change this file, please also look at files which source this one: +# elf32lppc.sh elf32ppclinux.sh elf32ppcsim.sh + TEMPLATE_NAME=elf32 -# If you change this, please also look at: -# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh GENERATE_SHLIB_SCRIPT=yes SCRIPT_NAME=elf OUTPUT_FORMAT="elf32-powerpc" @@ -11,8 +12,8 @@ MACHINE= BSS_PLT= EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);' OTHER_BSS_END_SYMBOLS='__end = .;' -OTHER_READWRITE_SECTIONS=' - .fixup : { *(.fixup) } - .got1 : { *(.got1) } - .got2 : { *(.got2) } -' +OTHER_READWRITE_SECTIONS=" + .fixup ${RELOCATING-0} : { *(.fixup) } + .got1 ${RELOCATING-0} : { *(.got1) } + .got2 ${RELOCATING-0} : { *(.got2) } +" diff --git a/contrib/binutils/ld/emulparams/elf32ppclinux.sh b/contrib/binutils/ld/emulparams/elf32ppclinux.sh index 7c458a2..5ced00d 100644 --- a/contrib/binutils/ld/emulparams/elf32ppclinux.sh +++ b/contrib/binutils/ld/emulparams/elf32ppclinux.sh @@ -1,18 +1,8 @@ -TEMPLATE_NAME=elf32 -# If you change this, please also look at: -# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh -GENERATE_SHLIB_SCRIPT=yes -SCRIPT_NAME=elf -OUTPUT_FORMAT="elf32-powerpc" +. ${srcdir}/emulparams/elf32ppc.sh TEXT_START_ADDR=0x10000000 -MAXPAGESIZE=0x10000 -ARCH=powerpc -MACHINE= -BSS_PLT= -OTHER_RELOCATING_SECTIONS=' - /DISCARD/ : { *(.fixup) } -' -OTHER_READWRITE_SECTIONS=' - .got1 : { *(.got1) } - .got2 : { *(.got2) } -' +unset EXECUTABLE_SYMBOLS +unset OTHER_BSS_END_SYMBOLS +test -z "${RELOCATING}" || OTHER_SECTIONS="/DISCARD/ : { *(.fixup) }" +OTHER_READWRITE_SECTIONS=" + .got1 ${RELOCATING-0} : { *(.got1) } + .got2 ${RELOCATING-0} : { *(.got2) }" diff --git a/contrib/binutils/ld/emulparams/elf32ppcsim.sh b/contrib/binutils/ld/emulparams/elf32ppcsim.sh index e25a170..c3466cf 100644 --- a/contrib/binutils/ld/emulparams/elf32ppcsim.sh +++ b/contrib/binutils/ld/emulparams/elf32ppcsim.sh @@ -1,18 +1,2 @@ -TEMPLATE_NAME=elf32 -# If you change this, please also look at: -# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh -GENERATE_SHLIB_SCRIPT=yes -SCRIPT_NAME=elf -OUTPUT_FORMAT="elf32-powerpc" +. ${srcdir}/emulparams/elf32ppc.sh TEXT_START_ADDR=0x10000000 -MAXPAGESIZE=0x10000 -ARCH=powerpc -MACHINE= -BSS_PLT= -EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);' -OTHER_BSS_END_SYMBOLS='__end = .;' -OTHER_READWRITE_SECTIONS=' - .fixup : { *(.fixup) } - .got1 : { *(.got1) } - .got2 : { *(.got2) } -' diff --git a/contrib/binutils/ld/emulparams/elf64_ia64.sh b/contrib/binutils/ld/emulparams/elf64_ia64.sh index 158db9c..0699d3d 100644 --- a/contrib/binutils/ld/emulparams/elf64_ia64.sh +++ b/contrib/binutils/ld/emulparams/elf64_ia64.sh @@ -11,6 +11,11 @@ TEXT_START_ADDR="0x4000000000000000" DATA_ADDR="0x6000000000000000 + (. & (${MAXPAGESIZE} - 1))" GENERATE_SHLIB_SCRIPT=yes NOP=0x00300000010070000002000001000400 # a bundle full of nops -OTHER_GOT_SECTIONS='.IA_64.pltoff : { *(.IA_64.pltoff) }' -OTHER_PLT_RELOC_SECTIONS='.rela.IA_64.pltoff : { *(.rela.IA_64.pltoff) }' -OTHER_READONLY_SECTIONS='.opd : { *(.opd) } .IA_64.unwind_info : { *(.IA_64.unwind_info*) } .IA_64.unwind : { *(.IA_64.unwind*) }' +OTHER_GOT_SECTIONS=" + .IA_64.pltoff ${RELOCATING-0} : { *(.IA_64.pltoff) }" +OTHER_PLT_RELOC_SECTIONS=" + .rela.IA_64.pltoff ${RELOCATING-0} : { *(.rela.IA_64.pltoff) }" +OTHER_READONLY_SECTIONS=" + .opd ${RELOCATING-0} : { *(.opd) } + .IA_64.unwind_info ${RELOCATING-0} : { *(.IA_64.unwind_info*${RELOCATING+ .gnu.linkonce.ia64unwi.*}) } + .IA_64.unwind ${RELOCATING-0} : { *(.IA_64.unwind*${RELOCATING+ .gnu.linkonce.ia64unw.*}) }" diff --git a/contrib/binutils/ld/emulparams/elf64_sparc.sh b/contrib/binutils/ld/emulparams/elf64_sparc.sh index b0a58ea..dae3f21 100644 --- a/contrib/binutils/ld/emulparams/elf64_sparc.sh +++ b/contrib/binutils/ld/emulparams/elf64_sparc.sh @@ -8,6 +8,7 @@ MACHINE= DATA_PLT= GENERATE_SHLIB_SCRIPT=yes NOP=0x01000000 +NO_SMALL_DATA=yes case "$target" in sparc*-solaris*) diff --git a/contrib/binutils/ld/emulparams/elf64alpha.sh b/contrib/binutils/ld/emulparams/elf64alpha.sh index 5c69816..39247ea 100644 --- a/contrib/binutils/ld/emulparams/elf64alpha.sh +++ b/contrib/binutils/ld/emulparams/elf64alpha.sh @@ -10,9 +10,10 @@ ARCH=alpha MACHINE= GENERATE_SHLIB_SCRIPT=yes DATA_PLT= -NOP=0x47ff041f +NOP=0x2ffe0000 # unop -OTHER_READONLY_SECTIONS='.reginfo : { *(.reginfo) }' +OTHER_READONLY_SECTIONS=" + .reginfo ${RELOCATING-0} : { *(.reginfo) }" # This code gets inserted into the generic elf32.sc linker script # and allows us to define our own command line switches. @@ -24,7 +25,7 @@ PARSE_AND_LIST_PROLOGUE=' static int elf64alpha_32bit = 0; struct ld_emulation_xfer_struct ld_elf64alpha_emulation; -static void gld_elf64alpha_finish (); +static void gld_elf64alpha_finish PARAMS ((void)); ' PARSE_AND_LIST_LONGOPTS=' diff --git a/contrib/binutils/ld/emulparams/elf64alpha_nbsd.sh b/contrib/binutils/ld/emulparams/elf64alpha_nbsd.sh new file mode 100644 index 0000000..8116f48 --- /dev/null +++ b/contrib/binutils/ld/emulparams/elf64alpha_nbsd.sh @@ -0,0 +1,2 @@ +. ${srcdir}/emulparams/elf64alpha.sh +ENTRY=__start diff --git a/contrib/binutils/ld/emulparams/elf64lppc.sh b/contrib/binutils/ld/emulparams/elf64lppc.sh new file mode 100644 index 0000000..1c47493 --- /dev/null +++ b/contrib/binutils/ld/emulparams/elf64lppc.sh @@ -0,0 +1,3 @@ +. ${srcdir}/emulparams/elf64ppc.sh +OUTPUT_FORMAT="elf64-powerpcle" +NOP=0x00000060 diff --git a/contrib/binutils/ld/emulparams/elf64ppc.sh b/contrib/binutils/ld/emulparams/elf64ppc.sh new file mode 100644 index 0000000..2169862 --- /dev/null +++ b/contrib/binutils/ld/emulparams/elf64ppc.sh @@ -0,0 +1,29 @@ +TEMPLATE_NAME=elf32 +EXTRA_EM_FILE=ppc64elf +ELFSIZE=64 +GENERATE_SHLIB_SCRIPT=yes +SCRIPT_NAME=elf +OUTPUT_FORMAT="elf64-powerpc" +TEXT_START_ADDR=0x10000000 +MAXPAGESIZE=0x40000 +ARCH=powerpc +MACHINE= +NOP=0x60000000 +EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);' +OTHER_BSS_END_SYMBOLS='__end = .;' +CTOR_START='PROVIDE (__CTOR_LIST__ = .); PROVIDE (___CTOR_LIST__ = .);' +CTOR_END='PROVIDE (__CTOR_END__ = .); PROVIDE (___CTOR_END__ = .);' +DTOR_START='PROVIDE (__DTOR_LIST__ = .); PROVIDE (___DTOR_LIST__ = .);' +DTOR_END='PROVIDE (__DTOR_END__ = .); PROVIDE (___DTOR_END__ = .);' +BSS_PLT= +OTHER_BSS_SYMBOLS=" + .tocbss ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.tocbss)}" +OTHER_PLT_RELOC_SECTIONS=" + .rela.tocbss ${RELOCATING-0} : { *(.rela.tocbss) }" +OTHER_GOT_SECTIONS=" + .toc ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.toc) }" +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)} : { *(.opd) }" diff --git a/contrib/binutils/ld/emulparams/elf_i386.sh b/contrib/binutils/ld/emulparams/elf_i386.sh index dff567b..53dd54b 100644 --- a/contrib/binutils/ld/emulparams/elf_i386.sh +++ b/contrib/binutils/ld/emulparams/elf_i386.sh @@ -5,6 +5,7 @@ MAXPAGESIZE=0x1000 NONPAGED_TEXT_START_ADDR=0x08048000 ARCH=i386 MACHINE= -NOP=0x9090 +NOP=0x90909090 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes +NO_SMALL_DATA=yes diff --git a/contrib/binutils/ld/emulparams/elf_i386_chaos.sh b/contrib/binutils/ld/emulparams/elf_i386_chaos.sh index 32e7719..f7ad3cf 100644 --- a/contrib/binutils/ld/emulparams/elf_i386_chaos.sh +++ b/contrib/binutils/ld/emulparams/elf_i386_chaos.sh @@ -5,6 +5,7 @@ MAXPAGESIZE=0x1000 NONPAGED_TEXT_START_ADDR=0x40000000 ARCH=i386 MACHINE= -NOP=0x9090 +NOP=0x90909090 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes +NO_SMALL_DATA=yes diff --git a/contrib/binutils/ld/emulparams/elf_i386_ldso.sh b/contrib/binutils/ld/emulparams/elf_i386_ldso.sh new file mode 100644 index 0000000..a477a69 --- /dev/null +++ b/contrib/binutils/ld/emulparams/elf_i386_ldso.sh @@ -0,0 +1,12 @@ +SCRIPT_NAME=elf +OUTPUT_FORMAT="elf32-i386" +TEXT_START_ADDR=0x08048000 +MAXPAGESIZE=0x1000 +NONPAGED_TEXT_START_ADDR=0x08048000 +ARCH=i386 +MACHINE= +NOP=0x90909090 +TEMPLATE_NAME=elf32 +GENERATE_SHLIB_SCRIPT=yes +ELF_INTERPRETER_NAME=\"/usr/lib/ld.so.1\" +NO_SMALL_DATA=yes diff --git a/contrib/binutils/ld/emulparams/elf_x86_64.sh b/contrib/binutils/ld/emulparams/elf_x86_64.sh index 635748f..27931c7 100644 --- a/contrib/binutils/ld/emulparams/elf_x86_64.sh +++ b/contrib/binutils/ld/emulparams/elf_x86_64.sh @@ -6,6 +6,7 @@ MAXPAGESIZE=0x100000 NONPAGED_TEXT_START_ADDR=0x400000 ARCH=i386 MACHINE= -NOP=0x9090 +NOP=0x90909090 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes +NO_SMALL_DATA=yes diff --git a/contrib/binutils/ld/emulparams/i386moss.sh b/contrib/binutils/ld/emulparams/i386moss.sh index a5e0e05..eece447 100644 --- a/contrib/binutils/ld/emulparams/i386moss.sh +++ b/contrib/binutils/ld/emulparams/i386moss.sh @@ -5,6 +5,6 @@ MAXPAGESIZE=0x1000 NONPAGED_TEXT_START_ADDR=0x00002000 ARCH=i386 MACHINE= -NOP=0x9090 +NOP=0x90909090 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes diff --git a/contrib/binutils/ld/emulparams/i386nw.sh b/contrib/binutils/ld/emulparams/i386nw.sh index e70ed67..621b475 100644 --- a/contrib/binutils/ld/emulparams/i386nw.sh +++ b/contrib/binutils/ld/emulparams/i386nw.sh @@ -4,6 +4,6 @@ TEXT_START_ADDR=0x08000000 MAXPAGESIZE=0x1000 NONPAGED_TEXT_START_ADDR=0x08000000 ARCH=i386 -NOP=0x9090 +NOP=0x90909090 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes diff --git a/contrib/binutils/ld/emulparams/sh.sh b/contrib/binutils/ld/emulparams/sh.sh index 38844fb..52d1443 100644 --- a/contrib/binutils/ld/emulparams/sh.sh +++ b/contrib/binutils/ld/emulparams/sh.sh @@ -1,3 +1,6 @@ +# If you change this file, please also look at files which source this one: +# shl.sh + SCRIPT_NAME=sh OUTPUT_FORMAT="coff-sh" TEXT_START_ADDR=0x8000 diff --git a/contrib/binutils/ld/emultempl/armcoff.em b/contrib/binutils/ld/emultempl/armcoff.em index ab70843..783efa9 100644 --- a/contrib/binutils/ld/emultempl/armcoff.em +++ b/contrib/binutils/ld/emultempl/armcoff.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, 1993, 1996, 1997, 1998, 1999, 2000 + Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Steve Chamberlain steve@cygnus.com @@ -46,6 +46,7 @@ static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile)); static int gld${EMULATION_NAME}_parse_args PARAMS((int, char **)); static void gld${EMULATION_NAME}_list_options PARAMS ((FILE *)); static void gld${EMULATION_NAME}_finish PARAMS ((void)); +static void gld${EMULATION_NAME}_after_open PARAMS ((void)); /* If true, then interworking stubs which support calls to old, non-interworking aware ARM code should be generated. */ diff --git a/contrib/binutils/ld/emultempl/armelf.em b/contrib/binutils/ld/emultempl/armelf.em index 0d1b8ed..c570486 100644 --- a/contrib/binutils/ld/emultempl/armelf.em +++ b/contrib/binutils/ld/emultempl/armelf.em @@ -97,13 +97,16 @@ arm_elf_before_allocation () } -static void gld${EMULATION_NAME}_finish PARAMS ((void)); +static void arm_elf_finish PARAMS ((void)); static void -gld${EMULATION_NAME}_finish PARAMS((void)) +arm_elf_finish () { struct bfd_link_hash_entry * h; + /* Call the elf32.em routine. */ + gld${EMULATION_NAME}_finish (); + if (thumb_entry_symbol == NULL) return; @@ -184,4 +187,4 @@ LDEMUL_BEFORE_ALLOCATION=arm_elf_before_allocation LDEMUL_BEFORE_PARSE=gld"${EMULATION_NAME}"_before_parse # Call the extra arm-elf function -LDEMUL_FINISH=gld${EMULATION_NAME}_finish +LDEMUL_FINISH=arm_elf_finish diff --git a/contrib/binutils/ld/emultempl/armelf_oabi.em b/contrib/binutils/ld/emultempl/armelf_oabi.em index 1f2deb38..b0c5669 100644 --- a/contrib/binutils/ld/emultempl/armelf_oabi.em +++ b/contrib/binutils/ld/emultempl/armelf_oabi.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, 1993, 1996, 1997, 1998, 1999, 2000 + Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Steve Chamberlain steve@cygnus.com @@ -50,6 +50,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); static void gld${EMULATION_NAME}_before_allocation PARAMS ((void)); static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile)); +static void gld${EMULATION_NAME}_after_open PARAMS ((void)); static void gld${EMULATION_NAME}_before_parse () diff --git a/contrib/binutils/ld/emultempl/elf32.em b/contrib/binutils/ld/emultempl/elf32.em index 76aaa8a..b2fd969 100644 --- a/contrib/binutils/ld/emultempl/elf32.em +++ b/contrib/binutils/ld/emultempl/elf32.em @@ -3,6 +3,11 @@ # This file is now misnamed, because it supports both 32 bit and 64 bit # ELF emulations. test -z "${ELFSIZE}" && ELFSIZE=32 +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! */ @@ -33,8 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" #include "libiberty.h" - -#include <ctype.h> +#include "safe-ctype.h" #include "bfdlink.h" @@ -48,27 +52,38 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ldgram.h" #include "elf/common.h" -static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); +static void gld${EMULATION_NAME}_before_parse + PARAMS ((void)); static void gld${EMULATION_NAME}_vercheck PARAMS ((lang_input_statement_type *)); static void gld${EMULATION_NAME}_stat_needed PARAMS ((lang_input_statement_type *)); -static boolean gld${EMULATION_NAME}_try_needed PARAMS ((const char *, int)); +static boolean gld${EMULATION_NAME}_try_needed + PARAMS ((const char *, int)); static boolean gld${EMULATION_NAME}_search_needed PARAMS ((const char *, const char *, int)); static void gld${EMULATION_NAME}_check_needed PARAMS ((lang_input_statement_type *)); -static void gld${EMULATION_NAME}_after_open PARAMS ((void)); -static void gld${EMULATION_NAME}_find_exp_assignment PARAMS ((etree_type *)); +static void gld${EMULATION_NAME}_after_open + PARAMS ((void)); +static void gld${EMULATION_NAME}_find_exp_assignment + PARAMS ((etree_type *)); static void gld${EMULATION_NAME}_find_statement_assignment PARAMS ((lang_statement_union_type *)); -static void gld${EMULATION_NAME}_before_allocation PARAMS ((void)); +static void gld${EMULATION_NAME}_before_allocation + PARAMS ((void)); static boolean gld${EMULATION_NAME}_open_dynamic_archive PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *)); -static lang_output_section_statement_type *output_rel_find PARAMS ((void)); +static lang_output_section_statement_type *output_rel_find + PARAMS ((void)); +static asection *output_prev_sec_find + PARAMS ((lang_output_section_statement_type *)); static boolean gld${EMULATION_NAME}_place_orphan PARAMS ((lang_input_statement_type *, asection *)); -static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile)); +static void gld${EMULATION_NAME}_finish + PARAMS ((void)); +static char *gld${EMULATION_NAME}_get_script + PARAMS ((int *isfile)); EOF @@ -90,7 +105,15 @@ cat >>e${EMULATION_NAME}.c <<EOF static void gld${EMULATION_NAME}_before_parse () { - ldfile_output_architecture = bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`; + const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}"); + if (arch) + { + ldfile_output_architecture = arch->arch; + ldfile_output_machine = arch->mach; + ldfile_output_machine_name = arch->printable_name; + } + else + ldfile_output_architecture = bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`; config.dynamic_link = ${DYNAMIC_LINK-true}; config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`; } @@ -142,7 +165,7 @@ gld${EMULATION_NAME}_vercheck (s) soname = bfd_elf_get_dt_soname (s->the_bfd); if (soname == NULL) - soname = lbasename (bfd_get_filename (s->the_bfd)); + soname = basename (bfd_get_filename (s->the_bfd)); for (l = global_vercheck_needed; l != NULL; l = l->next) { @@ -224,10 +247,9 @@ gld${EMULATION_NAME}_stat_needed (s) soname = bfd_elf_get_dt_soname (s->the_bfd); if (soname == NULL) - soname = lbasename (s->filename); + soname = basename (s->filename); - if (strncmp (soname, global_needed->name, - suffix - global_needed->name) == 0) + if (strncmp (soname, global_needed->name, suffix - global_needed->name) == 0) einfo ("%P: warning: %s, needed by %B, may conflict with %s\n", global_needed->name, global_needed->by, soname); } @@ -250,12 +272,12 @@ gld${EMULATION_NAME}_try_needed (name, force) return false; if (! bfd_check_format (abfd, bfd_object)) { - (void) bfd_close (abfd); + bfd_close (abfd); return false; } if ((bfd_get_file_flags (abfd) & DYNAMIC) == 0) { - (void) bfd_close (abfd); + bfd_close (abfd); return false; } @@ -278,7 +300,7 @@ gld${EMULATION_NAME}_try_needed (name, force) lang_for_each_input_file (gld${EMULATION_NAME}_vercheck); if (global_vercheck_failed) { - (void) bfd_close (abfd); + bfd_close (abfd); /* Return false to force the caller to move on to try another file on the search path. */ return false; @@ -303,7 +325,7 @@ case ${target} in break; if (l == NULL) { - (void) bfd_close (abfd); + bfd_close (abfd); return false; } } @@ -329,7 +351,7 @@ cat >>e${EMULATION_NAME}.c <<EOF einfo ("%F%P:%B: bfd_stat failed: %E\n", abfd); /* First strip off everything before the last '/'. */ - soname = lbasename (abfd->filename); + soname = basename (abfd->filename); if (trace_file_tries) info_msg (_("found %s at %s\n"), soname, name); @@ -347,6 +369,9 @@ cat >>e${EMULATION_NAME}.c <<EOF DT_NEEDED entry for this file. */ bfd_elf_set_dt_needed_name (abfd, ""); + /* Previos basename call was clobbered in lang_for_each_input_file. */ + soname = basename (abfd->filename); + /* Tell the ELF backend that the output file needs a DT_NEEDED entry for this file if it is used to resolve the reference in a regular object. */ @@ -789,6 +814,18 @@ gld${EMULATION_NAME}_find_statement_assignment (s) EOF if test x"$LDEMUL_BEFORE_ALLOCATION" != xgld"$EMULATION_NAME"_before_allocation; then + if test x"${ELF_INTERPRETER_NAME+set}" = xset; then + ELF_INTERPRETER_SET_DEFAULT=" + if (sinterp != NULL) + { + sinterp->contents = ${ELF_INTERPRETER_NAME}; + sinterp->_raw_size = strlen (sinterp->contents) + 1; + } + +" + else + ELF_INTERPRETER_SET_DEFAULT= + fi cat >>e${EMULATION_NAME}.c <<EOF /* This is called after the sections have been attached to output @@ -812,11 +849,11 @@ gld${EMULATION_NAME}_before_allocation () rpath = (const char *) getenv ("LD_RUN_PATH"); if (! (bfd_elf${ELFSIZE}_size_dynamic_sections (output_bfd, command_line.soname, rpath, - command_line.export_dynamic, command_line.filter_shlib, + command_line.filter_shlib, (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) @@ -948,6 +985,8 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) EOF 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. */ @@ -973,10 +1012,31 @@ output_rel_find () return (lang_output_section_statement_type *) NULL; } -EOF +/* Find the last output section before given output statement. + Used by place_orphan. */ -if test x"$LDEMUL_PLACE_ORPHAN" != xgld"$EMULATION_NAME"_place_orphan; then -cat >>e${EMULATION_NAME}.c <<EOF +static asection * +output_prev_sec_find (os) + 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. */ @@ -1017,12 +1077,13 @@ gld${EMULATION_NAME}_place_orphan (file, s) 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 == NULL + || ((s->flags ^ os->bfd_section->flags) + & (SEC_LOAD | SEC_ALLOC)) == 0)) { - /* We have already placed a section with this name. */ - wild_doit (&os->children, s, os, file); + /* We already have an output section statement with this + name, and its bfd section, if any, has compatible flags. */ + lang_add_section (&os->children, s, os, file); return true; } } @@ -1037,7 +1098,7 @@ gld${EMULATION_NAME}_place_orphan (file, s) && strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0 && hold_text.os != NULL) { - wild_doit (&hold_text.os->children, s, hold_text.os, file); + lang_add_section (&hold_text.os->children, s, hold_text.os, file); return true; } @@ -1050,7 +1111,11 @@ gld${EMULATION_NAME}_place_orphan (file, s) (hold.os != NULL || (hold.os = lang_output_section_find (name)) != NULL) if (s->flags & SEC_EXCLUDE) - return false; + { + if (s->output_section == NULL) + s->output_section = bfd_abs_section_ptr; + return true; + } place = NULL; if ((s->flags & SEC_ALLOC) == 0) @@ -1071,7 +1136,25 @@ gld${EMULATION_NAME}_place_orphan (file, s) else if (strncmp (secname, ".rel", 4) == 0 && (hold_rel.os != NULL || (hold_rel.os = output_rel_find ()) != NULL)) - place = &hold_rel; + { + if (! link_info.relocateable && link_info.combreloc) + { + if (strncmp (secname, ".rela", 5) == 0) + os = lang_output_section_find (".rela.dyn"); + else + os = lang_output_section_find (".rel.dyn"); + + if (os != NULL + && os->bfd_section != NULL + && ((s->flags ^ os->bfd_section->flags) + & (SEC_LOAD | SEC_ALLOC)) == 0) + { + lang_add_section (&os->children, s, os, file); + return true; + } + } + place = &hold_rel; + } else if ((s->flags & (SEC_CODE | SEC_READONLY)) == SEC_READONLY && HAVE_SECTION (hold_rodata, ".rodata")) place = &hold_rodata; @@ -1112,7 +1195,7 @@ gld${EMULATION_NAME}_place_orphan (file, s) /* If the name of the section is representable in C, then create symbols to mark the start and the end of the section. */ for (ps = outsecname; *ps != '\0'; ps++) - if (! isalnum ((unsigned char) *ps) && *ps != '_') + if (! ISALNUM (*ps) && *ps != '_') break; if (*ps == '\0') { @@ -1138,7 +1221,7 @@ gld${EMULATION_NAME}_place_orphan (file, s) (etree_type *) NULL, (etree_type *) NULL); - wild_doit (&os->children, s, os, file); + lang_add_section (&os->children, s, os, file); lang_leave_output_section_statement ((bfd_vma) 0, "*default*", @@ -1167,45 +1250,50 @@ gld${EMULATION_NAME}_place_orphan (file, s) asection *snew, **pps; snew = os->bfd_section; - if (place->section != NULL - || (place->os->bfd_section != NULL - && place->os->bfd_section != snew)) + + /* Shuffle the bfd section list to make the output file look + neater. This is really only cosmetic. */ + if (place->section == NULL) { - /* Shuffle the section to make the output file look neater. - This is really only cosmetic. */ - if (place->section == NULL) - { -#if 0 - /* Finding the end of the list is a little tricky. We - make a wild stab at it by comparing section flags. */ - flagword first_flags = place->os->bfd_section->flags; - for (pps = &place->os->bfd_section->next; - *pps != NULL && (*pps)->flags == first_flags; - pps = &(*pps)->next) - ; - place->section = pps; -#else - /* Put orphans after the first section on the list. */ - place->section = &place->os->bfd_section->next; -#endif - } + asection *bfd_section = place->os->bfd_section; - /* Unlink the 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) ; - *pps = snew->next; + bfd_section_list_remove (output_bfd, pps); /* Now tack it on to the "place->os" section list. */ - snew->next = *place->section; - *place->section = snew; + bfd_section_list_insert (output_bfd, place->section, snew); } - place->section = &snew->next; /* Save the end of this list. */ + /* 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) { - /* 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. */ if (place->stmt == NULL) { /* Put the new statement list right at the head. */ @@ -1231,7 +1319,29 @@ gld${EMULATION_NAME}_place_orphan (file, s) return true; } +EOF +fi + +if test x"$LDEMUL_FINISH" != xgld"$EMULATION_NAME"_finish; then +cat >>e${EMULATION_NAME}.c <<EOF + +static void +gld${EMULATION_NAME}_finish () +{ + if (bfd_elf${ELFSIZE}_discard_info (output_bfd, &link_info)) + { + /* Resize the sections. */ + lang_size_sections (stat_ptr->head, abs_output_section, + &stat_ptr->head, 0, (bfd_vma) 0, NULL); + /* 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); + } +} EOF fi @@ -1262,14 +1372,18 @@ echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME} 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 - +fi if test -n "$GENERATE_SHLIB_SCRIPT" ; then +echo ' ; else if (link_info.shared && link_info.combreloc) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xsc >> e${EMULATION_NAME}.c echo ' ; else if (link_info.shared) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xs >> e${EMULATION_NAME}.c fi - +echo ' ; else if (link_info.combreloc) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xc >> 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 @@ -1316,6 +1430,7 @@ cat >>e${EMULATION_NAME}.c <<EOF #define OPTION_DISABLE_NEW_DTAGS (400) #define OPTION_ENABLE_NEW_DTAGS (OPTION_DISABLE_NEW_DTAGS + 1) #define OPTION_GROUP (OPTION_ENABLE_NEW_DTAGS + 1) +#define OPTION_EH_FRAME_HDR (OPTION_GROUP + 1) static struct option longopts[] = { @@ -1329,6 +1444,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}, {"enable-new-dtags", no_argument, NULL, OPTION_ENABLE_NEW_DTAGS}, + {"eh-frame-hdr", no_argument, NULL, OPTION_EH_FRAME_HDR}, {"Bgroup", no_argument, NULL, OPTION_GROUP}, {"Bgroup", no_argument, NULL, OPTION_GROUP}, EOF @@ -1389,6 +1505,10 @@ cat >>e${EMULATION_NAME}.c <<EOF link_info.new_dtags = true; break; + case OPTION_EH_FRAME_HDR: + link_info.eh_frame_hdr = true; + break; + case OPTION_GROUP: link_info.flags_1 |= (bfd_vma) DF_1_GROUP; /* Groups must be self-contained. */ @@ -1422,6 +1542,12 @@ cat >>e${EMULATION_NAME}.c <<EOF } else if (strcmp (optarg, "defs") == 0) link_info.no_undefined = true; + else if (strcmp (optarg, "combreloc") == 0) + link_info.combreloc = true; + else if (strcmp (optarg, "nocombreloc") == 0) + link_info.combreloc = false; + else if (strcmp (optarg, "nocopyreloc") == 0) + link_info.nocopyreloc = true; /* What about the other Solaris -z options? FIXME. */ break; EOF @@ -1458,17 +1584,20 @@ cat >>e${EMULATION_NAME}.c <<EOF fprintf (file, _(" -Bgroup\t\tSelects group name lookup rules for DSO\n")); fprintf (file, _(" --disable-new-dtags\tDisable new dynamic tags\n")); fprintf (file, _(" --enable-new-dtags\tEnable new dynamic tags\n")); + fprintf (file, _(" --eh-frame-hdr\tCreate .eh_frame_hdr section\n")); + fprintf (file, _(" -z combreloc\t\tMerge dynamic relocs into one section and sort\n")); fprintf (file, _(" -z defs\t\tDisallows undefined symbols\n")); fprintf (file, _(" -z initfirst\t\tMark DSO to be initialized first at runtime\n")); fprintf (file, _(" -z interpose\t\tMark object to interpose all DSOs but executable\n")); fprintf (file, _(" -z loadfltr\t\tMark object requiring immediate process\n")); + fprintf (file, _(" -z nocombreloc\tDon't merge dynamic relocs into one section\n")); + fprintf (file, _(" -z nocopyreloc\tDon't create copy relocs\n")); fprintf (file, _(" -z nodefaultlib\tMark object not to use default search paths\n")); fprintf (file, _(" -z nodelete\t\tMark DSO non-deletable at runtime\n")); fprintf (file, _(" -z nodlopen\t\tMark DSO not available to dlopen\n")); fprintf (file, _(" -z nodump\t\tMark DSO not available to dldump\n")); fprintf (file, _(" -z now\t\tMark object non-lazy runtime binding\n")); - fprintf (file, _(" -z origin\t\tMark object requiring immediate \$ORIGIN processing\n")); - fprintf (file, _("\t\t\t at runtime\n")); + fprintf (file, _(" -z origin\t\tMark object requiring immediate \$ORIGIN processing\n\t\t\t at runtime\n")); fprintf (file, _(" -z KEYWORD\t\tIgnored for Solaris compatibility\n")); EOF fi @@ -1518,7 +1647,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-gld${EMULATION_NAME}_finish}, ${LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS-NULL}, ${LDEMUL_OPEN_DYNAMIC_ARCHIVE-gld${EMULATION_NAME}_open_dynamic_archive}, ${LDEMUL_PLACE_ORPHAN-gld${EMULATION_NAME}_place_orphan}, diff --git a/contrib/binutils/ld/emultempl/generic.em b/contrib/binutils/ld/emultempl/generic.em index cb5c30c..382150f 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 + Copyright 1991, 1992, 1994, 1996, 2000, 2001 Free Software Foundation, Inc. Written by Steve Chamberlain steve@cygnus.com @@ -42,6 +42,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile)); +EOF + +# Import any needed special functions and/or overrides. +# +if test -n "$EXTRA_EM_FILE" ; then +. ${srcdir}/emultempl/${EXTRA_EM_FILE}.em +fi + +if test x"$LDEMUL_BEFORE_PARSE" != xgld"$EMULATION_NAME"_before_parse; then +cat >>e${EMULATION_NAME}.c <<EOF + static void gld${EMULATION_NAME}_before_parse() { @@ -50,6 +61,12 @@ gld${EMULATION_NAME}_before_parse() #endif /* not TARGET_ */ } +EOF +fi + +if test x"$LDEMUL_GET_SCRIPT" != xgld"$EMULATION_NAME"_get_script; then +cat >>e${EMULATION_NAME}.c <<EOF + static char * gld${EMULATION_NAME}_get_script(isfile) int *isfile; @@ -99,34 +116,34 @@ cat >>e${EMULATION_NAME}.c <<EOF return "ldscripts/${EMULATION_NAME}.x"; } EOF - +fi 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, - after_open_default, - after_allocation_default, - set_output_arch_default, - ldemul_default_target, - before_allocation_default, - gld${EMULATION_NAME}_get_script, + ${LDEMUL_BEFORE_PARSE-gld${EMULATION_NAME}_before_parse}, + ${LDEMUL_SYSLIB-syslib_default}, + ${LDEMUL_HLL-hll_default}, + ${LDEMUL_AFTER_PARSE-after_parse_default}, + ${LDEMUL_AFTER_OPEN-after_open_default}, + ${LDEMUL_AFTER_ALLOCATION-after_allocation_default}, + ${LDEMUL_SET_OUTPUT_ARCH-set_output_arch_default}, + ${LDEMUL_CHOOSE_TARGET-ldemul_default_target}, + ${LDEMUL_BEFORE_ALLOCATION-before_allocation_default}, + ${LDEMUL_GET_SCRIPT-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, /* unrecognized file */ - NULL, /* list options */ - NULL, /* recognized file */ - NULL /* find_potential_libraries */ + ${LDEMUL_FINISH-NULL}, + ${LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS-NULL}, + ${LDEMUL_OPEN_DYNAMIC_ARCHIVE-NULL}, + ${LDEMUL_PLACE_ORPHAN-NULL}, + ${LDEMUL_SET_SYMBOLS-NULL}, + ${LDEMUL_PARSE_ARGS-NULL}, + ${LDEMUL_UNRECOGNIZED_FILE-NULL}, + ${LDEMUL_LIST_OPTIONS-NULL}, + ${LDEMUL_RECOGNIZED_FILE-NULL}, + ${LDEMUL_FIND_POTENTIAL_LIBRARIES-NULL} }; EOF diff --git a/contrib/binutils/ld/emultempl/linux.em b/contrib/binutils/ld/emultempl/linux.em index 888a3dd..85ed138 100644 --- a/contrib/binutils/ld/emultempl/linux.em +++ b/contrib/binutils/ld/emultempl/linux.em @@ -1,5 +1,10 @@ # This shell script emits a C file. -*- C -*- # It does some substitutions. +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! */ @@ -52,7 +57,15 @@ static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile)); static void gld${EMULATION_NAME}_before_parse() { - ldfile_output_architecture = bfd_arch_${ARCH}; + const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}"); + if (arch) + { + ldfile_output_architecture = arch->arch; + ldfile_output_machine = arch->mach; + ldfile_output_machine_name = arch->printable_name; + } + else + ldfile_output_architecture = bfd_arch_${ARCH}; config.dynamic_link = true; config.has_shared = true; } diff --git a/contrib/binutils/ld/emultempl/pe.em b/contrib/binutils/ld/emultempl/pe.em index feab338..2f00269 100644 --- a/contrib/binutils/ld/emultempl/pe.em +++ b/contrib/binutils/ld/emultempl/pe.em @@ -1,10 +1,15 @@ # This shell script emits a C file. -*- C -*- # It does some substitutions. +if [ -z "$MACHINE" ]; then + OUTPUT_ARCH=${ARCH} +else + OUTPUT_ARCH=${ARCH}:${MACHINE} +fi 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 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -26,8 +31,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ on whether certain switches were set, but these switches pertain to the Linux system and that particular version of coff. In the NT case, we only determine if the subsystem is console or windows in order to select - the correct entry point by default. */ - + the correct entry point by default. */ + +#define TARGET_IS_${EMULATION_NAME} + +/* Do this before including bfd.h, so we prototype the right functions. */ +#ifdef TARGET_IS_arm_epoc_pe +#define bfd_arm_pe_allocate_interworking_sections \ + bfd_arm_epoc_pe_allocate_interworking_sections +#define bfd_arm_pe_get_bfd_for_interworking \ + bfd_arm_epoc_pe_get_bfd_for_interworking +#define bfd_arm_pe_process_before_allocation \ + bfd_arm_epoc_pe_process_before_allocation +#endif + #include "bfd.h" #include "sysdep.h" #include "bfdlink.h" @@ -52,7 +69,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "deffile.h" #include "pe-dll.h" -#define TARGET_IS_${EMULATION_NAME} +#include <ctype.h> /* Permit the emulation parameters to override the default section alignment by setting OVERRIDE_SECTION_ALIGNMENT. FIXME: This makes @@ -87,27 +104,42 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define PE_DEF_FILE_ALIGNMENT 0x00000200 #endif -#ifdef TARGET_IS_arm_epoc_pe -#define bfd_arm_pe_allocate_interworking_sections \ - bfd_arm_epoc_pe_allocate_interworking_sections -#define bfd_arm_pe_get_bfd_for_interworking \ - bfd_arm_epoc_pe_get_bfd_for_interworking -#define bfd_arm_pe_process_before_allocation \ - bfd_arm_epoc_pe_process_before_allocation -#endif - static void gld_${EMULATION_NAME}_set_symbols PARAMS ((void)); static void gld_${EMULATION_NAME}_after_open PARAMS ((void)); static void gld_${EMULATION_NAME}_before_parse PARAMS ((void)); static void gld_${EMULATION_NAME}_after_parse PARAMS ((void)); static void gld_${EMULATION_NAME}_before_allocation PARAMS ((void)); +static asection *output_prev_sec_find + PARAMS ((lang_output_section_statement_type *)); static boolean gld_${EMULATION_NAME}_place_orphan PARAMS ((lang_input_statement_type *, asection *)); static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *)); static int gld_${EMULATION_NAME}_parse_args PARAMS ((int, char **)); static void gld_${EMULATION_NAME}_finish PARAMS ((void)); -static boolean gld_${EMULATION_NAME}_open_dynamic_archive +static boolean gld_${EMULATION_NAME}_open_dynamic_archive PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *)); +static void gld_${EMULATION_NAME}_list_options PARAMS ((FILE *)); +static void set_pe_name PARAMS ((char *, long)); +static void set_pe_subsystem PARAMS ((void)); +static void set_pe_value PARAMS ((char *)); +static void set_pe_stack_heap PARAMS ((char *, char *)); + +#ifdef DLL_SUPPORT +static boolean pe_undef_cdecl_match + PARAMS ((struct bfd_link_hash_entry *, PTR)); +static void pe_fixup_stdcalls PARAMS ((void)); +static int make_import_fixup PARAMS ((arelent *, asection *)); +static void pe_find_data_imports PARAMS ((void)); +#endif + +static boolean pr_sym PARAMS ((struct bfd_hash_entry *, PTR string)); +static boolean gld_${EMULATION_NAME}_unrecognized_file + PARAMS ((lang_input_statement_type *)); +static boolean gld_${EMULATION_NAME}_recognized_file + PARAMS ((lang_input_statement_type *)); +static int gld_${EMULATION_NAME}_find_potential_libraries + PARAMS ((char *, lang_input_statement_type *)); + static struct internal_extra_pe_aouthdr pe; static int dll; @@ -128,10 +160,20 @@ extern const char *output_filename; static void gld_${EMULATION_NAME}_before_parse() { + const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}"); + if (arch) + { + ldfile_output_architecture = arch->arch; + ldfile_output_machine = arch->mach; + ldfile_output_machine_name = arch->printable_name; + } + else + ldfile_output_architecture = bfd_arch_${ARCH}; output_filename = "${EXECUTABLE_NAME:-a.exe}"; - ldfile_output_architecture = bfd_arch_${ARCH}; #ifdef DLL_SUPPORT + config.dynamic_link = true; config.has_shared = 1; +/* link_info.pei386_auto_import = true; */ #if (PE_DEF_SUBSYSTEM == 9) || (PE_DEF_SUBSYSTEM == 2) #if defined TARGET_IS_mipspe || defined TARGET_IS_armpe @@ -176,13 +218,16 @@ gld_${EMULATION_NAME}_before_parse() #define OPTION_DISABLE_AUTO_IMAGE_BASE (OPTION_ENABLE_AUTO_IMAGE_BASE + 1) #define OPTION_DLL_SEARCH_PREFIX (OPTION_DISABLE_AUTO_IMAGE_BASE + 1) #define OPTION_NO_DEFAULT_EXCLUDES (OPTION_DLL_SEARCH_PREFIX + 1) +#define OPTION_DLL_ENABLE_AUTO_IMPORT (OPTION_NO_DEFAULT_EXCLUDES + 1) +#define OPTION_DLL_DISABLE_AUTO_IMPORT (OPTION_DLL_ENABLE_AUTO_IMPORT + 1) +#define OPTION_ENABLE_EXTRA_PE_DEBUG (OPTION_DLL_DISABLE_AUTO_IMPORT + 1) static struct option longopts[] = { /* PE options */ {"base-file", required_argument, NULL, OPTION_BASE_FILE}, {"dll", no_argument, NULL, OPTION_DLL}, {"file-alignment", required_argument, NULL, OPTION_FILE_ALIGNMENT}, - {"heap", required_argument, NULL, OPTION_HEAP}, + {"heap", required_argument, NULL, OPTION_HEAP}, {"image-base", required_argument, NULL, OPTION_IMAGE_BASE}, {"major-image-version", required_argument, NULL, OPTION_MAJOR_IMAGE_VERSION}, {"major-os-version", required_argument, NULL, OPTION_MAJOR_OS_VERSION}, @@ -213,6 +258,9 @@ static struct option longopts[] = { {"disable-auto-image-base", no_argument, NULL, OPTION_DISABLE_AUTO_IMAGE_BASE}, {"dll-search-prefix", required_argument, NULL, OPTION_DLL_SEARCH_PREFIX}, {"no-default-excludes", no_argument, NULL, OPTION_NO_DEFAULT_EXCLUDES}, + {"enable-auto-import", no_argument, NULL, OPTION_DLL_ENABLE_AUTO_IMPORT}, + {"disable-auto-import", no_argument, NULL, OPTION_DLL_DISABLE_AUTO_IMPORT}, + {"enable-extra-pe-debug", no_argument, NULL, OPTION_ENABLE_EXTRA_PE_DEBUG}, #endif {NULL, no_argument, NULL, 0} }; @@ -290,14 +338,19 @@ gld_${EMULATION_NAME}_list_options (file) fprintf (file, _(" --out-implib <file> Generate import library\n")); fprintf (file, _(" --output-def <file> Generate a .DEF file for the built DLL\n")); fprintf (file, _(" --warn-duplicate-exports Warn about duplicate exports.\n")); - fprintf (file, _(" --compat-implib Create backward compatible import libs;\n")); - fprintf (file, _(" create __imp_<SYMBOL> as well.\n")); - fprintf (file, _(" --enable-auto-image-base Automatically choose image base for DLLs\n")); - fprintf (file, _(" unless user specifies one\n")); + fprintf (file, _(" --compat-implib Create backward compatible import libs;\n\ + create __imp_<SYMBOL> as well.\n")); + fprintf (file, _(" --enable-auto-image-base Automatically choose image base for DLLs\n\ + unless user specifies one\n")); fprintf (file, _(" --disable-auto-image-base Do not auto-choose image base. (default)\n")); - fprintf (file, _(" --dll-search-prefix=<string> When linking dynamically to a dll witout an\n")); - fprintf (file, _(" importlib, use <string><basename>.dll \n")); - fprintf (file, _(" in preference to lib<basename>.dll \n")); + fprintf (file, _(" --dll-search-prefix=<string> When linking dynamically to a dll without an\n\ + importlib, use <string><basename>.dll \n\ + in preference to lib<basename>.dll \n")); + fprintf (file, _(" --enable-auto-import Do sophistcated linking of _sym to \n\ + __imp_sym for DATA references\n")); + fprintf (file, _(" --disable-auto-import Do not auto-import DATA items from DLLs\n")); + fprintf (file, _(" --enable-extra-pe-debug Enable verbose debug output when building\n\ + or linking to DLLs (esp. auto-import)\n")); #endif } @@ -327,7 +380,7 @@ set_pe_subsystem () const char *sver; int len; int i; - static const struct + static const struct { const char *name; const int value; @@ -400,7 +453,7 @@ set_pe_subsystem () return; } } - + einfo (_("%P%F: invalid subsystem type %s\n"), optarg); } @@ -409,12 +462,12 @@ set_pe_subsystem () static void set_pe_value (name) char *name; - + { char *end; - + set_pe_name (name, strtoul (optarg, &end, 0)); - + if (end == optarg) einfo (_("%P%F: invalid hex number for PE parameter '%s'\n"), optarg); @@ -427,7 +480,7 @@ set_pe_stack_heap (resname, comname) char *comname; { set_pe_value (resname); - + if (*optarg == ',') { optarg++; @@ -480,10 +533,10 @@ gld_${EMULATION_NAME}_parse_args(argc, argv) break; /* PE options */ - case OPTION_HEAP: + case OPTION_HEAP: set_pe_stack_heap ("__size_of_heap_reserve__", "__size_of_heap_commit__"); break; - case OPTION_STACK: + case OPTION_STACK: set_pe_stack_heap ("__size_of_stack_reserve__", "__size_of_stack_commit__"); break; case OPTION_SUBSYSTEM: @@ -568,6 +621,15 @@ gld_${EMULATION_NAME}_parse_args(argc, argv) case OPTION_NO_DEFAULT_EXCLUDES: pe_dll_do_default_excludes = 0; break; + case OPTION_DLL_ENABLE_AUTO_IMPORT: + link_info.pei386_auto_import = true; + break; + case OPTION_DLL_DISABLE_AUTO_IMPORT: + link_info.pei386_auto_import = false; + break; + case OPTION_ENABLE_EXTRA_PE_DEBUG: + pe_dll_extra_pe_debug = 1; + break; #endif } return 1; @@ -575,7 +637,7 @@ gld_${EMULATION_NAME}_parse_args(argc, argv) #ifdef DLL_SUPPORT -static unsigned long +static unsigned long strhash (const char *str) { const unsigned char *s; @@ -662,7 +724,7 @@ gld_${EMULATION_NAME}_set_symbols () } /* Restore the pointer. */ stat_ptr = save; - + if (pe.FileAlignment > pe.SectionAlignment) { @@ -693,6 +755,13 @@ gld_${EMULATION_NAME}_after_parse () ldlang_add_undef (entry_symbol); } +/* pe-dll.c directly accesses pe_data_import_dll, + so it must be defined outside of #ifdef DLL_SUPPORT. + Note - this variable is deliberately not initialised. + This allows it to be treated as a common varaible, and only + exist in one incarnation in a multiple target enabled linker. */ +char * pe_data_import_dll; + #ifdef DLL_SUPPORT static struct bfd_link_hash_entry *pe_undef_found_sym; @@ -701,14 +770,15 @@ pe_undef_cdecl_match (h, string) struct bfd_link_hash_entry *h; PTR string; { - int sl = strlen (string); + int sl; + sl = strlen (string); /* silence compiler warning */ if (h->type == bfd_link_hash_defined && strncmp (h->root.string, string, sl) == 0 && h->root.string[sl] == '@') - { - pe_undef_found_sym = h; - return false; - } + { + pe_undef_found_sym = h; + return false; + } return true; } @@ -718,6 +788,11 @@ pe_fixup_stdcalls () static int gave_warning_message = 0; struct bfd_link_hash_entry *undef, *sym; char *at; + if (pe_dll_extra_pe_debug) + { + printf ("%s\n", __FUNCTION__); + } + for (undef = link_info.hash->undefs; undef; undef=undef->next) if (undef->type == bfd_link_hash_undefined) { @@ -776,16 +851,141 @@ pe_fixup_stdcalls () } } } + +static int +make_import_fixup (rel, s) + arelent *rel; + asection *s; +{ + struct symbol_cache_entry *sym = *rel->sym_ptr_ptr; + + if (pe_dll_extra_pe_debug) + { + printf ("arelent: %s@%#lx: add=%li\n", sym->name, + (long) rel->address, (long) rel->addend); + } + + { + int addend = 0; + if (!bfd_get_section_contents(s->owner, s, &addend, rel->address, sizeof(addend))) + { + einfo (_("%C: Cannot get section contents - auto-import exception\n"), + s->owner, s, rel->address); + } + + if (addend == 0) + pe_create_import_fixup (rel); + else + { + einfo (_("%C: variable '%T' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.\n"), + s->owner, s, rel->address, sym->name); + einfo ("%X"); + } + } + + return 1; +} + +static void +pe_find_data_imports () +{ + struct bfd_link_hash_entry *undef, *sym; + for (undef = link_info.hash->undefs; undef; undef=undef->next) + { + if (undef->type == bfd_link_hash_undefined) + { + /* 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); + + sym = bfd_link_hash_lookup (link_info.hash, buf, 0, 0, 1); + if (sym && sym->type == bfd_link_hash_defined) + { + einfo (_("Warning: resolving %s by linking to %s (auto-import)\n"), + undef->root.string, buf); + { + bfd *b = sym->u.def.section->owner; + asymbol **symbols; + int nsyms, symsize, i; + + symsize = bfd_get_symtab_upper_bound (b); + symbols = (asymbol **) xmalloc (symsize); + nsyms = bfd_canonicalize_symtab (b, symbols); + + for (i = 0; i < nsyms; i++) + { + if (memcmp(symbols[i]->name, "__head_", + sizeof ("__head_") - 1)) + continue; + if (pe_dll_extra_pe_debug) + { + printf ("->%s\n", symbols[i]->name); + } + pe_data_import_dll = (char*) (symbols[i]->name + + sizeof ("__head_") - 1); + break; + } + } + + pe_walk_relocs_of_symbol (&link_info, undef->root.string, + make_import_fixup); + + /* let's differentiate it somehow from defined */ + undef->type = bfd_link_hash_defweak; + /* we replace original name with __imp_ prefixed, this + 1) may trash memory 2) leads to duplicate symbol generation. + Still, IMHO it's better than having name poluted. */ + undef->root.string = sym->root.string; + undef->u.def.value = sym->u.def.value; + undef->u.def.section = sym->u.def.section; + } + } + } +} #endif /* DLL_SUPPORT */ +static boolean +pr_sym (h, string) + struct bfd_hash_entry *h; + PTR string ATTRIBUTE_UNUSED; +{ + if (pe_dll_extra_pe_debug) + { + printf("+%s\n",h->string); + } + return true; +} + + static void gld_${EMULATION_NAME}_after_open () { + + if (pe_dll_extra_pe_debug) + { + bfd *a; + struct bfd_link_hash_entry *sym; + printf ("%s()\n", __FUNCTION__); + + for (sym = link_info.hash->undefs; sym; sym=sym->next) + 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) + { + printf("*%s\n",a->filename); + } + } + /* Pass the wacky PE command line options into the output bfd. FIXME: This should be done via a function, rather than by including an internal BFD header. */ - - if (!coff_data (output_bfd)->pe) + + if (coff_data (output_bfd) == NULL || coff_data (output_bfd)->pe == 0) einfo (_("%F%P: PE operations on non PE file.\n")); pe_data (output_bfd)->pe_opthdr = pe; @@ -795,6 +995,8 @@ gld_${EMULATION_NAME}_after_open () if (pe_enable_stdcall_fixup) /* -1=warn or 1=disable */ pe_fixup_stdcalls (); + pe_find_data_imports (); + pe_process_import_defs(output_bfd, &link_info); if (link_info.shared) pe_dll_build_sections (output_bfd, &link_info); @@ -844,7 +1046,7 @@ gld_${EMULATION_NAME}_after_open () { int idata2 = 0, reloc_count=0, is_imp = 0; asection *sec; - + /* See if this is an import library thunk. */ for (sec = is->the_bfd->sections; sec; sec = sec->next) { @@ -854,7 +1056,7 @@ gld_${EMULATION_NAME}_after_open () is_imp = 1; reloc_count += sec->reloc_count; } - + if (is_imp && !idata2 && reloc_count) { /* It is, look for the reference to head and see if it's @@ -867,22 +1069,22 @@ gld_${EMULATION_NAME}_after_open () asymbol **symbols; arelent **relocs; int nrelocs; - + symsize = bfd_get_symtab_upper_bound (is->the_bfd); if (symsize < 1) break; relsize = bfd_get_reloc_upper_bound (is->the_bfd, sec); if (relsize < 1) break; - + symbols = (asymbol **) xmalloc (symsize); - symsize = bfd_canonicalize_symtab (is->the_bfd, symbols); + symsize = bfd_canonicalize_symtab (is->the_bfd, symbols); if (symsize < 0) { einfo ("%X%P: unable to process symbols: %E"); return; } - + relocs = (arelent **) xmalloc ((size_t) relsize); nrelocs = bfd_canonicalize_reloc (is->the_bfd, sec, relocs, symbols); @@ -892,39 +1094,39 @@ gld_${EMULATION_NAME}_after_open () einfo ("%X%P: unable to process relocs: %E"); return; } - + for (i = 0; i < nrelocs; i++) { struct symbol_cache_entry *s; struct bfd_link_hash_entry * blhe; bfd *other_bfd; char *n; - + s = (relocs[i]->sym_ptr_ptr)[0]; - + if (s->flags & BSF_LOCAL) continue; - + /* Thunk section with reloc to another bfd. */ blhe = bfd_link_hash_lookup (link_info.hash, s->name, false, false, true); - + if (blhe == NULL || blhe->type != bfd_link_hash_defined) continue; - + other_bfd = blhe->u.def.section->owner; - + if (strcmp (is->the_bfd->my_archive->filename, other_bfd->my_archive->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); - + is->the_bfd->my_archive->filename = n; } @@ -1002,7 +1204,7 @@ gld_${EMULATION_NAME}_after_open () } } -static void +static void gld_${EMULATION_NAME}_before_allocation() { #ifdef TARGET_IS_ppcpe @@ -1144,7 +1346,7 @@ gld_${EMULATION_NAME}_unrecognized_file(entry) } #endif return false; - + } static boolean @@ -1183,7 +1385,7 @@ gld_${EMULATION_NAME}_finish () if (thumb_entry_symbol != NULL) { 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 || h->type == bfd_link_hash_defweak) @@ -1191,23 +1393,23 @@ gld_${EMULATION_NAME}_finish () { static char buffer[32]; bfd_vma val; - + /* Special procesing is required for a Thumb entry symbol. The bottom bit of its address must be set. */ val = (h->u.def.value + bfd_get_section_vma (output_bfd, h->u.def.section->output_section) + h->u.def.section->output_offset); - + val |= 1; - + /* Now convert this value into a string and store it in entry_symbol where the lang_finish() function will pick it up. */ buffer[0] = '0'; buffer[1] = 'x'; - + sprintf_vma (buffer + 2, val); - + if (entry_symbol != NULL && entry_from_cmdline) einfo (_("%P: warning: '--thumb-entry %s' is overriding '-e %s'\n"), thumb_entry_symbol, entry_symbol); @@ -1232,13 +1434,49 @@ gld_${EMULATION_NAME}_finish () pe_exe_fill_sections (output_bfd, &link_info); } #endif - + if (pe_out_def_filename) pe_dll_generate_def_file (pe_out_def_filename); #endif /* DLL_SUPPORT */ + + /* I don't know where .idata gets set as code, but it shouldn't be */ + { + asection *asec = bfd_get_section_by_name (output_bfd, ".idata"); + if (asec) + { + 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 (os) + 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 @@ -1289,10 +1527,13 @@ gld_${EMULATION_NAME}_place_orphan (file, s) lang_list_init (&add_child); if (os != NULL - && os->bfd_section != NULL - && ((s->flags ^ os->bfd_section->flags) & (SEC_LOAD | SEC_ALLOC)) == 0) + && (os->bfd_section == NULL + || ((s->flags ^ os->bfd_section->flags) + & (SEC_LOAD | SEC_ALLOC)) == 0)) { - wild_doit (&add_child, s, os, file); + /* 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); } else { @@ -1332,7 +1573,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s) /* 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 allocateable characteristics. */ + different loadable or allocatable characteristics. */ outsecname = xstrdup (hold_section_name); if (bfd_get_section_by_name (output_bfd, outsecname) != NULL) { @@ -1371,7 +1612,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s) { char *symname; etree_type *e_align; - + symname = (char *) xmalloc (ps - outsecname + sizeof "___start_"); sprintf (symname, "___start_%s", outsecname); e_align = exp_unop (ALIGN_K, @@ -1379,7 +1620,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s) lang_add_assignment (exp_assop ('=', symname, e_align)); } } - + if (link_info.relocateable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0) address = exp_intop ((bfd_vma) 0); else @@ -1396,7 +1637,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s) (etree_type *) NULL, (etree_type *) NULL); - wild_doit (&add_child, s, os, file); + lang_add_section (&add_child, s, os, file); lang_leave_output_section_statement ((bfd_vma) 0, "*default*", @@ -1410,7 +1651,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s) 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, @@ -1424,50 +1665,73 @@ gld_${EMULATION_NAME}_place_orphan (file, s) asection *snew, **pps; snew = os->bfd_section; - if (place->os->bfd_section != NULL || place->section != NULL) + + /* Shuffle the bfd section list to make the output file look + neater. This is really only cosmetic. */ + if (place->section == NULL) { - /* Shuffle the section to make the output file look neater. */ - if (place->section == NULL) - { -#if 0 - /* Finding the end of the list is a little tricky. We - make a wild stab at it by comparing section flags. */ - flagword first_flags = place->os->bfd_section->flags; - for (pps = &place->os->bfd_section->next; - *pps != NULL && (*pps)->flags == first_flags; - pps = &(*pps)->next) - ; - place->section = pps; -#else - /* Put orphans after the first section on the list. */ - place->section = &place->os->bfd_section->next; -#endif - } + asection *bfd_section = place->os->bfd_section; - /* Unlink the section. */ - for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next) - ; - *pps = snew->next; + /* 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); - /* Now tack it on to the "place->os" section list. */ - snew->next = *place->section; - *place->section = snew; + if (bfd_section != NULL && bfd_section != snew) + place->section = &bfd_section->next; } - place->section = &snew->next; /* Save the end of this list. */ - if (place->stmt == NULL) + if (place->section != NULL) { - /* Put the new statement list right at the head. */ - *add.tail = place->os->header.next; - place->os->header.next = add.head; + /* 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); } - else + + /* 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) { - /* Put it after the last orphan statement we added. */ - *add.tail = *place->stmt; - *place->stmt = add.head; + 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; } - place->stmt = add.tail; /* Save the end of this list. */ } } @@ -1482,7 +1746,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s) sections. */ found_dollar = false; - for ( ; *pl != NULL; pl = &(*pl)->next) + for ( ; *pl != NULL; pl = &(*pl)->header.next) { lang_input_section_type *ls; const char *lname; @@ -1509,7 +1773,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s) if (add_child.head != NULL) { - add_child.head->next = *pl; + add_child.head->header.next = *pl; *pl = add_child.head; } } @@ -1534,7 +1798,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) filename = entry->filename; string = (char *) xmalloc (strlen (search->name) - + strlen (filename) + + strlen (filename) + sizeof "/lib.a.dll" #ifdef DLL_SUPPORT + (pe_dll_search_prefix ? strlen (pe_dll_search_prefix) : 0) @@ -1568,7 +1832,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, 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)) @@ -1588,7 +1852,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) } } else /* pe_dll_search_prefix not specified */ -#endif +#endif { /* Try "libfoo.dll" (preferred dll name) */ sprintf (string, "%s/lib%s.dll", search->name, filename); @@ -1629,7 +1893,7 @@ EOF sc="-f stringify.sed" cat >>e${EMULATION_NAME}.c <<EOF -{ +{ *isfile = 0; if (link_info.relocateable == true && config.build_constructors == true) @@ -1649,7 +1913,7 @@ echo '; }' >> e${EMULATION_NAME} cat >>e${EMULATION_NAME}.c <<EOF -struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = +struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = { gld_${EMULATION_NAME}_before_parse, syslib_default, diff --git a/contrib/binutils/ld/emultempl/ppc64elf.em b/contrib/binutils/ld/emultempl/ppc64elf.em new file mode 100644 index 0000000..655ddea --- /dev/null +++ b/contrib/binutils/ld/emultempl/ppc64elf.em @@ -0,0 +1,99 @@ +# This shell script emits a C file. -*- C -*- +# Copyright 2002 Free Software Foundation, Inc. +# +# This file is part of GLD, the Gnu Linker. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +# This file is sourced from elf32.em, and defines extra powerpc64-elf +# specific routines. +# +cat >>e${EMULATION_NAME}.c <<EOF + +#include "elf64-ppc.h" + +static int need_laying_out = 0; + +static void gld${EMULATION_NAME}_after_allocation PARAMS ((void)); +static void gld${EMULATION_NAME}_finish PARAMS ((void)); + +/* Call the back-end function to set TOC base after we have placed all + the sections. */ +static void +gld${EMULATION_NAME}_after_allocation () +{ + if (!ppc64_elf_set_toc (output_bfd, &link_info)) + einfo ("%X%P: can not set TOC base: %E\n"); +} + +/* Final emulation specific call. PowerPC64 has 24 byte .plt entries, + and needs different call stubs for any entries that cross a 64k + boundary relative to the TOC. That means we need to wait until all + sections have been laid out to initialise the stubs. */ + +static void +gld${EMULATION_NAME}_finish () +{ + /* If generating a relocatable output file, then we don't have any + stubs. */ + if (link_info.relocateable) + return; + + /* bfd_elf64_discard_info just plays with debugging sections, + ie. doesn't affect any code, so we can delay resizing the + sections. It's likely we'll resize everything in the process of + adjusting stub sizes. */ + if (bfd_elf${ELFSIZE}_discard_info (output_bfd, &link_info)) + need_laying_out = 1; + + while (1) + { + /* Call into the BFD backend to do the real work. */ + if (! ppc64_elf_size_stubs (output_bfd, &link_info, &need_laying_out)) + { + einfo ("%X%P: can not size stub section: %E\n"); + return; + } + + if (!need_laying_out) + break; + + /* If we have changed the size of the stub section, then we need + to recalculate all the section offsets. After this, we may + need to adjust the stub size again. */ + need_laying_out = 0; + + /* Resize the sections. */ + lang_size_sections (stat_ptr->head, abs_output_section, + &stat_ptr->head, 0, (bfd_vma) 0, NULL); + + /* Recalculate TOC base. */ + ldemul_after_allocation (); + + /* Do the assignments again. */ + lang_do_assignments (stat_ptr->head, abs_output_section, + (fill_type) 0, (bfd_vma) 0); + } + + if (! ppc64_elf_build_stubs (output_bfd, &link_info)) + einfo ("%X%P: can not build stubs: %E\n"); +} +EOF + +# Put these extra ppc64elf routines in ld_${EMULATION_NAME}_emulation +# +LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation +LDEMUL_FINISH=gld${EMULATION_NAME}_finish diff --git a/contrib/binutils/ld/emultempl/vanilla.em b/contrib/binutils/ld/emultempl/vanilla.em index 3e6aed9..96ee34c 100644 --- a/contrib/binutils/ld/emultempl/vanilla.em +++ b/contrib/binutils/ld/emultempl/vanilla.em @@ -2,7 +2,7 @@ # It does some substitutions. cat >e${EMULATION_NAME}.c <<EOF /* A vanilla emulation with no defaults - Copyright 1991, 1992, 1994, 2000 Free Software Foundation, Inc. + Copyright 1991, 1992, 1994, 2000, 2001 Free Software Foundation, Inc. Written by Steve Chamberlain steve@cygnus.com This file is part of GLD, the Gnu Linker. @@ -34,6 +34,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ldfile.h" #include "ldemul.h" +static void vanilla_before_parse PARAMS ((void)); +static void vanilla_set_output_arch PARAMS ((void)); +static char *vanilla_get_script PARAMS ((int *)); + + static void vanilla_before_parse() { } diff --git a/contrib/binutils/ld/gen-doc.texi b/contrib/binutils/ld/gen-doc.texi index 8d1acad..c0ebac7 100644 --- a/contrib/binutils/ld/gen-doc.texi +++ b/contrib/binutils/ld/gen-doc.texi @@ -5,6 +5,7 @@ @c 2. Specific target machines @set H8300 @set I960 +@set MMIX @set TICOFF @c 3. Properties of this configuration diff --git a/contrib/binutils/ld/genscripts.sh b/contrib/binutils/ld/genscripts.sh index f6a2970..501a68c 100755 --- a/contrib/binutils/ld/genscripts.sh +++ b/contrib/binutils/ld/genscripts.sh @@ -84,6 +84,17 @@ LIB_SEARCH_DIRS=`echo ${LIB_PATH} | tr ':' ' ' | sed -e 's/\([^ ][^ ]*\)/SEARCH_ # A .xs script is for generating a shared library with the --shared # flag; it is only generated if $GENERATE_SHLIB_SCRIPT is set by the # emulation parameters. +# A .xc script is for linking with -z combreloc; it is only generated if +# $GENERATE_COMBRELOC_SCRIPT is set by the emulation parameters or +# $SCRIPT_NAME is "elf". +# A .xsc script is for linking with --shared -z combreloc; it is generated +# if $GENERATE_COMBRELOC_SCRIPT is set by the emulation parameters or +# $SCRIPT_NAME is "elf" and $GENERATE_SHLIB_SCRIPT is set by the emulation +# parameters too. + +if [ "x$SCRIPT_NAME" = "xelf" ]; then + GENERATE_COMBRELOC_SCRIPT=yes +fi SEGMENT_SIZE=${SEGMENT_SIZE-${TARGET_PAGE_SIZE}} @@ -99,39 +110,75 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}" LD_FLAG=r DATA_ALIGNMENT=${DATA_ALIGNMENT_r} DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})" -(. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc) | sed -e '/^ *$/d' > \ - ldscripts/${EMULATION_NAME}.xr +( echo "/* Script for ld -r: link without relocation */" + . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xr LD_FLAG=u DATA_ALIGNMENT=${DATA_ALIGNMENT_u} CONSTRUCTING=" " -(. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc) | sed -e '/^ *$/d' > \ - ldscripts/${EMULATION_NAME}.xu +( echo "/* Script for ld -Ur: link w/out relocation, do create constructors */" + . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xu LD_FLAG= DATA_ALIGNMENT=${DATA_ALIGNMENT_} RELOCATING=" " -(. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc) | sed -e '/^ *$/d' > \ - ldscripts/${EMULATION_NAME}.x +( echo "/* Default linker script, for normal executables */" + . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.x LD_FLAG=n DATA_ALIGNMENT=${DATA_ALIGNMENT_n} TEXT_START_ADDR=${NONPAGED_TEXT_START_ADDR-${TEXT_START_ADDR}} -(. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc) | sed -e '/^ *$/d' > \ - ldscripts/${EMULATION_NAME}.xn +( echo "/* Script for -n: mix text and data on same page */" + . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xn LD_FLAG=N DATA_ALIGNMENT=${DATA_ALIGNMENT_N} -(. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc) | sed -e '/^ *$/d' > \ - ldscripts/${EMULATION_NAME}.xbn +( echo "/* Script for -N: mix text and data on same page; don't align data */" + . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xbn + +if test -n "$GENERATE_COMBRELOC_SCRIPT"; then + DATA_ALIGNMENT=${DATA_ALIGNMENT_c-${DATA_ALIGNMENT_}} + LD_FLAG=c + COMBRELOC=ldscripts/${EMULATION_NAME}.xc.tmp + ( echo "/* Script for -z combreloc: combine and sort reloc sections */" + . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xc + rm -f ${COMBRELOC} + COMBRELOC= +fi if test -n "$GENERATE_SHLIB_SCRIPT"; then LD_FLAG=shared DATA_ALIGNMENT=${DATA_ALIGNMENT_s-${DATA_ALIGNMENT_}} CREATE_SHLIB=" " # Note that TEXT_START_ADDR is set to NONPAGED_TEXT_START_ADDR. - (. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc) | sed -e '/^ *$/d' > \ - ldscripts/${EMULATION_NAME}.xs + ( + echo "/* Script for ld --shared: link shared library */" + . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xs + if test -n "$GENERATE_COMBRELOC_SCRIPT"; then + LD_FLAG=cshared + DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}} + COMBRELOC=ldscripts/${EMULATION_NAME}.xc.tmp + ( echo "/* Script for --shared -z combreloc: shared library, combine & sort relocs */" + . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsc + rm -f ${COMBRELOC} + COMBRELOC= + fi fi for i in $EMULATION_LIBPATH ; do diff --git a/contrib/binutils/ld/ld.h b/contrib/binutils/ld/ld.h index 620c3ba..e629e66 100644 --- a/contrib/binutils/ld/ld.h +++ b/contrib/binutils/ld/ld.h @@ -73,6 +73,11 @@ struct wildcard_spec { boolean sorted; }; +struct wildcard_list { + struct wildcard_list *next; + struct wildcard_spec spec; +}; + /* Extra information we hold on sections */ typedef struct user_section_struct { /* Pointer to the section where this data will go */ @@ -97,6 +102,9 @@ typedef struct user_section_struct { typedef struct { /* 1 => assign space to common symbols even if `relocatable_output'. */ boolean force_common_definition; + + /* 1 => do not assign addresses to common symbols. */ + boolean inhibit_common_definition; boolean relax; /* Name of runtime interpreter to invoke. */ @@ -115,10 +123,6 @@ typedef struct { /* Big or little endian as set on command line. */ enum { ENDIAN_UNSET = 0, ENDIAN_BIG, ENDIAN_LITTLE } endian; - /* If true, export all symbols in the dynamic symbol table of an ELF - executable. */ - boolean export_dynamic; - /* If true, build MIPS embedded PIC relocation tables in the output file. */ boolean embedded_relocs; @@ -192,6 +196,9 @@ typedef struct { changes due to the alignment of an input section. */ boolean warn_section_align; + /* If true, warning messages are fatal */ + boolean fatal_warnings; + boolean sort_common; boolean text_read_only; @@ -207,6 +214,10 @@ typedef struct { unsigned int split_by_reloc; bfd_size_type split_by_file; + + /* If set, only search library directories explicitly selected + on the command line. */ + boolean only_cmd_line_lib_dirs; } ld_config_type; extern ld_config_type config; @@ -217,7 +228,7 @@ typedef enum { lang_final_phase_enum } lang_phase_type; -extern boolean had_script; +extern FILE * saved_script_handle; extern boolean force_make_executable; /* Non-zero if we are processing a --defsym from the command line. */ diff --git a/contrib/binutils/ld/ld.texinfo b/contrib/binutils/ld/ld.texinfo index 8c4d98f..1069d03 100644 --- a/contrib/binutils/ld/ld.texinfo +++ b/contrib/binutils/ld/ld.texinfo @@ -9,6 +9,43 @@ @c @smallbook +@macro gcctabopt{body} +@code{\body\} +@end macro + +@c man begin NAME +@ifset man +@c Configure for the generation of man pages +@set UsesEnvVars +@set GENERIC +@set A29K +@set ARC +@set ARM +@set D10V +@set D30V +@set H8/300 +@set H8/500 +@set HPPA +@set I370 +@set I80386 +@set I860 +@set I960 +@set M32R +@set M68HC11 +@set M680X0 +@set MCORE +@set MIPS +@set MMIX +@set PDP11 +@set PJ +@set SH +@set SPARC +@set C54X +@set V850 +@set VAX +@end ifset +@c man end + @ifinfo @format START-INFO-DIR-ENTRY @@ -20,7 +57,8 @@ END-INFO-DIR-ENTRY @ifinfo This file documents the @sc{gnu} linker LD version @value{VERSION}. -Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. +Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, +2001 Free Software Foundation, Inc. @ignore @@ -63,14 +101,16 @@ notice identical to this one except for the removal of this paragraph @end tex @vskip 0pt plus 1filll -Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. +@c man begin COPYRIGHT +Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with no Invariant Sections, with no Front-Cover Texts, and with no - Back-Cover Texts. A copy of the license is included in the - section entitled "GNU Free Documentation License". +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 +or any later version published by the Free Software Foundation; +with no Invariant Sections, with no Front-Cover Texts, and with no +Back-Cover Texts. A copy of the license is included in the +section entitled "GNU Free Documentation License". +@c man end @end titlepage @end iftex @@ -123,17 +163,40 @@ section entitled "GNU Free Documentation License". @cindex @sc{gnu} linker @cindex what is this? -@code{ld} combines a number of object and archive files, relocates + +@ifset man +@c man begin SYNOPSIS +ld [@b{options}] @var{objfile} @dots{} +@c man end + +@c man begin SEEALSO +ar(1), nm(1), objcopy(1), objdump(1), readelf(1) and +the Info entries for @file{binutils} and +@file{ld}. +@c man end +@end ifset + +@c man begin DESCRIPTION + +@command{ld} combines a number of object and archive files, relocates their data and ties up symbol references. Usually the last step in -compiling a program is to run @code{ld}. +compiling a program is to run @command{ld}. -@code{ld} accepts Linker Command Language files written in +@command{ld} accepts Linker Command Language files written in a superset of AT&T's Link Editor Command Language syntax, to provide explicit and total control over the linking process. +@ifset man +@c For the man only +This man page does not describe the command language; see the +@command{ld} entry in @code{info}, or the manual +ld: the GNU linker, for full details on the command language and +on other aspects of the GNU linker. +@end ifset + @ifclear SingleFormat -This version of @code{ld} uses the general purpose BFD libraries -to operate on object files. This allows @code{ld} to read, combine, and +This version of @command{ld} uses the general purpose BFD libraries +to operate on object files. This allows @command{ld} to read, combine, and write object files in many different formats---for example, COFF or @code{a.out}. Different formats may be linked together to produce any available kind of object file. @xref{BFD}, for more information. @@ -142,16 +205,22 @@ available kind of object file. @xref{BFD}, for more information. Aside from its flexibility, the @sc{gnu} linker is more helpful than other linkers in providing diagnostic information. Many linkers abandon execution immediately upon encountering an error; whenever possible, -@code{ld} continues executing, allowing you to identify other errors +@command{ld} continues executing, allowing you to identify other errors (or, in some cases, to get an output file in spite of the error). +@c man end + @node Invocation @chapter Invocation -The @sc{gnu} linker @code{ld} is meant to cover a broad range of situations, +@c man begin DESCRIPTION + +The @sc{gnu} linker @command{ld} is meant to cover a broad range of situations, and to be as compatible as possible with other linkers. As a result, you have many choices to control its behavior. +@c man end + @ifset UsesEnvVars @menu * Options:: Command Line Options @@ -164,10 +233,13 @@ you have many choices to control its behavior. @cindex command line @cindex options + +@c man begin OPTIONS + The linker supports a plethora of command-line options, but in actual practice few of them are used in any particular context. @cindex standard Unix system -For instance, a frequent use of @code{ld} is to link standard Unix +For instance, a frequent use of @command{ld} is to link standard Unix object files on a standard, supported Unix system. On such a system, to link a file @code{hello.o}: @@ -175,12 +247,12 @@ link a file @code{hello.o}: ld -o @var{output} /lib/crt0.o hello.o -lc @end smallexample -This tells @code{ld} to produce a file called @var{output} as the +This tells @command{ld} to produce a file called @var{output} as the result of linking the file @code{/lib/crt0.o} with @code{hello.o} and the library @code{libc.a}, which will come from the standard search directories. (See the discussion of the @samp{-l} option below.) -Some of the command-line options to @code{ld} may be specified at any +Some of the command-line options to @command{ld} may be specified at any point in the command line. However, options which refer to files, such as @samp{-l} or @samp{-T}, cause the file to be read at the point at which the option appears in the command line, relative to the object @@ -209,10 +281,8 @@ linker script or the one specified by using @samp{-T}). This feature permits the linker to link against a file which appears to be an object or an archive, but actually merely defines some symbol values, or uses @code{INPUT} or @code{GROUP} to load other objects. Note that -specifying a script in this way should only be used to augment the main -linker script; if you want to use some command that logically can only -appear once, such as the @code{SECTIONS} or @code{MEMORY} command, you -must replace the default linker script using the @samp{-T} option. +specifying a script in this way merely augments the main linker script; +use the @samp{-T} option to replace the default linker script entirely. @xref{Scripts}. For options whose names are a single letter, @@ -251,7 +321,7 @@ silently drop the linker options, resulting in a bad link. Here is a table of the generic command line switches accepted by the GNU linker: -@table @code +@table @gcctabopt @kindex -a@var{keyword} @item -a@var{keyword} This option is supported for HP/UX compatibility. The @var{keyword} @@ -266,14 +336,14 @@ to @samp{-Bdynamic}. This option may be used any number of times. @item -A@var{architecture} @kindex --architecture=@var{arch} @itemx --architecture=@var{architecture} -In the current release of @code{ld}, this option is useful only for the -Intel 960 family of architectures. In that @code{ld} configuration, the +In the current release of @command{ld}, this option is useful only for the +Intel 960 family of architectures. In that @command{ld} configuration, the @var{architecture} argument identifies the particular architecture in the 960 family, enabling some safeguards and modifying the -archive-library search path. @xref{i960,,@code{ld} and the Intel 960 +archive-library search path. @xref{i960,,@command{ld} and the Intel 960 family}, for details. -Future releases of @code{ld} may support similar functionality for +Future releases of @command{ld} may support similar functionality for other architecture families. @end ifset @@ -285,12 +355,12 @@ other architecture families. @cindex input format @item -b @var{input-format} @itemx --format=@var{input-format} -@code{ld} may be configured to support more than one kind of object -file. If your @code{ld} is configured this way, you can use the +@command{ld} may be configured to support more than one kind of object +file. If your @command{ld} is configured this way, you can use the @samp{-b} option to specify the binary format for input object files -that follow this option on the command line. Even when @code{ld} is +that follow this option on the command line. Even when @command{ld} is configured to support alternative object formats, you don't usually need -to specify this, as @code{ld} should be configured to expect as a +to specify this, as @command{ld} should be configured to expect as a default input format the most usual format on each machine. @var{input-format} is a text string, the name of a particular format supported by the BFD libraries. (You can list the available binary @@ -309,7 +379,10 @@ The default format is taken from the environment variable @xref{Environment}. @end ifset You can also define the input format from a script, using the command -@code{TARGET}; see @ref{Format Commands}. +@code{TARGET}; +@ifclear man +see @ref{Format Commands}. +@end ifclear @end ifclear @kindex -c @var{MRI-cmdfile} @@ -317,12 +390,18 @@ You can also define the input format from a script, using the command @cindex compatibility, MRI @item -c @var{MRI-commandfile} @itemx --mri-script=@var{MRI-commandfile} -For compatibility with linkers produced by MRI, @code{ld} accepts script +For compatibility with linkers produced by MRI, @command{ld} accepts script files written in an alternate, restricted command language, described in -@ref{MRI,,MRI Compatible Script Files}. Introduce MRI script files with +@ifclear man +@ref{MRI,,MRI Compatible Script Files}. +@end ifclear +@ifset man +the MRI Compatible Script Files section of GNU ld documentation. +@end ifset +Introduce MRI script files with the option @samp{-c}; use the @samp{-T} option to run linker -scripts written in the general-purpose @code{ld} scripting language. -If @var{MRI-cmdfile} does not exist, @code{ld} looks for it in the directories +scripts written in the general-purpose @command{ld} scripting language. +If @var{MRI-cmdfile} does not exist, @command{ld} looks for it in the directories specified by any @samp{-L} options. @cindex common allocation @@ -369,6 +448,10 @@ back to the symbols defined by the program, rather than some other dynamic object, then you will probably need to use this option when linking the program itself. +You can also use the version script to control what symbols should +be added to the dynamic symbol table if the output format supports it. +See the description of @samp{--version-script} in @ref{VERSION}. + @cindex big-endian objects @cindex endianness @kindex -EB @@ -419,12 +502,12 @@ found in the shared object @var{name}. Thus the filter object can be used to select a subset of the symbols provided by the object @var{name}. -Some older linkers used the @code{-F} option throughout a compilation +Some older linkers used the @option{-F} option throughout a compilation toolchain for specifying object-file format for both input and output object files. The @sc{gnu} linker uses other mechanisms for this -purpose: the @code{-b}, @code{--format}, @code{--oformat} options, the +purpose: the @option{-b}, @option{--format}, @option{--oformat} options, the @code{TARGET} command in linker scripts, and the @code{GNUTARGET} -environment variable. The @sc{gnu} linker will ignore the @code{-F} +environment variable. The @sc{gnu} linker will ignore the @option{-F} option when not creating an ELF shared object. @cindex finalization function @@ -479,13 +562,13 @@ function to call. @item -l@var{archive} @itemx --library=@var{archive} Add archive file @var{archive} to the list of files to link. This -option may be used any number of times. @code{ld} will search its +option may be used any number of times. @command{ld} will search its path-list for occurrences of @code{lib@var{archive}.a} for every @var{archive} specified. -On systems which support shared libraries, @code{ld} may also search for +On systems which support shared libraries, @command{ld} may also search for libraries with extensions other than @code{.a}. Specifically, on ELF -and SunOS systems, @code{ld} will search a directory for a library with +and SunOS systems, @command{ld} will search a directory for a library with an extension of @code{.so} before searching for one with an extension of @code{.a}. By convention, a @code{.so} extension indicates a shared library. @@ -497,14 +580,14 @@ command line, the linker will include the appropriate file(s) from the archive. However, an undefined symbol in an object appearing later on the command line will not cause the linker to search the archive again. -See the @code{-(} option for a way to force the linker to search +See the @option{-(} option for a way to force the linker to search archives multiple times. You may list the same archive multiple times on the command line. @ifset GENERIC This type of archive searching is standard for Unix linkers. However, -if you are using @code{ld} on AIX, note that it is different from the +if you are using @command{ld} on AIX, note that it is different from the behaviour of the AIX linker. @end ifset @@ -513,17 +596,17 @@ behaviour of the AIX linker. @kindex --library-path=@var{dir} @item -L@var{searchdir} @itemx --library-path=@var{searchdir} -Add path @var{searchdir} to the list of paths that @code{ld} will search -for archive libraries and @code{ld} control scripts. You may use this +Add path @var{searchdir} to the list of paths that @command{ld} will search +for archive libraries and @command{ld} control scripts. You may use this option any number of times. The directories are searched in the order in which they are specified on the command line. Directories specified on the command line are searched before the default directories. All -@code{-L} options apply to all @code{-l} options, regardless of the +@option{-L} options apply to all @option{-l} options, regardless of the order in which the options appear. @ifset UsesEnvVars The default set of paths searched (without being specified with -@samp{-L}) depends on which emulation mode @code{ld} is using, and in +@samp{-L}) depends on which emulation mode @command{ld} is using, and in some cases also on how it was configured. @xref{Environment}. @end ifset @@ -585,14 +668,14 @@ style magic numbers, mark the output as @code{OMAGIC}. @cindex naming the output file @item -o @var{output} @itemx --output=@var{output} -Use @var{output} as the name for the program produced by @code{ld}; if this +Use @var{output} as the name for the program produced by @command{ld}; if this option is not specified, the name @file{a.out} is used by default. The script command @code{OUTPUT} can also specify the output file name. @kindex -O @var{level} @cindex generating optimized output @item -O @var{level} -If @var{level} is a numeric values greater than zero @code{ld} optimizes +If @var{level} is a numeric values greater than zero @command{ld} optimizes the output. This might take significantly longer and therefore probably should only be enabled for the final binary. @@ -606,6 +689,8 @@ Post link analysis and optimization tools may need this information in order to perform correct modifications of executables. This results in larger executables. +This option is currently only supported on ELF platforms. + @cindex partial link @cindex relocatable output @kindex -r @@ -613,15 +698,21 @@ in larger executables. @item -r @itemx --relocateable Generate relocatable output---i.e., generate an output file that can in -turn serve as input to @code{ld}. This is often called @dfn{partial +turn serve as input to @command{ld}. This is often called @dfn{partial linking}. As a side effect, in environments that support standard Unix magic numbers, this option also sets the output file's magic number to @code{OMAGIC}. -@c ; see @code{-N}. +@c ; see @option{-N}. If this option is not specified, an absolute file is produced. When linking C++ programs, this option @emph{will not} resolve references to constructors; to do that, use @samp{-Ur}. +When an input file does not have the same format as the output file, +partial linking is only supported if that input file does not contain any +relocations. Different output formats can have further restrictions; for +example some @code{a.out}-based formats do not support partial linking +with input files in other formats at all. + This option does the same thing as @samp{-i}. @kindex -R @var{file} @@ -634,9 +725,9 @@ relocate it or include it in the output. This allows your output file to refer symbolically to absolute locations of memory defined in other programs. You may use this option more than once. -For compatibility with other ELF linkers, if the @code{-R} option is +For compatibility with other ELF linkers, if the @option{-R} option is followed by a directory name, rather than a file name, it is treated as -the @code{-rpath} option. +the @option{-rpath} option. @kindex -s @kindex --strip-all @@ -657,7 +748,7 @@ Omit debugger symbol information (but not all symbols) from the output file. @cindex input files, displaying @item -t @itemx --trace -Print the names of the input files as @code{ld} processes them. +Print the names of the input files as @command{ld} processes them. @kindex -T @var{script} @kindex --script=@var{script} @@ -665,14 +756,12 @@ Print the names of the input files as @code{ld} processes them. @item -T @var{scriptfile} @itemx --script=@var{scriptfile} Use @var{scriptfile} as the linker script. This script replaces -@code{ld}'s default linker script (rather than adding to it), so +@command{ld}'s default linker script (rather than adding to it), so @var{commandfile} must specify everything necessary to describe the -output file. You must use this option if you want to use a command -which can only appear once in a linker script, such as the -@code{SECTIONS} or @code{MEMORY} command. @xref{Scripts}. If -@var{scriptfile} does not exist in the current directory, @code{ld} -looks for it in the directories specified by any preceding @samp{-L} -options. Multiple @samp{-T} options accumulate. +output file. @xref{Scripts}. If @var{scriptfile} does not exist in +the current directory, @code{ld} looks for it in the directories +specified by any preceding @samp{-L} options. Multiple @samp{-T} +options accumulate. @kindex -u @var{symbol} @kindex --undefined=@var{symbol} @@ -690,7 +779,7 @@ option is equivalent to the @code{EXTERN} linker script command. @item -Ur For anything other than C++ programs, this option is equivalent to @samp{-r}: it generates relocatable output---i.e., an output file that can in -turn serve as input to @code{ld}. When linking C++ programs, @samp{-Ur} +turn serve as input to @command{ld}. When linking C++ programs, @samp{-Ur} @emph{does} resolve references to constructors, unlike @samp{-r}. It does not work to use @samp{-Ur} on files that were themselves linked with @samp{-Ur}; once the constructor table has been built, it cannot @@ -714,7 +803,7 @@ in a linker script. @item -v @itemx --version @itemx -V -Display the version number for @code{ld}. The @code{-V} option also +Display the version number for @command{ld}. The @option{-V} option also lists the supported emulations. @kindex -x @@ -754,7 +843,9 @@ for Solaris compatibility. @item -z @var{keyword} The recognized keywords are @code{initfirst}, @code{interpose}, @code{loadfltr}, @code{nodefaultlib}, @code{nodelete}, @code{nodlopen}, -@code{nodump}, @code{now} and @code{origin}. The other keywords are +@code{nodump}, @code{now}, @code{origin}, @code{combreloc}, @code{nocombreloc} +and @code{nocopyreloc}. +The other keywords are ignored for Solaris compatibility. @code{initfirst} marks the object to be initialized first at runtime before any other objects. @code{interpose} marks the object that its symbol table interposes @@ -768,6 +859,10 @@ of this object will ignore any default library search paths. @code{now} marks the object with the non-lazy runtime binding. @code{origin} marks the object may contain $ORIGIN. @code{defs} disallows undefined symbols. +@code{combreloc} combines multiple reloc sections and sorts them +to make dynamic symbol lookup caching possible. +@code{nocombreloc} disables multiple reloc sections combining. +@code{nocopyreloc} disables production of copy relocs. @kindex -( @cindex groups of archives @@ -804,14 +899,14 @@ for which shared libraries are supported. This option is normally the default on such platforms. 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 -@code{-l} options which follow it. +@option{-l} options which follow it. @kindex -Bgroup @item -Bgroup Set the @code{DF_1_GROUP} flag in the @code{DT_FLAGS_1} entry in the dynamic section. This causes the runtime linker to handle lookups in this object and its dependencies to be performed only inside the group. -@code{--no-undefined} is implied. This option is only meaningful on ELF +@option{--no-undefined} is implied. This option is only meaningful on ELF platforms which support shared libraries. @kindex -Bstatic @@ -826,7 +921,7 @@ Do not link against shared libraries. This is only meaningful on platforms for which shared libraries are supported. The different variants of this option are for compatibility with various systems. You may use this option multiple times on the command line: it affects -library searching for @code{-l} options which follow it. +library searching for @option{-l} options which follow it. @kindex -Bsymbolic @item -Bsymbolic @@ -860,6 +955,24 @@ sorted by name. For each symbol, a list of file names is given. If the symbol is defined, the first file listed is the location of the definition. The remaining files contain references to the symbol. +@cindex common allocation +@kindex --no-define-common +@item --no-define-common +This option inhibits the assignment of addresses to common symbols. +The script command @code{INHIBIT_COMMON_ALLOCATION} has the same effect. +@xref{Miscellaneous Commands}. + +The @samp{--no-define-common} option allows decoupling +the decision to assign addresses to Common symbols from the choice +of the output file type; otherwise a non-Relocatable output type +forces assigning addresses to Common symbols. +Using @samp{--no-define-common} allows Common symbols that are referenced +from a shared library to be assigned addresses only in the main program. +This eliminates the unused duplicate space in the shared library, +and also prevents any possible confusion over resolving to the wrong +duplicate when there are many dynamic modules with specialized search +paths for runtime symbol resolution. + @cindex symbols, from command line @kindex --defsym @var{symbol}=@var{exp} @item --defsym @var{symbol}=@var{expression} @@ -891,6 +1004,7 @@ demangle by default unless the environment variable @samp{COLLECT_NO_DEMANGLE} is set. These options may be used to override the default. @cindex dynamic linker, from command line +@kindex -I@var{file} @kindex --dynamic-linker @var{file} @item --dynamic-linker @var{file} Set the name of the dynamic linker. This is only meaningful when @@ -907,6 +1021,11 @@ 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 +Treat all warnings as errors. + @kindex --force-exe-suffix @item --force-exe-suffix Make sure that an output file has a .exe suffix. @@ -947,10 +1066,10 @@ Print a link map to the file @var{mapfile}. See the description of the @cindex memory usage @kindex --no-keep-memory @item --no-keep-memory -@code{ld} normally optimizes for speed over memory usage by caching the -symbol tables of input files in memory. This option tells @code{ld} to +@command{ld} normally optimizes for speed over memory usage by caching the +symbol tables of input files in memory. This option tells @command{ld} to instead optimize for memory usage, by rereading the symbol tables as -necessary. This may be required if @code{ld} runs out of memory space +necessary. This may be required if @command{ld} runs out of memory space while linking a large executable. @kindex --no-undefined @@ -959,7 +1078,7 @@ while linking a large executable. @itemx -z defs Normally when creating a non-symbolic shared library, undefined symbols are allowed and left to be resolved by the runtime loader. These options -disallow such undefined symbols. +disallows such undefined symbols. @kindex --allow-shlib-undefined @item --allow-shlib-undefined @@ -976,17 +1095,17 @@ is also normal for HPPA shared libraries to have undefined symbols. @kindex --no-warn-mismatch @item --no-warn-mismatch -Normally @code{ld} will give an error if you try to link together input +Normally @command{ld} will give an error if you try to link together input files that are mismatched for some reason, perhaps because they have been compiled for different processors or for different endiannesses. -This option tells @code{ld} that it should silently permit such possible +This option tells @command{ld} that it should silently permit such possible errors. This option should only be used with care, in cases when you have taken some special action that ensures that the linker errors are inappropriate. @kindex --no-whole-archive @item --no-whole-archive -Turn off the effect of the @code{--whole-archive} option for subsequent +Turn off the effect of the @option{--whole-archive} option for subsequent archive files. @cindex output file after errors @@ -1000,11 +1119,11 @@ when it issues any error whatsoever. @ifclear SingleFormat @kindex --oformat @item --oformat @var{output-format} -@code{ld} may be configured to support more than one kind of object -file. If your @code{ld} is configured this way, you can use the +@command{ld} may be configured to support more than one kind of object +file. If your @command{ld} is configured this way, you can use the @samp{--oformat} option to specify the binary format for the output -object file. Even when @code{ld} is configured to support alternative -object formats, you don't usually need to specify this, as @code{ld} +object file. Even when @command{ld} is configured to support alternative +object formats, you don't usually need to specify this, as @command{ld} should be configured to produce as a default output format the most usual format on each machine. @var{output-format} is a text string, the name of a particular format supported by the BFD libraries. (You can @@ -1030,10 +1149,10 @@ An option with machine dependent effects. This option is only supported on a few targets. @end ifset @ifset H8300 -@xref{H8/300,,@code{ld} and the H8/300}. +@xref{H8/300,,@command{ld} and the H8/300}. @end ifset @ifset I960 -@xref{i960,, @code{ld} and the Intel 960 family}. +@xref{i960,, @command{ld} and the Intel 960 family}. @end ifset @@ -1078,26 +1197,26 @@ line. It overrides @samp{-s} and @samp{-S}. @cindex runtime library search path @kindex -rpath Add a directory to the runtime library search path. This is used when -linking an ELF executable with shared objects. All @code{-rpath} +linking an ELF executable with shared objects. All @option{-rpath} arguments are concatenated and passed to the runtime linker, which uses -them to locate shared objects at runtime. The @code{-rpath} option is +them to locate shared objects at runtime. The @option{-rpath} option is also used when locating shared objects which are needed by shared objects explicitly included in the link; see the description of the -@code{-rpath-link} option. If @code{-rpath} is not used when linking an +@option{-rpath-link} option. If @option{-rpath} is not used when linking an ELF executable, the contents of the environment variable @code{LD_RUN_PATH} will be used if it is defined. -The @code{-rpath} option may also be used on SunOS. By default, on +The @option{-rpath} option may also be used on SunOS. By default, on SunOS, the linker will form a runtime search patch out of all the -@code{-L} options it is given. If a @code{-rpath} option is used, the -runtime search path will be formed exclusively using the @code{-rpath} -options, ignoring the @code{-L} options. This can be useful when using -gcc, which adds many @code{-L} options which may be on NFS mounted +@option{-L} options it is given. If a @option{-rpath} option is used, the +runtime search path will be formed exclusively using the @option{-rpath} +options, ignoring the @option{-L} options. This can be useful when using +gcc, which adds many @option{-L} options which may be on NFS mounted filesystems. -For compatibility with other ELF linkers, if the @code{-R} option is +For compatibility with other ELF linkers, if the @option{-R} option is followed by a directory name, rather than a file name, it is treated as -the @code{-rpath} option. +the @option{-rpath} option. @end ifset @ifset GENERIC @@ -1111,9 +1230,9 @@ of the input files. When the linker encounters such a dependency when doing a non-shared, non-relocatable link, it will automatically try to locate the required shared library and include it in the link, if it is not included -explicitly. In such a case, the @code{-rpath-link} option +explicitly. In such a case, the @option{-rpath-link} option specifies the first set of directories to search. The -@code{-rpath-link} option may specify a sequence of directory names +@option{-rpath-link} option may specify a sequence of directory names either by specifying a list of names separated by colons, or by appearing multiple times. @@ -1126,20 +1245,20 @@ The linker uses the following search paths to locate required shared libraries. @enumerate @item -Any directories specified by @code{-rpath-link} options. +Any directories specified by @option{-rpath-link} options. @item -Any directories specified by @code{-rpath} options. The difference -between @code{-rpath} and @code{-rpath-link} is that directories -specified by @code{-rpath} options are included in the executable and -used at runtime, whereas the @code{-rpath-link} option is only effective +Any directories specified by @option{-rpath} options. The difference +between @option{-rpath} and @option{-rpath-link} is that directories +specified by @option{-rpath} options are included in the executable and +used at runtime, whereas the @option{-rpath-link} option is only effective at link time. It is for the native linker only. @item -On an ELF system, if the @code{-rpath} and @code{rpath-link} options +On an ELF system, if the @option{-rpath} and @code{rpath-link} options were not used, search the contents of the environment variable @code{LD_RUN_PATH}. It is for the native linker only. @item -On SunOS, if the @code{-rpath} option was not used, search any -directories specified using @code{-L} options. +On SunOS, if the @option{-rpath} option was not used, search any +directories specified using @option{-L} options. @item For a native linker, the contents of the environment variable @code{LD_LIBRARY_PATH}. @@ -1166,20 +1285,20 @@ warning and continue with the link. @cindex shared libraries Create a shared library. This is currently only supported on ELF, XCOFF and SunOS platforms. On SunOS, the linker will automatically create a -shared library if the @code{-e} option is not used and there are +shared library if the @option{-e} option is not used and there are undefined symbols in the link. @item --sort-common @kindex --sort-common -This option tells @code{ld} to sort the common symbols by size when it +This option tells @command{ld} to sort the common symbols by size when it places them in the appropriate output sections. First come all the one -byte symbols, then all the two bytes, then all the four bytes, and then +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 --split-by-file @item --split-by-file [@var{size}] -Similar to @code{--split-by-reloc} but creates a new output section for +Similar to @option{--split-by-reloc} but creates a new output section for each input file when @var{size} is reached. @var{size} defaults to a size of 1 if not given. @@ -1204,16 +1323,16 @@ as execution time and memory usage. @kindex --traditional-format @cindex traditional format @item --traditional-format -For some targets, the output of @code{ld} is different in some ways from -the output of some existing linker. This switch requests @code{ld} to +For some targets, the output of @command{ld} is different in some ways from +the output of some existing linker. This switch requests @command{ld} to use the traditional format instead. @cindex dbx -For example, on SunOS, @code{ld} combines duplicate entries in the +For example, on SunOS, @command{ld} combines duplicate entries in the symbol string table. This can reduce the size of an output file with full debugging information by over 30 percent. Unfortunately, the SunOS @code{dbx} program can not read the resulting program (@code{gdb} has no -trouble). The @samp{--traditional-format} switch tells @code{ld} to not +trouble). The @samp{--traditional-format} switch tells @command{ld} to not combine duplicate entries. @kindex --section-start @var{sectionname}=@var{org} @@ -1245,9 +1364,9 @@ for compatibility with other linkers, you may omit the leading @cindex verbose @item --dll-verbose @itemx --verbose -Display the version number for @code{ld} and list the linker emulations +Display the version number for @command{ld} and list the linker emulations supported. Display which input files can and cannot be opened. Display -the linker script if using a default builtin script. +the linker script being used by the linker. @kindex --version-script=@var{version-scriptfile} @cindex version script, symbol versions @@ -1258,7 +1377,7 @@ about the version heirarchy for the library being created. This option is only meaningful on ELF platforms which support shared libraries. @xref{VERSION}. -@kindex --warn-comon +@kindex --warn-common @cindex warnings, on combining symbols @cindex combining symbols, warnings on @item --warn-common @@ -1384,15 +1503,15 @@ the section (@pxref{SECTIONS}). @cindex including an entire archive @item --whole-archive For each archive mentioned on the command line after the -@code{--whole-archive} option, include every object file in the archive +@option{--whole-archive} option, include every object file in the archive in the link, rather than searching the archive for the required object files. This is normally used to turn an archive file into a shared library, forcing every object to be included in the resulting shared library. This option may be used more than once. Two notes when using this option from gcc: First, gcc doesn't know -about this option, so you have to use @code{-Wl,-whole-archive}. -Second, don't forget to use @code{-Wl,-no-whole-archive} after your +about this option, so you have to use @option{-Wl,-whole-archive}. +Second, don't forget to use @option{-Wl,-no-whole-archive} after your list of archives, because gcc will add its own list of archives to your link and you may not want this flag to affect those as well. @@ -1419,13 +1538,13 @@ __wrap_malloc (int c) @} @end smallexample -If you link other code with this file using @code{--wrap malloc}, then +If you link other code with this file using @option{--wrap malloc}, then all calls to @code{malloc} will call the function @code{__wrap_malloc} instead. The call to @code{__real_malloc} in @code{__wrap_malloc} will call the real @code{malloc} function. You may wish to provide a @code{__real_malloc} function as well, so that -links without the @code{--wrap} option will succeed. If you do this, +links without the @option{--wrap} option will succeed. If you do this, 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}. @@ -1436,16 +1555,20 @@ call before the linker has a chance to wrap it to @code{malloc}. @itemx --disable-new-dtags This linker can create the new dynamic tags in ELF. But the older ELF systems may not understand them. If you specify -@code{--enable-new-dtags}, the dynamic tags will be created as needed. -If you specify @code{--disable-new-dtags}, no new dynamic tags will be +@option{--enable-new-dtags}, the dynamic tags will be created as needed. +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. @end table +@c man end + @subsection Options specific to i386 PE targets -The i386 PE linker supports the @code{-shared} option, which causes +@c man begin OPTIONS + +The i386 PE linker supports the @option{-shared} option, which causes the output to be a dynamically linked library (DLL) instead of a normal executable. You should name the output @code{*.dll} when you use this option. In addition, the linker fully supports the standard @@ -1459,7 +1582,7 @@ support additional command line options that are specific to the i386 PE target. Options that take values may be separated from their values by either a space or an equals sign. -@table @code +@table @gcctabopt @kindex --add-stdcall-alias @item --add-stdcall-alias @@ -1475,7 +1598,7 @@ addresses of all the relocations needed for generating DLLs with @kindex --dll @item --dll Create a DLL instead of a regular executable. You may also use -@code{-shared} or specify a @code{LIBRARY} in a given @code{.def} +@option{-shared} or specify a @code{LIBRARY} in a given @code{.def} file. @kindex --enable-stdcall-fixup @@ -1491,9 +1614,9 @@ undefined symbol @code{_foo} might be linked to the function to the function @code{_bar}. When the linker does this, it prints a warning, since it normally should have failed to link, but sometimes import libraries generated from third-party dlls may need this feature -to be usable. If you specify @code{--enable-stdcall-fixup}, this +to be usable. If you specify @option{--enable-stdcall-fixup}, this feature is fully enabled and warnings are not printed. If you specify -@code{--disable-stdcall-fixup}, this feature is disabled and such +@option{--disable-stdcall-fixup}, this feature is disabled and such mismatches are considered to be errors. @cindex DLLs, creating @@ -1505,8 +1628,22 @@ otherwise wouldn't be any exported symbols. When symbols are explicitly exported via DEF files or implicitly exported via function attributes, the default is to not export anything else unless this option is given. Note that the symbols @code{DllMain@@12}, -@code{DllEntryPoint@@0}, and @code{impure_ptr} will not be automatically -exported. +@code{DllEntryPoint@@0}, @code{DllMainCRTStartup@@12}, and +@code{impure_ptr} will not be automatically +exported. Also, symbols imported from other DLLs will not be +re-exported, nor will symbols specifying the DLL's internal layout +such as those beginning with @code{_head_} or ending with +@code{_iname}. In addition, no symbols from @code{libgcc}, +@code{libstd++}, @code{libmingw32}, or @code{crtX.o} will be exported. +Symbols whose names begin with @code{__rtti_} or @code{__builtin_} will +not be exported, to help with C++ DLLs. Finally, there is an +extensive list of cygwin-private symbols that are not exported +(obviously, this applies on when building DLLs for cygwin targets). +These cygwin-excludes are: @code{_cygwin_dll_entry@@12}, +@code{_cygwin_crt0_common@@8}, @code{_cygwin_noncygwin_dll_entry@@12}, +@code{_fmode}, @code{_impure_ptr}, @code{cygwin_attach_dll}, +@code{cygwin_premain0}, @code{cygwin_premain1}, @code{cygwin_premain2}, +@code{cygwin_premain3}, and @code{environ}. @kindex --exclude-symbols @item --exclude-symbols @var{symbol},@var{symbol},... @@ -1576,6 +1713,164 @@ file corresponding to the DLL the linker is generating. This DEF file library with @code{dlltool} or may be used as a reference to automatically or implicitly exported symbols. +@cindex DLLs, creating +@kindex --out-implib +@item --out-implib @var{file} +The linker will create the file @var{file} which will contain an +import lib corresponding to the DLL the linker is generating. This +import lib (which should be called @code{*.dll.a} or @code{*.a} +may be used to link clients against the generated DLL; this behavior +makes it possible to skip a separate @code{dlltool} import library +creation step. + +@kindex --enable-auto-image-base +@item --enable-auto-image-base +Automatically choose the image base for DLLs, unless one is specified +using the @code{--image-base} argument. By using a hash generated +from the dllname to create unique image bases for each DLL, in-memory +collisions and relocations which can delay program execution are +avoided. + +@kindex --disable-auto-image-base +@item --disable-auto-image-base +Do not automatically generate a unique image base. If there is no +user-specified image base (@code{--image-base}) then use the platform +default. + +@cindex DLLs, linking to +@kindex --dll-search-prefix +@item --dll-search-prefix @var{string} +When linking dynamically to a dll without an import library, i +search for @code{<string><basename>.dll} in preference to +@code{lib<basename>.dll}. This behavior allows easy distinction +between DLLs built for the various "subplatforms": native, cygwin, +uwin, pw, etc. For instance, cygwin DLLs typically use +@code{--dll-search-prefix=cyg}. + +@kindex --enable-auto-import +@item --enable-auto-import +Do sophisticated linking of @code{_symbol} to @code{__imp__symbol} for +DATA imports from DLLs, and create the necessary thunking symbols when +building the DLLs with those DATA exports. This generally will 'just +work' -- but sometimes you may see this message: + +"variable '<var>' can't be auto-imported. Please read the +documentation for ld's @code{--enable-auto-import} for details." + +This message occurs when some (sub)expression accesses an address +ultimately given by the sum of two constants (Win32 import tables only +allow one). Instances where this may occur include accesses to member +fields of struct variables imported from a DLL, as well as using a +constant index into an array variable imported from a DLL. Any +multiword variable (arrays, structs, long long, etc) may trigger +this error condition. However, regardless of the exact data type +of the offending exported variable, ld will always detect it, issue +the warning, and exit. + +There are several ways to address this difficulty, regardless of the +data type of the exported variable: + +One solution is to force one of the 'constants' to be a variable -- +that is, unknown and un-optimizable at compile time. For arrays, +there are two possibilities: a) make the indexee (the array's address) +a variable, or b) make the 'constant' index a variable. Thus: + +@example +extern type extern_array[]; +extern_array[1] --> + @{ volatile type *t=extern_array; t[1] @} +@end example + +or + +@example +extern type extern_array[]; +extern_array[1] --> + @{ volatile int t=1; extern_array[t] @} +@end example + +For structs (and most other multiword data types) the only option +is to make the struct itself (or the long long, or the ...) variable: + +@example +extern struct s extern_struct; +extern_struct.field --> + @{ volatile struct s *t=&extern_struct; t->field @} +@end example + +or + +@example +extern long long extern_ll; +extern_ll --> + @{ volatile long long * local_ll=&extern_ll; *local_ll @} +@end example + +A second method of dealing with this difficulty is to abandon +'auto-import' for the offending symbol and mark it with +@code{__declspec(dllimport)}. However, in practice that +requires using compile-time #defines to indicate whether you are +building a DLL, building client code that will link to the DLL, or +merely building/linking to a static library. In making the choice +between the various methods of resolving the 'direct address with +constant offset' problem, you should consider typical real-world usage: + +Original: +@example +--foo.h +extern int arr[]; +--foo.c +#include "foo.h" +void main(int argc, char **argv)@{ + printf("%d\n",arr[1]); +@} +@end example + +Solution 1: +@example +--foo.h +extern int arr[]; +--foo.c +#include "foo.h" +void main(int argc, char **argv)@{ + /* This workaround is for win32 and cygwin; do not "optimize" */ + volatile int *parr = arr; + printf("%d\n",parr[1]); +@} +@end example + +Solution 2: +@example +--foo.h +/* Note: auto-export is assumed (no __declspec(dllexport)) */ +#if (defined(_WIN32) || defined(__CYGWIN__)) && \ + !(defined(FOO_BUILD_DLL) || defined(FOO_STATIC)) +#define FOO_IMPORT __declspec(dllimport) +#else +#define FOO_IMPORT +#endif +extern FOO_IMPORT int arr[]; +--foo.c +#include "foo.h" +void main(int argc, char **argv)@{ + printf("%d\n",arr[1]); +@} +@end example + +A third way to avoid this problem is to re-code your +library to use a functional interface rather than a data interface +for the offending variables (e.g. set_foo() and get_foo() accessor +functions). + +@kindex --disable-auto-import +@item --disable-auto-import +Do not attempt to do sophisticalted linking of @code{_symbol} to +@code{__imp__symbol} for DATA imports from DLLs. + +@kindex --enable-extra-pe-debug +@item --enable-extra-pe-debug +Show additional debug info related to auto-import symbol thunking. + @kindex --section-alignment @item --section-alignment Sets the section alignment. Sections in memory will always begin at @@ -1586,7 +1881,7 @@ addresses which are a multiple of this number. Defaults to 0x1000. @item --stack @var{reserve} @itemx --stack @var{reserve},@var{commit} Specify the amount of memory to reserve (and optionally commit) to be -used as stack for this program. The default is 32Mb reserved, 4K +used as stack for this program. The default is 2Mb reserved, 4K committed. @kindex --subsystem @@ -1600,11 +1895,15 @@ subsystem version also. @end table +@c man end + @ifset UsesEnvVars @node Environment @section Environment Variables -You can change the behavior of @code{ld} with the environment variables +@c man begin ENVIRONMENT + +You can change the behavior of @command{ld} with the environment variables @code{GNUTARGET}, @code{LDEMULATION}, and @code{COLLECT_NO_DEMANGLE}. @kindex GNUTARGET @@ -1612,7 +1911,7 @@ You can change the behavior of @code{ld} with the environment variables @code{GNUTARGET} determines the input-file object format if you don't use @samp{-b} (or its synonym @samp{--format}). Its value should be one of the BFD names for an input format (@pxref{BFD}). If there is no -@code{GNUTARGET} in the environment, @code{ld} uses the natural format +@code{GNUTARGET} in the environment, @command{ld} uses the natural format of the target. If @code{GNUTARGET} is set to @code{default} then BFD attempts to discover the input format by examining binary input files; this method often succeeds, but there are potential ambiguities, since @@ -1631,7 +1930,6 @@ available emulations with the @samp{--verbose} or @samp{-V} options. If the @samp{-m} option is not used, and the @code{LDEMULATION} environment variable is not defined, the default emulation depends upon how the linker was configured. -@end ifset @kindex COLLECT_NO_DEMANGLE @cindex demangling, default @@ -1642,6 +1940,9 @@ a similar fashion by the @code{gcc} linker wrapper program. The default may be overridden by the @samp{--demangle} and @samp{--no-demangle} options. +@c man end +@end ifset + @node Scripts @chapter Linker Scripts @@ -1883,7 +2184,7 @@ Several linker script commands deal with files. @cindex including a linker script Include the linker script @var{filename} at this point. The file will be searched for in the current directory, and in any directory specified -with the @code{-L} option. You can nest calls to @code{INCLUDE} up to +with the @option{-L} option. You can nest calls to @code{INCLUDE} up to 10 levels deep. @item INPUT(@var{file}, @var{file}, @dots{}) @@ -1907,7 +2208,7 @@ it is not found, the linker will search through the archive library search path. See the description of @samp{-L} in @ref{Options,,Command Line Options}. -If you use @samp{INPUT (-l@var{file})}, @code{ld} will transform the +If you use @samp{INPUT (-l@var{file})}, @command{ld} will transform the name to @code{lib@var{file}.a}, as with the command line argument @samp{-l}. @@ -1942,7 +2243,7 @@ output file other than the usual default of @file{a.out}. @cindex archive search path in linker script @cindex search path in linker script The @code{SEARCH_DIR} command adds @var{path} to the list of paths where -@code{ld} looks for archive libraries. Using +@command{ld} looks for archive libraries. Using @code{SEARCH_DIR(@var{path})} is exactly like using @samp{-L @var{path}} on the command line (@pxref{Options,,Command Line Options}). If both are used, then the linker will search both paths. Paths specified using @@ -2030,13 +2331,20 @@ command has the same effect as the @samp{-u} command-line option. @kindex FORCE_COMMON_ALLOCATION @cindex common allocation in linker script This command has the same effect as the @samp{-d} command-line option: -to make @code{ld} assign space to common symbols even if a relocatable +to make @command{ld} assign space to common symbols even if a relocatable output file is specified (@samp{-r}). +@item INHIBIT_COMMON_ALLOCATION +@kindex INHIBIT_COMMON_ALLOCATION +@cindex common allocation in linker script +This command has the same effect as the @samp{--no-define-common} +command-line option: to make @code{ld} omit the assignment of addresses +to common symbols even for a non-relocatable output file. + @item NOCROSSREFS(@var{section} @var{section} @dots{}) @kindex NOCROSSREFS(@var{sections}) @cindex cross references -This command may be used to tell @code{ld} to issue an error about any +This command may be used to tell @command{ld} to issue an error about any references among certain output sections. In certain types of programs, particularly on embedded systems when @@ -2046,7 +2354,7 @@ errors. For example, it would be an error if code in one section called a function defined in the other section. The @code{NOCROSSREFS} command takes a list of output section names. If -@code{ld} detects any cross references between the sections, it reports +@command{ld} detects any cross references between the sections, it reports an error and returns a non-zero exit status. Note that the @code{NOCROSSREFS} command uses output section names, not input section names. @@ -2374,7 +2682,8 @@ There are two ways to include more than one section: @noindent The difference between these is the order in which the @samp{.text} and @samp{.rdata} input sections will appear in the output section. In the -first example, they will be intermingled. In the second example, all +first example, they will be intermingled, appearing in the same order as +they are found in the linker input. In the second example, all @samp{.text} input sections will appear first, followed by all @samp{.rdata} input sections. @@ -2615,16 +2924,16 @@ You may use the @code{FILL} command to set the fill pattern for the current section. It is followed by an expression in parentheses. Any otherwise unspecified regions of memory within the section (for example, gaps left due to the required alignment of input sections) are filled -with the two least significant bytes of the expression, repeated as +with the four least significant bytes of the expression, repeated as necessary. A @code{FILL} statement covers memory locations after the point at which it occurs in the section definition; by including more than one @code{FILL} statement, you can have different fill patterns in different parts of an output section. This example shows how to fill unspecified regions of memory with the -value @samp{0x9090}: +value @samp{0x90}: @smallexample -FILL(0x9090) +FILL(0x90909090) @end smallexample The @code{FILL} command is similar to the @samp{=@var{fillexp}} output @@ -2910,7 +3219,7 @@ You can set the fill pattern for an entire section by using @samp{=@var{fillexp}}. @var{fillexp} is an expression (@pxref{Expressions}). Any otherwise unspecified regions of memory within the output section (for example, gaps left due to the required -alignment of input sections) will be filled with the two least +alignment of input sections) will be filled with the four least significant bytes of the value, repeated as necessary. You can also change the fill value with a @code{FILL} command in the @@ -2919,7 +3228,7 @@ output section commands; see @ref{Output Section Data}. Here is a simple example: @smallexample @group -SECTIONS @{ .text : @{ *(.text) @} =0x9090 @} +SECTIONS @{ .text : @{ *(.text) @} =0x90909090 @} @end group @end smallexample @@ -3378,6 +3687,15 @@ they might suggest to the person reading them. The @samp{2.0} version could just as well have appeared in between @samp{1.1} and @samp{1.2}. However, this would be a confusing way to write a version script. +Node name can be omited, provided it is the only version node +in the version script. Such version script doesn't assign any versions to +symbols, only selects which symbols will be globally visible out and which +won't. + +@smallexample +@{ global: foo; bar; local: *; @} +@end smallexample + When you link an application against a shared library that has versioned symbols, the application itself knows which version of each symbol it requires, and it also knows which version nodes it needs from each @@ -3446,6 +3764,17 @@ within the shared library, you can use the aliases of convenience (i.e. @samp{old_foo}), or you can use the @samp{.symver} directive to specifically bind to an external version of the function in question. +You can also specify the language in the version script: + +@smallexample +VERSION extern "lang" @{ version-script-commands @} +@end smallexample + +The supported @samp{lang}s are @samp{C}, @samp{C++}, and @samp{Java}. +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}. + @node Expressions @section Expressions in Linker Scripts @cindex expressions @@ -3551,7 +3880,7 @@ SECTIONS file2(.text) . += 1000; file3(.text) - @} = 0x1234; + @} = 0x12345678; @} @end smallexample @noindent @@ -3559,7 +3888,7 @@ In the previous example, the @samp{.text} section from @file{file1} is located at the beginning of the output section @samp{output}. It is followed by a 1000 byte gap. Then the @samp{.text} section from @file{file2} appears, also with a 1000 byte gap following before the -@samp{.text} section from @file{file3}. The notation @samp{= 0x1234} +@samp{.text} section from @file{file3}. The notation @samp{= 0x12345678} specifies what data to write in the gaps (@pxref{Output Section Fill}). @cindex dot inside sections @@ -3937,8 +4266,8 @@ read. This can affect archive searching. @chapter Machine Dependent Features @cindex machine dependencies -@code{ld} has additional features on some platforms; the following -sections describe them. Machines where @code{ld} has no additional +@command{ld} has additional features on some platforms; the following +sections describe them. Machines where @command{ld} has no additional functionality are not listed. @menu @@ -3946,8 +4275,11 @@ functionality are not listed. * i960:: @code{ld} and the Intel 960 family * ARM:: @code{ld} and the ARM family * HPPA ELF32:: @code{ld} and HPPA 32-bit ELF +@ifset MMIX +* MMIX:: @code{ld} and MMIX +@end ifset @ifset TICOFF -* TI COFF:: @code{ld} and TI COFF +* TI COFF:: @command{ld} and TI COFF @end ifset @end menu @end ifset @@ -3960,16 +4292,16 @@ functionality are not listed. @end ifclear @node H8/300 -@section @code{ld} and the H8/300 +@section @command{ld} and the H8/300 @cindex H8/300 support -For the H8/300, @code{ld} can perform these global optimizations when +For the H8/300, @command{ld} can perform these global optimizations when you specify the @samp{--relax} command-line option. @table @emph @cindex relaxing on H8/300 @item relaxing address modes -@code{ld} finds all @code{jsr} and @code{jmp} instructions whose +@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. @@ -3977,7 +4309,7 @@ respectively. @cindex synthesizing on H8/300 @item synthesizing instructions @c FIXME: specifically mov.b, or any mov instructions really? -@code{ld} finds all @code{mov.b} instructions which use the +@command{ld} finds all @code{mov.b} instructions which use the sixteen-bit absolute address form, but refer to the top 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 @@ -3995,9 +4327,9 @@ top page of memory). @c This stuff is pointless to say unless you're especially concerned @c with Hitachi chips; don't enable it for generic case, please. @node Hitachi -@chapter @code{ld} and other Hitachi chips +@chapter @command{ld} and other Hitachi chips -@code{ld} also supports the H8/300H, the H8/500, and the Hitachi SH. No +@command{ld} also supports the H8/300H, the H8/500, and the Hitachi SH. No special features, commands, or command-line options are required for these chips. @end ifset @@ -4009,7 +4341,7 @@ these chips. @end ifclear @node i960 -@section @code{ld} and the Intel 960 family +@section @command{ld} and the Intel 960 family @cindex i960 support @@ -4021,7 +4353,7 @@ linker's search strategy for archive libraries, to support the use of libraries specific to each particular architecture, by including in the search loop names suffixed with the string identifying the architecture. -For example, if your @code{ld} command line included @w{@samp{-ACA}} as +For example, if your @command{ld} command line included @w{@samp{-ACA}} as well as @w{@samp{-ltry}}, the linker would look (in its built-in search paths, and in any paths you specify with @samp{-L}) for a library with the names @@ -4044,13 +4376,13 @@ the 960 architecture family allows combination of target architectures; each use will add another pair of name variants to search for when @w{@samp{-l}} specifies a library. -@cindex @code{--relax} on i960 +@cindex @option{--relax} on i960 @cindex relaxing on i960 -@code{ld} supports the @samp{--relax} option for the i960 family. If -you specify @samp{--relax}, @code{ld} finds all @code{balx} and +@command{ld} supports the @samp{--relax} option for the i960 family. If +you specify @samp{--relax}, @command{ld} finds all @code{balx} and @code{calx} instructions whose targets are within 24 bits, and turns them into 24-bit program-counter relative @code{bal} and @code{cal} -instructions, respectively. @code{ld} also turns @code{cal} +instructions, respectively. @command{ld} also turns @code{cal} instructions into @code{bal} instructions when it determines that the target subroutine is a leaf routine (that is, the target subroutine does not itself call any subroutines). @@ -4065,11 +4397,11 @@ not itself call any subroutines). @end ifclear @node ARM -@section @code{ld}'s support for interworking between ARM and Thumb code +@section @command{ld}'s support for interworking between ARM and Thumb code @cindex ARM interworking support @kindex --support-old-code -For the ARM, @code{ld} will generate code stubs to allow functions calls +For the ARM, @command{ld} will generate code stubs to allow functions calls betweem ARM and Thumb code. These stubs only work with code that has been compiled and assembled with the @samp{-mthumb-interwork} command line option. If it is necessary to link with old ARM object files or @@ -4090,18 +4422,18 @@ branched to using a BX instruction, and the program will start executing in Thumb mode straight away. @node HPPA ELF32 -@section @code{ld} and HPPA 32-bit ELF support +@section @command{ld} and HPPA 32-bit ELF support @cindex HPPA multiple sub-space stubs @kindex --multi-subspace -When generating a shared library, @code{ld} will by default generate +When generating a shared library, @command{ld} will by default generate import stubs suitable for use with a single sub-space application. -The @samp{--multi-subspace} switch causes @code{ld} to generate export +The @samp{--multi-subspace} switch causes @command{ld} to generate export stubs, and different (larger) import stubs suitable for use with multiple sub-spaces. @cindex HPPA stub grouping @kindex --stub-group-size=@var{N} -Long branch stubs and import/export stubs are placed by @code{ld} in +Long branch stubs and import/export 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, @@ -4112,7 +4444,7 @@ 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 -@code{ld} to automatically size input section groups for the branch types +@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. @@ -4121,15 +4453,41 @@ 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. +@ifset MMIX +@node MMIX +@section @code{ld} and MMIX +For MMIX, there is choice of generating @code{ELF} object files or +@code{mmo} object files when linking. The simulator @code{mmix} +understands the @code{mmo} format. The binutils @code{objcopy} utility +can translate between the two formats. + +There is one special section, the @samp{.MMIX.reg_contents} section. +Contents in this section is assumed to correspond to that of global +registers, and symbols referring to it are translated to special symbols, +equal to registers. In a final link, the start address of the +@samp{.MMIX.reg_contents} section corresponds to the first allocated +global register multiplied by 8. Register @code{$255} is not included in +this section; it is always set to the program entry, which is at the +symbol @code{Main} for @code{mmo} files. + +Symbols with the prefix @code{__.MMIX.start.}, for example +@code{__.MMIX.start..text} and @code{__.MMIX.start..data} are special; +there must be only one each, even if they are local. The default linker +script uses these to set the default start address of a section. + +Initial and trailing multiples of zero-valued 32-bit words in a section, +are left out from an mmo file. +@end ifset + @ifset TICOFF @node TI COFF -@section @code{ld}'s support for various TI COFF versions +@section @command{ld}'s support for various TI COFF versions @cindex TI COFF versions @kindex --format=@var{version} The @samp{--format} switch allows selection of one of the various TI COFF versions. The latest of this writing is 2; versions 0 and 1 are also supported. The TI COFF versions also vary in header byte-order -format; @code{ld} will read any version or byte order, but the output +format; @command{ld} will read any version or byte order, but the output header format depends on the default specified by the specific target. @end ifset @@ -4182,16 +4540,16 @@ conversion and during output. @xref{BFD information loss}. @node Reporting Bugs @chapter Reporting Bugs -@cindex bugs in @code{ld} -@cindex reporting bugs in @code{ld} +@cindex bugs in @command{ld} +@cindex reporting bugs in @command{ld} -Your bug reports play an essential role in making @code{ld} reliable. +Your bug reports play an essential role in making @command{ld} reliable. Reporting a bug may help you by bringing a solution to your problem, or it may not. But in any case the principal function of a bug report is -to help the entire community by making the next version of @code{ld} +to help the entire community by making the next version of @command{ld} work better. Bug reports are your contribution to the maintenance of -@code{ld}. +@command{ld}. In order for a bug report to serve its purpose, you must include the information that enables us to fix the bug. @@ -4213,37 +4571,37 @@ If you are not sure whether you have found a bug, here are some guidelines: @cindex crash of linker @item If the linker gets a fatal signal, for any input whatever, that is a -@code{ld} bug. Reliable linkers never crash. +@command{ld} bug. Reliable linkers never crash. @cindex error on valid input @item -If @code{ld} produces an error message for valid input, that is a bug. +If @command{ld} produces an error message for valid input, that is a bug. @cindex invalid input @item -If @code{ld} does not produce an error message for invalid input, that +If @command{ld} does not produce an error message for invalid input, that may be a bug. In the general case, the linker can not verify that object files are correct. @item If you are an experienced user of linkers, your suggestions for -improvement of @code{ld} are welcome in any case. +improvement of @command{ld} are welcome in any case. @end itemize @node Bug Reporting @section How to report bugs @cindex bug reports -@cindex @code{ld} bugs, reporting +@cindex @command{ld} bugs, reporting A number of companies and individuals offer support for @sc{gnu} -products. If you obtained @code{ld} from a support organization, we +products. If you obtained @command{ld} from a support organization, we recommend you contact that organization first. You can find contact information for many support companies and individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs distribution. -Otherwise, send bug reports for @code{ld} to +Otherwise, send bug reports for @command{ld} to @samp{bug-binutils@@gnu.org}. The fundamental principle of reporting bugs usefully is this: @@ -4273,14 +4631,14 @@ To enable us to fix the bug, you should include all these things: @itemize @bullet @item -The version of @code{ld}. @code{ld} announces it if you start it with +The version of @command{ld}. @command{ld} announces it if you start it with the @samp{--version} argument. Without this, we will not know whether there is any point in looking for -the bug in the current version of @code{ld}. +the bug in the current version of @command{ld}. @item -Any patches you may have applied to the @code{ld} source, including any +Any patches you may have applied to the @command{ld} source, including any patches made to the @code{BFD} library. @item @@ -4288,7 +4646,7 @@ The type of machine you are using, and the operating system name and version number. @item -What compiler (and its version) was used to compile @code{ld}---e.g. +What compiler (and its version) was used to compile @command{ld}---e.g. ``@code{gcc-2.7}''. @item @@ -4317,14 +4675,14 @@ how @code{gas} or @code{gcc} were configured. A description of what behavior you observe that you believe is incorrect. For example, ``It gets a fatal signal.'' -Of course, if the bug is that @code{ld} gets a fatal signal, then we +Of course, if the bug is that @command{ld} gets a fatal signal, then we will certainly notice it. But if the bug is incorrect output, we might not notice unless it is glaringly wrong. You might as well not give us a chance to make a mistake. Even if the problem you experience is a fatal signal, you should still say so explicitly. Suppose something strange is going on, such as, your -copy of @code{ld} is out of synch, or you have encountered a bug in the +copy of @command{ld} is out of synch, or you have encountered a bug in the C library on your system. (This has happened!) Your copy might crash and ours would not. If you told us to expect a crash, then when ours fails to crash, we would know that the bug was not happening for us. If @@ -4332,10 +4690,10 @@ you had not told us to expect a crash, then we would not be able to draw any conclusion from our observations. @item -If you wish to suggest changes to the @code{ld} source, send us context +If you wish to suggest changes to the @command{ld} source, send us context diffs, as generated by @code{diff} with the @samp{-u}, @samp{-c}, or @samp{-p} option. Always send diffs from the old file to the new file. -If you even discuss something in the @code{ld} source, refer to it by +If you even discuss something in the @command{ld} source, refer to it by context, not by line number. The line numbers in our development sources will not match those in your @@ -4373,7 +4731,7 @@ the necessary information, such as the test case, on the assumption that a patch is all we need. We might see problems with your patch and decide to fix the problem another way, or we might not understand it at all. -Sometimes with a program as complicated as @code{ld} it is very hard to +Sometimes with a program as complicated as @command{ld} it is very hard to construct an example that will make the program follow a certain path through the code. If you do not send us the example, we will not be able to construct one, so we will not be able to verify that the bug is @@ -4393,12 +4751,12 @@ things without first using the debugger to find the facts. @node MRI @appendix MRI Compatible Script Files @cindex MRI compatibility -To aid users making the transition to @sc{gnu} @code{ld} from the MRI -linker, @code{ld} can use MRI compatible linker scripts as an +To aid users making the transition to @sc{gnu} @command{ld} from the MRI +linker, @command{ld} can use MRI compatible linker scripts as an alternative to the more general-purpose linker scripting language described in @ref{Scripts}. MRI compatible linker scripts have a much simpler command set than the scripting language otherwise used with -@code{ld}. @sc{gnu} @code{ld} supports the most commonly used MRI +@command{ld}. @sc{gnu} @command{ld} supports the most commonly used MRI linker commands; these commands are described here. In general, MRI scripts aren't of much use with the @code{a.out} object @@ -4411,7 +4769,7 @@ You can specify a file containing an MRI-compatible script using the Each command in an MRI-compatible script occupies its own line; each command line starts with the keyword that identifies the command (though blank lines are also allowed for punctuation). If a line of an -MRI-compatible script begins with an unrecognized keyword, @code{ld} +MRI-compatible script begins with an unrecognized keyword, @command{ld} issues a warning message, but continues processing the script. Lines beginning with @samp{*} are comments. @@ -4424,7 +4782,7 @@ The following list shows only the upper-case form of each command. @cindex @code{ABSOLUTE} (MRI) @item ABSOLUTE @var{secname} @itemx ABSOLUTE @var{secname}, @var{secname}, @dots{} @var{secname} -Normally, @code{ld} includes in the output file all sections from all +Normally, @command{ld} includes in the output file all sections from all the input files. However, in an MRI-compatible script, you can use the @code{ABSOLUTE} command to restrict the sections that will be present in your output program. If the @code{ABSOLUTE} command is used at all in a @@ -4479,7 +4837,7 @@ COFF (the @samp{coff-m68k} variant in BFD), if @var{output-format} is @cindex @code{LIST} (MRI) @item LIST @var{anything}@dots{} Print (to the standard output file) a link map, as produced by the -@code{ld} command-line option @samp{-M}. +@command{ld} command-line option @samp{-M}. The keyword @code{LIST} may be followed by anything on the same line, with no change in its effect. @@ -4488,19 +4846,19 @@ same line, with no change in its effect. @item LOAD @var{filename} @itemx LOAD @var{filename}, @var{filename}, @dots{} @var{filename} Include one or more object file @var{filename} in the link; this has the -same effect as specifying @var{filename} directly on the @code{ld} +same effect as specifying @var{filename} directly on the @command{ld} command line. @cindex @code{NAME} (MRI) @item NAME @var{output-name} -@var{output-name} is the name for the program produced by @code{ld}; the +@var{output-name} is the name for the program produced by @command{ld}; the MRI-compatible command @code{NAME} is equivalent to the command-line option @samp{-o} or the general script language command @code{OUTPUT}. @cindex @code{ORDER} (MRI) @item ORDER @var{secname}, @var{secname}, @dots{} @var{secname} @itemx ORDER @var{secname} @var{secname} @var{secname} -Normally, @code{ld} orders the sections in its output file in the +Normally, @command{ld} orders the sections in its output file in the order in which they first appear in the input files. In an MRI-compatible script, you can override this ordering with the @code{ORDER} command. The sections you list with @code{ORDER} will appear first in your output @@ -4910,5 +5268,3 @@ to permit their use in free software. @contents @bye - - diff --git a/contrib/binutils/ld/ldcref.c b/contrib/binutils/ld/ldcref.c index 6b15ffd..c6ea18b 100644 --- a/contrib/binutils/ld/ldcref.c +++ b/contrib/binutils/ld/ldcref.c @@ -73,9 +73,9 @@ static boolean cref_fill_array PARAMS ((struct cref_hash_entry *, PTR)); static int cref_sort_array PARAMS ((const PTR, const PTR)); static void output_one_cref PARAMS ((FILE *, struct cref_hash_entry *)); static boolean check_nocrossref PARAMS ((struct cref_hash_entry *, PTR)); +static void check_section_sym_xref PARAMS ((lang_input_statement_type *)); static void check_refs - PARAMS ((struct cref_hash_entry *, struct bfd_link_hash_entry *, - struct lang_nocrossrefs *)); + PARAMS ((const char *, asection *, bfd *, struct lang_nocrossrefs *)); static void check_reloc_refs PARAMS ((bfd *, asection *, PTR)); /* Look up an entry in the cref hash table. */ @@ -342,6 +342,41 @@ check_nocrossrefs () return; cref_hash_traverse (&cref_table, check_nocrossref, (PTR) NULL); + + lang_for_each_file (check_section_sym_xref); +} + +/* Checks for prohibited cross references to section symbols. */ + +static void +check_section_sym_xref (statement) + lang_input_statement_type *statement; +{ + bfd *abfd; + asection *sec; + + abfd = statement->the_bfd; + if (abfd == NULL) + return; + + for (sec = abfd->sections; sec != NULL; sec = sec->next) + { + asection *outsec; + + outsec = sec->output_section; + if (outsec != NULL) + { + const char *outsecname; + struct lang_nocrossrefs *ncrs; + struct lang_nocrossref *ncr; + + outsecname = outsec->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 one symbol to see if it is a prohibited cross reference. */ @@ -356,6 +391,7 @@ check_nocrossref (h, ignore) const char *defsecname; struct lang_nocrossrefs *ncrs; struct lang_nocrossref *ncr; + struct cref_ref *ref; hl = bfd_link_hash_lookup (link_info.hash, h->root.string, false, false, true); @@ -378,7 +414,8 @@ check_nocrossref (h, ignore) for (ncrs = nocrossref_list; ncrs != NULL; ncrs = ncrs->next) for (ncr = ncrs->list; ncr != NULL; ncr = ncr->next) if (strcmp (ncr->name, defsecname) == 0) - check_refs (h, hl, ncrs); + for (ref = h->refs; ref != NULL; ref = ref->next) + check_refs (hl->root.string, hl->u.def.section, ref->abfd, ncrs); return true; } @@ -387,11 +424,10 @@ check_nocrossref (h, ignore) check_reloc_refs through bfd_map_over_sections. */ struct check_refs_info { - struct cref_hash_entry *h; + const char *sym_name; asection *defsec; struct lang_nocrossrefs *ncrs; asymbol **asymbols; - boolean same; }; /* This function is called for each symbol defined in a section which @@ -400,70 +436,59 @@ struct check_refs_info { prohibited sections. */ static void -check_refs (h, hl, ncrs) - struct cref_hash_entry *h; - struct bfd_link_hash_entry *hl; +check_refs (name, sec, abfd, ncrs) + const char *name; + asection *sec; + bfd *abfd; struct lang_nocrossrefs *ncrs; { - struct cref_ref *ref; + lang_input_statement_type *li; + asymbol **asymbols; + struct check_refs_info info; - for (ref = h->refs; ref != NULL; ref = ref->next) + /* We need to look through the relocations for this BFD, to see + if any of the relocations which refer to this symbol are from + a prohibited section. Note that we need to do this even for + the BFD in which the symbol is defined, since even a single + BFD might contain a prohibited cross reference. */ + + li = (lang_input_statement_type *) abfd->usrdata; + if (li != NULL && li->asymbols != NULL) + asymbols = li->asymbols; + else { - lang_input_statement_type *li; - asymbol **asymbols; - struct check_refs_info info; - - /* We need to look through the relocations for this BFD, to see - if any of the relocations which refer to this symbol are from - a prohibited section. Note that we need to do this even for - the BFD in which the symbol is defined, since even a single - BFD might contain a prohibited cross reference; for this - case, we set the SAME field in INFO, which will cause - CHECK_RELOCS_REFS to check for relocations against the - section as well as against the symbol. */ - - li = (lang_input_statement_type *) ref->abfd->usrdata; - if (li != NULL && li->asymbols != NULL) - asymbols = li->asymbols; - else + long symsize; + long symbol_count; + + symsize = bfd_get_symtab_upper_bound (abfd); + if (symsize < 0) + einfo (_("%B%F: could not read symbols; %E\n"), abfd); + asymbols = (asymbol **) 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) { - long symsize; - long symbol_count; - - symsize = bfd_get_symtab_upper_bound (ref->abfd); - if (symsize < 0) - einfo (_("%B%F: could not read symbols; %E\n"), ref->abfd); - asymbols = (asymbol **) xmalloc (symsize); - symbol_count = bfd_canonicalize_symtab (ref->abfd, asymbols); - if (symbol_count < 0) - einfo (_("%B%F: could not read symbols: %E\n"), ref->abfd); - if (li != NULL) - { - li->asymbols = asymbols; - li->symbol_count = symbol_count; - } + li->asymbols = asymbols; + li->symbol_count = symbol_count; } - - info.h = h; - info.defsec = hl->u.def.section; - info.ncrs = ncrs; - info.asymbols = asymbols; - if (ref->abfd == hl->u.def.section->owner) - info.same = true; - else - info.same = false; - bfd_map_over_sections (ref->abfd, check_reloc_refs, (PTR) &info); - - if (li == NULL) - free (asymbols); } + + info.sym_name = name; + info.defsec = sec; + info.ncrs = ncrs; + info.asymbols = asymbols; + bfd_map_over_sections (abfd, check_reloc_refs, (PTR) &info); + + if (li == NULL) + free (asymbols); } -/* This is called via bfd_map_over_sections. INFO->H is a symbol +/* This is called via bfd_map_over_sections. INFO->SYM_NAME is a symbol defined in INFO->DEFSECNAME. If this section maps into any of the sections listed in INFO->NCRS, other than INFO->DEFSECNAME, then we look through the relocations. If any of the relocations are to - INFO->H, then we report a prohibited cross reference error. */ + INFO->SYM_NAME, then we report a prohibited cross reference error. */ static void check_reloc_refs (abfd, sec, iarg) @@ -502,9 +527,10 @@ check_reloc_refs (abfd, sec, iarg) /* This section is one for which cross references are prohibited. Look through the relocations, and see if any of them are to - INFO->H. */ + INFO->SYM_NAME. If INFO->SYMNAME is NULL, check for relocations + against the section symbol. */ - symname = info->h->root.string; + symname = info->sym_name; relsize = bfd_get_reloc_upper_bound (abfd, sec); if (relsize < 0) @@ -525,9 +551,10 @@ check_reloc_refs (abfd, sec, iarg) if (q->sym_ptr_ptr != NULL && *q->sym_ptr_ptr != NULL - && (strcmp (bfd_asymbol_name (*q->sym_ptr_ptr), symname) == 0 - || (info->same - && bfd_get_section (*q->sym_ptr_ptr) == info->defsec))) + && (symname != NULL + ? strcmp (bfd_asymbol_name (*q->sym_ptr_ptr), symname) == 0 + : (((*q->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0 + && bfd_get_section (*q->sym_ptr_ptr) == info->defsec))) { /* We found a reloc for the symbol. The symbol is defined in OUTSECNAME. This reloc is from a section which is diff --git a/contrib/binutils/ld/ldctor.c b/contrib/binutils/ld/ldctor.c index 1c8439b..9e79921 100644 --- a/contrib/binutils/ld/ldctor.c +++ b/contrib/binutils/ld/ldctor.c @@ -1,5 +1,5 @@ /* ldctor.c -- constructor support routines - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. By Steve Chamberlain <sac@cygnus.com> @@ -23,8 +23,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "bfd.h" #include "sysdep.h" #include "bfdlink.h" - -#include <ctype.h> +#include "safe-ctype.h" #include "ld.h" #include "ldexp.h" @@ -146,7 +145,7 @@ ctor_prio (name) return -1; if (name[1] != 'I' && name[1] != 'D') return -1; - if (! isdigit ((unsigned char) name[3])) + if (! ISDIGIT (name[3])) return -1; return atoi (name + 3); diff --git a/contrib/binutils/ld/ldemul.c b/contrib/binutils/ld/ldemul.c index 44c8c3e..6b96204 100644 --- a/contrib/binutils/ld/ldemul.c +++ b/contrib/binutils/ld/ldemul.c @@ -169,15 +169,20 @@ ldemul_recognized_file (entry) } char * -ldemul_choose_target () +ldemul_choose_target (argc, argv) + int argc; + char **argv; { - return ld_emulation->choose_target (); + return ld_emulation->choose_target (argc, argv); } + /* The default choose_target function. */ char * -ldemul_default_target () +ldemul_default_target (argc, argv) + int argc ATTRIBUTE_UNUSED; + char **argv ATTRIBUTE_UNUSED; { char *from_outside = getenv (TARGET_ENVIRON); if (from_outside != (char *) NULL) diff --git a/contrib/binutils/ld/ldemul.h b/contrib/binutils/ld/ldemul.h index 423a9d9..c49961c 100644 --- a/contrib/binutils/ld/ldemul.h +++ b/contrib/binutils/ld/ldemul.h @@ -25,7 +25,7 @@ extern void ldemul_after_open PARAMS ((void)); extern void ldemul_after_allocation PARAMS ((void)); extern void ldemul_before_allocation PARAMS ((void)); extern void ldemul_set_output_arch PARAMS ((void)); -extern char *ldemul_choose_target PARAMS ((void)); +extern char *ldemul_choose_target PARAMS ((int, char**)); extern void ldemul_choose_mode PARAMS ((char *)); extern void ldemul_list_emulations PARAMS ((FILE *)); extern void ldemul_list_emulation_options PARAMS ((FILE *)); @@ -43,7 +43,7 @@ extern boolean ldemul_recognized_file extern boolean ldemul_open_dynamic_archive PARAMS ((const char *, struct search_dirs *, struct lang_input_statement_struct *)); -extern char *ldemul_default_target PARAMS ((void)); +extern char *ldemul_default_target PARAMS ((int, char**)); extern void after_parse_default PARAMS ((void)); extern void after_open_default PARAMS ((void)); extern void after_allocation_default PARAMS ((void)); @@ -78,7 +78,7 @@ typedef struct ld_emulation_xfer_struct { void (*set_output_arch) PARAMS ((void)); /* Decide which target name to use. */ - char * (*choose_target) PARAMS ((void)); + char * (*choose_target) PARAMS ((int, char**)); /* Run before allocating output sections. */ void (*before_allocation) PARAMS ((void)); diff --git a/contrib/binutils/ld/ldexp.c b/contrib/binutils/ld/ldexp.c index ca622f6..ec449fd8d 100644 --- a/contrib/binutils/ld/ldexp.c +++ b/contrib/binutils/ld/ldexp.c @@ -38,6 +38,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "ldexp.h" #include "ldgram.h" #include "ldlang.h" +#include "libiberty.h" static void exp_print_token PARAMS ((token_code_type code)); static void make_abs PARAMS ((etree_value_type *ptr)); @@ -67,12 +68,14 @@ static void exp_print_token (code) token_code_type code; { - static CONST struct { + static CONST struct + { token_code_type code; - char *name; - } table[] = { + char * name; + } + table[] = + { { INT, "int" }, - { REL, "relocateable" }, { NAME, "NAME" }, { PLUSEQ, "+=" }, { MINUSEQ, "-=" }, @@ -89,40 +92,45 @@ exp_print_token (code) { LE, "<=" }, { GE, ">=" }, { LSHIFT, "<<" }, - { RSHIFT, ">>=" }, + { RSHIFT, ">>" }, { ALIGN_K, "ALIGN" }, { BLOCK, "BLOCK" }, + { QUAD, "QUAD" }, + { SQUAD, "SQUAD" }, + { LONG, "LONG" }, + { SHORT, "SHORT" }, + { BYTE, "BYTE" }, { SECTIONS, "SECTIONS" }, { SIZEOF_HEADERS, "SIZEOF_HEADERS" }, - { NEXT, "NEXT" }, - { SIZEOF, "SIZEOF" }, - { ADDR, "ADDR" }, - { LOADADDR, "LOADADDR" }, { MEMORY, "MEMORY" }, { DEFINED, "DEFINED" }, { TARGET_K, "TARGET" }, { SEARCH_DIR, "SEARCH_DIR" }, { MAP, "MAP" }, - { QUAD, "QUAD" }, - { SQUAD, "SQUAD" }, - { LONG, "LONG" }, - { SHORT, "SHORT" }, - { BYTE, "BYTE" }, { ENTRY, "ENTRY" }, - { 0, (char *) NULL } + { NEXT, "NEXT" }, + { SIZEOF, "SIZEOF" }, + { ADDR, "ADDR" }, + { LOADADDR, "LOADADDR" }, + { MAX_K, "MAX_K" }, + { REL, "relocateable" }, }; unsigned int idx; - for (idx = 0; table[idx].name != (char *) NULL; idx++) + for (idx = ARRAY_SIZE (table); idx--;) { if (table[idx].code == code) { - fprintf (config.map_file, "%s", table[idx].name); + fprintf (config.map_file, " %s ", table[idx].name); return; } } - /* Not in table, just print it alone */ - fprintf (config.map_file, "%c", code); + + /* Not in table, just print it alone. */ + if (code < 127) + fprintf (config.map_file, " %c ", code); + else + fprintf (config.map_file, " <code %d> ", code); } static void @@ -335,6 +343,7 @@ fold_name (tree, current_section, allocation_done, dot) bfd_vma dot; { etree_value_type result; + switch (tree->type.node_code) { case SIZEOF_HEADERS: @@ -597,7 +606,7 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp) case etree_provided: if (tree->assign.dst[0] == '.' && tree->assign.dst[1] == 0) { - /* Assignment to dot can only be done during allocation */ + /* 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 @@ -622,10 +631,8 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp) + 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); - } + einfo (_("%F%S cannot move location counter backwards (from %V to %V)\n"), + dot, nextdot); else *dotp = nextdot; } @@ -740,9 +747,8 @@ exp_trinop (code, cond, lhs, rhs) (lang_output_section_statement_type *) NULL, lang_first_phase_enum); if (r.valid_p) - { - return exp_intop (r.value); - } + return exp_intop (r.value); + new = (etree_type *) stat_alloc (sizeof (new->trinary)); memcpy ((char *) new, (char *) &value, sizeof (new->trinary)); return new; @@ -762,9 +768,8 @@ exp_unop (code, child) r = exp_fold_tree_no_dot (&value, abs_output_section, lang_first_phase_enum); if (r.valid_p) - { - return exp_intop (r.value); - } + return exp_intop (r.value); + new = (etree_type *) stat_alloc (sizeof (new->unary)); memcpy ((char *) new, (char *) &value, sizeof (new->unary)); return new; @@ -785,9 +790,8 @@ exp_nameop (code, name) (lang_output_section_statement_type *) NULL, lang_first_phase_enum); if (r.valid_p) - { - return exp_intop (r.value); - } + return exp_intop (r.value); + new = (etree_type *) stat_alloc (sizeof (new->name)); memcpy ((char *) new, (char *) &value, sizeof (new->name)); return new; @@ -810,9 +814,7 @@ exp_assop (code, dst, src) #if 0 if (exp_fold_tree_no_dot (&value, &result)) - { - return exp_intop (result); - } + return exp_intop (result); #endif new = (etree_type *) stat_alloc (sizeof (new->assign)); memcpy ((char *) new, (char *) &value, sizeof (new->assign)); @@ -857,6 +859,15 @@ void exp_print_tree (tree) etree_type *tree; { + if (config.map_file == NULL) + config.map_file = stderr; + + if (tree == NULL) + { + minfo ("NULL TREE\n"); + return; + } + switch (tree->type.node_class) { case etree_value: @@ -870,14 +881,10 @@ exp_print_tree (tree) case etree_assign: #if 0 if (tree->assign.dst->sdefs != (asymbol *) NULL) - { - fprintf (config.map_file, "%s (%x) ", tree->assign.dst->name, - tree->assign.dst->sdefs->value); - } + 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); - } + 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); @@ -981,12 +988,9 @@ exp_get_abs_int (tree, def, name, allocation_done) res = exp_fold_tree_no_dot (tree, abs_output_section, allocation_done); if (res.valid_p) - { - res.value += res.section->bfd_section->vma; - } + res.value += res.section->bfd_section->vma; else - { - einfo (_("%F%S non constant expression for %s\n"), name); - } + einfo (_("%F%S non constant expression for %s\n"), name); + return res.value; } diff --git a/contrib/binutils/ld/ldfile.c b/contrib/binutils/ld/ldfile.c index 0e4d0ec..655ee60 100644 --- a/contrib/binutils/ld/ldfile.c +++ b/contrib/binutils/ld/ldfile.c @@ -24,6 +24,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "bfd.h" #include "sysdep.h" #include "bfdlink.h" +#include "safe-ctype.h" #include "ld.h" #include "ldmisc.h" #include "ldexp.h" @@ -35,8 +36,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "ldemul.h" #include "libiberty.h" -#include <ctype.h> - const char *ldfile_input_filename; boolean ldfile_assumed_script = false; const char *ldfile_output_machine_name = ""; @@ -80,6 +79,9 @@ ldfile_add_library_path (name, cmdline) { search_dirs_type *new; + if (!cmdline && config.only_cmd_line_lib_dirs) + return; + new = (search_dirs_type *) xmalloc (sizeof (search_dirs_type)); new->next = NULL; new->name = name; @@ -190,7 +192,7 @@ ldfile_open_file_search (arch, entry, lib, suffix) else if (entry->filename[0] == '/' || entry->filename[0] == '.' #if defined (__MSDOS__) || defined (_WIN32) || entry->filename[0] == '\\' - || (isalpha (entry->filename[0]) + || (ISALPHA (entry->filename[0]) && entry->filename[1] == ':') #endif ) @@ -350,7 +352,8 @@ ldfile_open_command_file (name) ldfile_input_filename = name; lineno = 1; - had_script = true; + + saved_script_handle = ldlex_input_stack; } #ifdef GNU960 @@ -425,8 +428,7 @@ ldfile_add_arch (in_name) new->next = (search_arch_type *) NULL; while (*name) { - if (isupper ((unsigned char) *name)) - *name = tolower ((unsigned char) *name); + *name = TOLOWER (*name); name++; } *search_arch_tail_ptr = new; diff --git a/contrib/binutils/ld/ldgram.y b/contrib/binutils/ld/ldgram.y index e7f4a59..f1924a0 100644 --- a/contrib/binutils/ld/ldgram.y +++ b/contrib/binutils/ld/ldgram.y @@ -49,9 +49,8 @@ static enum section_type sectype; lang_memory_region_type *region; -struct wildcard_spec current_file; boolean ldgram_want_filename = true; -boolean had_script = false; +FILE * saved_script_handle = NULL; boolean force_make_executable = false; boolean ldgram_in_script = false; @@ -70,6 +69,7 @@ static int error_index; char *name; const char *cname; struct wildcard_spec wildcard; + struct wildcard_list *wildcard_list; struct name_list *name_list; int token; union etree_union *etree; @@ -91,6 +91,7 @@ static int error_index; %type <etree> opt_exp_without_type %type <integer> fill_opt %type <name_list> exclude_name_list +%type <wildcard_list> file_NAME_list %type <name> memspec_opt casesymlist %type <name> memspec_at_opt %type <cname> wildcard_name @@ -124,6 +125,7 @@ static int error_index; %token SECTIONS PHDRS SORT %token '{' '}' %token SIZEOF_HEADERS OUTPUT_FORMAT FORCE_COMMON_ALLOCATION OUTPUT_ARCH +%token INHIBIT_COMMON_ALLOCATION %token SIZEOF_HEADERS %token INCLUDE %token MEMORY DEFSYMEND @@ -236,7 +238,9 @@ mri_script_command: | CASE casesymlist | EXTERN extern_name_list | INCLUDE filename - { ldfile_open_command_file ($2); } mri_script_lines END + { ldlex_script (); ldfile_open_command_file($2); } + mri_script_lines END + { ldlex_popstate (); } | START NAME { lang_add_entry ($2, false); } | @@ -320,6 +324,8 @@ ifile_p1: { ldfile_set_output_arch($3); } | FORCE_COMMON_ALLOCATION { command_line.force_common_definition = true ; } + | INHIBIT_COMMON_ALLOCATION + { command_line.inhibit_common_definition = true ; } | INPUT '(' input_list ')' | GROUP { lang_enter_group (); } @@ -328,7 +334,9 @@ ifile_p1: | MAP '(' filename ')' { lang_add_map($3); } | INCLUDE filename - { ldfile_open_command_file($2); } ifile_list END + { ldlex_script (); ldfile_open_command_file($2); } + ifile_list END + { ldlex_popstate (); } | NOCROSSREFS '(' nocrossref_list ')' { lang_add_nocrossref ($3); @@ -417,8 +425,6 @@ wildcard_spec: } ; - - exclude_name_list: exclude_name_list wildcard_name { @@ -440,42 +446,42 @@ exclude_name_list: ; file_NAME_list: - wildcard_spec + file_NAME_list opt_comma wildcard_spec { - lang_add_wild ($1.name, $1.sorted, - current_file.name, - current_file.sorted, - ldgram_had_keep, $1.exclude_name_list); + struct wildcard_list *tmp; + tmp = (struct wildcard_list *) xmalloc (sizeof *tmp); + tmp->next = $1; + tmp->spec = $3; + $$ = tmp; } - | file_NAME_list opt_comma wildcard_spec + | + wildcard_spec { - lang_add_wild ($3.name, $3.sorted, - current_file.name, - current_file.sorted, - ldgram_had_keep, $3.exclude_name_list); + struct wildcard_list *tmp; + tmp = (struct wildcard_list *) xmalloc (sizeof *tmp); + tmp->next = NULL; + tmp->spec = $1; + $$ = tmp; } ; input_section_spec_no_keep: NAME { - lang_add_wild (NULL, false, $1, false, - ldgram_had_keep, NULL); + struct wildcard_spec tmp; + tmp.name = $1; + tmp.exclude_name_list = NULL; + tmp.sorted = false; + lang_add_wild (&tmp, NULL, ldgram_had_keep); } - | '[' + | '[' file_NAME_list ']' { - current_file.name = NULL; - current_file.sorted = false; + lang_add_wild (NULL, $2, ldgram_had_keep); } - file_NAME_list ']' - | wildcard_spec + | wildcard_spec '(' file_NAME_list ')' { - current_file = $1; - /* '*' matches any file name. */ - if (strcmp (current_file.name, "*") == 0) - current_file.name = NULL; + lang_add_wild (&$1, $3, ldgram_had_keep); } - '(' file_NAME_list ')' ; input_section_spec: @@ -1055,7 +1061,11 @@ vers_nodes: ; vers_node: - VERS_TAG '{' vers_tag '}' ';' + '{' vers_tag '}' ';' + { + lang_register_vers_node (NULL, $2, NULL); + } + | VERS_TAG '{' vers_tag '}' ';' { lang_register_vers_node ($1, $3, NULL); } diff --git a/contrib/binutils/ld/ldint.texinfo b/contrib/binutils/ld/ldint.texinfo index 37efae3..489750a 100644 --- a/contrib/binutils/ld/ldint.texinfo +++ b/contrib/binutils/ld/ldint.texinfo @@ -84,6 +84,7 @@ section entitled "GNU Free Documentation License". * README:: The README File * Emulations:: How linker emulations are generated * Emulation Walkthrough:: A Walkthrough of a Typical Emulation +* Architecture Specific:: Some Architecture Specific Notes * GNU Free Documentation License:: GNU Free Documentation License @end menu @@ -238,7 +239,7 @@ If @code{SCRIPT_NAME} is set to @var{script}, @code{genscripts.sh} will invoke @file{scripttempl/@var{script}.sc}. The @file{genscripts.sh} script will invoke the @file{scripttempl} -script 5 or 6 times. Each time it will set the shell variable +script 5 to 8 times. Each time it will set the shell variable @code{LD_FLAG} to a different value. When the linker is run, the options used will direct it to select a particular script. (Script selection is controlled by the @code{get_script} emulation entry point; @@ -277,6 +278,22 @@ this value if @code{GENERATE_SHLIB_SCRIPT} is defined in the this script at the appropriate time, normally when the linker is invoked with the @code{-shared} option. The output has an extension of @file{.xs}. +@item c +The @file{scripttempl} script is only invoked with @code{LD_FLAG} set to +this value if @code{GENERATE_COMBRELOC_SCRIPT} is defined in the +@file{emulparams} file or if @code{SCRIPT_NAME} is @code{elf}. The +@file{emultempl} script must arrange to use this script at the appropriate +time, normally when the linker is invoked with the @code{-z combreloc} +option. The output has an extension of +@file{.xc}. +@item cshared +The @file{scripttempl} script is only invoked with @code{LD_FLAG} set to +this value if @code{GENERATE_COMBRELOC_SCRIPT} is defined in the +@file{emulparams} file or if @code{SCRIPT_NAME} is @code{elf} and +@code{GENERATE_SHLIB_SCRIPT} is defined in the @file{emulparms} file. +The @file{emultempl} script must arrange to use this script at the +appropriate time, normally when the linker is invoked with the @code{-shared +-z combreloc} option. The output has an extension of @file{.xsc}. @end table Besides the shell variables set by the @file{emulparams} script, and the @@ -300,6 +317,10 @@ page aligned, or to @samp{.} when generating the @code{-N} script. @item CREATE_SHLIB This will be set to a non-empty string when generating a @code{-shared} script. + +@item COMBRELOC +This will be set to a non-empty string when generating @code{-z combreloc} +scripts to a temporary file name which can be used during script generation. @end table The conventional way to write a @file{scripttempl} script is to first @@ -571,6 +592,105 @@ In summary, @end itemize +@node Architecture Specific +@chapter Some Architecture Specific Notes + +This is the place for notes on the behavior of @code{ld} on +specific platforms. Currently, only Intel x86 is documented (and +of that, only the auto-import behavior for DLLs). + +@menu +* ix86:: Intel x86 +@end menu + +@node ix86 +@section Intel x86 + +@table @emph +@code{ld} can create DLLs that operate with various runtimes available +on a common x86 operating system. These runtimes include native (using +the mingw "platform"), cygwin, and pw. + +@item auto-import from DLLs +@enumerate +@item +With this feature on, DLL clients can import variables from DLL +without any concern from their side (for example, without any source +code modifications). Auto-import can be enabled using the +@code{--enable-auto-import} flag, or disabled via the +@code{--disable-auto-import} flag. Auto-import is disabled by default. + +@item +This is done completely in bounds of the PE specification (to be fair, +there's a minor violation of the spec at one point, but in practice +auto-import works on all known variants of that common x86 operating +system) So, the resulting DLL can be used with any other PE +compiler/linker. + +@item +Auto-import is fully compatible with standard import method, in which +variables are decorated using attribute modifiers. Libraries of either +type may be mixed together. + +@item +Overhead (space): 8 bytes per imported symbol, plus 20 for each +reference to it; Overhead (load time): negligible; Overhead +(virtual/physical memory): should be less than effect of DLL +relocation. +@end enumerate + +Motivation + +The obvious and only way to get rid of dllimport insanity is +to make client access variable directly in the DLL, bypassing +the extra dereference imposed by ordinary DLL runtime linking. +I.e., whenever client contains someting like + +@code{mov dll_var,%eax,} + +address of dll_var in the command should be relocated to point +into loaded DLL. The aim is to make OS loader do so, and than +make ld help with that. Import section of PE made following +way: there's a vector of structures each describing imports +from particular DLL. Each such structure points to two other +parellel vectors: one holding imported names, and one which +will hold address of corresponding imported name. So, the +solution is de-vectorize these structures, making import +locations be sparse and pointing directly into code. + +Implementation + +For each reference of data symbol to be imported from DLL (to +set of which belong symbols with name <sym>, if __imp_<sym> is +found in implib), the import fixup entry is generated. That +entry is of type IMAGE_IMPORT_DESCRIPTOR and stored in .idata$3 +subsection. Each fixup entry contains pointer to symbol's address +within .text section (marked with __fuN_<sym> symbol, where N is +integer), pointer to DLL name (so, DLL name is referenced by +multiple entries), and pointer to symbol name thunk. Symbol name +thunk is singleton vector (__nm_th_<symbol>) pointing to +IMAGE_IMPORT_BY_NAME structure (__nm_<symbol>) directly containing +imported name. Here comes that "om the edge" problem mentioned above: +PE specification rambles that name vector (OriginalFirstThunk) should +run in parallel with addresses vector (FirstThunk), i.e. that they +should have same number of elements and terminated with zero. We violate +this, since FirstThunk points directly into machine code. But in +practice, OS loader implemented the sane way: it goes thru +OriginalFirstThunk and puts addresses to FirstThunk, not something +else. It once again should be noted that dll and symbol name +structures are reused across fixup entries and should be there +anyway to support standard import stuff, so sustained overhead is +20 bytes per reference. Other question is whether having several +IMAGE_IMPORT_DESCRIPTORS for the same DLL is possible. Answer is yes, +it is done even by native compiler/linker (libth32's functions are in +fact resident in windows9x kernel32.dll, so if you use it, you have +two IMAGE_IMPORT_DESCRIPTORS for kernel32.dll). Yet other question is +whether referencing the same PE structures several times is valid. +The answer is why not, prohibiting that (detecting violation) would +require more work on behalf of loader than not doing it. + +@end table + @node GNU Free Documentation License @chapter GNU Free Documentation License diff --git a/contrib/binutils/ld/ldlang.c b/contrib/binutils/ld/ldlang.c index 924e3ec..a7b53dd 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 + 2001, 2002 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -23,6 +23,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "bfd.h" #include "sysdep.h" #include "libiberty.h" +#include "safe-ctype.h" #include "obstack.h" #include "bfdlink.h" @@ -39,8 +40,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "fnmatch.h" #include "demangle.h" -#include <ctype.h> - /* FORWARDS */ static lang_statement_union_type *new_statement PARAMS ((enum statement_enum, size_t, lang_statement_list_type *)); @@ -78,16 +77,16 @@ static void already_linked_table_init PARAMS ((void)); static void already_linked_table_free PARAMS ((void)); static boolean wildcardp PARAMS ((const char *)); static lang_statement_union_type *wild_sort - PARAMS ((lang_wild_statement_type *, lang_input_statement_type *, - asection *)); + PARAMS ((lang_wild_statement_type *, struct wildcard_list *, + lang_input_statement_type *, asection *)); static void output_section_callback - PARAMS ((lang_wild_statement_type *, asection *, + PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *, lang_input_statement_type *, PTR)); static lang_input_statement_type *lookup_name PARAMS ((const char *)); -static void load_symbols +static boolean load_symbols PARAMS ((lang_input_statement_type *, lang_statement_list_type *)); static void wild - PARAMS ((lang_wild_statement_type *, const char *, const char *, + PARAMS ((lang_wild_statement_type *, const char *, lang_output_section_statement_type *)); static bfd *open_output PARAMS ((const char *)); static void ldlang_open_output PARAMS ((lang_statement_union_type *)); @@ -119,12 +118,12 @@ static void print_statement static void print_statement_list PARAMS ((lang_statement_union_type *, lang_output_section_statement_type *)); static void print_statements PARAMS ((void)); -static bfd_vma insert_pad +static void insert_pad PARAMS ((lang_statement_union_type **, fill_type, unsigned int, asection *, bfd_vma)); static bfd_vma size_input_section PARAMS ((lang_statement_union_type **, lang_output_section_statement_type *, - fill_type, bfd_vma, boolean)); + fill_type, bfd_vma)); static void lang_finish PARAMS ((void)); static void ignore_bfd_errors PARAMS ((const char *, ...)); static void lang_check PARAMS ((void)); @@ -135,11 +134,10 @@ static int topower PARAMS ((int)); static void lang_set_startof PARAMS ((void)); static void reset_memory_regions PARAMS ((void)); static void gc_section_callback - PARAMS ((lang_wild_statement_type *, asection *, + PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *, lang_input_statement_type *, PTR)); static void lang_record_phdrs PARAMS ((void)); -static void lang_gc_wild - PARAMS ((lang_wild_statement_type *, const char *, const char *)); +static void lang_gc_wild PARAMS ((lang_wild_statement_type *)); static void lang_gc_sections_1 PARAMS ((lang_statement_union_type *)); static void lang_gc_sections PARAMS ((void)); static int lang_vers_match_lang_c @@ -155,17 +153,18 @@ static void os_region_check struct memory_region_struct *, etree_type *, bfd_vma)); typedef void (*callback_t) PARAMS ((lang_wild_statement_type *, - asection *, lang_input_statement_type *, + struct wildcard_list *, + asection *, + lang_input_statement_type *, PTR)); static void walk_wild - PARAMS ((lang_wild_statement_type *, const char *, const char *, - callback_t, PTR)); + PARAMS ((lang_wild_statement_type *, callback_t, PTR)); static void walk_wild_section - PARAMS ((lang_wild_statement_type *, const char *, - lang_input_statement_type *, callback_t, PTR)); + PARAMS ((lang_wild_statement_type *, lang_input_statement_type *, + callback_t, PTR)); static void walk_wild_file - PARAMS ((lang_wild_statement_type *, const char *, - lang_input_statement_type *, callback_t, PTR)); + PARAMS ((lang_wild_statement_type *, lang_input_statement_type *, + callback_t, PTR)); static int get_target PARAMS ((const bfd_target *, PTR)); static void stricpy PARAMS ((char *, char *)); @@ -236,57 +235,74 @@ unique_section_p (secnam) /* Generic traversal routines for finding matching sections. */ static void -walk_wild_section (ptr, section, file, callback, data) +walk_wild_section (ptr, file, callback, data) lang_wild_statement_type *ptr; - const char *section; lang_input_statement_type *file; callback_t callback; PTR data; { - /* Don't process sections from files which were excluded. */ - if (ptr->exclude_filename_list != NULL) - { - struct name_list *list_tmp; - for (list_tmp = ptr->exclude_filename_list; - list_tmp; - list_tmp = list_tmp->next) - { - boolean match; - - if (wildcardp (list_tmp->name)) - match = fnmatch (list_tmp->name, file->filename, 0) == 0; - else - match = strcmp (list_tmp->name, file->filename) == 0; + asection *s; - if (match) - return; - } - } + if (file->just_syms_flag) + return; - if (file->just_syms_flag == false) + for (s = file->the_bfd->sections; s != NULL; s = s->next) { - register asection *s; - boolean wildcard = false; + struct wildcard_list *sec; - if (section != NULL) - wildcard = wildcardp (section); + sec = ptr->section_list; + if (sec == NULL) + (*callback) (ptr, sec, s, file, data); - for (s = file->the_bfd->sections; s != NULL; s = s->next) + while (sec != NULL) { - boolean match; - const char *sname = bfd_get_section_name (file->the_bfd, s); + 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 (section == NULL) - match = true; - else if (wildcard) - match = fnmatch (section, sname, 0) == 0; - else - match = strcmp (section, sname) == 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) + { + const char *sname = bfd_get_section_name (file->the_bfd, s); - /* If this is a wild-card output section statement, exclude - sections that match UNIQUE_SECTION_LIST. */ - if (match && (data == NULL || !unique_section_p (sname))) - (*callback) (ptr, s, file, data); + if (wildcardp (sec->spec.name)) + skip = fnmatch (sec->spec.name, sname, 0) != 0; + else + skip = strcmp (sec->spec.name, sname) != 0; + } + + if (!skip) + (*callback) (ptr, sec, s, file, data); + + sec = sec->next; } } } @@ -294,16 +310,15 @@ walk_wild_section (ptr, section, file, callback, data) /* Handle a wild statement for a single file F. */ static void -walk_wild_file (s, section, f, callback, data) +walk_wild_file (s, f, callback, data) lang_wild_statement_type *s; - const char *section; lang_input_statement_type *f; callback_t callback; PTR data; { if (f->the_bfd == NULL || ! bfd_check_format (f->the_bfd, bfd_archive)) - walk_wild_section (s, section, f, callback, data); + walk_wild_section (s, f, callback, data); else { bfd *member; @@ -320,7 +335,7 @@ walk_wild_file (s, section, f, callback, data) lang_input_statement. */ if (member->usrdata != NULL) { - walk_wild_section (s, section, + walk_wild_section (s, (lang_input_statement_type *) member->usrdata, callback, data); } @@ -331,27 +346,27 @@ walk_wild_file (s, section, f, callback, data) } static void -walk_wild (s, section, file, callback, data) +walk_wild (s, callback, data) lang_wild_statement_type *s; - const char *section; - const char *file; callback_t callback; PTR data; { - if (file == (char *) NULL) + const char *file_spec = s->filename; + + if (file_spec == NULL) { /* Perform the iteration over all files in the list. */ LANG_FOR_EACH_INPUT_STATEMENT (f) { - walk_wild_file (s, section, f, callback, data); + walk_wild_file (s, f, callback, data); } } - else if (wildcardp (file)) + else if (wildcardp (file_spec)) { LANG_FOR_EACH_INPUT_STATEMENT (f) { - if (fnmatch (file, f->filename, FNM_FILE_NAME) == 0) - walk_wild_file (s, section, f, callback, data); + if (fnmatch (file_spec, f->filename, FNM_FILE_NAME) == 0) + walk_wild_file (s, f, callback, data); } } else @@ -359,8 +374,9 @@ walk_wild (s, section, file, callback, data) lang_input_statement_type *f; /* Perform the iteration over a single file. */ - f = lookup_name (file); - walk_wild_file (s, section, f, callback, data); + f = lookup_name (file_spec); + if (f) + walk_wild_file (s, f, callback, data); } } @@ -372,7 +388,7 @@ lang_for_each_statement_worker (func, s) void (*func) PARAMS ((lang_statement_union_type *)); lang_statement_union_type *s; { - for (; s != (lang_statement_union_type *) NULL; s = s->next) + for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { func (s); @@ -813,7 +829,7 @@ init_os (s) return; if (strcmp (s->name, DISCARD_SECTION_NAME) == 0) - einfo (_("%P%F: Illegal use of `%s' section"), DISCARD_SECTION_NAME); + einfo (_("%P%F: Illegal use of `%s' section\n"), DISCARD_SECTION_NAME); new = ((section_userdata_type *) stat_alloc (sizeof (section_userdata_type))); @@ -1007,13 +1023,10 @@ section_already_linked (abfd, sec, data) break; } - /* Set the output_section field so that wild_doit 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. */ + /* Set the output_section field so that lang_add_section + does not create a lang_input_section structure for this + section. */ sec->output_section = bfd_abs_section_ptr; - sec->kept_section = l->sec; return; } @@ -1071,7 +1084,7 @@ already_linked_table_free () /* 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 the pattern to be treated as a wildcard. + be enough to cause the pattern to be treated as a wildcard. That lets us handle DOS filenames more naturally. */ static boolean @@ -1093,7 +1106,7 @@ wildcardp (pattern) input file which holds SECTION. */ void -wild_doit (ptr, section, output, file) +lang_add_section (ptr, section, output, file) lang_statement_list_type *ptr; asection *section; lang_output_section_statement_type *output; @@ -1178,8 +1191,22 @@ wild_doit (ptr, section, output, file) if (! first && (section->output_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)) + != (flags & (SEC_MERGE | SEC_STRINGS)) + || ((flags & SEC_MERGE) + && section->output_section->entsize != section->entsize))) + { + section->output_section->flags &= ~ (SEC_MERGE | SEC_STRINGS); + flags &= ~ (SEC_MERGE | SEC_STRINGS); + } + section->output_section->flags |= flags; + if (flags & SEC_MERGE) + section->output_section->entsize = section->entsize; + /* If SEC_READONLY is not set in the input section, then clear it from the output section. */ if ((section->flags & SEC_READONLY) == 0) @@ -1227,19 +1254,20 @@ wild_doit (ptr, section, output, file) new section should just go at the end of the current list. */ static lang_statement_union_type * -wild_sort (wild, file, section) +wild_sort (wild, sec, file, section) lang_wild_statement_type *wild; + struct wildcard_list *sec; lang_input_statement_type *file; asection *section; { const char *section_name; lang_statement_union_type *l; - if (! wild->filenames_sorted && ! wild->sections_sorted) + if (!wild->filenames_sorted && (sec == NULL || !sec->spec.sorted)) return NULL; section_name = bfd_get_section_name (file->the_bfd, section); - for (l = wild->children.head; l != NULL; l = l->next) + for (l = wild->children.head; l != NULL; l = l->header.next) { lang_input_section_type *ls; @@ -1309,7 +1337,7 @@ wild_sort (wild, file, section) /* Here either the files are not sorted by name, or we are looking at the sections for this file. */ - if (wild->sections_sorted) + if (sec != NULL && sec->spec.sorted) { if (strcmp (section_name, bfd_get_section_name (ls->ifile->the_bfd, @@ -1326,20 +1354,25 @@ wild_sort (wild, file, section) NULL, in which case it is a wild card. */ static void -output_section_callback (ptr, section, file, output) +output_section_callback (ptr, sec, section, file, output) lang_wild_statement_type *ptr; + struct wildcard_list *sec; asection *section; lang_input_statement_type *file; PTR output; { lang_statement_union_type *before; + /* Exclude sections that match UNIQUE_SECTION_LIST. */ + if (unique_section_p (bfd_get_section_name (file->the_bfd, 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, file, section); + before = wild_sort (ptr, sec, file, section); /* Here BEFORE points to the lang_input_section which should follow the one we are about to add. If BEFORE @@ -1347,31 +1380,31 @@ output_section_callback (ptr, section, file, output) of the current list. */ if (before == NULL) - wild_doit (&ptr->children, section, - (lang_output_section_statement_type *) output, - file); + lang_add_section (&ptr->children, section, + (lang_output_section_statement_type *) output, + file); else { lang_statement_list_type list; lang_statement_union_type **pp; lang_list_init (&list); - wild_doit (&list, section, - (lang_output_section_statement_type *) output, - file); + lang_add_section (&list, section, + (lang_output_section_statement_type *) output, + file); /* If we are discarding the section, LIST.HEAD will be NULL. */ if (list.head != NULL) { - ASSERT (list.head->next == NULL); + ASSERT (list.head->header.next == NULL); for (pp = &ptr->children.head; *pp != before; - pp = &(*pp)->next) + pp = &(*pp)->header.next) ASSERT (*pp != NULL); - list.head->next = *pp; + list.head->header.next = *pp; *pp = list.head; } } @@ -1411,14 +1444,15 @@ lookup_name (name) || search->filename == (const char *) NULL) return search; - load_symbols (search, (lang_statement_list_type *) NULL); + if (! load_symbols (search, (lang_statement_list_type *) NULL)) + return NULL; return search; } /* Get the symbols for an input file. */ -static void +static boolean load_symbols (entry, place) lang_input_statement_type *entry; lang_statement_list_type *place; @@ -1426,7 +1460,7 @@ load_symbols (entry, place) char **matching; if (entry->loaded) - return; + return true; ldfile_open_file (entry); @@ -1435,12 +1469,13 @@ load_symbols (entry, place) { bfd_error_type err; lang_statement_list_type *hold; - + boolean bad_load = true; + err = bfd_get_error (); /* See if the emulation has some special knowledge. */ if (ldemul_unrecognized_file (entry)) - return; + return true; if (err == bfd_error_file_ambiguously_recognized) { @@ -1454,8 +1489,10 @@ load_symbols (entry, place) } else if (err != bfd_error_file_not_recognized || place == NULL) - einfo (_("%F%B: file not recognized: %E\n"), entry->the_bfd); - + einfo (_("%F%B: file not recognized: %E\n"), entry->the_bfd); + else + bad_load = false; + bfd_close (entry->the_bfd); entry->the_bfd = NULL; @@ -1472,11 +1509,11 @@ load_symbols (entry, place) stat_ptr = hold; - return; + return ! bad_load; } if (ldemul_recognized_file (entry)) - return; + return true; /* We don't call ldlang_add_file for an archive. Instead, the add_symbols entry point will call ldlang_add_file, via the @@ -1496,56 +1533,74 @@ load_symbols (entry, place) case bfd_archive: if (entry->whole_archive) { - bfd *member = bfd_openr_next_archived_file (entry->the_bfd, - (bfd *) NULL); - while (member != NULL) + bfd * member = NULL; + boolean loaded = true; + + for (;;) { + member = bfd_openr_next_archived_file (entry->the_bfd, member); + + if (member == NULL) + break; + if (! bfd_check_format (member, bfd_object)) - einfo (_("%F%B: object %B in archive is not object\n"), - entry->the_bfd, member); + { + einfo (_("%F%B: member %B in archive is not an object\n"), + entry->the_bfd, member); + loaded = false; + } + if (! ((*link_info.callbacks->add_archive_element) (&link_info, member, "--whole-archive"))) abort (); + if (! bfd_link_add_symbols (member, &link_info)) - einfo (_("%F%B: could not read symbols: %E\n"), member); - member = bfd_openr_next_archived_file (entry->the_bfd, - member); + { + einfo (_("%F%B: could not read symbols: %E\n"), member); + loaded = false; + } } - entry->loaded = true; - - return; + entry->loaded = loaded; + return loaded; } + break; } - if (! bfd_link_add_symbols (entry->the_bfd, &link_info)) + if (bfd_link_add_symbols (entry->the_bfd, &link_info)) + entry->loaded = true; + else einfo (_("%F%B: could not read symbols: %E\n"), entry->the_bfd); - entry->loaded = true; + return entry->loaded; } -/* Handle a wild statement. SECTION or FILE or both may be NULL, - indicating that it is a wildcard. Separate lang_input_section - statements are created for each part of the expansion; they are - added after the wild statement S. OUTPUT is the output section. */ +/* Handle a wild statement. S->FILENAME or S->SECTION_LIST or both + may be NULL, indicating that it is a wildcard. Separate + lang_input_section statements are created for each part of the + expansion; they are added after the wild statement S. OUTPUT is + the output section. */ static void -wild (s, section, file, target, output) +wild (s, target, output) lang_wild_statement_type *s; - const char *section; - const char *file; const char *target ATTRIBUTE_UNUSED; lang_output_section_statement_type *output; { - walk_wild (s, section, file, output_section_callback, (PTR) output); + struct wildcard_list *sec; - if (section != (char *) NULL - && strcmp (section, "COMMON") == 0 - && default_common_section == NULL) + walk_wild (s, output_section_callback, (PTR) output); + + for (sec = s->section_list; sec != NULL; sec = sec->next) { - /* Remember the section that common is going to in case we later - get something which doesn't know where to put it. */ - default_common_section = output; + if (default_common_section != NULL) + break; + if (sec->spec.name != NULL && strcmp (sec->spec.name, "COMMON") == 0) + { + /* Remember the section that common is going to in case we + later get something which doesn't know where to put it. */ + default_common_section = output; + } } } @@ -1571,12 +1626,7 @@ stricpy (dest, src) char c; while ((c = *src++) != 0) - { - if (isupper ((unsigned char) c)) - c = tolower (c); - - *dest++ = c; - } + *dest++ = TOLOWER (c); *dest = 0; } @@ -1859,7 +1909,7 @@ open_input_bfds (s, force) lang_statement_union_type *s; boolean force; { - for (; s != (lang_statement_union_type *) NULL; s = s->next) + for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { switch (s->header.type) { @@ -1915,12 +1965,13 @@ open_input_bfds (s, force) lang_list_init (&add); - load_symbols (&s->input_statement, &add); + if (! load_symbols (&s->input_statement, &add)) + config.make_executable = false; if (add.head != NULL) { - *add.tail = s->next; - s->next = add.head; + *add.tail = s->header.next; + s->header.next = add.head; } } break; @@ -2014,16 +2065,12 @@ map_input_to_output_sections (s, target, output_section_statement) const char *target; lang_output_section_statement_type *output_section_statement; { - for (; s != (lang_statement_union_type *) NULL; s = s->next) + for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { switch (s->header.type) { - case lang_wild_statement_enum: - wild (&s->wild_statement, s->wild_statement.section_name, - s->wild_statement.filename, target, - output_section_statement); - + wild (&s->wild_statement, target, output_section_statement); break; case lang_constructors_statement_enum: map_input_to_output_sections (constructor_list.head, @@ -2407,18 +2454,12 @@ print_wild_statement (w, os) lang_wild_statement_type *w; lang_output_section_statement_type *os; { + struct wildcard_list *sec; + print_space (); if (w->filenames_sorted) minfo ("SORT("); - if (w->exclude_filename_list != NULL) - { - name_list *tmp; - minfo ("EXCLUDE_FILE ( %s", w->exclude_filename_list->name); - for (tmp = w->exclude_filename_list->next; tmp; tmp = tmp->next) - minfo (", %s", tmp->name); - minfo (")"); - } if (w->filename != NULL) minfo ("%s", w->filename); else @@ -2427,14 +2468,25 @@ print_wild_statement (w, os) minfo (")"); minfo ("("); - if (w->sections_sorted) - minfo ("SORT("); - if (w->section_name != NULL) - minfo ("%s", w->section_name); - else - minfo ("*"); - if (w->sections_sorted) - minfo (")"); + for (sec = w->section_list; sec; sec = sec->next) + { + if (sec->spec.sorted) + minfo ("SORT("); + if (sec->spec.exclude_name_list != NULL) + { + name_list *tmp; + minfo ("EXCLUDE_FILE ( %s", sec->spec.exclude_name_list->name); + for (tmp = sec->spec.exclude_name_list->next; tmp; tmp = tmp->next) + minfo (", %s", tmp->name); + minfo (")"); + } + if (sec->spec.name != NULL) + minfo ("%s", sec->spec.name); + else + minfo ("*"); + if (sec->spec.sorted) + minfo (")"); + } minfo (")"); print_nl (); @@ -2465,7 +2517,7 @@ print_statement_list (s, os) while (s != NULL) { print_statement (s, os); - s = s->next; + s = s->header.next; } } @@ -2571,94 +2623,97 @@ dprint_statement (s, n) while (s && --n >= 0) { print_statement (s, abs_output_section); - s = s->next; + s = s->header.next; } } config.map_file = map_save; } -static bfd_vma -insert_pad (this_ptr, fill, power, output_section_statement, dot) - lang_statement_union_type **this_ptr; +static void +insert_pad (ptr, fill, alignment_needed, output_section, dot) + lang_statement_union_type **ptr; fill_type fill; - unsigned int power; - asection *output_section_statement; + unsigned int alignment_needed; + asection *output_section; bfd_vma dot; { - /* Align this section first to the - input sections requirement, then - to the output section's requirement. - If this alignment is > than any seen before, - then record it too. Perform the alignment by - inserting a magic 'padding' statement. */ - - unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, - ldfile_output_machine); - unsigned int alignment_needed = align_power (dot, power) - dot; + lang_statement_union_type *pad; - if (alignment_needed != 0) + pad = ((lang_statement_union_type *) + ((char *) ptr - offsetof (lang_statement_union_type, header.next))); + if (ptr != &statement_list.head + && pad->header.type == lang_padding_statement_enum + && pad->padding_statement.output_section == output_section) { - lang_statement_union_type *new = - ((lang_statement_union_type *) - stat_alloc (sizeof (lang_padding_statement_type))); - - /* Link into existing chain. */ - new->header.next = *this_ptr; - *this_ptr = new; - new->header.type = lang_padding_statement_enum; - new->padding_statement.output_section = output_section_statement; - new->padding_statement.output_offset = - dot - output_section_statement->vma; - new->padding_statement.fill = fill; - new->padding_statement.size = alignment_needed * opb; + /* Use the existing pad statement. The above test on output + section is probably redundant, but it doesn't hurt to check. */ } - - /* Remember the most restrictive alignment. */ - if (power > output_section_statement->alignment_power) + else { - output_section_statement->alignment_power = power; + /* Make a new padding statement, linked into existing chain. */ + pad = ((lang_statement_union_type *) + stat_alloc (sizeof (lang_padding_statement_type))); + pad->header.next = *ptr; + *ptr = pad; + pad->header.type = lang_padding_statement_enum; + pad->padding_statement.output_section = output_section; + pad->padding_statement.fill = fill; } - output_section_statement->_raw_size += alignment_needed * opb; - - return dot + alignment_needed; + pad->padding_statement.output_offset = dot - output_section->vma; + pad->padding_statement.size = alignment_needed; + output_section->_raw_size += alignment_needed; } /* Work out how much this section will move the dot point. */ static bfd_vma -size_input_section (this_ptr, output_section_statement, fill, dot, relax) +size_input_section (this_ptr, output_section_statement, fill, dot) lang_statement_union_type **this_ptr; lang_output_section_statement_type *output_section_statement; fill_type fill; bfd_vma dot; - boolean relax ATTRIBUTE_UNUSED; { lang_input_section_type *is = &((*this_ptr)->input_section); asection *i = is->section; - unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, - ldfile_output_machine); if (is->ifile->just_syms_flag == false) { + unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, + ldfile_output_machine); + unsigned int alignment_needed; + asection *o; + + /* Align this section first to the input sections requirement, + then to the output section's requirement. If this alignment + is greater than any seen before, then record it too. Perform + the alignment by inserting a magic 'padding' statement. */ + if (output_section_statement->subsection_alignment != -1) - i->alignment_power = - output_section_statement->subsection_alignment; + i->alignment_power = output_section_statement->subsection_alignment; + + o = output_section_statement->bfd_section; + if (o->alignment_power < i->alignment_power) + o->alignment_power = i->alignment_power; - dot = insert_pad (this_ptr, fill, i->alignment_power, - output_section_statement->bfd_section, dot); + alignment_needed = align_power (dot, i->alignment_power) - dot; + + if (alignment_needed != 0) + { + insert_pad (this_ptr, fill, alignment_needed * opb, o, dot); + dot += alignment_needed; + } /* Remember where in the output section this input section goes. */ - i->output_offset = dot - output_section_statement->bfd_section->vma; + i->output_offset = dot - o->vma; /* Mark how big the output section must be to contain this now. */ if (i->_cooked_size != 0) dot += i->_cooked_size / opb; else dot += i->_raw_size / opb; - output_section_statement->bfd_section->_raw_size = - (dot - output_section_statement->bfd_section->vma) * opb; + o->_raw_size = (dot - o->vma) * opb; } else { @@ -2729,11 +2784,6 @@ _("%X%P: section %s [%V -> %V] overlaps section %s [%V -> %V]\n"), } } -/* This variable indicates whether bfd_relax_section should be called - again. */ - -static boolean relax_again; - /* Make sure the new address is within the region. We explicitly permit the current address to be at the exact end of the region when the address is non-zero, in case the region is at the end of addressable memory and the @@ -2780,13 +2830,13 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax) lang_statement_union_type **prev; fill_type fill; bfd_vma dot; - boolean relax; + boolean *relax; { unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, ldfile_output_machine); /* Size up the sections from their constituent parts. */ - for (; s != (lang_statement_union_type *) NULL; s = s->next) + for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { switch (s->header.type) { @@ -2809,7 +2859,7 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax) asection *input; if (os->children.head == NULL - || os->children.head->next != 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); @@ -2899,9 +2949,8 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax) os->bfd_section->output_offset = 0; } - (void) lang_size_sections (os->children.head, os, - &os->children.head, - os->fill, dot, relax); + lang_size_sections (os->children.head, os, &os->children.head, + os->fill, dot, relax); /* Put the section within the requested block size, or align at the block boundary. */ @@ -2972,8 +3021,7 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax) dot = lang_size_sections (constructor_list.head, output_section_statement, &s->wild_statement.children.head, - fill, - dot, relax); + fill, dot, relax); break; case lang_data_statement_enum: @@ -3065,12 +3113,10 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax) if (! bfd_relax_section (i->owner, i, &link_info, &again)) einfo (_("%P%F: can't relax section: %E\n")); if (again) - relax_again = true; + *relax = true; } - dot = size_input_section (prev, - output_section_statement, - output_section_statement->fill, - dot, relax); + dot = size_input_section (prev, output_section_statement, + output_section_statement->fill, dot); } break; case lang_input_statement_enum: @@ -3093,31 +3139,22 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax) if (newdot != dot) { - /* The assignment changed dot. Insert a pad. */ 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*")->current = newdot; } - else if (!relax) + else { - lang_statement_union_type *new = - ((lang_statement_union_type *) - stat_alloc (sizeof (lang_padding_statement_type))); - - /* Link into existing chain. */ - new->header.next = *prev; - *prev = new; - new->header.type = lang_padding_statement_enum; - new->padding_statement.output_section = - output_section_statement->bfd_section; - new->padding_statement.output_offset = - dot - output_section_statement->bfd_section->vma; - new->padding_statement.fill = fill; - new->padding_statement.size = (newdot - dot) * opb; - output_section_statement->bfd_section->_raw_size += - new->padding_statement.size; + /* Insert a pad after this statement. We can't + put the pad before when relaxing, in case the + assignment references dot. */ + insert_pad (&s->header.next, fill, (newdot - dot) * opb, + output_section_statement->bfd_section, dot); + + /* Don't neuter the pad below when relaxing. */ + s = s->header.next; } dot = newdot; @@ -3126,16 +3163,20 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax) break; case lang_padding_statement_enum: - /* If we are relaxing, and this is not the first pass, some - padding statements may have been inserted during previous - passes. We may have to move the padding statement to a new - location if dot has a different value at this point in this - pass than it did at this point in the previous pass. */ - s->padding_statement.output_offset = - dot - output_section_statement->bfd_section->vma; - dot += s->padding_statement.size / opb; - output_section_statement->bfd_section->_raw_size += - s->padding_statement.size; + /* If this is the first time lang_size_sections is called, + we won't have any padding statements. If this is the + second or later passes when relaxing, we should allow + padding to shrink. If padding is needed on this pass, it + will be added back in. */ + s->padding_statement.size = 0; + + /* Make sure output_offset is valid. If relaxation shrinks + the section and this pad isn't needed, it's possible to + have output_offset larger than the final size of the + section. bfd_set_section_contents will complain even for + a pad size of zero. */ + s->padding_statement.output_offset + = dot - output_section_statement->bfd_section->vma; break; case lang_group_statement_enum: @@ -3149,8 +3190,7 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax) FAIL (); break; - /* This can only get here when relaxing is turned on. */ - + /* We can only get here when relaxing is turned on. */ case lang_address_statement_enum: break; } @@ -3169,7 +3209,7 @@ lang_do_assignments (s, output_section_statement, fill, dot) unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, ldfile_output_machine); - for (; s != (lang_statement_union_type *) NULL; s = s->next) + for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { switch (s->header.type) { @@ -3486,6 +3526,18 @@ lang_check () bfd_printable_name (input_bfd), input_bfd, bfd_printable_name (output_bfd)); } + else if (link_info.relocateable + /* In general it is not possible to perform a relocatable + link between differing object formats when the input + file has relocations, because the relocations in the + input format may not have equivalent representations in + the output format (and besides BFD does not translate + relocs for other link purposes than a final link). */ + && 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"), + bfd_get_target (input_bfd), input_bfd, + bfd_get_target (output_bfd), output_bfd); else if (bfd_count_sections (input_bfd)) { /* If the input bfd has no contents, it shouldn't set the @@ -3519,6 +3571,8 @@ lang_check () static void lang_common () { + if (command_line.inhibit_common_definition) + return; if (link_info.relocateable && ! command_line.force_common_definition) return; @@ -3679,18 +3733,18 @@ lang_place_orphans () lang_output_section_statement_lookup (".bss"); } - wild_doit (&default_common_section->children, s, - default_common_section, file); + lang_add_section (&default_common_section->children, s, + default_common_section, file); } } else if (ldemul_place_orphan (file, s)) ; else { - lang_output_section_statement_type *os = - lang_output_section_statement_lookup (s->name); + lang_output_section_statement_type *os; - wild_doit (&os->children, s, os, file); + os = lang_output_section_statement_lookup (s->name); + lang_add_section (&os->children, s, os, file); } } } @@ -3922,6 +3976,7 @@ static void reset_memory_regions () { lang_memory_region_type *p = lang_memory_region_list; + asection *o; for (p = lang_memory_region_list; p != (lang_memory_region_type *) NULL; @@ -3930,34 +3985,33 @@ reset_memory_regions () p->old_length = (bfd_size_type) (p->current - p->origin); p->current = p->origin; } + + for (o = output_bfd->sections; o != NULL; o = o->next) + o->_raw_size = 0; } -/* Expand a wild statement for a particular FILE, marking its sections KEEP - as needed. SECTION may be NULL, in which case it is a wild card. */ +/* If the wild pattern was marked KEEP, the member sections + should be as well. */ static void -gc_section_callback (ptr, section, file, data) +gc_section_callback (ptr, sec, section, file, data) lang_wild_statement_type *ptr; + struct wildcard_list *sec ATTRIBUTE_UNUSED; asection *section; lang_input_statement_type *file ATTRIBUTE_UNUSED; PTR data ATTRIBUTE_UNUSED; { - /* 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. SECTION or FILE or both - may be NULL, indicating that it is a wildcard. */ +/* Handle a wild statement, marking it against GC. */ static void -lang_gc_wild (s, section, file) +lang_gc_wild (s) lang_wild_statement_type *s; - const char *section; - const char *file; { - walk_wild (s, section, file, gc_section_callback, NULL); + walk_wild (s, gc_section_callback, NULL); } /* Iterate over sections marking them against GC. */ @@ -3966,14 +4020,12 @@ static void lang_gc_sections_1 (s) lang_statement_union_type *s; { - for (; s != (lang_statement_union_type *) NULL; s = s->next) + for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { switch (s->header.type) { case lang_wild_statement_enum: - lang_gc_wild (&s->wild_statement, - s->wild_statement.section_name, - s->wild_statement.filename); + lang_gc_wild (&s->wild_statement); break; case lang_constructors_statement_enum: lang_gc_sections_1 (constructor_list.head); @@ -4072,6 +4124,12 @@ lang_process () 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); + /* Size up the common data. */ lang_common (); @@ -4089,16 +4147,17 @@ lang_process () 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, (bfd_vma) 0, NULL); + /* Now run around and relax if we can. */ if (command_line.relax) { - /* First time round is a trial run to get the 'worst case' - addresses of the objects if there was no relaxing. */ - lang_size_sections (statement_list.head, - abs_output_section, - &(statement_list.head), 0, (bfd_vma) 0, false); - /* Keep relaxing until bfd_relax_section gives up. */ + boolean relax_again; + do { reset_memory_regions (); @@ -4119,17 +4178,11 @@ lang_process () globals are, so can make better guess. */ lang_size_sections (statement_list.head, abs_output_section, - &(statement_list.head), 0, (bfd_vma) 0, true); + &(statement_list.head), 0, (bfd_vma) 0, + &relax_again); } while (relax_again); } - else - { - /* Size up the sections. */ - lang_size_sections (statement_list.head, - abs_output_section, - &(statement_list.head), 0, (bfd_vma) 0, false); - } /* See if anything special should be done now we know how big everything is. */ @@ -4159,32 +4212,44 @@ lang_process () /* EXPORTED TO YACC */ void -lang_add_wild (section_name, sections_sorted, filename, filenames_sorted, - keep_sections, exclude_filename_list) - const char *const section_name; - boolean sections_sorted; - const char *const filename; - boolean filenames_sorted; +lang_add_wild (filespec, section_list, keep_sections) + struct wildcard_spec *filespec; + struct wildcard_list *section_list; boolean keep_sections; - struct name_list *exclude_filename_list; { - lang_wild_statement_type *new = new_stat (lang_wild_statement, - stat_ptr); + struct wildcard_list *curr, *next; + lang_wild_statement_type *new; + + /* Reverse the list as the parser puts it back to front. */ + for (curr = section_list, section_list = NULL; + curr != NULL; + section_list = curr, curr = next) + { + if (curr->spec.name != NULL && strcmp (curr->spec.name, "COMMON") == 0) + placed_commons = true; + + next = curr->next; + curr->next = section_list; + } - if (section_name != (char *) NULL && strcmp (section_name, "COMMON") == 0) + if (filespec != NULL && filespec->name != NULL) { - placed_commons = true; + if (strcmp (filespec->name, "*") == 0) + filespec->name = NULL; + else if (! wildcardp (filespec->name)) + lang_has_input_file = true; } - if (filename != NULL && ! wildcardp (filename)) + + new = new_stat (lang_wild_statement, stat_ptr); + new->filename = NULL; + new->filenames_sorted = false; + if (filespec != NULL) { - lang_has_input_file = true; + new->filename = filespec->name; + new->filenames_sorted = filespec->sorted; } - new->section_name = section_name; - new->sections_sorted = sections_sorted; - new->filename = filename; - new->filenames_sorted = filenames_sorted; + new->section_list = section_list; new->keep_sections = keep_sections; - new->exclude_filename_list = exclude_filename_list; lang_list_init (&new->children); } @@ -4736,7 +4801,7 @@ lang_leave_overlay_section (fill, phdrs) clean = xmalloc (strlen (name) + 1); s2 = clean; for (s1 = name; *s1 != '\0'; s1++) - if (isalnum ((unsigned char) *s1) || *s1 == '_') + if (ISALNUM (*s1) || *s1 == '_') *s2++ = *s1; *s2 = '\0'; @@ -4981,6 +5046,16 @@ lang_register_vers_node (name, version, deps) struct bfd_elf_version_tree *t, **pp; struct bfd_elf_version_expr *e1; + if (name == NULL) + 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")); + return; + } + /* Make sure this node has a unique name. */ for (t = lang_elf_version_info; t != NULL; t = t->next) if (strcmp (t->name, name) == 0) @@ -5017,8 +5092,13 @@ lang_register_vers_node (name, version, deps) version->deps = deps; version->name = name; - ++version_index; - version->vernum = version_index; + if (name[0] != '\0') + { + ++version_index; + version->vernum = version_index; + } + else + version->vernum = 0; for (pp = &lang_elf_version_info; *pp != NULL; pp = &(*pp)->next) ; @@ -5069,7 +5149,7 @@ lang_do_version_exports_section () len = bfd_section_size (is->the_bfd, sec); contents = xmalloc (len); if (!bfd_get_section_contents (is->the_bfd, sec, contents, 0, len)) - einfo (_("%X%P: unable to read .exports section contents"), sec); + einfo (_("%X%P: unable to read .exports section contents\n"), sec); p = contents; while (p < contents + len) diff --git a/contrib/binutils/ld/ldlang.h b/contrib/binutils/ld/ldlang.h index 348529a..983d34c 100644 --- a/contrib/binutils/ld/ldlang.h +++ b/contrib/binutils/ld/ldlang.h @@ -257,12 +257,10 @@ typedef struct { typedef struct lang_wild_statement_struct { lang_statement_header_type header; - const char *section_name; - boolean sections_sorted; const char *filename; boolean filenames_sorted; + struct wildcard_list *section_list; boolean keep_sections; - struct name_list *exclude_filename_list; lang_statement_list_type children; } lang_wild_statement_type; @@ -292,7 +290,6 @@ typedef struct { typedef union lang_statement_union { lang_statement_header_type header; - union lang_statement_union *next; lang_wild_statement_type wild_statement; lang_data_statement_type data_statement; lang_reloc_statement_type reloc_statement; @@ -385,7 +382,7 @@ extern void lang_section_start PARAMS ((const char *, union etree_union *)); extern void lang_add_entry PARAMS ((const char *, boolean)); extern void lang_add_target PARAMS ((const char *)); extern void lang_add_wild - PARAMS ((const char *, boolean, const char *, boolean, boolean, name_list *)); + PARAMS ((struct wildcard_spec *, struct wildcard_list *, boolean)); extern void lang_add_map PARAMS ((const char *)); extern void lang_add_fill PARAMS ((int)); extern lang_assignment_statement_type * lang_add_assignment PARAMS ((union etree_union *)); @@ -443,10 +440,10 @@ extern bfd_vma lang_size_sections PARAMS ((lang_statement_union_type *s, lang_output_section_statement_type *output_section_statement, lang_statement_union_type **prev, fill_type fill, - bfd_vma dot, boolean relax)); + bfd_vma dot, boolean *relax)); extern void lang_enter_group PARAMS ((void)); extern void lang_leave_group PARAMS ((void)); -extern void wild_doit +extern void lang_add_section PARAMS ((lang_statement_list_type *ptr, asection *section, lang_output_section_statement_type *output, lang_input_statement_type *file)); diff --git a/contrib/binutils/ld/ldlex.l b/contrib/binutils/ld/ldlex.l index eecb902..0b15ca2 100644 --- a/contrib/binutils/ld/ldlex.l +++ b/contrib/binutils/ld/ldlex.l @@ -1,7 +1,7 @@ %{ -/* Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 - Free Software Foundation, Inc. +/* Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -28,7 +28,6 @@ This was written by steve chamberlain #include <ansidecl.h> #include <stdio.h> -#include <ctype.h> #ifdef MPW /* Prevent enum redefinition problems. */ @@ -37,6 +36,7 @@ This was written by steve chamberlain #include "bfd.h" #include "sysdep.h" +#include "safe-ctype.h" #include "ld.h" #include "ldgram.h" #include "ldmisc.h" @@ -260,6 +260,7 @@ V_IDENTIFIER [*?.$_a-zA-Z]([*?.$_a-zA-Z0-9]|::)* <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>"INHIBIT_COMMON_ALLOCATION" { RTOKEN(INHIBIT_COMMON_ALLOCATION);} <BOTH,SCRIPT>"SECTIONS" { RTOKEN(SECTIONS);} <BOTH,SCRIPT>"FILL" { RTOKEN(FILL);} <BOTH,SCRIPT>"STARTUP" { RTOKEN(STARTUP);} @@ -417,11 +418,10 @@ V_IDENTIFIER [*?.$_a-zA-Z]([*?.$_a-zA-Z0-9]|::)* else { yy_switch_to_buffer(include_stack[include_stack_ptr]); - } - BEGIN(SCRIPT); + ldfile_input_filename = file_name_stack[include_stack_ptr - 1]; - lineno = lineno_stack[include_stack_ptr - 1]; + lineno = lineno_stack[include_stack_ptr]; return END; } @@ -445,13 +445,13 @@ lex_push_file (file, name) einfo("%F:includes nested too deeply\n"); } file_name_stack[include_stack_ptr] = name; - lineno_stack[include_stack_ptr] = 1; + lineno_stack[include_stack_ptr] = lineno; include_stack[include_stack_ptr] = YY_CURRENT_BUFFER; include_stack_ptr++; + lineno = 1; yyin = file; yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); - BEGIN (SCRIPT); } /* Return a newly created flex input buffer containing STRING, @@ -511,12 +511,12 @@ lex_redirect (string) einfo("%F: macros nested too deeply\n"); } file_name_stack[include_stack_ptr] = "redirect"; - lineno_stack[include_stack_ptr] = 0; + lineno_stack[include_stack_ptr] = lineno; include_stack[include_stack_ptr] = YY_CURRENT_BUFFER; include_stack_ptr++; + lineno = 1; tmp = yy_create_string_buffer (string, strlen (string)); yy_switch_to_buffer (tmp); - BEGIN (SCRIPT); } /* Functions to switch to a different flex start condition, @@ -595,8 +595,8 @@ yy_input (buf, result, max_size) { if (yyin) { - *result = read (fileno (yyin), (char *) buf, max_size); - if (*result < 0) + *result = fread ((char *) buf, 1, max_size, yyin); + if (*result < max_size && ferror (yyin)) einfo ("%F%P: read in flex scanner failed\n"); } } @@ -658,7 +658,7 @@ lex_warn_invalid (where, what) einfo ("%F%s: file not recognized: %E\n", ldfile_input_filename); } - if (! isprint ((unsigned char) *what)) + if (! ISPRINT (*what)) { sprintf (buf, "\\%03o", (unsigned int) *what); what = buf; diff --git a/contrib/binutils/ld/ldmain.c b/contrib/binutils/ld/ldmain.c index 0b8120f..eac23ae 100644 --- a/contrib/binutils/ld/ldmain.c +++ b/contrib/binutils/ld/ldmain.c @@ -1,5 +1,5 @@ /* Main program of GNU linker. - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Steve Chamberlain steve@cygnus.com @@ -23,7 +23,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "bfd.h" #include "sysdep.h" #include <stdio.h> -#include <ctype.h> +#include "safe-ctype.h" #include "libiberty.h" #include "progress.h" #include "bfdlink.h" @@ -169,6 +169,9 @@ main (argc, argv) #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -193,6 +196,13 @@ main (argc, argv) xexit (1); } +#if YYDEBUG + { + extern int yydebug; + yydebug = 1; + } +#endif + /* Initialize the data about options. */ trace_files = trace_file_tries = version_printed = false; whole_archive = false; @@ -202,6 +212,7 @@ main (argc, argv) config.split_by_reloc = (unsigned) -1; config.split_by_file = (bfd_size_type) -1; command_line.force_common_definition = false; + command_line.inhibit_common_definition = false; command_line.interpreter = NULL; command_line.rpath = NULL; command_line.warn_mismatch = true; @@ -219,13 +230,14 @@ main (argc, argv) link_info.emitrelocations = false; link_info.shared = false; link_info.symbolic = false; + link_info.export_dynamic = false; link_info.static_link = false; link_info.traditional_format = false; link_info.optimize = false; link_info.no_undefined = false; link_info.allow_shlib_undefined = false; link_info.strip = strip_none; - link_info.discard = discard_none; + link_info.discard = discard_sec_merge; link_info.keep_memory = true; link_info.input_bfds = NULL; link_info.create_object_symbols_section = NULL; @@ -240,8 +252,12 @@ main (argc, argv) link_info.init_function = "_init"; link_info.fini_function = "_fini"; link_info.new_dtags = false; + link_info.eh_frame_hdr = false; link_info.flags = (bfd_vma) 0; link_info.flags_1 = (bfd_vma) 0; + link_info.pei386_auto_import = false; + link_info.combreloc = false; + link_info.spare_dynamic_tags = 5; ldfile_add_arch (""); @@ -252,7 +268,7 @@ main (argc, argv) emulation = get_emulation (argc, argv); ldemul_choose_mode (emulation); - default_target = ldemul_choose_target (); + default_target = ldemul_choose_target (argc, argv); lang_init (); ldemul_before_parse (); lang_has_input_file = false; @@ -272,13 +288,21 @@ main (argc, argv) einfo (_("%P%F: -r and -shared may not be used together\n")); } + if (! link_info.shared) + { + if (command_line.filter_shlib) + einfo (_("%P%F: -F may not be used without -shared\n")); + if (command_line.auxiliary_filters) + einfo (_("%P%F: -f may not be used without -shared\n")); + } + /* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols). I don't see how else this can be handled, since in this case we must preserve all externally visible symbols. */ if (link_info.relocateable && link_info.strip == strip_all) { link_info.strip = strip_debugger; - if (link_info.discard == discard_none) + if (link_info.discard == discard_sec_merge) link_info.discard = discard_all; } @@ -286,23 +310,17 @@ main (argc, argv) the -L's in argv have been processed. */ set_scripts_dir (); - if (had_script == false) + /* If we have not already opened and parsed a linker script + read the emulation's appropriate default script. */ + if (saved_script_handle == NULL) { - /* Read the emulation's appropriate default script. */ int isfile; - char *s = ldemul_get_script (&isfile); + char *s = ldemul_get_script (& isfile); if (isfile) ldfile_open_command_file (s); else - { - if (trace_file_tries) - { - info_msg (_("using internal linker script:\n")); - info_msg ("==================================================\n"); - info_msg (s); - info_msg ("\n==================================================\n"); - } + { lex_string = s; lex_redirect (s); } @@ -311,6 +329,39 @@ main (argc, argv) lex_string = NULL; } + if (trace_file_tries) + { + if (saved_script_handle) + info_msg (_("using external linker script:")); + else + info_msg (_("using internal linker script:")); + info_msg ("\n==================================================\n"); + + if (saved_script_handle) + { + static const int ld_bufsz = 8193; + size_t n; + char *buf = xmalloc (ld_bufsz); + + rewind (saved_script_handle); + while ((n = fread (buf, 1, ld_bufsz - 1, saved_script_handle)) > 0) + { + buf [n] = 0; + info_msg (buf); + } + rewind (saved_script_handle); + free (buf); + } + else + { + int isfile; + + info_msg (ldemul_get_script (& isfile)); + } + + info_msg ("\n==================================================\n"); + } + lang_final (); if (lang_has_input_file == false) @@ -502,9 +553,12 @@ get_emulation (argc, argv) else if (strcmp (argv[i], "-mips1") == 0 || strcmp (argv[i], "-mips2") == 0 || strcmp (argv[i], "-mips3") == 0 - || strcmp (argv[i], "-mips4") == 0) + || strcmp (argv[i], "-mips32") == 0 + || strcmp (argv[i], "-mips64") == 0 + || strcmp (argv[i], "-mips4") == 0 + || strcmp (argv[i], "-mips5") == 0) { - /* FIXME: The arguments -mips1, -mips2 and -mips3 are + /* FIXME: The arguments -mips1, -mips2, -mips3, etc. are passed to the linker by some MIPS compilers. They generally tell the linker to use a slightly different library path. Perhaps someday these should be @@ -681,14 +735,14 @@ add_keepsyms_file (filename) c = getc (file); while (c != EOF) { - while (isspace (c)) + while (ISSPACE (c)) c = getc (file); if (c != EOF) { size_t len = 0; - while (! isspace (c) && c != EOF) + while (! ISSPACE (c) && c != EOF) { buf[len] = c; ++len; @@ -785,8 +839,7 @@ add_archive_element (info, abfd, name) { char buf[100]; - sprintf (buf, "%-29s %s\n\n", _("Archive member included"), - _("because of file (symbol)")); + sprintf (buf, _("Archive member included because of file (symbol)\n\n")); minfo ("%s", buf); header_printed = true; } diff --git a/contrib/binutils/ld/ldmisc.c b/contrib/binutils/ld/ldmisc.c index 12dbdf3..42adcee 100644 --- a/contrib/binutils/ld/ldmisc.c +++ b/contrib/binutils/ld/ldmisc.c @@ -1,5 +1,6 @@ /* ldmisc.c - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2002 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. @@ -27,10 +28,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifdef ANSI_PROTOTYPES #include <stdarg.h> -#define USE_STDARG 1 #else #include <varargs.h> -#define USE_STDARG 0 #endif #include "ld.h" @@ -71,18 +70,20 @@ demangle (string) const char *string; { char *res; + const char *p; if (output_bfd != NULL && bfd_get_symbol_leading_char (output_bfd) == string[0]) ++string; - /* This is a hack for better error reporting on XCOFF, or the MS PE - format. Xcoff has a single '.', while the NT PE for PPC has - '..'. So we remove all of them. */ - while (string[0] == '.') - ++string; + /* This is a hack for better error reporting on XCOFF, PowerPC64-ELF + or the MS PE format. These formats have a number of leading '.'s + on at least some symbols, so we remove all dots. */ + p = string; + while (*p == '.') + ++p; - res = cplus_demangle (string, DMGL_ANSI | DMGL_PARAMS); + res = cplus_demangle (p, DMGL_ANSI | DMGL_PARAMS); return res ? res : xstrdup (string); } @@ -399,6 +400,9 @@ vfinfo (fp, fmt, arg) } } + if (config.fatal_warnings) + config.make_executable = false; + if (fatal == true) xexit (1); } @@ -409,51 +413,25 @@ vfinfo (fp, fmt, arg) would hosed by LynxOS, which defines that name in its libc.) */ void -#if USE_STDARG -info_msg (const char *fmt, ...) -#else -info_msg (va_alist) - va_dcl -#endif +info_msg VPARAMS ((const char *fmt, ...)) { - va_list arg; - -#if ! USE_STDARG - const char *fmt; - - va_start (arg); - fmt = va_arg (arg, const char *); -#else - va_start (arg, fmt); -#endif + VA_OPEN (arg, fmt); + VA_FIXEDARG (arg, const char *, fmt); vfinfo (stdout, fmt, arg); - va_end (arg); + VA_CLOSE (arg); } /* ('e' for error.) Format info message and print on stderr. */ void -#if USE_STDARG -einfo (const char *fmt, ...) -#else -einfo (va_alist) - va_dcl -#endif +einfo VPARAMS ((const char *fmt, ...)) { - va_list arg; - -#if ! USE_STDARG - const char *fmt; - - va_start (arg); - fmt = va_arg (arg, const char *); -#else - va_start (arg, fmt); -#endif + VA_OPEN (arg, fmt); + VA_FIXEDARG (arg, const char *, fmt); vfinfo (stderr, fmt, arg); - va_end (arg); + VA_CLOSE (arg); } void @@ -467,50 +445,24 @@ info_assert (file, line) /* ('m' for map) Format info message and print on map. */ void -#if USE_STDARG -minfo (const char *fmt, ...) -#else -minfo (va_alist) - va_dcl -#endif +minfo VPARAMS ((const char *fmt, ...)) { - va_list arg; - -#if ! USE_STDARG - const char *fmt; - va_start (arg); - fmt = va_arg (arg, const char *); -#else - va_start (arg, fmt); -#endif + VA_OPEN (arg, fmt); + VA_FIXEDARG (arg, const char *, fmt); vfinfo (config.map_file, fmt, arg); - va_end (arg); + VA_CLOSE (arg); } void -#if USE_STDARG -lfinfo (FILE *file, const char *fmt, ...) -#else -lfinfo (va_alist) - va_dcl -#endif +lfinfo VPARAMS ((FILE *file, const char *fmt, ...)) { - va_list arg; - -#if ! USE_STDARG - FILE *file; - const char *fmt; - - va_start (arg); - file = va_arg (arg, FILE *); - fmt = va_arg (arg, const char *); -#else - va_start (arg, fmt); -#endif + VA_OPEN (arg, fmt); + VA_FIXEDARG (arg, FILE *, file); + VA_FIXEDARG (arg, const char *, fmt); vfinfo (file, fmt, arg); - va_end (arg); + VA_CLOSE (arg); } /* Functions to print the link map. */ diff --git a/contrib/binutils/ld/ldmisc.h b/contrib/binutils/ld/ldmisc.h index 998fb4f..aa3f6af 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 + Copyright 1991, 1992, 1993, 1994, 1996, 1997, 2001 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -15,28 +15,17 @@ 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. */ + 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. */ #ifndef LDMISC_H #define LDMISC_H -#ifdef ANSI_PROTOTYPES extern void einfo PARAMS ((const char *, ...)); extern void minfo PARAMS ((const char *, ...)); extern void info_msg PARAMS ((const char *, ...)); extern void lfinfo PARAMS ((FILE *, const char *, ...)); -#else -/* VARARGS*/ -extern void einfo (); -/* VARARGS*/ -extern void minfo (); -/* VARARGS*/ -extern void info_msg (); -/*VARARGS*/ -extern void lfinfo (); -#endif - extern void info_assert PARAMS ((const char *, unsigned int)); extern void yyerror PARAMS ((const char *)); extern PTR xmalloc PARAMS ((size_t)); diff --git a/contrib/binutils/ld/ldver.c b/contrib/binutils/ld/ldver.c index a50b548..f81884c 100644 --- a/contrib/binutils/ld/ldver.c +++ b/contrib/binutils/ld/ldver.c @@ -1,5 +1,5 @@ /* ldver.c -- Print linker version. - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000 + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -30,16 +30,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ldemul.h" #include "ldmain.h" -const char *ld_program_version = VERSION; - void ldversion (noisy) int noisy; { - fprintf (stdout, _("GNU ld version %s (with BFD %s)\n"), - ld_program_version, BFD_VERSION); + /* Output for noisy == 2 is intended to follow the GNU standards. */ + fprintf (stdout, _("GNU ld version %s\n"), BFD_VERSION_STRING); + + if (noisy & 2) + { + printf (_("Copyright 2002 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")); + } - if (noisy) + if (noisy & 1) { ld_emulation_xfer_type **ptr = ld_emulations; diff --git a/contrib/binutils/ld/ldver.h b/contrib/binutils/ld/ldver.h index a5ba624..ef06937 100644 --- a/contrib/binutils/ld/ldver.h +++ b/contrib/binutils/ld/ldver.h @@ -17,6 +17,4 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -extern const char *ld_program_version; - void ldversion PARAMS ((int)); diff --git a/contrib/binutils/ld/lexsup.c b/contrib/binutils/ld/lexsup.c index 77a37b2..ca2e9a1 100644 --- a/contrib/binutils/ld/lexsup.c +++ b/contrib/binutils/ld/lexsup.c @@ -25,7 +25,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "libiberty.h" #include <stdio.h> #include <string.h> -#include <ctype.h> +#include "safe-ctype.h" #include "getopt.h" #include "bfdlink.h" #include "ld.h" @@ -109,7 +109,8 @@ int parsing_defsym = 0; #define OPTION_VERSION_EXPORTS_SECTION (OPTION_VERSION_SCRIPT + 1) #define OPTION_WARN_COMMON (OPTION_VERSION_EXPORTS_SECTION + 1) #define OPTION_WARN_CONSTRUCTORS (OPTION_WARN_COMMON + 1) -#define OPTION_WARN_MULTIPLE_GP (OPTION_WARN_CONSTRUCTORS + 1) +#define OPTION_WARN_FATAL (OPTION_WARN_CONSTRUCTORS + 1) +#define OPTION_WARN_MULTIPLE_GP (OPTION_WARN_FATAL + 1) #define OPTION_WARN_ONCE (OPTION_WARN_MULTIPLE_GP + 1) #define OPTION_WARN_SECTION_ALIGN (OPTION_WARN_ONCE + 1) #define OPTION_SPLIT_BY_RELOC (OPTION_WARN_SECTION_ALIGN + 1) @@ -129,6 +130,10 @@ int parsing_defsym = 0; #define OPTION_UNIQUE (OPTION_SECTION_START + 1) #define OPTION_TARGET_HELP (OPTION_UNIQUE + 1) #define OPTION_ALLOW_SHLIB_UNDEFINED (OPTION_TARGET_HELP + 1) +#define OPTION_DISCARD_NONE (OPTION_ALLOW_SHLIB_UNDEFINED + 1) +#define OPTION_SPARE_DYNAMIC_TAGS (OPTION_DISCARD_NONE + 1) +#define OPTION_NO_DEFINE_COMMON (OPTION_SPARE_DYNAMIC_TAGS + 1) +#define OPTION_NOSTDLIB (OPTION_NO_DEFINE_COMMON + 1) /* The long options. This structure is used for both the option parsing and the help text. */ @@ -199,6 +204,8 @@ static const struct ld_option ld_options[] = TWO_DASHES }, { {"soname", required_argument, NULL, OPTION_SONAME}, '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 }, { {"library", required_argument, NULL, 'l'}, 'l', N_("LIBNAME"), N_("Search for library LIBNAME"), TWO_DASHES }, { {"library-path", required_argument, NULL, 'L'}, @@ -248,7 +255,9 @@ static const struct ld_option ld_options[] = { {"discard-all", no_argument, NULL, 'x'}, 'x', NULL, N_("Discard all local symbols"), TWO_DASHES }, { {"discard-locals", no_argument, NULL, 'X'}, - 'X', NULL, N_("Discard temporary local symbols"), 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 }, { {"trace-symbol", required_argument, NULL, 'y'}, 'y', N_("SYMBOL"), N_("Trace mentions of SYMBOL"), TWO_DASHES }, { {NULL, required_argument, NULL, '\0'}, @@ -286,8 +295,6 @@ static const struct ld_option ld_options[] = '\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 }, - { {"dynamic-linker", required_argument, NULL, OPTION_DYNAMIC_LINKER}, - '\0', N_("PROGRAM"), N_("Set the dynamic linker to use"), TWO_DASHES }, { {"embedded-relocs", no_argument, NULL, OPTION_EMBEDDED_RELOCS}, '\0', NULL, N_("Generate embedded relocs"), TWO_DASHES}, { {"fini", required_argument, NULL, OPTION_FINI}, @@ -306,6 +313,8 @@ static const struct ld_option ld_options[] = '\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 }, + { {"no-define-common", no_argument, NULL, OPTION_NO_DEFINE_COMMON}, + '\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 }, { {"no-keep-memory", no_argument, NULL, OPTION_NO_KEEP_MEMORY}, @@ -322,6 +331,8 @@ static const struct ld_option ld_options[] = '\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 }, + { {"nostdlib", no_argument, NULL, OPTION_NOSTDLIB}, + '\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 }, { {"qmagic", no_argument, NULL, OPTION_IGNORE}, @@ -343,6 +354,8 @@ static const struct ld_option ld_options[] = '\0', NULL, N_("Sort common symbols by size"), TWO_DASHES }, { {"sort_common", no_argument, NULL, OPTION_SORT_COMMON}, '\0', NULL, NULL, NO_HELP }, + { {"spare-dynamic-tags", required_argument, NULL, OPTION_SPARE_DYNAMIC_TAGS}, + '\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 }, { {"split-by-reloc", optional_argument, NULL, OPTION_SPLIT_BY_RELOC}, @@ -385,6 +398,9 @@ static const struct ld_option ld_options[] = { {"warn-section-align", no_argument, NULL, OPTION_WARN_SECTION_ALIGN}, '\0', NULL, N_("Warn if start of section changes due to alignment"), TWO_DASHES }, + { {"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 }, { {"wrap", required_argument, NULL, OPTION_WRAP}, @@ -409,7 +425,7 @@ is_num (string, min, max, err) for (; *string; ++string) { - if (! isdigit (*string)) + if (! ISDIGIT (*string)) { result = err; break; @@ -494,7 +510,7 @@ parse_args (argc, argv) for (i = 1; i < argc; i++) if (strcmp (argv[i], "-G") == 0 && (i + 1 >= argc - || ! isdigit ((unsigned char) argv[i + 1][0]))) + || ! ISDIGIT (argv[i + 1][0]))) argv[i] = (char *) "--shared"; /* Because we permit long options to start with a single dash, and @@ -536,20 +552,18 @@ parse_args (argc, argv) -nx, in which the -n is parsed as a single option, and we loop around to pick up the -x. */ if (optind != last_optind) - { - if (ldemul_parse_args (argc, argv)) - continue; - last_optind = optind; - } + if (ldemul_parse_args (argc, argv)) + continue; /* getopt_long_only is like getopt_long, but '-' as well as '--' can indicate a long option. */ opterr = 0; + last_optind = optind; optc = getopt_long_only (argc, argv, shortopts, longopts, &longind); if (optc == '?') { - --optind; - optc = getopt_long (argc, argv, shortopts, really_longopts, &longind); + optind = last_optind; + optc = getopt_long (argc, argv, "-", really_longopts, &longind); } if (optc == -1) @@ -558,13 +572,10 @@ parse_args (argc, argv) switch (optc) { case '?': - fprintf (stderr, _("%s: unrecognized option '%s'\n"), - program_name, argv[optind - 1]); + einfo (_("%P: unrecognized option '%s'\n"), argv[last_optind]); default: - fprintf (stderr, - _("%s: use the --help option for usage information\n"), - program_name); - xexit (1); + einfo (_("%P%F: use the --help option for usage information\n")); + case 1: /* File name. */ lang_add_input_file (optarg, lang_input_file_is_file_enum, (char *) NULL); @@ -644,6 +655,7 @@ parse_args (argc, argv) cplus_demangle_set_style (style); } break; + case 'I': /* Used on Solaris. */ case OPTION_DYNAMIC_LINKER: command_line.interpreter = optarg; break; @@ -658,7 +670,7 @@ parse_args (argc, argv) break; case OPTION_EXPORT_DYNAMIC: case 'E': /* HP/UX compatibility. */ - command_line.export_dynamic = true; + link_info.export_dynamic = true; break; case 'e': lang_add_entry (optarg, true); @@ -735,6 +747,9 @@ parse_args (argc, argv) config.magic_demand_paged = false; config.dynamic_link = false; break; + case OPTION_NO_DEFINE_COMMON: + command_line.inhibit_common_definition = true; + break; case OPTION_NO_DEMANGLE: demangling = false; break; @@ -756,6 +771,9 @@ parse_args (argc, argv) case OPTION_NOINHIBIT_EXEC: force_make_executable = true; break; + case OPTION_NOSTDLIB: + config.only_cmd_line_lib_dirs = true; + break; case OPTION_NO_WHOLE_ARCHIVE: whole_archive = false; break; @@ -780,6 +798,17 @@ parse_args (argc, argv) break; case 'i': case 'r': + if (optind == last_optind) + /* 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 + but it cannot parse the text after the -r so it refuses to + increment the optind counter. Detect this case and issue + 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. */ + einfo(_("%P%F: bad -rpath option\n")); + link_info.relocateable = true; config.build_constructors = false; config.magic_demand_paged = false; @@ -821,6 +850,7 @@ parse_args (argc, argv) do { size_t idx = 0; + while (optarg[idx] != '\0' && optarg[idx] == cp[idx]) ++idx; if (optarg[idx] == '\0' @@ -907,23 +937,13 @@ parse_args (argc, argv) /* Check for <something>=<somthing>... */ optarg2 = strchr (optarg, '='); if (optarg2 == NULL) - { - fprintf (stderr, - _("%s: Invalid argument to option \"--section-start\"\n"), - program_name); - xexit (1); - } + 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')) - { - fprintf (stderr, - _("%s: Missing argument(s) to option \"--section-start\"\n"), - program_name); - xexit (1); - } + 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. */ @@ -985,22 +1005,7 @@ parse_args (argc, argv) version_printed = true; break; case OPTION_VERSION: - /* This output is intended to follow the GNU standards document. */ - printf ("GNU ld %s\n", ld_program_version); - printf (_("Copyright 2001 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")); - { - ld_emulation_xfer_type **ptr = ld_emulations; - - printf (_(" Supported emulations:\n")); - while (*ptr) - { - printf (" %s\n", (*ptr)->emulation_name); - ptr++; - } - } + ldversion (2); xexit (0); break; case OPTION_VERSION_SCRIPT: @@ -1008,11 +1013,11 @@ the GNU General Public License. This program has absolutely no warranty.\n")); version information. Read it, but don't assume that we've seen a linker script. */ { - boolean hold_had_script; + FILE * hold_script_handle; - hold_had_script = had_script; + hold_script_handle = saved_script_handle; ldfile_open_command_file (optarg); - had_script = hold_had_script; + saved_script_handle = hold_script_handle; parser_input = input_version_script; yyparse (); } @@ -1029,6 +1034,9 @@ the GNU General Public License. This program has absolutely no warranty.\n")); case OPTION_WARN_CONSTRUCTORS: config.warn_constructors = true; break; + case OPTION_WARN_FATAL: + config.fatal_warnings = true; + break; case OPTION_WARN_MULTIPLE_GP: config.warn_multiple_gp = true; break; @@ -1044,6 +1052,9 @@ the GNU General Public License. This program has absolutely no warranty.\n")); case OPTION_WRAP: add_wrap (optarg); break; + case OPTION_DISCARD_NONE: + link_info.discard = discard_none; + break; case 'X': link_info.discard = discard_l; break; @@ -1058,6 +1069,9 @@ the GNU General Public License. This program has absolutely no warranty.\n")); case 'y': add_ysym (optarg); break; + case OPTION_SPARE_DYNAMIC_TAGS: + link_info.spare_dynamic_tags = strtoul (optarg, NULL, 0); + break; case OPTION_SPLIT_BY_RELOC: if (optarg != NULL) config.split_by_reloc = strtoul (optarg, NULL, 0); @@ -1078,41 +1092,31 @@ the GNU General Public License. This program has absolutely no warranty.\n")); break; case '(': if (ingroup) - { - fprintf (stderr, - _("%s: may not nest groups (--help for usage)\n"), - program_name); - xexit (1); - } + einfo (_("%P%F: may not nest groups (--help for usage)\n")); + lang_enter_group (); ingroup = 1; break; case ')': if (! ingroup) - { - fprintf (stderr, - _("%s: group ended before it began (--help for usage)\n"), - program_name); - xexit (1); - } + einfo (_("%P%F: group ended before it began (--help for usage)\n")); + lang_leave_group (); ingroup = 0; break; case OPTION_MPC860C0: - link_info.mpc860c0 = 20; /* default value (in bytes) */ + /* Default value (in bytes). */ + link_info.mpc860c0 = 20; if (optarg) { unsigned words; words = is_num (optarg, 1, 10, 0); if (words == 0) - { - fprintf (stderr, - _("%s: Invalid argument to option \"mpc860c0\"\n"), - program_name); - xexit (1); - } - link_info.mpc860c0 = words * 4; /* convert words to bytes */ + einfo (_("%P%F: invalid argument to option \"mpc860c0\"\n")); + + /* Convert words to bytes. */ + link_info.mpc860c0 = words * 4; } command_line.relax = true; break; diff --git a/contrib/binutils/ld/mri.c b/contrib/binutils/ld/mri.c index f4094cb..6ec0ab8 100644 --- a/contrib/binutils/ld/mri.c +++ b/contrib/binutils/ld/mri.c @@ -220,6 +220,7 @@ mri_draw_tree () struct section_name_struct *aptr; etree_type *align = 0; etree_type *subalign = 0; + struct wildcard_list *tmp; /* See if an alignment has been specified. */ for (aptr = alignment; aptr; aptr = aptr->next) @@ -238,12 +239,24 @@ mri_draw_tree () 1, align, subalign, (etree_type *) NULL); base = 0; - lang_add_wild (p->name, false, (char *) NULL, false, false, NULL); + tmp = (struct wildcard_list *) xmalloc (sizeof *tmp); + tmp->next = NULL; + tmp->spec.name = p->name; + tmp->spec.exclude_name_list = NULL; + tmp->spec.sorted = false; + lang_add_wild (NULL, tmp, false); /* If there is an alias for this section, add it too. */ for (aptr = alias; aptr; aptr = aptr->next) if (strcmp (aptr->alias, p->name) == 0) - lang_add_wild (aptr->name, false, (char *) NULL, false, false, NULL); + { + tmp = (struct wildcard_list *) xmalloc (sizeof *tmp); + tmp->next = NULL; + tmp->spec.name = aptr->name; + tmp->spec.exclude_name_list = NULL; + tmp->spec.sorted = false; + lang_add_wild (NULL, tmp, false); + } lang_leave_output_section_statement (0, "*default*", (struct lang_output_section_phdr_list *) NULL, diff --git a/contrib/binutils/ld/pe-dll.c b/contrib/binutils/ld/pe-dll.c index 717426f..945564c 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 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by DJ Delorie <dj@cygnus.com> This file is part of GLD, the Gnu Linker. @@ -23,9 +23,9 @@ #include "sysdep.h" #include "bfdlink.h" #include "libiberty.h" +#include "safe-ctype.h" #include <time.h> -#include <ctype.h> #include "ld.h" #include "ldexp.h" @@ -41,57 +41,133 @@ #include "deffile.h" #include "pe-dll.h" -/************************************************************************ +/* This file turns a regular Windows PE image into a DLL. Because of + the complexity of this operation, it has been broken down into a + number of separate modules which are all called by the main function + at the end of this file. This function is not re-entrant and is + normally only called once, so static variables are used to reduce + the number of parameters and return values required. + + See also: ld/emultempl/pe.em. */ + +/* Auto-import feature by Paul Sokolovsky + + Quick facts: + + 1. With this feature on, DLL clients can import variables from DLL + without any concern from their side (for example, without any source + code modifications). + + 2. This is done completely in bounds of the PE specification (to be fair, + there's a place where it pokes nose out of, but in practise it works). + So, resulting module can be used with any other PE compiler/linker. + + 3. Auto-import is fully compatible with standard import method and they + can be mixed together. + + 4. Overheads: space: 8 bytes per imported symbol, plus 20 for each + reference to it; load time: negligible; virtual/physical memory: should be + less than effect of DLL relocation, and I sincerely hope it doesn't affect + DLL sharability (too much). + + Idea + + The obvious and only way to get rid of dllimport insanity is to make client + access variable directly in the DLL, bypassing extra dereference. I.e., + whenever client contains someting like + + mov dll_var,%eax, + + address of dll_var in the command should be relocated to point into loaded + DLL. The aim is to make OS loader do so, and than make ld help with that. + Import section of PE made following way: there's a vector of structures + each describing imports from particular DLL. Each such structure points + to two other parellel vectors: one holding imported names, and one which + will hold address of corresponding imported name. So, the solution is + de-vectorize these structures, making import locations be sparse and + pointing directly into code. Before continuing, it is worth a note that, + while authors strives to make PE act ELF-like, there're some other people + make ELF act PE-like: elfvector, ;-) . + + Implementation + + For each reference of data symbol to be imported from DLL (to set of which + belong symbols with name <sym>, if __imp_<sym> is found in implib), the + import fixup entry is generated. That entry is of type + IMAGE_IMPORT_DESCRIPTOR and stored in .idata$3 subsection. Each + fixup entry contains pointer to symbol's address within .text section + (marked with __fuN_<sym> symbol, where N is integer), pointer to DLL name + (so, DLL name is referenced by multiple entries), and pointer to symbol + name thunk. Symbol name thunk is singleton vector (__nm_th_<symbol>) + pointing to IMAGE_IMPORT_BY_NAME structure (__nm_<symbol>) directly + containing imported name. Here comes that "om the edge" problem mentioned + above: PE specification rambles that name vector (OriginalFirstThunk) + should run in parallel with addresses vector (FirstThunk), i.e. that they + should have same number of elements and terminated with zero. We violate + this, since FirstThunk points directly into machine code. But in practise, + OS loader implemented the sane way: it goes thru OriginalFirstThunk and + puts addresses to FirstThunk, not something else. It once again should be + noted that dll and symbol name structures are reused across fixup entries + and should be there anyway to support standard import stuff, so sustained + overhead is 20 bytes per reference. Other question is whether having several + IMAGE_IMPORT_DESCRIPTORS for the same DLL is possible. Answer is yes, it is + done even by native compiler/linker (libth32's functions are in fact reside + in windows9x kernel32.dll, so if you use it, you have two + IMAGE_IMPORT_DESCRIPTORS for kernel32.dll). Yet other question is whether + referencing the same PE structures several times is valid. The answer is why + not, prohibitting that (detecting violation) would require more work on + behalf of loader than not doing it. + + See also: ld/emultempl/pe.em. */ - This file turns a regular Windows PE image into a DLL. Because of - the complexity of this operation, it has been broken down into a - number of separate modules which are all called by the main function - at the end of this file. This function is not re-entrant and is - normally only called once, so static variables are used to reduce - the number of parameters and return values required. - - See also: ld/emultempl/pe.em - - ************************************************************************/ +static void +add_bfd_to_link PARAMS ((bfd *, const char *, struct bfd_link_info *)); -/* for emultempl/pe.em */ +/* For emultempl/pe.em. */ -def_file *pe_def_file = 0; +def_file * pe_def_file = 0; int pe_dll_export_everything = 0; int pe_dll_do_default_excludes = 1; int pe_dll_kill_ats = 0; int pe_dll_stdcall_aliases = 0; int pe_dll_warn_dup_exports = 0; int pe_dll_compat_implib = 0; +int pe_dll_extra_pe_debug = 0; -/************************************************************************ - - static variables and types - - ************************************************************************/ +/* Static variables and types. */ static bfd_vma image_base; - static bfd *filler_bfd; static struct sec *edata_s, *reloc_s; static unsigned char *edata_d, *reloc_d; static size_t edata_sz, reloc_sz; -typedef struct { - char *target_name; - char *object_target; - unsigned int imagebase_reloc; - int pe_arch; - int bfd_arch; - int underscored; -} pe_details_type; +typedef struct + { + char *target_name; + char *object_target; + unsigned int imagebase_reloc; + int pe_arch; + int bfd_arch; + int underscored; + } +pe_details_type; + +typedef struct + { + char *name; + int len; + } +autofilter_entry_type; #define PE_ARCH_i386 1 #define PE_ARCH_sh 2 #define PE_ARCH_mips 3 #define PE_ARCH_arm 4 +#define PE_ARCH_arm_epoc 5 -static pe_details_type pe_detail_list[] = { +static pe_details_type pe_detail_list[] = +{ { "pei-i386", "pe-i386", @@ -124,18 +200,112 @@ static pe_details_type pe_detail_list[] = { bfd_arch_arm, 0 }, + { + "epoc-pei-arm-little", + "epoc-pe-arm-little", + 11 /* ARM_RVA32 */, + PE_ARCH_arm_epoc, + bfd_arch_arm, + 0 + }, { NULL, NULL, 0, 0, 0, 0 } }; static pe_details_type *pe_details; +static autofilter_entry_type autofilter_symbollist[] = +{ + { "DllMain@12", 10 }, + { "DllEntryPoint@0", 15 }, + { "DllMainCRTStartup@12", 20 }, + { "_cygwin_dll_entry@12", 20 }, + { "_cygwin_crt0_common@8", 21 }, + { "_cygwin_noncygwin_dll_entry@12", 30 }, + { "impure_ptr", 10 }, + { NULL, 0 } +}; + +/* Do not specify library suffix explicitly, to allow for dllized versions. */ +static autofilter_entry_type autofilter_liblist[] = +{ + { "libgcc.", 7 }, + { "libstdc++.", 10 }, + { "libmingw32.", 11 }, + { NULL, 0 } +}; + +static autofilter_entry_type autofilter_objlist[] = +{ + { "crt0.o", 6 }, + { "crt1.o", 6 }, + { "crt2.o", 6 }, + { "dllcrt1.o", 9 }, + { "dllcrt2.o", 9 }, + { "gcrt0.o", 7 }, + { "gcrt1.o", 7 }, + { "gcrt2.o", 7 }, + { NULL, 0 } +}; + +static autofilter_entry_type autofilter_symbolprefixlist[] = +{ + /* { "__imp_", 6 }, */ + /* Do __imp_ explicitly to save time. */ + { "__rtti_", 7 }, + { "__builtin_", 10 }, + /* Don't export symbols specifying internal DLL layout. */ + { "_head_", 6 }, + { "_fmode", 6 }, + { "_impure_ptr", 11 }, + { "cygwin_attach_dll", 17 }, + { "cygwin_premain0", 15 }, + { "cygwin_premain1", 15 }, + { "cygwin_premain2", 15 }, + { "cygwin_premain3", 15 }, + { "environ", 7 }, + { NULL, 0 } +}; + +static autofilter_entry_type autofilter_symbolsuffixlist[] = +{ + { "_iname", 6 }, + { NULL, 0 } +}; + #define U(str) (pe_details->underscored ? "_" str : str) +static int reloc_sort PARAMS ((const void *, const void *)); +static int pe_export_sort PARAMS ((const void *, const void *)); +static int auto_export PARAMS ((bfd *, def_file *, const char *)); +static void process_def_file PARAMS ((bfd *, struct bfd_link_info *)); +static void build_filler_bfd PARAMS ((int)); +static void generate_edata PARAMS ((bfd *, struct bfd_link_info *)); +static void fill_exported_offsets PARAMS ((bfd *, struct bfd_link_info *)); +static void fill_edata PARAMS ((bfd *, struct bfd_link_info *)); +static void generate_reloc PARAMS ((bfd *, struct bfd_link_info *)); +static void quoteput PARAMS ((char *, FILE *, int)); +static asection *quick_section PARAMS ((bfd *, const char *, int, int)); +static void quick_symbol + PARAMS ((bfd *, const char *, const char *, const char *, + asection *, int, int)); +static void quick_reloc PARAMS ((bfd *, int, int, int)); +static bfd *make_head PARAMS ((bfd *)); +static bfd *make_tail PARAMS ((bfd *)); +static bfd *make_one PARAMS ((def_file_export *, bfd *)); +static bfd *make_singleton_name_thunk PARAMS ((const char *, bfd *)); +static char *make_import_fixup_mark PARAMS ((arelent *)); +static bfd *make_import_fixup_entry + PARAMS ((const char *, const char *, const char *, bfd *)); +static unsigned int pe_get16 PARAMS ((bfd *, int)); +static unsigned int pe_get32 PARAMS ((bfd *, int)); +static unsigned int pe_as32 PARAMS ((void *)); + void pe_dll_id_target (target) const char *target; { int i; + for (i = 0; pe_detail_list[i].target_name; i++) if (strcmp (pe_detail_list[i].target_name, target) == 0 || strcmp (pe_detail_list[i].object_target, target) == 0) @@ -147,18 +317,16 @@ pe_dll_id_target (target) exit (1); } -/************************************************************************ - - Helper functions for qsort. Relocs must be sorted so that we can write - them out by pages. +/* Helper functions for qsort. Relocs must be sorted so that we can write + them out by pages. */ - ************************************************************************/ - -typedef struct { - bfd_vma vma; - char type; - short extra; -} reloc_data_type; +typedef struct + { + bfd_vma vma; + char type; + short extra; + } +reloc_data_type; static int reloc_sort (va, vb) @@ -166,6 +334,7 @@ reloc_sort (va, vb) { bfd_vma a = ((reloc_data_type *) va)->vma; bfd_vma b = ((reloc_data_type *) vb)->vma; + return (a > b) ? 1 : ((a < b) ? -1 : 0); } @@ -175,14 +344,11 @@ pe_export_sort (va, vb) { def_file_export *a = (def_file_export *) va; def_file_export *b = (def_file_export *) vb; + return strcmp (a->name, b->name); } -/************************************************************************ - - Read and process the .DEF file - - ************************************************************************/ +/* Read and process the .DEF file. */ /* These correspond to the entries in pe_def_file->exports[]. I use exported_symbol_sections[i] to tag whether or not the symbol was @@ -190,7 +356,6 @@ pe_export_sort (va, vb) static bfd_vma *exported_symbol_offsets; static struct sec **exported_symbol_sections; - static int export_table_size; static int count_exported; static int count_exported_byname; @@ -199,10 +364,12 @@ static const char *dll_name; static int min_ordinal, max_ordinal; static int *exported_symbols; -typedef struct exclude_list_struct { - char *string; - struct exclude_list_struct *next; -} exclude_list_struct; +typedef struct exclude_list_struct + { + char *string; + struct exclude_list_struct *next; + } +exclude_list_struct; static struct exclude_list_struct *excludes = 0; @@ -231,28 +398,106 @@ pe_dll_add_excludes (new_excludes) free (local_copy); } +/* abfd is a bfd containing n (or NULL) + It can be used for contextual checks. */ + static int -auto_export (d, n) +auto_export (abfd, d, n) + bfd *abfd; def_file *d; const char *n; { int i; struct exclude_list_struct *ex; + autofilter_entry_type *afptr; + + /* We should not re-export imported stuff. */ + if (strncmp (n, "_imp__", 6) == 0) + return 0; + for (i = 0; i < d->num_exports; i++) if (strcmp (d->exports[i].name, n) == 0) return 0; + if (pe_dll_do_default_excludes) { - if (strcmp (n, "DllMain@12") == 0) - return 0; - if (strcmp (n, "DllEntryPoint@0") == 0) - return 0; - if (strcmp (n, "impure_ptr") == 0) - return 0; + const char * p; + int len; + + if (pe_dll_extra_pe_debug) + printf ("considering exporting: %s, abfd=%p, abfd->my_arc=%p\n", + n, abfd, abfd->my_archive); + + /* First of all, make context checks: + Don't export anything from libgcc. */ + if (abfd && abfd->my_archive) + { + afptr = autofilter_liblist; + + while (afptr->name) + { + if (strstr (abfd->my_archive->filename, afptr->name)) + return 0; + afptr++; + } + } + + /* Next, exclude symbols from certain startup objects. */ + + if (abfd && (p = lbasename (abfd->filename))) + { + afptr = autofilter_objlist; + while (afptr->name) + { + if ( strcmp (p, afptr->name) == 0 ) + return 0; + afptr++; + } + } + + /* Don't try to blindly exclude all symbols + that begin with '__'; this was tried and + it is too restrictive. */ + + /* Then, exclude specific symbols. */ + afptr = autofilter_symbollist; + while (afptr->name) + { + if (strcmp (n, afptr->name) == 0) + return 0; + + afptr ++; + } + + /* Next, exclude symbols starting with ... */ + afptr = autofilter_symbolprefixlist; + while (afptr->name) + { + if (strncmp (n, afptr->name, afptr->len) == 0) + return 0; + + afptr ++; + } + + /* Finally, exclude symbols ending with ... */ + len = strlen (n); + afptr = autofilter_symbolsuffixlist; + while (afptr->name) + { + if ((len >= afptr->len) && + /* Add 1 to insure match with trailing '\0'. */ + strncmp (n + len - afptr->len, afptr->name, + afptr->len + 1) == 0) + return 0; + + afptr ++; + } } + for (ex = excludes; ex; ex = ex->next) if (strcmp (n, ex->string) == 0) return 0; + return 1; } @@ -272,7 +517,6 @@ process_def_file (abfd, info) /* First, run around to all the objects looking for the .drectve sections, and push those into the def file too. */ - for (b = info->input_bfds; b; b = b->link_next) { s = bfd_get_section_by_name (b, ".drectve"); @@ -280,6 +524,7 @@ process_def_file (abfd, info) { int size = bfd_get_section_size_before_reloc (s); char *buf = xmalloc (size); + bfd_get_section_contents (b, s, buf, 0, size); def_file_add_directive (pe_def_file, buf, size); free (buf); @@ -287,7 +532,6 @@ process_def_file (abfd, info) } /* Now, maybe export everything else the default way. */ - if (pe_dll_export_everything || pe_def_file->num_exports == 0) { for (b = info->input_bfds; b; b = b->link_next) @@ -302,20 +546,37 @@ process_def_file (abfd, info) for (j = 0; j < nsyms; j++) { /* We should export symbols which are either global or not - anything at all. (.bss data is the latter) */ - if ((symbols[j]->flags & BSF_GLOBAL) - || (symbols[j]->flags == BSF_NO_FLAGS)) + anything at all. (.bss data is the latter) + We should not export undefined symbols. */ + if (symbols[j]->section != &bfd_und_section + && ((symbols[j]->flags & BSF_GLOBAL) + || (symbols[j]->flags == BFD_FORT_COMM_DEFAULT_VALUE))) { const char *sn = symbols[j]->name; + + /* We should not re-export imported stuff. */ + { + char *name = (char *) xmalloc (strlen (sn) + 2 + 6); + sprintf (name, "%s%s", U("_imp_"), sn); + + blhe = bfd_link_hash_lookup (info->hash, name, + false, false, false); + free (name); + + if (blhe && blhe->type == bfd_link_hash_defined) + continue; + } + if (*sn == '_') sn++; - if (auto_export (pe_def_file, sn)) - { - def_file_export *p; - p=def_file_add_export (pe_def_file, sn, 0, -1); - /* Fill data flag properly, from dlltool.c */ - p->flag_data = !(symbols[j]->flags & BSF_FUNCTION); - } + + if (auto_export (b, pe_def_file, sn)) + { + def_file_export *p; + p=def_file_add_export (pe_def_file, sn, 0, -1); + /* Fill data flag properly, from dlltool.c. */ + p->flag_data = !(symbols[j]->flags & BSF_FUNCTION); + } } } } @@ -325,7 +586,6 @@ process_def_file (abfd, info) #define NE pe_def_file->num_exports /* Canonicalize the export list. */ - if (pe_dll_kill_ats) { for (i = 0; i < NE; i++) @@ -336,6 +596,7 @@ process_def_file (abfd, info) pointing to the same memory as name, or might not have. */ char *tmp = xstrdup (pe_def_file->exports[i].name); + *(strchr (tmp, '@')) = 0; pe_def_file->exports[i].name = tmp; } @@ -349,10 +610,12 @@ process_def_file (abfd, info) if (strchr (pe_def_file->exports[i].name, '@')) { char *tmp = xstrdup (pe_def_file->exports[i].name); + *(strchr (tmp, '@')) = 0; - if (auto_export (pe_def_file, tmp)) + if (auto_export (NULL, pe_def_file, tmp)) def_file_add_export (pe_def_file, tmp, - pe_def_file->exports[i].internal_name, -1); + pe_def_file->exports[i].internal_name, + -1); else free (tmp); } @@ -394,6 +657,7 @@ process_def_file (abfd, info) einfo (_("Warning, duplicate EXPORT: %s\n"), e[j - 1].name); } + if (e[i].ordinal != -1) e[j - 1].ordinal = e[i].ordinal; e[j - 1].flag_private |= e[i].flag_private; @@ -413,6 +677,7 @@ process_def_file (abfd, info) for (i = 0; i < NE; i++) { char *name = (char *) xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2); + if (pe_details->underscored) { *name = '_'; @@ -473,11 +738,7 @@ process_def_file (abfd, info) } } -/************************************************************************ - - Build the bfd that will contain .edata and .reloc sections - - ************************************************************************/ +/* Build the bfd that will contain .edata and .reloc sections. */ static void build_filler_bfd (include_edata) @@ -526,16 +787,13 @@ build_filler_bfd (include_edata) einfo ("%X%P: can not create .reloc section: %E\n"); return; } + bfd_set_section_size (filler_bfd, reloc_s, 0); ldlang_add_file (filler_file); } -/************************************************************************ - - Gather all the exported symbols and build the .edata section - - ************************************************************************/ +/* Gather all the exported symbols and build the .edata section. */ static void generate_edata (abfd, info) @@ -548,19 +806,15 @@ generate_edata (abfd, info) /* First, we need to know how many exported symbols there are, and what the range of ordinals is. */ - if (pe_def_file->name) - { - dll_name = pe_def_file->name; - } + dll_name = pe_def_file->name; else { dll_name = abfd->filename; + for (dlnp = dll_name; *dlnp; dlnp++) - { - if (*dlnp == '\\' || *dlnp == '/' || *dlnp == ':') - dll_name = dlnp + 1; - } + if (*dlnp == '\\' || *dlnp == '/' || *dlnp == ':') + dll_name = dlnp + 1; } if (count_with_ordinals && max_ordinal > count_exported) @@ -573,8 +827,8 @@ generate_edata (abfd, info) min_ordinal = 1; max_ordinal = count_exported; } - export_table_size = max_ordinal - min_ordinal + 1; + export_table_size = max_ordinal - min_ordinal + 1; exported_symbols = (int *) xmalloc (export_table_size * sizeof (int)); for (i = 0; i < export_table_size; i++) exported_symbols[i] = -1; @@ -588,6 +842,7 @@ generate_edata (abfd, info) { int ei = pe_def_file->exports[i].ordinal - min_ordinal; int pi = exported_symbols[ei]; + if (pi != -1) { /* xgettext:c-format */ @@ -608,15 +863,15 @@ generate_edata (abfd, info) if (pe_def_file->exports[i].ordinal == -1) { while (exported_symbols[next_ordinal - min_ordinal] != -1) - next_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 */ - + 4 * export_table_size /* addresses */ + edata_sz = (40 /* directory */ + + 4 * export_table_size /* addresses */ + 4 * count_exported_byname /* name ptrs */ + 2 * count_exported_byname /* ordinals */ + name_table_size + strlen (dll_name) + 1); @@ -636,6 +891,7 @@ fill_exported_offsets (abfd, info) for (i = 0; i < pe_def_file->num_exports; i++) { char *name = (char *) xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2); + if (pe_details->underscored) { *name = '_'; @@ -649,9 +905,8 @@ fill_exported_offsets (abfd, info) false, false, true); if (blhe && (blhe->type == bfd_link_hash_defined)) - { - exported_symbol_offsets[i] = blhe->u.def.value; - } + exported_symbol_offsets[i] = blhe->u.def.value; + free (name); } } @@ -689,6 +944,7 @@ fill_edata (abfd, info) bfd_put_16 (abfd, pe_def_file->version_major, edata_d + 8); bfd_put_16 (abfd, pe_def_file->version_minor, edata_d + 10); } + bfd_put_32 (abfd, ERVA (enamestr), edata_d + 12); strcpy (enamestr, dll_name); enamestr += strlen (enamestr) + 1; @@ -706,6 +962,7 @@ fill_edata (abfd, info) for (i = 0; i < export_table_size; i++) { int s = exported_symbols[i]; + if (s != -1) { struct sec *ssec = exported_symbol_sections[s]; @@ -716,6 +973,7 @@ fill_edata (abfd, info) bfd_put_32 (abfd, srva - image_base, (void *) (eaddresses + ord - min_ordinal)); + if (!pe_def_file->exports[s].flag_noname) { char *ename = pe_def_file->exports[s].name; @@ -731,11 +989,62 @@ fill_edata (abfd, info) } } -/************************************************************************ - Gather all the relocations and build the .reloc section +static struct sec *current_sec; + +void +pe_walk_relocs_of_symbol (info, name, cb) + struct bfd_link_info *info; + const char *name; + int (*cb) (arelent *, asection *); +{ + bfd *b; + asection *s; + + for (b = info->input_bfds; b; b = b->link_next) + { + asymbol **symbols; + int nsyms, symsize; + + symsize = bfd_get_symtab_upper_bound (b); + symbols = (asymbol **) xmalloc (symsize); + nsyms = bfd_canonicalize_symtab (b, symbols); + + for (s = b->sections; s; s = s->next) + { + arelent **relocs; + int relsize, nrelocs, i; + int flags = bfd_get_section_flags (b, s); + + /* Skip discarded linkonce sections. */ + if (flags & SEC_LINK_ONCE + && s->output_section == bfd_abs_section_ptr) + continue; + + current_sec = s; + + relsize = bfd_get_reloc_upper_bound (b, s); + relocs = (arelent **) xmalloc ((size_t) relsize); + nrelocs = bfd_canonicalize_reloc (b, s, relocs, symbols); + + for (i = 0; i < nrelocs; i++) + { + struct symbol_cache_entry *sym = *relocs[i]->sym_ptr_ptr; + + if (!strcmp (name, sym->name)) + cb (relocs[i], s); + } + + free (relocs); + + /* Warning: the allocated symbols are remembered in BFD and reused + later, so don't free them! */ + /* free (symbols); */ + } + } +} - ************************************************************************/ +/* Gather all the relocations and build the .reloc section. */ static void generate_reloc (abfd, info) @@ -758,7 +1067,8 @@ generate_reloc (abfd, info) for (s = b->sections; s; s = s->next) total_relocs += s->reloc_count; - reloc_data = (reloc_data_type *) xmalloc (total_relocs * sizeof (reloc_data_type)); + reloc_data = + (reloc_data_type *) xmalloc (total_relocs * sizeof (reloc_data_type)); total_relocs = 0; bi = 0; @@ -801,11 +1111,17 @@ generate_reloc (abfd, info) for (i = 0; i < nrelocs; i++) { + if (pe_dll_extra_pe_debug) + { + struct symbol_cache_entry *sym = *relocs[i]->sym_ptr_ptr; + printf("rel: %s\n",sym->name); + } if (!relocs[i]->howto->pc_relative && relocs[i]->howto->type != pe_details->imagebase_reloc) { bfd_vma sym_vma; struct symbol_cache_entry *sym = *relocs[i]->sym_ptr_ptr; + sym_vma = (relocs[i]->addend + sym->value + sym->section->vma @@ -859,7 +1175,6 @@ generate_reloc (abfd, info) /* At this point, we have total_relocs relocation addresses in reloc_addresses, which are all suitable for the .reloc section. We must now create the new sections. */ - qsort (reloc_data, total_relocs, sizeof (*reloc_data), reloc_sort); for (i = 0; i < total_relocs; i++) @@ -868,7 +1183,7 @@ generate_reloc (abfd, info) if (this_page != sec_page) { - reloc_sz = (reloc_sz + 3) & ~3; /* 4-byte align */ + reloc_sz = (reloc_sz + 3) & ~3; /* 4-byte align. */ reloc_sz += 8; sec_page = this_page; } @@ -878,54 +1193,59 @@ generate_reloc (abfd, info) if (reloc_data[i].type == 4) reloc_sz += 2; } - reloc_sz = (reloc_sz + 3) & ~3; /* 4-byte align */ - + + reloc_sz = (reloc_sz + 3) & ~3; /* 4-byte align. */ reloc_d = (unsigned char *) xmalloc (reloc_sz); - sec_page = (unsigned long) (-1); reloc_sz = 0; page_ptr = (unsigned long) (-1); page_count = 0; + for (i = 0; i < total_relocs; i++) { unsigned long rva = reloc_data[i].vma - image_base; unsigned long this_page = (rva & ~0xfff); + if (this_page != sec_page) { while (reloc_sz & 3) reloc_d[reloc_sz++] = 0; + if (page_ptr != (unsigned long) (-1)) bfd_put_32 (abfd, reloc_sz - page_ptr, reloc_d + page_ptr + 4); + bfd_put_32 (abfd, this_page, reloc_d + reloc_sz); page_ptr = reloc_sz; reloc_sz += 8; sec_page = this_page; page_count = 0; } + bfd_put_16 (abfd, (rva & 0xfff) + (reloc_data[i].type << 12), reloc_d + reloc_sz); reloc_sz += 2; + if (reloc_data[i].type == 4) { bfd_put_16 (abfd, reloc_data[i].extra, reloc_d + reloc_sz); reloc_sz += 2; } + page_count++; } + while (reloc_sz & 3) reloc_d[reloc_sz++] = 0; + 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) reloc_d[reloc_sz++] = 0; } -/************************************************************************ - - Given the exiting def_file structure, print out a .DEF file that - corresponds to it. - - ************************************************************************/ +/* Given the exiting def_file structure, print out a .DEF file that + corresponds to it. */ static void quoteput (s, f, needs_quotes) @@ -934,24 +1254,29 @@ quoteput (s, f, needs_quotes) int needs_quotes; { char *cp; + for (cp = s; *cp; cp++) if (*cp == '\'' || *cp == '"' || *cp == '\\' - || isspace ((unsigned char) *cp) + || ISSPACE (*cp) || *cp == ',' || *cp == ';') needs_quotes = 1; + if (needs_quotes) { putc ('"', f); + while (*s) { if (*s == '"' || *s == '\\') putc ('\\', f); + putc (*s, f); s++; } + putc ('"', f); } else @@ -964,12 +1289,11 @@ pe_dll_generate_def_file (pe_out_def_filename) { int i; FILE *out = fopen (pe_out_def_filename, "w"); + if (out == NULL) - { - /* xgettext:c-format */ - einfo (_("%s: Can't open output def file %s\n"), - program_name, pe_out_def_filename); - } + /* xgettext:c-format */ + einfo (_("%s: Can't open output def file %s\n"), + program_name, pe_out_def_filename); if (pe_def_file) { @@ -979,7 +1303,9 @@ pe_dll_generate_def_file (pe_out_def_filename) fprintf (out, "LIBRARY "); else fprintf (out, "NAME "); + quoteput (pe_def_file->name, out, 1); + if (pe_data (output_bfd)->pe_opthdr.ImageBase) fprintf (out, " BASE=0x%lx", (unsigned long) pe_data (output_bfd)->pe_opthdr.ImageBase); @@ -1007,6 +1333,7 @@ pe_dll_generate_def_file (pe_out_def_filename) pe_def_file->stack_reserve, pe_def_file->stack_commit); else if (pe_def_file->stack_reserve != -1) fprintf (out, "STACKSIZE 0x%x\n", pe_def_file->stack_reserve); + if (pe_def_file->heap_commit != -1) fprintf (out, "HEAPSIZE 0x%x,0x%x\n", pe_def_file->heap_reserve, pe_def_file->heap_commit); @@ -1016,48 +1343,62 @@ pe_dll_generate_def_file (pe_out_def_filename) if (pe_def_file->num_section_defs > 0) { fprintf (out, "\nSECTIONS\n\n"); + for (i = 0; i < pe_def_file->num_section_defs; i++) { fprintf (out, " "); quoteput (pe_def_file->section_defs[i].name, out, 0); + if (pe_def_file->section_defs[i].class) { fprintf (out, " CLASS "); quoteput (pe_def_file->section_defs[i].class, out, 0); } + if (pe_def_file->section_defs[i].flag_read) fprintf (out, " READ"); + if (pe_def_file->section_defs[i].flag_write) fprintf (out, " WRITE"); + if (pe_def_file->section_defs[i].flag_execute) fprintf (out, " EXECUTE"); + if (pe_def_file->section_defs[i].flag_shared) fprintf (out, " SHARED"); + fprintf (out, "\n"); } } if (pe_def_file->num_exports > 0) { - fprintf (out, "\nEXPORTS\n\n"); + fprintf (out, "EXPORTS\n"); + for (i = 0; i < pe_def_file->num_exports; i++) { def_file_export *e = pe_def_file->exports + i; fprintf (out, " "); quoteput (e->name, out, 0); + if (e->internal_name && strcmp (e->internal_name, e->name)) { fprintf (out, " = "); quoteput (e->internal_name, out, 0); } + if (e->ordinal != -1) fprintf (out, " @%d", e->ordinal); + if (e->flag_private) fprintf (out, " PRIVATE"); + if (e->flag_constant) fprintf (out, " CONSTANT"); + if (e->flag_noname) fprintf (out, " NONAME"); + if (e->flag_data) fprintf (out, " DATA"); @@ -1068,22 +1409,27 @@ pe_dll_generate_def_file (pe_out_def_filename) if (pe_def_file->num_imports > 0) { fprintf (out, "\nIMPORTS\n\n"); + for (i = 0; i < pe_def_file->num_imports; i++) { def_file_import *im = pe_def_file->imports + i; fprintf (out, " "); + if (im->internal_name && (!im->name || strcmp (im->internal_name, im->name))) { quoteput (im->internal_name, out, 0); fprintf (out, " = "); } + quoteput (im->module->name, out, 0); fprintf (out, "."); + if (im->name) quoteput (im->name, out, 0); else fprintf (out, "%d", im->ordinal); + fprintf (out, "\n"); } } @@ -1092,17 +1438,11 @@ pe_dll_generate_def_file (pe_out_def_filename) fprintf (out, _("; no contents available\n")); if (fclose (out) == EOF) - { - /* xgettext:c-format */ - einfo (_("%P: Error closing file `%s'\n"), pe_out_def_filename); - } + /* xgettext:c-format */ + einfo (_("%P: Error closing file `%s'\n"), pe_out_def_filename); } -/************************************************************************ - - Generate the import library - - ************************************************************************/ +/* Generate the import library. */ static asymbol **symtab; static int symptr; @@ -1141,15 +1481,16 @@ quick_section (abfd, name, flags, align) static void quick_symbol (abfd, n1, n2, n3, sec, flags, addr) bfd *abfd; - char *n1; - char *n2; - char *n3; + const char *n1; + const char *n2; + const char *n3; asection *sec; int flags; int addr; { asymbol *sym; char *name = (char *) xmalloc (strlen (n1) + strlen (n2) + strlen (n3) + 1); + strcpy (name, n1); strcat (name, n2); strcat (name, n3); @@ -1190,6 +1531,7 @@ static void save_relocs (asection *sec) { int i; + sec->relocation = reltab; sec->reloc_count = relcount; sec->orelocation = (arelent **) xmalloc ((relcount + 1) * sizeof (arelent *)); @@ -1201,24 +1543,22 @@ save_relocs (asection *sec) relcount = relsize = 0; } -/* - * .section .idata$2 - * .global __head_my_dll - * __head_my_dll: - * .rva hname - * .long 0 - * .long 0 - * .rva __my_dll_iname - * .rva fthunk - * - * .section .idata$5 - * .long 0 - * fthunk: - * - * .section .idata$4 - * .long 0 - * hname: - */ +/* .section .idata$2 + .global __head_my_dll + __head_my_dll: + .rva hname + .long 0 + .long 0 + .rva __my_dll_iname + .rva fthunk + + .section .idata$5 + .long 0 + fthunk: + + .section .idata$4 + .long 0 + hname: */ static bfd * make_head (parent) @@ -1258,7 +1598,7 @@ make_head (parent) d2 = (unsigned char *) xmalloc (20); id2->contents = d2; memset (d2, 0, 20); - d2[0] = d2[16] = 4; /* reloc addend */ + d2[0] = d2[16] = 4; /* Reloc addend. */ quick_reloc (abfd, 0, BFD_RELOC_RVA, 2); quick_reloc (abfd, 12, BFD_RELOC_RVA, 4); quick_reloc (abfd, 16, BFD_RELOC_RVA, 1); @@ -1284,16 +1624,14 @@ make_head (parent) return abfd; } -/* - * .section .idata$4 - * .long 0 - * .section .idata$5 - * .long 0 - * .section idata$7 - * .global __my_dll_iname - *__my_dll_iname: - * .asciz "my.dll" - */ +/* .section .idata$4 + .long 0 + .section .idata$5 + .long 0 + .section idata$7 + .global __my_dll_iname + __my_dll_iname: + .asciz "my.dll" */ static bfd * make_tail (parent) @@ -1351,55 +1689,52 @@ make_tail (parent) return abfd; } -/* - * .text - * .global _function - * .global ___imp_function - * .global __imp__function - *_function: - * jmp *__imp__function: - * - * .section idata$7 - * .long __head_my_dll - * - * .section .idata$5 - *___imp_function: - *__imp__function: - *iat? - * .section .idata$4 - *iat? - * .section .idata$6 - *ID<ordinal>: - * .short <hint> - * .asciz "function" xlate? (add underscore, kill at) - */ - -static unsigned char jmp_ix86_bytes[] = { +/* .text + .global _function + .global ___imp_function + .global __imp__function + _function: + jmp *__imp__function: + + .section idata$7 + .long __head_my_dll + + .section .idata$5 + ___imp_function: + __imp__function: + iat? + .section .idata$4 + iat? + .section .idata$6 + ID<ordinal>: + .short <hint> + .asciz "function" xlate? (add underscore, kill at) */ + +static unsigned char jmp_ix86_bytes[] = +{ 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90 }; -/* - *_function: - * mov.l ip+8,r0 - * mov.l @r0,r0 - * jmp @r0 - * nop - * .dw __imp_function - */ +/* _function: + mov.l ip+8,r0 + mov.l @r0,r0 + jmp @r0 + nop + .dw __imp_function */ -static unsigned char jmp_sh_bytes[] = { +static unsigned char jmp_sh_bytes[] = +{ 0x01, 0xd0, 0x02, 0x60, 0x2b, 0x40, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00 }; -/* - *_function: - * lui $t0,<high:__imp_function> - * lw $t0,<low:__imp_function> - * jr $t0 - * nop - */ +/* _function: + lui $t0,<high:__imp_function> + lw $t0,<low:__imp_function> + jr $t0 + nop */ -static unsigned char jmp_mips_bytes[] = { +static unsigned char jmp_mips_bytes[] = +{ 0x00, 0x00, 0x08, 0x3c, 0x00, 0x00, 0x08, 0x8d, 0x08, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 }; @@ -1431,6 +1766,8 @@ make_one (exp, parent) jmp_bytes = jmp_mips_bytes; jmp_byte_count = sizeof (jmp_mips_bytes); break; + default: + abort (); } oname = (char *) xmalloc (20); @@ -1445,7 +1782,7 @@ make_one (exp, parent) bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0); symptr = 0; - symtab = (asymbol **) xmalloc (10 * sizeof (asymbol *)); + symtab = (asymbol **) xmalloc (11 * sizeof (asymbol *)); tx = quick_section (abfd, ".text", SEC_CODE|SEC_HAS_CONTENTS, 2); id7 = quick_section (abfd, ".idata$7", SEC_HAS_CONTENTS, 2); id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2); @@ -1455,32 +1792,38 @@ make_one (exp, parent) quick_symbol (abfd, U (""), exp->internal_name, "", tx, BSF_GLOBAL, 0); quick_symbol (abfd, U ("_head_"), dll_symname, "", UNDSEC, BSF_GLOBAL, 0); quick_symbol (abfd, U ("_imp__"), exp->internal_name, "", id5, BSF_GLOBAL, 0); + /* Symbol to reference ord/name of imported + symbol, used to implement auto-import. */ + quick_symbol (abfd, U("_nm__"), exp->internal_name, "", id6, BSF_GLOBAL, 0); if (pe_dll_compat_implib) quick_symbol (abfd, U ("__imp_"), exp->internal_name, "", id5, BSF_GLOBAL, 0); if (! exp->flag_data) - { - bfd_set_section_size (abfd, tx, jmp_byte_count); - td = (unsigned char *) xmalloc (jmp_byte_count); - tx->contents = td; - memcpy (td, jmp_bytes, jmp_byte_count); - switch (pe_details->pe_arch) - { - case PE_ARCH_i386: - quick_reloc (abfd, 2, BFD_RELOC_32, 2); - break; - case PE_ARCH_sh: - quick_reloc (abfd, 8, BFD_RELOC_32, 2); - break; - case PE_ARCH_mips: - quick_reloc (abfd, 0, BFD_RELOC_HI16_S, 2); - quick_reloc (abfd, 0, BFD_RELOC_LO16, 0); /* MIPS_R_PAIR */ - quick_reloc (abfd, 4, BFD_RELOC_LO16, 2); - break; - } - save_relocs (tx); - } + { + bfd_set_section_size (abfd, tx, jmp_byte_count); + td = (unsigned char *) xmalloc (jmp_byte_count); + tx->contents = td; + memcpy (td, jmp_bytes, jmp_byte_count); + + switch (pe_details->pe_arch) + { + case PE_ARCH_i386: + quick_reloc (abfd, 2, BFD_RELOC_32, 2); + break; + case PE_ARCH_sh: + quick_reloc (abfd, 8, BFD_RELOC_32, 2); + break; + case PE_ARCH_mips: + quick_reloc (abfd, 0, BFD_RELOC_HI16_S, 2); + quick_reloc (abfd, 0, BFD_RELOC_LO16, 0); /* MIPS_R_PAIR */ + quick_reloc (abfd, 4, BFD_RELOC_LO16, 2); + break; + default: + abort (); + } + save_relocs (tx); + } bfd_set_section_size (abfd, id7, 4); d7 = (unsigned char *) xmalloc (4); @@ -1493,6 +1836,7 @@ make_one (exp, parent) d5 = (unsigned char *) xmalloc (4); id5->contents = d5; memset (d5, 0, 4); + if (exp->flag_noname) { d5[0] = exp->ordinal; @@ -1509,6 +1853,7 @@ make_one (exp, parent) d4 = (unsigned char *) xmalloc (4); id4->contents = d4; memset (d4, 0, 4); + if (exp->flag_noname) { d4[0] = exp->ordinal; @@ -1553,6 +1898,188 @@ make_one (exp, parent) return abfd; } +static bfd * +make_singleton_name_thunk (import, parent) + const char *import; + bfd *parent; +{ + /* Name thunks go to idata$4. */ + asection *id4; + unsigned char *d4; + char *oname; + bfd *abfd; + + oname = (char *) xmalloc (20); + sprintf (oname, "nmth%06d.o", tmp_seq); + tmp_seq++; + + abfd = bfd_create (oname, parent); + bfd_find_target (pe_details->object_target, abfd); + bfd_make_writable (abfd); + + bfd_set_format (abfd, bfd_object); + bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0); + + symptr = 0; + symtab = (asymbol **) xmalloc (3 * sizeof (asymbol *)); + id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2); + quick_symbol (abfd, U ("_nm_thnk_"), import, "", id4, BSF_GLOBAL, 0); + quick_symbol (abfd, U ("_nm_"), import, "", UNDSEC, BSF_GLOBAL, 0); + + bfd_set_section_size (abfd, id4, 8); + d4 = (unsigned char *) xmalloc (4); + id4->contents = d4; + memset (d4, 0, 8); + quick_reloc (abfd, 0, BFD_RELOC_RVA, 2); + save_relocs (id4); + + bfd_set_symtab (abfd, symtab, symptr); + + bfd_set_section_contents (abfd, id4, d4, 0, 8); + + bfd_make_readable (abfd); + return abfd; +} + +static char * +make_import_fixup_mark (rel) + arelent *rel; +{ + /* We convert reloc to symbol, for later reference. */ + static int counter; + static char *fixup_name = NULL; + static size_t buffer_len = 0; + + struct symbol_cache_entry *sym = *rel->sym_ptr_ptr; + + bfd *abfd = bfd_asymbol_bfd (sym); + struct coff_link_hash_entry *myh = NULL; + + if (!fixup_name) + { + fixup_name = (char *) xmalloc (384); + buffer_len = 384; + } + + if (strlen (sym->name) + 25 > buffer_len) + /* Assume 25 chars for "__fu" + counter + "_". If counter is + bigger than 20 digits long, we've got worse problems than + overflowing this buffer... */ + { + free (fixup_name); + /* New buffer size is length of symbol, plus 25, but then + rounded up to the nearest multiple of 128. */ + buffer_len = ((strlen (sym->name) + 25) + 127) & ~127; + fixup_name = (char *) xmalloc (buffer_len); + } + + sprintf (fixup_name, "__fu%d_%s", counter++, sym->name); + + bfd_coff_link_add_one_symbol (&link_info, abfd, fixup_name, BSF_GLOBAL, + current_sec, /* sym->section, */ + rel->address, NULL, true, false, + (struct bfd_link_hash_entry **) &myh); + +#if 0 + printf ("type:%d\n", myh->type); + printf ("%s\n", myh->root.u.def.section->name); +#endif + return fixup_name; +} + +/* .section .idata$3 + .rva __nm_thnk_SYM (singleton thunk with name of func) + .long 0 + .long 0 + .rva __my_dll_iname (name of dll) + .rva __fuNN_SYM (pointer to reference (address) in text) */ + +static bfd * +make_import_fixup_entry (name, fixup_name, dll_symname,parent) + const char *name; + const char *fixup_name; + const char *dll_symname; + bfd *parent; +{ + asection *id3; + unsigned char *d3; + char *oname; + bfd *abfd; + + oname = (char *) xmalloc (20); + sprintf (oname, "fu%06d.o", tmp_seq); + tmp_seq++; + + abfd = bfd_create (oname, parent); + bfd_find_target (pe_details->object_target, abfd); + bfd_make_writable (abfd); + + bfd_set_format (abfd, bfd_object); + bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0); + + symptr = 0; + symtab = (asymbol **) 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); + + bfd_set_section_size (abfd, id3, 20); + d3 = (unsigned char *) xmalloc (20); + id3->contents = d3; + memset (d3, 0, 20); + + quick_reloc (abfd, 0, BFD_RELOC_RVA, 1); + quick_reloc (abfd, 12, BFD_RELOC_RVA, 2); + quick_reloc (abfd, 16, BFD_RELOC_RVA, 3); + save_relocs (id3); + + bfd_set_symtab (abfd, symtab, symptr); + + bfd_set_section_contents (abfd, id3, d3, 0, 20); + + bfd_make_readable (abfd); + return abfd; +} + +void +pe_create_import_fixup (rel) + arelent *rel; +{ + char buf[300]; + struct symbol_cache_entry *sym = *rel->sym_ptr_ptr; + struct bfd_link_hash_entry *name_thunk_sym; + const char *name = sym->name; + char *fixup_name = make_import_fixup_mark (rel); + + sprintf (buf, U ("_nm_thnk_%s"), name); + + name_thunk_sym = bfd_link_hash_lookup (link_info.hash, buf, 0, 0, 1); + + if (!name_thunk_sym || name_thunk_sym->type != bfd_link_hash_defined) + { + bfd *b = make_singleton_name_thunk (name, output_bfd); + add_bfd_to_link (b, b->filename, &link_info); + + /* If we ever use autoimport, we have to cast text section writable. */ + config.text_read_only = false; + } + + { + extern char * pe_data_import_dll; + char * dll_symname = pe_data_import_dll ? pe_data_import_dll : "unknown"; + + bfd *b = make_import_fixup_entry (name, fixup_name, dll_symname, + output_bfd); + add_bfd_to_link (b, b->filename, &link_info); + } +} + + void pe_dll_generate_implib (def, impfilename) def_file *def; @@ -1567,7 +2094,7 @@ pe_dll_generate_implib (def, impfilename) dll_filename = (def->name) ? def->name : dll_name; dll_symname = xstrdup (dll_filename); for (i = 0; dll_symname[i]; i++) - if (!isalnum ((unsigned char) dll_symname[i])) + if (!ISALNUM (dll_symname[i])) dll_symname[i] = '_'; unlink (impfilename); @@ -1588,7 +2115,6 @@ pe_dll_generate_implib (def, impfilename) outarch->has_armap = 1; /* Work out a reasonable size of things to put onto one line. */ - ar_head = make_head (outarch); for (i = 0; i < def->num_exports; i++) @@ -1596,6 +2122,7 @@ pe_dll_generate_implib (def, impfilename) /* The import library doesn't know about the internal name. */ char *internal = def->exports[i].internal_name; bfd *n; + def->exports[i].internal_name = def->exports[i].name; n = make_one (def->exports + i, outarch); n->next = head; @@ -1609,7 +2136,6 @@ pe_dll_generate_implib (def, impfilename) return; /* Now stick them all into the archive. */ - ar_head->next = head; ar_tail->next = ar_head; head = ar_tail; @@ -1631,15 +2157,17 @@ pe_dll_generate_implib (def, impfilename) static void add_bfd_to_link (abfd, name, link_info) bfd *abfd; - char *name; + const char *name; struct bfd_link_info *link_info; { lang_input_statement_type *fake_file; + fake_file = lang_add_input_file (name, lang_input_file_is_fake_enum, NULL); fake_file->the_bfd = abfd; ldlang_add_file (fake_file); + if (!bfd_link_add_symbols (abfd, link_info)) einfo ("%Xaddsym %s: %s\n", name, bfd_errmsg (bfd_get_error ())); } @@ -1650,6 +2178,7 @@ pe_process_import_defs (output_bfd, link_info) struct bfd_link_info *link_info; { def_file_module *module; + pe_dll_id_target (bfd_get_target (output_bfd)); if (!pe_def_file) @@ -1662,7 +2191,7 @@ pe_process_import_defs (output_bfd, link_info) dll_filename = module->name; dll_symname = xstrdup (module->name); for (i = 0; dll_symname[i]; i++) - if (!isalnum (dll_symname[i])) + if (!ISALNUM (dll_symname[i])) dll_symname[i] = '_'; do_this_dll = 0; @@ -1718,13 +2247,9 @@ pe_process_import_defs (output_bfd, link_info) } } -/************************************************************************ - - We were handed a *.DLL file. Parse it and turn it into a set of - IMPORTS directives in the def file. Return true if the file was - handled, false if not. - - ************************************************************************/ +/* We were handed a *.DLL file. Parse it and turn it into a set of + IMPORTS directives in the def file. Return true if the file was + handled, false if not. */ static unsigned int pe_get16 (abfd, where) @@ -1732,8 +2257,9 @@ pe_get16 (abfd, where) int where; { unsigned char b[2]; - bfd_seek (abfd, where, SEEK_SET); - bfd_read (b, 1, 2, abfd); + + bfd_seek (abfd, (file_ptr) where, SEEK_SET); + bfd_bread (b, (bfd_size_type) 2, abfd); return b[0] + (b[1] << 8); } @@ -1743,8 +2269,9 @@ pe_get32 (abfd, where) int where; { unsigned char b[4]; - bfd_seek (abfd, where, SEEK_SET); - bfd_read (b, 1, 4, abfd); + + bfd_seek (abfd, (file_ptr) where, SEEK_SET); + bfd_bread (b, (bfd_size_type) 4, abfd); return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24); } @@ -1755,6 +2282,7 @@ pe_as16 (ptr) void *ptr; { unsigned char *b = ptr; + return b[0] + (b[1] << 8); } @@ -1765,6 +2293,7 @@ pe_as32 (ptr) void *ptr; { unsigned char *b = ptr; + return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24); } @@ -1781,13 +2310,13 @@ pe_implied_import_dll (filename) /* No, I can't use bfd here. kernel32.dll puts its export table in the middle of the .rdata section. */ - dll = bfd_openr (filename, pe_details->target_name); if (!dll) { einfo ("%Xopen %s: %s\n", filename, bfd_errmsg (bfd_get_error ())); return false; } + /* PEI dlls seem to be bfd_objects. */ if (!bfd_check_format (dll, bfd_object)) { @@ -1803,14 +2332,17 @@ pe_implied_import_dll (filename) pe_header_offset = pe_get32 (dll, 0x3c); opthdr_ofs = pe_header_offset + 4 + 20; num_entries = pe_get32 (dll, opthdr_ofs + 92); - if (num_entries < 1) /* no exports */ + + if (num_entries < 1) /* No exports. */ return false; + export_rva = pe_get32 (dll, opthdr_ofs + 96); export_size = pe_get32 (dll, opthdr_ofs + 100); nsections = pe_get16 (dll, pe_header_offset + 4 + 2); secptr = (pe_header_offset + 4 + 20 + pe_get16 (dll, pe_header_offset + 4 + 16)); expptr = 0; + for (i = 0; i < nsections; i++) { char sname[8]; @@ -1818,8 +2350,10 @@ pe_implied_import_dll (filename) unsigned long vaddr = pe_get32 (dll, secptr1 + 12); unsigned long vsize = pe_get32 (dll, secptr1 + 16); unsigned long fptr = pe_get32 (dll, secptr1 + 20); - bfd_seek (dll, secptr1, SEEK_SET); - bfd_read (sname, 1, 8, dll); + + bfd_seek (dll, (file_ptr) secptr1, SEEK_SET); + bfd_bread (sname, (bfd_size_type) 8, dll); + if (vaddr <= export_rva && vaddr + vsize > export_rva) { expptr = fptr + (export_rva - vaddr); @@ -1830,8 +2364,8 @@ pe_implied_import_dll (filename) } expdata = (unsigned char *) xmalloc (export_size); - bfd_seek (dll, expptr, SEEK_SET); - bfd_read (expdata, 1, export_size, dll); + bfd_seek (dll, (file_ptr) expptr, SEEK_SET); + bfd_bread (expdata, (bfd_size_type) export_size, dll); erva = expdata - export_rva; if (pe_def_file == 0) @@ -1841,10 +2375,12 @@ pe_implied_import_dll (filename) name_rvas = pe_as32 (expdata + 32); ordinals = pe_as32 (expdata + 36); ordbase = pe_as32 (expdata + 16); + for (i = 0; i < nexp; i++) { unsigned long name_rva = pe_as32 (erva + name_rvas + i * 4); def_file_import *imp; + imp = def_file_add_import (pe_def_file, erva + name_rva, dll_name, i, 0); } @@ -1852,14 +2388,10 @@ pe_implied_import_dll (filename) return true; } -/************************************************************************ - - These are the main functions, called from the emulation. The first - is called after the bfds are read, so we can guess at how much space - we need. The second is called after everything is placed, so we - can put the right values in place. - - ************************************************************************/ +/* These are the main functions, called from the emulation. The first + is called after the bfds are read, so we can guess at how much space + we need. The second is called after everything is placed, so we + can put the right values in place. */ void pe_dll_build_sections (abfd, info) @@ -1897,7 +2429,7 @@ pe_dll_fill_sections (abfd, info) /* Resize the sections. */ lang_size_sections (stat_ptr->head, abs_output_section, - &stat_ptr->head, 0, (bfd_vma) 0, false); + &stat_ptr->head, 0, (bfd_vma) 0, NULL); /* Redo special stuff. */ ldemul_after_allocation (); @@ -1931,7 +2463,7 @@ pe_exe_fill_sections (abfd, info) /* Resize the sections. */ lang_size_sections (stat_ptr->head, abs_output_section, - &stat_ptr->head, 0, (bfd_vma) 0, false); + &stat_ptr->head, 0, (bfd_vma) 0, NULL); /* Redo special stuff. */ ldemul_after_allocation (); diff --git a/contrib/binutils/ld/pe-dll.h b/contrib/binutils/ld/pe-dll.h index b1b5602..f5e9324 100644 --- a/contrib/binutils/ld/pe-dll.h +++ b/contrib/binutils/ld/pe-dll.h @@ -33,6 +33,7 @@ extern int pe_dll_kill_ats; extern int pe_dll_stdcall_aliases; extern int pe_dll_warn_dup_exports; extern int pe_dll_compat_implib; +extern int pe_dll_extra_pe_debug; extern void pe_dll_id_target PARAMS ((const char *)); extern void pe_dll_add_excludes PARAMS ((const char *)); @@ -45,4 +46,9 @@ extern void pe_exe_build_sections PARAMS ((bfd *, struct bfd_link_info *)); extern void pe_dll_fill_sections PARAMS ((bfd *, struct bfd_link_info *)); extern void pe_exe_fill_sections PARAMS ((bfd *, struct bfd_link_info *)); +extern void pe_walk_relocs_of_symbol PARAMS ((struct bfd_link_info * info, + CONST char *name, + int (*cb) (arelent *, asection *))); + +extern void pe_create_import_fixup PARAMS ((arelent * rel)); #endif /* PE_DLL_H */ diff --git a/contrib/binutils/ld/po/ld.pot b/contrib/binutils/ld/po/ld.pot index 584dca5..bff203ff 100644 --- a/contrib/binutils/ld/po/ld.pot +++ b/contrib/binutils/ld/po/ld.pot @@ -6,252 +6,273 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-12-26 12:54-0800\n" +"POT-Creation-Date: 2002-01-17 13:58+0000\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" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: ENCODING\n" +"Content-Transfer-Encoding: 8bit\n" -#: emultempl/armcoff.em:70 +#: emultempl/armcoff.em:71 msgid " --support-old-code Support interworking with old code\n" msgstr "" -#: emultempl/armcoff.em:71 +#: emultempl/armcoff.em:72 msgid " --thumb-entry=<sym> Set the entry point to be Thumb symbol <sym>\n" msgstr "" -#: emultempl/armcoff.em:140 +#: emultempl/armcoff.em:141 #, c-format msgid "Errors encountered processing file %s" msgstr "" -#: emultempl/armcoff.em:206 emultempl/pe.em:1211 +#: emultempl/armcoff.em:207 emultempl/pe.em:1414 msgid "%P: warning: '--thumb-entry %s' is overriding '-e %s'\n" msgstr "" -#: emultempl/armcoff.em:211 emultempl/pe.em:1216 +#: emultempl/armcoff.em:212 emultempl/pe.em:1419 msgid "%P: warning: connot find thumb start symbol %s\n" msgstr "" -#: emultempl/pe.em:266 +#: emultempl/pe.em:315 msgid "" " --base_file <basefile> Generate a base file for relocatable " "DLLs\n" msgstr "" -#: emultempl/pe.em:267 +#: emultempl/pe.em:316 msgid "" " --dll Set image base to the default for DLLs\n" msgstr "" -#: emultempl/pe.em:268 +#: emultempl/pe.em:317 msgid " --file-alignment <size> Set file alignment\n" msgstr "" -#: emultempl/pe.em:269 +#: emultempl/pe.em:318 msgid " --heap <size> Set initial size of the heap\n" msgstr "" -#: emultempl/pe.em:270 +#: emultempl/pe.em:319 msgid "" " --image-base <address> Set start address of the executable\n" msgstr "" -#: emultempl/pe.em:271 +#: emultempl/pe.em:320 msgid "" " --major-image-version <number> Set version number of the executable\n" msgstr "" -#: emultempl/pe.em:272 +#: emultempl/pe.em:321 msgid " --major-os-version <number> Set minimum required OS version\n" msgstr "" -#: emultempl/pe.em:273 +#: emultempl/pe.em:322 msgid "" " --major-subsystem-version <number> Set minimum required OS subsystem " "version\n" msgstr "" -#: emultempl/pe.em:274 +#: emultempl/pe.em:323 msgid "" " --minor-image-version <number> Set revision number of the executable\n" msgstr "" -#: emultempl/pe.em:275 +#: emultempl/pe.em:324 msgid " --minor-os-version <number> Set minimum required OS revision\n" msgstr "" -#: emultempl/pe.em:276 +#: emultempl/pe.em:325 msgid "" " --minor-subsystem-version <number> Set minimum required OS subsystem " "revision\n" msgstr "" -#: emultempl/pe.em:277 +#: emultempl/pe.em:326 msgid " --section-alignment <size> Set section alignment\n" msgstr "" -#: emultempl/pe.em:278 +#: emultempl/pe.em:327 msgid " --stack <size> Set size of the initial stack\n" msgstr "" -#: emultempl/pe.em:279 +#: emultempl/pe.em:328 msgid "" " --subsystem <name>[:<version>] Set required OS subsystem [& version]\n" msgstr "" -#: emultempl/pe.em:280 +#: emultempl/pe.em:329 msgid "" " --support-old-code Support interworking with old code\n" msgstr "" -#: emultempl/pe.em:281 +#: emultempl/pe.em:330 msgid "" " --thumb-entry=<symbol> Set the entry point to be Thumb " "<symbol>\n" msgstr "" -#: emultempl/pe.em:283 +#: emultempl/pe.em:332 msgid "" " --add-stdcall-alias Export symbols with and without @nn\n" msgstr "" -#: emultempl/pe.em:284 +#: emultempl/pe.em:333 msgid " --disable-stdcall-fixup Don't link _sym to _sym@nn\n" msgstr "" -#: emultempl/pe.em:285 +#: emultempl/pe.em:334 msgid "" " --enable-stdcall-fixup Link _sym to _sym@nn without warnings\n" msgstr "" -#: emultempl/pe.em:286 +#: emultempl/pe.em:335 msgid "" " --exclude-symbols sym,sym,... Exclude symbols from automatic export\n" msgstr "" -#: emultempl/pe.em:287 +#: emultempl/pe.em:336 msgid "" " --export-all-symbols Automatically export all globals to " "DLL\n" msgstr "" -#: emultempl/pe.em:288 +#: emultempl/pe.em:337 msgid " --kill-at Remove @nn from exported symbols\n" msgstr "" -#: emultempl/pe.em:289 +#: emultempl/pe.em:338 msgid " --out-implib <file> Generate import library\n" msgstr "" -#: emultempl/pe.em:290 +#: emultempl/pe.em:339 msgid "" " --output-def <file> Generate a .DEF file for the built DLL\n" msgstr "" -#: emultempl/pe.em:291 +#: emultempl/pe.em:340 msgid " --warn-duplicate-exports Warn about duplicate exports.\n" msgstr "" -#: emultempl/pe.em:292 +#: emultempl/pe.em:341 msgid "" " --compat-implib Create backward compatible import " "libs;\n" +" create __imp_<SYMBOL> as well.\n" msgstr "" -#: emultempl/pe.em:293 -msgid " create __imp_<SYMBOL> as well.\n" -msgstr "" - -#: emultempl/pe.em:294 +#: emultempl/pe.em:343 msgid "" " --enable-auto-image-base Automatically choose image base for " "DLLs\n" +" unless user specifies one\n" msgstr "" -#: emultempl/pe.em:295 -msgid " unless user specifies one\n" -msgstr "" - -#: emultempl/pe.em:296 +#: emultempl/pe.em:345 msgid "" " --disable-auto-image-base Do not auto-choose image base. " "(default)\n" msgstr "" -#: emultempl/pe.em:297 +#: emultempl/pe.em:346 msgid "" " --dll-search-prefix=<string> When linking dynamically to a dll " -"witout an\n" +"without an\n" +" importlib, use <string><basename>." +"dll \n" +" in preference to lib<basename>.dll \n" msgstr "" -#: emultempl/pe.em:298 +#: emultempl/pe.em:349 msgid "" -" importlib, use <string><basename>.dll " -"\n" +" --enable-auto-import Do sophistcated linking of _sym to \n" +" __imp_sym for DATA references\n" msgstr "" -#: emultempl/pe.em:299 +#: emultempl/pe.em:351 msgid "" -" in preference to lib<basename>.dll \n" +" --disable-auto-import Do not auto-import DATA items from " +"DLLs\n" msgstr "" -#: emultempl/pe.em:367 +#: emultempl/pe.em:352 +msgid "" +" --enable-extra-pe-debug Enable verbose debug output when " +"building\n" +" or linking to DLLs (esp. auto-" +"import)\n" +msgstr "" + +#: emultempl/pe.em:421 msgid "%P: warning: bad version number in -subsystem option\n" msgstr "" -#: emultempl/pe.em:403 +#: emultempl/pe.em:457 msgid "%P%F: invalid subsystem type %s\n" msgstr "" -#: emultempl/pe.em:418 +#: emultempl/pe.em:472 msgid "%P%F: invalid hex number for PE parameter '%s'\n" msgstr "" -#: emultempl/pe.em:436 +#: emultempl/pe.em:490 msgid "%P%F: strange hex info for PE parameter '%s'\n" msgstr "" -#: emultempl/pe.em:475 +#: emultempl/pe.em:529 #, c-format msgid "%s: Can't open base file %s\n" msgstr "" -#: emultempl/pe.em:668 +#: emultempl/pe.em:731 msgid "%P: warning, file alignment > section alignment.\n" msgstr "" -#: emultempl/pe.em:739 emultempl/pe.em:765 +#: emultempl/pe.em:815 emultempl/pe.em:841 #, c-format msgid "Warning: resolving %s by linking to %s\n" msgstr "" -#: emultempl/pe.em:744 emultempl/pe.em:770 +#: emultempl/pe.em:820 emultempl/pe.em:846 msgid "Use --enable-stdcall-fixup to disable these warnings\n" msgstr "" -#: emultempl/pe.em:745 emultempl/pe.em:771 +#: emultempl/pe.em:821 emultempl/pe.em:847 msgid "Use --disable-stdcall-fixup to disable these fixups\n" msgstr "" -#: emultempl/pe.em:788 +#: emultempl/pe.em:872 +msgid "%C: Cannot get section contents - auto-import exception\n" +msgstr "" + +#: emultempl/pe.em:880 +msgid "" +"%C: variable '%T' can't be auto-imported. Please read the documentation for " +"ld's --enable-auto-import for details.\n" +msgstr "" + +#: emultempl/pe.em:908 +#, c-format +msgid "Warning: resolving %s by linking to %s (auto-import)\n" +msgstr "" + +#: emultempl/pe.em:989 msgid "%F%P: PE operations on non PE file.\n" msgstr "" -#: emultempl/pe.em:1015 +#: emultempl/pe.em:1218 #, c-format msgid "Errors encountered processing file %s\n" msgstr "" -#: emultempl/pe.em:1038 +#: emultempl/pe.em:1241 #, c-format msgid "Errors encountered processing file %s for interworking" msgstr "" -#: emultempl/pe.em:1094 ldlang.c:1981 ldlang.c:4347 ldlang.c:4380 -#: ldmain.c:1016 +#: emultempl/pe.em:1297 ldlang.c:2050 ldlang.c:4441 ldlang.c:4474 +#: ldmain.c:1067 msgid "%P%F: bfd_link_hash_lookup failed: %E\n" msgstr "" @@ -282,19 +303,19 @@ msgstr "" msgid "No symbols\n" msgstr "" -#: ldcref.c:364 +#: ldcref.c:400 msgid "%P: symbol `%T' missing from main hash table\n" msgstr "" -#: ldcref.c:435 +#: ldcref.c:465 msgid "%B%F: could not read symbols; %E\n" msgstr "" -#: ldcref.c:439 ldmain.c:1082 ldmain.c:1086 +#: ldcref.c:469 ldmain.c:1133 ldmain.c:1137 msgid "%B%F: could not read symbols: %E\n" msgstr "" -#: ldcref.c:511 ldcref.c:518 ldmain.c:1132 ldmain.c:1139 +#: ldcref.c:537 ldcref.c:544 ldmain.c:1183 ldmain.c:1190 msgid "%B%F: could not read relocs: %E\n" msgstr "" @@ -302,355 +323,361 @@ 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:536 +#: ldcref.c:563 msgid "%X%C: prohibited cross reference from %s to `%T' in %s\n" msgstr "" -#: ldctor.c:89 +#: ldctor.c:88 msgid "%P%X: Different relocs used in set %s\n" msgstr "" -#: ldctor.c:107 +#: ldctor.c:106 msgid "%P%X: Different object file formats composing set %s\n" msgstr "" -#: ldctor.c:289 ldctor.c:303 +#: ldctor.c:288 ldctor.c:302 msgid "%P%X: %s does not support reloc %s for set %s\n" msgstr "" -#: ldctor.c:324 +#: ldctor.c:323 msgid "%P%X: Unsupported size %d for set %s\n" msgstr "" -#: ldctor.c:345 +#: ldctor.c:344 msgid "" "\n" "Set Symbol\n" "\n" msgstr "" -#: ldemul.c:220 +#: ldemul.c:225 msgid "%S SYSLIB ignored\n" msgstr "" -#: ldemul.c:227 +#: ldemul.c:232 msgid "%S HLL ignored\n" msgstr "" -#: ldemul.c:248 +#: ldemul.c:253 msgid "%P: unrecognised emulation mode: %s\n" msgstr "" -#: ldemul.c:249 +#: ldemul.c:254 msgid "Supported emulations: " msgstr "" -#: ldemul.c:293 +#: ldemul.c:298 msgid " no emulation specific options.\n" msgstr "" -#: ldexp.c:154 +#: ldexp.c:163 msgid "%F%P: %s uses undefined section %s\n" msgstr "" -#: ldexp.c:156 +#: ldexp.c:165 msgid "%F%P: %s forward reference of section %s\n" msgstr "" -#: ldexp.c:268 +#: ldexp.c:277 msgid "%F%S %% by zero\n" msgstr "" -#: ldexp.c:275 +#: ldexp.c:284 msgid "%F%S / by zero\n" msgstr "" -#: ldexp.c:398 +#: ldexp.c:408 msgid "%X%S: unresolvable symbol `%s' referenced in expression\n" msgstr "" -#: ldexp.c:417 +#: ldexp.c:427 msgid "%F%S: undefined symbol `%s' referenced in expression\n" msgstr "" -#: ldexp.c:600 +#: ldexp.c:611 msgid "%F%S can not PROVIDE assignment to location counter\n" msgstr "" -#: ldexp.c:610 +#: ldexp.c:621 msgid "%F%S invalid assignment to location counter\n" msgstr "" -#: ldexp.c:614 +#: ldexp.c:625 msgid "%F%S assignment to location counter invalid outside of SECTION\n" msgstr "" -#: ldexp.c:624 +#: ldexp.c:634 msgid "%F%S cannot move location counter backwards (from %V to %V)\n" msgstr "" -#: ldexp.c:652 +#: ldexp.c:661 msgid "%P%F:%s: hash creation failed\n" msgstr "" -#: ldexp.c:951 +#: ldexp.c:963 msgid "%F%S nonconstant expression for %s\n" msgstr "" -#: ldexp.c:984 +#: ldexp.c:993 msgid "%F%S non constant expression for %s\n" msgstr "" -#: ldfile.c:102 +#: ldfile.c:105 #, c-format msgid "attempt to open %s failed\n" msgstr "" -#: ldfile.c:104 +#: ldfile.c:107 #, c-format msgid "attempt to open %s succeeded\n" msgstr "" -#: ldfile.c:110 +#: ldfile.c:113 msgid "%F%P: invalid BFD target `%s'\n" msgstr "" -#: ldfile.c:134 +#: ldfile.c:137 msgid "%P: skipping incompatible %s when searching for %s\n" msgstr "" -#: ldfile.c:226 +#: ldfile.c:229 msgid "%F%P: cannot open %s for %s: %E\n" msgstr "" -#: ldfile.c:229 +#: ldfile.c:232 msgid "%F%P: cannot open %s: %E\n" msgstr "" -#: ldfile.c:250 +#: ldfile.c:262 msgid "%F%P: cannot find %s\n" msgstr "" -#: ldfile.c:269 ldfile.c:285 +#: ldfile.c:281 ldfile.c:297 #, c-format msgid "cannot find script file %s\n" msgstr "" -#: ldfile.c:271 ldfile.c:287 +#: ldfile.c:283 ldfile.c:299 #, c-format msgid "opened script file %s\n" msgstr "" -#: ldfile.c:336 +#: ldfile.c:348 msgid "%P%F: cannot open linker script file %s: %E\n" msgstr "" -#: ldfile.c:373 +#: ldfile.c:386 msgid "%P%F: unknown architecture: %s\n" msgstr "" -#: ldfile.c:389 +#: ldfile.c:402 msgid "%P%F: target architecture respecified\n" msgstr "" -#: ldfile.c:444 +#: ldfile.c:456 msgid "%P%F: cannot represent machine `%s'\n" msgstr "" -#: ldlang.c:736 +#: ldlang.c:771 msgid "" "\n" "Memory Configuration\n" "\n" msgstr "" -#: ldlang.c:738 +#: ldlang.c:773 msgid "Name" msgstr "" -#: ldlang.c:738 +#: ldlang.c:773 msgid "Origin" msgstr "" -#: ldlang.c:738 +#: ldlang.c:773 msgid "Length" msgstr "" -#: ldlang.c:738 +#: ldlang.c:773 msgid "Attributes" msgstr "" -#: ldlang.c:780 +#: ldlang.c:815 msgid "" "\n" "Linker script and memory map\n" "\n" msgstr "" -#: ldlang.c:797 -msgid "%P%F: Illegal use of `%s' section" +#: ldlang.c:832 +msgid "%P%F: Illegal use of `%s' section\n" msgstr "" -#: ldlang.c:807 +#: ldlang.c:842 msgid "%P%F: output format %s cannot represent section called %s\n" msgstr "" -#: ldlang.c:969 +#: ldlang.c:1004 msgid "%P: %B: warning: ignoring duplicate section `%s'\n" msgstr "" -#: ldlang.c:972 +#: ldlang.c:1007 msgid "%P: %B: warning: ignoring duplicate `%s' section symbol `%s'\n" msgstr "" -#: ldlang.c:986 +#: ldlang.c:1021 msgid "%P: %B: warning: duplicate section `%s' has different size\n" msgstr "" -#: ldlang.c:1037 +#: ldlang.c:1069 msgid "%P%F: Failed to create hash table\n" msgstr "" -#: ldlang.c:1427 +#: ldlang.c:1484 msgid "%B: file not recognized: %E\n" msgstr "" -#: ldlang.c:1428 +#: ldlang.c:1485 msgid "%B: matching formats:" msgstr "" -#: ldlang.c:1435 +#: ldlang.c:1492 msgid "%F%B: file not recognized: %E\n" msgstr "" -#: ldlang.c:1488 -msgid "%F%B: object %B in archive is not object\n" +#: ldlang.c:1548 +msgid "%F%B: member %B in archive is not an object\n" msgstr "" -#: ldlang.c:1494 ldlang.c:1506 +#: ldlang.c:1559 ldlang.c:1573 msgid "%F%B: could not read symbols: %E\n" msgstr "" -#: ldlang.c:1766 +#: ldlang.c:1834 msgid "" "%P: warning: could not find any targets that match endianness requirement\n" msgstr "" -#: ldlang.c:1779 +#: ldlang.c:1847 msgid "%P%F: target %s not found\n" msgstr "" -#: ldlang.c:1781 +#: ldlang.c:1849 msgid "%P%F: cannot open output file %s: %E\n" msgstr "" -#: ldlang.c:1791 +#: ldlang.c:1859 msgid "%P%F:%s: can not make object file: %E\n" msgstr "" -#: ldlang.c:1795 +#: ldlang.c:1863 msgid "%P%F:%s: can not set architecture: %E\n" msgstr "" -#: ldlang.c:1799 +#: ldlang.c:1867 msgid "%P%F: can not create link hash table: %E\n" msgstr "" -#: ldlang.c:2104 +#: ldlang.c:2169 msgid " load address 0x%V" msgstr "" -#: ldlang.c:2234 +#: ldlang.c:2299 msgid "%W (size before relaxing)\n" msgstr "" -#: ldlang.c:2316 +#: ldlang.c:2381 #, c-format msgid "Address of section %s set to " msgstr "" -#: ldlang.c:2465 +#: ldlang.c:2535 #, c-format msgid "Fail with %d\n" msgstr "" -#: ldlang.c:2703 +#: ldlang.c:2777 msgid "%X%P: section %s [%V -> %V] overlaps section %s [%V -> %V]\n" msgstr "" -#: ldlang.c:2737 +#: ldlang.c:2806 msgid "%X%P: address 0x%v of %B section %s is not within region %s\n" msgstr "" -#: ldlang.c:2745 +#: ldlang.c:2814 msgid "%X%P: region %s is full (%B section %s)\n" msgstr "" -#: ldlang.c:2794 +#: ldlang.c:2864 msgid "%P%X: Internal error on COFF shared library section %s\n" msgstr "" -#: ldlang.c:2835 +#: ldlang.c:2906 msgid "%P: warning: no memory region specified for section `%s'\n" msgstr "" -#: ldlang.c:2848 +#: ldlang.c:2921 msgid "%P: warning: changing start of section %s by %u bytes\n" msgstr "" -#: ldlang.c:2862 +#: ldlang.c:2935 msgid "%F%S: non constant address expression for section %s\n" msgstr "" -#: ldlang.c:2927 +#: ldlang.c:2999 msgid "%X%P: use an absolute load address or a load memory region, not both\n" msgstr "" -#: ldlang.c:3043 +#: ldlang.c:3114 msgid "%P%F: can't relax section: %E\n" msgstr "" -#: ldlang.c:3210 +#: ldlang.c:3273 msgid "%F%P: invalid data statement\n" msgstr "" -#: ldlang.c:3247 +#: ldlang.c:3310 msgid "%F%P: invalid reloc statement\n" msgstr "" -#: ldlang.c:3383 +#: ldlang.c:3448 msgid "%P%F:%s: can't set start address\n" msgstr "" -#: ldlang.c:3396 ldlang.c:3413 +#: ldlang.c:3461 ldlang.c:3478 msgid "%P%F: can't set start address\n" msgstr "" -#: ldlang.c:3408 +#: ldlang.c:3473 msgid "%P: warning: cannot find entry symbol %s; defaulting to %V\n" msgstr "" -#: ldlang.c:3418 +#: ldlang.c:3483 msgid "%P: warning: cannot find entry symbol %s; not setting start address\n" msgstr "" -#: ldlang.c:3460 +#: ldlang.c:3525 msgid "" "%P: warning: %s architecture of input file `%B' is incompatible with %s " "output\n" msgstr "" -#: ldlang.c:3478 +#: ldlang.c:3538 +msgid "" +"%P%F: Relocatable linking with relocations from format %s (%B) to format %s " +"(%B) is not supported\n" +msgstr "" + +#: ldlang.c:3558 msgid "%E%X: failed to merge target specific data of file %B\n" msgstr "" -#: ldlang.c:3565 +#: ldlang.c:3647 msgid "" "\n" "Allocating common symbols\n" msgstr "" -#: ldlang.c:3566 +#: ldlang.c:3648 msgid "" "Common symbol size file\n" "\n" @@ -659,288 +686,311 @@ msgstr "" #. This message happens when using the #. svr3.ifile linker script, so I have #. disabled it. -#: ldlang.c:3648 +#: ldlang.c:3730 msgid "%P: no [COMMON] command, defaulting to .bss\n" msgstr "" -#: ldlang.c:3707 +#: ldlang.c:3789 msgid "%P%F: invalid syntax in flags\n" msgstr "" -#: ldlang.c:4296 +#: ldlang.c:4390 msgid "%P%Fmultiple STARTUP files\n" msgstr "" -#: ldlang.c:4566 +#: ldlang.c:4658 msgid "%F%P: bfd_record_phdr failed: %E\n" msgstr "" -#: ldlang.c:4585 +#: ldlang.c:4677 msgid "%X%P: section `%s' assigned to non-existent phdr `%s'\n" msgstr "" -#: ldlang.c:4893 +#: ldlang.c:5003 msgid "%X%P: unknown language `%s' in version information\n" msgstr "" -#: ldlang.c:4942 +#: ldlang.c:5055 +msgid "" +"%X%P: anonymous version tag cannot be combined with other version tags\n" +msgstr "" + +#: ldlang.c:5062 msgid "%X%P: duplicate version tag `%s'\n" msgstr "" -#: ldlang.c:4955 ldlang.c:4968 +#: ldlang.c:5075 ldlang.c:5088 msgid "%X%P: duplicate expression `%s' in version information\n" msgstr "" -#: ldlang.c:5005 +#: ldlang.c:5130 msgid "%X%P: unable to find version dependency `%s'\n" msgstr "" -#: ldlang.c:5027 -msgid "%X%P: unable to read .exports section contents" +#: ldlang.c:5152 +msgid "%X%P: unable to read .exports section contents\n" msgstr "" -#: ldmain.c:192 +#: ldmain.c:195 msgid "%X%P: can't set BFD default target to `%s': %E\n" msgstr "" -#: ldmain.c:268 +#: ldmain.c:284 msgid "%P%F: -r and --mpc860c0 may not be used together\n" msgstr "" -#: ldmain.c:270 +#: ldmain.c:286 msgid "%P%F: --relax and -r may not be used together\n" msgstr "" -#: ldmain.c:272 +#: ldmain.c:288 msgid "%P%F: -r and -shared may not be used together\n" msgstr "" -#: ldmain.c:301 -msgid "using internal linker script:\n" +#: ldmain.c:294 +msgid "%P%F: -F may not be used without -shared\n" +msgstr "" + +#: ldmain.c:296 +msgid "%P%F: -f may not be used without -shared\n" msgstr "" -#: ldmain.c:320 +#: ldmain.c:334 +#, c-format +msgid "using %s linker script:\n" +msgstr "" + +#: ldmain.c:369 msgid "%P%F: no input files\n" msgstr "" -#: ldmain.c:325 +#: ldmain.c:374 msgid "%P: mode %s\n" msgstr "" -#: ldmain.c:342 +#: ldmain.c:391 msgid "%P%F: cannot open map file %s: %E\n" msgstr "" -#: ldmain.c:389 +#: ldmain.c:438 msgid "%P: link errors found, deleting executable `%s'\n" msgstr "" -#: ldmain.c:400 +#: ldmain.c:449 msgid "%F%B: final close failed: %E\n" msgstr "" -#: ldmain.c:424 +#: ldmain.c:473 msgid "%X%P: unable to open for source of copy `%s'\n" msgstr "" -#: ldmain.c:426 +#: ldmain.c:475 msgid "%X%P: unable to open for destination of copy `%s'\n" msgstr "" -#: ldmain.c:432 +#: ldmain.c:481 msgid "%P: Error writing file `%s'\n" msgstr "" -#: ldmain.c:438 pe-dll.c:1097 +#: ldmain.c:487 pe-dll.c:1442 #, c-format msgid "%P: Error closing file `%s'\n" msgstr "" -#: ldmain.c:455 +#: ldmain.c:504 #, c-format msgid "%s: total time in link: %ld.%06ld\n" msgstr "" -#: ldmain.c:458 +#: ldmain.c:507 #, c-format msgid "%s: data size %ld\n" msgstr "" -#: ldmain.c:499 +#: ldmain.c:548 msgid "%P%F: missing argument to -m\n" msgstr "" -#: ldmain.c:624 ldmain.c:645 ldmain.c:676 +#: ldmain.c:676 ldmain.c:697 ldmain.c:728 msgid "%P%F: bfd_hash_table_init failed: %E\n" msgstr "" -#: ldmain.c:629 ldmain.c:648 +#: ldmain.c:681 ldmain.c:700 msgid "%P%F: bfd_hash_lookup failed: %E\n" msgstr "" -#: ldmain.c:663 +#: ldmain.c:715 msgid "%X%P: error: duplicate retain-symbols-file\n" msgstr "" -#: ldmain.c:707 +#: ldmain.c:759 msgid "%P%F: bfd_hash_lookup for insertion failed: %E\n" msgstr "" -#: ldmain.c:712 +#: ldmain.c:764 msgid "%P: `-retain-symbols-file' overrides `-s' and `-S'\n" msgstr "" -#: ldmain.c:788 -msgid "Archive member included" -msgstr "" - -#: ldmain.c:789 -msgid "because of file (symbol)" +#: ldmain.c:840 +msgid "" +"Archive member included because of file (symbol)\n" +"\n" msgstr "" -#: ldmain.c:860 +#: ldmain.c:911 msgid "%X%C: multiple definition of `%T'\n" msgstr "" -#: ldmain.c:863 +#: ldmain.c:914 msgid "%D: first defined here\n" msgstr "" -#: ldmain.c:867 +#: ldmain.c:918 msgid "%P: Disabling relaxation: it will not work with multiple definitions\n" msgstr "" -#: ldmain.c:898 +#: ldmain.c:949 msgid "%B: warning: definition of `%T' overriding common\n" msgstr "" -#: ldmain.c:901 +#: ldmain.c:952 msgid "%B: warning: common is here\n" msgstr "" -#: ldmain.c:908 +#: ldmain.c:959 msgid "%B: warning: common of `%T' overridden by definition\n" msgstr "" -#: ldmain.c:911 +#: ldmain.c:962 msgid "%B: warning: defined here\n" msgstr "" -#: ldmain.c:918 +#: ldmain.c:969 msgid "%B: warning: common of `%T' overridden by larger common\n" msgstr "" -#: ldmain.c:921 +#: ldmain.c:972 msgid "%B: warning: larger common is here\n" msgstr "" -#: ldmain.c:925 +#: ldmain.c:976 msgid "%B: warning: common of `%T' overriding smaller common\n" msgstr "" -#: ldmain.c:928 +#: ldmain.c:979 msgid "%B: warning: smaller common is here\n" msgstr "" -#: ldmain.c:932 +#: ldmain.c:983 msgid "%B: warning: multiple common of `%T'\n" msgstr "" -#: ldmain.c:934 +#: ldmain.c:985 msgid "%B: warning: previous common is here\n" msgstr "" -#: ldmain.c:955 ldmain.c:994 +#: ldmain.c:1006 ldmain.c:1045 msgid "%P: warning: global constructor %s used\n" msgstr "" -#: ldmain.c:1004 +#: ldmain.c:1055 msgid "%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n" msgstr "" -#: ldmain.c:1188 +#: ldmain.c:1239 msgid "%F%P: bfd_hash_table_init failed: %E\n" msgstr "" -#: ldmain.c:1195 +#: ldmain.c:1246 msgid "%F%P: bfd_hash_lookup failed: %E\n" msgstr "" -#: ldmain.c:1215 +#: ldmain.c:1266 msgid "%C: undefined reference to `%T'\n" msgstr "" -#: ldmain.c:1221 +#: ldmain.c:1272 msgid "%D: more undefined references to `%T' follow\n" msgstr "" -#: ldmain.c:1228 +#: ldmain.c:1279 msgid "%B: undefined reference to `%T'\n" msgstr "" -#: ldmain.c:1234 +#: ldmain.c:1285 msgid "%B: more undefined references to `%T' follow\n" msgstr "" -#: ldmain.c:1254 ldmain.c:1275 ldmain.c:1294 +#: ldmain.c:1305 ldmain.c:1326 ldmain.c:1345 msgid "%P%X: generated" msgstr "" -#: ldmain.c:1257 +#: ldmain.c:1308 msgid " relocation truncated to fit: %s %T" msgstr "" -#: ldmain.c:1278 +#: ldmain.c:1329 #, c-format msgid "dangerous relocation: %s\n" msgstr "" -#: ldmain.c:1297 +#: ldmain.c:1348 msgid " reloc refers to symbol `%T' which is not being output\n" msgstr "" -#: ldmisc.c:178 +#: ldmisc.c:176 msgid "no symbol" msgstr "" -#: ldmisc.c:242 +#: ldmisc.c:240 #, c-format msgid "built in linker script:%u" msgstr "" -#: ldmisc.c:292 ldmisc.c:296 +#: ldmisc.c:290 ldmisc.c:294 msgid "%B%F: could not read symbols\n" msgstr "" #. We use abfd->filename in this initial line, #. in case filename is a .h file or something #. similarly unhelpful. -#: ldmisc.c:332 +#: ldmisc.c:330 msgid "%B: In function `%T':\n" msgstr "" -#: ldmisc.c:464 +#: ldmisc.c:439 msgid "%F%P: internal error %s %d\n" msgstr "" -#: ldmisc.c:550 +#: ldmisc.c:489 msgid "%P: internal error: aborting at %s line %d in %s\n" msgstr "" -#: ldmisc.c:553 +#: ldmisc.c:492 msgid "%P: internal error: aborting at %s line %d\n" msgstr "" -#: ldmisc.c:555 +#: ldmisc.c:494 msgid "%P%F: please report this bug\n" msgstr "" -#: ldver.c:39 +#. Output for noisy == 2 is intended to follow the GNU standards. +#: ldver.c:38 #, c-format -msgid "GNU ld version %s (with BFD %s)\n" +msgid "GNU ld version %s\n" +msgstr "" + +#: ldver.c:42 +msgid "Copyright 2001 Free Software Foundation, Inc.\n" msgstr "" -#: ldver.c:46 lexsup.c:961 +#: ldver.c:43 +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:52 msgid " Supported emulations:\n" msgstr "" @@ -961,622 +1011,652 @@ msgstr "" msgid "%F%P: final link failed: %E\n" msgstr "" -#: lexsup.c:159 lexsup.c:250 +#: lexsup.c:175 lexsup.c:270 msgid "KEYWORD" msgstr "" -#: lexsup.c:159 +#: lexsup.c:175 msgid "Shared library control for HP/UX compatibility" msgstr "" -#: lexsup.c:162 +#: lexsup.c:178 msgid "ARCH" msgstr "" -#: lexsup.c:162 +#: lexsup.c:178 msgid "Set architecture" msgstr "" -#: lexsup.c:164 lexsup.c:315 +#: lexsup.c:180 lexsup.c:337 msgid "TARGET" msgstr "" -#: lexsup.c:164 +#: lexsup.c:180 msgid "Specify target for following input files" msgstr "" -#: lexsup.c:166 lexsup.c:205 lexsup.c:217 lexsup.c:226 lexsup.c:297 -#: lexsup.c:322 lexsup.c:360 +#: lexsup.c:182 lexsup.c:223 lexsup.c:235 lexsup.c:244 lexsup.c:315 +#: lexsup.c:344 lexsup.c:384 msgid "FILE" msgstr "" -#: lexsup.c:166 +#: lexsup.c:182 msgid "Read MRI format linker script" msgstr "" -#: lexsup.c:168 +#: lexsup.c:184 msgid "Force common symbols to be defined" msgstr "" -#: lexsup.c:172 lexsup.c:350 lexsup.c:352 lexsup.c:354 +#: lexsup.c:188 lexsup.c:374 lexsup.c:376 lexsup.c:378 msgid "ADDRESS" msgstr "" -#: lexsup.c:172 +#: lexsup.c:188 msgid "Set start address" msgstr "" -#: lexsup.c:174 +#: lexsup.c:190 msgid "Export all dynamic symbols" msgstr "" -#: lexsup.c:176 +#: lexsup.c:192 msgid "Link big-endian objects" msgstr "" -#: lexsup.c:178 +#: lexsup.c:194 msgid "Link little-endian objects" msgstr "" -#: lexsup.c:180 lexsup.c:183 +#: lexsup.c:196 lexsup.c:199 msgid "SHLIB" msgstr "" -#: lexsup.c:180 +#: lexsup.c:196 msgid "Auxiliary filter for shared object symbol table" msgstr "" -#: lexsup.c:183 +#: lexsup.c:199 msgid "Filter for shared object symbol table" msgstr "" -#: lexsup.c:185 +#: lexsup.c:201 msgid "Ignored" msgstr "" -#: lexsup.c:187 +#: lexsup.c:203 msgid "SIZE" msgstr "" -#: lexsup.c:187 +#: lexsup.c:203 msgid "Small data size (if no size, same as --shared)" msgstr "" -#: lexsup.c:190 +#: lexsup.c:206 msgid "FILENAME" msgstr "" -#: lexsup.c:190 +#: lexsup.c:206 msgid "Set internal name of shared library" msgstr "" -#: lexsup.c:192 +#: lexsup.c:208 +msgid "PROGRAM" +msgstr "" + +#: lexsup.c:208 +msgid "Set PROGRAM as the dynamic linker to use" +msgstr "" + +#: lexsup.c:210 msgid "LIBNAME" msgstr "" -#: lexsup.c:192 +#: lexsup.c:210 msgid "Search for library LIBNAME" msgstr "" -#: lexsup.c:194 +#: lexsup.c:212 msgid "DIRECTORY" msgstr "" -#: lexsup.c:194 +#: lexsup.c:212 msgid "Add DIRECTORY to library search path" msgstr "" -#: lexsup.c:196 +#: lexsup.c:214 msgid "EMULATION" msgstr "" -#: lexsup.c:196 +#: lexsup.c:214 msgid "Set emulation" msgstr "" -#: lexsup.c:198 +#: lexsup.c:216 msgid "Print map file on standard output" msgstr "" -#: lexsup.c:200 +#: lexsup.c:218 msgid "Do not page align data" msgstr "" -#: lexsup.c:202 +#: lexsup.c:220 msgid "Do not page align data, do not make text readonly" msgstr "" -#: lexsup.c:205 +#: lexsup.c:223 msgid "Set output file name" msgstr "" -#: lexsup.c:207 +#: lexsup.c:225 msgid "Optimize output file" msgstr "" -#: lexsup.c:209 +#: lexsup.c:227 msgid "Ignored for SVR4 compatibility" msgstr "" -#: lexsup.c:213 +#: lexsup.c:231 msgid "Generate relocateable output" msgstr "" -#: lexsup.c:217 +#: lexsup.c:235 msgid "Just link symbols (if directory, same as --rpath)" msgstr "" -#: lexsup.c:220 +#: lexsup.c:238 msgid "Strip all symbols" msgstr "" -#: lexsup.c:222 +#: lexsup.c:240 msgid "Strip debugging symbols" msgstr "" -#: lexsup.c:224 +#: lexsup.c:242 msgid "Trace file opens" msgstr "" -#: lexsup.c:226 +#: lexsup.c:244 msgid "Read linker script" msgstr "" -#: lexsup.c:228 lexsup.c:242 lexsup.c:283 lexsup.c:295 lexsup.c:344 -#: lexsup.c:363 lexsup.c:380 +#: lexsup.c:246 lexsup.c:262 lexsup.c:301 lexsup.c:313 lexsup.c:368 +#: lexsup.c:387 lexsup.c:407 msgid "SYMBOL" msgstr "" -#: lexsup.c:228 +#: lexsup.c:246 msgid "Start with undefined reference to SYMBOL" msgstr "" -#: lexsup.c:230 -msgid "Don't merge orphan sections with the same name" +#: lexsup.c:248 +msgid "[=SECTION]" msgstr "" -#: lexsup.c:232 +#: lexsup.c:248 +msgid "Don't merge input [SECTION | orphan] sections" +msgstr "" + +#: lexsup.c:250 msgid "Build global constructor/destructor tables" msgstr "" -#: lexsup.c:234 +#: lexsup.c:252 msgid "Print version information" msgstr "" -#: lexsup.c:236 +#: lexsup.c:254 msgid "Print version and emulation information" msgstr "" -#: lexsup.c:238 +#: lexsup.c:256 msgid "Discard all local symbols" msgstr "" -#: lexsup.c:240 -msgid "Discard temporary local symbols" +#: lexsup.c:258 +msgid "Discard temporary local symbols (default)" msgstr "" -#: lexsup.c:242 +#: lexsup.c:260 +msgid "Don't discard any local symbols" +msgstr "" + +#: lexsup.c:262 msgid "Trace mentions of SYMBOL" msgstr "" -#: lexsup.c:244 lexsup.c:324 lexsup.c:326 +#: lexsup.c:264 lexsup.c:346 lexsup.c:348 msgid "PATH" msgstr "" -#: lexsup.c:244 +#: lexsup.c:264 msgid "Default search path for Solaris compatibility" msgstr "" -#: lexsup.c:246 +#: lexsup.c:266 msgid "Start a group" msgstr "" -#: lexsup.c:248 +#: lexsup.c:268 msgid "End a group" msgstr "" -#: lexsup.c:250 +#: lexsup.c:270 msgid "Ignored for SunOS compatibility" msgstr "" -#: lexsup.c:252 +#: lexsup.c:272 msgid "Link against shared libraries" msgstr "" -#: lexsup.c:258 +#: lexsup.c:278 msgid "Do not link against shared libraries" msgstr "" -#: lexsup.c:266 +#: lexsup.c:286 msgid "Bind global references locally" msgstr "" -#: lexsup.c:268 +#: lexsup.c:288 msgid "Check section addresses for overlaps (default)" msgstr "" -#: lexsup.c:270 +#: lexsup.c:290 msgid "Do not check section addresses for overlaps" msgstr "" -#: lexsup.c:273 +#: lexsup.c:293 msgid "Output cross reference table" msgstr "" -#: lexsup.c:275 +#: lexsup.c:295 msgid "SYMBOL=EXPRESSION" msgstr "" -#: lexsup.c:275 +#: lexsup.c:295 msgid "Define a symbol" msgstr "" -#: lexsup.c:277 +#: lexsup.c:297 msgid "[=STYLE]" msgstr "" -#: lexsup.c:277 +#: lexsup.c:297 msgid "Demangle symbol names [using STYLE]" msgstr "" -#: lexsup.c:279 -msgid "PROGRAM" -msgstr "" - -#: lexsup.c:279 -msgid "Set the dynamic linker to use" -msgstr "" - -#: lexsup.c:281 +#: lexsup.c:299 msgid "Generate embedded relocs" msgstr "" -#: lexsup.c:283 +#: lexsup.c:301 msgid "Call SYMBOL at unload-time" msgstr "" -#: lexsup.c:285 +#: lexsup.c:303 msgid "Force generation of file with .exe suffix" msgstr "" -#: lexsup.c:287 +#: lexsup.c:305 msgid "Remove unused sections (on some targets)" msgstr "" -#: lexsup.c:290 +#: lexsup.c:308 msgid "Don't remove unused sections (default)" msgstr "" -#: lexsup.c:293 +#: lexsup.c:311 msgid "Print option help" msgstr "" -#: lexsup.c:295 +#: lexsup.c:313 msgid "Call SYMBOL at load-time" msgstr "" -#: lexsup.c:297 +#: lexsup.c:315 msgid "Write a map file" msgstr "" -#: lexsup.c:299 +#: lexsup.c:317 +msgid "Do not define Common storage" +msgstr "" + +#: lexsup.c:319 msgid "Do not demangle symbol names" msgstr "" -#: lexsup.c:301 +#: lexsup.c:321 msgid "Use less memory and more disk I/O" msgstr "" -#: lexsup.c:303 +#: lexsup.c:323 msgid "Allow no undefined symbols" msgstr "" -#: lexsup.c:305 +#: lexsup.c:325 msgid "Allow undefined symbols in shared objects" msgstr "" -#: lexsup.c:307 +#: lexsup.c:327 msgid "Don't warn about mismatched input files" msgstr "" -#: lexsup.c:309 +#: lexsup.c:329 msgid "Turn off --whole-archive" msgstr "" -#: lexsup.c:311 +#: lexsup.c:331 msgid "Create an output file even if errors occur" msgstr "" -#: lexsup.c:315 +#: lexsup.c:335 +msgid "" +"Only use library directories specified on\n" +"\t\t\t\tthe command line" +msgstr "" + +#: lexsup.c:337 msgid "Specify target of output file" msgstr "" -#: lexsup.c:317 +#: lexsup.c:339 msgid "Ignored for Linux compatibility" msgstr "" -#: lexsup.c:319 +#: lexsup.c:341 msgid "Relax branches on certain targets" msgstr "" -#: lexsup.c:322 +#: lexsup.c:344 msgid "Keep only symbols listed in FILE" msgstr "" -#: lexsup.c:324 +#: lexsup.c:346 msgid "Set runtime shared library search path" msgstr "" -#: lexsup.c:326 +#: lexsup.c:348 msgid "Set link time shared library search path" msgstr "" -#: lexsup.c:328 +#: lexsup.c:350 msgid "Create a shared library" msgstr "" -#: lexsup.c:332 +#: lexsup.c:354 msgid "Sort common symbols by size" msgstr "" -#: lexsup.c:336 +#: lexsup.c:358 +msgid "COUNT" +msgstr "" + +#: lexsup.c:358 +msgid "How many tags to reserve in .dynamic section" +msgstr "" + +#: lexsup.c:360 msgid "[=SIZE]" msgstr "" -#: lexsup.c:336 +#: lexsup.c:360 msgid "Split output sections every SIZE octets" msgstr "" -#: lexsup.c:338 +#: lexsup.c:362 msgid "[=COUNT]" msgstr "" -#: lexsup.c:338 +#: lexsup.c:362 msgid "Split output sections every COUNT relocs" msgstr "" -#: lexsup.c:340 +#: lexsup.c:364 msgid "Print memory usage statistics" msgstr "" -#: lexsup.c:342 +#: lexsup.c:366 msgid "Display target specific options" msgstr "" -#: lexsup.c:344 +#: lexsup.c:368 msgid "Do task level linking" msgstr "" -#: lexsup.c:346 +#: lexsup.c:370 msgid "Use same format as native linker" msgstr "" -#: lexsup.c:348 +#: lexsup.c:372 msgid "SECTION=ADDRESS" msgstr "" -#: lexsup.c:348 +#: lexsup.c:372 msgid "Set address of named section" msgstr "" -#: lexsup.c:350 +#: lexsup.c:374 msgid "Set address of .bss section" msgstr "" -#: lexsup.c:352 +#: lexsup.c:376 msgid "Set address of .data section" msgstr "" -#: lexsup.c:354 +#: lexsup.c:378 msgid "Set address of .text section" msgstr "" -#: lexsup.c:356 +#: lexsup.c:380 msgid "Output lots of information during link" msgstr "" -#: lexsup.c:360 +#: lexsup.c:384 msgid "Read version information script" msgstr "" -#: lexsup.c:363 +#: lexsup.c:387 msgid "" "Take export symbols list from .exports, using\n" "\t\t\t\tSYMBOL as the version." msgstr "" -#: lexsup.c:366 +#: lexsup.c:390 msgid "Warn about duplicate common symbols" msgstr "" -#: lexsup.c:368 +#: lexsup.c:392 msgid "Warn if global constructors/destructors are seen" msgstr "" -#: lexsup.c:371 +#: lexsup.c:395 msgid "Warn if the multiple GP values are used" msgstr "" -#: lexsup.c:373 +#: lexsup.c:397 msgid "Warn only once per undefined symbol" msgstr "" -#: lexsup.c:375 +#: lexsup.c:399 msgid "Warn if start of section changes due to alignment" msgstr "" -#: lexsup.c:378 +#: lexsup.c:402 +msgid "Treat warnings as errors" +msgstr "" + +#: lexsup.c:405 msgid "Include all objects from following archives" msgstr "" -#: lexsup.c:380 +#: lexsup.c:407 msgid "Use wrapper functions for SYMBOL" msgstr "" -#: lexsup.c:382 +#: lexsup.c:409 msgid "[=WORDS]" msgstr "" -#: lexsup.c:382 +#: lexsup.c:409 msgid "" "Modify problematic branches in last WORDS (1-10,\n" "\t\t\t\tdefault 5) words of a page" msgstr "" -#: lexsup.c:532 -#, c-format -msgid "%s: use the --help option for usage information\n" +#: lexsup.c:575 +msgid "%P: unrecognized option '%s'\n" msgstr "" -#: lexsup.c:552 +#: lexsup.c:577 +msgid "%P%F: use the --help option for usage information\n" +msgstr "" + +#: lexsup.c:596 msgid "%P%F: unrecognized -a option `%s'\n" msgstr "" -#: lexsup.c:565 +#: lexsup.c:609 msgid "%P%F: unrecognized -assert option `%s'\n" msgstr "" -#: lexsup.c:608 +#: lexsup.c:652 msgid "%F%P: unknown demangling style `%s'" msgstr "" -#: lexsup.c:667 +#: lexsup.c:712 msgid "%P%F: invalid number `%s'\n" msgstr "" -#: lexsup.c:845 -msgid "%P%F: -shared not supported\n" -msgstr "" - -#: lexsup.c:879 -#, c-format -msgid "%s: Invalid argument to option \"--section-start\"\n" +#. 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 +#. but it cannot parse the text after the -r so it refuses to +#. increment the optind counter. Detect this case and issue +#. 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:810 +msgid "%P%F: bad -rpath option\n" msgstr "" -#: lexsup.c:890 -#, c-format -msgid "%s: Missing argument(s) to option \"--section-start\"\n" +#: lexsup.c:908 +msgid "%P%F: -shared not supported\n" msgstr "" -#: lexsup.c:954 -msgid "Copyright 2000 Free Software Foundation, Inc.\n" +#: lexsup.c:940 +msgid "%P%F: invalid argument to option \"--section-start\"\n" msgstr "" -#: lexsup.c:955 -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" +#: lexsup.c:946 +msgid "%P%F: missing argument(s) to option \"--section-start\"\n" msgstr "" -#: lexsup.c:1047 -#, c-format -msgid "%s: may not nest groups (--help for usage)\n" +#: lexsup.c:1095 +msgid "%P%F: may not nest groups (--help for usage)\n" msgstr "" -#: lexsup.c:1058 -#, c-format -msgid "%s: group ended before it began (--help for usage)\n" +#: lexsup.c:1102 +msgid "%P%F: group ended before it began (--help for usage)\n" msgstr "" -#: lexsup.c:1075 -#, c-format -msgid "%s: Invalid argument to option \"mpc860c0\"\n" +#: lexsup.c:1116 +msgid "%P%F: invalid argument to option \"mpc860c0\"\n" msgstr "" -#: lexsup.c:1131 +#: lexsup.c:1171 msgid "%P%F: invalid hex number `%s'\n" msgstr "" -#: lexsup.c:1143 +#: lexsup.c:1183 #, c-format msgid "Usage: %s [options] file...\n" msgstr "" -#: lexsup.c:1145 +#: lexsup.c:1185 msgid "Options:\n" msgstr "" #. Note: Various tools (such as libtool) depend upon the #. format of the listings below - do not change them. -#: lexsup.c:1224 +#: lexsup.c:1268 #, c-format msgid "%s: supported targets:" msgstr "" -#: lexsup.c:1232 +#: lexsup.c:1276 #, c-format msgid "%s: supported emulations: " msgstr "" -#: lexsup.c:1237 +#: lexsup.c:1281 #, c-format msgid "%s: emulation specific options:\n" msgstr "" -#: lexsup.c:1241 +#: lexsup.c:1285 #, c-format msgid "Report bugs to %s\n" msgstr "" -#: mri.c:321 +#: mri.c:334 msgid "%P%F: unknown format type %s\n" msgstr "" -#: pe-dll.c:146 +#: pe-dll.c:316 #, c-format msgid "%XUnsupported PEI architecture: %s\n" msgstr "" -#: pe-dll.c:387 +#: pe-dll.c:650 #, c-format msgid "%XError, duplicate EXPORT with ordinals: %s (%d vs %d)\n" msgstr "" -#: pe-dll.c:394 +#: pe-dll.c:657 #, c-format msgid "Warning, duplicate EXPORT: %s\n" msgstr "" -#: pe-dll.c:456 +#: pe-dll.c:721 #, c-format msgid "%XCannot export %s: symbol not defined\n" msgstr "" -#: pe-dll.c:462 +#: pe-dll.c:727 #, c-format msgid "%XCannot export %s: symbol wrong type (%d vs %d)\n" msgstr "" -#: pe-dll.c:469 +#: pe-dll.c:734 #, c-format msgid "%XCannot export %s: symbol not found\n" msgstr "" -#: pe-dll.c:594 +#: pe-dll.c:849 #, c-format msgid "%XError, ordinal used twice: %d (%s vs %s)\n" msgstr "" -#: pe-dll.c:844 +#: pe-dll.c:1160 #, c-format msgid "%XError: %d-bit reloc in dll\n" msgstr "" -#: pe-dll.c:970 +#: pe-dll.c:1295 #, c-format msgid "%s: Can't open output def file %s\n" msgstr "" -#: pe-dll.c:1092 +#: pe-dll.c:1438 msgid "; no contents available\n" msgstr "" -#: pe-dll.c:1580 +#: pe-dll.c:2107 #, c-format msgid "%XCan't open .lib file: %s\n" msgstr "" -#: pe-dll.c:1585 +#: pe-dll.c:2112 #, c-format msgid "Creating library file: %s\n" msgstr "" diff --git a/contrib/binutils/ld/scripttempl/armaout.sc b/contrib/binutils/ld/scripttempl/armaout.sc index e9276a8..9bae887 100644 --- a/contrib/binutils/ld/scripttempl/armaout.sc +++ b/contrib/binutils/ld/scripttempl/armaout.sc @@ -20,10 +20,10 @@ SECTIONS ${RELOCATING+__sdata_ = .;} *(.data) ${CONSTRUCTING+CONSTRUCTORS} - ${RELOCATING+_edata = .;} - ${RELOCATING+__edata = .;} + ${RELOCATING+_edata = ${DATA_ALIGNMENT};} + ${RELOCATING+__edata = ${DATA_ALIGNMENT};} } - .bss ${RELOCATING+ SIZEOF(.data) + ADDR (.data)} : + .bss ${RELOCATING+${DATA_ALIGNMENT}} : { ${RELOCATING+ __bss_start = .}; *(.bss) diff --git a/contrib/binutils/ld/scripttempl/armcoff.sc b/contrib/binutils/ld/scripttempl/armcoff.sc index 9f9cd7c..c61f734 100644 --- a/contrib/binutils/ld/scripttempl/armcoff.sc +++ b/contrib/binutils/ld/scripttempl/armcoff.sc @@ -6,6 +6,18 @@ if test -z "${DATA_ADDR}"; then DATA_ADDR=. fi fi + +# These are substituted in as variables in order to get '}' in a shell +# conditional expansion. +CTOR='.ctor : { + *(SORT(.ctors.*)) + *(.ctor) + }' +DTOR='.dtor : { + *(SORT(.dtors.*)) + *(.dtor) + }' + cat <<EOF OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}", "${LITTLE_OUTPUT_FORMAT}") ${LIB_SEARCH_DIRS} @@ -20,7 +32,7 @@ SECTIONS present): */ .text ${RELOCATING+ 0x8000} : { *(.init) - *(.text) + *(.text*) *(.glue_7t) *(.glue_7) *(.rdata) @@ -30,14 +42,24 @@ SECTIONS LONG (-1); *(.dtors); *(.dtor); LONG (0); } *(.fini) ${RELOCATING+ etext = .;} + ${RELOCATING+ _etext = .;} } .data ${RELOCATING+${DATA_ADDR-0x40000 + (. & 0xfffc0fff)}} : { ${RELOCATING+ __data_start__ = . ;} - *(.data) + *(.data*) + + ${RELOCATING+*(.gcc_exc*)} + ${RELOCATING+___EH_FRAME_BEGIN__ = . ;} + ${RELOCATING+*(.eh_fram*)} + ${RELOCATING+___EH_FRAME_END__ = . ;} + ${RELOCATING+LONG(0);} + ${RELOCATING+ __data_end__ = . ;} ${RELOCATING+ edata = .;} ${RELOCATING+ _edata = .;} } + ${CONSTRUCTING+${RELOCATING-$CTOR}} + ${CONSTRUCTING+${RELOCATING-$DTOR}} .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : { ${RELOCATING+ __bss_start__ = . ;} diff --git a/contrib/binutils/ld/scripttempl/elf.sc b/contrib/binutils/ld/scripttempl/elf.sc index 3c1bfb4..fe8e242 100644 --- a/contrib/binutils/ld/scripttempl/elf.sc +++ b/contrib/binutils/ld/scripttempl/elf.sc @@ -1,6 +1,8 @@ # # Unusual variables checked by this code: -# NOP - two byte opcode for no-op (defaults to 0) +# NOP - four byte opcode for no-op (defaults to 0) +# NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not +# empty. # 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 ... @@ -17,7 +19,8 @@ # DATA_START_SYMBOLS - symbols that appear at the start of the # .data section. # OTHER_GOT_SYMBOLS - symbols defined just before .got. -# OTHER_GOT_SECTIONS - sections just after .got and .sdata. +# 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. @@ -32,6 +35,8 @@ # combination of .init sections. # 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. # # When adding sections, do note that the names of some sections are used # when specifying the start address of the next. @@ -54,6 +59,7 @@ # .sbss .gnu.linkonce.sb.foo # .sdata2 .gnu.linkonce.s2.foo # .sbss2 .gnu.linkonce.sb2.foo +# .debug_info .gnu.linkonce.wi.foo # # Each of these can also have corresponding .rel.* and .rela.* sections. @@ -64,13 +70,41 @@ 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=. -INTERP=".interp ${RELOCATING-0} : { *(.interp) }" -PLT=".plt ${RELOCATING-0} : { *(.plt) }" -DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" -RODATA=".rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r.*)} }" -SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2) ${RELOCATING+*(.sbss2.*)} ${RELOCATING+*(.gnu.linkonce.sb2.*)} }" -SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2) ${RELOCATING+*(.sdata2.*)} ${RELOCATING+*(.gnu.linkonce.s2.*)} }" -CTOR=".ctors ${CONSTRUCTING-0} : +INTERP=".interp ${RELOCATING-0} : { *(.interp) }" +PLT=".plt ${RELOCATING-0} : { *(.plt) }" +DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" +RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" +if test -z "${NO_SMALL_DATA}"; then + SBSS=".sbss ${RELOCATING-0} : + { + ${RELOCATING+PROVIDE (__sbss_start = .);} + ${RELOCATING+PROVIDE (___sbss_start = .);} + *(.dynsbss) + *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*}) + *(.scommon) + ${RELOCATING+PROVIDE (__sbss_end = .);} + ${RELOCATING+PROVIDE (___sbss_end = .);} + }" + SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }" + SDATA="/* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata ${RELOCATING-0} : + { + ${RELOCATING+${SDATA_START_SYMBOLS}} + *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*}) + }" + SDATA2=".sdata2 ${RELOCATING-0} : { *(.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.*}) } + .rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }" + REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) } + .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.*}) }" +fi +CTOR=".ctors ${CONSTRUCTING-0} : { ${CONSTRUCTING+${CTOR_START}} /* gcc uses crtbegin.o to find the start of @@ -95,8 +129,7 @@ CTOR=".ctors ${CONSTRUCTING-0} : KEEP (*(.ctors)) ${CONSTRUCTING+${CTOR_END}} }" - -DTOR=" .dtors ${CONSTRUCTING-0} : +DTOR=".dtors ${CONSTRUCTING-0} : { ${CONSTRUCTING+${DTOR_START}} KEEP (*crtbegin.o(.dtors)) @@ -105,6 +138,11 @@ DTOR=" .dtors ${CONSTRUCTING-0} : KEEP (*(.dtors)) ${CONSTRUCTING+${DTOR_END}} }" +STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : + { + ${RELOCATING+_stack = .;} + *(.stack) + }" # if this is for an embedded system, don't add SIZEOF_HEADERS. if [ -z "$EMBEDDED" ]; then @@ -137,126 +175,67 @@ SECTIONS ${CREATE_SHLIB-${INTERP}} ${INITIAL_READONLY_SECTIONS} ${TEXT_DYNAMIC+${DYNAMIC}} - .hash ${RELOCATING-0} : { *(.hash) } - .dynsym ${RELOCATING-0} : { *(.dynsym) } - .dynstr ${RELOCATING-0} : { *(.dynstr) } - .gnu.version ${RELOCATING-0} : { *(.gnu.version) } - .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } - .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } + .hash ${RELOCATING-0} : { *(.hash) } + .dynsym ${RELOCATING-0} : { *(.dynsym) } + .dynstr ${RELOCATING-0} : { *(.dynstr) } + .gnu.version ${RELOCATING-0} : { *(.gnu.version) } + .gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) } + .gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) } - .rel.init ${RELOCATING-0} : { *(.rel.init) } - .rela.init ${RELOCATING-0} : { *(.rela.init) } - .rel.text ${RELOCATING-0} : - { - *(.rel.text) - ${RELOCATING+*(.rel.text.*)} - ${RELOCATING+*(.rel.gnu.linkonce.t.*)} - } - .rela.text ${RELOCATING-0} : - { - *(.rela.text) - ${RELOCATING+*(.rela.text.*)} - ${RELOCATING+*(.rela.gnu.linkonce.t.*)} - } - .rel.fini ${RELOCATING-0} : { *(.rel.fini) } - .rela.fini ${RELOCATING-0} : { *(.rela.fini) } - .rel.rodata ${RELOCATING-0} : - { - *(.rel.rodata) - ${RELOCATING+*(.rel.rodata.*)} - ${RELOCATING+*(.rel.gnu.linkonce.r.*)} - } - .rela.rodata ${RELOCATING-0} : - { - *(.rela.rodata) - ${RELOCATING+*(.rela.rodata.*)} - ${RELOCATING+*(.rela.gnu.linkonce.r.*)} - } +EOF +if [ "x$COMBRELOC" = x ]; then + COMBRELOCCAT=cat +else + COMBRELOCCAT="cat > $COMBRELOC" +fi +eval $COMBRELOCCAT <<EOF + .rel.init ${RELOCATING-0} : { *(.rel.init) } + .rela.init ${RELOCATING-0} : { *(.rela.init) } + .rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) } + .rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) } + .rel.fini ${RELOCATING-0} : { *(.rel.fini) } + .rela.fini ${RELOCATING-0} : { *(.rela.fini) } + .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 ${RELOCATING-0} : - { - *(.rel.data) - ${RELOCATING+*(.rel.data.*)} - ${RELOCATING+*(.rel.gnu.linkonce.d.*)} - } - .rela.data ${RELOCATING-0} : - { - *(.rela.data) - ${RELOCATING+*(.rela.data.*)} - ${RELOCATING+*(.rela.gnu.linkonce.d.*)} - } - .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } - .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } - .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } - .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } - .rel.got ${RELOCATING-0} : { *(.rel.got) } - .rela.got ${RELOCATING-0} : { *(.rela.got) } + .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.ctors ${RELOCATING-0} : { *(.rel.ctors) } + .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } + .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } + .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } + .rel.got ${RELOCATING-0} : { *(.rel.got) } + .rela.got ${RELOCATING-0} : { *(.rela.got) } ${OTHER_GOT_RELOC_SECTIONS} - .rel.sdata ${RELOCATING-0} : - { - *(.rel.sdata) - ${RELOCATING+*(.rel.sdata.*)} - ${RELOCATING+*(.rel.gnu.linkonce.s.*)} - } - .rela.sdata ${RELOCATING-0} : - { - *(.rela.sdata) - ${RELOCATING+*(.rela.sdata.*)} - ${RELOCATING+*(.rela.gnu.linkonce.s.*)} - } - .rel.sbss ${RELOCATING-0} : - { - *(.rel.sbss) - ${RELOCATING+*(.rel.sbss.*)} - ${RELOCATING+*(.rel.gnu.linkonce.sb.*)} - } - .rela.sbss ${RELOCATING-0} : + ${REL_SDATA} + ${REL_SBSS} + ${REL_SDATA2} + ${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.*}) } +EOF +if [ -n "$COMBRELOC" ]; then +cat <<EOF + .rel.dyn ${RELOCATING-0} : { - *(.rela.sbss) - ${RELOCATING+*(.rela.sbss.*)} - ${RELOCATING+*(.rel.gnu.linkonce.sb.*)} - } - .rel.sdata2 ${RELOCATING-0} : - { - *(.rel.sdata2) - ${RELOCATING+*(.rel.sdata2.*)} - ${RELOCATING+*(.rel.gnu.linkonce.s2.*)} +EOF +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC +cat <<EOF } - .rela.sdata2 ${RELOCATING-0} : + .rela.dyn ${RELOCATING-0} : { - *(.rela.sdata2) - ${RELOCATING+*(.rela.sdata2.*)} - ${RELOCATING+*(.rela.gnu.linkonce.s2.*)} - } - .rel.sbss2 ${RELOCATING-0} : - { - *(.rel.sbss2) - ${RELOCATING+*(.rel.sbss2.*)} - ${RELOCATING+*(.rel.gnu.linkonce.sb2.*)} - } - .rela.sbss2 ${RELOCATING-0} : - { - *(.rela.sbss2) - ${RELOCATING+*(.rela.sbss2.*)} - ${RELOCATING+*(.rela.gnu.linkonce.sb2.*)} - } - .rel.bss ${RELOCATING-0} : - { - *(.rel.bss) - ${RELOCATING+*(.rel.bss.*)} - ${RELOCATING+*(.rel.gnu.linkonce.b.*)} - } - .rela.bss ${RELOCATING-0} : - { - *(.rela.bss) - ${RELOCATING+*(.rela.bss.*)} - ${RELOCATING+*(.rela.gnu.linkonce.b.*)} +EOF +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC +cat <<EOF } - .rel.plt ${RELOCATING-0} : { *(.rel.plt) } - .rela.plt ${RELOCATING-0} : { *(.rela.plt) } +EOF +fi +cat <<EOF + .rel.plt ${RELOCATING-0} : { *(.rel.plt) } + .rela.plt ${RELOCATING-0} : { *(.rela.plt) } ${OTHER_PLT_RELOC_SECTIONS} - .init ${RELOCATING-0} : + .init ${RELOCATING-0} : { ${RELOCATING+${INIT_START}} KEEP (*(.init)) @@ -264,18 +243,15 @@ SECTIONS } =${NOP-0} ${DATA_PLT-${BSS_PLT-${PLT}}} - .text ${RELOCATING-0} : + .text ${RELOCATING-0} : { ${RELOCATING+${TEXT_START_SYMBOLS}} - *(.text) - ${RELOCATING+*(.text.*)} - *(.stub) + *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*}) /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) - ${RELOCATING+*(.gnu.linkonce.t.*)} ${RELOCATING+${OTHER_TEXT_SECTIONS}} } =${NOP-0} - .fini ${RELOCATING-0} : + .fini ${RELOCATING-0} : { ${RELOCATING+${FINI_START}} KEEP (*(.fini)) @@ -285,92 +261,71 @@ SECTIONS ${RELOCATING+PROVIDE (_etext = .);} ${RELOCATING+PROVIDE (etext = .);} ${WRITABLE_RODATA-${RODATA}} - .rodata1 ${RELOCATING-0} : { *(.rodata1) } + .rodata1 ${RELOCATING-0} : { *(.rodata1) } ${CREATE_SHLIB-${SDATA2}} ${CREATE_SHLIB-${SBSS2}} - ${RELOCATING+${OTHER_READONLY_SECTIONS}} + ${OTHER_READONLY_SECTIONS} + .eh_frame_hdr : { *(.eh_frame_hdr) } /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ ${CREATE_SHLIB-${RELOCATING+. = ${DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))};}} ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))};}} - .data ${RELOCATING-0} : + .data ${RELOCATING-0} : { ${RELOCATING+${DATA_START_SYMBOLS}} - *(.data) - ${RELOCATING+*(.data.*)} - ${RELOCATING+*(.gnu.linkonce.d.*)} + *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*}) ${CONSTRUCTING+SORT(CONSTRUCTORS)} } - .data1 ${RELOCATING-0} : { *(.data1) } - .eh_frame : { KEEP (*(.eh_frame)) } - .gcc_except_table : { *(.gcc_except_table) } + .data1 ${RELOCATING-0} : { *(.data1) } + .eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame)) } + .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) } ${WRITABLE_RODATA+${RODATA}} - ${RELOCATING+${OTHER_READWRITE_SECTIONS}} + ${OTHER_READWRITE_SECTIONS} + ${TEXT_DYNAMIC-${DYNAMIC}} ${RELOCATING+${CTOR}} ${RELOCATING+${DTOR}} + .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) } ${DATA_PLT+${PLT}} ${RELOCATING+${OTHER_GOT_SYMBOLS}} - .got ${RELOCATING-0} : { *(.got.plt) *(.got) } + .got ${RELOCATING-0} : { *(.got.plt) *(.got) } + ${OTHER_GOT_SECTIONS} ${CREATE_SHLIB+${SDATA2}} ${CREATE_SHLIB+${SBSS2}} - ${TEXT_DYNAMIC-${DYNAMIC}} - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - .sdata ${RELOCATING-0} : - { - ${RELOCATING+${SDATA_START_SYMBOLS}} - *(.sdata) - ${RELOCATING+*(.sdata.*)} - ${RELOCATING+*(.gnu.linkonce.s.*)} - } - ${RELOCATING+${OTHER_GOT_SECTIONS}} + ${SDATA} + ${OTHER_SDATA_SECTIONS} ${RELOCATING+_edata = .;} ${RELOCATING+PROVIDE (edata = .);} ${RELOCATING+__bss_start = .;} ${RELOCATING+${OTHER_BSS_SYMBOLS}} - .sbss ${RELOCATING-0} : - { - ${RELOCATING+PROVIDE (__sbss_start = .);} - ${RELOCATING+PROVIDE (___sbss_start = .);} - *(.dynsbss) - *(.sbss) - ${RELOCATING+*(.sbss.*)} - ${RELOCATING+*(.gnu.linkonce.sb.*)} - *(.scommon) - ${RELOCATING+PROVIDE (__sbss_end = .);} - ${RELOCATING+PROVIDE (___sbss_end = .);} - } + ${SBSS} ${BSS_PLT+${PLT}} - .bss ${RELOCATING-0} : + .bss ${RELOCATING-0} : { *(.dynbss) - *(.bss) - ${RELOCATING+*(.bss.*)} - ${RELOCATING+*(.gnu.linkonce.b.*)} + *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(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});} } - ${RELOCATING+${OTHER_BSS_SECTIONS}} + ${OTHER_BSS_SECTIONS} ${RELOCATING+. = ALIGN(${ALIGNMENT});} ${RELOCATING+_end = .;} ${RELOCATING+${OTHER_BSS_END_SYMBOLS}} ${RELOCATING+PROVIDE (end = .);} /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } + .comment 0 : { *(.comment) } /* DWARF debug sections. Symbols in the DWARF debugging sections are relative to the beginning @@ -389,7 +344,7 @@ SECTIONS .debug_pubnames 0 : { *(.debug_pubnames) } /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } .debug_abbrev 0 : { *(.debug_abbrev) } .debug_line 0 : { *(.debug_line) } .debug_frame 0 : { *(.debug_frame) } @@ -403,9 +358,8 @@ SECTIONS .debug_typenames 0 : { *(.debug_typenames) } .debug_varnames 0 : { *(.debug_varnames) } - ${RELOCATING+${OTHER_RELOCATING_SECTIONS}} - - /* These must appear regardless of ${RELOCATING}. */ + ${STACK_ADDR+${STACK}} ${OTHER_SECTIONS} + ${RELOCATING+${OTHER_END_SYMBOLS}} } EOF diff --git a/contrib/binutils/ld/scripttempl/nw.sc b/contrib/binutils/ld/scripttempl/nw.sc index 725522c..3fb9bce 100644 --- a/contrib/binutils/ld/scripttempl/nw.sc +++ b/contrib/binutils/ld/scripttempl/nw.sc @@ -1,6 +1,6 @@ # # Unusual variables checked by this code: -# NOP - two byte opcode for no-op (defaults to 0) +# NOP - four byte opcode for no-op (defaults to 0) # DATA_ADDR - if end-of-text-plus-one-page isn't right for data start # OTHER_READONLY_SECTIONS - other than .text .init .ctors .rodata ... # (e.g., .PARISC.milli) @@ -87,7 +87,7 @@ SECTIONS .dtors ${RELOCATING-0} : { *(.dtors) } .rodata ${RELOCATING-0} : { *(.rodata) } .rodata1 ${RELOCATING-0} : { *(.rodata1) } - ${RELOCATING+${OTHER_READONLY_SECTIONS}} + ${OTHER_READONLY_SECTIONS} /* Read-write section, merged into data segment: */ ${RELOCATING+. = ${DATA_ADDR- ALIGN(8) + ${MAXPAGESIZE}};} @@ -98,7 +98,7 @@ SECTIONS ${CONSTRUCTING+CONSTRUCTORS} } .data1 ${RELOCATING-0} : { *(.data1) } - ${RELOCATING+${OTHER_READWRITE_SECTIONS}} + ${OTHER_READWRITE_SECTIONS} .got ${RELOCATING-0} : { *(.got.plt) *(.got) } .dynamic ${RELOCATING-0} : { *(.dynamic) } ${DATA_PLT+${PLT}} @@ -125,7 +125,6 @@ SECTIONS .stab 0 : { *(.stab) } .stabstr 0 : { *(.stabstr) } - /* These must appear regardless of ${RELOCATING}. */ ${OTHER_SECTIONS} } EOF diff --git a/contrib/binutils/ld/scripttempl/pe.sc b/contrib/binutils/ld/scripttempl/pe.sc index ce1a502..2f24757 100644 --- a/contrib/binutils/ld/scripttempl/pe.sc +++ b/contrib/binutils/ld/scripttempl/pe.sc @@ -54,9 +54,9 @@ SECTIONS *(.glue_7t) *(.glue_7) ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; - LONG (-1); *(.ctors); *(.ctor); LONG (0); } + LONG (-1); *(SORT(.ctors.*)); *(.ctors); *(.ctor); LONG (0); } ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; - LONG (-1); *(.dtors); *(.dtor); LONG (0); } + LONG (-1); *(SORT(.dtors.*)); *(.dtors); *(.dtor); LONG (0); } ${RELOCATING+ *(.fini)} /* ??? Why is .gcc_exc here? */ ${RELOCATING+ *(.gcc_exc)} |