diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-11-02 20:45:59 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-11-02 20:45:59 +0000 |
commit | 56301d46413bee335c617ed8e6e32080e4ffaba7 (patch) | |
tree | 6a4c4eeffd92f1d9f6394e2d5fa08301fa0b79b1 /gnu/usr.bin/binutils/ld | |
parent | 21ca5604689b35171671ce1ed04c5faccc82e0cd (diff) |
Merge conflicts, bringing our changes back in:
- extra $(SHELL) and sugar for make (so that files not mode +x still work)
- safer temp file handling
- our W^X binary layout changes in ld
- OpenBSD policy for library file selection in ld
- arm and m88k changes which were not merged in time for official 2.15
- bfd core file handling
- a couple typos
New for 2.15:
- ld(1) and as(1) manpages now generated at build time
- binutils/stabs.c reverted to use our in-tree libiberty for now
- we still use our VIA C3 crypto code over stock binutils, as it recognizes
more instructions
- new emulations for OpenBSD on mips64 machines, to help OpenBSD/sgi
- relaxed %f# handling in gas on OpenBSD/sparc64 (same as was in 2.14)
Tested on all platforms by various people; special thanks to sturm@ and
otto@.
Diffstat (limited to 'gnu/usr.bin/binutils/ld')
65 files changed, 4492 insertions, 11392 deletions
diff --git a/gnu/usr.bin/binutils/ld/ChangeLog b/gnu/usr.bin/binutils/ld/ChangeLog index f882515c731..4b3c1f959de 100644 --- a/gnu/usr.bin/binutils/ld/ChangeLog +++ b/gnu/usr.bin/binutils/ld/ChangeLog @@ -1,5959 +1,319 @@ -2003-06-12 Richard Sandiford <rsandifo@redhat.com> +2004-05-13 Joel Sherrill <joel@oarcorp.com> - * configure.tgt (mips*-sgi-irix6*): Add the o32 and n64 emulations - to $targ_extra_libpath. + * configure.tgt (or32-*-rtems*): Switch to elf and + support versioned targets. -2003-06-02 Daniel Jacobowitz <drow@mvista.com> +2004-05-13 Nick Clifton <nickc@redhat.com> - Merge from mainline: - 2003-05-15 H.J. Lu <hongjiu.lu@intel.com> - * emulparams/elf64_ia64.sh: Don't set COMMONPAGESIZE for now. - -2003-05-30 Nick Clifton <nickc@redhat.com> - - * emultempl/armelf.em (arm_elf_before_allocation): Replace ASSERT - with a test for a NULL bfd_for_interworking. - -2003-05-05 Alan Modra <amodra@bigpond.net.au> - - * ldlex.l: Accept C style comments in version scripts. - -2003-04-28 H.J. Lu <hjl@gnu.org> - - * ldlang.c (lang_process): Add the relax finalize pass. - - * ldmain.c (main): Initialize link_info.relax_finalizing to - FALSE. - -2003-04-24 Roland McGrath <roland@redhat.com> - - * ldgram.y (phdr_type): Grok PT_TLS and PT_GNU_EH_FRAME names. - If a name string is unknown, give an error rather than crashing later. - -2003-04-23 Dhananjay Deshpande <dhananjayd@kpitcummins.com> - - * Makefile.am (ALL_EMULATIONS): Add eh8300hn.o, eh8300sn.o, - eh8300hnelf.o, eh8300snelf.o and respective rules. - * Makefile.in: Regenerate. - * configure.tgt: Add h8300hn, h8300sn, h8300hnelf, h8300snelf - * emulparams/h8300hn.sh: New - * emulparams/h8300sn.sh: New - * emulparams/h8300hnelf.sh: New - * emulparams/h8300snelf.sh: New - * scripttempl/h8300hn.sc: new - * scripttempl/h8300sn.sc: new - -2003-04-23 H.J. Lu <hjl@gnu.org> - - * ldmain.c (link_callbacks): Initialize error_handler. - - * ldmisc.c (error_handler): New function. - - * ldmisc.h (error_handler): New prototype. - -2003-04-21 Stephane Carrez <stcarrez@nerim.fr> - - * emulparams/m68hc11elf.sh: Use m68hc1xelf.em extra. - * emulparams/m68hc11elfb.sh: Likewise. - * emulparams/m68hc12elf.sh: Likewise. - * emulparams/m68hc12elfb.sh: Likewise. - -2003-04-19 Stephane Carrez <stcarrez@nerim.fr> - - * emultempl/m68hc1xelf.em: New file to generate far trampolines on - 68HC11 and 68HC12. - (LDEMUL_BEFORE_ALLOCATION): Override to gather the trampolines to - generate. - (LDEMUL_FINISH): Override to generate the trampolines after gc and - linker relaxation. - (LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Override to create the - stub file for trampolines. - (PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_LONGOPTS): New options - --no-trampoline and --bank-window to control the memory bank window. - -2003-04-18 H.J. Lu <hjl@gnu.org> - - * ldfile.c (ldfile_add_library_path): Remove the unused - variable. - -2003-04-18 Andrew Haley <aph@cambridge.redhat.com> - - * scripttempl/xstormy16.sc (__data, __rdata): New. - -2003-04-16 Nick Clifton <nickc@redhat.com> - - * scripttempl/xstormy16.sc: Add .jcr section mapping. - -2003-04-15 H.J. Lu <hjl@gnu.org> - - From Debian by Jack Howarth <howarth@nitro.med.uc.edu>: - - * ldlex.l: Use YY_CURRENT_BUFFER instead of yy_current_buffer. - -2003-04-15 Rohit Kumar Srivastava <rohits@kpitcummins.com> - - * h8-doc.texi: Replace occurrances of 'Hitachi' with 'Renesas'. - * ld.texinfo: Likewise. - -2003-04-14 Alan Modra <amodra@bigpond.net.au> - - From Prashanth Tamraparni <prashanth_t@in.ibm.com> - * scripttempl/elf.sc (CTOR): Handle crtbeginS.o, crtendS.o and - other variants of crtbegin.o, crtend.o. - (DTOR): Likewise. - * scripttempl/crisaout.sc (ctors, dtors): Likewise. - * scripttempl/elf_chaos.sc (CTOR, DTOR): Likewise. - * scripttempl/elfd10v.sc (CTOR, DTOR): Likewise. - * scripttempl/elfd30v.sc (CTOR, DTOR): Likewise. - * scripttempl/elfxtensa.sc (CTOR, DTOR): Likewise. - * scripttempl/iq2000.sc (CTOR, DTOR): Likewise. - * scripttempl/mmo.sc (ctors, dtors): Likewise. - * scripttempl/xstormy16.sc (CTOR, DTOR): Likewise. - -2003-04-09 Dmitry Diky <diwil@mail.ru> - - * scripttempl/elf32msp430.sc: Add initX, finiX, ctors, dtors - sections to respect C++ constructor/destructor. Add ctors/dtors - start/stop definitions. - * scripttempl/elf32msp430_3.sc: Likewise. - -2003-04-06 Nick Clifton <nickc@redhat.com> - - * ld.texinfo (Options): Add a reminder of the target specific - nature to the description of the i386 PE specific options, for - readers who have not read all the way through the manual. - -2003-04-04 Svein E. Seldal <Svein.Seldal@solidas.com> - - * configure.tgt: Fixed bug in list of targ_extra_emuls. - * emulparams/tic3xcoff.sh (SCRIPT_NAME): Namespace - cleanup. Replace s/c4x/tic4x and s/c3x/tic3x/ - * emulparams/tic3xcoff_onchip.sh: Ditto - * emulparams/tic4xcoff.sh: Ditto - * scripttempl/tic4xcoff.sc: Ditto - -2003-04-03 Nick Clifton <nickc@redhat.com> - - * NEWS: Mention support for Xtensa architecture. - -2003-04-02 Nick Clifton <nickc@redhat.com> - - * pe-dll.c (pe_detail_list): arm-pe targets use underscores. - -2003-04-01 Danny Smith <dannysmith@users.sourceforge.net> - - * emultempl/pe.em (gld_${EMULATION_NAME}_after_open): - Don't call pe_dll_build_section() if link_info.relocateable. - (gld_${EMULATION_NAME}_finish): Don't call pe_dll_fill_sections() - if link_info.relocateable. - -2003-04-01 Fabrizio Gennari <fabrizio.ge@tiscalinet.it> - - * pe-dll.c (process_def_file): Don't create an export - section if there are no exports and we're building an exe - (pe_dll_build_sections): Ditto - (pe_dll_fill_sections): Conditionalize setting - abfd->dll true on info->shared - * emultempl/pe.em (gld_${EMULATION_NAME}_after_open): - If i386pe or armpe, call pe_dll_build_section() - for both exe's and dll's, not just dll's. - (gld_${EMULATION_NAME}_finish): For all targets except - shpe and mipspe, call pe_dll_fill_sections() for both - exe's and dll's, not just dll's. - -2003-04-02 Bob Wilson <bob.wilson@acm.org> - - * emulparams/xtensa-config.sh: Remove comment indicating that this is - a generated file. - -2003-04-01 Bob Wilson <bob.wilson@acm.org> - - * Makefile.am (ALL_EMULATIONS): Add eelf32xtensa.o. - (eelf32xtensa.c): New target. - * Makefile.in: Regenerate. - * configure.tgt: Handle xtensa-*-*. - * gen-doc.texi: Set XTENSA variable. - * ld.texinfo: Set XTENSA variable. Add new Xtensa node. - * emulparams/elf32xtensa.sh: New file. - * emulparams/xtensa-config.sh: Likewise. - * emultempl/xtensaelf.em: Likewise. - * scripttempl/elfxtensa.sc: Likewise. - -2003-04-01 Jakub Jelinek <jakub@redhat.com> - - * configure.tgt (powerpc*-*-linux*): Add elf32ppc to ppc64 - targ_extra_libpath. Add elf64ppc to ppc targ_extra_libpath - if --enable-64-bit-bfd. - -2003-04-01 Nick Clifton <nickc@redhat.com> - - * emulparams/armelf.sh (OTHER_READONLY_SECTIONS): Change name of - note section. - * emulparams/armelf_linux.sh (OTHER_READONLY_SECTIONS): Change - name of note section. - -2003-03-31 Alexandre Oliva <aoliva@redhat.com> - - * ld.texinfo (-Tbss, -Tdata, -Ttext): Document in terms of - --section-start. - -2003-03-31 David Heine <dlheine@suif.stanford.edu> - - * ldfile.c (ldfile_add_library_path): Always allocate space for - the filename. - * ldlang.c (lang_register_vers_node): Free the node if it cannot - be used. - * ldmain.c (set_scripts_dir): Always free the constructed - directory name. - (add_keepsyms_file): Fix memory leak. - * ldmisc.c (vfinfo): Likewise. - * lexsup.c (parse_args): Likewise. - -2003-03-25 Stan Cox <scox@redhat.com> - Nick Clifton <nickc@redhat.com> - - Contribute support for Intel's iWMMXt chip - an ARM variant: - - * emulparams/armelf.sh (OTHER_READONLY_SECTIONS): Define. - * emulparams/armelf_linux.sh (OTHER_READONLY_SECTIONS): Define. - * scripttempl/armcoff.sc (.data): Ensure 8 byte alignment. - (.bss): Likewise. - -2003-03-25 Alexandre Oliva <aoliva@redhat.com> - - * ldmain.h (ld_canon_sysroot, ld_canon_sysroot_len): Declare. - * ldmain.c (ld_canon_sysroot, ld_canon_sysroot_len): Define. - (main): Initialize them. - * ldfile.c: Include pathnames.h. - (is_sysrooted_pathname): New. - (ldfile_add_library_path): Use it. - (ldfile_open_file_search): Likewise. Use IS_ABSOLUTE_PATH. Don't - search_dirs if given an absolute pathname. - (ldfile_open_file): Issue error message for sysrooted - absolute pathnames. - * Makefile.am: Updated dependencies. - * Makefile.in: Rebuild. - -2003-03-24 Daniel Néri <dne@mayonnaise.net> - - * ld.texinfo: Rename all occurances of C54X to TIC54X. - -2003-03-19 Andreas Schwab <schwab@suse.de> - - * ldfile.c (ldfile_try_open_bfd): Pop lexer start condition after - eof. - -2003-03-18 Danny Smith <dannysmith@users.sourceforge.net> - - * defilep.y (opt_base): If no number given, set to default - (-1), not 0. - -2003-03-13 Danny Smith <dannysmith@users.sourceforge.net> - - * deffilep.y (def_import): Use default extension of "dll" - if no extension provided in parsed IMPORT definition. - - * deffilep.y (def_lex): Revert 2003-03-12 change. - (dot_name): New id type and rule. - (expline): Use instead of ID. - (opt_equal_name): Likewise. - -2003-03-12 Danny Smith <dannysmith@users.sourceforge.net> - - * deffilep.y (def_lex): Accept '.' as valid non-lead char. - -2003-03-07 Christopher Faylor <cgf@redhat.com> - - * configure.tgt: Add NATIVE_LIB_DIRS for cygwin target back after - apparent accidental removal on 2003-01-06. - -2003-03-04 Dmitry Diky <diwil@mail.ru> - - * Makefile.am: Add new devices x1122 x1132 emulation - * configure.tgt: Likewise. - * Makefile.in: Regenerate. - * emulparams/msp430x1122.sh: New file. - * emulparams/msp430x1132.sh: New file. - -2003-03-03 Alexandre Oliva <aoliva@redhat.com> - - * ldmain.c (set_scripts_dir): Look for relative to TOOLBINDIR as - well. - - * ldfile.h (struct search_dirs): Added sysrooted field. - * ldlang.h (struct lang_input_statement_struct): Likewise. - * ldfile.c (ldfile_add_library_path): Mark sysrooted paths. - (ldfile_open_file_search): Look for sysrooted filename starting - with / in ld_sysroot instead of in the current directory. Clear - sysrooted flag if it's found in the current directory. Set it - from the search directory's sysrooted flag where it is found - otherwise. - * ldlang.c (ldlang_sysrooted_script): New static variable. - (new_afile): Mark search_file_enums as sysrooted if - ldlang_sysrooted_script. - (load_symbols): Set ldlang_sysrooted_script according to the - script's sysrooted field while processing it. - * ld.texinfo: Document INPUT behavior in sysroot. - -2003-03-02 Danny Smith <dannysmith@users.sourceforge.net> - - * scripttempl/pe.sc: Use PROVIDE with etext, end, _end, - -2003-03-03 Alan Modra <amodra@bigpond.net.au> - - * emulparams/elf64alpha.sh (EXTRA_EM_FILE): Define. - (PARSE_AND_LIST_PROLOGUE, PARSE_AND_LIST_LONGOPTS, - PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_ARGS_CASES, - PARSE_AND_LIST_EPILOGUE): Don't define. - * emultempl/alphaelf.em: New file. - -2003-03-01 Alan Modra <amodra@bigpond.net.au> - - * ldemul.c: Include getopt.h. - * emultempl/elf32.em: Include getopt.h earlier. - * emultempl/ticoff.em: Likewise. - -2003-02-28 Alan Modra <amodra@bigpond.net.au> - - * emultempl/elf32.em (gld${EMULATION_NAME}_get_script): Add combreloc - support when scripts read from files. - -2003-02-28 Alan Modra <amodra@bigpond.net.au> - - * ldemul.c (ldemul_parse_args): Return FALSE by default. - * ldemul.h (struct ld_emulation_xfer_struct): Update parse_args - comment. - - * ldemul.c (ldemul_add_options, ldemul_handle_option): New functions. - (ldemul_parse_args): Return bfd_boolean. Formatting. - * ldemul.h (ldemul_add_options, ldemul_handle_option): Declare. - (ldemul_parse_args): Adjust. - (struct ld_emulation_xfer_struct): Add add_options and handle_option. - Return bfd_boolean from parse_args. - * lexsup.c (parse_args): Malloc shortopts, longopts and - really_longopts. Call ldemul_add_options and ldemul_handle_option. - * emultempl/aix.em (gld${EMULATION_NAME}_add_options): Split out from - gld${EMULATION_NAME}_parse_args. - (gld${EMULATION_NAME}_handle_option): Likewise. - (ld_${EMULATION_NAME}_emulation): Adjust initializer. - * emultempl/armcoff.em: As for aix.em, but remove parse_args. - * emultempl/beos.em: Likewise. - * emultempl/pe.em: Likewise. - * emultempl/ticoff.em: Likewise. - * emultempl/elf32.em: Likewise. Don't duplicate long options either. - (gld${EMULATION_NAME}_add_sysroot): Prototype. - * emultempl/armelf.em (PARSE_AND_LIST_LONGOPTS): Don't duplicate - options. - * emultempl/hppaelf.em (PARSE_AND_LIST_LONGOPTS): Likewise. - * emultempl/ppc32elf.em (PARSE_AND_LIST_LONGOPTS): Likewise. - * emultempl/ppc64elf.em (PARSE_AND_LIST_LONGOPTS): Likewise. - * emultempl/armelf_oabi.em (ld_${EMULATION_NAME}_emulation): Adjust - initializer. - * emultempl/generic.em: Likewise. - * emultempl/gld960.em: Likewise. - * emultempl/gld960c.em: Likewise. - * emultempl/linux.em: Likewise. - * emultempl/lnk960.em: Likewise. - * emultempl/m68kcoff.em: Likewise. - * emultempl/mipsecoff.em: Likewise. - * emultempl/sunos.em: Likewise. - * emultempl/vanilla.em: Likewise. - * emultempl/netbsd.em (gldnetbsd_before_parse): Prototype. - -2003-02-25 Alexandre Oliva <aoliva@redhat.com> - - * emultempl/elf32.em (gld${EMULATION_NAME}_add_sysroot): Fix - memory allocation error. - - * Makefile.am (ldmain.o): Define TOOLBINDIR. - * Makefile.in: Rebuilt. - * ldmain.c (ld_sysroot): Try to set from TOOLBINDIR too. - -2003-02-21 Bob Wilson <bob.wilson@acm.org> - - * ldlang.c (lang_size_sections_1): Add CHECK_REGIONS argument and only - call os_region_check when it is set. - (lang_size_sections): Add CHECK_REGIONS argument and pass it through to - lang_size_sections_1. - (lang_process): Change lang_size_sections calls to set CHECK_REGIONS - only for the last call, not on every relaxation iteration. - * ldlang.h (lang_size_sections): Update prototype. - * pe-dll.c (pe_dll_fill_sections): Set CHECK_REGIONS argument in calls - to lang_size_sections. - (pe_exe_fill_sections): Likewise. - * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Likewise. - * emultempl/hppaelf.em (hppaelf_layout_sections_again): Likewise. - * emultempl/ppc64elf.em (ppc_before_allocation): Likewise. - (ppc_layout_sections_again): Likewise. - -2003-02-21 Bob Wilson <bob.wilson@acm.org> - - * gen-doc.texi: Set ARM and HPPA variables. - * ld.texinfo: Fix typos and obvious texinfo mistakes. Make section - title capitalization more consistent. Add missing menu entries for - machine-specific sections and conditionalize them consistently. - Conditionalize text that is irrelevant when SingleFormat is set. - Add @group divisions to improve page breaks in long examples. - Use @iftex/@ifnottex instead of @iftex/@ifinfo so that HTML output - is correct. Remove "FIXME" comment about not using - @raisesections/@lowersections. Use @raisesections/@lowersections - consistently for machine-specific sections. Change to be more polite - about poor bug reports. Replace FDL appendix with include of fdl.texi. - Move WIN32 node to match its order in the menus. - * fdl.texi: New file. - -2003-02-20 Alexandre Oliva <aoliva@redhat.com> - - * configure.in (TARGET_SYSTEM_ROOT): Set default to - ${exec_prefix}/${target_alias}/sys-root. Match explicit - '${exec_prefix}' (in addition to the expansion thereof) as - relocatable. - * configure: Rebuilt. - -2003-02-20 Phil Edwards <pme@gcc.gnu.org> - - * ldgram.y (vers_defns): Also recurse with 'EXTERN NAME' patterns. - -2003-02-20 Harri Porten <porten@kde.org> - - * ldgram.y (vers_defns): Allow optional trailing semicolon in - EXTERN NAME block; - -2003-02-18 Alan Modra <amodra@bigpond.net.au> - - * emultempl/ppc32elf.em: New file. - * emulparams/elf32ppc.sh (EXTRA_EM_FILE): Define. - * Makefile.am (eelf32lppc.c): Depend on emultempl/ppc32elf.em. - (eelf32lppcnto.c): Likewise. - (eelf32lppcsim.c): Likewise. - (eelf32ppcnto.c): Likewise. - (eelf32ppc.c): Likewise. - (eelf32ppc_fbsd.c): Likewise. - (eelf32ppcsim.c): Likewise. - (eelf32ppclinux.c): Likewise. - * Makefile.in: Regenerate. - -2003-02-18 Alan Modra <amodra@bigpond.net.au> - - * ld.texinfo: Remove spaces between @samp and opening brace. - -2003-02-18 Alan Modra <amodra@bigpond.net.au> - - * emultempl/ppc64elf.em (ppc_create_output_section_statements): Check - hash creator. - (ppc_before_allocation): Don't do optimizations if wrong hash table. - (gld${EMULATION_NAME}_finish): Ditto. - -2003-02-17 Nick Clifton <nickc@redhat.com> - - * ldmain.c (main) Default allow_shlib_undefined to true. - * lexsup.c (ld_options): Add --no-allow-shlib-undefined. - (parse_args): Parse the new switch. - * ld.texinfo: Document new switch and default behaviour of - allowing undefined symbols in shared libraries. - -2003-02-11 Dmitry Diky <diwil@mail.ru> - - * scripttempl/elf32msp430.sc: Add new data anchors definitions. - * scripttempl/elf32msp430_3.sc: Likewise. - -2003-02-11 Uwe Stieber <uwe@wwws.de> - - * configure.tgt: Add support for kaOS as cross build target - system. - -2003-02-10 John Daivid Anglin <dave.anglin@nrc-cnrc.gc.ca> - - * hppaelf.em (group_size): Change default back to 1. - -2003-02-09 Alan Modra <amodra@bigpond.net.au> - - * emultempl/ppc64elf.em: Add "no-tls-optimize" option and support code. - -2003-02-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> - - * hppaelf.em (group_size): Change default to -1. - -2003-02-07 Nick Clifton <nickc@redhat.com> - - * emultempl/armelf.em (PARSE_AND_LIST_SHORTOPTS): Remove 'n' short - opt. - (PARSE_AND_LIST_LONGOPTS): Add duplicate entry for - no-pipeline-knowledge. This will prevent the getopt package from - thinking that there are any shorter abbreviations for - --no-pipeline-knowledge. - -2003-02-07 Jakub Jelinek <jakub@redhat.com> - - * genscripts.sh (LIB_PATH): Don't append LIBPATH_SUFFIX to paths - which already have it. Avoid duplicates. - -2003-02-06 Jakub Jelinek <jakub@redhat.com> - - * emulparams/elf64_s390.sh (LIBPATH_SUFFIX): Set to 64. - * emulparams/elf_x86_64.sh (LIBPATH_SUFFIX): Likewise. - * emulparams/elf64_sparc.sh (LIBPATH_SUFFIX): Set instead of suffix. - -2003-02-05 Alan Modra <amodra@bigpond.net.au> - - * emultempl/ppc64elf.em (ppc_before_allocation): Size sections then - call ppc64_elf_tls_optimize. - -2003-02-03 Daniel Jacobowitz <drow@mvista.com> - - * emultempl/elf32.em: Move gld${EMULATION_NAME}_add_sysroot - outside of GNU/Linux conditional. - -2003-01-28 Ralf Habacker <ralf.habacker@freenet.de> - - * deffilep.y (def_get_module): New function: locate an already - added module. - * deffile.h (def_get_module): New prototype. - * pe-dll.c (pe_implied_import_dll): Add code to prevent importing - a dll multiple times. - -2003-01-23 Alan Modra <amodra@bigpond.net.au> - - * emultempl/sh64elf.em: Include elf32-sh64.h. - (sh64_elf_${EMULATION_NAME}_before_allocation): Adjust for changed - sh64_elf_section_data. - (sh64_elf_${EMULATION_NAME}_after_allocation): Likewise. - -2003-01-23 Wu Yongwei <adah@netstd.com> - - * ld.texinfo: Remove an extra "i" in --dll-search-prefix. - * emultempl/pe.em (gld_${EMULATION_NAME}_list_options): Move a - cross-80th-column-margin "an" to the next line. - -2003-01-21 Nick Clifton <nickc@redhat.com> - - * emulparams/tic3xcoff-onchip.sh: Rename to ...z - * emulparams/tic3xcoff_onchip.sh: ...this. - * Makefile.am (etic3xcoff_onchip.c): Fix name of generated C file. - * Makefile.in: Regenerate. - -2003-01-21 Fabio Alemagna <falemagn@aros.org> - - * configure.tgt: Handle i[3456]86-*-aros* - -2003-01-19 Svein E. Seldal <Svein.Seldal@solidas.com> - - * Makefile.am: Added etic3xcoff.o and etic4xcoff_onchip.o - * Makefile.in: Regenerate - * configure.tgt: Added extra target emulations - * emulparams/tic3xcoff.sh: Remove old settings - * emulparams/tic4xcoff.sh: Ditto - * emulparams/tic3xcoff-onchip.sh: Added new - * scripttempl/tic4xcoff.sc: Revise and combine both c3x and c4x - * scripttempl/tic3xcoff.sc: Remove - -2003-01-17 Andreas Jaeger <aj@suse.de> - - * emultempl/elf32.em (gld${EMULATION_NAME}_add_sysroot): Do not - skip ':'. - -2003-01-16 Alan Modra <amodra@bigpond.net.au> - - * Makefile.in: Regenerate. - -2002-01-14 Charles Wilson <cwilson@ece.gatech.edu> - - * ld/ld.texinfo (node WIN32): Some clarifications - and formatting fixups. - -2003-01-09 Chris Demetriou <cgd@broadcom.com> - - * ldmain.c (get_emulation): Sort -mipsNN checks in the usual - order, and handle (ignore) -mips32r2. - -2003-01-09 Daniel Jacobowitz <drow@mvista.com> - - * ldmain.c (main): Make sure ld_sysroot is initialized. - -2003-01-06 Daniel Jacobowitz <drow@mvista.com> - - * Makefile.am (eelf32iq10.c): Fix tab/whitespace mixup. - - * Makefile.am (ldmain.o): Add @TARGET_SYSTEM_ROOT_DEFINE@. - (GENSCRIPTS): Add @use_sysroot@. - * Makefile.in: Regenerated. - * configure.host: Move setting of NATIVE_LIB_DIRS to... - * configure.tgt: ... here. Use ${target} instead of ${host} - for NATIVE_LIB_DIRS. - * configure.in: Add --with-sysroot. - * configure: Regenerated. - * genscripts.sh: Accept use_sysroot option. Set new variables - NATIVE and USE_LIBPATH. Prepend "=" to directory names if - $use_sysroot. Don't search $tool_lib if $use_sysroot. - * ldfile.c (ldfile_add_library_path): Handle leading '='. - * ldmain.c (TARGET_SYSTEM_ROOT): Define if not defined. - (ld_sysroot): New variable. - (main): Initialize ld_sysroot. - * ldmain.h (ld_sysroot): New extern. - * emultempl/elf32.em: Use NATIVE and USE_LIBPATH instead of - searching $EMULATION_LIBPATH. - (gld${EMULATION_NAME}_add_sysroot): New function. - (gld${EMULATION_NAME}_check_ld_so_conf): Use it. Honor ld_sysroot. - (gld${EMULATION_NAME}_after_open): Likewise. Only search - environment variables if $NATIVE. - * ld.texinfo (Options): Mention "=" prefix in the description of -L. - * NEWS: Mention --with-sysroot. - - * emulparams/elf32bmipn32-defs.sh: Set NATIVE and LIBPATH_SUFFIX - instead of setting LIB_PATH. - * emulparams/elf32ppc.sh: Likewise. - * emulparams/elf64_s390.sh: Likewise. - * emulparams/elf64_sparc.sh: Likewise. - * emulparams/elf64ppc.sh: Likewise. - * emulparams/elf_x86_64.sh: Likewise. - - * emulparams/elf64_aix.sh: Add "=" prefixes to LIB_PATH. - * emulparams/elf64hppa.sh: Add "=" prefixes to LIB_PATH. - -2003-01-03 Charles Wilson <cwilson@ece.gatech.edu> - - * ld/pe-dll.c (autofilter_symbollist): Add cygwin_crt0. - -2003-01-04 Daniel Jacobowitz <drow@mvista.com> - - * Makefile.am (ldmain.o): Pass BINDIR. - * Makefile.in: Regenerated. - * ldmain.c (set_scripts_dir): Use make_relative_prefix for the first - search path. + * po/fr.po: Updated French translation. -2003-01-02 Ben Elliston <bje@redhat.com> +2004-05-05 Alexandre Oliva <aoliva@redhat.com> - * Makefile.am (ALL_EMULATIONS): Add eelf32iq2000.o. - (eelf32iq2000.c): New target. - * Makefile.in: Regenerate. - * configure.tgt: Handle iq2000-*-elf. - * emulparams/elf32iq10.sh: New file. - * emulparams/elf32iq2000.sh: New file. - * scripttempl/iq2000.sc: New file. + * emulparams/elf32frvfd.sh (OUTPUT_FORMAT): Switch to new + elf32-frvfdpic. -2003-01-02 Charles Wilson <cwilson@ece.gatech.edu> +2004-04-29 Alan Modra <amodra@bigpond.net.au> - * pe-dll.c (autofilter_symbollist): Add do_pseudo_reloc - and _pei386_runtime_relocator to the exclude list. + * pe-dll.c: Revert changes accidentally committed 2004-03-08. + (fill_edata): Correct pointer arithmetic. -2003-01-01 Kazu Hirata <kazu@cs.umass.edu> +2004-04-21 Hans-Peter Nilsson <hp@axis.com> - * ldfile.c: Fix comment typos. - * ldlang.c: Likewise. - * mri.c: Likewise. - * pe-dll.c: Likewise. + * NEWS: Mention change in DEFINED semantics. -2003-01-01 Daniel Jacobowitz <drow@mvista.com> +2004-04-20 Chris Demetriou <cgd@broadcom.com> - Suggested by Manfred Hollstein <manfred.h@gmx.net>: - * Makefile.am (ld.1): Depend on configdoc.texi - and ldver.texi. - * Makefile.in: Regenerated. + * NEWS: Note that MIPS --embedded-relocs option is deprecated. -2002-12-24 Dmitry Diky <diwil@mail.ru> +2004-04-11 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> - * Makefile.am: Add msp430 target. + * configure.host: Remove mips*-dec-bsd* target. * configure.tgt: Likewise. - * Makefile.in: Regenerate. - * emulparams/msp430x???.sh: New files. Linker script parameters - for various msp430 configurations. - * gen-doc.texi: Enable msp430 documenation. - * ld.texinfo: Document msp430 sections. - * scripttempl/elf32msp430.sc: New file. Linker script for msp430. - * scripttempl/elf32msp430_3.sc: New file. Linker script for msp430. - -2002-12-30 Ralf Habacker <Ralf.Habacker@freenet.de> - Charles Wilson <cwilson@ece.gatech.edu> - - * ld/config.in (HAVE_REALPATH): New entry. - (HAVE_SYS_STAT_H, HAVE_SYS_TYPES_H): Removed: obsolete. - -2002-12-30 Ralf Habacker <ralf.habacker@freenet.de> - - * ld.texinfo: New win32 topics: 'symbol aliasing' and 'export dll - symbols'. - -2002-12-23 Alan Modra <amodra@bigpond.net.au> - - * ldmain.c (main): Init "strip_discarded". - * lexsup.c (OPTION_STRIP_DISCARDED): Define. - (OPTION_NO_STRIP_DISCARDED): Define. - (ld_options): Add "strip-discarded" and "no-strip-discarded". - (parse_args): Handle them. - -2002-12-23 Nick Clifton <nickc@redhat.com> - - * ld.h (struct args_type): Add new field - 'accept_unknown_input_architecture'. - * ldmain.c (main): Initialise 'accept_unknown_input_architecture' - to false. - * ldlang.c (lang_check): Pass accept_unknown_input_architecture to - bfd_arch_get_compatible. - * ldfile.c (ldfile_try_open_bfd): Likewise. - * lexsup.c (ld_options): Add new command line switch - --accept-unknown-input-architecture and its inverse. - (parse_args): Handle --accept-unknown-input-architecture. - * ld.texinfo: Document new linker option. - * NEWS: Mention new linker option. - -2002-12-20 Alan Modra <amodra@bigpond.net.au> - - * ldmain.c (main): Re-order link_info initialization. Init all - fields. - -2002-12-19 Charles Wilson <cwilson@ece.gatech.edu> - - * ld.texinfo: Clarify and extend the documentation - in the Machine Dependent, WIN32 section. - -2002-12-18 Ralf Habacker <ralf.habacker@freenet.de> - - * ld.texinfo: Add win32 machine depending section. - * gen-doc.texi: Enable win32 machine depending section. - - * configure.host: Add win32 library search path. - -2002-12-17 Ralf Habacker <ralf.habacker@freenet.de> - - * ld/emultempl/pe.em (pe_find_data_imports): Don't search for data - import when auto-import is disabled. - -2002-12-17 Danny Smith <dannysmith@users.sourceforge.net> - - * emultempl/pe.em (..._recognized_file): Use LD_PATHMAX+1 to - account for trailing '\0'. - -2002-12-17 Nick Clifton <nickc@redhat.com> - - * emultempl/pe.em (longopts): Duplicate entry for --compact-implib - so that it is not confused with -c. - -2002-12-13 Ralf Habacker <Ralf.Habacker@freenet.de> - Charles Wilson <cwilson@ece.gatech.edu> - - * configure.in: Add check for realpath function. - * configure: Regenerate. - * config.in: Regenerate. - * aclocal.m4: Regenerate. - * deffile.h: Add .data field to def_file_import - structure. - * pe-dll.c (pe_proces_import_defs): Use .data field of - def_file_import structure to initialize flag_data field of - def_file_export structure. - (pe_implied_import_dll): New variables exp_funcbase and - [data|bss]_[start|end]. Use DLL's internal name to set dll_name, - not filename (which may be a symlink). Scan the sections and - initialize [data|bss]_[start|end]. When scanning the export - table, skip _nm_ symbols, and mark any symbols whose rva indicates - that it is in the .bss or .data sections as data. - * sysdep.h: Include limits.h and sys/param.h, and define - LD_PATHMAX as appropriate. Also define REALPATH as realpath if it - exists, NULL otherwise. - * emultempl/pe.em (gld_${EMULATION_NAME}_after_open): Call - pe_process_import_defs before pe_find_data_imports, so that - auto-import will check the virtual implib as well as "real" - implibs. - (gld_${EMULATION_NAME}_recognized_file): Use REALPATH to follow - symlinks to their target; check that the target's extension is - .dll before calling pe_implied_import_dll(), not the filename - itself (which may be a symlink). - -2002-12-10 Alan Modra <amodra@bigpond.net.au> - - * emultempl/elf32.em (struct orphan_save): Add os_tail field. - (gld${EMULATION_NAME}_place_orphan): Re-order output_section_statement - list too. - -2002-12-08 Alan Modra <amodra@bigpond.net.au> - - * ldlang.h: Formatting. - -2002-12-07 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (init_os): Ensure sections mentioned in load_base - are initialized. - -2002-12-05 Alan Modra <amodra@bigpond.net.au> - - * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Set - load_base for orphans that follow a section with load_base set. -2002-12-01 H.J. Lu <hjl@gnu.org> - - * ld.texinfo: Remove the extra `;' in sample version script. - -2002-11-30 Alan Modra <amodra@bigpond.net.au> - - * configure.host: Correct dynamic-linker for powerpc64 hosts. - - * Makefile.am (eelf32ppcwindiss.c): Correct dependencies. - * Makefile.in: Regenerate. - - * ld.h, ldcref.c, ldctor.c, ldctor.h, ldemul.c, ldemul.h, ldexp.c, - ldexp.h, ldfile.c, ldfile.h, ldgram.y, ldlang.c, ldlang.h, ldmain.c, - ldmain.h, ldmisc.c, ldwrite.c, lexsup.c, mri.c, pe-dll.c, pe-dll.h, - emulparams/elf32b4300.sh, emultempl/aix.em, emultempl/armcoff.em, - emultempl/armelf.em, emultempl/armelf_oabi.em, emultempl/beos.em, - emultempl/elf32.em, emultempl/generic.em, emultempl/gld960.em, - emultempl/gld960c.em, emultempl/hppaelf.em, emultempl/linux.em, - emultempl/lnk960.em, emultempl/m68kcoff.em, emultempl/mipsecoff.em, - emultempl/mmix-elfnmmo.em, emultempl/mmixelf.em, emultempl/mmo.em, - emultempl/needrelax.em, emultempl/pe.em, emultempl/ppc64elf.em, - emultempl/sh64elf.em, emultempl/sunos.em, emultempl/ticoff.em: Replace - boolean with bfd_boolean, true with TRUE, false with FALSE. Simplify - comparisons of bfd_boolean vars with TRUE/FALSE. Formatting. - -2002-11-27 David O'Brien <obrien@FreeBSD.org> - - * configure.host: Fix generic FreeBSD configuration entry. - -2002-11-27 H.J. Lu <hjl@gnu.org> - - * ld.texinfo: Add the missing `;' to sample version scripts. - -2002-11-20 Alan Modra <amodra@bigpond.net.au> - - * emulparams/elf64ppc.sh (SEGMENT_SIZE): Don't define. - -2002-11-14 Egor Duda <deo@logos-m.ru> - - * ldmain.c (main): Make runtime relocs disabled by default. Remove - assignment which has no effect. - * pe-dll.h (pe_create_import_fixup): Change prototype. - * pe-dll.c (make_runtime_pseudo_reloc): New function. - (pe_create_runtime_relocator_reference): Ditto. - (pe_create_import_fixup): Handle relocations with non-zero addends. - * emultempl/pe.em: Add options --enable-runtime-pseudo-reloc and - --disable-runtime-pseudo-reloc. - (make_import_fixup): Handle relocations with non-zero addends. Create - an external reference to _pei386_runtime_relocator symbol if at least - one pseudo reloc was created. - * ld.texinfo: Document --enable-runtime-pseudo-reloc and - --disable-runtime-pseudo-reloc options. - -2002-11-12 Earl Chew <earl_chew@agilent.com> - - * ldlang.c (lang_add_section): Discard debugging sections that have - been marked SEC_EXCLUDE. - -2002-11-12 Nick Clifton <nickc@redhat.com> - - * configure.in (ALL_LINGUAS): Add da. - * configure: Regenerate. - * po/da.po: New Danish translation. - -2002-11-12 Alan Modra <amodra@bigpond.net.au> - - * emultempl/ppc64elf.em (ppc_before_allocation): New function. - (LDEMUL_BEFORE_ALLOCATION): Define. - (gld${EMULATION_NAME}_finish): Run discard_info for relocatable - linking. - * emultemp/hppaelf.em ((gld${EMULATION_NAME}_finish): Likewise. - -2002-11-11 Christopher Faylor <cgf@redhat.com> - - * configure.tgt (LIB_PATH): Default to searching w32api directory under - cygwin. - -2002-11-11 Charles Wilson <cwilson@ece.gatech.edu> - - * pe-dll.c (autofilter_liblist): add libmingwex and libgcj to the list - of restricted auto-export libs. - -2002-11-11 Charles Wilson <cwilson@ece.gatech.edu> - - * pe-dll.c (autofilter_liblist): Generalize library names to catch more - creative library naming instances like, e.g., libstdc++-2.a. - -2002-11-06 Alexandre Oliva <aoliva@redhat.com> - - * emulparams/elf32btsmipn32.sh (TEXT_DYNAMIC): Define. - * emulparams/elf64btsmip.sh (TEXT_DYNAMIC): Likewise. - -2002-11-07 Danny Smith <dannysmith@users.sourceforge.net> - - * deffilep.y (def_lex): Handle '@' as first character of an ID. - * pe-dll.c (auto-export): Filter on "_imp_" prefix, not "_imp__". - (make_one): Don't prefix decorated fastcall symbols with '_'. - (pe_process_import_defs): Likewise. - * emultempl/pe.em (pe_fixup_stdcalls): Don't fixup fastcall - symbols to cdecl names or vise-versa. - -2002-10-13 Eric Kohl <ekohl@rz-online.de> - - * pe-dll.c (process_def_file): Handle fastcall symbols when - generating undecorated aliases. Don't prefix decorated fastcall - symbols with '_'. - (fill_exported_offsets): Don't prefix decorated fastcall symbols - with '_'. - -2002-10-29 Daniel Jacobowitz <drow@mvista.com> - - * emultempl/aix.em: Use include <> for generated headers. - * emultempl/beos.em: Likewise. - * emultempl/elf32.em: Likewise. - * emultempl/pe.em: Likewise. - * ldctor.c: Likewise. - * ldexp.c: Likewise. - * ldfile.c: Likewise. - * ldlang.c: Likewise. - * ldlex.c: Likewise. - * ldlex.l: Likewise. - * ldmain.c: Likewise. - * ldmisc.c: Likewise. - * ldwrite.c: Likewise. - * lexsup.c: Likewise. - * mri.c: Likewise. - * pe-dll.c: Likewise. - -2002-10-23 Jakub Jelinek <jakub@redhat.com> - - * emultempl/elf32.em (place_orphan): Don't put non-allocated .rel* - sections into .rel{,a}.dyn. - -2002-10-23 Nick Clifton <nickc@redhat.com> - - * lexsup.c (OPTION_NO_OMAGIC): Define. - (ld_options): Add "no-omagic" option. - (parse_args): Parse --no-omagic. - * ld.texinfo: Document --no-omagic. - * NEWS: Mention new option. - -2002-10-21 Danny Smith <dannysmith@users.sourceforeg.net> - - * scripttempl/pe.sc (__RUNTIME_PSEUDO_RELOC_LIST__, - __RUNTIME_PSEUDO_RELOC_LIST_END__): Add only when relocating. - -2002-10-22 Alexandre Oliva <aoliva@redhat.com> - - * emulparams/elf32bmipn32-defs.sh: Set ELFSIZE according to - emulation name. Set LIB_PATH only for native tools, and - search the ABI-specific versions of NATIVE_LIB_DIRS before the - .../lib variants, not instead of them. Mostly copied from... - * emulparams/elf32ppc.sh: ... here. Fixed typo. - * emulparams/elf64bmip-defs.sh: Backed out. - * emulparams/elf64bmip.sh: Import elf32bmipn32-defs.sh again. - * emulparams/elf64btsmip.sh: Likewise. - (DATA_ADDR, NONPAGED_TEXT_START_ADDR, SHLIB_TEXT_START_ADDR, - TEXT_DYNAMIC): Removed. - -2002-10-17 Alexandre Oliva <aoliva@redhat.com> - - * emulparams/elf32bmipn32-defs.sh (LIB_PATH): Set to /usr/lib32. - (GENERATE_SHLIB_SCRIPT): Set to yes. - (EXECUTABLE_SYMBOLS, WRITABLE_RODATA): Moved to... - * emulparams/elf32bmipn32.sh: here. - (GENERATE_SHLIB_SCRIPT): Deleted as redundant. - * emulparams/elf32btsmipn32.sh: Delete redundant unsets. - * emulparams/elf64bmip-defs.sh: New file. Extend - elf32bmipn32-defs.sh by overiding ELFSIZE and LIB_PATH. - * emulparams/elf64bmip.sh: Bring in definitions from - elf64bmip-defs.sh. - (ELFSIZE, GENERATE_SHLIB_SCRIPT, LIB_PATH): Delete redundant - settings. - (WRITABLE_RODATA): Moved from elf32bmipn32-defs.sh. - * emulparams/elf64btsmip.sh: Bring in definitions from - elf64bmip-defs.sh. - (ELFSIZE, GENERATE_SHLIB_SCRIPT): Delete, redundant. - (EXECUTABLE_SYMBOLS, WRITABLE_RODATA): Delete redundant unsets. - -2002-10-16 Jakub Jelinek <jakub@redhat.com> - - * configure.tgt (s390x-*-linux*): Add elf_s390 emulation. - (s390-*-linux*): Add elf64_s390 emulation if want64. - * emulparams/elf64_sparc.sh (LIB_PATH): Update to match 2002-05-22 - genscript.sh changes. - * emulparams/elf_x86_64.sh (LIB_PATH): Likewise. - * emulparams/elf64_s390.sh (LIB_PATH): Set up native 64 bit dirs. - -2002-10-15 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (load_symbols): Revert last change. - -2002-10-14 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (load_symbols): Don't call bfd_link_add_symbols when - just_syms_flag. - (lang_reasonable_defaults): Don't compare against false. - (size_input_section): Likewise. - (lang_size_sections_1): Likewise. - (lang_do_assignments): Likewise. - (lang_add_output): Likewise. - - * Makefile.am: Run "make dep-am". - * Makefile.in: Regenerate. - * ldver.c: #include "bfdver.h". - -2002-10-13 Stephane Carrez <stcarrez@nerim.fr> - - * scripttempl/elfm68hc11.sc: Use KEEP for .vectors, .installN, - .finiN section. - * scripttempl/elfm68hc12.sc: Likewise. - -2002-10-11 Alan Modra <amodra@bigpond.net.au> - - * pe-dll.c (make_import_fixup_mark): Avoid type-punned pointer. - - * ldgram.y (memory_spec): Provide empty action. - (section <NAME>): Likewise. - -2002-10-10 Jakub Jelinek <jakub@redhat.com> - - * ldfile.c (ldfile_try_open_bfd): When searching skip linker scripts if - they have OUTPUT_FORMAT not matching actual output format. - * ldlang.c (lang_get_output_target): New function. - (open_output): Use it. - * ldlang.h (lang_get_output_target): New prototype. - -2002-10-10 Alan Modra <amodra@bigpond.net.au> - - * emultempl/elf32.em (output_rel_find): Prefer .rel script sections - when orphan is .rel, .rela when orphan is .rela. - (gld${EMULATION_NAME}_place_orphan): Handle combreloc .rel* case - first. Remove outsecname var. - -2002-10-09 Richard Shann <richard.shann@superh.com> - Stephen Clarke <stephen.clarke@superh.com> - - * Makefile.am: Add eshelf32_linux.o and - eshlelf32_linux.o, new emulations for sh64 Linux. - * Makefile.in: Regenerate. - * configure.tgt: Add sh64eb-*-linux* and sh64-*-linux* emulations. - * emulparams/shelf32_linux.sh: New file. - * emulparams/shlelf32_linux.sh: New file. - -2002-10-08 H.J. Lu <hjl@gnu.org> - - * ldlang.c (lang_file_exist): Removed. - (new_afile): Revert the last change. - * ldlang.h (lang_file_exist): Removed. - * lexsup.c (parse_args): Revert the last change. - -2002-10-07 Ralf Habacker <Ralf.Habacker@freenet.de> - - * pe-dll.cc (autofilter_symbolprefixlist): Don't re-export - auto-import symbols. - (make_one): Create _nm_<symbol> for data only. - -2002-10-05 Elias Athanasopoulos <eathan@otenet.gr> - - * ldlang.c (lang_file_exist): New function. - (new_afile): Abort if the filename to be added matches the linker - output filename. - * ldlang.h: Add prototype for lang_file_exist. - * lexsup.c (parse_args): Abort if the output filename matches - one of the input filenames. - -2002-10-02 Alan Modra <amodra@bigpond.net.au> - - * emulparams/elf64ppc.sh (MAXPAGESIZE): Set to 0x10000. - -2002-09-30 Alan Modra <amodra@bigpond.net.au> - - * scripttempl/elfd30v.sc: Order reloc sections placing .plt last. - * scripttempl/elfm68hc11.sc: Likewise. - * scripttempl/elfm68hc12.sc: Likewise. - - * emultempl/elf32.em (output_rel_find): Always place orphan loadable - reloc sections just before .rel.plt/.rela.plt. - (gld${EMULATION_NAME}_place_orphan <.rel>): Remove combreloc code. - Only put loadable reloc sections in hold_rel. - -2002-09-29 H.J. Lu <hjl@gnu.org> - - * emulparams/elf32ppc.sh (OTHER_GOT_RELOC_SECTIONS): New. - -2002-09-25 Daniel Jacobowitz <drow@mvista.com> - - From "Anita Kulkarni" <AnitaK@kpit.com> - * scripttempl/sh.sc: Handle .eh_frame* and .gcc_exc* - sections. - -2002-09-25 Alan Modra <amodra@bigpond.net.au> - - * genscripts.sh (SEGMENT_SIZE): Use MAXPAGESIZE before - TARGET_PAGE_SIZE. - * scripttempl/elf.sc (DATA_SEGMENT_ALIGN): Incorporate - SEGMENT_SIZE alignment. - * emulparams/elf64ppc.sh (DATA_ADDR): Delete. - (SEGMENT_SIZE): Define. - - * ldexp.c (fold_unary): New. Split out from exp_fold_tree. - (fold_binary): Correct abs - non-abs case. - (fold_trinary): New. Split out from exp_fold_tree. - -2002-09-24 Alan Modra <amodra@bigpond.net.au> - - * emulparams/elf64ppc.sh (DATA_ADDR): Define. - * emulparams/elf64_aix.sh (DATA_ADDR): Don't use a fixed address - for start of .data, instead align up to 256M boundary. - * scripttempl/aix.sc: Likewise. - -2002-09-22 Mark Elbrecht <snowball3@softhome.net> - - * scripttempl/i386go32.sc: Handle bss unique sections. - -2002-09-21 Alan Modra <amodra@bigpond.net.au> - - * ldmisc.c (vfinfo <%C,%D,%G>): Always output bfd, section and offset. - -2002-09-17 Stan Cox <scox@redhat.com> - - * emulparams/elf32bmipn32-defs.sh: New file. - * emulparams/elf32bmipn32.sh: Use elf32bmipn32-defs.sh. - * emulparams/elf32btsmipn32.sh: Likewise. - * emulparams/elf64bmip.sh: Likewise. - * emulparams/elf64btsmip.sh: Likewise. - -2002-09-16 Bruno Haible <bruno@clisp.org> - - * emulparams/elf_i386_fbsd.sh: Set OUTPUT_FORMAT to - elf32-i386-freebsd. - * emulparams/elf64alpha_fbsd.sh: Set OUTPUT_FORMAT to - elf64-alpha-freebsd. - -2002-09-11 Nick Clifton <nickc@redhat.com> - - * NEWS: New TI port supports both C4x and C3x series of DSPs. - - * po/tr.po: Updated Turkish translation. - -2002-09-06 Jeffrey A Law (law@redhat.com) - - * configure.tgt (h8300-*-hms*, h8500-*-hms*): Restore. - -2002-09-02 Nick Clifton <nickc@redhat.com> - - * scripttempl/v850.sc: Add EXTERN references to __ctbpm __gp and - __ep. - * emulparams/v850.sh (TEMPLATE_NAME): Define. - -2002-08-30 Nick Clifton <nickc@redhat.com> - - * scripttempl/elfd10v.sc (MEMORY): Remove UNIFIED, it is not - used. Change INSN to start at 0x01000000 and extend for - 256K (ignoring holes). Start the STACK on a word aligned - boundary. - (.rodata): Start it at the READONLY_START_ADDR. - -2002-08-30 Alan Modra <amodra@bigpond.net.au> - - * emulparams/elf32ppc.sh (ARCH): Set to "powerpc:common". - -2002-08-28 Svein E. Seldal <Svein.Seldal@solidas.com> - - * Makefile.am: Add etic4xcoff.o in ALL_EMULATIONS list and - added makefile targets for this file. - * Makefile.in: Regenerate. - * configure.tgt: Added tic4x-coff and c4x-coff emulations. - * NEWS: Mention new port. - -2002-08-28 Michael Hayes <m.hayes@elec.canterbury.ac.nz> - - * emulparams/tic3xcoff.sh: New file. - * emulparams/tic4xcoff.sh: New file. - * scripttempl/tic3xcoff.sc: New file. - * scripttempl/tic4xcoff.sc: New file. - -2002-08-28 Alan Modra <amodra@bigpond.net.au> - - * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Replace strtoll, - strtoul and strtoull with bfd_scan_vma. - (gld${EMULATION_NAME}_read_file): Likewise. - -2002-08-28 Alan Modra <amodra@bigpond.net.au> - - * configure.tgt: Remove h8[35]00-*-hms*. Add h8500-*-rtems*. - -2002-08-27 Egor Duda <deo@logos-m.ru> - - * scripttempl/pe.sc: Handle .rdata_runtime_pseudo_reloc sections. - Add symbols for application to access them. - -2002-08-27 Nick Clifton <nickc@redhat.com> - - * emultempl/armelf.em: Revert this patch, it is not needed. - - 2002-08-22 Adam Nemet <anemet@lnxw.com> - -2002-08-20 Dan Kegel <dank@kegel.com> - - * configure.in: added --with-lib-path argument to ld's configure - to set LIB_PATH. - * ld/NEWS: Document new switch. - * ld/README: Mention new switch. - * configure: Regenerate. - * Makefile.in: Regenerate. - - Based on this patch: - 2001-04-25 Christopher Faylor <cgf@cygnus.com> - - * Makefile.in (LIB_PATH): Make configurable. - (GENSCRIPTS): Set LIB_PATH in environment. - * configure.in: Substitute LIB_PATH. - -2002-08-22 Adam Nemet <anemet@lnxw.com> - - * emultempl/armelf.em: Include elf-bfd.h and elf/arm.h. - (arm_elf_finish): Set the last bit of DT_INIT and DT_FINI - depending on the type of the function. - (arm_elf_convert_thumb_symbol_to_address): New function. - -2002-08-22 Graeme Peterson <gp@qnx.com> - - * Makefile.am: Add esh{l}elf_nto.o files. - * Makefile.in: Regenerate. - * configure.tgt: Add support for sh-**-nto* targets. - * emulparams/shelf_nto.sh: New file. - * emulparams/shlelf_nto.sh: New file. - -2002-08-21 John David Anglin <dave@hiauly1.hia.nrc.ca> - - * ldlang.c (offsetof): Define if not defined. - -2002-08-14 H.J. Lu <hjl@gnu.org> - - * configure.tgt: Always enable 64bit emulations for 32bit - Linux/mips. - -2002-08-13 Alan Modra <amodra@bigpond.net.au> - - * emulparams/elf32_dlx.sh (TARGET_PAGE_SIZE): Set to 1. - (MAXPAGESIZE): Set to 1. - - * ld.h (ALIGN_N): Delete. - * ldexp.h (align_n): Declare. - * ldexp.c (align_n): New function. - (fold_binary): Use align_n instead of ALIGN_N. - (exp_fold_tree): Likewise. - * ldlang.c (lang_size_sections_1): Likewise. - (lang_one_common): Likewise. - * ld.texinfo (ALIGN): Remove power of 2 restriction. - -2002-07-31 Graeme Peterson <gp@qnx.com> - - * configure.tgt: Add support for powerpc{le}-*-nto* targets. - * Makefile.am: Add eelf32{l}ppcnto.o files. - * Makefile.in: Regenerate. - * emulparams/elf32lppcnto.sh: New file. - * emulparams/elf32ppcnto.sh: New file. - -2002-08-07 H.J. Lu <hjl@gnu.org> - - * ld.texinfo: Document --no-undefined-version. - - * ldlang.c (lang_new_vers_pattern): Set the `symver' and - `script.' fields to 0. - - * ldmain.c (main): Initialize the allow_undefined_version to - true. - - * lexsup.c (OPTION_NO_UNDEFINED_VERSION): New. - (ld_options): Add --no-undefined-version. - (parse_args): Support OPTION_NO_UNDEFINED_VERSION. - -2002-08-07 Nick Clifton <nickc@redhat.com> - - * emultempl/armelf.em (arm_elf_before_allocation): Only search for - an interworking bfd if there are input bfds. (107501) - -2002-08-06 Alan Modra <amodra@bigpond.net.au> - - * emultempl/aix.em (gld*_before_parse): Set default arch. Reverts - 2002-05-10 change. - -2002-08-01 Nick Clifton <nickc@redhat.com> - - * emulparams/armelf.sh: Revert previous delta. - * scripttempl/elf.sc: Revert previous delta. - -2002-07-31 H.J. Lu <hjl@gnu.org> - - * configure.tgt (powerpc*-*-linux*): Enable elf64ppc for - --enable-64-bit-bfd. - -2002-07-31 H.J. Lu <hjl@gnu.org> - - * configure.tgt: Enable x86-64 emulation for Linux/i386 if - 64bit BFD is selected. - -2002-07-31 H.J. Lu <hjl@gnu.org> - - * configure.tgt: Enable 64bit emulations for 32bit Linux/mips - if 64bit BFD is selected. - -2002-07-31 Ian Dall <ian@sibyl.beware.dropbear.id.au> - - * emultempl/netbsd.em (LDEMUL_BEFORE_PARSE): New file to custom set - link_info.common_skip_ar_aymbols. - * emulparams/ns32knbsd.sh (EXTRA_EM_FILE): Refer to extra file. - - * ldmain.c (main): Initialize new field - link_info.common_skip_ar_aymbols. - -2002-07-31 Adam Nemet <anemet@lnxw.com> - - * emulparams/armelf.sh (OTHER_PLT_SECTIONS): New variable. Set it - to .plt.thumb. - * scripttempl/elf.sc: Comment it. Use the same way as ${PLT} is - used. - -2002-07-31 Nick Clifton <nickc@redhat.com> - - * NEWS: Retroactively add entry for Lars Brinkhoff's contribution - of the PDP-11 and 2.11BSD a.out support. - -2002-07-31 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> - - * Makefile.am (eelf32btsmipn32.o, eelf32ltsmipn32.o): New emulations - for n32 ABI support. - * Makefile.in: Regenerate. - * configure.tgt (mips64*el-*-linux-gnu*,mips64*-*-linux-gnu*): Add - n32 ABI emulations for these 64 bit targets. - * emulparams/elf32bmipn32.sh: Expand comment. - * emulparams/elf32btsmipn32.sh: New file, for traditional big endian - n32 ABI. - * emulparams/elf32ltsmipn32.sh: Likewise for little endian. - -2002-07-30 Graeme Peterson <gp@qnx.com> - - * configure.tgt: Add support for arm-*-nto target. - * Makefile.am: Add earmnto.o file. - * Makefile.in: Regenerate. - * NEWS: Mention port of ARM support to QNX. - * emulparams/armnto.sh: New file. - -2002-07-30 Jakub Jelinek <jakub@redhat.com> - - * ldlang.c (lang_add_section): Don't turn .tbss into normal sections - for relocatable link. - (lang_size_sections_1): Don't make .tbss zero size for relocatable - link. - -2002-07-26 Bernd Schmidt <bernds@redhat.com> - - * emulparams/elf32frv.sh (OTHER_RELOCATING_SECTIONS): Delete. - (STACK_ADDR): New. - -2002-07-25 Nick Clifton <nickc@redhat.com> - - * po/sv.po: Updated Swedish translation. - * po/es.po: Updated Spanish translation. - * po/fr.po: Updated French translation. - -2002-07-24 Nick Clifton <nickc@redhat.com> +2004-04-09 Daniel Jacobowitz <drow@mvista.com> + Merge from mainline: + 2004-03-30 Nick Clifton <nickc@redhat.com> * po/sv.po: Updated Swedish translation. - * po/es.po: Updated Spanish translation. - -2002-07-23 Nick Clifton <nickc@redhat.com> - - * po/fr.po: Updated French translation. - -2002-07-20 Alan Modra <amodra@bigpond.net.au> - - * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't - bomb on /DISCARD/ input section. - * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise. - * emultempl/mmo.em (mmo_place_orphan): Likewise. - -2002-07-19 Hans-Peter Nilsson <hp@bitrange.com> - - * emultempl/mmo.em (mmo_place_orphan): Handle case of no .text - output section. - -2002-07-16 Denis Chertykov <denisc@overta.ru> - Nick Clifton <nickc@redhat.com> - Frank Ch. Eigler <fche@redhat.com> - John Healy <jhealy@redhat.com> - - * configure.tgt: Add support for ip2k-elf. - * Makefile.am: Add support for ip2k-elf. - * Makefile.in: Regenerate. - * emulparams/elf32ip2k.sh: New file. - * scripttempl/ip2k.sc: New file - * NEWS: Mention support for new port. - -2002-07-16 Nick Clifton <nickc@cambridge.redhat.com> - - * NEWS: Add 'Changes in 2.13'. - -2002-07-14 H.J. Lu <hjl@gnu.org> - - * ld.texinfo: Document a .symver takes precedence over a - version script. - -2002-07-12 Alan Modra <amodra@bigpond.net.au> - - * emulparams/elf64ppc.sh (ARCH): Set to powerpc:common64. - (COMMONPAGESIZE): Define. - -2002-07-09 Alan Modra <amodra@bigpond.net.au> - - * emulparams/hppanbsd.sh: Remark that hppaobsd.sh references this file. - -2002-07-09 Federico G. Schwindt <fgsch@olimpo.com.br> - - * configure.tgt: Add support for alpha-*-openbsd*, hppa-*-openbsd*, - powerpc-*-openbsd* and sparc64-*-openbsd*. - * Makefile.am (ALL_EMULATIONS): Add ehppaobsd.o. - * Makefile.in: Regenerate. - * emulparams/hppaobsd.sh: New file. - -2002-07-05 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (print_wild_statement): Fix output formatting. - -2002-07-04 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c: (strip_excluded_output_sections): New function. - (lang_process): Call it. - (lang_size_sections_1): Revert 2002-06-10 change. - -2002-07-03 Alan Modra <amodra@bigpond.net.au> - - * Makefile.am (check-DEJAGNU): Revert 2002-06-25 change. - Run "make dep-am". - * Makefile.in: Regenerate. -2002-07-02 Alan Modra <amodra@bigpond.net.au> + 2004-03-20 Alexandre Oliva <aoliva@redhat.com> + * emulparams/elf32frvfd.sh (MAXPAGESIZE): Change to 16Kb. - * ldfile.c (ldfile_try_open_bfd): Formatting. + 2004-03-08 Danny Smith <dannysmith@users.sourceforge.net> + * pe-dll.c (pe_dll_generate_implib): Skip sections marked as + private when building implib. - * ldmisc.c (demangle): Move so that it doesn't intrude between - vfinfo comment and body. Add comment. + 2004-03-01 Andreas Schwab <schwab@suse.de> + * ld.texinfo (Options): Fix example for --wrap. -2002-07-01 John David Anglin <dave@hiauly1.hia.nrc.ca> + 2004-02-25 Danny Smith <dannysmith@users.sourceforge.net> + * pe-dll.c (fill_edata): Check that exported_symbol_sections is + not NULL. - * emulparams/vax.sh (OUTPUT_FORMAT): Use a.out-vax-bsd format. + 2004-02-23 Ian Lance Taylor <ian@wasabisystems.com> + * ldlang.c (lang_check): Use %P, not %E, in error message. -2002-07-01 Alan Modra <amodra@bigpond.net.au> +2004-04-08 Richard Sandiford <rsandifo@redhat.com> - * ldlang.h (entry_sym): Make it a struct bfd_sym_chain. - * ldlang.c (entry_sym): Likewise. - (ldlang_undef_chain_list_type): Likewise. - (lang_finish): Adjust references to entry_symbol. - (lang_add_entry): Likewise. - (lang_gc_sections): Use link_info.gc_sym_list. - (lang_process): Set link_info.gc_sym_list. - * ldlex.l: Include bfdlink.h. - * ldmain.c (main): Init link_info.gc_sym_list. - * emultempl/aix.em: Adjust references to entry_symbol. - * emultempl/armcoff.em: Likewise. - * emultempl/armelf.em: Likewise. - * emultempl/pe.em: Likewise. - * emultempl/ppc64elf.em (ppc_after_open): New function. - (LDEMUL_AFTER_OPEN): Define. - * emulparams/elf64ppc.sh: KEEP .opd sections. - -2002-06-29 Stephane Carrez <stcarrez@nerim.fr> - - * emulparams/m68hc12elfb.sh (EEPROM_MEMORY): Define. - * emulparams/m68hc11elfb.sh (EEPROM_MEMORY): Define. - * emulparams/m68hc11elf.sh (EEPROM_SIZE): Define. - (EEPROM_START_ADDR): Define. - (EEPROM_MEMORY): Define. - * emulparams/m68hc12elf.sh: Likewise. - * scripttempl/elfm68hc11.sc: Handle .eeprom section; handle .softregs - section to put soft registers in .page0. - * scripttempl/elfm68hc12.sc: Likewise but put soft registers in bss. - -2002-06-26 John David Anglin <dave@hiauly1.hia.nrc.ca> - - * emulparams/hppa64linux.sh (OTHER_GOT_RELOC_SECTIONS): Add rela.opd - section. Add ${RELOCATING-0}. - -2002-06-26 J"orn Rennecke <joern.rennecke@superh.com> - - * emulparams/shelf.sh (STACK_ADDR): Don't define. - (OTHER_SECTIONS): Define. - * emulparams/shelf_nbsd.sh ((STACK_ADDR): Don't undef. - (OTHER_SECTIONS): Undef. - -2002-06-26 Alan Modra <amodra@bigpond.net.au> - - * ldmisc.c (demangle): Restore dots stripped from sym name. - -2002-06-25 H.J. Lu <hjl@gnu.org> - - * Makefile.am (check-DEJAGNU): Set LC_ALL=C and export it. - * Makefile.in: Regenerated. - -2002-06-20 Nick Clifton <nickc@cambridge.redhat.com> - - * ld.texinfo (Bug Reporting): Update text to suggest a limit on - the size of attached object files, to allow make the object files - available via FTP or HTTP and to mention that the mail will be - sent to a mailing list. - -2002-06-20 Nathanael Nerode <neroden@twcny.rr.com> - - * ld/configure.host (romp): Drop support. - -2002-06-18 Chris Demetriou <cgd@broadcom.com> - - * emultempl/mipself.em (mips_elf${ELFSIZE}_check_sections): Check - section flags for SEC_DATA, rather than for SEC_CODE being unset. - -2002-06-18 Chris Demetriou <cgd@broadcom.com> - - * emultempl/mipself.em (mips_elf${ELFSIZE}_check_sections): Fix - format specifier used to print BFD name. - -2002-06-18 Dave Brolley <brolley@redhat.com> - - From Catherine Moore, Michael Meissner, Jim Blandy: - * emulparams/elf32frv.sh: New file. - * configure.tgt: Support frv-*-*. - * Makefile.am (ALL_EMULATIONS): Add eelf32frv.o. - (eelf32frv.c): New target. - -2002-06-17 Tom Rix <trix@redhat.com> - - * emultempl/elf32.em: gld*_get_script: Check for - GENERATE_COMBRELOC_SCRIPT. - * scripttempl/elfd10v.sc : Fix STACK and INSN. - * emulparams/d10velf.sh : Fix TEXT_START_ADDR. - -2002-06-13 J"orn Rennecke <joern.rennecke@superh.com> - - * configure.tgt: Add support for sh[1234]*le*-*-elf, sh[1234]*-*-elf. - -2002-06-12 H.J. Lu <hjl@gnu.org> - - * emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Return - false if xvec doesn't match. - -2002-06-10 Richard Sandiford <rsandifo@redhat.com> - - * ldlang.c (lang_size_sections_1): Skip removed output sections. - -2002-06-08 Alan Modra <amodra@bigpond.net.au> - - * ldexp.c: Replace CONST with const. - * ldfile.c: Likewise. - * ldfile.h: Likewise. - * ldlex.l: Likewise. - * mri.c: Likewise. - * pe-dll.h: Likewise. - -2002-06-07 Alan Modra <amodra@bigpond.net.au> - - * emultempl/ppc64elf.em (new_vers_pattern): Warning fix. - -2002-06-07 Charles Wilson <cwilson@ece.gatech.edu> - - * ld/ldmain.c (main): initialize link_info.pei386_auto_import - to -1 == implicit enable. - * ld/emultempl/pe.em (gld_${EMULATION_NAME}_before_parse): - initialize link_info.pei386_auto_import to -1 == implicit - enable. - (gld_${EMULATION_NAME}_parse_args): When processing - --enable-auto-import and --disable-auto-import options, use - '1' and '0' instead of 'true' and 'false'. - (pe_find_data_imports): Only issue message about auto-import - when the feature is implicitly enabled. Downgrade message to - informational instead of warning. - -2002-06-07 Alan Modra <amodra@bigpond.net.au> - - * scripttempl/elf.sc (.tbss): Fix mismatched parentheses/braces. - -2002-06-06 John David Anglin <dave@hiauly1.hia.nrc.ca> - - * configure.host (hppa*64*-*-hpux11*): Define NATIVE_LIB_DIRS, - HOSTING_CRT0 and HOSTING_LIBS. - -2002-06-05 J"orn Rennecke <joern.rennecke@superh.com> - - * configure.tgt (shle*-*-elf*, sh64le-*-elf*): New configurations. - -2002-06-05 Jason Thorpe <thorpej@wasabisystems.com> - - * emulparams/ns32knbsd.sh (EXECUTABLE_SYMBOLS): Set _DYNAMIC to 0. - (NONPAGED_TEXT_START_ADDR): Set to 0x1000. - -2002-06-05 Alan Modra <amodra@bigpond.net.au> - - * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Place - SEC_EXCLUDE sections when doing a relocatable link. - -2002-06-04 Jason Thorpe <thorpej@wasabisystems.com> - - * Makefile.am (ALL_EMULATIONS): Add eshelf32_nbsd.o, - eshlelf32_nbsd.o, eshelf64_nbsd.o, and eshlelf64_nbsd.o. - (eshelf32_nbsd.c, eshelf64_nbsd.c, eshlelf32_nbsd.c) - (eshlelf64_nbsd.c): New rules. - * Makefile.in: Regenerate. - * configure.tgt (sh5le-*-netbsd*, sh5-*-netbsd*, sh64le-*-netbsd*) - (sh64-*-netbsd*): New targets. - * emulparams/shelf32_nbsd.sh: New file. - * emulparams/shelf64_nbsd.sh: New file. - * emulparams/shlelf32_nbsd.sh: New file. - * emulparams/shlelf64_nbsd.sh: New file. - -2002-06-04 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (section_already_linked): Call bfd_discard_group. Typo fix. - -2002-06-02 Marek Michalkiewicz <marekm@amelek.gda.pl> - - * scripttempl/avr.sc: Changes to support current GCC and avr-libc, - C++ constructors/destructors, loosely based on the m68hc11 port. - -2002-05-31 Alan Modra <amodra@bigpond.net.au> - - * Makefile.in: Regenerate. - * aclocal.m4: Regenerate. - * config.in: Regenerate. - * configure: Regenerate. - -2002-05-31 Graeme Peterson <gp@qnx.com> - - * Makefile.am (ALL_EMULATIONS): Add ei386nto.o. - (ei386nto.c): Add rule. - * Makefile.in: Regenerate. - * configure.tgt: Add i[3456]86-*-nto-qnx*. - * emulparams/i386nto.sh: New file. - -2002-05-29 Jason Thorpe <thorpej@wasabisystems.com> - - * NEWS: Add entry for VAX ELF support. - -2002-05-29 Matt Thomas <matt@3am-software.com> - Jason Thorpe <thorpej@wasabisystems.com> - - * Makefile.am (ALL_EMULATIONS): Add eelf32vax.o and evaxnbsd.o. - (eelf32vax.c) - (evaxnbsd.c): New rules. - * Makefile.in: Regenerate. - * configure.tgt (vax-*-netbsdelf*) - (vax-*-netbsdaout*) - (vax-*-netbsd*): New targets. - * emulparams/elf32vax.sh: New file. - * emulparams/vaxnbsd.sh: New file. - -2002-05-29 Adam Nemet <anemet@lnxw.com> - - * emultempl/armelf.em (arm_elf_after_open): Don't determine - bfd_for_interwork, instead add glue sections to each input bfd. - (bfd_for_interwork): New global. - (arm_elf_set_bfd_for_interworking): New function. - (arm_elf_before_allocation): Use it. - -2002-05-28 Kuang Hwa Lin <kuang@sbcglobal.net> - - * Makefile.am: Add DLX make target. - * configure.tgt: Add DLX configuration. - * Makefile.in: Regenerate. - * emulparams/elf32_dlx.sh: New file - * scripttempl/dlx.sc: New file - -2002-05-27 Per Lundberg <per@caleb.dnsalias.org> - - * Makefile.am (eelf_i386_chaos): Use elf_chaos.sc script. - * Makefile.in: Regenerate. - * emulparams/elf_chaos.sh: Use elf_chaos script. - * scripttempl/elf_chaos.sc: New file. - -2002-05-27 Richard Sandiford <rsandifo@redhat.com> - - * ldlang.c (lang_size_sections_1): Move check for conflicting load - addresses and regions from here... - (lang_get_regions): ...to this new function. - (lang_leave_output_section_statement): Use lang_get_regions. - (lang_leave_overlay): Likewise. - * mri.c (mri_draw_tree): Pass null as last argument to - lang_leave_output_section_statement. - * emultempl/elf32.em (gld*_place_orphan): Likewise. - * emultempl/mmo.em (mmo_place_orphan): Likewise. - * emultempl/pe.em (gld*_place_orphan): Likewise. - -2002-05-26 Jason Thorpe <thorpej@wasabisystems.com> - - * configure.tgt: Use ns32k-*-netbsd* instead of ns32k-pc532-netbsd*. - -2002-05-25 Kazu Hirata <kazu@cs.umass.edu> - - * ldemul.c: Fix formatting. - * ldfile.c: Likewise. - * pe-dll.c: Likewise. - * pe-dll.h: Likewise. - -2002-05-25 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (lang_process): Formatting, grammar. - - * ldlex.l: Use #include "" instead of <> for local header files. - -2002-05-24 TAMURA Kent <kent@netbsd.org> - - * configure.tgt: Add a target for i386-netbsdpe. - -2002-05-23 Jakub Jelinek <jakub@redhat.com> - - * scripttempl/elf.sc: Add .rel{,a}.t{bss,data}, .tdata and .tbss. - * ldlang.c (lang_add_section): Set SEC_THREAD_LOCAL for - output section if necessary. Handle .tbss. - (lang_size_sections): Clear _raw_size for .tbss section - (it allocates space in PT_TLS segment only). - * ldwrite.c (build_link_order): Build link order for .tbss too. - -2002-05-23 Alan Modra <amodra@bigpond.net.au> - - * configure.in: Correct spelling of AC_PREREQ. - -2002-05-21 Danny Smith <dannysmith@users.sourceforge.net> - - * pe-dll.c (autofilter_liblist): Add more system libs excluded by - default. - (autofilter_objlist): Add crtbegin.o, crtend.o. - -2002-05-21 Danny Smith <dannysmith@users.sourceforge.net> - - * emultempl/pe.em (OPTION_EXCLUDE_LIBS): Add new define. - (longopts): Add new option --exclude-libs. - (gld_${EMULATION_NAME}_list_options): Give quick help about it. - (gld_${EMULATION_NAME}_parse_args): Use it. - * pe-dll.h (pe_dll_add_excludes): Add second param to prototype. - * pe-dll.c (exclude_list_struct): Add field type to distinguish symbols - from whole archives. - (pe_dll_add_excludes): Set excludes->type. - (auto_export): Add new variable libname and set to archive basename if - abfd. Use it when filtering default and user-specified libarary - excludes. Let string "ALL" mean all libs when filtering user-specified - libs. - * ld.texinfo: Document --exclude-libs. - -2002-05-22 Alan Modra <amodra@bigpond.net.au> - - * ldemul.c (ldemul_new_vers_pattern): New function. - * ldemul.h (ldemul_new_vers_pattern): Declare. - (struct ld_emulation_xfer_struct): Add new_vers_pattern. - * ldlang.c (lang_new_vers_pattern): Call ldemul_new_vers_pattern. - * emultempl/ppc64elf.em (dotsyms): New static var. - (gld${EMULATION_NAME}_new_vers_pattern): New function. - (LDEMUL_NEW_VERS_PATTERN): Define. - (PARSE_AND_LIST_PROLOGUE): Add OPTION_DOTSYMS, OPTION_NO_DOTSYMS. - (PARSE_AND_LIST_LONGOPTS): Likewise. - (PARSE_AND_LIST_ARGS_CASES): Handle them. - * emultempl/aix.em (ld_${EMULATION_NAME}_emulation): Update - initialiser. - * emultempl/armcoff.em: Likewise. - * emultempl/armelf_oabi.em: Likewise. - * emultempl/beos.em: Likewise. - * emultempl/elf32.em: Likewise. - * emultempl/generic.em: Likewise. - * emultempl/gld960.em: Likewise. - * emultempl/gld960c.em: Likewise. - * emultempl/linux.em: Likewise. - * emultempl/lnk960.em: Likewise. - * emultempl/m68kcoff.em: Likewise. - * emultempl/mipsecoff.em: Likewise. - * emultempl/pe.em: Likewise. - * emultempl/sunos.em: Likewise. - * emultempl/ticoff.em: Likewise. - * emultempl/vanilla.em: Likewise. - -2002-05-22 Alan Modra <amodra@bigpond.net.au> - - * genscripts.sh (LIB_PATH): For native targets, concatenate $libdir - and $NATIVE_LIB_DIRS. Add $tool_lib before other libs. - (LIB_SEARCH_DIRS): No need to use "tr". - (COMPILE_IN): Only set for native targets. - * configure.host (NATIVE_LIB_DIRS): Specify all native search dirs - here, rather than adding lib:/usr/lib:/usr/local/lib in genscripts.sh. - * configure.tgt (powerpc*): Set tdir_*. - (powerpcle*): Correct targ_extra_emuls. - * emulparams/elf32ppc.sh (LIB_PATH): Set up native 64 bit dirs. - * emulparams/elf64ppc.sh (LIB_PATH): Likewise. - -2002-05-22 Alan Modra <amodra@bigpond.net.au> - - * emultempl/pe.em (set_pe_subsystem): Don't set "cmdline" when - calling lang_add_entry. - -2002-05-21 H.J. Lu (hjl@gnu.org) - - * emultempl/elf32.em (gld${EMULATION_NAME}_parse_args): Handle - "-z muldefs". - (gld${EMULATION_NAME}_list_options): Add "-z muldefs". - - * ld.texinfo: Updated for --allow-multiple-definition and - "-z muldefs". - - * ldmain.c (main): Initialize the allow_multiple_definition - field to false. - - * lexsup.c (OPTION_ALLOW_MULTIPLE_DEFINITION): New. - (ld_options): Add --allow-multiple-definition. - (parse_args): Support OPTION_ALLOW_MULTIPLE_DEFINITION. - -2002-05-21 Jason Thorpe <thorpej@wasabisystems.com> - - * Makefile.am (ALL_EMULATIONS): Add earmelfb_nbsd.o. - (earmelfb_nbsd.c): New rule. + * emulparams/elf32bsmip.sh (EXTRA_EM_FILE): Define to irix. + * emulparams/elf64bmip.sh (EXTRA_EM_FILE): Likewise. + * emulparams/elf32bmipn32.sh (EXTRA_EM_FILE): Likewise. + * emultempl/irix.em: New file. + * Makefile.am (eelf32bsmip.c, eelf32bmipn32.c, eelf64bmip.c): Update + dependencies. * Makefile.in: Regenerate. - * configure.tgt (armeb-*-netbsdelf*): New target. - (arm-*-netbsdelf*): Add armelfb_nbsd to targ_extra_emuls. - (arm-*-netbsd*): Likewise. - * emulparams/armelfb_nbsd.sh: New file. - -2002-05-18 Tom Rix <trix@redhat.com> - - * emultempl/aix.em (gld*_parse_args): Add -bnortl and -bnortllib - support. - -2002-05-17 Marek Michalkiewicz <marekm@amelek.gda.pl> - - * Makefile.am: Add new emulations avr1, avr2, avr3, avr4, avr5. - * Makefile.in: Regenerate. - * configure.tgt (avr-*-*): Add avr[1-5] to targ_extra_emuls. - -2002-05-16 Marek Michalkiewicz <marekm@amelek.gda.pl> - - * emulparams/avr1.sh: New file. - * emulparams/avr2.sh: New file. - * emulparams/avr3.sh: New file. - * emulparams/avr4.sh: New file. - * emulparams/avr5.sh: New file. - * scripttempl/avr.sc: New file. - -2002-05-15 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (section_already_linked): Call bfd_link_just_syms. - (lang_place_orphans): Abort if just_syms_flag. - -2002-05-10 Tom Rix <trix@redhat.com> - - * emultempl/aix.em: (gld*_set_output_arch): New function. Use - architecture and machine information in the output bfd. - (gld*_before_parse): Remove old arch and machine code. - (choose_target): Rename to gld*_choose_target. - (rtld): Change type to int. - * ldfile.c (ldfile_try_open_bfd): Disable compatiblity check for - objects in XCOFF archives. - * ldfile.h: Update copyright date. - -2002-05-10 Jakub Jelinek <jakub@redhat.com> - - * ldmain.c (main): Enable -z combreloc by default. - -2002-05-07 Federico G. Schwindt <fgsch@olimpo.com.br> - - * Makefile.am: Honour DESTDIR. - * Makefile.in: Regenerate. - -2002-05-07 Richard Sandiford <rsandifo@redhat.com> - - * ldlang.h (lang_output_section_statement_type): Add update_dot_tree. - (lang_enter_overlay): Remove the last two parameters. - (lang_leave_overlay): Take them here instead. - * ldgram.y (memspec_at_opt): Set $$ to null if no region is given. - (section): Pass LMA and crossref flag to lang_leave_overlay rather - than lang_enter_overlay. - * ldlang.c (lang_memory_region_lookup): Return null for null names. - (lang_output_section_statement_lookup): Initialize update_dot_tree. - (lang_size_sections_1): Evaluate it. - (lang_leave_output_section_statement): Rework LMA lookup. - (overlay_lma, overlay_nocrossrefs): Remove. - (lang_enter_overlay): Remove LMA and crossref arguments. - (lang_enter_overlay_section): Don't set the LMA here. - (lang_leave_overlay): Take LMA and crossref arguments. Move the '.' - assignment to the last section's update_dot_tree. Unconditionally - use the load and run-time regions specified in the OVERLAY statement. - Likewise the first section's LMA. Only set the other sections' LMAs - when no load region is given. - -2002-05-06 Nick Clifton <nickc@redhat.com> - - * po/sv.po: New translation. - -2002-05-04 Alan Modra <amodra@bigpond.net.au> - - * emultempl/hppaelf.em (build_section_lists): New function. - (gld${EMULATION_NAME}_finish): Call elf32_hppa_setup_section_lists - and build_section_lists. - -2002-05-03 Kazu Hirata <kazu@cs.umass.edu> - - * ld.h: Fix formatting. - * ldexp.c: Likewise. - * ldfile.c: Likewise. - * ldlang.c: Likewise. - * ldmain.c: Likewise. - * lexsup.c: Likewise. - * pe-dll.c: Likewise. - -2002-05-02 Alan Modra <amodra@bigpond.net.au> - - * emultempl/ppc64elf.em (gld${EMULATION_NAME}_after_allocation): - Adjust for ppc64_elf_set_toc change. #include libbfd.h. - (build_section_lists): Do output_section tests here. - -2002-04-30 Tom Rix <trix@redhat.com> - - * emultempl/aix.em : (gld*_parse_arge): Formatting changes. - -2002-05-01 Alan Modra <amodra@bigpond.net.au> - - Long branch stubs, multiple stub sections. - * emultempl/ppc64elf.em: Include ldctor.h. - (stub_file): New var. - (group_size): New var. - (ppc_create_output_section_statements): New function. - (struct hook_stub_info): New. - (hook_in_stub): New function. - (ppc_add_stub_section): New function. - (ppc_layout_sections_again): New function. - (build_section_lists): New function. - (gld${EMULATION_NAME}_finish): Rewrite. - (real_func): New var. - (ppc_for_each_input_file_wrapper): New function. - (ppc_lang_for_each_input_file): New function. - (lang_for_each_input_file): Define. - (PARSE_AND_LIST_PROLOGUE): Define. - (PARSE_AND_LIST_LONGOPTS): Define. - (PARSE_AND_LIST_OPTIONS): Define. - (PARSE_AND_LIST_ARGS_CASES): Define. - (LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Define. - -2002-04-30 Tom Rix <trix@redhat.com> - - * emultempl/aix.em (gld*_parse_arge, gld*_before_allocation): Add - -blibpath, -bnolibpath support. - -2002-04-30 Mark Mitchell <mark@codesourcery.com> - - * Makefile.am (ALL_EMULATIONS): Add elf32ppcwindiss.o. - (eelf32ppcwindiss.c): New target. - * Makefile.in: Regenerated. - * configure.tgt: Add support for powerpc-*-windiss. - * emulparams/elf32ppcwindiss.sh: New file. - -2002-04-30 Richard Sandiford <rsandifo@redhat.com> - - * ldlang.c (print_assignment): Update print_dot for assignments to ".". - * ldexp.c (exp_print_token): Add "infix_p" argument. - (exp_print_tree): Update accordingly. - -2002-04-28 Alan Modra <amodra@bigpond.net.au> - - * Makefile.am (mpw): New maintainer mode rule to make mpw-*.c files. - * Makefile.in: Regenerate. - * mpw-elfmips.c: Delete. - * mpw-eppcmac.c: Delete. - * mpw-esh.c: Delete. - * mpw-idtmips.c: Delete. - -2002-04-17 J"orn Rennecke <joern.rennecke@superh.com> - - * emulparams/shelf32.sh (MACHINE): Now sh5. - -2002-04-17 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> - - * ldgram.y: Fix syntax warning. - -2002-04-11 Nick Clifton <nickc@cambridge.redhat.com> - - * emultempl/armelf.em (PARSE_AND_LIST_SHORTOPTS): Add 'n' in order - to prevent "-n" from being taken as an abbreviation for - "--no-pipeline-knowledge". - -2002-04-08 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (lang_size_sections_1): Don't complain about - SEC_NEVER_LOAD sections having no memory region specified. - - * ld.texinfo (Format Commands <OUTPUT_FORMAT>): Typo fix. - -2002-04-07 matthew green <mrg@redhat.com> - - * ld/configure.host (*-*-netbsd*): Add support for NetBSD/ELF. - -2002-04-04 Alan Modra <amodra@bigpond.net.au> - - * dep-in.sed: Cope with absolute paths. - * Makefile.am (dep.sed): Subst TOPDIR and BFDDIR. - Run "make dep-am". - * Makefile.in: Regenerate. - -2002-04-04 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> - - * emulparams/elf64btsmip.sh: n64 replaces .reginfo with .MIPS.options. - -2002-04-03 Jakub Jelinek <jakub@redhat.com> - - * ldexp.c (fold_binary) [DATA_SEGMENT_ALIGN]: If common page size - is smaller than maximum, round dot up to common page boundary. - -2002-03-28 Alan Modra <amodra@bigpond.net.au> - - * configure.host: Set up for generic hosts first, then tweak as - necessary in more specific targets. - (HOSTING_LIBS): Include libgcc_eh.a if found. - -2002-03-23 Andreas Jaeger <aj@suse.de> - - * emulparams/elf_x86_64.sh (COMMONPAGESIZE): Set it. - -2002-03-21 Alan Modra <amodra@bigpond.net.au> - - * Makefile.am: Run "make dep-am". - * Makefile.in: Regenerate. - -2002-03-21 Albert Chin-A-Young <china@thewrittenword.com> - - * genscripts.sh (LIB_SEARCH_DIRS): Quote path. - -2002-03-20 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (ldlang_add_undef): If the output bfd has been opened, - add the symbol to the linker hash table immediately. - (lang_place_undefineds): Split symbol creation out.. - (insert_undefined): ..to here. - -2002-03-18 David O'Brien <obrien@FreeBSD.org> - - * emultempl/elf32.em: Use lbasename vs. basename to fix problem where - the contents of the buffer returned from basename function will are - getting overwritten while still being used. - -2002-03-18 Jan Hubicka <jh@suse.cz> - Andreas Jaeger <aj@suse.de> - Andreas Schwab <schwab@suse.de> - - * configure.tgt (x86_64-*-linux-gnu*): Configure i386 as native. - * elf_x86_64.sh (ARCH): Set to i386:x86-64 - set libraries to default to lib64 paths. - -2002-03-18 Tom Rix <trix@redhat.com> - - * Makefile.am : Add eaix5ppc and eaix5rs6, AIX 5 support. - * configure.tgt : Same. - * emulparms/aix5ppc.sh : New file. For eaix5ppc. - * emulparms/aix5rs6.sh : New file. For eaix5rs6. - * emulparms/aixppc.sh : OUPUT_FORMAT_32BIT and OUTPUT_FORMAT_64BIT - emulation parameters for better -b32, -b64 support. - * emulparms/aixrs6.sh : Same. - * emulparms/ppcmacos.sh : Same. - * emultempl/aix.em (choose_target) : Use new emulation parameters - OUTPUT_FORMAT_32BIT and OUTPUT_FORMAT_64BIT. - * Makefile.in : Regenerate. - -2002-03-18 Nick Clifton <nickc@cambridge.redhat.com> - - * po/fr.po: Updated version. - -2002-03-18 Alan Modra <amodra@bigpond.net.au> - - * ldmain.c (main): Move .text readonly flag fudges from here.. - * ldlang.c (lang_process): ..to here. - -2002-03-14 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (lang_check): Remove the word size check added in last - change. Treat emitrelocations case as for relocatable links. - -2002-03-13 Nick Clifton <nickc@cambridge.redhat.com> - - * po/fr.po: Updated version. - -2002-03-13 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (lang_check): Do relocatable link checks first, so that - warn_mismatch can't override. Check compatible and word size too. - -2002-03-07 Daniel Jacobowitz <drow@mvista.com> - - * ld.texinfo: Wrap @menu in @ifnottex, not @ifinfo. - -2002-03-05 Jakub Jelinek <jakub@redhat.com> - - * scripttempl/elf.sc: Only use DATA_SEGMENT_END() together with - DATA_SEGMENT_ALIGN. - -2002-03-04 H.J. Lu <hjl@gnu.org> - - * scripttempl/elf.sc: Put .preinit_array, .init_array and - .fini_array in the data segment. - -2002-03-04 Alan Modra <amodra@bigpond.net.au> - - * scripttempl/elf.sc: Correct syntax errors in 2002-03-01 commit. - -2002-03-01 David Mosberger <davidm@hpl.hp.com> - - * scripttempl/elf.sc (SECTIONS): Add entries for .preinit_array, - .init_array, and .fini_array. - -2002-02-20 Andreas Schwab <schwab@suse.de> - - * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Don't fold - .IA64_unwind* in a relocatable link. - -2002-02-20 Nick Clifton <nickc@cambridge.redhat.com> - - * NEWS: Mark 2.12 branch. - -2002-02-19 Martin Schwidefsky <schwidefsky@de.ibm.com> - - * emulparams/elf64_s390.sh (ARCH): Change to "s390:64-bit". - * emulparams/elf_s390.sh (ARCH): Change to "s390:31-bit". - -2002-02-18 Tom Rix <trix@redhat.com> - - * emultempl/aix.em (gld*_parse_args): Add -brtl support. - (gld*_before_allocation): Same. - (gld*_create_output_section_statements): Generate - __rtinit if run time linking. Add librtl.a to the link. - (gld*_read_file): Clean. - -2002-02-18 Alan Modra <amodra@bigpond.net.au> - - * emulparams/elf64ppc.sh (OTHER_TEXT_SECTIONS): Define. -2002-02-18 David O'Brien <obrien@FreeBSD.org> +2004-04-08 Alan Modra <amodra@bigpond.net.au> - * Makefile.am: Add new files earmelf_fbsd, eelf32ppc_fbsd, - eelf_i386_fbsd, eelf64_ia64_fbsd, eelf_x86_64_fbsd, eelf64_sparc_fbsd, - and eelf64alpha_fbsd. - * Makefile.in: Regenerate. - * configure.tgt(sparc64-*-freebsd, ia64-*-freebsd, i[3456]86-*-freebsd, - x86_64-*-freebsd, arm-*-freebsd, alpha*-*-freebsd, powerpc-*-freebsd): - use a FreeBSD-specific emulation rather than the psABI one. - * emulparams/elf_fbsd.sh (ELF_INTERPRETER_NAME): Set appropriate value - for all FreeBSD ELF systems. - * emulparams/armelf_fbsd.sh: Bridge elf_fbsd.sh and the "native" psABI - emulation. - * emulparams/elf32ppc_fbsd.sh: Likewise. - * emulparams/elf64_ia64_fbsd.sh: Likewise. - * emulparams/elf64_sparc_fbsd.sh: Likewise. - * emulparams/elf64alpha_fbsd.sh: Likewise. - * emulparams/elf_i386_fbsd.sh: Likewise. - * emulparams/elf_x86_64_fbsd.sh: Likewise. - -2002-02-18 Nick Clifton <nickc@cambridge.redhat.com> - - * po/tr.po: Updated version. - -2002-02-18 Alan Modra <amodra@bigpond.net.au> - - * ld.texinfo (Output Section Fill): Fix amateur texinfo. - (FILL): Likewise. - -2002-02-17 Hans-Peter Nilsson <hp@bitrange.com> - - * emultempl/mmo.em (mmo_after_open): Don't call - _bfd_mmix_check_all_relocs when producing ELF output. - -2002-02-15 Richard Henderson <rth@redhat.com> - - * emulparams/elf64alpha.sh (NOP): Adjust for big-endian - definition. Emit a unop+nop pair. - -2002-02-15 Hans-Peter Nilsson <hp@bitrange.com> - - * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Also check - for presence of .MMIX.reg_contents.linker_allocated before early - exit. - - * NEWS: Mention support for MMIX. - -2002-02-15 Alan Modra <amodra@bigpond.net.au> - - Support arbitrary length fill patterns. - * ld.texinfo (Output Section Fill): Describe fill expressions. - (FILL): Refer to the above. - * ldexp.h (etree_value_type): Add "str" field. - (union etree_union): Add "str" to "value" struct. - (exp_bigintop): Declare. - (exp_get_fill): Declare. - * ldexp.c: Include "safe-ctype.h". - (exp_intop): Set value.str to NULL. - (exp_bigintop): New function. - (new_rel): Pass in "str", and set new.str from it. - (new_rel_from_section): Set new.str to NULL. - (fold_name): Adjust calls to new_rel. - (exp_fold_tree): Likewise. - (exp_get_fill): New function. - * ldgram.y (struct big_int bigint, fill_type *fill): New. - (INT): Returns a "bigint". Adjust all code handling INTs. - (fill_opt): Returns a "fill". - (fill_exp): Split out of fill_opt, use for FILL. - * ldlang.h (struct _fill_type): New. - (fill_type): Move typedef to ldexp.h. - (lang_output_section_statement_type): "fill" is now a pointer. - (lang_fill_statement_type): Likewise. - (lang_padding_statement_type): Likewise. - (lang_add_fill): Now takes a "fill_type *" param. - (lang_leave_output_section_statement): Likewise. - (lang_do_assignments): Likewise. - (lang_size_sections): Likewise. - (lang_leave_overlay_section): Likewise. - (lang_leave_overlay): Likewise. - * ldlang.c: Include ldgram.h after ldexp.h. - (lang_output_section_statement_lookup): Adjust for fill_type change. - (print_fill_statement): Likewise. - (print_padding_statement): Likewise. - (insert_pad): Now takes a "fill_type *" arg. - (size_input_section): Likewise. - (lang_size_sections_1): Likewise. - (lang_size_sections): Likewise. - (lang_do_assignments): Likewise. - (lang_add_fill): Likewise. - (lang_leave_output_section_statement): Likewise. - (lang_leave_overlay_section): Likewise. - (lang_leave_overlay): Likewise. - Adjust all callers of the above function. - * ldlex.l: Include ldgram.h after ldexp.h. Allow hex numbers - starting with "0X" as well as "0x". Return bigint.str for hex - numbers starting with "0x" or "0X", zero bigint.str otherwise. - Always use base 16 for numbers starting with "$". - * ldmain.c: Include ldgram.h after ldexp.h. - * ldwrite.c (build_link_order): Use bfd_data_link_order in place - of bfd_fill_link_order. - * pe-dll.c: Adjust lang_do_assignments calls. - * emultempl/elf32.em: Likewise. + Apply from mainline. + 2004-03-27 Alan Modra <amodra@bigpond.net.au> + * emultempl/elf32.em: Update new bfd_elf_discard_info name. * emultempl/hppaelf.em: Likewise. * emultempl/ppc64elf.em: Likewise. - * emultempl/beos.em: Include ldgram.h after ldexp.h, adjust - lang_add_assignment call. - * emultempl/pe.em: Likewise. - -2002-02-14 Phil Edwards <pme@gcc.gnu.org> - - * ld.texinfo (VERSION scripts): Symbol names are globbing patterns. - * ldgram.y (lang_new_vers_regex): Rename to lang_new_vers_pattern; - the pattern in question is not a regexp. - * ldlang.c: Likewise. - * ldlang.h: Likewise. - * ldlex.l (V_IDENTIFIER): Allow '[', ']', '-', '!', and '^' also. - -2002-02-12 Jakub Jelinek <jakub@redhat.com> - - * ldlex.l (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): New tokens. - * ldgram.y (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): New tokens. - (exp): Add DATA_SEGMENT_ALIGN (exp, exp) and DATA_SEGMENT_END (exp). - * ldexp.c (exp_data_seg): New variable. - (exp_print_token): Handle DATA_SEGMENT_ALIGN and DATA_SEGMENT_END. - (fold_binary): Handle DATA_SEGMENT_ALIGN. - (exp_fold_tree): Handle DATA_SEGMENT_END. - Pass allocation_done when recursing instead of hardcoding - lang_allocating_phase_enum. - * ldexp.h (exp_data_seg): New. - * ldlang.c (lang_size_sections_1): Renamed from lang_size_sections. - (lang_size_sections): New. - * ld.texinfo (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): Document. - * scripttempl/elf.sc: Use DATA_SEGMENT_ALIGN and DATA_SEGMENT_END - if COMMONPAGESIZE is defined. - * emulparams/elf_i386.sh (COMMONPAGESIZE): Set to 4K. - * emulparams/elf32_sparc.sh (COMMONPAGESIZE): Set to 8K. - * emulparams/elf64_sparc.sh (COMMONPAGESIZE): Set to 8K. - * emulparams/elf64alpha.sh (COMMONPAGESIZE): Set to 8K. - * emulparams/elf64_ia64.sh (COMMONPAGESIZE): Set to 16K for shared - libraries only. - -2002-02-11 Alan Modra <amodra@bigpond.net.au> - - * Makefile.in: Regenerate. - -2002-02-10 Daniel Jacobowitz <drow@mvista.com> - - * lexsup.c: Remove strtoul declaration. - -2002-02-10 Daniel Jacobowitz <drow@mvista.com> - - * ldmain.c: Add prototype for main (). - * lexsup.c: Guard declaration of strtoul with HAVE_STDLIB_H. - * emultempl/lnk960.em (lnk960_choose_target): Function should - take two arguments. - -2002-02-10 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (entry_section): New initialised variable. - (lang_finish): Use it. - * ldlang.h (entry_section): Declare. - * emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Set - entry_section to ".opd". - -2002-02-09 Chris Demetriou <cgd@broadcom.com> - - * ld.texinfo (Options): Add back in -nostdlib documentation, - which had been inadvertently removed. - -2002-02-09 Hans-Peter Nilsson <hp@bitrange.com> - - * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Adjust - register section vma to a sane value after emitting error. Make - fatal conditions cause program exit when emitting message. - -2002-02-08 Ivan Guzvinec <ivang@opencores.org> - - * configure.tgt: Add or32-*-rtems target. - -2002-02-08 Alexandre Oliva <aoliva@redhat.com> - - Contribute sh64-elf. - 2002-01-24 Alexandre Oliva <aoliva@redhat.com> - * emulparams/shelf32.sh (STACK_ADDR): Define as formerly defined - in OTHER_RELOCATABLE_SECTIONS. - 2002-01-18 Alexandre Oliva <aoliva@redhat.com> - * emulparams/shelf32.sh (STACK_ADDR): Define. - (OTHER_RELOCATABLE_SECTIONS): Renamed to... - (OTHER_SECTIONS): this. Removed stack settings. - * emulparams/shelf64.sh (OTHER_RELOCATABLE_SECTIONS): Do not set. - (OTHER_SECTIONS): Reset after sourcing shelf32.sh. - 2001-03-12 DJ Delorie <dj@redhat.com> - * emultempl/sh64elf.em (sh64_elf_$_before_allocation): Disable - relaxing if any shmedia or mixed sections are found. - 2001-03-07 DJ Delorie <dj@redhat.com> - * emultempl/sh64elf.em (sh64_elf_before_allocation): Pass f to - einfo. Gracefully decline to output to non-elf formats. - 2001-03-06 Hans-Peter Nilsson <hpn@redhat.com> - * emulparams/shelf64.sh (OTHER_RELOCATING_SECTIONS) <.stack>: - Default to _end aligned to next multiple of 0x40000, plus 0x40000. - * emulparams/shelf32.sh: Ditto. - 2001-01-14 Hans-Peter Nilsson <hpn@cygnus.com> - * emulparams/shelf32.sh (OTHER_RELOCATING_SECTIONS): Tweak - comment. - 2001-01-10 Ben Elliston <bje@redhat.com> - * emulparams/shelf32.sh (OTHER_RELOCATING_SECTIONS): Avoid - non-portable shell constructs. From Hans-Peter Nilsson. - 2001-01-09 Hans-Peter Nilsson <hpn@cygnus.com> - * emulparams/shelf64.sh (EXTRA_EM_FILE): Define empty. - * Makefile.am (eshelf64.c, eshlelf64.c, eshlelf32.c): Adjust - dependencies to the shell script include chain. - * Makefile.in: Regenerate. - 2001-01-06 Hans-Peter Nilsson <hpn@cygnus.com> - * emultempl/sh64elf.em: Update and tweak comments. - (sh64_elf_${EMULATION_NAME}_after_allocation): Always allocate and - make a .cranges section SEC_IN_MEMORY. - 2000-12-30 Hans-Peter Nilsson <hpn@cygnus.com> - * emultempl/sh64elf.em - (sh64_elf_${EMULATION_NAME}_before_allocation): Don't stop when - .cranges section found to be necessary; continue and set stored - section contents flags for sections with non-mixed contents. - Use a struct sh64_section_data container and sh64_elf_section_data - to store contents-type flags. - Remove unused update of "isec". - (sh64_elf_${EMULATION_NAME}_after_allocation): Only process - sections marked SHF_SH5_ISA32_MIXED. Use sh64_elf_section_data to - access contents-type flags. Assert that the associated container - is initialized. Use that container, not elf_gp_size, to hold size - of linker-generated cranges contents. - 2000-12-18 Hans-Peter Nilsson <hpn@cygnus.com> - * emultempl/sh64elf.em - (sh64_elf_${EMULATION_NAME}_before_allocation): Exit early if - there's already a .cranges section. When section flag difference - is found, don't NULL-check cranges a second time. Tweak comments. - (sh64_elf_${EMULATION_NAME}_after_allocation): Use size after - merging, not max size, as size of ld-generated .cranges contents. - Don't set ELF section flags in output section. When checking for - needed .cranges descriptors, don't use a variable; compare - incoming ELF section flags directly to SHF_SH5_ISA32_MIXED. Tweak - comments. - 2000-12-18 Hans-Peter Nilsson <hpn@cygnus.com> - * emultempl/sh64elf.em: New file. - * Makefile.am (eshelf32.c, eshlelf32.c): Adjust dependencies. - * Makefile.in: Regenerate. - * emulparams/shelf32.sh (OUTPUT_FORMAT): Only set if not set. - (OTHER_RELOCATING_SECTIONS): Ditto. - (EXTRA_EM_FILE): New, set to sh64elf if not set. - * emulparams/shlelf32.sh: Stub out all settings except - OUTPUT_FORMAT. Source shelf32.sh. - * emulparams/shelf64.sh: Similar, but also keep ELF_SIZE and - OTHER_RELOCATING_SECTIONS. - (OTHER_RELOCATING_SECTIONS): Remove .cranges. - * emulparams/shlelf64.sh: Stub out all settings except - OUTPUT_FORMAT. Source shelf64.sh. - 2000-12-15 Hans-Peter Nilsson <hpn@cygnus.com> - * emulparams/shelf64.sh (OTHER_RELOCATING_SECTIONS): Include - .cranges section. - (DATA_START_SYMBOLS): Define, provide ___data. - (OTHER_READONLY_SYMBOLS): Define, provide ___rodata and align to 8 - for consecutive .data section. - (OTHER_GOT_SECTIONS): Define, align to 8 for consecutive .bss - section after .data section. - * emulparams/shlelf64.sh: Ditto. - * emulparams/shelf32.sh: Ditto. - (ALIGNMENT): Define to 8. - * emulparams/shelf32.sh: Ditto. - 2000-12-12 Hans-Peter Nilsson <hpn@cygnus.com> - * configure.tgt (sh64-*-elf*): Assign targ_extra_libpath to get - built-in linker scripts. - 2000-11-30 Hans-Peter Nilsson <hpn@cygnus.com> - * emulparams/shlelf64.sh: New. - * emulparams/shelf64.sh: New. - * configure.tgt (sh64-*-elf*): Add shelf64 and shlelf64 to - targ_extra_emuls. - * Makefile.am: Add support for shlelf64 and shelf64. - * Makefile.in: Regenerate. - 2000-11-29 Hans-Peter Nilsson <hpn@cygnus.com> - * configure.tgt (sh64-*-elf*): Add shelf as default. - Add shlelf to targ_extra_emuls. - 2000-11-24 Hans-Peter Nilsson <hpn@cygnus.com> - * emulparams/shelf32.sh: New file. - * emulparams/shlelf32.sh: New file. - * Makefile.am: Add support for shlelf32 and shelf32. - * configure.tgt: Map sh64-*-elf* to shlelf32 and shelf32. - * Makefile.in: Regenerate. - -2002-02-05 Hans-Peter Nilsson <hp@axis.com> - - * ldlang.c (lang_reset_memory_regions): Rename from - reset_memory_regions. Change all callers. Make public. - * ldlang.h (lang_reset_memory_regions): Prototype. - * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Call - lang_reset_memory_regions before lang_size_sections. - * emultempl/hppaelf.em (hppaelf_layout_sections_again): Likewise. - * emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Likewise. - -2002-02-04 Hans-Peter Nilsson <hp@bitrange.com> - - * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Use signed - arithmetic when checking for too many global registers. - -2002-02-02 Jason Thorpe <thorpej@wasabisystems.com> - - * Makefile.am (ALL_EMULATIONS): Add ehppanbsd.o. - (ehppanbsd.c): New rule. - * Makefile.in: Regenerate. - * configure.tgt (hppa*-*-netbsd*): New target. - * emulparams/hppalinux.sh: Add comment to check other files - that source this file it is modified, and list which - files that do. - * emulparams/hppanbsd.sh: New file. - -2002-02-01 Geoffrey Keating <geoffk@redhat.com> - - * scripttempl/xstormy16.sc: Don't allocate extra space for the - stack. - -2002-02-01 Hans-Peter Nilsson <hp@bitrange.com> - - Support on-demand global register allocation from - R_MMIX_BASE_PLUS_OFFSET relocs. - * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Rename from - mmix_set_reg_section_vma. Call - _bfd_mmix_finalize_linker_allocated_gregs. - (mmix_before_allocation): New function. - (LDEMUL_AFTER_ALLOCATION): Set to mmix_after_allocation. - (LDEMUL_BEFORE_ALLOCATION): Define to mmix_before_allocation. - * scripttempl/mmo.sc (.text): Mark .init, .fini as KEEP. - (.MMIX.reg_contents): Add .MMIX.reg_contents.linker_allocated - before .MMIX.reg_contents. - * emultempl/mmo.em (gldmmo_before_allocation): Define to default. - (mmo_after_open): New function. - (LDEMUL_AFTER_OPEN): Define to mmo_after_open. - * emulparams/elf64mmix.sh (OTHER_SECTIONS): Tweak formatting. Add - .MMIX.reg_contents.linker_allocated before .MMIX.reg_contents. - -2002-01-31 Ivan Guzvinec <ivang@opencores.org> - - * emulparams/or32.sh: New file. - * emulparams/or32elf.sh: New file. - * scripttempl/or32.sc: New file. - * configure.tgt : Add support for or32. - * configure: Regenerate - * Makefile.am: Add support for or32. - * Makefile.in: Regenerate. - * NEWS: Mention support for or32. - * po/ld.pot: Regenerate. - -2002-01-29 Chris Demetriou <cgd@broadcom.com> - Mitch Lichtenberg <mpl@broadcom.com> - - * emulparams/elf32bmip.sh (EXTRA_EM_FILE): Define to be mipself. - * emultempl/mipself.em: New file to handle MIPS ELF embedded - reloc creation (ld --embedded-relocs). - -2002-01-27 Daniel Jacobowitz <drow@mvista.com> - - * configure: Regenerated. - -2002-01-26 Hans-Peter Nilsson <hp@bitrange.com> - - * Makefile.am (install): Depend on install-info. - * Makefile.in: Regenerate. - -2002-01-26 Christian Rose <menthos@menthos.com> - - * ldmain.c (main): Use full sentences to ease translation. - -2002-01-26 Nick Clifton <nickc@cambridge.redhat.com> - - * po/fr.po: Updated version. - -2002-01-25 Nick Clifton <nickc@cambridge.redhat.com> - - * po/es.po: Updated version. - -2002-01-25 Andreas Jaeger <aj@suse.de> - - * ldlex.l (yy_input): Correct error check. - -2002-01-25 Alan Modra <amodra@bigpond.net.au> - - * ldmisc.c (demangle): Put back dots when string not demangled. - -2002-01-22 Richard Henderson <rth@redhat.com> - - * emulparams/elf64alpha.sh (NOP): Use unop. - -2002-01-21 Andreas Jaeger <aj@suse.de> - - * ldlex.l: Use fread instead of read. - -2002-01-21 Jason Thorpe <thorpej@wasabisystems.com> - - * configure.tgt (ia64-*-netbsd*): New target. - -2002-01-21 H.J. Lu <hjl@gnu.org> - - * emulparams/elf32btsmip.sh (SHLIB_TEXT_START_ADDR): Change to - 0. - * emulparams/elf64btsmip.sh (SHLIB_TEXT_START_ADDR): Likewise. - -2002-01-18 Andreas Jaeger <aj@suse.de> - - * ldver.c (ldversion): Update year. - -2002-01-17 Nick Clifton <nickc@cambridge.redhat.com> - - * po/ld.pot: Regenerate. - -2002-01-16 Alan Modra <amodra@bigpond.net.au> - - * Makefile.am (eelf64ppc.c, eelf64lppc.c): Depend on ppc64elf.em. - * Makefile.in: Regenerate. - * emulparams/elf64ppc.sh (EXTRA_EM_FILE): Define. - * emultempl/ppc64elf.em: New file. - -2002-01-15 DJ Delorie <dj@redhat.com> - - * scripttempl/pe.sc: Add support for constructor priorities. - -2002-01-07 Marek Michalkiewicz <marekm@amelek.gda.pl> - - * emulparams/avr1200.sh (DATA_START): Define as 0x60. - * emulparams/avr23xx.sh: Likewise. - * emulparams/avr4433.sh: Likewise. - * emulparams/avr44x4.sh: Likewise. - * emulparams/avr85xx.sh: Likewise. - * emulparams/avrmega103.sh: Likewise. - * emulparams/avrmega161.sh: Likewise. - * emulparams/avrmega603.sh: Likewise. - * scripttempl/elf32avr.sc: Use DATA_START instead of 0x60. - -2002-01-08 Alexandre Oliva <aoliva@redhat.com> - - * ldlang.c (walk_wild_section): Exclude object file if enclosing - archive is excluded. - -2002-01-07 Jason Thorpe <thorpej@wasabisystems.com> - - * Makefile.am (ALL_EMULATIONS): Add eshelf_nbsd.o and eshlelf_nbsd.o. - (eshelf_nbsd.c): New rule. - (eshlelf_nbsd.c): New rule. - * Makefile.in: Regenerate. - * configure.tgt (sh*le-*-netbsdelf*): New target. - (sh*-*-netbsdelf*): New target. - * emulparams/shelf.sh: Document that shelf_nbsd.sh sources this file. - * ld/emulparams/shelf_nbsd.sh: New emulation. - * ld/emulparams/shlelf_nbsd.sh: New emulation. - -2002-01-07 Nick Clifton <nickc@cambridge.redhat.com> - - * po/es.po: New file: Spanish translation. - * configure.in (ALL_LINGUAS): Add es. - * configure: Regenerate. - -2002-01-06 John Marshall <jmarshall@acm.org> - - * ld.texinfo: Note that --emit-relocs is currently only - implemented for ELF. - -2002-01-05 Alan Modra <amodra@bigpond.net.au> - - * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Make use - of bfd_section_list_remove and bfd_section_list_insert macros. - * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise. - * emultempl/mmo.em (mmo_place_orphan): Likewise. - -2002-01-04 Jason Thorpe <thorpej@wasabisystems.com> - - * configure.tgt (x86_64-*-netbsd*): New target. - -2001-12-21 Tom Rix <trix@redhat.com> - - (gld*_create_output_section_statements): New function. - For -binitfini support. - * emultempl/aix.em (gld*_before_parse): Fix comment. - * emultempl/aix.em (gld*_parse_args): Fix comment. - -2001-12-20 Jason Thorpe <thorpej@wasabisystems.com> - - * configure.tgt (mips*-dec-netbsd*): Delete alias for - mips*el-*-netbsd*. - (sparc64-*-netbsd*): Add elf32_sparc to targ_extra_emuls. - - * configure.tgt (arm-*-netbsdelf*): Add target. - (arm-*-netbsd*): Add armelf and armelf_nbsd to targ_extra_emuls. - * emulparams/armelf_nbsd.sh: Added. - * Makefile.am: Add rules for earmelf_nbsd. - * Makefile.in: Regenerate. - -2001-12-19 Andreas Jaeger <aj@suse.de>, - Susanne Oberhauser <froh@suse.de> - - * configure.host: Add rules for x86_64-*linux-gnu. Change - s390x-linux entry to use gcc to report configuration, replace gcc - with $CC in s390-linux - -2001-12-19 Andreas Jaeger <aj@suse.de> - - * ld.texinfo (VERSION): Fix markup. - -2001-12-18 matthew green <mrg@eterna.com.au> - - * Makefile.am (ALL_EMULATIONS): Add m68kelfnbsd.o. - (m68kelfnbsd.c): New rule. - * Makefile.in: Regenerate. - * configure.tgt (m68*-hp-netbsd*): Renamed to .. - (m68*-*-netbsd*4k*): .. this. - (m68*-*-netbsdelf*): New target. - (m68*-*-netbsd*): Also include ELF support. - (m68*-*-netbsdaout*): New alias for m68*-*-netbsd*. - * emulparams/m68kelfnbsd.sh: New emulation. - -2001-12-18 Jakub Jelinek <jakub@redhat.com> - - * ldgram.y (vers_node): Support anonymous version tags. - * ldlang.c (lang_register_vers_node): Ensure anonymous version - tag is not defined together with non-anonymous versions. - * ld.texinfo: Document it. - -2001-12-18 Nick Clifton <nickc@cambridge.redhat.com> - - * po/tr.po: New file: Turkish translation. - * configure.in (ALL_LINGUAS): Add tr. - * configure: Regenerate. - -2001-12-17 Jason Thorpe <thorpej@wasabisystems.com> - - * Makefile.am: Add rules for eelf64alpha_nbsd. - * Makefile.in: Regenerate. - * configure.tgt (alpha*-*-netbsd*): Set - targ_emul to elf64alpha_nbsd. - * emulparams/elf64alpha_nbsd.sh: Added. - -2001-12-17 Alan Modra <amodra@bigpond.net.au> - - * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Adjust - section_tail when fiddling with section list. - (gld${EMULATION_NAME}_list_options): Ensure sentences aren't - broken into separate strings to make translation easier. - * emultempl/mmo.em (mmo_place_orphan): Adjust section_tail when - fiddling with section list. - * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise. - -2001-12-16 Hans-Peter Nilsson <hp@bitrange.com> - - * scripttempl/mmo.sc: Add .debug_ranges to listed sections. - -2001-12-15 Alan Modra <amodra@bigpond.net.au> - - * ldmain.c (main): Initialise link_info.eh_frame_hdr. - -2001-12-13 Jakub Jelinek <jakub@redhat.com> - - * emultempl/elf32.em (finish): Supply output_bfd - to bfd_elf*_discard_info. - (OPTION_EH_FRAME_HDR): Define. - (longopts): Add --eh-frame-hdr. - (parse_args): Handle it. - (list_options): Add --eh-frame-hdr to help. - * emultempl/hppaelf.em (finish): Supply output_bfd - to bfd_elf*_discard_info. - * scripttempl/elf.sc (.eh_frame_hdr): Add. - -2001-12-13 Alan Modra <amodra@bigpond.net.au> - - * lexsup.c (parse_args): Don't pass shortopts to second call to - getopt functions. Restore optind rather than decrementing before - second call. Remove errind as it now duplicates last_optind. - -2001-12-11 Christopher Faylor <cgf@redhat.com> - - * emultempl/pe.em (gld_${EMULATION_NAME}_list_options): Fix typo. - -2001-12-07 Geoffrey Keating <geoffk@redhat.com> - Richard Henderson <rth@redhat.com> - - * Makefile.am: Add support for xstormy16. - * configure.tgt: Add support for xstormy16. - * Makefile.in: Regenerate. - * emulparams/elf32xstormy16.sh: New file. - * scripttempl/xstormy16.sc: New file. - -2001-10-01 Christopher Faylor <cgf@cygnus.com> - - * Makefile.in (LIB_PATH): Make configurable. - (GENSCRIPTS): Set LIB_PATH in environment. - * configure.in: Substitute LIB_PATH. - * configure: Regenerate. - * configure.tgt (*cygwin): Set LIB_PATH for cross build. - * configure.host (*cygwin): Add /usr/lib/w32api to NATIVE_LIB_DIRS. - -2001-12-07 Nick Clifton <nickc@cambridge.redhat.com> - - * lexsup.c (ld_options): Insert 'PROGRAM' into the text string - describing the -N option so that it is easier to translate into - foreign languages. - -2001-12-05 Nick Clifton <nickc@cambridge.redhat.com> - - * emultempl/pe.em (..._list_options): Replace multiple fprintf - statements describing a single option with a single, newline - escaped fprintf. This allows better translation into other - languages. - - * ldmain.c (add_archive_element): Combine multiple strings - into a single string to permit better translation into other - languages. - -2001-12-05 Tom Rix <trix@redhat.com> - - * Makefile.am: Remove eaixppc64. - * Makefile.in: Regenerate. - -2001-12-04 Tom Rix <trix@redhat.com> - - * emultempl/aix.em (choose_target): Change default target to - OUTPUT_FORMAT for ppcmacos. Add braces to remove compiler - warning. - (gld*_read_file): Fix typo. - (change_symbol_mode): Add prototype. - (is_syscall): Same. - - * emulparams/aixppc.sh (SYSCALL_MASK, SYMBOL_MODE_MASK): Delete. - * emulparams/aixrs6.sh : Same. - * emulparams/ppcmacos.sh : Same. - * emulparams/aixppc64.sh : Delete file. - * emultempl/aix.em : Formatting changes. - -2001-12-04 Hans-Peter Nilsson <hp@axis.com> - - * emulparams/criself.sh (NO_SMALL_DATA): Set, to yes. - (OTHER_BSS_END_SYMBOLS): Don't refer to .sbss when setting - __Sbss. - (OTHER_END_SYMBOLS): Fix formatting. - * emulparams/crislinux.sh (NO_SMALL_DATA): Set, to yes. - (OTHER_END_SYMBOLS): Fix formatting. - -2001-12-04 Alan Modra <amodra@bigpond.net.au> - - * ldexp.c (exp_print_token): Correct "table" entry for RSHIFT. - -2001-12-02 Tom Rix <trix@redhat.com> - - * configure.tgt : Remove eaixppc64 emulations. - * Makefile.in : Remove eaixppc64.c - * ldemul.c (ldemul_choose_target): New parameters argc, argv. - (ldemul_default_target): Same. - * emultempl/gld960.em (gld960_choose_target): Same. - * emultempl/gld960c.em (gld960_choose_target): Same. - * scripttempl/aix.sc: Remove OUTPUT_FORMAT. - * emultempl/aix.em (is_syscall): syscall_mask now a variable. - * emultempl/aix.em (gld*_read_file): symbol_mode_mask now a variable. - * emultempl/aix.em (gld*_parse_args): Handle -b32 -b64 emulation. - * emultempl/aix.em (choose_target): New function. Handle emulation of - -b32 and -b64. - -2001-11-27 H.J. Lu <hjl@gnu.org> - - * emulparams/elf_i386.sh (NO_SMALL_DATA): Set to yes. - * emulparams/elf_i386_be.sh (NO_SMALL_DATA): Likewise. - * emulparams/elf_i386_chaos.sh (NO_SMALL_DATA): Likewise. - * emulparams/elf_i386_ldso.sh (NO_SMALL_DATA): Likewise. - * emulparams/elf_x86_64.sh (NO_SMALL_DATA): Likewise. - * emulparams/m68kelf.sh (NO_SMALL_DATA): Likewise. - * emulparams/elf32_sparc.sh (NO_SMALL_DATA): Likewise. - * emulparams/elf64_sparc.sh (NO_SMALL_DATA): Likewise. - - * scripttempl/elf.sc (SBSS): New. Define if ${NO_SMALL_DATA} - is not empty. - (SDATA): Likewise. - (REL_SDATA): Likewise. - (REL_SBSS): Likewise. - (REL_SDATA2): Likewise. - (REL_SBSS2): Likewise. - (SBSS2): Define if ${NO_SMALL_DATA} is not empty. - (SDATA2): Likewise. - -2001-11-25 Stephane Carrez <Stephane.Carrez@worldnet.fr> - - * scripttempl/elfm68hc11.sc (CTOR, DTOR): Put constructor and - destructor in rom. - * scripttempl/elfm68hc12.sc (CTOR, DTOR): Likewise. - -2001-11-22 H.J. Lu <hjl@gnu.org> - - * Makefile.in: Regenerated with automake based on automake - 1.4-8 in RedHat 7.1. - -2001-11-22 Alan Modra <amodra@bigpond.net.au> - - * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Define. - (config.status): Delete rule. - Add extra dependencies to cover sourced emulparams files. - * Makefile.in: Regenerate. - - * scripttempl/elf.sc: Order <section>, <section>.* and - corresponding linkonce sections as seen in input files. - Formatting fixes. Zero vma of all sections if not relocating. - (STACK): Define and insert if STACK_ADDR defined. - (OTHER_RELOCATING_SECTIONS): Delete. - (OTHER_END_SYMBOLS): Define. - (OTHER_READONLY_SECTIONS): Always insert, not just when relocating. - (OTHER_READWRITE_SECTIONS): Likewise. - (OTHER_GOT_SECTIONS): Likewise. - (OTHER_SDATA_SECTIONS): Likewise. - (OTHER_BSS_SECTIONS): Likewise. - * scripttempl/elfi370.sc (OTHER_READONLY_SECTIONS): Likewise. - (OTHER_READWRITE_SECTIONS): Likewise. - * scripttempl/nw.sc (OTHER_READONLY_SECTIONS): Likewise. - (OTHER_READWRITE_SECTIONS): Likewise - - * emulparams/armelf.sh (OTHER_RELOCATING_SECTIONS): Delete. - (STACK_ADDR): Define. - * emulparams/armelf_oabi.sh: As for armelf.sh. - * emulparams/elf32mcore.sh: As for armelf.sh. - * emulparams/h8300elf.sh: As for armelf.sh. - * emulparams/mn10200.sh: As for armelf.sh. - * emulparams/shelf.sh: As for armelf.sh. - - * emulparams/elf32fr30.sh (OTHER_RELOCATING_SECTIONS): Delete. - (OTHER_END_SYMBOLS): Define. - * emulparams/m32relf.sh: As for elf32fr30.sh. - * emulparams/h8300helf.sh: As for elf32fr30.sh. - * emulparams/h8300self.sh: As for elf32fr30.sh. - - * emulparams/criself.sh (OTHER_READONLY_SECTIONS): Protect symbol - defines with RELOCATING test. - (OTHER_SDATA_SECTIONS): Likewise. - (OTHER_RELOCATING_SECTIONS): Delete, replacing with.. - (OTHER_END_SYMBOLS): ..this. - * emulparams/crislinux.sh: As for criself.sh. - - * emulparams/elf32bmipn32.sh (OTHER_SDATA_SECTIONS): Zero vma - if not relocating. - (OTHER_RELOCATING_SECTIONS): Delete, replacing with.. - (OTHER_SECTIONS): ..this. Zero vma if not relocating. Order - normal and linkonce sections as seen in input files. - * emulparams/elf32bmip.sh (DATA_ADDR): Don't define if EMBEDDED. - (TEXT_DYNAMIC): Likewise. - (INITIAL_READONLY_SECTIONS): Zero vma if not relocating. - (OTHER_SDATA_SECTIONS): Likewise. - * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Likewise. - * emulparams/shlelf_linux.sh (OTHER_READWRITE_SECTIONS): Likewise. - * emulparams/elf64alpha.sh (OTHER_READONLY_SECTIONS): Likewise. - * emulparams/hppalinux.sh (OTHER_READONLY_SECTIONS): Likewise. - * emulparams/elf64_aix.sh (OTHER_GOT_SECTIONS): Likewise. - (OTHER_PLT_RELOC_SECTIONS): Likewise. - (OTHER_READONLY_SECTIONS): Likewise. Order normal and linkonce - sections as seen in input files. - * emulparams/elf64_ia64.sh: As for emulparams/elf64_aix.sh. - * emulparams/hppa64linux.sh (OTHER_READONLY_SECTIONS): Zero vma - if not relocating. - (OTHER_READWRITE_SECTIONS, OTHER_BSS_SECTIONS): Likewise. - (OTHER_BSS_END_SYMBOLS): Merge from elf64hppa.sh. - * emulparams/elf64mmix.sh (OTHER_RELOCATING_SECTIONS): Delete. - (OTHER_SECTIONS): Instead, use this.. - (OTHER_END_SYMBOLS): ..and this. - - * emulparams/elf32b4300.sh: Source elf32bmip.sh, remove duplicates. - * emulparams/elf32bsmip.sh: Likewise. - * emulparams/elf32btsmip.sh: Likewise. - * emulparams/elf32ebmip.sh: Likewise. - * emulparams/elf32lmip.sh: Likewise. - * emulparams/elf32elmip.sh: Source elf32lmip.sh, remove duplicates. - * emulparams/elf32lsmip.sh: Likewise. - * emulparams/elf32ltsmip.sh: Source elf32btsmip.sh, remove duplicates. - * emulparams/elf32l4300.sh: Source elf32b4300.sh, remove duplicates. - * emulparams/elf64bmip.sh: Source elf32bmipn32.sh, remove duplicates. - * emulparams/elf64btsmip.sh: Likewise. - * emulparams/elf64ltsmip.sh: Source elf64btsmip.sh, remove duplicates. - * emulparams/elf32lppc.sh: Source elf32ppc.sh, remove duplicates. - * emulparams/elf32ppclinux.sh: Likewise. - * emulparams/elf32ppcsim.sh: Likewise. - * emulparams/elf32lppcsim.sh: Source elf32lppc.sh, remove duplicates. - * emulparams/elf64hppa.sh: Source hppa64linux.sh, remove duplicates. - * emulparams/h8300helf.sh: Source h8300elf.sh, remove duplicates. - * emulparams/h8300self.sh: Likewise. - * emulparams/mn10300.sh: Source mn10200.sh, remove duplicates. - * emulparams/sh.sh: Comment. - * emulparams/shl.sh: Source sh.sh, remove duplicates. - * emulparams/shlelf.sh: Source shelf.sh, remove duplicates. - * emulparams/shelf_linux.sh: Source shlelf_linux.sh, remove duplicates. - -2001-11-21 David Heine <dlheine@tensilica.com> - Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (map_input_to_output_sections): Replace "break" - accidentally removed with 2001-08-03 change. - (lang_gc_sections_1): Likewise. - -2001-11-21 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (walk_wild_section): Move sec == NULL case out of loop. - -2001-11-20 Angela Marie Thomas <angela@redhat.com> - - * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Use NULL instead - of false when calling lang_size_sections. - * emultempl/hppaelf.em (hppaelf_layout_sections_again): Likewise. - -2001-11-15 Alan Modra <amodra@bigpond.net.au> - - * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Only emit this - function when LDEMUL_FINISH isn't set to the same name. Don't - call ${LDEMUL_FINISH}. - (ld_${EMULATION_NAME}_emulation): Call $LDEMUL_FINISH if defined. - * emultempl/armelf.em (arm_elf_finish): Call - gld${EMULATION_NAME}_finish. - * emultempl/hppaelf.em (hppaelf_finish): Rename to - gld${EMULATION_NAME}_finish. Call bfd_elf32_discard_info and - hppaelf_layout_sections_again if necessary. - (need_laying_out): New var. - (hppaelf_layaout_sections_again): Rename to - hppaelf_layout_sections_again. Clear need_laying_out. - (PARSE_AND_LIST_OPTIONS): Format text. - -2001-11-14 H.J. Lu <hjl@gnu.org> - - * emultempl/armelf.em (arm_elf_finish): Renamed from - gld${EMULATION_NAME}_finish. - (LDEMUL_FINISH): Set to arm_elf_finish. - -2001-11-14 Daniel Jacobowitz <drow@mvista.com> - - * emultempl/elf32.em (gld${EMULATION_NAME}_finish): New. - (struct ld_emulation_xfer_struct): Use it. - -2001-11-13 Ross Alexander <ross.alexander@uk.neceur.com> - - * emulparams/elf64hppa.sh (OTHER_BSS_END_SYMBOLS): Add - additional symbols referenced by newer crt0.o files from HP. - -2001-11-12 Anthony Green <green@redhat.com> - - * emulparams/armelf.sh (DATA_START_SYMBOLS): New symbol. - -2001-11-12 Alfred M. Szmidt <ams@kemisten.nu> - - * Makefile.am (GENSCRIPTS): Quote ${exec_prefix}. - * Makefile.in: Regenerate. - -2001-11-02 Stephane Carrez <Stephane.Carrez@worldnet.fr> - - * ld.texinfo: Use @command for commands, @option for options. - * Makefile.am (POD2MAN): Use 'GNU Development Tools' for - the page man title. - * Makefile.in: Rebuild. - -2001-11-04 Chris Demetriou <cgd@broadcom.com> - - * configure.tgt (mips*el-*-netbsd*, mips*-*-netbsd*): - Add support for targets. - -2001-11-02 Nick Clifton <nickc@cambridge.redhat.com> - - * configure.in (ALL_LINGUAS): Add "fr" and "sv" - * configure: Regernate. - * po/fr.po: New file. - * po/sv.po: New file. - -2001-11-01 NIIBE Yutaka <gniibe@m17n.org> - - * configure.tgt (sh-*-linux): Set targ_emul, targ_extra_emuls - as little endian default and to support big endian. - -2001-11-01 Chris Demetriou <cgd@broadcom.com> - - * ld.texinfo (Options): Document new option, -nostdlib. - * lexsup.c (OPTION_NOSTDLIB): New definition. - (ld_options): Add entry for "nostdlib". - (parse_args): Handle OPTIONS_NOSTDLIB. - * ldfile.c (ldfile_add_library_path): Don't add directories - to the search path if they weren't specified on the command line - and -nostdlib was specified. - * ld.h (ld_config_type): New member only_cmd_line_lib_dirs. - -2001-10-31 Nick Clifton <nickc@cambridge.redhat.com> - - * lexsup.c (parse_args): Prevent infinite parsing loop when - "-rpath.a" is specified on the command line. - Replace calls to fprintf with calls to einfo. - -2001-10-31 John Marshall <jmarshall@acm.org> - - * ld.texinfo: A historical requirement that MEMORY and SECTIONS - appear only once across all the linker scripts involved in a link - invocation no longer applies. Make the documentation reflect - that. - -2001-10-31 NIIBE Yutaka <gniibe@m17n.org> - - * configure.tgt: Supports sh3/sh4/sh3eb/sh4eb-unknown-linux-gnu - targets. - (sh-*-linux*): Added targ_extra_libpath. - -2001-10-31 David Heine <dlheine@tensilica.com> - - * ldlang.c (lang_size_sections): Keep a valid output_offset field - for padding statements. - -2001-10-30 Hans-Peter Nilsson <hp@bitrange.com> - - * configure.tgt (mmix-*-*): New target. - * Makefile.am (ALL_EMULATIONS): Add eelf64mmix.o and emmo.o. - Add dependencies to match. - * emulparams/mmo.sh, emulparams/elf64mmix.sh, emultempl/mmo.em, - emultempl/mmix-elfnmmo.em, emultempl/mmixelf.em, - scripttempl/mmo.sc: New files. - * gen-doc.texi: @set MMIX. - * ld.texinfo: Ditto. - [MMIX] Add MMIX node. - * Makefile.in: Regenerate. - -2001-10-29 Kazu Hirata <kazu@hxi.com> - - * ldlang.c: Fix a comment typo. - -2001-10-23 Alan Modra <amodra@bigpond.net.au> - - * configure.host: Move alpha*-*-linux-gnu* entry to generic - entries, and match *-*-linux*. - -2001-10-20 Alan Modra <amodra@bigpond.net.au> - - * ldgram.y (mri_script_command): Surround processing of INCLUDE - with ldlex_script, ldlex_popstate. - (ifile_p1): Likewise. - * ldlex.l (EOF): Don't BEGIN(SCRIPT). Restore lineno from the - correct slot. - (lex_push_file): Save current lineno to lineno_stack. Set lineno - to 1. Don't BEGIN(SCRIPT). - (lex_redirect): Similarly. - * ldmain.c (main): Set yydebug non-zero if YYDEBUG. - -2001-10-20 Nick Clifton <nickc@cambridge.redhat.com> - - * scripttempl/armcoff.sc: Define __EH_FRAME_BEGIN__ and - __EH_FRAME_END__ and accept eh frames into data section. - Add ctor and dtor sections. - -2001-10-19 Danny Smith <danny_r_smith_2001@yahoo.co.nz> - - * pe-dll.c (autofilter_objectlist): Add gcrt0.o. - (auto-export): Fix indentation. - -2001-10-18 Danny Smith <danny_r_smith_2001@yahoo.co.nz> - - * pe-dll.c (autofilter_objectlist): Add startup objects - for profiling. - (auto-export): Constify char * p. - Extract file basename and use strcmp rather than ststr - for object lookup. - -2001-10-18 Chris Demetriou <cgd@broadcom.com> - - * ldmain.c (get_emulation): Improve comment about the handling - of -mipsN options. - -2001-10-17 Alan Modra <amodra@bigpond.net.au> - - * po/POTFILES.in: Regenerate. - -2001-10-16 Vassili Karpov <malc@pulsesoft.com> - - * emultempl/elf32.em (gld*_list_options): Remove extra '\t' from - -z nocopyreloc and -z nocombreloc usage strings. - -2001-10-12 Vassili Karpov <malc@pulsesoft.com> - - * emultempl/elf32.em (gld*_list_options): Include -z nocopyreloc - in usage. - -2001-10-11 Aleksey Romanov <aromanov@ennovatenetworks.com> - - * scripttempl/armaout.sc: Place .bss section after end of aligned - data section to match behaviour of aout code in constructrion of - header. - -2001-10-11 Danny Smith <danny_r_smith_2001@yahoo.co.nz> - - * pe-dll.c (autofilter_entry_type autofilter_liblist: Add - startup files for mingw32 dlls to list. - -2001-10-10 Chris Demetriou <cgd@broadcom.com> - - * emultempl/elf32.em: Fix shell 'if' usage for portability. - -2001-10-08 Aldy Hernandez <aldyh@redhat.com> - - * configure.tgt (targ): Add arm9e-*-elf. - -2001-10-05 H.J. Lu <hjl@gnu.org> - - * genscripts.sh: Fix a typo in the last change. - -2001-10-05 Jakub Jelinek <jakub@redhat.com> - - * emultempl/elf32.em (gld_*_list_options): Include -z combreloc and - -z nocombreloc in usage. - -2001-10-03 Jim Blandy <jimb@redhat.com> - - * genscripts.sh: Include a comment at the top of each generated - script, explaining its purpose. - -2001-10-03 Vassili Karpov <malc@pulsesoft.com> - - * emultempl/elf32.em (parse_args): Handle -z nocopyreloc. - * NEWS: Mention -z nocopyreloc. - * ld.texinfo (Options): Describe nocopyreloc. - -2001-10-03 Alan Modra <amodra@bigpond.net.au> - - * configure: Regenerate. - -2001-10-02 Alan Modra <amodra@bigpond.net.au> - - * ldver.h (ld_program_version): Remove declaration. - * lexsup.c (parse_args): Move printing of copyright message.. - * ldver.c (ldversion): .. to here. - Use BFD_VERSION_STRING in place of BFD_VERSION. - (ld_program_version): Remove. - * Makefile.am (Makefile): Depend on bfd/configure.in. - Run "make dep-am". - * Makefile.in: Regenerate. - -2001-09-30 Hans-Peter Nilsson <hp@bitrange.com> - - * Makefile.am: Update dependencies with "make dep-am". - * Makefile.in: Regenerate. - -2001-09-29 John Reiser <jreiser@BitWagon.com> - - * ldlang.c (lang_common): Conditionally inhibit Common allocation. - * lexsup.c: Add --no-define-common commandline option. - * ldgram.y: Add INHIBIT_COMMON_ALLOCATION script command. - * ldlex.l: Likewise. - * ld.h: Add command_line.inhibit_common_definition. - * ldmain.c (main): Initialize. - * ld.texinfo: Document. - -2001-09-29 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (section_already_linked): Remove assignment to kept_section. - -2001-09-26 Alan Modra <amodra@bigpond.net.au> - - * ldmisc.c (USE_STDARG): Remove. - (info_msg): Define using VPARAMS, VA_OPEN, VA_FIXEDARG, VA_CLOSE. - (einfo): Likewise. - (minfo): Likewise. - (lfinfo): Likewise. - - * ldmisc.h: Remove #ifdef ANSI_PROTOTYPES and non-ansi - declarations. Update copyright. - -2001-09-24 Charles Wilson <cwilson@ece.gatech.edu> - - * pe-dll.c: Remove obsoleted declaration of - pe_get_data_import_dll_name. - (pe_create_import_fixup): Fix thinko. - - * ld.texinfo(enable-auto-import): Clarify the explanation. - -2001-09-24 Nick Clifton <nickc@cambridge.redhat.com> - - * pe-dll.c (pe_create_import_fixup): Revert previous patch. - * emultemp/pe.em (pe_data_import_dll): Move definition outside of - DLL_SUPPORT controlled code. - -2001-09-24 Charles Wilson <cwilson@ece.gatech.edu> - - * emultempl/pe.em(pe_data_import_dll): Make static. - (pe_get_data_import_dll_name): New accessor function. - * pe-dll.c(pe_create_import_fixup): call - pe_get_data_import_dll_name() from pe.em, instead of - directly accessing pe_data_import_dll variable from pe.em. - -2001-09-18 Bruno Haible <haible@clisp.cons.org> - - * deffilep.y: Include "safe-ctype.h" instead of <ctype.h>. - (def_file_add_directive): Use ISSPACE instead of isspace. - (def_lex): Use ISDIGIT/ISXDIGIT/ISALPHA/ISALNUM instead of - isdigit/isxdigit/isalpha/isalnum. - * emultempl/aix.em: Include "safe-ctype.h" instead of <ctype.h>. - (gld${EMULATION_NAME}_read_file): Use ISSPACE instead of isspace. - * emultempl/elf32.em: Include "safe-ctype.h" instead of <ctype.h>. - (gld${EMULATION_NAME}_place_orphan): Use ISALNUM instead of - isalnum. - * emultempl/gld960c.em: Include "safe-ctype.h" instead of <ctype.h>. - (gld960_set_output_arch): Use ISUPPER/TOLOWER instead of - isupper/tolower. - * emultempl/sunos.em: Include "safe-ctype.h" instead of <ctype.h>. - (gld${EMULATION_NAME}_search_dir): Use ISDIGIT instead of isdigit. - * ldctor.c: Include "safe-ctype.h" instead of <ctype.h>. - (ctor_prio): Use ISDIGIT instead of isdigit. - * ldfile.c: Include "safe-ctype.h" instead of <ctype.h>. - (ldfile_open_file_search): Use ISALPHA instead of isalpha. - (ldfile_add_arch): Use ISUPPER/TOLOWER instead of - isupper/tolower. - * ldlang.c: Include "safe-ctype.h" instead of <ctype.h>. - (stricpy): Use TOLOWER instead of isupper/tolower. - (lang_leave_overlay_section): Use ISALNUM instead of isalnum. - * ldlex.l: Include "safe-ctype.h" instead of <ctype.h>. - (lex_warn_invalid): Use ISPRINT instead of isprint. - * ldmain.c: Include "safe-ctype.h" instead of <ctype.h>. - (main): For gettext, also set the LC_CTYPE locate facet. - (add_keepsyms_file): Use ISSPACE instead of isspace. - * lexsup.c: Include "safe-ctype.h" instead of <ctype.h>. - (is_num, parse_args): Use ISDIGIT instead of isdigit. - * mpw-elfmips.c: Include "safe-ctype.h" instead of <ctype.h>. - (gldelf32ebmip_place_orphan): Use ISALNUM instead of isalnum. - * mpw-eppcmac.c: Include "safe-ctype.h" instead of <ctype.h>. - (gldppcmacos_read_file): Use ISSPACE instead of isspace. - * pe-dll.c: Include "safe-ctype.h" instead of <ctype.h>. - (quoteput): Use ISSPACE instead of isspace. - (pe_dll_generate_implib, pe_process_import_defs): Use ISALNUM - instead of isalnum. - -2001-09-18 Alan Modra <amodra@bigpond.net.au> - - * deffilep.y (def_stash_module): Constify "name" param. - - * pe-dll.c: Replace CONST with const throughout. - (quick_symbol): Constify "n1", "n2", "n3" params. - (make_singleton_name_thunk): Constify "import" param. Make - "buffer_len" a size_t. - (make_import_fixup_entry): Constify "name", "fixup_name", - "dll_symname" params. - (pe_get16): Cast args of bfd_seek. Replace bfd_read with bfd_bread. - (pe_get32): Likewise. - (pe_implied_import_dll): Likewise. - - * emultempl/beos.em (sort_by_file_name): Constify "ra", "rb". - (sort_by_section_name): Likewise. - - * emultempl/pe.em: Move defines for arm_epoc_pe before bfd.h included. - (make_import_fixup): Cast printf arg, rel->address to long rather - than int. - (gld_${EMULATION_NAME}_after_open): Don't compare NULL against int. - -2001-09-15 Alan Modra <amodra@bigpond.net.au> - - * ldmain.c (main): Rename BufferSize to ld_bufsz because HPUX - defines BufferSize. Increase buffer size by one. - -2001-09-14 Ralf Habacker <Ralf.Habacker@freenet.de> - - * pe-dll.c (pe_walk_relocs_of_symbol): Fix memory leak. - -2001-09-14 Kevin Lo <kevlo@openbsd.org> - - * configure.tgt: Add arm-openbsd target. - -2001-09-12 H.J. Lu <hjl@gnu.org> - - * Makefile.am (ALL_EMULATIONS): Move eelf64ppc.o and - eelf64lppc.o to ... - (ALL_64_EMULATIONS): Here. - * Makefile.in: Regenerated. - -2001-09-12 Paul Sokolovsky <Paul.Sokolovsky@technologist.com> - - * emultempl/pe.em(make_import_fixup): change signature to - take asection as well as arelec; we need this for proper - error reporting. Only call pe_create_import_fixup() if - there is no attempt to add a constant addend to the reloc; - otherwise, report error condition. - * pe-dll.c(pe_walk_relocs_of_symbol): change signature, - since final argument is a pointer to make_import_fixup(). - Change call to cb() to match make_import_fixup() signature. - (make_import_fixup_mark): make buffer_len unsigned. - * pe-dll.h: change signature of pe_walk_relocs_of_symbol. - -2001-09-12 Charles Wilson <cwilson@ece.gatech.edu> - - * ld.texinfo: add verbose documentation for auto-import - direct-addressing workaround, to compliment the terse - error message. - -2001-09-12 Andrew MacLeod <amacleod@redhat.com> - - * scripttempl/v850.sc: Add gcc_except_table sections. - -2001-09-11 Jeffrey A Law (law@cygnus.com) - - * emulparams/h8300helf.sh: Move stack to a much higher memory address. - * emulparams/h8300self.sh: Similarly. - -2001-09-05 Danny Smith <dannysmith@users.souceforge.net> - - * ld.texinfo (Options, --stack): Correct default value for stack - reserve. - -2001-09-05 Tom Rix <trix@redhat.com> - - * emultempl/aix.em : Handle import file XMC_XO and syscall symbols. - -2001-09-03 Andreas Jaeger <aj@suse.de> - - * emultempl/beos.em: Declare prototypes for comparions functions, - adjust definitions. - -2001-09-02 Andreas Jaeger <aj@suse.de> - - * emultempl/aix.em: Add missing prototype. - * emultempl/lnk960.em: Likewise. - * emultempl/vanilla.em: Likewise. - * emultempl/armcoff.em: Likewise. - * emultempl/armelf_oabi.em: Likewise. - * emultempl/beos.em: Likewise. - * emultempl/gld960c.em: Likewise. - * emultempl/gld960.em: Likewise. - - * emulparams/elf64alpha.sh (PARSE_AND_LIST_PROLOGUE): Add parameter - for prototype declaration. - -2001-08-31 Eric Christopher <echristo@redhat.com> - Jason Eckhardt <jle@redhat.com> - - * ldmain.c (get_emulation): Add support for -mips32 and -mips64. - -2001-08-31 Andreas Jaeger <aj@suse.de> - - * emultempl/pe.em: Add missing prototypes. - (gld_${EMULATION_NAME}_after_open): Remove extra args to - pe_find_data_imports. - (pr_sym): Add unused attribute. - -2001-08-29 Joel Sherrill <joel@OARcorp.com> - - * configure.tgt (i[3456]86-*-rtems*, m68*-*-rtems*): Change - default from coff to elf. - -2001-08-29 Jeff Law <law@redhat.com> - - * emulparams/h8300helf.sh: Resync with h8300elf.sh. Update - ARCH specification. - * emulparams/h8300self.sh: Similarly. - -2001-08-28 J"orn Rennecke <amylaar@redhat.com> - - * Makefile.am (ALL_EMULATIONS): Add eh8300elf.o, eh8300elf.o and - eh8300self.o . - (eh8300elf.c, eh8300helf.c, eh8300self.c): New targets. - * configure.tgt (h8300-*-elf*): New case. - * emulparams/h8300elf.sh, emulparams/h8300helf.sh: New files. - * emulparams/h8300self.sh: New file. - * Makefile.in: Regenerated. - -2001-08-28 Nick Clifton <nickc@cambridge.redhat.com> - - * ldmain.c (main): Rename BSIZE to BufferSize to avoid collision - with macro name. - -2001-08-27 Linus Nordberg <linus@swox.com> - Alan Modra <amodra@bigpond.net.au> - - * Makefile.am (ALL_EMULATIONS): Add eelf64ppc.o and eelf64lppc.o. - (eelf64ppc.c, eelf64lppc.c): Add make targets. - Run "make dep-am" - * Makefile.in: Regenerate. - * configure.tgt: Add powerpc64 support. Move pdp11, pjl, pj - entries to correct alphabetical position. - * emulparams/elf64ppc.sh: New. - * emulparams/elf64lppc.sh: New. - -2001-08-27 Nick Clifton <nickc@cambridge.redhat.com> - - * ldmain.c (main): Declare BSIZE as static. - -2001-08-23 Jakub Jelinek <jakub@redhat.com> - - * emultempl/elf32.em (place_orphan): Place orphan .rel* sections - into .rel.dyn resp. .rela.dyn if combreloc. - (get_script): If .x linker script is equal to .xn, only put it - once into the binary. - Add .xc and .xsc scripts. - (parse_args): Handle -z combreloc and -z nocombreloc. - * scripttempl/elf.sc (.rela.sbss): Fix a typo. - For .xc and .xsc scripts put all .rel* or .rela* input sections - but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn. - * genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME - is elf. - Strip trailing whitespace from script. - Generate .xc and .xsc scripts if requested. - * ldmain.c (main): Initialize link_info.combreloc and - link_info.spare_dynamic_tags. - * lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define. - (ld_options): Add --spare-dynamic-tags option. - (parse_args): Likewise. - * ld.texinfo: Document -z combreloc and -z nocombreloc. - * ldint.texinfo: Document .xc and .xsc linker scripts. - * NEWS: Add notes about -z combreloc and SHF_MERGE. - -2001-08-22 H.J. Lu <hjl@gnu.org> - - * emulparams/elf32fr30.sh: Add a newline. - -2001-08-21 Andreas Jaeger <aj@suse.de> - - * deffilep.y: Add missing prototypes. - * pe-dll.c: Likewise. - -2001-08-20 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (insert_pad): Fix typos in last patch. - - * ldlang.c: When traversing lang_statement_union_type lists, - consistently use "header.next" rather than "next". - * mpw-eppcmac.c: Likewise. - * emultempl/beos.em: Likewise. - * emultempl/hppaelf.em: Likewise. - * emultempl/pe.em: Likewise. - * ldlang.h (union lang_statement_union): Remove "next" field. - - * ldlang.c (insert_pad): Use offsetof macro. - (lang_size_sections): Always neuter padding statements. - * emultempl/hppaelf.em (hppaelf_delete_padding_statements): Delete. - - * pe-dll.c (pe_dll_fill_sections): Correct type of "relax" param - passed to lang_size_sections. - (pe_exe_fill_sections): Likewise. - * emultempl/pe.em (output_prev_sec_find): Copied from elf32.em. - (gld_${EMULATION_NAME}_place_orphan): Merge from elf32.em. - -2001-08-18 Alan Modra <amodra@bigpond.net.au> - - * emultempl/aix.em: Formatting fixes. - -2001-08-18 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (insert_pad): Make use of an existing pad statement if - available. Move code calculating alignment, adjusting section - alignment power, and adjusting dot to .. - (size_input_section): .. here. Remove unused relax param. - (lang_size_sections): Change boolean `relax' param to boolean *. - Adjust call to size_input_section. Make use of insert_pad to - place pad after the assignment statement. If relaxing, zap - padding statements. - (reset_memory_regions): Reset output_bfd section sizes too. - (relax_again): Move to.. - (lang_process): ..here. Adjust call to lang_size_sections, and - remove duplicated code. - * ldlang.h (lang_size_sections): Change `relax' param to boolean *. - -2001-08-17 Alan Modra <amodra@bigpond.net.au> - - * ld.texinfo: Document that fill values now use the four least - significant bytes. - * emulparams/elf32fr30.sh (NOP): Update. - * emulparams/elf32mcore.sh: Likewise. - * emulparams/elf64_s390.sh: Likewise. - * emulparams/elf_i386.sh: Likewise. - * emulparams/elf_i386_be.sh: Likewise. - * emulparams/elf_i386_chaos.sh: Likewise. - * emulparams/elf_i386_ldso.sh: Likewise. - * emulparams/elf_s390.sh: Likewise. - * emulparams/elf_x86_64.sh: Likewise. - * emulparams/i386moss.sh: Likewise. - * emulparams/i386nw.sh: Likewise. - * emulparams/m68kelf.sh: Likewise. - * scripttempl/elf.sc: Update NOP comment. - * scripttempl/elfi370.sc: Likewise. - * scripttempl/elfm68hc11.sc: Likewise. - * scripttempl/elfm68hc12.sc: Likewise. - * scripttempl/nw.sc: Likewise. - -2001-08-15 Tom Rix <trix@redhat.com> - - * ldgram.y (saved_script_handle): Initialize to NULL. - * ldmain.c (main): Change check on saved_script_handle. - -2001-08-14 Alan Modra <amodra@bigpond.net.au> - - * emultempl/elf32.em: Formatting fixes. - (output_prev_sec_find): Test for bfd_ind_section too; do so by - looking at sec->owner. - (output_rel_find): Move function inside LDEMUL_PLACE_ORPHAN test. - (gld${EMULATION_NAME}_place_orphan): Add a few comments. Remove - unused code, and reorganize orphan section placement code. - - * ldlang.c (wild_doit): Rename to lang_add_section. - * ldlang.h: Here too. - * mpw-elfmips.c: And here. - * emultempl/beos.em: And here. - * emultempl/elf32.em: And here. - * emultempl/hppaelf.em: And here. - * emultempl/pe.em: And here. - -2001-08-13 Richard Henderson <rth@redhat.com> - - * emultempl/needrelax.em: New file. - * emulparams/elf64_ia64.sh (EXTRA_EM_FILE): Reference it. - * Makefile.am (eelf64_ia64.c): Depend on it. - * Makefile.in: Rebuild. - -2001-08-13 Alan Modra <amodra@bigpond.net.au> - - * emultempl/elf32.em: For SEC_EXCLUDE sections, ensure that - output_section is set non-NULL. - - * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Return - `true' for SEC_EXCLUDE sections so that the generic code doesn't - needlessly create an output_section_statement. Treat a correctly - named output_section_statement with NULL bfd_section as compatible. - -2001-08-13 Hans-Peter Nilsson <hp@bitrange.com> - - * emultempl/generic.em: Support EXTRA_EM_FILE. - (ld_${EMULATION_NAME}_emulation): Support emulation parameters - LDEMUL_BEFORE_PARSE, LDEMUL_SYSLIB, LDEMUL_HLL, - LDEMUL_AFTER_PARSE, LDEMUL_AFTER_OPEN, LDEMUL_AFTER_ALLOCATION, - LDEMUL_SET_OUTPUT_ARCH, LDEMUL_CHOOSE_TARGET, - LDEMUL_BEFORE_ALLOCATION, LDEMUL_GET_SCRIPT, LDEMUL_FINISH, - LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS, - LDEMUL_OPEN_DYNAMIC_ARCHIVE, LDEMUL_PLACE_ORPHAN, - LDEMUL_SET_SYMBOLS, LDEMUL_PARSE_ARGS, LDEMUL_UNRECOGNIZED_FILE, - LDEMUL_LIST_OPTIONS, LDEMUL_RECOGNIZED_FILE, - LDEMUL_FIND_POTENTIAL_LIBRARIES. - -2001-08-12 Richard Henderson <rth@redhat.com> - - * scripttempl/elf.sc, scripttempl/elfd30v.sc, - scripttempl/elfm68hc11.sc, scripttempl/elfm68hc12.sc, - scripttempl/v850.sc: Keep .jcr data. - -2001-08-12 H.J. Lu <hjl@gnu.org> - Andrew Haley <aph@cambridge.redhat.com> - Nick Clifton <nickc@redhat.com> - - * ldgram.y (had_script): Change name to saved_script_handle. - Change type to file handle. - * ld.h (had_script): Rename and retype. - * ldfile.c (ldfile_open_command_file): Save the file handle - used in saved_script_handle. - * lexsup.c (parse_args): Do not allow -c option to alter - saved_script_handle. - * ldmain.c (main): Print out the linker script used if - --verbose is given. Check saved_script_handle to obtain the - external linker script used, or if NULL, dump the builtin - script. - * ld.texinfo: Document that --verbose now dumps the linker - script used, regardless of whether it was an internal or an - external script. - -2001-08-10 Andreas Jaeger <aj@suse.de> - - * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes - to build warnings. - * configure: Regenerate. - -2001-08-09 Alan Modra <amodra@bigpond.net.au> - - * emultempl/elf32.em (output_prev_sec_find): Add missing prototype. - - * scripttempl/elf.sc: Move non-text .dynamic section before - .plt/.got/.sdata* group. - (OTHER_GOT_SECTIONS): Move to immediately after .got. - (OTHER_SDATA_SECTIONS): Add. - * emulparams/criself.sh: Use OTHER_SDATA_SECTIONS rather than - OTHER_GOT_SECTIONS. - * emulparams/crislinux.sh: Likewise. - * emulparams/elf32b4300.sh: Likewise. - * emulparams/elf32bmip.sh: Likewise. - * emulparams/elf32bmipn32.sh: Likewise. - * emulparams/elf32bsmip.sh: Likewise. - * emulparams/elf32btsmip.sh: Likewise. - * emulparams/elf32ebmip.sh: Likewise. - * emulparams/elf32elmip.sh: Likewise. - * emulparams/elf32l4300.sh: Likewise. - * emulparams/elf32lmip.sh: Likewise. - * emulparams/elf32lsmip.sh: Likewise. - * emulparams/elf32ltsmip.sh: Likewise. - * emulparams/elf64bmip.sh: Likewise. - * emulparams/elf64btsmip.sh: Likewise. - * emulparams/elf64ltsmip.sh: Likewise. - -2001-08-08 Alan Modra <amodra@bigpond.net.au> - - * genscripts.sh: Source the emulparams script before each output - script is generated so that variables like `RELOCATING' may affect - variables defined in the emulparams script. - -2001-08-04 Alan Modra <amodra@bigpond.net.au> - - * emultempl/aix.em: ldexp.h,ldlang.h,ldfile.h,ldemul.h go in this - order. - - * emultempl/beos.em (sort_sections): Modify for 2001-08-03 change, - ie. iterate over wild_statement.section_list. - (gld${EMULATION_NAME}_place_orphan): Likewise. - -2001-08-03 Stephane Carrez <Stephane.Carrez@worldnet.fr> - - * scripttempl/elfm68hc12.sc (FINISH_CODE, FINISH_RELOC): New to handle - .fini[0-4] sections used by _exit - (CTOR, DTOR): Export ctor/dtor symbols; move them to ROM. - (*.text,*.data,*.bss): Take into account .text.*, .data.*, .bss.*. - * scripttempl/elfm68hc11.sc: Likewise. - -2001-08-03 H.J. Lu <hjl@gnu.org> - - * emultempl/beos.em (init): Add the missing initialization. - -2001-08-03 Alan Modra <amodra@bigpond.net.au> - - * ld.texinfo (Input Section Basics): Clarify ordering of output - sections. - * ldlang.c (callback_t): Add wildcard_list param. - (walk_wild_section): Remove "section" param. Rewrite for - lang_wild_statement_type change. Remove unique_section_p test. - (walk_wild_file): Remove "section" param. - (walk_wild): Remove "section" and "file" params. - (lang_gc_wild): Likewise. - (wild): Likewise. Modify for lang_wild_statement_type change. - (wild_sort): Likewise. Add "sec" param. - (gc_section_callback): Likewise. - (output_section_callback): Likewise. Do unique_section_p test. - (map_input_to_output_sections): Modify call to wild. - (lang_gc_sections_1): Likewise. - (print_wild_statement): Modify for lang_wild_statement_type - change. - (lang_add_wild): Replace filename, filenames_sorted param with - filespec. Replace section_name, sections_sorted, - exclude_filename_list with section_list. - * ldlang.h (lang_add_wild): Here too. - (lang_wild_statement_type): Replace section_name, sections_sorted, - and exclude_filename_list with section_list. - * ldgram.y (current_file): Delete. - (%union): Add wildcard_list. - (file_NAME_list): Set type to wildcard_list. Build a linked list - rather than calling lang_add_wild for each entry. - (input_section_spec_no_keep): Call lang_add_wild here instead. - * ld.h (struct wildcard_list): Declare. - * mri.c (mri_draw_tree): Modify to suit new lang_add_wild. - -2001-08-02 Charles Wilson <cwilson@ece.gatech.edu> - - * ldmain.c (main): initialize link_info.pei386_auto_import - * pe-dll.c: new tables for auto-export filtering - (auto_export): change API, pass abfd for contextual filtering. - Loop thru tables of excluded symbols instead of comparing - "by hand". - -2001-08-02 Paul Sokolovsky <paul.sokolovsky@technologist.com> - - * pe-dll.c: new variable pe_dll_enable_extra_debug. New - static variable current_sec (static struct sec *). Add - forward declaration for add_bfd_to_link. - (process_def_file): Don't export undefined symbols. Do not - export symbols starting with "_imp__". Call auto_export() - with new API. - (pe_walk_relocs_of_symbol): New function. - (generate_reloc): add optional extra debugging - (pe_dll_generate_def_file): eliminate extraneous initial blank - line in output - (make_one): enlarge symtab to make room for __nm__ symbols - (DATA auto-import support). - (make_singleton_name_thunk): New function. - (make_import_fixup_mark): New function. - (make_import_fixup_entry): New function. - (pe_create_import_fixup): New function. - (add_bfd_to_link): Specify that 'name' argument is a CONST - char *. - * pe-dll.h: declare new variable pe_dll_extra_pe_debug; - declare new functions pe_walk_relocs_of_symbol and - pe_create_import_fixup. - * emultempl/pe.em: add new options --enable-auto-import, - --disable-auto-import, and --enable-extra-pe-debug. - (make_import_fixup): New function. - (pe_find_data_imports): New function. - (pr_sym): New function. - (gld_${EMULATION_NAME}_after_open): Add optional extra pe - debugging. Call pe_find_data_imports. Mark .idata as DATA, not - CODE. - -2001-08-02 Charles Wilson <cwilson@ece.gatech.edu> - - * ld.texinfo: add additional documentation for - --export-all-symbols. Document --out-implib, - --enable-auto-image-base, --disable-auto-image-base, - --dll-search-prefix, --enable-auto-import, and - --disable-auto-import. - * ldint.texinfo: Add detailed documentation on auto-import - implementation. - -2001-07-30 Nick Clifton <nickc@cambridge.redhat.com> - - * ld.texinfo (Simple Assignments): Fix computation in SECTIONS - example. - -2001-07-24 Alan Modra <amodra@bigpond.net.au> - - * Makefile.am: Update dependencies with "make dep-am". - * Makefile.in: Regenerate - -2001-07-23 Alan Modra <amodra@bigpond.net.au> - - * ldcref.c (check_section_sym_xref): New function. - (check_nocrossrefs): Call it. - (check_nocrossref): Interate over h->refs here instead of.. - (check_refs): ..here. Pass in the symbol name, section, and bfd - rather than hash_entry pointers. - (struct check_refs_info): Keep symbol name rather than hash entry. - Remove "same". - (check_reloc_refs): Tweak for above changes in check_refs_info. - Only report references to section syms when symname is NULL to - prevent duplicate messages for the same reloc. - -2001-07-19 Nick Clifton <nickc@cambridge.redhat.com> - - * ldexp.c (exp_print_tree): Use stderr if config.map_file is not - available. Do not print NULL trees. - (exp_print_token): Print unknown tokens with values > 126 as - decimal values not ASCII characters. - - * ldlang.c (lang_leave_overlay): If a region is specified assign - it to all sections inside the overlay unless they have been - assigned to the own, non-default, memory region. - - * README: Add header for consistency with other README files. - -2001-07-14 H.J. Lu <hjl@gnu.org> - - * emultempl/elf32.em (output_prev_sec_find): Never return - bfd_abs_section_ptr, bfd_com_section_ptr nor - bfd_und_section_ptr. - -2001-07-14 Nick Clifton <nickc@cambridge.redhat.com> - - * Makefile.am (em32relf.c): Change dependency from generic.em to - elf32.em. - * Makefile.in: Regenerate. - -2001-07-14 matthew green <mrg@eterna.com.au> - - * configure.tgt (i386-*-netbsdelf*): New target. - (i386-*-netbsd*): Set targ_extra_emuls to `elf_i386' - -2001-07-13 Jakub Jelinek <jakub@redhat.com> - - * emultempl/elf32.em (output_prev_sec_find): New. - (place_orphan): Use it. - -2001-07-11 H.J. Lu <hjl@gnu.org> - - * ldmain.c (main): Fix typos in the last change. - -2001-07-11 Jakub Jelinek <jakub@redhat.com> - - * ldmain.c (main): Disallow -F and -f without -shared. - -2001-07-11 Nick Clifton <nickc@cambridge.redhat.com> - - * emultempl/pe.em (after_open): Check for the output_bfd not - having any coff_data structure allocated to it. - -2001-07-09 David O'Brien <obrien@FreeBSD.org> - - * emultempl/elf32.em: Do not assuming that contents of the buffer - returned from basename function will remain unchanged accross other - function calls. - -2001-07-03 H.J. Lu <hjl@gnu.org> - - * scripttempl/elf.sc (DYNAMIC_PAD): Revert the change made on - 2001-07-03. It creates dynamic entries even for static binaries. - -2001-07-03 Jakub Jelinek <jakub@redhat.com> - - * scripttempl/elf.sc (DYNAMIC_PAD): New variable. - (DYNAMIC): Use it to reserve few dynamic entries for - post-linking tools. - -2001-06-27 Alan Modra <amodra@bigpond.net.au> - - * emulparams/hppa64linux.sh: New file. - * configure.tgt: hppa*64*-*-linux* uses hppa64linux.sh - * Makefile.am (ALL_64_EMULATIONS): Add ehppa64linux.o - (ehppa64linux.c): Add rule to make it. - Run "make dep-am". - * Makefile.in: Regenerate. - -2001-06-21 Hans-Peter Nilsson <hp@axis.com> - - * ld.texinfo (Options, -r): Mention restrictions when using - different object formats. - -2001-06-19 Hans-Peter Nilsson <hp@axis.com> - - * ldlang.c (lang_check): Emit fatal error if relocatable link - between different object flavours with relocations in input. - -2001-06-19 H.J. Lu <hjl@gnu.org> - - * ld.texinfo (-E, --export-dynamic): Mention --version-script. - (--version-script): Mention the language support. - -2001-06-19 H.J. Lu <hjl@gnu.org> - - * ldlang.c (lang_check): Revert the change mode on 2001-06-15. - -2001-06-18 H.J. Lu <hjl@gnu.org> - - * Makefile.am (ld.1): Remove the prefix `$(srcdir)/'. - (diststuff): Add $(MANS). - * Makefile.in: Regenerated. - - * ld.1: Removed. - -2001-06-18 Hans-Peter Nilsson <hp@axis.com> - - * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): - Update for API change in bfd_elf${ELFSIZE}_size_dynamic_sections. - * mpw-elfmips.c (gldelf32ebmip_before_allocation): Ditto. - * ld.h (args_type): Remove member export_dynamic. All users - changed to use struct bfd_link_info member. - - * Makefile.am (ecriself.c, ed10velf.c, ei386moss.c): Depend on - $(srcdir)/emultempl/elf32.em, not $(srcdir)/emultempl/generic.em. - * Makefile.in: Regenerate. - -2001-06-18 H.J. Lu <hjl@gnu.org> - - * ldlang.c (init_os): Add the newline to the einfo call. - (lang_check): Likewise. - (lang_do_version_exports_section): Likewise. - -2001-06-15 H.J. Lu <hjl@gnu.org> - - * lexsup.c (parse_args); Save optind to report unrecognized - option. - -2001-06-15 Hans-Peter Nilsson <hp@axis.com> - - * ldlang.c (lang_check): Emit fatal error if relocatable link - between different object flavours. - - * lexsup.c (parse_args) <case OPTION_EXPORT_DYNAMIC, case 'E'>: - Set new link_info member export_dynamic. - * ldmain.c (main): Initialize new link_info member export_dynamic. - -2001-06-12 Nick Clifton <nickc@cambridge.redhat.com> - - * ldlang.c (walk_wild): Only call walk_wild_file if - lookup_name returns something. - (lookup_name): If load_symbols fails, return NULL. - (load_symbols): Change to a boolean function. - (open_input_bfds): If load_symbols fails then do not make the - executable. - -2001-06-08 Alan Modra <amodra@bigpond.net.au> - - * ldlang.c (record_bfd_errors): Remove. - - * emultempl/aix.em: Fix copyright dates. - -2001-06-07 Andreas Jaeger <aj@suse.de> - - * elf_x86_64.sh (NONPAGED_TEXT_START_ADDR): Increase. - (TEXT_START_ADDR): Likewise. - -2001-06-06 Martin Schwidefsky <schwidefsky@de.ibm.com> - - * configure.host: Set HOSTING_CRT0/HOSTING_LIBS correctly for s/390. - -2001-06-05 Danny Smith <danny_r_smith_2001@yahoo.co.nz> - - * emultempl/pe.em (init): Reduce default stack reserve to 0x200000. - -2001-05-31 H.J. Lu <hjl@gnu.org> - - * ldlang.c (open_input_bfds): Don't change the bfd error - handler whilst loading symbols. - -2001-05-28 Nick Clifton <nickc@cambridge.redhat.com> - - * configure.tgt: Remove i370-mvs architecture, it is not currently - supported. - -2001-05-25 H.J. Lu <hjl@gnu.org> - - * emulparams/ppcmacos.sh: Add SYSCALL_MASK and SYMBOL_MODE_MASK - like emulparams/aixppc.sh. - -2001-05-25 H.J. Lu <hjl@gnu.org> - - * emultempl/beos.em (gld${EMULATION_NAME}_before_parse): Move - setting of output_filename after bfd_scan_arch. - * emultempl/pe.em: Likewise. - -2001-05-25 H.J. Lu <hjl@gnu.org> - - * emulparams/aixrs6.sh: Add SYSCALL_MASK and SYMBOL_MODE_MASK - like emulparams/aixppc.sh. - - * emultempl/aix.em (sc): Use ${srcdir}/emultempl/ostring.sed - instead of ${srcdir}/emultempl/stringify.sed. - -2001-05-25 Timothy Wall <twall@oculustech.com> - - * emulparams/elf64_aix.sh: Change settings to match IBM linker - output. - -2001-05-25 Alan Modra <amodra@one.net.au> - - * configure.host: Replace linuxoldld with linux*oldld. - * configure.tgt: Likewise. - -2001-05-24 H.J. Lu <hjl@gnu.org> - - * emultempl/stringify.sed: Removed again. - -2001-05-24 H.J. Lu <hjl@gnu.org> - - * emultempl/aix.em (OUTPUT_ARCH): Defined. - (gld${EMULATION_NAME}_before_parse): Initialize - ldfile_output_architecture, ldfile_output_machine and - ldfile_output_machine_name from ${OUTPUT_ARCH} if possible. - * emultempl/beos.em: Likewise. - * emultempl/elf32.em: Likewise. - * emultempl/linux.em: Likewise. - * emultempl/mipsecoff.em: Likewise. - * emultempl/pe.em: Likewise. - * emultempl/sunos.em: Likewise. - -2001-05-24 Tom Rix <trix@redhat.com> - - * emultempl/aix.em : (gld${EMULATION_NAME}_read_file) - udate import file format. - (change_symbol_mode) New, same - (is_syscall) New, same - * emulparams/aixppc.sh : add SYSCALL_MASK and SYMBOL_MODE_MASK - * emulparams/aixppc64.sh : same - * emulparams/aixrs6.sh : same - * emulparams/ppcmacos.sh : same - * emultempl/aix.em : use strtoull to parse options - * Makefile.am : add eaixppc64 emulation for xcoff64 - * Makefile.in : same - * configure.tgt : same - - * scripttempl/aix.sc : default text section offset to 0x10000000 - default data section offset to 0x20000000 - add .sv3264 and .sv64 pseudo sections - loader and debug sections use the currect section offset. - - * emultempl/aix.em : Add xcoff64 support - Add -binitfini support - (gld${EMULATION_NAME}_before_parse) -binitfini - (gld${EMULATION_NAME}_parse_args) same - (gld${EMULATION_NAME}_before_allocation) format change for special - sections - - * emulparams/aixppc64.sh : New file for xcoff64 support - -2001-05-23 Alexandre Oliva <aoliva@redhat.com> - - * emultempl/elf32.em (ELF_INTERPRETER_SET_DEFAULT): Use this new - variable to avoid non-portable shell construct. - -2001-05-23 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> - - * ldmain.c (get_emulation): Add -mips5 command line argument. - -2001-05-22 Alexandre Oliva <aoliva@redhat.com> - - * emulparams/elf_i386_ldso.sh: New, copied from elf_i386.sh. - (ELF_INTERPRETER_NAME): Define it. - * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Use - it. - * configure.tgt (targ_emul, targ_extra_emuls) - [i[3456]86-*-solaris2*, i[3456]86-*-solaris*]: Use elf_i386_ldso - as primary, elf_i386 as extra. - * Makefile.am (ALL_EMULATIONS): Added eelf_i386_ldso.o. - (eelf_i386_ldso.c): New rule. - * Makefile.in: Rebuilt. - -2001-05-22 Nick Clifton <nickc@redhat.com> - - * lexsup.c (ld_options): Allow -I to be an alias for - --dynamic-linker. This is for Solaris compatability. - * ld.texinfo: Document that -I can be used. - * ld.1: Regenerate. - -2001-05-16 Alan Modra <amodra@one.net.au> - - * ldlang.c (wild_doit): Use linker_has_input to reliably determine - whether an input section is the first one assigned to an output - section. - Assorted formatting fixes. - -2001-05-14 DJ Delorie <dj@delorie.com> - - * Makefile.am (ld.dvi): Search bfd/doc for texinfo files. - * Makefile.in: Ditto. - -2001-05-11 Jakub Jelinek <jakub@redhat.com> - - * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Put - .gnu.linkonce.ia64unw{,i} sections into corresponding .IA_64.unwind* - output sections. - * emulparams/elf64_aix.sh (OTHER_READONLY_SECTIONS): Likewise. - -2001-05-11 Jakub Jelinek <jakub@redhat.com> - - * ldlang.c (lang_process): Call bfd_merge_sections. - -2001-05-07 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> - - * ldgram.y: Fix typo. - -2001-05-03 H.J. Lu <hjl@gnu.org> - - * emultempl/elf32.em: Include "libiberty.h". - (gld${EMULATION_NAME}_vercheck): Call basename () to get the - basename of the bfd filename. - (gld${EMULATION_NAME}_stat_needed): Likewise. - (gld${EMULATION_NAME}_try_needed): Likewise. - (gld${EMULATION_NAME}_open_dynamic_archive): Likewise. - -2001-05-02 H.J. Lu <hjl@gnu.org> - - * emultempl/pe.em: Include <ctype.h>. - -2001-05-02 Johan Rydberg <jrydberg@opencores.org> - - * emulparams/elf32openrisc.sh: New file. - - * Makefile.am: Add OpenRISC target. - * Makefile.in: Regenerated. - - * configure.tgt: Add openrisc-*-* mapping. - -2001-05-02 Nick Clifton <nickc@redhat.com> - - * emultempl/aix.em: Replace buystring with xstrdup. - * emultempl/beos.em: Replace buystring with xstrdup. - -2001-05-02 H.J. Lu <hjl@gnu.org> - - * ldfile.c: Include "libiberty.h". - * ldlex.l: Likewise. - - * ldmisc.c (buystring): Removed. - * ldmisc.h: Likewise. - - * ldfile.c: Replace buystring with xstrdup. - * ldlang.c: Likewise. - * ldlex.l: Likewise. - * ldmain.c: Likewise. - * ldmisc.c: Likewise. - * lexsup.c: Likewise. - * mpw-eppcmac.c: Likewise. - -2001-04-30 Andreas Jaeger <aj@suse.de> - - * emulparms/elf_x86_64.sh (MAXPAGESIZE): Fix value. - -2001-04-28 Paul Sokolovsky <Paul.Sokolovsky@technologist.com> - - * ldlang.c (load_symbols): Give emulation a chance - to process unrecognized file before fatal error is - reported, not after. - -2001-04-27 Sean McNeil <sean@mcneil.com> - - * configure.tgt: Add arm-vxworks target. - * scripttempl/armcoff.sc: Support .text or .data as a section name - prefix. - Define _etext. - -2001-04-13 J.T. Conklin <jtc@redback.com> - - * ld.texinfo: Document --fatal-warnings. - * ld.1: Regenerate. - - * ldmisc.c (vfinfo): Set flag to inhibit making executable if - warnings have been turned into errors. - * lexsup.c (OPTION_WARN_FATAL): Define. - (ld_options): Entry for --fatal-warnings. - (parse_args): Handle OPTION_WARN_FATAL. - * ld.h (ld_config_type): Add fatal_warnings field. - -2001-04-13 Jakub Jelinek <jakub@redhat.com> - - * ldmain.c (main): Default to discard_sec_merge. - * lexsup.c (OPTION_DISCARD_NONE): Define. - (ld_options): Add --discard-none. - (parse_args): Handle OPTION_DISCARD_NONE. - * ldlang.c (wild_doit): SEC_MERGE should be set in the output - section only if SEC_MERGE and SEC_STRINGS flags and entsize of - all its input sections match. - -2001-04-05 Steven J. Hill <sjhill@cotw.com> - - * Makefile.am (ALL_EMULATIONS): Add eelf32ltsmip.o. - (ALL_64_EMULATIONS): Add eelf64btsmip.o and eelf64ltsmip.o. - (eelf32ltsmip.c): New target. - (eelf64btsmip.c): Likewise. - (eelf64ltsmip.c): Likewise. - * Makefile.in: Regenerated. - - * configure.tgt (mips*el-*-linux-gnu): Uses traditional MIPS - target. - (mips*-*-linux-gnu*): Likewise. - - * emulparams/elf32ltsmip.sh: New. Traditional little endian - MIPS taget. - * emulparams/elf64btsmip.sh: New. Traditional 64bit big endian - target. - * emulparams/elf64ltsmip.sh: New. Traditional 64bit little - endian target. - -2001-04-05 Hans-Peter Nilsson <hp@axis.com> - - * emulparams/criself.sh (EXECUTABLE_SYMBOLS): Cannot provide - correct value of __Stext here. - (TEXT_START_SYMBOLS): Define; always define __Stext, to start of - .startup section. - - * emulparams/crislinux.sh: Remove FIXME. - -2001-04-02 Alan Modra <alan@linuxcare.com.au> - - * emulparams/hppalinux.sh (MAXPAGESIZE): Set to 64k. - (TEXT_START_ADDR, TARGET_PAGE_SIZE): Likewise. - -2001-03-27 Hans-Peter Nilsson <hp@axis.com> - - * configure.tgt (cris-*-*): Change default emulation to criself. - (cris-*-*aout*): New rule. - -2001-03-27 Matthew Wilcox <willy@ldl.fc.hp.com> - - * emulparams/hppalinux.sh (MAXPAGESIZE): Set to 0x4000. - (TEXT_START_ADDR, TARGET_PAGE_SIZE): Ditto. - -2001-03-26 Andreas Jaeger <aj@suse.de> - - * ld.texinfo (Overview): Fix syntax in texi code. - -2001-03-25 Stephane Carrez <Stephane.Carrez@worldnet.fr> - - * ld.texinfo: Put @c man indications to generate the ld man page. - When generating man, define all the variables. Define SEEALSO - and SYNOPSIS. Re-organize some lines to avoid the cross references. - * Makefile.am (MANCONF, TEXI2POD, POD2MAN): New variables. - (ld.1): Generate from ld.texinfo. - * Makefile.in: Regenerate. - -2001-03-23 Mark Elbrecht <snowball3@bigfoot.com> - - * scripttempl/i386go32.sc: Support the GCC flags '-ffunction-sections' - and '-fdata-sections'. Set the VMA of STABS sections to zero. - -2001-03-17 Ulrich Drepper <drepper@redhat.com> - - * emultmpl/elf32.em (gld${EMULATION_NAME}_search_needed): If NAME - is an absolute path look only for this file and not along the path. - -2001-03-17 Ulrich Drepper <drepper@redhat.com> - - * emultempl/elf32.em (OPTION_GROUP): New macro. - Add new option Bgroup to longopts. - (gld*_parse_args): Handle GROUP_OPTION and recognize -z defs. - (gld*_list_options): Add -Bgroup and -z defs. - * ld.1: Document -Bgroup and -z defs. - * ld.texinfo: Likewise. - -2001-03-07 Michael Meissner <meissner@redhat.com> - - * scripttempl/elfd10v.sc (.rodata,.rodata1,.data1,.sdata): Deal - with sections created by -fdata-sections. - (.dynbss,.bss): Ditto. - -2001-03-05 Alan Modra <alan@linuxcare.com.au> - - * emultempl/m68kelf.em (m68k_elf_after_allocation): Call - after_allocation_default, not gld..._before_allocation. - -2001-02-27 Alan Modra <alan@linuxcare.com.au> - - * configure.in (BFD_VERSION): New. - (AM_INIT_AUTOMAKE): Use $BFD_VERSION. - * configure: Regenerate. - * Makefile.am: Run "make dep-am" - * Makefile.in: Regenerate. - -2001-02-26 Timothy Wall <twall@cygnus.com> - - * emulparams/elf64_aix.sh: Add additional read-only sections; - uncomment lines which are now required. - -2001-02-26 H.J. Lu <hjl@gnu.org> - - * ldlang.c (open_input_bfds): Set the bfd error handler so - that problems can be caught whilst loading symbols. - (record_bfd_errors): New function: Report BFD errors and mark - the executable output as being invalid. - -2001-02-22 Timothy Wall <twall@cygnus.com> - - * configure.host: Add configuration for ia64-*-aix*. - * Makefile.am (ALL_64_EMULATIONS): Add emulation for ia64-*-aix*. - Add dependencies for eelf64_aix.c. - * Makefile.in: Regenerate. - * configure.tgt: Add ia64-*-aix* mapping. - * emulparams/elf64_aix.sh: Add settings for elf64 on aix5. - -2001-02-20 H.J. Lu <hjl@gnu.org> - - * ldfile.c (ldfile_open_file): Set entry->search_dirs_flag to - false if we found the file. - -2001-02-18 David O'Brien <obrien@FreeBSD.org> - - * configure.tgt: Add FreeBSD/Alpha, FreeBSD/x86-64, FreeBSD/ia64, - FreeBSD/PowerPC, FreeBSD/arm, and FreeBSD/sparc64 entries. - -2001-02-18 lars brinkhoff <lars@nocrew.org> - - * Makefile.am: Add PDP-11 target. - * configure.tgt: Likewise. - * emulparams/pdp11.sh: New file. - -2001-02-17 David O'Brien <obrien@FreeBSD.org> - - * configure.host: Add a generic FreeBSD configuration entry such that - all [modern] FreeBSD systems on all platforms will look the same. - -2001-02-14 H.J. Lu <hjl@gnu.org> - - * configure.tgt: Remove mention of earmelf_linux26. - -2001-02-13 Richard Henderson <rth@redhat.com> - - * emulparams/elf64_ia64.sh (OTHER_GOT_SYMBOLS): Remove. - -2001-02-13 H.J. Lu <hjl@gnu.org> - - * ldexp.h (node_type): Add etree_provided. - * ldexp.c (exp_fold_tree): Handle etree_provided. Set the node - type to etree_provided if defined by PROVIDE. Allow updating - for etree_provided. - (exp_print_tree): Handle etree_provided. - * mpw-elfmips.c (gldelf32ebmip_find_exp_assignment): Handle - etree_provided. - -2001-02-09 David Mosberger <davidm@hpl.hp.com> - - * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Add - .IA_64.unwind.* pattern to unwind table section and - .IA_64.unwind_info* pattern to unwind info section. - -2001-02-09 Martin Schwidefsky <schwidefsky@de.ibm.com> - - * Makefile.am: Add linux target for S/390. - * Makefile.in: Likewise. - * configure.host: Likewise. - * configure.tgt: Likewise. - * emulparams/elf64_s390.sh: New file. - * emulparams/elf_s390.sh: New file. - -2001-02-09 Jakub Jelinek <jakub@redhat.com> - - * configure.tgt (sparc64-*-linux-gnu*): Add elf32_sparc into - targ_extra_libpath. - (sparc-*-linux-gnu*): Add elf64_sparc into targ_extra_libpath. - -2001-02-06 Philip Blundell <philb@gnu.org> - - * Makefile.am: Remove mention of earmelf_linux26. - * Makefile.in: Regenerate. - -2001-02-04 Philip Blundell <philb@gnu.org> - - * emulparams/armelf_linux.sh (TEXT_START_ADDR): Set to 0x8000. - * emulparams/armelf_linux26.sh: Delete. - * configure.tgt: Remove mention of armelf_linux26 emulation. - -2001-02-01 Nick Clifton <nickc@redhat.com> - - * ld.1: Replace occurances of -oformat with --oformat. - -2001-01-25 Jim Driftmyer <jdrift@stny.rr.com> - - * ldlang.c (lang_leave_overlay): Don't set lma_region when - load_base is specified. - -2001-01-24 Hans-Peter Nilsson <hp@axis.com> - - * emultempl/elf32.em: Correct spelling in comments and listed - options. - -2001-01-23 Alan Modra <alan@linuxcare.com.au> - - * ldlang.c (lang_leave_overlay): Only set lma_region from the - default for the first section of a group of overlay sections. - -2001-01-22 Alan Modra <alan@linuxcare.com.au> - - * Makefile.am (GENSCRIPTS): Pass exec_prefix. - * Makefile.in: Regenerate. - * genscripts.sh: Use exec_prefix parameter to specify tool lib. - Check for null tool_dir. - -2001-01-16 Jim Wilson <wilson@redhat.com> - - * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Add IA_64.unwind - and IA_64.unwind.info. - -2001-01-16 H.J. Lu <hjl@gnu.org> - - * ldlang.c (lang_check): Merge the private data only if the - input file has contents. - -2001-01-14 Alan Modra <alan@linuxcare.com.au> - - * emulparams/hppalinux.sh (OUTPUT_FORMAT): Set to elf32-hppa-linux. - - * emultempl/hppaelf.em (hppaelf_after_parse): New function, - enabling search for libmilli. On a relocatable link, make .text - sections unique. - (LDEMUL_AFTER_PARSE): Define. - (hppaelf_finish): Correct spelling of relocatable in comments. - - * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't - rummage through the script for sections on the unique list. - Correct length of strncmp for ".note". - (gld${EMULATION_NAME}_check_needed): Rearrange function. - - * ldlang.c (unique_section_list): New var. - (unique_section_p): New function. - (walk_wild_section): Don't match sections on unique_section_list. - (lang_add_unique): New function. - Correct spelling of relocatable in comments. - - * ldlang.h (struct unique_sections): Declare. - (unique_section_list): Declare. - (unique_section_p): Declare. - (lang_add_unique): Declare. - - * lexsup.c (ld_options): Allow --unique to take an optional arg. - (parse_args [OPTION_UNIQUE]): Call lang_add_unique. - - * ld.texinfo (--unique): Update. - -2001-01-13 Nick Clifton <nickc@redhat.com> - - * lexsup.c (parse_args): Remove spurious white space. - -2001-01-12 Nick Clifton <nickc@redhat.com> - - * lexsup.c (parse_args): Update copyright date. - -2001-01-12 Philip Blundell <pb@futuretv.com> - - * configure.host: Set HOSTING_LIBS appropriately for ix86-cygwin. - -2001-01-10 Kazu Hirata <kazu@hxi.com> - - * scripttempl/h8300.sc: Fix formatting. Fix a comment typo. - * scripttempl/h8300h.sc: Fix formatting. - * scripttempl/h8300s.sc: Likewise. - * scripttempl/h8500.sc: Likewise. - * scripttempl/h8500b.sc: Likewise. - * scripttempl/h8500c.sc: Likewise. - * scripttempl/h8500m.sc: Likewise. - * scripttempl/h8500s.sc: Likewise. - -2000-01-07 David O'Brien <obrien@BSDi.com> - - * emultempl/elf32.em: Only perform Linux ld hints processing when - targeting Linux. - -2001-01-07 Philip Blundell <philb@gnu.org> - - * ld.texinfo (Bug Reporting): Update email address for reports. - -2000-12-31 Nick Clifton <nickc@redhat.com> - - * lexsup.c (parse_args): Set opterr to 0 and detect unparsed long - options by checking for a return value of '?' not -1. - -2000-12-28 Nick Clifton <nickc@redhat.com> - - * lexsup.c (struct ld_option): Add new enum value: - EXACTLY_TWO_DASHES. - (ld_options[]): Change -omagic, -output and -oformat options - to be EXACTLY_TWO_DASHES. - (OUTPUT_COUNT): Use ARRAY_SIZE. - (parse_args): Change parameter 'argc' to unsigned. - Place EXACTLY_TWO_DASHES options into new really_longopts - array. - If getopt_long_only fails, try calling getopt_long using the - really_longopts array. - (help): Print a double dash for both EXACTLY_TWO_DASHES and - TWO_DASHES options. - - * ldlex.h: Fix prototype of parse_args. - - * ld.texinfo: Document that long options starting with 'o' - must be preceeded by two dashes. Change example of a single - dashed long option from -oformat to -trace-symbol. - -2000-12-26 Danny Smith <danny_r_smith_2001@yahoo.co.nz> - - * emultempl/pe.em (OPTION_NO_DEFAULT_EXCLUDES): Define. - (longopts[]): New --no-default-excludes option. - (gld_${EMULATION_NAME}_list_options): Document. - (gld_${EMULATION_NAME}_parse_args): Handle. - -2000-12-13 Michael Sokolov <msokolov@ivan.Harhan.ORG> - - * ldlang.c (new_stat): Revert the last beautification with "innocent" - whitespace, it breaks the K&R C preprocessor. - -2000-12-11 DJ Delorie <dj@redhat.com> - - * ld.texinfo: Add notes about --whole-archive and gcc. - -2000-11-18 Fred Fish <fnf@be.com> - - * lexsup.c (OPTION_ALLOW_SHLIB_UNDEFINED): Define. - (ld_options): Entry for --allow-shlib-undefined. - (parse_args): Handle OPTION_ALLOW_SHLIB_UNDEFINED. - * ldmain.c (main): Initialize link_info.allow_shlib_undefined - to false. - * ld.texinfo: Document new command line switch. - -2000-12-12 Geoffrey Keating <geoffk@redhat.com> - - * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): - .fixup is actually read/write. - * emulparams/elf32lppc.sh (OTHER_READWRITE_SECTIONS): Likewise. - * emulparams/elf32ppcsim.sh (OTHER_READWRITE_SECTIONS): Likewise. - * emulparams/elf32lppcsim.sh (OTHER_READWRITE_SECTIONS): Likewise. - -2000-12-11 Jan Hubicka <jh@suse.cz> - - * NEWS: Add note about x86_64 architecture. - -2000-12-06 Mark Elbrecht <snowball3@bigfoot.com> - - * scripttempl/i386go32.sc: Use PROVIDE with _etext, _edata, _end. - Set DWARF2 sections to a VMA of zero. - -2000-12-01 Joel Sherrill <joel@OARcorp.com> - - * configure.tgt (arm-*-rtems*, a29k-*rtems*, h8300-*-rtems*): - New targets. - (sparc*-*-rtemself*, sparc*-*-rtemsaout*): New targets. - (sparc*-*-rtems*): Switched from a.out to ELF. - -2000-11-30 Jan Hubicka <jh@suse.cz> - - * Makefile.am (ALL_EMULATIONS): Add eelf_x86_64.o - (eelf_x86_64.c): New. - * Makefile.in: Regenerate. - * configure.tgt: Add support for x86_64-*-linux-gnu*. - * emulparams/elf_x86_64.sh: New. - -2000-11-30 Hans-Peter Nilsson <hp@axis.com> - - * emulparams/crislinux.sh (ENTRY): Change back to _start. - (TEXT_START_SYMBOLS): Remove conditional setting of __start. - - * scripttempl/crisaout.sc: Change all RELOCATING not related to - merging non-a.out sections into CONSTRUCTING. - -2000-11-28 Nick Clifton <nickc@redhat.com> - - * ld.1 (COPYING): Mention that the GNU Free Documentation - License is present in the sources, but not the output, and - also available from the GNU website. - (GNU Free Documentation License): Comment out this section. - -2000-11-28 David O'Brien <obrien@dragon.nuxi.com> - - * emulparams/elf64alpha.sh (ENTRY): Remove leading underscore as ELF - does not use them. - -2000-11-25 David O'Brien <obrien@FreeBSD.org> - - * ld.1: Remove old date so it does not give the impression the manpage - is way out of date. - -2000-11-24 Nick Clifton <nickc@redhat.com> - - * configure.tgt (xscale-coff): Add target. - (xscale-elf): Add target. - -2000-11-24 Fred Fish <fnf@be.com> - - * ldmain.c (main): Remove redundant init of config.make_executable - to true. - -2000-11-15 Richard Henderson <rth@redhat.com> - - * emulparams/elf64alpha.sh (MAXPAGESIZE): Typo -- 64k, not 1M. - -2000-11-14 Kazu Hirata <kazu@hxi.com> - - * scripttempl/h8300.sc: Fix formatting. - * scripttempl/h8300h.sc: Likewise. - * scripttempl/h8300s.sc: Likewise. - -2000-11-14 Denis Chertykov <denisc@overta.ru> - - * scripttempl/elf32avr.sc: Fix bug in .eeprom segment. - -2000-11-09 Philip Blundell <pb@futuretv.com> - - * emultempl/pe.em: Define ___start_SECNAME and ___stop_SECNAME - around orphan sections whose names can be represented in C. - -2000-11-07 Jim Wilson <wilson@redhat.com> - - * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): New local - hold_sdata. If SEC_SMALL_DATA set, set place to hold_sdata. - -2000-11-06 Nick Clifton <nickc@redhat.com> - - * ld.texinfo: Add GNU Free Documentation License. - * ldint.texinfo: Add GNU Free Documentation License. - * ld.1: Add GNU Free Documentation License. - -2000-11-05 Alan Modra <alan@linuxcare.com.au> - - * ldlex.l (yy_create_string_buffer): Init yy_is_our_buffer, - yy_is_interactive, yy_at_bol, and yy_fill_buffer. - - * Makefile.am (DISTCLEANFILES): Add stringify.sed. - Move 2000-11-02 Makefile.in changes to this file. - * Makefile.in: Regenerate. - -2000-11-03 Nick Clifton <nickc@redhat.com> - - * scripttempl/h8300.sc: Use ${CONSTRUCTING...} to enclose - constructors and destructors. - * scripttempl/h8300h.sc: Ditto. - * scripttempl/h8300s.sc: Ditto. - * scripttempl/h8500.sc: Ditto. - * scripttempl/h8500b.sc: Ditto. - * scripttempl/h8500c.sc: Ditto. - * scripttempl/h8500m.sc: Ditto. - * scripttempl/h8500s.sc: Ditto. - * scripttempl/v850.sc: Ditto. - * scripttempl/w65.sc: Ditto. - * scripttempl/z8000.sc: Ditto. - -2000-11-02 Per Lundberg <plundis@chaosdev.org> - - * Makefile.in (e_i386_chaos.c): New rule. - (ALL_EMULATIONS): Added e_i386_chaos.o. - * emulparams/elf_i386_chaos.sh: New file. - * configure.tgt: Recognise i[3456]86-chaosdev-storm-chaos. - -2000-10-20 Jakub Jelinek <jakub@redhat.com> - - * emulparams/elf64_sparc.sh (TEXT_START_ADDR, - NONPAGED_TEXT_START_ADDR): Set to 4GB for Solaris targets. - Fix sed invocation, so that it coped with '/' in Solaris 64bit - library path suffix. - Based on patch by Andrew Macleod <amacleod@cygnus.com>. - -2000-10-18 Hans-Peter Nilsson <hp@axis.com> - - * scripttempl/crisaout.sc (.text, .data): Pad, with ALIGN (32), - for consecutive sections. - -2000-10-17 Chandrakala Chavva <cchavva@redhat.com> - - * lexsup.c: New option OPTION_TARGET_HELP. Prints all target specific - options. - * ld.texinfo: Added notes about this new option. - -2000-10-16 Nick Clifton <nickc@redhat.com> - - * emultempl/pe.em (_after_open): Add tests of return values from - bfd functions. Emit appropriate error messages if necessary. - -2000-10-13 Nick Clifton <nickc@redhat.com> - - * emultempl/pe.em (_after_open): Delete 'is2' and 'nsyms' - local variables - they are not used, but leave in the call to - bfd_canonicalize_symtab. - (_open_dynamic_archive): Add #ifdef DLL_SUPPORT around use of - pe_dll_search_prefix. - -2000-10-12 Charles Wilson <cwilson@ece.gatech.edu> - - * emultempl/pe.em (pe_dll_search_prefix): New variable, - (longopts): New --dll-search-prefix option. - (gld_${EMULATION_NAME}_list_options): Document. - (gld_${EMULATION_NAME}_parse_args): Handle. - (gld_${EMULATION_NAME}_open_dynamic_archive): When linking - dynamically, search for a dll named '<prefix><basename>.dll' - in preference to 'lib<basename>.dll' if --dll-search-prefix - is specified. - -2000-10-12 Alan Modra <alan@linuxcare.com.au> - - * ldlang.c (section_already_linked): Set kept_section instead of - sec->comdat->sec. - -2000-10-10 Kazu Hirata <kazu@hxi.com> - - * deffile.h: Fix formatting. - * lexsup.c: Likewise. - * mri.c: Likewise. - -2000-10-09 Paul Sokolovsky <Paul.Sokolovsky@technologist.com> - - * pe-dll.c (make_one): Do not generate code thunk for DATA - exports. - (process_def_file): deduce DATA flag for auto-export sumbols. - -2000-10-09 Kazu Hirata <kazu@hxi.com> - - * ld.h: Fix formatting. - * ldcref.c: Likewise. - * ldctor.h: Likewise. - * ldemul.c: Likewise. - * ldemul.h: Likewise. - * ldexp.c: Likewise. - * ldexp.h: Likewise. - * ldfile.c: Likewise. - * ldfile.h: Likewise. - * ldlang.c: Likewise. - * ldlang.h: Likewise. - * ldmain.c: Likewise. - * pe-dll.c: Likewise. - - * pe-dll.c: Revert some formatting fixes. - -2000-10-08 Kazu Hirata <kazu@hxi.com> - - * pe-dll.c: Fix formatting. - -2000-10-05 Kazu Hirata <kazu@hxi.com> - - * ldlang.c: Fix formatting. - -2000-10-03 DJ Delorie <dj@redhat.com> - - * pe-dll.c (fill_edata): initialize entire block - (make_one): fill in correct section. - -2000-10-03 Kazu Hirata <kazu@hxi.com> - - * ldexp.c: Fix formatting. - -2000-10-02 DJ Delorie <dj@redhat.com> - - * emultempl/pe.em (gld_*_after_open): detect case where there two - import libraries for same dll; rename one to ensure proper link - order. - - * pe-dll.c (process_def_file): compare ordinals to -1, not 0; fix - typo - (generate_edata): fix typo - -2000-09-29 Hans-Peter Nilsson <hp@axis.com> - - * scripttempl/crisaout.sc (ENTRY): Now __start. - (.text): Add default setting for __start. - Remove CONSTRUCTORS handling. - (/DISCARD/): Add .gnu.warning.*. - * emulparams/crislinux.sh (ENTRY): Now __start. - (TEXT_START_SYMBOLS): New; provide __Stext and __start default. - * emulparams/criself.sh (OUTPUT_FORMAT): Now elf32-us-cris. - (ENTRY): Now __start. - (INITIAL_READONLY_SECTIONS): Add KEEP for .startup. - (EXECUTABLE_SYMBOLS): Add default setting for __start. - -2000-09-29 Kazu Hirata <kazu@hxi.com> - - * deffile.h: Fix formatting. - * ld.h: Likewise. - * ldcref.c: Likewise. - * ldctor.c: Likewise. - * ldctor.h: Likewise. - * ldemul.c: Likewise. - * ldemul.h: Likewise. - * ldexp.c: Likewise. - * ldexp.h: Likewise. - * ldfile.c: Likewise. - * ldfile.h: Likewise. - * ldlang.c: Likewise. - * ldlang.h: Likewise. - * lexsup.c: Likewise. - * mri.c: Likewise. - * pe-dll.c: Likewise. - -2000-09-28 Paul Sokolovsky <Paul.Sokolovsky@technologist.com> - - * pe-dll.c (process_def_file): Uninitialized data wasn't - exported with --export-all-symbols switch. - -2000-09-28 DJ Delorie <dj@redhat.com> - - * pe-dll.c (fill_edata): rearrange the data so that ordinals and - noname work properly. - -2000-09-28 Alan Modra <alan@linuxcare.com.au> - - * ld.texinfo (HPPA ELF32): New section. - - * emultempl/hppaelf.em (group_size): New. - (hppaelf_finish): Pass group_size to elf32_hppa_size_stubs. - (PARSE_AND_LIST_PROLOGUE): Add OPTION_STUBGROUP_SIZE. - (PARSE_AND_LIST_LONGOPTS): Add --stub-group-size. Duplicate - options to prevent abbreviations matching. - (PARSE_AND_LIST_OPTIONS): Describe the above. Reformat. - (PARSE_AND_LIST_ARGS_CASES): Handle it. - -2000-09-21 Michael Sokolov <msokolov@ivan.Harhan.ORG> - - * emultempl/m68kelf.em: Conditionalise the embedded relocs feature - on the m68*-*-elf target. Make it support COFF input objects. - -2000-09-21 Kazu Hirata <kazu@hxi.com> - - * ldmain.c: Fix formatting. - * ldmisc.c: Likewise. - * ldver.c: Likewise. - * ldwrite.c: Likewise. - -2000-09-21 Alan Modra <alan@linuxcare.com.au> - - * ldwrite.c (clone_section): Silence gcc warnings. - -2000-09-20 Alan Modra <alan@linuxcare.com.au> - - * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Handle - out of memory failure. - - * ldwrite.c (ldwrite): Remove unnecessary einfo arg. - (clone_section): Handle out of memory failures. Rename var to - avoid c++ reserved word. - -2000-09-18 Alan Modra <alan@linuxcare.com.au> - - * emultempl/hppaelf.em (hppaelf_add_stub_section): Rename - stub_name param to stub_sec_name. - (hppaelf_finish): Modify call to elf32_hppa_size_stubs. - -2000-09-10 Michael Sokolov <msokolov@ivan.Harhan.ORG> - - * emultempl/m68kelf.em: New file. - * emulparams/m68kelf.sh (EXTRA_EM_FILE): Use it. - * Makefile.am (em68kelf.c): Add dependency on m68kelf.em. - * Makefile.in: Regenerate. - -2000-09-15 Alan Modra <alan@linuxcare.com.au> - - * emulparams/hppalinux.sh (DATA_START_SYMBOLS): Provide $global$ - only as needed. - -2000-09-13 Nick Clifton <nickc@redhat.com> - - * ldmain.c (multiple_definition): Disable relaxation if - multiple symbol definitions are encountered - otherwise the - linker could abort with an assertion failure. - -2000-09-10 Nick Clifton <nickc@redhat.com> - - * mri.c: Fix formatting. - -2000-09-07 H.J. Lu <hjl@gnu.org> - - * configure.in (AC_ISC_POSIX): Put after AC_CANONICAL_SYSTEM. - * configure: Rebuild. - -2000-09-07 H.J. Lu <hjl@gnu.org> - - * Makefile.am (lexsup.o): Also depend on $(INCDIR)/demangle.h. - * Makefile.in: Rebuild. - -2000-09-07 Alan Modra <alan@linuxcare.com.au> - - * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Fix - broken list handling. Create __start_SECNAME and __stop_SECNAME - when no place-holder. Add some comments. Test both SEC_CODE and - SEC_READONLY for hold_text to prevent .rodata orphan poisoning. - Handle case where no output section statement created. - -2000-09-07 Niibe Yutaka <gniibe@m17n.org>, Kaz Kojima <kkojima@rr.iij4u.or.jp>, Alexandre Oliva <aoliva@redhat.com> - - * configure.tgt (sh-*-linux*): Added. - * Makefile.am: Added eshelf_linux and eshlelf_linux. - * Makefile.in: Rebuilt. - * emulparams/shelf_linux.sh: New file. - * emulparams/shlelf_linux.sh: New file. - -2000-09-06 Alan Modra <alan@linuxcare.com.au> - - * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't - try shuffling sections when the orphan happens to be the place - holder. Keep count of unique section names generated so we speed - the search for a new name. - -2000-09-06 Alexandre Oliva <aoliva@redhat.com> - - * configure: Rebuilt with new libtool.m4. - -2000-09-05 Nick Clifton <nickc@redhat.com> - - * Makefile.in: Regenerate. - * aclocal.m4: Regenerate. - * configure: Regenerate. - * config.in: Regenerate. - * po/ld.pot: Regenerate. - - * ldint.texinfo: Remove CVS revision marker - it foils local - comparisons. - - * emultempl/ticoff.em: Remove extraneous comma. - -2000-09-05 Alan Modra <alan@linuxcare.com.au> - - * emultempl/hppaelf.em (hppaelf_add_stub_section): Add SEC_RELOC - to stub section flags. - (hppa_for_each_input_file_wrapper): New. - (hppa_lang_for_each_input_file): New. - (lang_for_each_input_file): Define to call above. - (multi_subspace): New. - (hppaelf_finish): Pass multi_subspace to elf32_hppa_size_stubs. - (PARSE_AND_LIST_PROLOGUE): Define. - (PARSE_AND_LIST_LONGOPTS): Define. - (PARSE_AND_LIST_OPTIONS): Define. - (PARSE_AND_LIST_ARGS_CASES): Define. - (hppaelf_finish): Call elf32_hppa_set_gp. - (hppaelf_set_output_arch): Remove. - (LDEMUL_SET_OUTPUT_ARCH): Remove. - - * emulparams/hppalinux.sh (ELFSIZE): Define. - (MACHINE): Define. - (OTHER_READONLY_SECTIONS): Define. - (DATA_PLT): Define. - (GENERATE_SHLIB_SCRIPT): Define. - - * ldlang.c: Add missing prototypes, and tidy others. Change CONST - to const throughout. Change `void *' to `PTR' throughout. - (lang_memory_default): Function is local to file, add `static'. - - * Makefile.am (ehppaelf.c): Depend on emultempl/elf32.em. - (ehppalinux.c): Likewise. - (earmelf.c): Likewise. - (earmelf_linux.c): Likewise. - (earmelf_linux26.c): Likewise. - * Makefile.in: Regenerate. - - * ld.h (ld_config_type): Add unique_orphan_sections. - * lexsup.c (OPTION_UNIQUE): Define. - (ld_options): Add "--unique". - (parse_args): Handle it. - * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't - search for an existing output section if unique_orphan_sections is - set. Make use of bfd_get_unique_section_name rather than - duplicating code here. - * ld.texinfo: Describe --unique. - - * lexsup.c (ld_options): Make split-by-reloc arg optional. Add - optional arg to split-by-file. + * emultempl/sh64elf.em: Likewise. + + 2004-03-25 Alan Modra <amodra@bigpond.net.au> + * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Update + size_dynamic_sections call. + + 2004-03-20 H.J. Lu <hongjiu.lu@intel.com> + * lexsup.c (parse_args): Don't set unresolved_syms_in_objects + or unresolved_syms_in_shared_libs for -Bdynamic and -Bstatic. + + 2004-03-18 Alan Modra <amodra@bigpond.net.au> + * ld.texinfo: Add --as-needed doco. + * ldmain.c (as_needed): New global var. + * ldmain.h (as_needed): Declare. + * lexsup.c (option_values): Add OPTION_AS_NEEDED and + OPTION_NO_AS_NEEDED. + (ld_options): Likewise. (parse_args): Handle them. - * ld.texinfo: Update description of these options. - * ldwrite.c (clone_section): Pass in the section name. Replace - local code with bfd_get_unique_section_name. - (split_sections): Tidy code and comments. Use a list traversal - more appropriate to the list construction. Handle cooked section - sizes. Split when split_by_reloc reached rather than exceeded. - Track section size and split when split_by_file reached. Fix - link_order_tail (even though it's not used). - (ldwrite): Modify condition for calling split_sections to suit - changed split_by_reloc and split_by_file. - * ldmain.c (main): Init config.split_by_reloc and - config.split_by_file to -1. - * ld.h (ld_config_type): Change split_by_reloc to unsigned. - Change split_by_file to bfd_size_type. - -2000-09-02 Nick Clifton <nickc@redhat.com> - - * configure.in: Increase version number to 2.10.91. - * NEWS: Mention new ability to support removal of duplicate DWARF2 - debug information. - * configure: Regenerate. - * aclocal.m4: Regenerate. - * config.in: Regenerate. - -2000-09-02 Daniel Berlin <dberlin@redhat.com> - - * scripttempl/elf.sc: Add .gnu.linkonce.wi.* to .debug_info - sections. - * scripttempl/elf32avr.sc: Ditto. - * scripttempl/elfd10v.sc: Ditto. - * scripttempl/elfd30v.sc: Ditto. - * scripttempl/elfi370.sc: Ditto. - * scripttempl/elfm68hc11.sc: Ditto. - * scripttempl/elfm68hc12.sc: Ditto. - * scripttempl/elfi386beos.sc: Ditto. - * scripttempl/v850.sc: Ditto. - -2000-08-31 Alexandre Oliva <aoliva@redhat.com> - - * acinclude.m4: Include libtool and gettext macros from the - top level. - * aclocal.m4, configure: Rebuilt. - -2000-08-25 Nick Clifton <nickc@redhat.com> - - * ldlang.c (open_output): When choosing the target for a - particular endianness, do nothing if the target is not - supported. - -2000-08-25 H.J. Lu <hjl@gnu.org> - - * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Don't - check -rpath nor LD_RUN_PATH for cross link. - * ld.texinfo: Document the change. - -2000-08-24 Hans-Peter Nilsson <hp@axis.com> - - * NEWS: Mention support for CRIS. - -2000-08-23 H.J. Lu <hjl@gnu.org> - - * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Get - the current runpath list from bfd_elf_get_runpath_list () - before search. - -2000-08-22 H.J. Lu <hjl@gnu.org> + * ldlang.h (lang_input_statement_type): Add as_needed field. + * ldlang.c (new_afile): Set p->as_needed. + * emultempl/elf32.em (gld${EMULATION_NAME}_load_symbols): New function. + (gld${EMULATION_NAME}_try_needed): Use bfd_elf_set_dyn_lib_class. + (ld_${EMULATION_NAME}_emulation): Set LDEMUL_RECOGNIZED_FILE entry. + * ldlang.c (open_input_bfds): Remove useless cast. + (lang_do_assignments_1): Likewise. + (lang_for_each_input_section): Delete. - * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Search - the DT_RPATH/DT_RUNPATH entries for DT_NEEDED after - LD_LIBRARY_PATH for native linker. Display the needed DSO if - trace_file_tries is non-zero. - (gld${EMULATION_NAME}_try_needed): Report the needed DSO found - if trace_file_tries is non-zero. +2004-03-23 Alan Modra <amodra@bigpond.net.au> - * ld.texinfo: Document the usage of DT_RPATH/DT_RUNPATH. - * NEWS: Mention it. + PR 51. + * emultempl/ppc64elf.em (ppc_create_output_section_statements): Set + link_info.wrap_char. -2000-08-14 Jason Eckhardt <jle@cygnus.com> +2004-03-17 Ralf Corsepius <corsepiu@faw.uni-ulm.de> - * NEWS: Mention i860 support. + * configure.tgt: Switch sh-*-rtems* to ELF. Add sh-*-rtemscoff*. -2000-08-14 Andreas Schwab <schwab@suse.de> +2004-03-05 Nathan Sidwell <nathan@codesourcery.com> - * scripttempl/elf.sc: Fix last change to use correct comment - syntax. + * ldlang.c (lang_add_section): Don't force SEC_LOAD on + SEC_THREAD_LOCAL. + (IGNORE_SECTION): Ignore .tbss sections too. + (lang_size_sections_1): .tbss sections do not advance dot. -2000-08-10 Geoff Keating <geoffk@cygnus.com> +2004-02-23 Nathan Sidwell <nathan@codesourcery.com> - * scripttempl/elf.sc: Add a comment giving the correspondence - between sections, per-datum sections, and linkonce sections. Make - the comment true even for .bss, .sdata, .sdata2, .sbss, and - .sbss2. + * ldlang.h (struct lang_output_section_state): Change processed + field's type. + * ldexp.c (check, invalid): Remove. + (fold_name): Move valid_p assignments. Create undefined symbol + when needed. Directly exampine section's processd flag. + * ldlang.c (lang_output_section_statement_lookup): Adjust + processed field init. + (lang_size_sections_1): Allow LOADADDR when determining section's + VMA. Adjust error message. Fold data statement's expr. + (lang_size_sections): Correctly increment lang_statement_iteration. -2000-08-10 Jason Eckhardt <jle@cygnus.com> +2004-02-23 Alan Modra <amodra@bigpond.net.au> - * emulparams/elf32_i860.sh: New file. - * configure.tgt: Recognize new target i860-stardent-{sysv4*|elf*}. - * Makefile.am (ALL_EMULATIONS): Add eelf32_i860.o. - (eelf32_i860.c): New rule. - * Makefile.in: Regenerate. - -2000-08-10 Nick Clifton <nickc@cygnus.com> - - * emulparams/mipspe.sh (ENTRY): Add definition. - -2000-08-08 Peter Jeremy <peter.jeremy@alcatel.com.au> - - * emultempl/elf32.em (_after_close): Refer to -rpath not --rpath - in error message. - -2000-08-08 Stephane Carrez <Stephane.Carrez@worldnet.fr> - - * scripttempl/elfm68hc11.sc: Define __bss_size symbol to indicate - the final size of .bss section. - * scripttempl/elfm68hc12.sc: Likewise. - -2000-08-04 Alan Modra <alan@linuxcare.com.au> - - * emultempl/elf32.em (gld_${EMULATION_NAME}_parse_args): Rename to - gld${EMULATION_NAME}_parse_args for consistency. Combine - lastoptind and prevoptind vars, and keep track of last optind. - (gld_${EMULATION_NAME}_list_options): Rename to - gld${EMULATION_NAME}_list_options. - -2000-08-03 Rodney Brown <RodneyBrown@pmsc.com> - - * configure.tgt: Select targ_emul=elf_i386 for Unixware 7 - (i586-sco-sysv5uw7.1.0). - -2000-07-27 H.J. Lu <hjl@gnu.org> - - * emulparams/elf64alpha.sh (PARSE_AND_LIST_ARGS): Removed. - (PARSE_AND_LIST_PROLOGUE): New. - (PARSE_AND_LIST_LONGOPTS): Likewise. - (PARSE_AND_LIST_OPTIONS): Likewise. - (PARSE_AND_LIST_ARGS_CASES): Likewise. - (PARSE_AND_LIST_EPILOGUE): Likewise. - -2000-07-28 Alan Modra <alan@linuxcare.com.au> - - * emultempl/armelf.em: Elide functions common to elf32.em, - ie. most of the file. - (arm_elf_after_open): New. Do arm specific things then call - gld${EMULATION_NAME}_after_open. - (arm_elf_before_allocation): New. Call - gld${EMULATION_NAME}_before_allocation then do arm specifics. - (PARSE_AND_LIST_PROLOGUE): Define. - (PARSE_AND_LIST_SHORTOPTS): Define. - (PARSE_AND_LIST_LONGOPTS): Define. - (PARSE_AND_LIST_OPTIONS): Define. - (PARSE_AND_LIST_ARGS_CASES): Define. - (LDEMUL_AFTER_OPEN): Define. - (LDEMUL_BEFORE_ALLOCATION): Define. - (LDEMUL_BEFORE_PARSE): Define. - (LDEMUL_FINISH): Define. - - * emultempl/hppaelf.em: Similarly zap most of this file. - (hppaelf_add_stub_section): Prototype. - (hppaelf_layaout_sections_again): Prototype. - (hook_in_stub): Prototype. - (LDEMUL_SET_OUTPUT_ARCH): Define. - (LDEMUL_FINISH): Define. - (LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Define. - - * emulparams/armelf.sh (TEMPLATE_NAME): Use elf32. - (EXTRA_EM_FILE): New. - * emulparams/armelf_linux.sh: Likewise. - * emulparams/armelf_linux26.sh: Likewise. - * emulparams/hppalinux.sh: Likewise. - * emulparams/hppaelf.sh: Likewise. - (NOP): Define. - - * emultempl/elf32.em: Fix formatting. - (EXTRA_EM_FILE): Source it. - (LDEMUL_BEFORE_PARSE, LDEMUL_SYSLIB, LDEMUL_HLL, - LDEMUL_AFTER_PARSE, LDEMUL_AFTER_OPEN, LDEMUL_AFTER_ALLOCATION, - LDEMUL_SET_OUTPUT_ARCH, LDEMUL_CHOOSE_TARGET, - LDEMUL_BEFORE_ALLOCATION, LDEMUL_GET_SCRIPT, LDEMUL_FINISH, - LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS, - LDEMUL_OPEN_DYNAMIC_ARCHIVE, LDEMUL_PLACE_ORPHAN, - LDEMUL_SET_SYMBOLS, LDEMUL_PARSE_ARGS, LDEMUL_UNRECOGNIZED_FILE, - LDEMUL_LIST_OPTIONS, LDEMUL_RECOGNIZED_FILE, - LDEMUL_FIND_POTENTIAL_LIBRARIES): New shell vars. Add code to - allow functions in this file to be overridden. - (PARSE_AND_LIST_SHORTOPTS): Handle it. - - * emultempl/m68kcoff.em: Include ldfile.h before ldemul.h. - - * emultempl/elf32.em: Reorganize file. - -2000-07-27 Ivan Kokshaysky <ink@jurassic.park.msu.ru> - - * emulparams/elf64alpha.sh: Implement "-taso" emulation - specific option to fit 64-bit executable in the lower - 31-bit address range. This is done by changing start - address of .interp (the very first section of executable) - and then setting EF_ALPHA_32BIT elf header flag. - -2000-07-21 Michael Sokolov <msokolov@ivan.Harhan.ORG> - - * emultempl/m68kcoff.em: New file. - * emulparams/m68kcoff.sh (TEMPLATE_NAME): Use m68kcoff template. - * Makefile.am (em68kcoff.c): Depend on m68kcoff.em rather than - generic.em. - * Makefile.in: Regenerate. - -2000-07-20 H.J. Lu <hjl@gnu.org> + * ldexp.c (fold_tree): Follow indirect symbols. - * emultempl/elf32.em (longopts): Duplicate "disable-new-dtags" - and "disable-new-dtags" to stop getopt from treating -d/-e as - abbreviations for these options. +2004-02-20 Nathan Sidwell <nathan@codesourcery.com> -2000-07-20 H.J. Lu <hjl@gnu.org> + * ldgram.y (exp): Add two operand ALIGN. + * ldexp.c (fold_binary): Add ALIGN_K case. + * ld.texinfo (ALIGN): Document two operand version. - * ld.texinfo: Add documentation for --disable-new-dtags and - --enable-new-dtags. +2004-02-19 Nathan Sidwell <nathan@codesourcery.com> - * ldmain.c (main): Initialize link_info.new_dtags to false. + * ldlang.c (map_input_to_output_sections): Initialize sections + mentioned in a data statement expression. + (lang_do_assignments_1): Add data statement's expression's + section's vma. - * emultempl/elf32.em (gld_${EMULATION_NAME}_parse_args): Add - --disable-new-dtags and --enable-new-dtags. - (gld_${EMULATION_NAME}_list_options): Likewise. +2004-02-18 Nathan Sidwell <nathan@codesourcery.com> -2000-07-05 Kenneth Block <krblock@computer.org> + * ldgram.y (statement_anywhere): Add assert rule. + * ldlang.c (exp_init_os): Add assert case. - * lexsup.c: Add optional style to demangle switch - * ld.texinfo: Document optional style to demangle switch. +2004-02-14 Andrew Cagney <cagney@redhat.com> -2000-07-20 Hans-Peter Nilsson <hp@axis.com> + * ldmain.c (remove_output): Call bfd_cache_close. - * Makefile.am (ALL_EMULATIONS): Add ecrisaout.o, ecriself.o, - ecrislinux.o. - (ecrisaout.c, ecriself.c, ecrislinux.c): New rules. - Regenerate dependencies. - * Makefile.in: Rebuild. - * configure.tgt (cris-*-*): New target. - * emulparams/crisaout.sh, emulparams/criself.sh, - emulparams/crislinux.sh, scripttempl/crisaout.sc: New files. - * po/POTFILES.in, po/ld.pot: Regenerate. +2004-02-14 Richard Sandiford <rsandifo@redhat.com> -2000-07-20 H.J. Lu <hjl@gnu.org> + * emulparams/elf32bmipn32-defs.sh (OTHER_SECTIONS): Discard + .MIPS.content* and .MIPS.events* sections. - * emultempl/elf32.em (gld_${EMULATION_NAME}_list_options): - Print out ignored -z options. +2004-02-09 Daniel Jacobowitz <drow@mvista.com> -2000-07-19 H.J. Lu <hjl@gnu.org> + * emulparams/armelf.sh, emulparams/armelf_linux.sh: Move + .note.gnu.arm.ident to after allocated sections. Mark its + address as 0. - * emulparams/elf32mcore.sh (PARSE_AND_LIST_ARGS): Removed. - (PARSE_AND_LIST_PROLOGUE): New. - (PARSE_AND_LIST_LONGOPTS): Likewise. - (PARSE_AND_LIST_OPTIONS): Likewise. - (PARSE_AND_LIST_ARGS_CASES): Likewise. +2004-02-09 Daniel Jacobowitz <drow@mvista.com> - * ldmain.c (main): Clear link_info.flags and link_info.flags_1. + * emulparams/armelf_linux.sh (COMMONPAGESIZE): Set to 4KB. + * emulparams/elf32bmip.sh (COMMONPAGESIZE): Likewise. + * emulparams/elf32bmipn32.sh (COMMONPAGESIZE): Likewise. + * emulparams/elf32btsmipn32.sh (COMMONPAGESIZE): Likewise. + * emulparams/shlelf_linux.sh (COMMONPAGESIZE): Likewise. - * lexsup.c (ld_options): Comment out 'z'. - (parse_args): Likewise. +2004-02-05 Nick Clifton <nickc@redhat.com> - * emultempl/elf32.em: Include "elf/common.h". - (gld_${EMULATION_NAME}_parse_args): Defined. Handle some -z - options. - (gld_${EMULATION_NAME}_list_options): Likewise. + * emultempl/pe.em (_after_open): Fix typo in previous delta. - * ld.texinfo: Add documentation for the recognized -z options. +2004-02-04 Danny Smith <dannysmith@users.sourceforge.net> -2000-07-19 H.J. Lu <hjl@gnu.org> + * emultempl/pe.em (_after_open): Fix thinko in 2003-12-18 patch. - * emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Call - bfd_elf_set_dt_needed_soname (). +2004-01-28 Alan Modra <amodra@bigpond.net.au> -2000-07-18 DJ Delorie <dj@cygnus.com> + * genscripts.sh: Fix typo. - * pe-dll.c (pe_dll_id_target): check object target name also + * genscripts.sh: Apply $LIBPATH_SUFFIX to $tool_lib and $libdir too. -2000-07-18 Hans-Peter Nilsson <hp@axis.com> +2004-01-24 Jakub Jelinek <jakub@redhat.com> - * scripttempl/elf.sc (.init): Only do ${INIT_START} and - ${INIT_END} if relocating. - (.fini): Likewise ${FINI_START} and ${FINI_END}. - -2000-07-16 Charles Wilson <cwilson@ece.gatech.edu> - - * emultempl/pe.em (gld_*_open_dynamic_archive): New search - order for dynamic library '-lfoo' on pei386: libfoo.dll.a, - foo.dll.a, libfoo.a, libfoo.dll, foo.dll. This fixes compatibility - errors introduced by the old dynamic lib search order. - -2000-07-17 DJ Delorie <dj@cygnus.com> - - * pe-dll.c (process_def_file): auto-export data items also - (pe_process_import_defs): also see if _imp_ form needed - -2000-07-12 Charles Wilson <cwilson@ece.gatech.edu> - - * pe-dll.c (make_one): fix a typo in the __imp_ name decoration - for dll import libraries - -2000-07-12 Mark Elbrecht <snowball3@bigfoot.com> - - * scripttempl/i386go32.sc: Support the g++ attribute init_priority in - gcc 2.95.2 and later. - -2000-07-11 Kazu Hirata <kazu@hxi.com> - - * ldfile.c (ldfile_try_open_bfd): Output '\n' after an error - message. - -2000-07-10 Alan Modra <alan@linuxcare.com.au> - - * ldemul.h (struct lang_input_statement_struct): Remove forward - declaration. - (struct search_dirs): Likewise. - * ldfile.h (struct lang_input_statement_struct): Likewise. - Protect file from multiple inclusion. - * ldlang.h (LANG_FOR_EACH_INPUT_STATEMENT): Move file_chain - declaration from macro to file scope. - - * ldemul.c: ldexp.h,ldlang.h,ldfile.h,ldemul.h go in this order. - * ldgram.y: Likewise here. - * ldlang.c: And here. - * ldmain.c: And here. - * mpw-elfmips.c: And here. - * mpw-eppcmac.c: And here. - * emultempl/aix.em: And here. - * emultempl/armcoff.em: And here. - * emultempl/armelf.em: And here. - * emultempl/armelf_oabi.em: And here. - * emultempl/beos.em: And here. - * emultempl/elf32.em: And here. - * emultempl/hppaelf.em: And here. - * emultempl/linux.em: And here. - * emultempl/lnk960.em: And here. - * emultempl/pe.em: And here. - * emultempl/sunos.em: And here. - * mpw-esh.c: And here. Include ldexp.h and ldlang.h too. - * mpw-idtmips.c: Ditto. - * emultempl/generic.em: Ditto. - * emultempl/gld960.em: Ditto. - * emultempl/gld960c.em: Ditto. - * emultempl/mipsecoff.em: Ditto. - * emultempl/ticoff.em: Ditto. - * emultempl/vanilla.em: Ditto. - - * pe-dll.c: Include ldfile.h - * ldver.c: Include ldexp.h, ldlang.h, ldfile.h - - * mpw-elfmips.c: (gldelf32ebmip_before_allocation): Add missing - arguments to bfd_elf32_size_dynamic_sections call. - (gldelf32ebmip_place_orphan): Add missing arguments to - lang_leave_output_section_statement call. - -2000-07-10 H.J. Lu <hjl@gnu.org> - - * emultempl/pe.em (pe_enable_stdcall_fixup): Protect with - DLL_SUPPORT. - (strhash): Likewise. - (compute_dll_image_base): Likewise. - (pe_undef_found_sym): Likewise. - (pe_undef_cdecl_match): Likewise. - (gld_${EMULATION_NAME}_open_dynamic_archive): Mark the - argument "arch" with ATTRIBUTE_UNUSED. - -2000-07-10 Alan Modra <alan@linuxcare.com.au> - - * configure.tgt: Remove extraneous hppa*-*-linux-gnu*. - - From Ryan Bradetich <rbradetich@uswest.net> - * ldwrite.c (SSIZE): Remove to cure macro redefinition warning. - -2000-07-09 Alan Modra <alan@linuxcare.com.au> - - Changes to create multiple linker stubs, positioned immediately - before the section where they are required. - * emultempl/hppaelf.em: Include elf32-hppa.h. - (stub_sec, file_chain): Delete. - (hppaelf_create_output_section_statements): Don't make a stub - section here. - (hook_stub_info): New struct. - (hook_in_stub): New function. - (hppaelf_add_stub_section): New function. - (hppaelf_finish): Do nothing for relocateable links. Modify the - call to elf32_hppa_size_stubs. Move code for updating section - layout from here... - (hppaelf_layaout_sections_again): ..to here, a new function. - - * emultempl/hppaelf.em (hppaelf_delete_padding_statements): Fix - broken list handling. Pass in a pointer to the list. - (hppaelf_finish): Update call to hppaelf_delete_padding_statements - for above changes. - (hppaelf_before_parse): Prototype. - (hppaelf_set_output_arch): Prototype. - (hppaelf_create_output_section_statements): Prototype. - (hppaelf_delete_padding_statements): Prototype. - (hppaelf_finish): Prototype. - - Merge from elf32.em - * emultempl/hppaelf.em: Include ctype.h. - (struct orphan_save): New. - (gld${EMULATION_NAME}_place_orphan): New. - (output_rel_find): New. - (hppaelf_get_script): Update from elf32.em. - (ld_hppaelf_emulation): Rename to ld_${EMULATION_NAME}_emulation. - Change emulation_name field to "${EMULATION_NAME}". Add - gld${EMULATION_NAME}_place_orphan. - - * Makefile.am (ALL_EMULATIONS): Reinstate ehppaelf.o, add - ehppalinux.o, sort it. Regenerate dependencies. - (ehppalinux.c): Depend on hppaelf.em - * Makefile.in: Regenerate. + * emulparams/elf64_ia64.sh: Put .rela.opd into + OTHER_GOT_RELOC_SECTIONS instead of OTHER_PLT_RELOC_SECTIONS. - * configure.tgt: targ_emul=hppalinux for hppa*linux +2004-01-20 Danny Smith <dannysmith@users.sourceforge.net> - * emulparams/hppalinux.sh: New. - * emulparams/hppaelf.sh (TARGET_PAGE_SIZE): Write in hex. + * pe-dll.c (pe_create_import_fixup): Clear WP_TEXT flag. + * ld.texinfo (--omagic): Note that writable text section + does not conform to published PE-COFF specs. + (--enable-auto-import): Likewise. -2000-07-08 Alan Modra <alan@linuxcare.com.au> +2004-01-15 Alan Modra <amodra@bigpond.net.au> - * lexsup.c (parse_args): Copy section name. + * emulparams/elf32ppc.sh (COMMONPAGESIZE): Define. -2000-07-07 Charles Wilson <cwilson@ece.gatech.edu> +2004-01-13 Nick Clifton <nickc@redhat.com> - * emultempl/pe.em: institute the following search order for - dynamic libraries on pei386: libfoo.dll.a, foo.dll.a (import - libs), libfoo.dll, foo.dll (link direct to dll). Fall back to - static lib (libfoo.a) if none of the above are found. - -2000-07-07 Mumit Khan <khan@xraylith.wisc.edu> - - * emultempl/pe.em (pe_enable_auto_image_base): New variable. - (longopts): New --{enable,disable}-auto-image-base options. - (gld_${EMULATION_NAME}_list_options): Document. - (gld_${EMULATION_NAME}_parse): Handle. - (strhash): New static function. - (compute_dll_image_base): New static function. - (gld_${EMULATION_NAME}_set_symbols): Use. - -2000-07-05 DJ Delorie <dj@redhat.com> - - * MAINTAINERS: new - -2000-07-01 Koundinya K <kk@ddeorg.soft.net> - - * configure.tgt: Add traditional mips (mips*-*-sysv4*) target. - * emulparams/elf32btsmip.sh: New file. - * Makefile.am: Add traditional mips target. - * Makefile.in: Rebuild. - -2000-07-01 H.J. Lu <hjl@gnu.org> - - * Makefile.am (EXTRA_ld_new_SOURCES): Set to deffilep.y for - automake to use YLWRAP. - * Makefile.in: Rebuild. - -2000-07-01 Alan Modra <alan@linuxcare.com.au> - - * Makefile.am (DEP): Fix 2000-06-22. grep after running dep.sed - (CLEANFILES): Add DEPA. - * Makefile.in: Regenerate. - -2000-06-30 Timothy Wall <twall@ppc> - - * scripttempl/tic54xcoff.sc: PAGE N is not implemented, so encode - the page in the upper octet of the address. - -2000-06-26 Marek Michalkiewicz <marekm@linux.org.pl> - - * emulparams/avrmega161.sh (ARCH): Change to avr:5. - -2000-06-24 Alan Modra <alan@linuxcare.com.au> - - * NEWS: arm-elf does --gc-sections too. - -2000-06-22 Alan Modra <alan@linuxcare.com.au> - - * Makefile.am (DEP): grep for leading `/' in DEP1, and fail if we - find one. - * Makefile.in: Regenerate. - -2000-06-21 H.J. Lu <hjl@gnu.org> - - * Makefile.am: Rebuild dependency. - * Makefile.in: Rebuild. - -2000-06-20 H.J. Lu <hjl@gnu.org> - - * Makefile.am: Rebuild dependency. - * Makefile.in: Rebuild. - -2000-06-20 Timothy Wall <twall@cygnus.com> - - * scripttempl/tic54xcoff.sc: New. - * ldlang.c (wild_doit): Propagate SEC_BLOCK flag. - * gen-doc.texi: Add flag for TI COFF. - * ld.texinfo: Add documentation for TI COFF handling switches. - * emultempl/ticoff.em: New. TI COFF handling. - * configure.tgt: Add tic54x target. - * Makefile.am: Add tic54x target. - * Makefile.in: Ditto. - -2000-06-20 Alan Modra <alan@linuxcare.com.au> - - * ldmain.c (set_scripts_dir): Correct pointer comparison when - checking for backslashes. - -2000-06-19 Alan Modra <alan@linuxcare.com.au> - - * NEWS: Move entries not in 2.10 above "Changes in version 2.10". - -2000-06-18 Alan Modra <alan@linuxcare.com.au> - - * NEWS: Update list of targets supporting --gc-sections. - - * scripttempl/elf.sc: KEEP .eh_frame contents. - * scripttempl/elfd30v.sc: Same here. - -2000-06-18 Stephane Carrez <stcarrez@worldnet.fr> - - * Makefile.am (ALL_EMULATIONS): Added new emulation for m68hc12 - and m68hc11 (elf). - * Makefile.in: Rebuild. - * configure.tgt: Recognize m68hc12 and m68hc11. - * scripttempl/elfm68hc12.sc: New file. - * emulparams/m68hc12elfb: New emulation. - * emulparams/m68hc12elf: New emulation. - * emulparams/m68hc11elfb.sh: New file. User configurable emulation - (includes a memory.x script to define the ROM and RAM banks). - * scripttempl/elfm68hc11.sc, emulparams/m68hc11elf.sh: - New configuration files for support of Motorola 68hc11 - -2000-06-15 Alan Modra <alan@linuxcare.com.au> - - * ldmain.c (main): Only change SEC_READONLY for final link. - -2000-06-13 H.J. Lu <hjl@gnu.org> - - * configure: Regenerate. - -2000-06-08 David O'Brien <obrien@FreeBSD.org> - - * configure.in (VERSION): Update to show this is the CVS mainline. - -2000-06-07 Michael Sokolov <msokolov@ivan.Harhan.ORG> - - * emultempl/mipsecoff.em (gld{EMULATION_NAME}_after_open): Require all - input objects to be ECOFF. - (check_sections): einfo takes %B, not %P, to print a BFD name. - -2000-06-05 Michael Matz <matz@ifh.de> - - * ldgram.y (vers_defns): Handle 'extern "C++" { ... }' in - version scripts. - - * ldlex.l (V_IDENTIFIER): Accept `::' in symbols. - -2000-05-23 Marek Michalkiewicz <marekm@linux.org.pl> - - * emulparams/avr1200.sh (STACK): Define as 0. - * emulparams/avr23xx.sh (STACK): Define as last internal SRAM address. - * emulparams/avr4433.sh (STACK): Likewise. - * emulparams/avr44x4.sh (STACK): Likewise. - * emulparams/avr85xx.sh (STACK): Likewise. - * emulparams/avrmega103.sh (STACK): Likewise. - * emulparams/avrmega161.sh (STACK): Likewise. - * emulparams/avrmega603.sh (STACK): Likewise. - * scripttempl/elf32avr.sc (__data_start): Define for gcrt1. - (__stack): Define from ${STACK} for main(). - -2000-05-26 Alan Modra <alan@linuxcare.com.au> - - * Makefile.am: Update dependencies with "make dep-am" - * Makefile.in: Regenerate. - -2000-05-26 Eli Zaretskii <eliz@is.elta.co.il> - - * ldmain.c: Include filenames.h. - (set_scripts_dir): Support backslashes in program name. - -2000-05-22 Igor Shevlyakov <igor@windriver.com> - - * ldmain.c (main): When deciding if ".text" section should be - read-only, don't forget to reset SEC_READONLY because it - could be already set. - -2000-05-22 Thomas de Lellis <tdel@windriver.com> - - * ld.1: Add documentation for new command line option: - --section-start <sectionname>=<sectionorg> - This is a generic version of -Ttext etc. which accepts - any section name as a parameter instead of just text/data/ - bss. - * ld.texinfo: More docs. - * NEWS: More docs. - * lexsup.c: (parse_args): Recognize new command line option. - (ld_options): Add new option. - -2000-05-18 H.J. Lu <hjl@gnu.org> - - * lexsup.c (parse_args): `i' == `r', not `q'. - -2000-05-18 Jeffrey A Law (law@cygnus.com) - - * configure.tgt (hppa*64*-*-*): Enable PA64 target. - -2000-05-17 S. Bharadwaj Yadavalli <sby@scrugs.lkg.dec.com> - Rick Gorton <gorton@scrugs.lkg.dec.com> - - Add support for '-q' == '--emit-relocs' switch. - * ldmain.c (main): Default to false. - * lexsup.c (parse_args): Turn on emitrelocations flag if set. - * NEWS: Describe the emitrelocations switch. - * ld.texinfo: Describe the emitrelocations switch. - -2000-05-16 Charles Wilson <cwilson@ece.gatech.edu> - - * emultempl/pe.em (_open_dynamic_archive): New function: Search - the library path for "foo.dll" and "libfoo.dll" dynamic libraries - before searching for 'libfoo.a' in response to a '-Bdynamic -lfoo' - link options. - -2000-05-15 David O'Brien <obrien@FreeBSD.org> - - * lexsup.c (parse_args): Update the year in the copyright notice. - -2000-05-13 Alan Modra <alan@linuxcare.com.au> - - * ld.h (gettext, dgettext, dcgettext, textdomain, bindtextdomain): - Replace defines with those from intl/libgettext.h to quieten gcc - warnings. - -2000-05-10 H.J. Lu <hjl@gnu.org> - - * ldlang.c (open_input_bfds): Don't load the same file within - a group again if the whole archive has been loaded already. - -2000-05-03 Alan Modra <alan@linuxcare.com.au> - - From Ulf Carlsson <ulfc@engr.sgi.com> and Andreas Jaeger <aj@suse.de> - * lexsup.c (set_section_start): Use bfd_scan_vma rather than - strtoul. - -2000-05-01 Jim Wilson <wilson@cygnus.com> - - * configure.host (ia64-*-linux-gnu*): Change gcc to ${CC}. - - * configure.host: Added HOSTING_CRT0, HOSTING_LIBS for - host "ia64-*-linux-gnu*". - -2000-04-29 Andreas Jaeger <aj@suse.de> - - * ld.h: Correctly check GCC version. - -2000-04-25 Jeffrey A Law (law@cygnus.com) - - * Makefile.am: Add PA64 support. Add missing dependencies for - PA32 elf support. + * ldlang.c (lang_get_regions): Add extra parameter 'have_vma' + which if true will prevent the LMA region being used as a + replacement for a default VMA region. + (lang_leave_output_section_statement): Pass extra parameter. + (lang_leave_overlay): Likewise. + * ld.texinfo (Output Section LMA): Document that the LMA + region can be set to the VMA region if no VMA has been set. + * ldlang.h (struct lang_output_section_phdr_list): Create a + typedef for this type. Minor formatting fixes. + +2004-01-13 Nick Clifton <nickc@redhat.com> + + * ldlang.c (lang_size_sections_1): If dot is advanced, then + assume that the section should be allocated. + +2004-01-13 Alan Modra <amodra@bigpond.net.au> + + * ldlang.c (IGNORE_SECTION): Don't ignore SEC_ALLOC && !SEC_LOAD + sections. Do ignore SEC_NEVER_LOAD sections. + (lang_size_sections_1): Remove test made redundant with the above. + +2004-01-09 Alan Modra <amodra@bigpond.net.au> + + * emultempl/ppc64elf.em (ppc_before_allocation): Clear cached + program_header_size. + +2004-01-06 Alexandre Oliva <aoliva@redhat.com> + + 2003-11-28 Alexandre Oliva <aoliva@redhat.com> + * emulparams/elf32frvfd.sh (EMBEDDED): Clear. + 2003-11-05 Alexandre Oliva <aoliva@redhat.com> + * emulparams/elf32frvfd.sh (STACK_ADDR): Unset. + (MAXPAGESIZE): Set to 64Kb. + (OTHER_READONLY_SECTIONS): Define __ROFIXUP_LIST__ and + __ROFIXUP_END__. Don't map .rofixup.got any more. + * emulparams/elf32frv.sh (NOP): Set. + 2003-10-31 Alexandre Oliva <aoliva@redhat.com> + * configure.tgt: Add frv-*-*linux*. + 2003-09-30 Alexandre Oliva <aoliva@redhat.com> + * Makefile.am (ALL_EMULATIONS): Added eelf32frvfd.o. + (eelf32frvfd.c): New. + * configure.tgt <frv-*-*>: Added it to targ_extra_emuls. + * emulparams/elf32frv.sh: Reverted previous two patches. + * emulparams/elf32frvfd.sh: New. * Makefile.in: Rebuilt. - * configure.tgt: Add PA64 support (currently disabled). - -2000-04-25 Alan Modra <alan@linuxcare.com.au> - - * emultempl/elf32.em (gld${EMULATION_NAME}_place_section): Delete. - (output_rel_find): New function. - (hold_section, hold_use): Delete. - (hold_text, hold_rodata, hold_data, hold_bss, hold_rel, - hold_interp): Make local to place_orphan. - (gld${EMULATION_NAME}_place_orphan): Use lang_output_section_find - rather than place_section to find possible previous use of orphan. - Similarly find the place-holder output sections. Use returned - value from lang_enter_output_section_statement rather than calling - lang_output_section_statement_lookup. - * emultempl/armelf.em: Same here. - * emultempl/pe.em: Similar to above, but no need for output_rel_find. - - * ldlang.c (lang_enter_output_section_statement): Return output - section statement. - * ldlang.h (lang_enter_output_section_statement): Change - declaration too. - - * ldlang.h (lang_output_section_statement): Export it. - * ldlang.c (lang_output_section_statement): Ditto. - -2000-04-24 Nick Clifton <nickc@cygnus.com> - - * ld.texinfo (Output Section Data): Add note that section data - commands cannot appear outside of section directives. - -2000-04-2 Matthew Green <mrg@cygnus.com> - - * configure.tgt: Add NetBSD/sparc ELF, and NetBSD/sparc64 support. - -2000-04-21 Richard Henderson <rth@cygnus.com> - David Mosberger <davidm@hpl.hp.com> - - * Makefile.am (ALL_64_EMULATIONS): Add eelf64_ia64.o. - (eelf64_ia64.c): New rule. - * Makefile.in: Rebuild. - * configure.tgt (ia64-*-elf*, ia64-*-linux*): New targets. - * emulparams/elf64_ia64.sh: New file. - -2000-04-21 Richard Henderson <rth@cygnus.com> - - * scripttempl/elfd30v.sc: Place .gcc_except_table. - -2000-04-19 Alan Modra <alan@linuxcare.com.au> - - * dep-in.sed: Match space at start of file name, not at end. - -2000-04-18 H.J. Lu <hjl@gnu.org> - - * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Call - lang_leave_output_section_statement () after calling - lang_enter_output_section_statement (). - * emultempl/armelf.em: Likewise. - -2000-04-18 Alan Modra <alan@linuxcare.com.au> - - * emultempl/elf32.em (struct orphan_save): Add section field. - (gld${EMULATION_NAME}_place_orphan): Use above to keep sections in - better order, and place first orphan section as we did before the - 2000-04-12 patch. Ignore ~SEC_ALLOC sections when choosing place. - Don't call make_bfd_section here, let wild_doit do the job for us. - Don't build a statement list when we'll only throw it away. - * emultempl/armelf.em: Ditto. - * emultempl/pe.em: Similarly. - -2000-04-14 Geoff Keating <geoffk@cygnus.com> - - * scripttempl/elfppc.sc: Remove. - * emulparams/elf32ppc.sh: Use elf.sc. - * emulparams/elf32lppc.sh: Use elf.sc. - * emulparams/elf32ppclinux.sh: Use elf.sc. - * emulparams/elf32ppcsim.sh: New file. - * emulparams/elf32lppcsim.sh: New file. - * Makefile.am: Update dependencies. Add elf32ppcsim ad elf32lppcsim. - (ALL_EMULATIONS): Add elf32ppcsim ad elf32lppcsim. - * Makefile.in: Regenerate. - * configure.tgt (powerpc-*): Add elf32ppcsim and elf32lppcsim. - -2000-04-14 Alan Modra <alan@linuxcare.com.au> - - * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Process - ~SEC_ALLOC sections too. Init start address of debug sections. - * emultempl/armelf.em (gld${EMULATION_NAME}_place_orphan): Ditto. - * emultempl/pe.em (gld${EMULATION_NAME}_place_orphan): Ditto. - Also set all relocateable section start addresses. - -2000-04-13 Geoff Keating <geoffk@cygnus.com> - - * scripttempl/elf.sc: Add support for .sbss2 and .sdata2 sections. - Add new BSS_PLT variable for when .plt need not be contained in - the file. Move _etext so that it is also after .fini, and provide - both etext and _etext with a leading underscore. Mark the start - and end of .sbss. - -2000-04-12 Alan Modra <alan@linuxcare.com.au> - - * emultempl/elf32.em (struct orphan_save): New. - (hold_text, hold_rodata, hold_data, hold_bss, hold_rel, - hold_interp): Make them struct orphan_save. - (gld${EMULATION_NAME}_place_section): Modify for new hold_*. - (gld${EMULATION_NAME}_place_orphan): Add new orphan sections to - the end of the relevant section list. Also add associated section - statements to the end of any previous orphan statements. - * emultempl/armelf.em: Similarly. - * emultempl/pe.em: Similarly. - -2000-04-11 Alan Modra <alan@linuxcare.com.au> - - * ld.texinfo (Simple Example): Remove extraneous paragraph. - -2000-04-07 Andrew Cagney <cagney@b1.cygnus.com> - - * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add - --enable-build-warnings option. - * Makefile.am (AM_CFLAGS, WARN_CFLAGS): Add definitions. - * Makefile.in, configure: Re-generate. - -2000-04-04 Alan Modra <alan@linuxcare.com.au> - - * po/ld.pot: Regenerate. - - * lexsup.c (help): Restore translated part of bug string. - - * Makefile.am (MKDEP): Use gcc -MM rather than mkdep. - (DEP): Quote when passing vars to sub-make. Add warning message - to end. - (DEP1): Rewrite for "gcc -MM". - (CLEANFILES): Add DEP2. - Update dependencies. - * Makefile.in: Regenerate. - -2000-04-03 Alan Modra <alan@linuxcare.com.au> - - * ld.h: #include "bin-bugs.h" - * lexsup.c (help): Use REPORT_BUGS_TO. - -2000-03-27 Denis Chertykov <denisc@overta.ru> - - * configure.tgt (avr-*-*): New target support. - * Makefile.am: Likewise. - * scripttempl/elf32avr.sc: New script file. - * emulparams/avr1200.sh: New file. - * emulparams/avr23xx.sh: New file. - * emulparams/avr4433.sh New file. - * emulparams/avr44x4.sh New file. - * emulparams/avr85xx.sh New file. - * emulparams/avrmega103.sh New file. - * emulparams/avrmega161.sh New file. - * emulparams/avrmega603.sh New file. - * Makefile.in: Regenerate. - -2000-03-09 Andreas Jaeger <aj@suse.de> - - * Makefile.am (check-DEJAGNU): Also unset LANG. - * Makefile.in: Rebuild. - -2000-03-06 Ian Lance Taylor <ian@zembu.com> - - * ldfile.c (ldfile_try_open_bfd): Don't crash if we see an empty - archive. - -2000-03-02 H.J. Lu <hjl@gnu.org> - - * emulparams/elf32mcore.sh: Include "getopt.h". - -2000-03-01 Ian Lance Taylor <ian@zembu.com> - - * configure.tgt: Remove *-*-aout, *-*-coff, and *-*-netware. - -2000-03-01 H.J. Lu <hjl@gnu.org> - - * emulparams/mipspe.sh: Add SUBSYSTEM and INITIAL_SYMBOL_CHAR. - * emulparams/shpe.sh: Likewise. - -2000-03-01 Nick Clifton <nickc@cygnus.com> - - * pe-dll.c: Remove unused variables and add ATTRIBUTE_UNUSED - to unused parameters. - - * emultempl/pe.em: Add "#ifdef DLL_SUPPORT" around static - functions only used by DLL code. - (_place_orphan): Initialise 'dollar'. - -2000-03-01 H.J. Lu <hjl@gnu.org> - - * ldmain.c (undefined_symbol): Take one more arg, fatal, to - indicate if the undefined symbol is a fatal error or not. - Don't delete the output file if "fatal" is false. - -2000-02-29 H.J. Lu <hjl@gnu.org> - - * Makefile.am (check-DEJAGNU): Also pass LIBS="$(LIBS)". - Set LC_COLLATE and LC_ALL to null and export them. It is for - sort which expects the C locale. - Add $(LIBS) to all $(HOSTING_LIBS). - * Makefile.in: Rebuild. - -2000-02-29 Alan Modra <alan@spri.levels.unisa.edu.au> - - * emultempl/{aix.em, armcoff.em, armelf.em, armelf_oabi.em, - beos.em, elf32.em, generic.em, gld960.em, gld960c.em, hppaelf.em, - linux.em, lnk960.em, mipsecoff.em, sunos.em, vanilla.em} - (ld_emulation_xfer_struct): Add missing NULL initialiser for - find_potential_libraries. - -2000-02-28 Jim Blandy <jimb@redhat.com> - - * ldgram.y (exclude_name_list): Don't require a comma to separate - list entries; the lexer considers commas to be valid part of a - filename, so in something like `foo, bar' the comma is considered - part of the first filename, `foo,'. - * ld.texinfo: Update section on EXCLUDE_FILE lists. - -2000-02-27 Loren J. Rittle <ljrittle@acm.org> - - * configure.host: Added HOSTING_CRT0, HOSTING_LIBS for - host "i[3456]86-*-freebsdelf*". - -2000-02-27 Mark Elbrecht <snowball3@bigfoot.com> - - * scripttempl/i386go32.sc: Move misplaced semicolons. - -2000-02-25 Ian Lance Taylor <ian@zembu.com> - - * Makefile.am (ALL_EMULATIONS): Remove ehppaelf.o. - (ALL_64_EMULATIONS): Remove eelf64hppa.o. - (eelf64hppa.c, ehppaelf.c): Remove targets. - * Makefile.in: Rebuild. - -2000-02-25 Alexandre Oliva <oliva@lsd.ic.unicamp.br> - - * configure.tgt (targ_extra_ofiles): Enable elf64_sparc on - GNU/Linux/sparc, but keep the default as 32. - - * configure.tgt: Enable elf64_sparc on Solaris7+/sparc. And make - it default if sparcv9 or sparc64. - -2000-02-24 Nick Clifton <nickc@cygnus.com> - - * Makefile.am: Add rules to build emipspe.o and earmpe.o. - * Makefile.in: Regenerate. - * configure.tgt: Add targets for arm-wince, sh-pe and mips-pe. - - * ldemul.h (ld_emulation_xfer_struct): Add new field: - find_potential_libraries. - * ldemul.c (ldemul_find_potential_libraries): New function. - - * ldfile.c (ldfile_open_file_search): Allow function to be - exported. - (ldfile_open_file): Call ldemul_find_potential_libraries. - * ldfile.h: Add prototype for ldfile_open_file_search. - - * pe-dll.c: Add support for ARM, MIPS and SH targets. - - * emulparams/mipspe.sh: New file. Parameters for mips-pe target. - * emulparams/shpe.sh: New file. Parameters for sh-pe target. - - * emultempl/pe.em: Add support for ARM, MIPS and SH DLLs. - (gld_X_find_potential_libraries): New function. Search for - libraries called "*.lib". - - * scripttempl/pe.sc: Add .pdata section. - -2000-02-23 Richard Henderson <rth@cygnus.com> - - * scripttempl/elfd10v.sc: Remove dynamic linking hooks. - Add and use memory regions. - -2000-02-23 Linas Vepstas (linas@linas.org) - - * emulparams/elf32i370.sh, scripttempl/elfi370.sc: New. - - * Makefile.am: Add support for Linux/IBM 370. - * configure.tgt: Likewise. - - * Makefile.in: Regenerate. - -2000-02-21 Alan Modra <alan@spri.levels.unisa.edu.au> - - * ldlang.c (print_input_section, print_data_statement, - print_reloc_statement, print_padding_statement, insert_pad, - size_input_section, lang_check_section_addresses, - lang_size_sections, lang_do_assignments, lang_set_startof, - lang_one_common): Change `opb' to unsigned. - (lang_do_assignments): Also change `size' to unsigned. - -2000-02-16 Richard Henderson <rth@cygnus.com> - - * scripttempl/elf.sc: Place OTHER_PLT_RELOC_SECTION. - -2000-02-16 Timothy Wall <twall@cygnus.com> - - * mri.c (mri_draw_tree): Add default LMA region argument to call - to lang_leave_output_section_statement. - * ldlang.h: Update prototypes with LMA region arguments. - * ldlang.c (lang_size_sections): Encapsulate region bounds - checking in os_check_region call. - (os_check_region): New function. - (lang_output_section_statement_lookup): Initialize lma_region. - (lang_leave_output_section_statement): Add LMA region argument. - (lang_leave_overlay): Ditto. - * ldgram.y: Handle LMA region syntax. - * ld.texinfo (Output Section Description): Describe LMA region usage. - * emultempl/armelf.em (gld$place_orphan): Add default value for - lma region in call to lang_leave_output_section_statement. - * emultempl/elf32.em (gld$place_orphan): Add default value for - lma region in call to lang_leave_output_section_statement. - * emultempl/pe.em (gld$place_orphan): Add default value for - lma region in call to lang_leave_output_section_statement. - - -2000-02-04 Timothy Wall <twall@redhat.com> - - * ldlang.c (lang_check_section_addresses): Use bytes instead of - octets when calculating section end addresses. - -2000-02-04 Timothy Wall <twall@redhat.com> - - * ldlang.c (lang_size_sections): Fix typo in ALIGN_N invocation. - -2000-02-03 Timothy Wall <twall@redhat.com> - - * ldexp.c (fold_name): Make SIZEOF operator return byte count, not - octet count. - * ldlang.c (print_input_section, print_data_statement, - print_reloc_statement, print_padding_statement): Print target - address values and section sizes as bytes, not octets. - (insert_pad) Calculate padding size in octets, and adjust "dot" - by bytes. - (size_input_section) Always adjust "dot" by bytes, not octets. - (lang_check_section_addresses, lang_do_assignments) Adjust - "dot" by bytes, not octets. Use the larger of the directive size - or octets_per_byte for the number of octets actually allocated in - the output section. - (lang_set_startof) Make sure STARTOF returns a target address. - (lang_one_common) Record size changes in octets. - (lang_abs_symbol_at_end_of) Section end symbol's value is - recorded in target bytes. - * ld.texinfo: Updated description of BYTE, SHORT, LONG, etc. - to be clear about behavior when an octet is smaller than one byte. - -2000-01-27 Alan Modra <alan@spri.levels.unisa.edu.au> - - * ldcref.c (output_cref): Don't pass message strings to printf - as format arg. - Update copyright. - - * ldmisc.c (vfinfo): Same here. - Update copyright. - -2000-01-23 Alan Modra <alan@spri.levels.unisa.edu.au> - - * emultempl/{armcoff.em,armelf.em,armelf_oabi.em,beos.em, - generic.em,gld960.em,gld960c.em,hppaelf.em,linux.em,lnk960.em, - mipsecoff.em,sunos.em,vanilla.em} (ld_emulation_xfer_struct): - Add missing NULL initialisers, and comments. - -2000-01-21 Nick Clifton <nickc@cygnus.com> - - * ldlang.c (lang_size_sections): Fix typo in comment. - -2000-01-18 H.J. Lu <hjl@gnu.org> - - * ldlang.c (lang_size_sections): Also update the current - address of a region if the SEC_NEVER_LOAD bit is not set. - -2000-01-10 Philip Blundell <pb@futuretv.com> - - * configure.tgt (arm*-*-conix*): New target. - -2000-01-07 Nick Clifton <nickc@cygnus.com> - - * ld.texinfo (Options): Remind users to preceed linker command - line switches with -Wl, (or whatever is appropriate) if it is - being invoked by a comnpiler driver program. - Fix description of the behaviour of the -n command line switch. - -2000-01-05 Catherine Moore <clm@cygnus.com> - - * ld.h (wildcard_spec): Change exclude_name to exclude_name_list. - (name_list): New. - * ld.texinfo (EXCLUDE_FILE): Update documentation. - * ldgram.y (wildcard_spec): Support a list of excluded_files. - (exclude_name_list): New. - ldlang.c (walk_wild_section): Support list of excluded files. - (print_wild_statement): Likewise. - (lang_add_wild): Likewise. - * ldlang.h (lang_wild_statement_type): Likewise. - * scripttempl/elf.sc (OTHER_EXCLUDE_FILES): Support. - -2000-01-04 Mumit Khan <khan@xraylith.wisc.edu> - - * pe-dll.c (pe_dll_warn_dup_exports): New variable. - (process_def_file): Use. - (pe_dll_compat_implib): New variable. - (make_one): Use. - - * pe-dll.h: Add exports of pe_dll_warn_dup_exports and - pe_dll_compat_implib. - - * emultempl/pe.em (longopts): Add warn-duplicate-exports and - compat-implib options. - (gld_${EMULATION_NAME}_list_options): List new options. - (gld_${EMULATION_NAME}_parse_args): Handle. - - * pe-dll.c (pe_dll_generate_implib): Use the correct name for output - dll. - - * deffilep.y (opt_name): Allow "." in name. - -For older changes see ChangeLog-9899 + 2003-09-18 Alexandre Oliva <aoliva@redhat.com> + * emulparams/elf32frv.sh (OTHER_READONLY_SECTIONS): Added + .rofixup.got to .rofixup. + 2003-09-15 Alexandre Oliva <aoliva@redhat.com> + * emulparams/elf32frv.sh (MAXPAGESIZE): Make it 256KiB, not 256B. + (TEMPLATE_NAME, GENERATE_SHLIB_SCRIPT): Set. + +2004-01-05 Jakub Jelinek <jakub@redhat.com> + + * emulparams/elf_s390.sh (NO_SMALL_DATA): Set to yes. + * emulparams/elf64_s390.sh (NO_SMALL_DATA): Set to yes. + +2004-01-03 Alan Modra <amodra@bigpond.net.au> + + * ldexp.c (align_n): Make static. + * ldexp.h (align_n): Delete declaration. + * ldlang.h (lang_enter_output_section_statement): Remove + block_value param. + * ldlang.c (lang_enter_output_section_statement): Likewise. + (TO_ADDR, TO_SIZE): Define. + (opb_shift): New var. + (init_opb): New function. + (print_input_section): Call init_opb and use TO_ADDR. + (print_data_statement, print_reloc_statement): Likewise. + (print_padding_statement): Likewise. + (size_input_section): Use TO_SIZE and TO_ADDR, and global opb_shift. + (lang_check_section_addresses): Likewise. + (lang_size_sections_1): Likewise. + (lang_do_assignments_1): Likewise. + (lang_set_startof): Likewise. + (lang_one_common): Likewise. Combine power_of_two and opb_shift align. + (lang_process): Call init_opb. + (lang_abs_symbol_at_end_of): Use TO_ADDR and global opb_shift. + (lang_enter_overlay_section): Adjust + lang_enter_output_section_statement call. + * ldgram.y: Likewise. + * mri.c (mri_draw_tree): Likewise. + * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Likewise. + * emultempl/mmo.em (mmo_place_orphan): Likewise. + * emultempl/pe.em (gld${EMULATION_NAME}_place_orphan): Likewise. + + * ldfile.c (ldfile_set_output_arch): Add defarch param. + * ldfile.h (ldfile_set_output_arch): Ditto. + * emultempl/aix.em (gld${EMULATION_NAME}_before_parse): Use + ldfile_set_output_arch. + * emultempl/beos.em (gld${EMULATION_NAME}_before_parse): Ditto. + * emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Ditto. + * emultempl/linux.em (gld${EMULATION_NAME}_before_parse): Ditto. + * emultempl/mipsecoff.em (gld${EMULATION_NAME}_before_parse): Ditto. + * emultempl/pe.em (gld${EMULATION_NAME}_before_parse): Ditto. + * emultempl/sunos.em (gld${EMULATION_NAME}_before_parse): Ditto. + * ldgram.y: Adjust ldfile_set_output_arch call. + * emultempl/armcoff.em (gld${EMULATION_NAME}_before_parse): Ditto. + * emultempl/armelf.em (gld${EMULATION_NAME}_before_parse): Ditto. + * emultempl/armelf_oabi.em (gld${EMULATION_NAME}_before_parse): Ditto. + * emultempl/generic.em (gld${EMULATION_NAME}_before_parse): Ditto. + * emultempl/gld960c.em (gld960_set_output_arch): Ditto. + * emultempl/m68kcoff.em (gld${EMULATION_NAME}_before_parse): Ditto. + * emultempl/ticoff.em (gld${EMULATION_NAME}_before_parse): Ditto. + +2004-01-02 Bernardo Innocenti <bernie@develer.com> + + * configure.tgt: Add m68k-uClinux target. + +For older changes see ChangeLog-0203 Local Variables: mode: change-log diff --git a/gnu/usr.bin/binutils/ld/Makefile.am b/gnu/usr.bin/binutils/ld/Makefile.am index 8e32d74aafb..179653bc6eb 100644 --- a/gnu/usr.bin/binutils/ld/Makefile.am +++ b/gnu/usr.bin/binutils/ld/Makefile.am @@ -3,7 +3,7 @@ ## FIXME: work around apparent automake bug. INTLLIBS = @INTLLIBS@ -AUTOMAKE_OPTIONS = cygnus dejagnu no-installman +AUTOMAKE_OPTIONS = cygnus dejagnu SUBDIRS = po @@ -105,7 +105,7 @@ man_MANS = ld.1 INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) -I$(top_srcdir)/../intl -I../intl $(HDEFINES) $(CFLAGS) -DLOCALEDIR="\"$(prefix)/share/locale\"" BFDLIB = ../bfd/libbfd.la -LIBIBERTY = -liberty +LIBIBERTY = -libiberty ALL_EMULATIONS = \ ea29k.o \ @@ -118,29 +118,24 @@ ALL_EMULATIONS = \ earmaoutl.o \ earmcoff.o \ earmelf.o \ + earmelfb.o \ earmelf_fbsd.o \ earmelf_linux.o \ + earmelfb_linux.o \ earmelf_nbsd.o \ - earmelf_obsd.o \ earmelfb_nbsd.o \ + earmelf_obsd.o \ earmelfb_obsd.o \ earmelf_oabi.o \ earmnto.o \ earmnbsd.o \ earmpe.o \ - eavr1200.o \ - eavr23xx.o \ - eavr4433.o \ - eavr44x4.o \ - eavr85xx.o \ - eavrmega103.o \ - eavrmega161.o \ - eavrmega603.o \ - eavr1.o \ eavr2.o \ + eavr1.o \ eavr3.o \ eavr4.o \ eavr5.o \ + ecoff_i860.o \ ecoff_sparc.o \ ecrisaout.o \ ecriself.o \ @@ -177,6 +172,7 @@ ALL_EMULATIONS = \ eelf32lppcnto.o \ eelf32lppcsim.o \ eelf32mcore.o \ + eelf32mipswindiss.o \ eelf32openrisc.o \ eelf32ppc.o \ eelf32ppc_fbsd.o \ @@ -203,10 +199,14 @@ ALL_EMULATIONS = \ eh8300elf.o \ eh8300hn.o \ eh8300sn.o \ + eh8300sx.o \ eh8300helf.o \ eh8300self.o \ eh8300hnelf.o \ eh8300snelf.o \ + eh8300sxelf.o \ + eh8300sxn.o \ + eh8300sxnelf.o \ eh8500.o \ eh8500b.o \ eh8500c.o \ @@ -229,12 +229,16 @@ ALL_EMULATIONS = \ ei386moss.o \ ei386msdos.o \ ei386nbsd.o \ - ei386obsd.o \ ei386nto.o \ ei386nw.o \ + ei386obsd.o \ ei386pe.o \ ei386pe_posix.o \ elnk960.o \ + em32relf.o \ + em32rlelf.o \ + em32relf_linux.o \ + em32rlelf_linux.o \ em68hc11elf.o \ em68hc11elfb.o \ em68hc12elf.o \ @@ -259,26 +263,30 @@ ALL_EMULATIONS = \ emipslit.o \ emipslnews.o \ emipspe.o \ + emsp430x110.o \ + emsp430x112.o \ emsp430x1101.o \ emsp430x1111.o \ emsp430x1121.o \ emsp430x1122.o \ emsp430x1132.o \ - emsp430x1331.o \ - emsp430x1351.o \ - emsp430x149.o \ - emsp430x148.o \ - emsp430x147.o \ - emsp430x135.o \ - emsp430x133.o \ - emsp430x110.o \ - emsp430x112.o \ emsp430x122.o \ - emsp430x1222.o \ emsp430x123.o \ + emsp430x1222.o \ emsp430x1232.o \ - emsp430x412.o \ - emsp430x413.o \ + emsp430x133.o \ + emsp430x135.o \ + emsp430x1331.o \ + emsp430x1351.o \ + emsp430x147.o \ + emsp430x148.o \ + emsp430x149.o \ + emsp430x155.o \ + emsp430x156.o \ + emsp430x157.o \ + emsp430x167.o \ + emsp430x168.o \ + emsp430x169.o \ emsp430x311.o \ emsp430x312.o \ emsp430x313.o \ @@ -288,17 +296,20 @@ ALL_EMULATIONS = \ emsp430x325.o \ emsp430x336.o \ emsp430x337.o \ + emsp430x412.o \ + emsp430x413.o \ + emsp430xE423.o \ + emsp430xE425.o \ + emsp430xE427.o \ + emsp430xW423.o \ + emsp430xW425.o \ + emsp430xW427.o \ emsp430x435.o \ emsp430x436.o \ + emsp430x437.o \ emsp430x447.o \ emsp430x448.o \ emsp430x449.o \ - emsp430x169.o \ - emsp430x168.o \ - emsp430x167.o \ - emsp430x155.o \ - emsp430x156.o \ - emsp430x157.o \ enews.o \ ens32knbsd.o \ eor32.o \ @@ -350,6 +361,7 @@ ALL_EMULATIONS = \ evsta.o \ ew65.o \ ez8001.o \ + eelf32frvfd.o \ ez8002.o ALL_64_EMULATIONS = \ @@ -369,10 +381,11 @@ ALL_64_EMULATIONS = \ eelf64_sparc_obsd.o \ eelf64alpha.o \ eelf64alpha_fbsd.o \ - eelf64alpha_obsd.o \ eelf64alpha_nbsd.o \ + eelf64alpha_obsd.o \ eelf64bmip.o \ eelf64btsmip.o \ + eelf64btsmip_obsd.o \ eelf64ltsmip.o \ eelf64hppa.o \ eelf64mmix.o \ @@ -409,7 +422,7 @@ EMULATION_FILES = emultempl/pe.em emultempl/armcoff.em POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES) po/POTFILES.in: @MAINT@ Makefile - for file in $(POTFILES); do echo $$file; done | sort > tmp \ + for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \ && mv tmp $(srcdir)/po/POTFILES.in ldmain.o: ldmain.c config.status @@ -441,6 +454,7 @@ stringify.sed: ${srcdir}/emultempl/$(STRINGIFY) GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed + @TDIRS@ ea29k.c: $(srcdir)/emulparams/a29k.sh \ @@ -468,6 +482,10 @@ earmelf.c: $(srcdir)/emulparams/armelf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} armelf "$(tdir_armelf)" +earmelfb.c: $(srcdir)/emulparams/armelfb.sh $(srcdir)/emulparams/armelf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \ + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} armelfb "$(tdir_armelfb)" earmelf_oabi.c: $(srcdir)/emulparams/armelf_oabi.sh \ $(srcdir)/emultempl/armelf_oabi.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} armelf_oabi "$(tdir_armelf)" @@ -480,6 +498,11 @@ earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} armelf_linux "$(tdir_armelf_linux)" +earmelfb_linux.c: $(srcdir)/emulparams/armelfb_linux.sh \ + $(srcdir)/emulparams/armelf_linux.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \ + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} armelfb_linux "$(tdir_armelfb_linux)" earmelf_nbsd.c: $(srcdir)/emulparams/armelf_nbsd.sh \ $(srcdir)/emulparams/armelf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \ @@ -524,58 +547,29 @@ earm_epoc_pe.c: $(srcdir)/emulparams/arm_epoc_pe.sh \ earmpe.c: $(srcdir)/emulparams/armpe.sh \ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS} ${GENSCRIPTS} armpe "$(tdir_armpe)" -eavr85xx.c: $(srcdir)/emulparams/avr85xx.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avr85xx "$(tdir_avr85xx)" -eavr1200.c: $(srcdir)/emulparams/avr1200.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avr1200 "$(tdir_avr85xx)" -eavr23xx.c: $(srcdir)/emulparams/avr23xx.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avr23xx "$(tdir_avr85xx)" -eavr44x4.c: $(srcdir)/emulparams/avr44x4.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avr44x4 "$(tdir_avr85xx)" -eavr4433.c: $(srcdir)/emulparams/avr4433.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avr4433 "$(tdir_avr85xx)" -eavrmega603.c: $(srcdir)/emulparams/avrmega603.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avrmega603 "$(tdir_avr85xx)" -eavrmega103.c: $(srcdir)/emulparams/avrmega103.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avrmega103 "$(tdir_avr85xx)" -eavrmega161.c: $(srcdir)/emulparams/avrmega161.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avrmega161 "$(tdir_avr85xx)" -eavr1.c: $(srcdir)/emulparams/avr1.sh \ +eavr2.c: $(srcdir)/emulparams/avr2.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} avr1 "$(tdir_avr85xx)" -eavr2.c: $(srcdir)/emulparams/avr2.sh \ + ${GENSCRIPTS} avr2 "$(tdir_avr2)" +eavr1.c: $(srcdir)/emulparams/avr1.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} avr2 "$(tdir_avr85xx)" + ${GENSCRIPTS} avr1 "$(tdir_avr2)" eavr3.c: $(srcdir)/emulparams/avr3.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} avr3 "$(tdir_avr85xx)" + ${GENSCRIPTS} avr3 "$(tdir_avr2)" eavr4.c: $(srcdir)/emulparams/avr4.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} avr4 "$(tdir_avr85xx)" + ${GENSCRIPTS} avr4 "$(tdir_avr2)" eavr5.c: $(srcdir)/emulparams/avr5.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} avr5 "$(tdir_avr85xx)" + ${GENSCRIPTS} avr5 "$(tdir_avr2)" +ecoff_i860.c: $(srcdir)/emulparams/coff_i860.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i860coff.sc ${GEN_DEPENDS} + ${GENSCRIPTS} coff_i860 "$(tdir_coff_i860)" ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS} ${GENSCRIPTS} coff_sparc "$(tdir_coff_sparc)" @@ -613,6 +607,9 @@ eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32xstormy16 "$(tdir_xstormy16)" +eelf32am33lin.c: $(srcdir)/emulparams/elf32am33lin.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf32am33lin "$(tdir_mn10300)" eelf32vax.c: $(srcdir)/emulparams/elf32vax.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32vax "$(tdir_elf32vax)" @@ -633,11 +630,19 @@ eelf32mcore.c: $(srcdir)/emulparams/elf32mcore.sh \ em32relf.c: $(srcdir)/emulparams/m32relf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} m32relf "$(tdir_m32r)" +em32rlelf.c: $(srcdir)/emulparams/m32rlelf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} m32rlelf "$(tdir_m32rlelf)" +em32relf_linux.c: $(srcdir)/emulparams/m32relf_linux.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} m32relf_linux "$(tdir_m32relf_linux)" +em32rlelf_linux.c: $(srcdir)/emulparams/m32rlelf_linux.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} m32rlelf_linux "$(tdir_m32rlelf_linux)" eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)" eelf32_sparc_obsd.c: $(srcdir)/emulparams/elf32_sparc_obsd.sh \ - $(srcdir)/emulparams/elf32_sparc.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32_sparc_obsd "$(tdir_elf32_sparc_obsd)" eelf32_i860.c: $(srcdir)/emulparams/elf32_i860.sh \ @@ -647,51 +652,60 @@ eelf32_i960.c: $(srcdir)/emulparams/elf32_i960.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32_i960 "$(tdir_elf32_i960)" eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \ - $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)" eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)" eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \ - $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/irix.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32bsmip "$(tdir_elf32bsmip)" eelf32btsmip.c: $(srcdir)/emulparams/elf32btsmip.sh \ - $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)" eelf32btsmipn32.c: $(srcdir)/emulparams/elf32btsmipn32.sh \ - $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32btsmipn32 "$(tdir_elf32btsmipn32)" eelf32ltsmip.c: $(srcdir)/emulparams/elf32ltsmip.sh \ $(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ltsmip "$(tdir_elf32ltsmip)" eelf32ltsmipn32.c: $(srcdir)/emulparams/elf32ltsmipn32.sh \ $(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ltsmipn32 "$(tdir_elf32ltsmipn32)" eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \ - $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)" eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \ $(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)" eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \ + $(srcdir)/emultempl/irix.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32bmipn32 "$(tdir_elf32bmipn32)" eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \ $(srcdir)/emulparams/elf32b4300.sh $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)" eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \ - $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)" +eelf32mipswindiss.c: $(srcdir)/emulparams/elf32mipswindiss.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf32mipswindiss "$(tdir_elf32mipswindiss)" eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} @@ -714,6 +728,7 @@ eelf32ppcwindiss.c: $(srcdir)/emulparams/elf32ppcwindiss.sh \ ${GENSCRIPTS} elf32ppcwindiss "$(tdir_elf32ppcwindiss)" eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \ $(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32lsmip "$(tdir_elf32lsmip)" eelf32openrisc.c: $(srcdir)/emulparams/elf32openrisc.sh \ @@ -727,7 +742,7 @@ eelf32ppc_fbsd.c: $(srcdir)/emulparams/elf32ppc_fbsd.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ppc_fbsd "$(tdir_elf32ppc_fbsd)" eelf32ppc_obsd.c: $(srcdir)/emulparams/elf32ppc_obsd.sh \ - $(srcdir)/emulparams/elf32ppc.sh \ + $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ppc_obsd "$(tdir_elf32ppc_obsd)" eelf32ppcsim.c: $(srcdir)/emulparams/elf32ppcsim.sh \ @@ -780,12 +795,14 @@ eelf64_aix.c: $(srcdir)/emulparams/elf64_aix.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_aix "$(tdir_elf64_aix)" eelf64_ia64.c: $(srcdir)/emulparams/elf64_ia64.sh \ - $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/ia64elf.em \ + $(srcdir)/emultempl/needrelax.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_ia64 "$(tdir_elf64_ia64)" eelf64_ia64_fbsd.c: $(srcdir)/emulparams/elf64_ia64_fbsd.sh \ $(srcdir)/emulparams/elf64_ia64.sh \ - $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/ia64elf.em \ + $(srcdir)/emultempl/needrelax.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_ia64_fbsd "$(tdir_elf64_ia64_fbsd)" eelf64_s390.c: $(srcdir)/emulparams/elf64_s390.sh \ @@ -803,7 +820,7 @@ eelf64_sparc_obsd.c: $(srcdir)/emulparams/elf64_sparc_obsd.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_sparc_obsd "$(tdir_elf64_sparc_obsd)" eelf64bmip.c: $(srcdir)/emulparams/elf64bmip.sh \ - $(srcdir)/emulparams/elf32bmipn32.sh \ + $(srcdir)/emulparams/elf32bmipn32.sh $(srcdir)/emultempl/irix.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64bmip "$(tdir_elf64bmip)" eelf64mmix.c: $(srcdir)/emulparams/elf64mmix.sh \ @@ -818,6 +835,10 @@ eelf64btsmip.c: $(srcdir)/emulparams/elf64btsmip.sh \ $(srcdir)/emulparams/elf32bmipn32.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64btsmip "$(tdir_elf64btsmip)" +eelf64btsmip_obsd.c: $(srcdir)/emulparams/elf64btsmip_obsd.sh \ + $(srcdir)/emulparams/elf32bmipn32.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64btsmip_obsd "$(tdir_elf64btsmip_obsd)" eelf64ltsmip.c: $(srcdir)/emulparams/elf64ltsmip.sh \ $(srcdir)/emulparams/elf64btsmip.sh $(srcdir)/emulparams/elf32bmipn32.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} @@ -877,6 +898,12 @@ eh8300hn.c: $(srcdir)/emulparams/h8300hn.sh \ eh8300sn.c: $(srcdir)/emulparams/h8300sn.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sn.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8300sn "$(tdir_h8300sn)" +eh8300sx.c: $(srcdir)/emulparams/h8300sx.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sx.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300sx "$(tdir_h8300sx)" +eh8300sxn.c: $(srcdir)/emulparams/h8300sxn.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sxn.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300sxn "$(tdir_h8300sxn)" eh8300elf.c: $(srcdir)/emulparams/h8300elf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8300elf "$(tdir_h8300elf)" @@ -896,6 +923,14 @@ eh8300snelf.c: $(srcdir)/emulparams/h8300snelf.sh \ $(srcdir)/emulparams/h8300elf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8300snelf "$(tdir_h8300snelf)" +eh8300sxelf.c: $(srcdir)/emulparams/h8300sxelf.sh \ + $(srcdir)/emulparams/h8300elf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300sxelf "$(tdir_h8300sxelf)" +eh8300sxnelf.c: $(srcdir)/emulparams/h8300sxnelf.sh \ + $(srcdir)/emulparams/h8300elf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300sxnelf "$(tdir_h8300sxnelf)" eh8500.c: $(srcdir)/emulparams/h8500.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8500 "$(tdir_h8500)" @@ -970,15 +1005,15 @@ ei386msdos.c: $(srcdir)/emulparams/i386msdos.sh \ ei386nbsd.c: $(srcdir)/emulparams/i386nbsd.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} i386nbsd "$(tdir_i386nbsd)" -ei386obsd.c: $(srcdir)/emulparams/i386obsd.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} - ${GENSCRIPTS} i386obsd "$(tdir_i386obsd)" ei386nto.c: $(srcdir)/emulparams/i386nto.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} i386nto "$(tdir_i386nto)" ei386nw.c: $(srcdir)/emulparams/i386nw.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS} ${GENSCRIPTS} i386nw "$(tdir_i386nw)" +ei386obsd.c: $(srcdir)/emulparams/i386obsd.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} + ${GENSCRIPTS} i386obsd "$(tdir_i386obsd)" ei386pe.c: $(srcdir)/emulparams/i386pe.sh \ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS} ${GENSCRIPTS} i386pe "$(tdir_i386pe)" @@ -989,16 +1024,20 @@ elnk960.c: $(srcdir)/emulparams/lnk960.sh \ $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS} ${GENSCRIPTS} lnk960 "$(tdir_lnk960)" em68hc11elf.c: $(srcdir)/emulparams/m68hc11elf.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \ + $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68hc11elf "$(tdir_m68hc11)" em68hc11elfb.c: $(srcdir)/emulparams/m68hc11elfb.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \ + $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68hc11elfb "$(tdir_m68hc11b)" em68hc12elf.c: $(srcdir)/emulparams/m68hc12elf.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \ + $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68hc12elf "$(tdir_m68hc12)" em68hc12elfb.c: $(srcdir)/emulparams/m68hc12elfb.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \ + $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68hc12elfb "$(tdir_m68hc12b)" em68k4knbsd.c: $(srcdir)/emulparams/m68k4knbsd.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} @@ -1030,7 +1069,7 @@ em68klynx.c: $(srcdir)/emulparams/m68klynx.sh \ em68knbsd.c: $(srcdir)/emulparams/m68knbsd.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68knbsd "$(tdir_m68knbsd)" -em68kobsd.c: $(srcdir)/emulparams/m68kobsd.sh \ +em68kobsd.c: $(srcdir)/emulparams/m68kobsd.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68kobsd "$(tdir_m68kobsd)" em68kpsos.c: $(srcdir)/emulparams/m68kpsos.sh \ @@ -1070,175 +1109,200 @@ emn10300.c: $(srcdir)/emulparams/mn10300.sh \ emn10200.c: $(srcdir)/emulparams/mn10200.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} mn10200 "$(tdir_mn10200)" -emsp430x1101.c: $(srcdir)/emulparams/msp430x1101.sh \ +emsp430x110.c: $(srcdir)/emulparams/msp430all.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ + ${GEN_DEPENDS} + ${GENSCRIPTS} msp430x110 "$(tdir_msp430x110)" msp430all +emsp430x112.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1101 "$(tdir_msp430x1101)" -emsp430x1111.c: $(srcdir)/emulparams/msp430x1111.sh \ + ${GENSCRIPTS} msp430x112 "$(tdir_msp430x112)" msp430all +emsp430x1101.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1111 "$(tdir_msp430x1111)" -emsp430x1121.c: $(srcdir)/emulparams/msp430x1121.sh \ + ${GENSCRIPTS} msp430x1101 "$(tdir_msp430x1101)" msp430all +emsp430x1111.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1121 "$(tdir_msp430x1121)" -emsp430x1122.c: $(srcdir)/emulparams/msp430x1122.sh \ + ${GENSCRIPTS} msp430x1111 "$(tdir_msp430x1111)" msp430all +emsp430x1121.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1122 "$(tdir_msp430x1122)" -emsp430x1132.c: $(srcdir)/emulparams/msp430x1132.sh \ + ${GENSCRIPTS} msp430x1121 "$(tdir_msp430x1121)" msp430all +emsp430x1122.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1132 "$(tdir_msp430x1132)" -emsp430x1331.c: $(srcdir)/emulparams/msp430x1331.sh \ + ${GENSCRIPTS} msp430x1122 "$(tdir_msp430x1122)" msp430all +emsp430x1132.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1331 "$(tdir_msp430x1331)" -emsp430x1351.c: $(srcdir)/emulparams/msp430x1351.sh \ + ${GENSCRIPTS} msp430x1132 "$(tdir_msp430x1132)" msp430all +emsp430x122.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1351 "$(tdir_msp430x1351)" -emsp430x149.c: $(srcdir)/emulparams/msp430x149.sh \ + ${GENSCRIPTS} msp430x122 "$(tdir_msp430x122)" msp430all +emsp430x123.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x149 "$(tdir_msp430x149)" -emsp430x148.c: $(srcdir)/emulparams/msp430x148.sh \ + ${GENSCRIPTS} msp430x123 "$(tdir_msp430x123)" msp430all +emsp430x1222.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x148 "$(tdir_msp430x148)" -emsp430x449.c: $(srcdir)/emulparams/msp430x449.sh \ + ${GENSCRIPTS} msp430x1222 "$(tdir_msp430x1222)" msp430all +emsp430x1232.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x449 "$(tdir_msp430x449)" -emsp430x448.c: $(srcdir)/emulparams/msp430x448.sh \ + ${GENSCRIPTS} msp430x1232 "$(tdir_msp430x1232)" msp430all +emsp430x133.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x448 "$(tdir_msp430x448)" -emsp430x447.c: $(srcdir)/emulparams/msp430x447.sh \ + ${GENSCRIPTS} msp430x133 "$(tdir_msp430x133)" msp430all +emsp430x135.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x447 "$(tdir_msp430x447)" -emsp430x412.c: $(srcdir)/emulparams/msp430x412.sh \ + ${GENSCRIPTS} msp430x135 "$(tdir_msp430x135)" msp430all +emsp430x1331.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x412 "$(tdir_msp430x412)" -emsp430x413.c: $(srcdir)/emulparams/msp430x413.sh \ + ${GENSCRIPTS} msp430x1331 "$(tdir_msp430x1331)" msp430all +emsp430x1351.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x413 "$(tdir_msp430x413)" -emsp430x147.c: $(srcdir)/emulparams/msp430x147.sh \ + ${GENSCRIPTS} msp430x1351 "$(tdir_msp430x1351)" msp430all +emsp430x147.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x147 "$(tdir_msp430x147)" -emsp430x135.c: $(srcdir)/emulparams/msp430x135.sh \ + ${GENSCRIPTS} msp430x147 "$(tdir_msp430x147)" msp430all +emsp430x148.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x135 "$(tdir_msp430x135)" -emsp430x133.c: $(srcdir)/emulparams/msp430x133.sh \ + ${GENSCRIPTS} msp430x148 "$(tdir_msp430x148)" msp430all +emsp430x149.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x133 "$(tdir_msp430x133)" -emsp430x110.c: $(srcdir)/emulparams/msp430x110.sh \ + ${GENSCRIPTS} msp430x149 "$(tdir_msp430x149)" msp430all +emsp430x155.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x110 "$(tdir_msp430x110)" -emsp430x112.c: $(srcdir)/emulparams/msp430x112.sh \ + ${GENSCRIPTS} msp430x155 "$(tdir_msp430x155)" msp430all +emsp430x156.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x112 "$(tdir_msp430x112)" -emsp430x122.c: $(srcdir)/emulparams/msp430x122.sh \ + ${GENSCRIPTS} msp430x156 "$(tdir_msp430x156)" msp430all +emsp430x157.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x122 "$(tdir_msp430x122)" -emsp430x1222.c: $(srcdir)/emulparams/msp430x1222.sh \ + ${GENSCRIPTS} msp430x157 "$(tdir_msp430x157)" msp430all +emsp430x167.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1222 "$(tdir_msp430x1222)" -emsp430x123.c: $(srcdir)/emulparams/msp430x123.sh \ + ${GENSCRIPTS} msp430x167 "$(tdir_msp430x167)" msp430all +emsp430x168.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x123 "$(tdir_msp430x123)" -emsp430x1232.c: $(srcdir)/emulparams/msp430x1232.sh \ + ${GENSCRIPTS} msp430x168 "$(tdir_msp430x168)" msp430all +emsp430x169.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1232 "$(tdir_msp430x1232)" -emsp430x311.c: $(srcdir)/emulparams/msp430x311.sh \ + ${GENSCRIPTS} msp430x169 "$(tdir_msp430x169)" msp430all +emsp430x311.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x311 "$(tdir_msp430x311)" -emsp430x312.c: $(srcdir)/emulparams/msp430x312.sh \ + ${GENSCRIPTS} msp430x311 "$(tdir_msp430x311)" msp430all +emsp430x312.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x312 "$(tdir_msp430x312)" -emsp430x313.c: $(srcdir)/emulparams/msp430x313.sh \ + ${GENSCRIPTS} msp430x312 "$(tdir_msp430x312)" msp430all +emsp430x313.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x313 "$(tdir_msp430x313)" -emsp430x314.c: $(srcdir)/emulparams/msp430x314.sh \ + ${GENSCRIPTS} msp430x313 "$(tdir_msp430x313)" msp430all +emsp430x314.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x314 "$(tdir_msp430x314)" -emsp430x315.c: $(srcdir)/emulparams/msp430x315.sh \ + ${GENSCRIPTS} msp430x314 "$(tdir_msp430x314)" msp430all +emsp430x315.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x315 "$(tdir_msp430x315)" -emsp430x323.c: $(srcdir)/emulparams/msp430x323.sh \ + ${GENSCRIPTS} msp430x315 "$(tdir_msp430x315)" msp430all +emsp430x323.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x323 "$(tdir_msp430x323)" -emsp430x325.c: $(srcdir)/emulparams/msp430x325.sh \ + ${GENSCRIPTS} msp430x323 "$(tdir_msp430x323)" msp430all +emsp430x325.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x325 "$(tdir_msp430x325)" -emsp430x336.c: $(srcdir)/emulparams/msp430x336.sh \ + ${GENSCRIPTS} msp430x325 "$(tdir_msp430x325)" msp430all +emsp430x336.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x336 "$(tdir_msp430x336)" -emsp430x337.c: $(srcdir)/emulparams/msp430x337.sh \ + ${GENSCRIPTS} msp430x336 "$(tdir_msp430x336)" msp430all +emsp430x337.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x337 "$(tdir_msp430x337)" -emsp430x435.c: $(srcdir)/emulparams/msp430x435.sh \ + ${GENSCRIPTS} msp430x337 "$(tdir_msp430x337)" msp430all +emsp430x412.c: $(srcdir)/emulparams/msp430all.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ + ${GEN_DEPENDS} + ${GENSCRIPTS} msp430x412 "$(tdir_msp430x412)" msp430all +emsp430x413.c: $(srcdir)/emulparams/msp430all.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ + ${GEN_DEPENDS} + ${GENSCRIPTS} msp430x413 "$(tdir_msp430x413)" msp430all +emsp430xE423.c: $(srcdir)/emulparams/msp430all.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ + ${GEN_DEPENDS} + ${GENSCRIPTS} msp430xE423 "$(tdir_msp430xE423)" msp430all +emsp430xE425.c: $(srcdir)/emulparams/msp430all.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ + ${GEN_DEPENDS} + ${GENSCRIPTS} msp430xE425 "$(tdir_msp430xE425)" msp430all +emsp430xE427.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x435 "$(tdir_msp430x435)" -emsp430x436.c: $(srcdir)/emulparams/msp430x436.sh \ + ${GENSCRIPTS} msp430xE427 "$(tdir_msp430xE427)" msp430all +emsp430xW423.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x436 "$(tdir_msp430x436)" -emsp430x437.c: $(srcdir)/emulparams/msp430x437.sh \ + ${GENSCRIPTS} msp430xW423 "$(tdir_msp430xW423)" msp430all +emsp430xW425.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x437 "$(tdir_msp430x437)" -emsp430x167.c: $(srcdir)/emulparams/msp430x167.sh \ + ${GENSCRIPTS} msp430xW425 "$(tdir_msp430xW425)" msp430all +emsp430xW427.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x167 "$(tdir_msp430x167)" -emsp430x168.c: $(srcdir)/emulparams/msp430x167.sh \ + ${GENSCRIPTS} msp430xW427 "$(tdir_msp430xW427)" msp430all +emsp430x435.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x168 "$(tdir_msp430x168)" -emsp430x169.c: $(srcdir)/emulparams/msp430x169.sh \ + ${GENSCRIPTS} msp430x435 "$(tdir_msp430x435)" msp430all +emsp430x436.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x169 "$(tdir_msp430x169)" -emsp430x155.c: $(srcdir)/emulparams/msp430x155.sh \ + ${GENSCRIPTS} msp430x436 "$(tdir_msp430x436)" msp430all +emsp430x437.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x155 "$(tdir_msp430x155)" -emsp430x156.c: $(srcdir)/emulparams/msp430x156.sh \ + ${GENSCRIPTS} msp430x437 "$(tdir_msp430x437)" msp430all +emsp430x447.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x156 "$(tdir_msp430x156)" -emsp430x157.c: $(srcdir)/emulparams/msp430x157.sh \ + ${GENSCRIPTS} msp430x447 "$(tdir_msp430x447)" msp430all +emsp430x448.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x157 "$(tdir_msp430x157)" + ${GENSCRIPTS} msp430x448 "$(tdir_msp430x448)" msp430all +emsp430x449.c: $(srcdir)/emulparams/msp430all.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ + ${GEN_DEPENDS} + ${GENSCRIPTS} msp430x449 "$(tdir_msp430x449)" msp430all enews.c: $(srcdir)/emulparams/news.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} news "$(tdir_news)" ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/netbsd.em \ + $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} ns32knbsd "$(tdir_ns32knbsd)" eor32.c: $(srcdir)/emulparams/or32.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/or32.sc ${GEN_DEPENDS} @@ -1374,7 +1438,7 @@ esparclynx.c: $(srcdir)/emulparams/sparclynx.sh \ esparcnbsd.c: $(srcdir)/emulparams/sparcnbsd.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} sparcnbsd "$(tdir_sparcnbsd)" -esparcobsd.c: $(srcdir)/emulparams/sparcobsd.sh \ +esparcobsd.c: $(srcdir)/emulparams/sparcobsd.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} sparcobsd "$(tdir_sparcobsd)" est2000.c: $(srcdir)/emulparams/st2000.sh \ @@ -1431,6 +1495,10 @@ ez8001.c: $(srcdir)/emulparams/z8001.sh \ ez8002.c: $(srcdir)/emulparams/z8002.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS} ${GENSCRIPTS} z8002 "$(tdir_z8002)" +eelf32frvfd.c: $(srcdir)/emulparams/elf32frvfd.sh \ + $(srcdir)/emulparams/elf32frv.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf32frvfd "$(tdir_frv)" # We need this for automake to use YLWRAP. EXTRA_ld_new_SOURCES = deffilep.y @@ -1654,22 +1722,22 @@ dep-am: DEP @MAINT@ $(srcdir)/mpw-esh.c $(srcdir)/mpw-idtmips.c @MAINT@ @MAINT@$(srcdir)/mpw-ei386go32.c: ei386go32.c -@MAINT@ $(srcdir)/../move-if-change $< $@ +@MAINT@ $(SHELL) $(srcdir)/../move-if-change $< $@ @MAINT@ @MAINT@$(srcdir)/mpw-elfmips.c: eelf32ebmip.c -@MAINT@ $(srcdir)/../move-if-change $< $@ +@MAINT@ $(SHELL) $(srcdir)/../move-if-change $< $@ @MAINT@ @MAINT@$(srcdir)/mpw-em68kcoff.c: em68kcoff.c -@MAINT@ $(srcdir)/../move-if-change $< $@ +@MAINT@ $(SHELL) $(srcdir)/../move-if-change $< $@ @MAINT@ @MAINT@$(srcdir)/mpw-eppcmac.c: eppcmacos.c -@MAINT@ $(srcdir)/../move-if-change $< $@ +@MAINT@ $(SHELL) $(srcdir)/../move-if-change $< $@ @MAINT@ @MAINT@$(srcdir)/mpw-esh.c: esh.c -@MAINT@ $(srcdir)/../move-if-change $< $@ +@MAINT@ $(SHELL) $(srcdir)/../move-if-change $< $@ @MAINT@ @MAINT@$(srcdir)/mpw-idtmips.c: emipsidt.c -@MAINT@ $(srcdir)/../move-if-change $< $@ +@MAINT@ $(SHELL) $(srcdir)/../move-if-change $< $@ # What appears below is generated by a hacked mkdep using gcc -MM. @@ -1698,7 +1766,8 @@ ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldmain.h \ ldexp.h ldlang.h ldgram.h ldlex.h ldmisc.h ldctor.h \ - ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h + ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h \ + $(INCDIR)/hashtab.h ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h $(INCDIR)/progress.h \ @@ -1706,18 +1775,19 @@ ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ ldmain.h ldmisc.h ldwrite.h ldexp.h ldlang.h ldgram.h \ ldlex.h ldfile.h ldemul.h ldctor.h ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h $(INCDIR)/demangle.h ld.h $(INCDIR)/bin-bugs.h \ - ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h \ - ldfile.h + $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h sysdep.h config.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \ + ld.h $(INCDIR)/bin-bugs.h ldmisc.h ldexp.h ldlang.h \ + ldgram.h ldlex.h ldmain.h ldfile.h ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h ../bfd/bfdver.h sysdep.h config.h \ $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h ldver.h \ ldexp.h ldlang.h ldfile.h ldemul.h ldmain.h ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h \ - ldexp.h ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + ld.h $(INCDIR)/bin-bugs.h ldexp.h ldlang.h ldwrite.h \ + ldmisc.h ldgram.h ldmain.h lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h \ @@ -1742,7 +1812,7 @@ ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \ ldver.h ldlang.h ldfile.h ldemul.h ldmisc.h ldmain.h \ mri.h ldctor.h ldlex.h -ldlex.o: ldlex.c $(INCDIR)/ansidecl.h ../bfd/bfd.h \ +ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h \ ldmisc.h ldexp.h ldlang.h ldgram.h ldfile.h ldlex.h \ diff --git a/gnu/usr.bin/binutils/ld/Makefile.in b/gnu/usr.bin/binutils/ld/Makefile.in index acac58a02e5..fe0b0866894 100644 --- a/gnu/usr.bin/binutils/ld/Makefile.in +++ b/gnu/usr.bin/binutils/ld/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation @@ -112,7 +112,7 @@ use_sysroot = @use_sysroot@ INTLLIBS = @INTLLIBS@ -AUTOMAKE_OPTIONS = cygnus dejagnu no-installman +AUTOMAKE_OPTIONS = cygnus dejagnu SUBDIRS = po @@ -156,7 +156,8 @@ MANCONF = -Dman TEXI2POD = perl $(BASEDIR)/etc/texi2pod.pl -POD2MAN = pod2man --center="GNU Development Tools" --release="binutils-$(VERSION)" --section=1 +POD2MAN = pod2man --center="GNU Development Tools" \ + --release="binutils-$(VERSION)" --section=1 #stuff for self hosting (can be overridden in config file). @@ -165,19 +166,49 @@ HOSTING_LIBS = @HOSTING_LIBS@ HOSTING_EMU = -m $(EMUL) # Setup the testing framework, if you have one -EXPECT = `if [ -f $$r/../expect/expect ] ; then echo $$r/../expect/expect ; else echo expect ; fi` +EXPECT = `if [ -f $$r/../expect/expect ] ; \ + then echo $$r/../expect/expect ; \ + else echo expect ; fi` -RUNTEST = `if [ -f $${srcroot}/../dejagnu/runtest ] ; then echo $${srcroot}/../dejagnu/runtest ; else echo runtest ; fi` +RUNTEST = `if [ -f $${srcroot}/../dejagnu/runtest ] ; \ + then echo $${srcroot}/../dejagnu/runtest ; \ + else echo runtest ; fi` RUNTESTFLAGS = -CC_FOR_TARGET = ` if [ -f $$r/../gcc/xgcc ] ; then if [ -f $$r/../newlib/Makefile ] ; then echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; else echo $$r/../gcc/xgcc -B$$r/../gcc/; fi; else if [ "@host@" = "@target@" ] ; then echo $(CC); else echo gcc | sed '$(transform)'; fi; fi` +CC_FOR_TARGET = ` \ + if [ -f $$r/../gcc/xgcc ] ; then \ + if [ -f $$r/../newlib/Makefile ] ; then \ + echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \ + else \ + echo $$r/../gcc/xgcc -B$$r/../gcc/; \ + fi; \ + else \ + if [ "@host@" = "@target@" ] ; then \ + echo $(CC); \ + else \ + echo gcc | sed '$(transform)'; \ + fi; \ + fi` CXX = gcc -CXX_FOR_TARGET = ` if [ -f $$r/../gcc/xgcc ] ; then if [ -f $$r/../newlib/Makefile ] ; then echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; else echo $$r/../gcc/xgcc -B$$r/../gcc/; fi; else if [ "@host@" = "@target@" ] ; then echo $(CXX); else echo gcc | sed '$(transform)'; fi; fi` +CXX_FOR_TARGET = ` \ + if [ -f $$r/../gcc/xgcc ] ; then \ + if [ -f $$r/../newlib/Makefile ] ; then \ + echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \ + else \ + echo $$r/../gcc/xgcc -B$$r/../gcc/; \ + fi; \ + else \ + if [ "@host@" = "@target@" ] ; then \ + echo $(CXX); \ + else \ + echo gcc | sed '$(transform)'; \ + fi; \ + fi` noinst_PROGRAMS = ld-new @@ -190,25 +221,316 @@ INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) -I$(to BFDLIB = ../bfd/libbfd.la LIBIBERTY = -liberty -ALL_EMULATIONS = ea29k.o eaixppc.o eaixrs6.o ealpha.o earcelf.o earm_epoc_pe.o earmaoutb.o earmaoutl.o earmcoff.o earmelf.o earmelf_fbsd.o earmelf_linux.o earmelf_nbsd.o earmelf_obsd.o earmelfb_nbsd.o earmelfb_obsd.o earmelf_oabi.o earmnto.o earmnbsd.o earmpe.o eavr1200.o eavr23xx.o eavr4433.o eavr44x4.o eavr85xx.o eavrmega103.o eavrmega161.o eavrmega603.o eavr1.o eavr2.o eavr3.o eavr4.o eavr5.o ecoff_sparc.o ecrisaout.o ecriself.o ecrislinux.o ed10velf.o ed30v_e.o ed30v_o.o ed30velf.o edelta68.o eelf32_dlx.o eebmon29k.o eelf32_i960.o eelf32_i860.o eelf32_sparc.o eelf32_sparc_obsd.o eelf32b4300.o eelf32bmip.o eelf32bmipn32.o eelf32btsmip.o eelf32btsmipn32.o eelf32ltsmip.o eelf32ltsmipn32.o eelf32ebmip.o eelf32elmip.o eelf32fr30.o eelf32frv.o eelf32i370.o eelf32ip2k.o eelf32iq2000.o eelf32iq10.o eelf32l4300.o eelf32lmip.o eelf32lppc.o eelf32lppcnto.o eelf32lppcsim.o eelf32mcore.o eelf32openrisc.o eelf32ppc.o eelf32ppc_fbsd.o eelf32ppc_obsd.o eelf32ppclinux.o eelf32ppcnto.o eelf32ppcsim.o eelf32ppcwindiss.o eelf32vax.o eelf32xstormy16.o eelf32xtensa.o eelf_i386.o eelf_i386_be.o eelf_i386_chaos.o eelf_i386_fbsd.o eelf_i386_obsd.o eelf_i386_ldso.o eelf_s390.o egld960.o egld960coff.o eh8300.o eh8300h.o eh8300s.o eh8300elf.o eh8300hn.o eh8300sn.o eh8300helf.o eh8300self.o eh8300hnelf.o eh8300snelf.o eh8500.o eh8500b.o eh8500c.o eh8500m.o eh8500s.o ehp300bsd.o ehp3hpux.o ehppaelf.o ehppalinux.o ehppanbsd.o ehppaobsd.o ei386aout.o ei386beos.o ei386bsd.o ei386coff.o ei386go32.o ei386linux.o ei386lynx.o ei386mach.o ei386moss.o ei386msdos.o ei386nbsd.o ei386obsd.o ei386nto.o ei386nw.o ei386pe.o ei386pe_posix.o elnk960.o em68hc11elf.o em68hc11elfb.o em68hc12elf.o em68hc12elfb.o em68k4knbsd.o em68kaout.o em68kaux.o em68kcoff.o em68kelf.o em68kelfnbsd.o em68klinux.o em68klynx.o em68knbsd.o em68kobsd.o em68kpsos.o em88kbcs.o emcorepe.o emipsbig.o emipsbsd.o emipsidt.o emipsidtl.o emipslit.o emipslnews.o emipspe.o emsp430x1101.o emsp430x1111.o emsp430x1121.o emsp430x1122.o emsp430x1132.o emsp430x1331.o emsp430x1351.o emsp430x149.o emsp430x148.o emsp430x147.o emsp430x135.o emsp430x133.o emsp430x110.o emsp430x112.o emsp430x122.o emsp430x1222.o emsp430x123.o emsp430x1232.o emsp430x412.o emsp430x413.o emsp430x311.o emsp430x312.o emsp430x313.o emsp430x314.o emsp430x315.o emsp430x323.o emsp430x325.o emsp430x336.o emsp430x337.o emsp430x435.o emsp430x436.o emsp430x447.o emsp430x448.o emsp430x449.o emsp430x169.o emsp430x168.o emsp430x167.o emsp430x155.o emsp430x156.o emsp430x157.o enews.o ens32knbsd.o eor32.o eor32elf.o epc532macha.o epdp11.o epjelf.o epjlelf.o eppcmacos.o eppcnw.o eppcpe.o eriscix.o esa29200.o esh.o eshelf32.o eshlelf32.o eshelf32_linux.o eshlelf32_linux.o eshelf32_nbsd.o eshlelf32_nbsd.o eshelf.o eshelf_linux.o eshlelf_linux.o eshelf_nbsd.o eshlelf_nbsd.o eshelf_nto.o eshlelf_nto.o eshl.o eshlelf.o eshpe.o esparcaout.o esparclinux.o esparclynx.o esparcnbsd.o esparcobsd.o est2000.o esun3.o esun4.o etic30aout.o etic30coff.o etic3xcoff.o etic3xcoff_onchip.o etic4xcoff.o etic54xcoff.o etic80coff.o evanilla.o evax.o evaxnbsd.o evsta.o ew65.o ez8001.o ez8002.o - - -ALL_64_EMULATIONS = eelf64_aix.o eelf64_ia64.o eelf64_ia64_fbsd.o eshelf64.o eshlelf64.o eshelf64_nbsd.o eshlelf64_nbsd.o eelf_x86_64.o eelf_x86_64_fbsd.o eelf_x86_64_obsd.o eelf64_s390.o eelf64_sparc.o eelf64_sparc_fbsd.o eelf64_sparc_obsd.o eelf64alpha.o eelf64alpha_fbsd.o eelf64alpha_obsd.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 = deffilep.o pe-dll.o - - -CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c mri.c ldcref.c pe-dll.c - - -HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h ldwrite.h mri.h deffile.h pe-dll.h +ALL_EMULATIONS = \ + ea29k.o \ + eaixppc.o \ + eaixrs6.o \ + ealpha.o \ + earcelf.o \ + earm_epoc_pe.o \ + earmaoutb.o \ + earmaoutl.o \ + earmcoff.o \ + earmelf.o \ + earmelfb.o \ + earmelf_fbsd.o \ + earmelf_linux.o \ + earmelfb_linux.o \ + earmelf_nbsd.o \ + earmelfb_nbsd.o \ + earmelf_oabi.o \ + earmelf_obsd.o \ + earmelfb_obsd.o \ + earmnto.o \ + earmnbsd.o \ + earmpe.o \ + eavr2.o \ + eavr1.o \ + eavr3.o \ + eavr4.o \ + eavr5.o \ + ecoff_i860.o \ + ecoff_sparc.o \ + ecrisaout.o \ + ecriself.o \ + ecrislinux.o \ + ed10velf.o \ + ed30v_e.o \ + ed30v_o.o \ + ed30velf.o \ + edelta68.o \ + eelf32_dlx.o \ + eebmon29k.o \ + eelf32_i960.o \ + eelf32_i860.o \ + eelf32_sparc.o \ + eelf32_sparc_obsd.o \ + eelf32b4300.o \ + eelf32bmip.o \ + eelf32bmipn32.o \ + eelf32btsmip.o \ + eelf32btsmipn32.o \ + eelf32ltsmip.o \ + eelf32ltsmipn32.o \ + eelf32ebmip.o \ + eelf32elmip.o \ + eelf32fr30.o \ + eelf32frv.o \ + eelf32i370.o \ + eelf32ip2k.o \ + eelf32iq2000.o \ + eelf32iq10.o \ + eelf32l4300.o \ + eelf32lmip.o \ + eelf32lppc.o \ + eelf32lppcnto.o \ + eelf32lppcsim.o \ + eelf32mcore.o \ + eelf32mipswindiss.o \ + eelf32openrisc.o \ + eelf32ppc.o \ + eelf32ppc_fbsd.o \ + eelf32ppc_obsd.o \ + eelf32ppclinux.o \ + eelf32ppcnto.o \ + eelf32ppcsim.o \ + eelf32ppcwindiss.o \ + eelf32vax.o \ + eelf32xstormy16.o \ + eelf32xtensa.o \ + eelf_i386.o \ + eelf_i386_be.o \ + eelf_i386_chaos.o \ + eelf_i386_fbsd.o \ + eelf_i386_ldso.o \ + eelf_i386_obsd.o \ + eelf_s390.o \ + egld960.o \ + egld960coff.o \ + eh8300.o \ + eh8300h.o \ + eh8300s.o \ + eh8300elf.o \ + eh8300hn.o \ + eh8300sn.o \ + eh8300sx.o \ + eh8300helf.o \ + eh8300self.o \ + eh8300hnelf.o \ + eh8300snelf.o \ + eh8300sxelf.o \ + eh8300sxn.o \ + eh8300sxnelf.o \ + eh8500.o \ + eh8500b.o \ + eh8500c.o \ + eh8500m.o \ + eh8500s.o \ + ehp300bsd.o \ + ehp3hpux.o \ + ehppaelf.o \ + ehppalinux.o \ + ehppanbsd.o \ + ehppaobsd.o \ + ei386aout.o \ + ei386beos.o \ + ei386bsd.o \ + ei386coff.o \ + ei386go32.o \ + ei386linux.o \ + ei386lynx.o \ + ei386mach.o \ + ei386moss.o \ + ei386msdos.o \ + ei386nbsd.o \ + ei386obsd.o \ + ei386nto.o \ + ei386nw.o \ + ei386pe.o \ + ei386pe_posix.o \ + elnk960.o \ + em32relf.o \ + em32rlelf.o \ + em32relf_linux.o \ + em32rlelf_linux.o \ + em68hc11elf.o \ + em68hc11elfb.o \ + em68hc12elf.o \ + em68hc12elfb.o \ + em68k4knbsd.o \ + em68kaout.o \ + em68kaux.o \ + em68kcoff.o \ + em68kelf.o \ + em68kelfnbsd.o \ + em68klinux.o \ + em68klynx.o \ + em68knbsd.o \ + em68kobsd.o \ + em68kpsos.o \ + em88kbcs.o \ + emcorepe.o \ + emipsbig.o \ + emipsbsd.o \ + emipsidt.o \ + emipsidtl.o \ + emipslit.o \ + emipslnews.o \ + emipspe.o \ + emsp430x110.o \ + emsp430x112.o \ + emsp430x1101.o \ + emsp430x1111.o \ + emsp430x1121.o \ + emsp430x1122.o \ + emsp430x1132.o \ + emsp430x122.o \ + emsp430x123.o \ + emsp430x1222.o \ + emsp430x1232.o \ + emsp430x133.o \ + emsp430x135.o \ + emsp430x1331.o \ + emsp430x1351.o \ + emsp430x147.o \ + emsp430x148.o \ + emsp430x149.o \ + emsp430x155.o \ + emsp430x156.o \ + emsp430x157.o \ + emsp430x167.o \ + emsp430x168.o \ + emsp430x169.o \ + emsp430x311.o \ + emsp430x312.o \ + emsp430x313.o \ + emsp430x314.o \ + emsp430x315.o \ + emsp430x323.o \ + emsp430x325.o \ + emsp430x336.o \ + emsp430x337.o \ + emsp430x412.o \ + emsp430x413.o \ + emsp430xE423.o \ + emsp430xE425.o \ + emsp430xE427.o \ + emsp430xW423.o \ + emsp430xW425.o \ + emsp430xW427.o \ + emsp430x435.o \ + emsp430x436.o \ + emsp430x437.o \ + emsp430x447.o \ + emsp430x448.o \ + emsp430x449.o \ + enews.o \ + ens32knbsd.o \ + eor32.o \ + eor32elf.o \ + epc532macha.o \ + epdp11.o \ + epjelf.o \ + epjlelf.o \ + eppcmacos.o \ + eppcnw.o \ + eppcpe.o \ + eriscix.o \ + esa29200.o \ + esh.o \ + eshelf32.o \ + eshlelf32.o \ + eshelf32_linux.o \ + eshlelf32_linux.o \ + eshelf32_nbsd.o \ + eshlelf32_nbsd.o \ + eshelf.o \ + eshelf_linux.o \ + eshlelf_linux.o \ + eshelf_nbsd.o \ + eshlelf_nbsd.o \ + eshelf_nto.o \ + eshlelf_nto.o \ + eshl.o \ + eshlelf.o \ + eshpe.o \ + esparcaout.o \ + esparclinux.o \ + esparclynx.o \ + esparcnbsd.o \ + esparcobsd.o \ + est2000.o \ + esun3.o \ + esun4.o \ + etic30aout.o \ + etic30coff.o \ + etic3xcoff.o \ + etic3xcoff_onchip.o \ + etic4xcoff.o \ + etic54xcoff.o \ + etic80coff.o \ + evanilla.o \ + evax.o \ + evaxnbsd.o \ + evsta.o \ + ew65.o \ + ez8001.o \ + eelf32frvfd.o \ + ez8002.o + + +ALL_64_EMULATIONS = \ + eelf64_aix.o \ + eelf64_ia64.o \ + eelf64_ia64_fbsd.o \ + eshelf64.o \ + eshlelf64.o \ + eshelf64_nbsd.o \ + eshlelf64_nbsd.o \ + eelf_x86_64.o \ + eelf_x86_64_fbsd.o \ + eelf_x86_64_obsd.o \ + eelf64_s390.o \ + eelf64_sparc.o \ + eelf64_sparc_fbsd.o \ + eelf64_sparc_obsd.o \ + eelf64alpha.o \ + eelf64alpha_fbsd.o \ + eelf64alpha_nbsd.o \ + eelf64alpha_obsd.o \ + eelf64bmip.o \ + eelf64btsmip.o \ + eelf64btsmip_obsd.o \ + eelf64ltsmip.o \ + eelf64hppa.o \ + eelf64mmix.o \ + emmo.o \ + eelf64ppc.o \ + eelf64lppc.o \ + ehppa64linux.o + + +ALL_EMUL_EXTRA_OFILES = \ + deffilep.o \ + pe-dll.o + + +CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \ + ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \ + mri.c ldcref.c pe-dll.c + + +HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h \ + ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \ + ldwrite.h mri.h deffile.h pe-dll.h GENERATED_CFILES = ldgram.c ldlex.c deffilep.c GENERATED_HFILES = ldgram.h ldemul-list.h deffilep.h -OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o ${EMULATION_OFILES} ${EMUL_EXTRA_OFILES} +OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \ + ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o \ + ldfile.o ldcref.o ${EMULATION_OFILES} ${EMUL_EXTRA_OFILES} STAGESTUFF = *.o ldscripts/* e*.c @@ -227,7 +549,8 @@ GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed # We need this for automake to use YLWRAP. EXTRA_ld_new_SOURCES = deffilep.y -ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c +ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \ + ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(INTLDEPS) ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(INTLLIBS) @@ -240,7 +563,8 @@ 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 +MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \ + ldemul-list.h crtbegin.o crtend.o ld.log ld.sum CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 @@ -290,7 +614,7 @@ deffilep.c ldgram.c ldlex.c DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +TAR = gtar GZIP_ENV = --best SOURCES = $(ld_new_SOURCES) $(EXTRA_ld_new_SOURCES) OBJECTS = $(ld_new_OBJECTS) @@ -592,7 +916,6 @@ maintainer-clean-recursive: rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ test "$$subdir" != "." || dot_seen=yes; \ - true; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ @@ -744,20 +1067,21 @@ all-recursive-am: config.h install-exec-am: install-exec-local install-exec: install-exec-recursive -install-data-am: install-data-local +install-data-am: install-man install-data-local install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive -uninstall-am: +uninstall-am: uninstall-man uninstall: uninstall-recursive -all-am: Makefile $(PROGRAMS) config.h +all-am: Makefile $(PROGRAMS) $(MANS) config.h all-redirect: all-recursive-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 mostlyclean-generic: @@ -772,7 +1096,7 @@ distclean-generic: -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: - -test -z "ldlexcdeffilephdeffilepcldgramhldgramc$(MAINTAINERCLEANFILES)" || rm -f ldlexc deffileph deffilepc ldgramh ldgramc $(MAINTAINERCLEANFILES) + -test -z "ldlexldeffilephdeffilepcldgramhldgramc$(MAINTAINERCLEANFILES)" || rm -f ldlexl deffileph deffilepc ldgramh ldgramc $(MAINTAINERCLEANFILES) mostlyclean-am: mostlyclean-hdr mostlyclean-noinstPROGRAMS \ mostlyclean-compile mostlyclean-libtool \ mostlyclean-aminfo mostlyclean-tags mostlyclean-generic \ @@ -829,7 +1153,7 @@ mostlyclean distclean maintainer-clean po/POTFILES.in: @MAINT@ Makefile - for file in $(POTFILES); do echo $$file; done | sort > tmp \ + for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \ && mv tmp $(srcdir)/po/POTFILES.in ldmain.o: ldmain.c config.status @@ -856,6 +1180,7 @@ ldemul-list.h: Makefile stringify.sed: ${srcdir}/emultempl/$(STRINGIFY) cp ${srcdir}/emultempl/$(STRINGIFY) stringify.sed + @TDIRS@ ea29k.c: $(srcdir)/emulparams/a29k.sh \ @@ -883,6 +1208,10 @@ earmelf.c: $(srcdir)/emulparams/armelf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} armelf "$(tdir_armelf)" +earmelfb.c: $(srcdir)/emulparams/armelfb.sh $(srcdir)/emulparams/armelf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \ + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} armelfb "$(tdir_armelfb)" earmelf_oabi.c: $(srcdir)/emulparams/armelf_oabi.sh \ $(srcdir)/emultempl/armelf_oabi.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} armelf_oabi "$(tdir_armelf)" @@ -895,6 +1224,11 @@ earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} armelf_linux "$(tdir_armelf_linux)" +earmelfb_linux.c: $(srcdir)/emulparams/armelfb_linux.sh \ + $(srcdir)/emulparams/armelf_linux.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \ + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} armelfb_linux "$(tdir_armelfb_linux)" earmelf_nbsd.c: $(srcdir)/emulparams/armelf_nbsd.sh \ $(srcdir)/emulparams/armelf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \ @@ -939,58 +1273,29 @@ earm_epoc_pe.c: $(srcdir)/emulparams/arm_epoc_pe.sh \ earmpe.c: $(srcdir)/emulparams/armpe.sh \ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS} ${GENSCRIPTS} armpe "$(tdir_armpe)" -eavr85xx.c: $(srcdir)/emulparams/avr85xx.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avr85xx "$(tdir_avr85xx)" -eavr1200.c: $(srcdir)/emulparams/avr1200.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avr1200 "$(tdir_avr85xx)" -eavr23xx.c: $(srcdir)/emulparams/avr23xx.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avr23xx "$(tdir_avr85xx)" -eavr44x4.c: $(srcdir)/emulparams/avr44x4.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avr44x4 "$(tdir_avr85xx)" -eavr4433.c: $(srcdir)/emulparams/avr4433.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avr4433 "$(tdir_avr85xx)" -eavrmega603.c: $(srcdir)/emulparams/avrmega603.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avrmega603 "$(tdir_avr85xx)" -eavrmega103.c: $(srcdir)/emulparams/avrmega103.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avrmega103 "$(tdir_avr85xx)" -eavrmega161.c: $(srcdir)/emulparams/avrmega161.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \ - ${GEN_DEPENDS} - ${GENSCRIPTS} avrmega161 "$(tdir_avr85xx)" -eavr1.c: $(srcdir)/emulparams/avr1.sh \ +eavr2.c: $(srcdir)/emulparams/avr2.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} avr1 "$(tdir_avr85xx)" -eavr2.c: $(srcdir)/emulparams/avr2.sh \ + ${GENSCRIPTS} avr2 "$(tdir_avr2)" +eavr1.c: $(srcdir)/emulparams/avr1.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} avr2 "$(tdir_avr85xx)" + ${GENSCRIPTS} avr1 "$(tdir_avr2)" eavr3.c: $(srcdir)/emulparams/avr3.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} avr3 "$(tdir_avr85xx)" + ${GENSCRIPTS} avr3 "$(tdir_avr2)" eavr4.c: $(srcdir)/emulparams/avr4.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} avr4 "$(tdir_avr85xx)" + ${GENSCRIPTS} avr4 "$(tdir_avr2)" eavr5.c: $(srcdir)/emulparams/avr5.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/avr.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} avr5 "$(tdir_avr85xx)" + ${GENSCRIPTS} avr5 "$(tdir_avr2)" +ecoff_i860.c: $(srcdir)/emulparams/coff_i860.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i860coff.sc ${GEN_DEPENDS} + ${GENSCRIPTS} coff_i860 "$(tdir_coff_i860)" ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS} ${GENSCRIPTS} coff_sparc "$(tdir_coff_sparc)" @@ -1028,6 +1333,9 @@ eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32xstormy16 "$(tdir_xstormy16)" +eelf32am33lin.c: $(srcdir)/emulparams/elf32am33lin.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf32am33lin "$(tdir_mn10300)" eelf32vax.c: $(srcdir)/emulparams/elf32vax.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32vax "$(tdir_elf32vax)" @@ -1048,11 +1356,19 @@ eelf32mcore.c: $(srcdir)/emulparams/elf32mcore.sh \ em32relf.c: $(srcdir)/emulparams/m32relf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} m32relf "$(tdir_m32r)" +em32rlelf.c: $(srcdir)/emulparams/m32rlelf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} m32rlelf "$(tdir_m32rlelf)" +em32relf_linux.c: $(srcdir)/emulparams/m32relf_linux.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} m32relf_linux "$(tdir_m32relf_linux)" +em32rlelf_linux.c: $(srcdir)/emulparams/m32rlelf_linux.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} m32rlelf_linux "$(tdir_m32rlelf_linux)" eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)" eelf32_sparc_obsd.c: $(srcdir)/emulparams/elf32_sparc_obsd.sh \ - $(srcdir)/emulparams/elf32_sparc.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32_sparc_obsd "$(tdir_elf32_sparc_obsd)" eelf32_i860.c: $(srcdir)/emulparams/elf32_i860.sh \ @@ -1062,51 +1378,60 @@ eelf32_i960.c: $(srcdir)/emulparams/elf32_i960.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32_i960 "$(tdir_elf32_i960)" eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \ - $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)" eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)" eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \ - $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/irix.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32bsmip "$(tdir_elf32bsmip)" eelf32btsmip.c: $(srcdir)/emulparams/elf32btsmip.sh \ - $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)" eelf32btsmipn32.c: $(srcdir)/emulparams/elf32btsmipn32.sh \ - $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32btsmipn32 "$(tdir_elf32btsmipn32)" eelf32ltsmip.c: $(srcdir)/emulparams/elf32ltsmip.sh \ $(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ltsmip "$(tdir_elf32ltsmip)" eelf32ltsmipn32.c: $(srcdir)/emulparams/elf32ltsmipn32.sh \ $(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ltsmipn32 "$(tdir_elf32ltsmipn32)" eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \ - $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)" eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \ $(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)" eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \ + $(srcdir)/emultempl/irix.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32bmipn32 "$(tdir_elf32bmipn32)" eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \ $(srcdir)/emulparams/elf32b4300.sh $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)" eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \ - $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)" +eelf32mipswindiss.c: $(srcdir)/emulparams/elf32mipswindiss.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf32mipswindiss "$(tdir_elf32mipswindiss)" eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} @@ -1129,6 +1454,7 @@ eelf32ppcwindiss.c: $(srcdir)/emulparams/elf32ppcwindiss.sh \ ${GENSCRIPTS} elf32ppcwindiss "$(tdir_elf32ppcwindiss)" eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \ $(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \ + $(srcdir)/emultempl/mipself.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32lsmip "$(tdir_elf32lsmip)" eelf32openrisc.c: $(srcdir)/emulparams/elf32openrisc.sh \ @@ -1142,7 +1468,7 @@ eelf32ppc_fbsd.c: $(srcdir)/emulparams/elf32ppc_fbsd.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ppc_fbsd "$(tdir_elf32ppc_fbsd)" eelf32ppc_obsd.c: $(srcdir)/emulparams/elf32ppc_obsd.sh \ - $(srcdir)/emulparams/elf32ppc.sh \ + $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32ppc_obsd "$(tdir_elf32ppc_obsd)" eelf32ppcsim.c: $(srcdir)/emulparams/elf32ppcsim.sh \ @@ -1179,14 +1505,14 @@ eelf64alpha_fbsd.c: $(srcdir)/emulparams/elf64alpha_fbsd.sh \ $(srcdir)/emulparams/elf64alpha.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64alpha_fbsd "$(tdir_elf64alpha_fbsd)" -eelf64alpha_obsd.c: $(srcdir)/emulparams/elf64alpha_obsd.sh \ - $(srcdir)/emulparams/elf64alpha.sh \ - $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - ${GENSCRIPTS} elf64alpha_obsd "$(tdir_elf64alpha_obsd)" 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)" +eelf64alpha_obsd.c: $(srcdir)/emulparams/elf64alpha_obsd.sh \ + $(srcdir)/emulparams/elf64alpha.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64alpha_obsd "$(tdir_elf64alpha_obsd)" eelf64hppa.c: $(srcdir)/emulparams/elf64hppa.sh \ $(srcdir)/emulparams/hppa64linux.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} @@ -1195,12 +1521,14 @@ eelf64_aix.c: $(srcdir)/emulparams/elf64_aix.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_aix "$(tdir_elf64_aix)" eelf64_ia64.c: $(srcdir)/emulparams/elf64_ia64.sh \ - $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/ia64elf.em \ + $(srcdir)/emultempl/needrelax.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_ia64 "$(tdir_elf64_ia64)" eelf64_ia64_fbsd.c: $(srcdir)/emulparams/elf64_ia64_fbsd.sh \ $(srcdir)/emulparams/elf64_ia64.sh \ - $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \ + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/ia64elf.em \ + $(srcdir)/emultempl/needrelax.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_ia64_fbsd "$(tdir_elf64_ia64_fbsd)" eelf64_s390.c: $(srcdir)/emulparams/elf64_s390.sh \ @@ -1218,7 +1546,7 @@ eelf64_sparc_obsd.c: $(srcdir)/emulparams/elf64_sparc_obsd.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64_sparc_obsd "$(tdir_elf64_sparc_obsd)" eelf64bmip.c: $(srcdir)/emulparams/elf64bmip.sh \ - $(srcdir)/emulparams/elf32bmipn32.sh \ + $(srcdir)/emulparams/elf32bmipn32.sh $(srcdir)/emultempl/irix.em \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64bmip "$(tdir_elf64bmip)" eelf64mmix.c: $(srcdir)/emulparams/elf64mmix.sh \ @@ -1233,6 +1561,10 @@ eelf64btsmip.c: $(srcdir)/emulparams/elf64btsmip.sh \ $(srcdir)/emulparams/elf32bmipn32.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf64btsmip "$(tdir_elf64btsmip)" +eelf64btsmip_obsd.c: $(srcdir)/emulparams/elf64btsmip_obsd.sh \ + $(srcdir)/emulparams/elf32bmipn32.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf64btsmip_obsd "$(tdir_elf64btsmip_obsd)" eelf64ltsmip.c: $(srcdir)/emulparams/elf64ltsmip.sh \ $(srcdir)/emulparams/elf64btsmip.sh $(srcdir)/emulparams/elf32bmipn32.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} @@ -1261,13 +1593,13 @@ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \ $(srcdir)/emulparams/elf_i386.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf_i386_fbsd "$(tdir_elf_i386_fbsd)" +eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)" eelf_i386_obsd.c: $(srcdir)/emulparams/elf_i386_obsd.sh \ $(srcdir)/emulparams/elf_i386.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf_i386_obsd "$(tdir_elf_i386_obsd)" -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)" @@ -1292,6 +1624,12 @@ eh8300hn.c: $(srcdir)/emulparams/h8300hn.sh \ eh8300sn.c: $(srcdir)/emulparams/h8300sn.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sn.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8300sn "$(tdir_h8300sn)" +eh8300sx.c: $(srcdir)/emulparams/h8300sx.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sx.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300sx "$(tdir_h8300sx)" +eh8300sxn.c: $(srcdir)/emulparams/h8300sxn.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sxn.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300sxn "$(tdir_h8300sxn)" eh8300elf.c: $(srcdir)/emulparams/h8300elf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8300elf "$(tdir_h8300elf)" @@ -1311,6 +1649,14 @@ eh8300snelf.c: $(srcdir)/emulparams/h8300snelf.sh \ $(srcdir)/emulparams/h8300elf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8300snelf "$(tdir_h8300snelf)" +eh8300sxelf.c: $(srcdir)/emulparams/h8300sxelf.sh \ + $(srcdir)/emulparams/h8300elf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300sxelf "$(tdir_h8300sxelf)" +eh8300sxnelf.c: $(srcdir)/emulparams/h8300sxnelf.sh \ + $(srcdir)/emulparams/h8300elf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300sxnelf "$(tdir_h8300sxnelf)" eh8500.c: $(srcdir)/emulparams/h8500.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8500 "$(tdir_h8500)" @@ -1385,15 +1731,15 @@ ei386msdos.c: $(srcdir)/emulparams/i386msdos.sh \ ei386nbsd.c: $(srcdir)/emulparams/i386nbsd.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} i386nbsd "$(tdir_i386nbsd)" -ei386obsd.c: $(srcdir)/emulparams/i386obsd.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} - ${GENSCRIPTS} i386obsd "$(tdir_i386obsd)" ei386nto.c: $(srcdir)/emulparams/i386nto.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} i386nto "$(tdir_i386nto)" ei386nw.c: $(srcdir)/emulparams/i386nw.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS} ${GENSCRIPTS} i386nw "$(tdir_i386nw)" +ei386obsd.c: $(srcdir)/emulparams/i386obsd.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} + ${GENSCRIPTS} i386obsd "$(tdir_i386obsd)" ei386pe.c: $(srcdir)/emulparams/i386pe.sh \ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS} ${GENSCRIPTS} i386pe "$(tdir_i386pe)" @@ -1404,16 +1750,20 @@ elnk960.c: $(srcdir)/emulparams/lnk960.sh \ $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS} ${GENSCRIPTS} lnk960 "$(tdir_lnk960)" em68hc11elf.c: $(srcdir)/emulparams/m68hc11elf.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \ + $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68hc11elf "$(tdir_m68hc11)" em68hc11elfb.c: $(srcdir)/emulparams/m68hc11elfb.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \ + $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68hc11elfb "$(tdir_m68hc11b)" em68hc12elf.c: $(srcdir)/emulparams/m68hc12elf.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \ + $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68hc12elf "$(tdir_m68hc12)" em68hc12elfb.c: $(srcdir)/emulparams/m68hc12elfb.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/m68hc1xelf.em $(srcdir)/emultempl/elf32.em \ + $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68hc12elfb "$(tdir_m68hc12b)" em68k4knbsd.c: $(srcdir)/emulparams/m68k4knbsd.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} @@ -1445,7 +1795,7 @@ em68klynx.c: $(srcdir)/emulparams/m68klynx.sh \ em68knbsd.c: $(srcdir)/emulparams/m68knbsd.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68knbsd "$(tdir_m68knbsd)" -em68kobsd.c: $(srcdir)/emulparams/m68kobsd.sh \ +em68kobsd.c: $(srcdir)/emulparams/m68kobsd.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} m68kobsd "$(tdir_m68kobsd)" em68kpsos.c: $(srcdir)/emulparams/m68kpsos.sh \ @@ -1485,175 +1835,200 @@ emn10300.c: $(srcdir)/emulparams/mn10300.sh \ emn10200.c: $(srcdir)/emulparams/mn10200.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} mn10200 "$(tdir_mn10200)" -emsp430x1101.c: $(srcdir)/emulparams/msp430x1101.sh \ +emsp430x110.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1101 "$(tdir_msp430x1101)" -emsp430x1111.c: $(srcdir)/emulparams/msp430x1111.sh \ + ${GENSCRIPTS} msp430x110 "$(tdir_msp430x110)" msp430all +emsp430x112.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1111 "$(tdir_msp430x1111)" -emsp430x1121.c: $(srcdir)/emulparams/msp430x1121.sh \ + ${GENSCRIPTS} msp430x112 "$(tdir_msp430x112)" msp430all +emsp430x1101.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1121 "$(tdir_msp430x1121)" -emsp430x1122.c: $(srcdir)/emulparams/msp430x1122.sh \ + ${GENSCRIPTS} msp430x1101 "$(tdir_msp430x1101)" msp430all +emsp430x1111.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1122 "$(tdir_msp430x1122)" -emsp430x1132.c: $(srcdir)/emulparams/msp430x1132.sh \ + ${GENSCRIPTS} msp430x1111 "$(tdir_msp430x1111)" msp430all +emsp430x1121.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1132 "$(tdir_msp430x1132)" -emsp430x1331.c: $(srcdir)/emulparams/msp430x1331.sh \ + ${GENSCRIPTS} msp430x1121 "$(tdir_msp430x1121)" msp430all +emsp430x1122.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1331 "$(tdir_msp430x1331)" -emsp430x1351.c: $(srcdir)/emulparams/msp430x1351.sh \ + ${GENSCRIPTS} msp430x1122 "$(tdir_msp430x1122)" msp430all +emsp430x1132.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1351 "$(tdir_msp430x1351)" -emsp430x149.c: $(srcdir)/emulparams/msp430x149.sh \ + ${GENSCRIPTS} msp430x1132 "$(tdir_msp430x1132)" msp430all +emsp430x122.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x149 "$(tdir_msp430x149)" -emsp430x148.c: $(srcdir)/emulparams/msp430x148.sh \ + ${GENSCRIPTS} msp430x122 "$(tdir_msp430x122)" msp430all +emsp430x123.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x148 "$(tdir_msp430x148)" -emsp430x449.c: $(srcdir)/emulparams/msp430x449.sh \ + ${GENSCRIPTS} msp430x123 "$(tdir_msp430x123)" msp430all +emsp430x1222.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x449 "$(tdir_msp430x449)" -emsp430x448.c: $(srcdir)/emulparams/msp430x448.sh \ + ${GENSCRIPTS} msp430x1222 "$(tdir_msp430x1222)" msp430all +emsp430x1232.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x448 "$(tdir_msp430x448)" -emsp430x447.c: $(srcdir)/emulparams/msp430x447.sh \ + ${GENSCRIPTS} msp430x1232 "$(tdir_msp430x1232)" msp430all +emsp430x133.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x447 "$(tdir_msp430x447)" -emsp430x412.c: $(srcdir)/emulparams/msp430x412.sh \ + ${GENSCRIPTS} msp430x133 "$(tdir_msp430x133)" msp430all +emsp430x135.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x412 "$(tdir_msp430x412)" -emsp430x413.c: $(srcdir)/emulparams/msp430x413.sh \ + ${GENSCRIPTS} msp430x135 "$(tdir_msp430x135)" msp430all +emsp430x1331.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x413 "$(tdir_msp430x413)" -emsp430x147.c: $(srcdir)/emulparams/msp430x147.sh \ + ${GENSCRIPTS} msp430x1331 "$(tdir_msp430x1331)" msp430all +emsp430x1351.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x147 "$(tdir_msp430x147)" -emsp430x135.c: $(srcdir)/emulparams/msp430x135.sh \ + ${GENSCRIPTS} msp430x1351 "$(tdir_msp430x1351)" msp430all +emsp430x147.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x135 "$(tdir_msp430x135)" -emsp430x133.c: $(srcdir)/emulparams/msp430x133.sh \ + ${GENSCRIPTS} msp430x147 "$(tdir_msp430x147)" msp430all +emsp430x148.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x133 "$(tdir_msp430x133)" -emsp430x110.c: $(srcdir)/emulparams/msp430x110.sh \ + ${GENSCRIPTS} msp430x148 "$(tdir_msp430x148)" msp430all +emsp430x149.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x110 "$(tdir_msp430x110)" -emsp430x112.c: $(srcdir)/emulparams/msp430x112.sh \ + ${GENSCRIPTS} msp430x149 "$(tdir_msp430x149)" msp430all +emsp430x155.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x112 "$(tdir_msp430x112)" -emsp430x122.c: $(srcdir)/emulparams/msp430x122.sh \ + ${GENSCRIPTS} msp430x155 "$(tdir_msp430x155)" msp430all +emsp430x156.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x122 "$(tdir_msp430x122)" -emsp430x1222.c: $(srcdir)/emulparams/msp430x1222.sh \ + ${GENSCRIPTS} msp430x156 "$(tdir_msp430x156)" msp430all +emsp430x157.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1222 "$(tdir_msp430x1222)" -emsp430x123.c: $(srcdir)/emulparams/msp430x123.sh \ + ${GENSCRIPTS} msp430x157 "$(tdir_msp430x157)" msp430all +emsp430x167.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x123 "$(tdir_msp430x123)" -emsp430x1232.c: $(srcdir)/emulparams/msp430x1232.sh \ + ${GENSCRIPTS} msp430x167 "$(tdir_msp430x167)" msp430all +emsp430x168.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x1232 "$(tdir_msp430x1232)" -emsp430x311.c: $(srcdir)/emulparams/msp430x311.sh \ + ${GENSCRIPTS} msp430x168 "$(tdir_msp430x168)" msp430all +emsp430x169.c: $(srcdir)/emulparams/msp430all.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ + ${GEN_DEPENDS} + ${GENSCRIPTS} msp430x169 "$(tdir_msp430x169)" msp430all +emsp430x311.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x311 "$(tdir_msp430x311)" -emsp430x312.c: $(srcdir)/emulparams/msp430x312.sh \ + ${GENSCRIPTS} msp430x311 "$(tdir_msp430x311)" msp430all +emsp430x312.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x312 "$(tdir_msp430x312)" -emsp430x313.c: $(srcdir)/emulparams/msp430x313.sh \ + ${GENSCRIPTS} msp430x312 "$(tdir_msp430x312)" msp430all +emsp430x313.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x313 "$(tdir_msp430x313)" -emsp430x314.c: $(srcdir)/emulparams/msp430x314.sh \ + ${GENSCRIPTS} msp430x313 "$(tdir_msp430x313)" msp430all +emsp430x314.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x314 "$(tdir_msp430x314)" -emsp430x315.c: $(srcdir)/emulparams/msp430x315.sh \ + ${GENSCRIPTS} msp430x314 "$(tdir_msp430x314)" msp430all +emsp430x315.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x315 "$(tdir_msp430x315)" -emsp430x323.c: $(srcdir)/emulparams/msp430x323.sh \ + ${GENSCRIPTS} msp430x315 "$(tdir_msp430x315)" msp430all +emsp430x323.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x323 "$(tdir_msp430x323)" -emsp430x325.c: $(srcdir)/emulparams/msp430x325.sh \ + ${GENSCRIPTS} msp430x323 "$(tdir_msp430x323)" msp430all +emsp430x325.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x325 "$(tdir_msp430x325)" -emsp430x336.c: $(srcdir)/emulparams/msp430x336.sh \ + ${GENSCRIPTS} msp430x325 "$(tdir_msp430x325)" msp430all +emsp430x336.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x336 "$(tdir_msp430x336)" -emsp430x337.c: $(srcdir)/emulparams/msp430x337.sh \ + ${GENSCRIPTS} msp430x336 "$(tdir_msp430x336)" msp430all +emsp430x337.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430_3.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x337 "$(tdir_msp430x337)" -emsp430x435.c: $(srcdir)/emulparams/msp430x435.sh \ + ${GENSCRIPTS} msp430x337 "$(tdir_msp430x337)" msp430all +emsp430x412.c: $(srcdir)/emulparams/msp430all.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ + ${GEN_DEPENDS} + ${GENSCRIPTS} msp430x412 "$(tdir_msp430x412)" msp430all +emsp430x413.c: $(srcdir)/emulparams/msp430all.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ + ${GEN_DEPENDS} + ${GENSCRIPTS} msp430x413 "$(tdir_msp430x413)" msp430all +emsp430xE423.c: $(srcdir)/emulparams/msp430all.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ + ${GEN_DEPENDS} + ${GENSCRIPTS} msp430xE423 "$(tdir_msp430xE423)" msp430all +emsp430xE425.c: $(srcdir)/emulparams/msp430all.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ + ${GEN_DEPENDS} + ${GENSCRIPTS} msp430xE425 "$(tdir_msp430xE425)" msp430all +emsp430xE427.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x435 "$(tdir_msp430x435)" -emsp430x436.c: $(srcdir)/emulparams/msp430x436.sh \ + ${GENSCRIPTS} msp430xE427 "$(tdir_msp430xE427)" msp430all +emsp430xW423.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x436 "$(tdir_msp430x436)" -emsp430x437.c: $(srcdir)/emulparams/msp430x437.sh \ + ${GENSCRIPTS} msp430xW423 "$(tdir_msp430xW423)" msp430all +emsp430xW425.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x437 "$(tdir_msp430x437)" -emsp430x167.c: $(srcdir)/emulparams/msp430x167.sh \ + ${GENSCRIPTS} msp430xW425 "$(tdir_msp430xW425)" msp430all +emsp430xW427.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x167 "$(tdir_msp430x167)" -emsp430x168.c: $(srcdir)/emulparams/msp430x167.sh \ + ${GENSCRIPTS} msp430xW427 "$(tdir_msp430xW427)" msp430all +emsp430x435.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x168 "$(tdir_msp430x168)" -emsp430x169.c: $(srcdir)/emulparams/msp430x169.sh \ + ${GENSCRIPTS} msp430x435 "$(tdir_msp430x435)" msp430all +emsp430x436.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x169 "$(tdir_msp430x169)" -emsp430x155.c: $(srcdir)/emulparams/msp430x155.sh \ + ${GENSCRIPTS} msp430x436 "$(tdir_msp430x436)" msp430all +emsp430x437.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x155 "$(tdir_msp430x155)" -emsp430x156.c: $(srcdir)/emulparams/msp430x156.sh \ + ${GENSCRIPTS} msp430x437 "$(tdir_msp430x437)" msp430all +emsp430x447.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x156 "$(tdir_msp430x156)" -emsp430x157.c: $(srcdir)/emulparams/msp430x157.sh \ + ${GENSCRIPTS} msp430x447 "$(tdir_msp430x447)" msp430all +emsp430x448.c: $(srcdir)/emulparams/msp430all.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ ${GEN_DEPENDS} - ${GENSCRIPTS} msp430x157 "$(tdir_msp430x157)" + ${GENSCRIPTS} msp430x448 "$(tdir_msp430x448)" msp430all +emsp430x449.c: $(srcdir)/emulparams/msp430all.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32msp430.sc \ + ${GEN_DEPENDS} + ${GENSCRIPTS} msp430x449 "$(tdir_msp430x449)" msp430all enews.c: $(srcdir)/emulparams/news.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} news "$(tdir_news)" ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/netbsd.em \ + $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} ns32knbsd "$(tdir_ns32knbsd)" eor32.c: $(srcdir)/emulparams/or32.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/or32.sc ${GEN_DEPENDS} @@ -1789,7 +2164,7 @@ esparclynx.c: $(srcdir)/emulparams/sparclynx.sh \ esparcnbsd.c: $(srcdir)/emulparams/sparcnbsd.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} sparcnbsd "$(tdir_sparcnbsd)" -esparcobsd.c: $(srcdir)/emulparams/sparcobsd.sh \ +esparcobsd.c: $(srcdir)/emulparams/sparcobsd.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} sparcobsd "$(tdir_sparcobsd)" est2000.c: $(srcdir)/emulparams/st2000.sh \ @@ -1846,6 +2221,10 @@ ez8001.c: $(srcdir)/emulparams/z8001.sh \ ez8002.c: $(srcdir)/emulparams/z8002.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS} ${GENSCRIPTS} z8002 "$(tdir_z8002)" +eelf32frvfd.c: $(srcdir)/emulparams/elf32frvfd.sh \ + $(srcdir)/emulparams/elf32frv.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf32frvfd "$(tdir_frv)" # The generated emulation files mostly have the same dependencies. $(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \ @@ -2043,22 +2422,22 @@ dep-am: DEP @MAINT@ $(srcdir)/mpw-esh.c $(srcdir)/mpw-idtmips.c @MAINT@ @MAINT@$(srcdir)/mpw-ei386go32.c: ei386go32.c -@MAINT@ $(srcdir)/../move-if-change $< $@ +@MAINT@ $(SHELL) $(srcdir)/../move-if-change $< $@ @MAINT@ @MAINT@$(srcdir)/mpw-elfmips.c: eelf32ebmip.c -@MAINT@ $(srcdir)/../move-if-change $< $@ +@MAINT@ $(SHELL) $(srcdir)/../move-if-change $< $@ @MAINT@ @MAINT@$(srcdir)/mpw-em68kcoff.c: em68kcoff.c -@MAINT@ $(srcdir)/../move-if-change $< $@ +@MAINT@ $(SHELL) $(srcdir)/../move-if-change $< $@ @MAINT@ @MAINT@$(srcdir)/mpw-eppcmac.c: eppcmacos.c -@MAINT@ $(srcdir)/../move-if-change $< $@ +@MAINT@ $(SHELL) $(srcdir)/../move-if-change $< $@ @MAINT@ @MAINT@$(srcdir)/mpw-esh.c: esh.c -@MAINT@ $(srcdir)/../move-if-change $< $@ +@MAINT@ $(SHELL) $(srcdir)/../move-if-change $< $@ @MAINT@ @MAINT@$(srcdir)/mpw-idtmips.c: emipsidt.c -@MAINT@ $(srcdir)/../move-if-change $< $@ +@MAINT@ $(SHELL) $(srcdir)/../move-if-change $< $@ # What appears below is generated by a hacked mkdep using gcc -MM. @@ -2087,7 +2466,8 @@ ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldmain.h \ ldexp.h ldlang.h ldgram.h ldlex.h ldmisc.h ldctor.h \ - ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h + ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h \ + $(INCDIR)/hashtab.h ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h $(INCDIR)/progress.h \ @@ -2095,18 +2475,19 @@ ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ ldmain.h ldmisc.h ldwrite.h ldexp.h ldlang.h ldgram.h \ ldlex.h ldfile.h ldemul.h ldctor.h ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/libiberty.h $(INCDIR)/demangle.h ld.h $(INCDIR)/bin-bugs.h \ - ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h \ - ldfile.h + $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h sysdep.h config.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \ + ld.h $(INCDIR)/bin-bugs.h ldmisc.h ldexp.h ldlang.h \ + ldgram.h ldlex.h ldmain.h ldfile.h ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h ../bfd/bfdver.h sysdep.h config.h \ $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h ldver.h \ ldexp.h ldlang.h ldfile.h ldemul.h ldmain.h ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h \ - ldexp.h ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + ld.h $(INCDIR)/bin-bugs.h ldexp.h ldlang.h ldwrite.h \ + ldmisc.h ldgram.h ldmain.h lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h \ @@ -2131,7 +2512,7 @@ ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \ ldver.h ldlang.h ldfile.h ldemul.h ldmisc.h ldmain.h \ mri.h ldctor.h ldlex.h -ldlex.o: ldlex.c $(INCDIR)/ansidecl.h ../bfd/bfd.h \ +ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h \ ldmisc.h ldexp.h ldlang.h ldgram.h ldfile.h ldlex.h \ diff --git a/gnu/usr.bin/binutils/ld/NEWS b/gnu/usr.bin/binutils/ld/NEWS index cfaf1860292..81512c4fb4b 100644 --- a/gnu/usr.bin/binutils/ld/NEWS +++ b/gnu/usr.bin/binutils/ld/NEWS @@ -1,5 +1,20 @@ -*- text -*- +* The linker script operator DEFINED() will now yield 1 only for a symbol that + is defined before the statement where DEFINED is used. + +* The MIPS --embedded-relocs (used to embed relocations into binaries for + Embedded-PIC code) is deprecated and will be removed in a future release. + +* m32r Linux (ELF) support added by Renesas. + +* Improved linker's handling of unresolved symbols. The switch + --unresolved-symbols=<method> has been added to tell the linker when it + should report them and the switch --warn-unresolved-symbols has been added to + make reports be issued as warning messages rather than errors. + +Changes in 2.14: + * Added support for Xtensa architecture. * Added --with-sysroot configure switch to specify a target system root, for @@ -170,7 +185,7 @@ not copied into the output file. This is used by glibc. * When an ELF section named .gnu.warning.SYMBOL is encountered in an input file, and the symbol SYMBOL is referenced by some object file, the contents of the section are displayed as an error message. The section is not copied into -the output file, unless doing a relocateable or shared link. This is used by +the output file, unless doing a relocatable or shared link. This is used by glibc. * New options -split-by-reloc and -split-by-file. @@ -193,7 +208,7 @@ Changes in version 2.5: * The linker now supports linking against SunOS shared libraries. It still can not link SunOS PIC (Position Independent Code) files, so it can not be used to -generate shared libaries. +generate shared libraries. * The linker now supports linking against ELF shared libraries for the i386 (UnixWare) and SPARC (Solaris). It can also link ELF PIC files, and can be diff --git a/gnu/usr.bin/binutils/ld/configure.host b/gnu/usr.bin/binutils/ld/configure.host index e923a33531d..2db1806db2d 100644 --- a/gnu/usr.bin/binutils/ld/configure.host +++ b/gnu/usr.bin/binutils/ld/configure.host @@ -10,7 +10,7 @@ HDEFINES= HOSTING_CRT0=/lib/crt0.o -HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libgcc=\`${CC} -print-libgcc-file-name\`; fi; if [ -f ../gcc/libgcc_eh.a ]; then libgcc="$libgcc ../gcc/libgcc_eh.a"; else libgcc_eh=\`${CC} -print-file-name=libgcc_eh.a\`; if [ x"$libgcc_eh" != xlibgcc_eh.a ]; then libgcc="$libgcc $libgcc_eh"; fi; fi; echo $libgcc -lc $libgcc`' +HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libgcc=\`${CC} -print-libgcc-file-name\`; fi; if [ -f ../gcc/libgcc_eh.a ]; then libgcc="$libgcc ../gcc/libgcc_eh.a"; else libgcc_eh=\`${CC} -print-file-name=libgcc_eh.a\`; if [ x"$libgcc_eh" != xlibgcc_eh.a ]; then libgcc="$libgcc $libgcc_eh"; fi; fi; echo --start-group $libgcc -lc --end-group`' # # Generic configurations: @@ -18,19 +18,11 @@ HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libg case "${host}" in -*-*-freebsd*) - # Older versions of gcc do not use a specs file. In those cases, - # gcc -print-file-name=specs will simply print specs. We create a - # dummy specs files to handle this. - echo "-dynamic-linker `${CC} --print-file-name=ld-elf.so.1`" > specs - HOSTING_CRT0='-dynamic-linker `${CC} --print-prog-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`' +*-*-freebsd* | *-*-kfreebsd*-gnu) + HOSTING_CRT0='-dynamic-linker `[ -f \`${CC} --print-prog-name=ld-elf.so.1\` ] || echo /usr/libexec/``${CC} --print-prog-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`' HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`' ;; -*-*-openbsd*) - HOSTING_CRT0=/usr/lib/crt0.o - ;; - *-*-linux*aout* | *-*-linux*oldld) HOSTING_CRT0=/usr/lib/crt0.o ;; @@ -45,6 +37,40 @@ case "${host}" in HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`' ;; +*-*-netbsd*) + # Different versions of NetBSD with the ELF object format use different + # sets of start/end files. + HOSTING_CRT0='-dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o' + if [ -f `${CC} --print-file-name=crti.o` ]; then + # Support for GCC's crtstuff present. + HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crti.o`" + if [ -f ../gcc/crtbegin.o ]; then + HOSTING_CRT0="$HOSTING_CRT0 ../gcc/crtbegin.o" + else + HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crtbegin.o`" + fi + else + # Support for GCC's crtstuff not present. + HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crtbegin.o`" + fi + if [ -f `${CC} --print-file-name=crtn.o` ]; then + # Support for GCC's crtstuff present. + if [ -f ../gcc/crtbegin.o ]; then + HOSTING_LIBS="$HOSTING_LIBS ../gcc/crtend.o" + else + HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtend.o`" + fi + HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtn.o`" + else + # Support for GCC's crtstuff not present. + HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtend.o`" + fi + ;; + +*-*-openbsd*) + HOSTING_CRT0=/usr/lib/crt0.o + ;; + esac # @@ -57,45 +83,45 @@ case "${host}" in # No further tweaking needed ;; -alpha*-*-netbsd*) - HOSTING_CRT0=/usr/lib/crt0.o +am33_2.0-*-linux*) + HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"` ;; arm*-*-linux-gnu*) - HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux,g"` + HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"` ;; hppa*64*-*-hpux11*) HOSTING_CRT0=/usr/ccs/lib/pa20_64/crt0.o # Even if CC is not gcc, the tests use gcc. - HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else if test "$GCC" = yes; then ${CC} --print-libgcc-file-name; else gcc --print-libgcc-file-name; fi fi` -lc /usr/lib/pa20_64/milli.a' + HOSTING_LIBS='--start-group `if [ -f ../gcc/libgcc.a ]; then echo ../gcc/libgcc.a; else if test "$GCC" = yes; then ${CC} --print-libgcc-file-name; else gcc --print-libgcc-file-name; fi fi` -lc --end-group /usr/lib/pa20_64/milli.a' ;; -i[3456]86-*-bsd* | i[34567]86-*-freebsd[12] | i[34567]86-*-freebsd[12]\.* | i[34567]86-*-freebsd*aout* | i[3456]86-*-netbsd*) +i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[12] | i[3-7]86-*-freebsd[12]\.* | i[3-7]86-*-freebsd*aout*) HOSTING_CRT0=/usr/lib/crt0.o ;; -i[3456]86-*-sysv4*) +i[3-7]86-*-sysv4*) HOSTING_CRT0='/usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /usr/ccs/lib/crtn.o' ;; -i[3456]86-sequent-ptx* | i[3456]86-sequent-sysv*) +i[3-7]86-sequent-ptx* | i[3-7]86-sequent-sysv*) HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`' ;; -i[3456]86-*-sysv*) +i[3-7]86-*-sysv*) HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; fi`' HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; fi` /lib/crtn.o' ;; -i[3456]86-*-solaris*) +i[3-7]86-*-solaris*) HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else ${CC} -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else ${CC} -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`' ;; -i[3456]86-*-sco* | i[3456]86-*-isc*) +i[3-7]86-*-sco* | i[3-7]86-*-isc*) # In some configurations gcc does not use crtbegin.o and crtend.o. # In that case gcc -print-file-name=crtbegin.o will simply print # crtbegin.o. We create dummy crtbegin.o and crtend.o files to @@ -110,17 +136,17 @@ i[3456]86-*-sco* | i[3456]86-*-isc*) HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /lib/crtn.o' ;; -i[3456]86-*-lynxos*) +i[3-7]86-*-lynxos*) HOSTING_CRT0=/lib/init1.o HOSTING_LIBS="$HOSTING_LIBS"' -lm /lib/initn.o' ;; -i[3456]86-pc-interix*) +i[3-7]86-pc-interix*) HOSTING_CRT0='$$INTERIX_ROOT/usr/lib/crt0.o' HOSTING_LIBS='-L $$X/local_bin -L $$INTERIX_ROOT/usr/lib '"$HOSTING_LIBS"' -lcpsx -lc -lcpsx $$INTERIX_ROOT/usr/lib/psxdll.a $$INTERIX_ROOT/usr/lib/psxdll2.a' ;; -i[3456]86-*-cygwin*) +i[3-7]86-*-cygwin*) HOSTING_LIBS="$HOSTING_LIBS"' -lcygwin -L/usr/lib/w32api -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`' ;; @@ -133,10 +159,6 @@ ia64-*-aix*) HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`' ;; -mips*-dec-bsd*) - HOSTING_CRT0=/usr/lib/crt0.o - ;; - mips*-sgi-irix4* | mips*-sgi-irix5*) HOSTING_CRT0=/usr/lib/crt1.o HOSTING_LIBS="$HOSTING_LIBS"' /usr/lib/crtn.o' @@ -213,19 +235,16 @@ x86_64-*-linux-gnu*) HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld-linux-x86-64.so.2,"` ;; -*-*-freebsd*) - ;; - -*-*-openbsd*) +*-*-freebsd* | *-*-kfreebsd*-gnu) ;; *-*-linux*) ;; *-*-netbsd*) - # NetBSD typically does not use the GCC crtstuff, so ignore it. - HOSTING_CRT0='-dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o /usr/lib/crtbegin.o' - HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` /usr/lib/crtend.o' + ;; + +*-*-openbsd*) ;; alpha*-*-*) diff --git a/gnu/usr.bin/binutils/ld/configure.tgt b/gnu/usr.bin/binutils/ld/configure.tgt index 4429e0f6d85..1767cc1c8f3 100644 --- a/gnu/usr.bin/binutils/ld/configure.tgt +++ b/gnu/usr.bin/binutils/ld/configure.tgt @@ -16,6 +16,7 @@ targ_extra_emuls= targ_extra_ofiles= case "${targ}" in +am33_2.0-*-linux*) targ_emul=elf32am33lin ;; arm-epoc-pe) targ_emul=arm_epoc_pe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;; arm-*-wince) targ_emul=armpe ; @@ -23,11 +24,12 @@ arm-*-wince) targ_emul=armpe ; arm-*-pe) targ_emul=armpe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;; arc-*-elf*) targ_emul=arcelf ;; -avr-*-*) targ_emul=avr85xx - targ_extra_emuls="avr1200 avr23xx avr44x4 avr4433 avrmega603 avrmega103 avrmega161 avr1 avr2 avr3 avr4 avr5" ;; +avr-*-*) targ_emul=avr2 + targ_extra_emuls="avr1 avr3 avr4 avr5" ;; cris-*-*aout*) targ_emul=crisaout targ_extra_emuls="criself crislinux" targ_extra_libpath=$targ_extra_emuls ;; +cris-*-linux-gnu*) targ_emul=crislinux ;; cris-*-*) targ_emul=criself targ_extra_emuls="crisaout crislinux" targ_extra_libpath=$targ_extra_emuls ;; @@ -46,7 +48,7 @@ sparc*-*-aout) targ_emul=sparcaout ;; sparc*-*-coff) targ_emul=coff_sparc ;; sparc*-*-elf) targ_emul=elf32_sparc ;; sparc*-*-sysv4*) targ_emul=elf32_sparc ;; -sparc64-*-freebsd* | sparcv9-*-freebsd*) +sparc64-*-freebsd* | sparcv9-*-freebsd* | sparc64-*-kfreebsd*-gnu | sparcv9-*-kfreebsd*-gnu) targ_emul=elf64_sparc_fbsd targ_extra_emuls="elf64_sparc elf32_sparc" targ_extra_libpath=$targ_extra_emuls @@ -78,9 +80,9 @@ sparc64-*-netbsd*) targ_emul=elf64_sparc sparc64-*-openbsd*) targ_emul=elf64_sparc_obsd ;; sparc*-*-netbsd*elf*) targ_emul=elf32_sparc ;; sparc*-*-netbsd*) targ_emul=sparcnbsd ;; -sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1]) +sparc-*-openbsd[0-2].*| sparc-*-openbsd3.[0-1]) targ_emul=sparcobsd ;; -sparc*-*-openbsd*) targ_emul=elf32_sparc_obsd ;; +sparc-*-openbsd*) targ_emul=elf32_sparc_obsd ;; sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*) targ_emul=elf32_sparc ;; sparc-*-solaris2*) targ_emul=elf32_sparc @@ -99,6 +101,7 @@ sparc*-wrs-vxworks*) targ_emul=sparcaout ;; sparc*-*-rtemsaout*) targ_emul=sparcaout ;; sparc*-*-rtemself*) targ_emul=elf32_sparc ;; sparc*-*-rtems*) targ_emul=elf32_sparc ;; +i860-*-coff) targ_emul=coff_i860 ;; i860-stardent-sysv4* | i860-stardent-elf*) targ_emul=elf32_i860 ;; i960-wrs-vxworks5.0*) targ_emul=gld960 ;; @@ -109,12 +112,16 @@ i960-intel-nindy) targ_emul=gld960 ;; i960-*-rtems*) targ_emul=gld960coff ;; i960-*-elf*) targ_emul=elf32_i960 ;; ia64-*-elf*) targ_emul=elf64_ia64 ;; -ia64-*-freebsd*) targ_emul=elf64_ia64_fbsd +ia64-*-freebsd* | ia64-*-kfreebsd*-gnu) + targ_emul=elf64_ia64_fbsd targ_extra_emuls="elf64_ia64" ;; ia64-*-netbsd*) targ_emul=elf64_ia64 ;; ia64-*-linux*) targ_emul=elf64_ia64 ;; ia64-*-aix*) targ_emul=elf64_aix ;; -m32r-*-*) targ_emul=m32relf ;; +m32r*le-*-elf*) targ_emul=m32rlelf ;; +m32r*-*-elf*) targ_emul=m32relf ;; +m32r*le-*-linux-gnu*) targ_emul=m32rlelf_linux ;; +m32r*-*-linux-gnu*) targ_emul=m32relf_linux ;; m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;; m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf @@ -125,30 +132,30 @@ m68*-ericsson-ose) targ_emul=sun3 ;; m68*-apple-aux*) targ_emul=m68kaux ;; *-tandem-none) targ_emul=st2000 ;; i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;; -i[3456]86-*-nto-qnx*) targ_emul=i386nto ;; -i[3456]86-*-vsta) targ_emul=vsta ;; -i[3456]86-go32-rtems*) targ_emul=i386go32 ;; -i[3456]86-*-go32) targ_emul=i386go32 ;; -i[3456]86-*-msdosdjgpp*) targ_emul=i386go32 ;; -i[3456]86-*-aix*) targ_emul=i386coff ;; -i[3456]86-*-sco*) targ_emul=i386coff ;; -i[3456]86-*-isc*) targ_emul=i386coff ;; -i[3456]86-*-lynxos*) targ_emul=i386lynx ;; -i[3456]86-*-coff) targ_emul=i386coff ;; -i[3456]86-*-rtemscoff*) targ_emul=i386coff ;; -i[3456]86-*-rtemself*) targ_emul=elf_i386 ;; -i[3456]86-*-rtems*) targ_emul=elf_i386 ;; -i[3456]86-*-aros*) targ_emul=elf_i386 ;; -i[3456]86-*-bsd) targ_emul=i386bsd ;; -i[3456]86-*-bsd386) targ_emul=i386bsd ;; -i[3456]86-*-bsdi*) targ_emul=i386bsd ;; -i[3456]86-*-aout) targ_emul=i386aout ;; -i[3456]86-*-linux*aout*) targ_emul=i386linux +i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;; +i[3-7]86-*-vsta) targ_emul=vsta ;; +i[3-7]86-go32-rtems*) targ_emul=i386go32 ;; +i[3-7]86-*-go32) targ_emul=i386go32 ;; +i[3-7]86-*-msdosdjgpp*) targ_emul=i386go32 ;; +i[3-7]86-*-aix*) targ_emul=i386coff ;; +i[3-7]86-*-sco*) targ_emul=i386coff ;; +i[3-7]86-*-isc*) targ_emul=i386coff ;; +i[3-7]86-*-lynxos*) targ_emul=i386lynx ;; +i[3-7]86-*-coff) targ_emul=i386coff ;; +i[3-7]86-*-rtemscoff*) targ_emul=i386coff ;; +i[3-7]86-*-rtemself*) targ_emul=elf_i386 ;; +i[3-7]86-*-rtems*) targ_emul=elf_i386 ;; +i[3-7]86-*-aros*) targ_emul=elf_i386 ;; +i[3-7]86-*-bsd) targ_emul=i386bsd ;; +i[3-7]86-*-bsd386) targ_emul=i386bsd ;; +i[3-7]86-*-bsdi*) targ_emul=i386bsd ;; +i[3-7]86-*-aout) targ_emul=i386aout ;; +i[3-7]86-*-linux*aout*) targ_emul=i386linux targ_extra_emuls=elf_i386 tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'` ;; -i[3456]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;; -i[3456]86-*-linux-gnu*) targ_emul=elf_i386 +i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;; +i[3-7]86-*-linux-gnu*) targ_emul=elf_i386 targ_extra_emuls=i386linux if test x${want64} = xtrue; then targ_extra_emuls="$targ_extra_emuls elf_x86_64" @@ -161,31 +168,26 @@ x86_64-*-linux-gnu*) targ_emul=elf_x86_64 tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'` tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'` ;; -i[3456]86-*-sysv[45]*) targ_emul=elf_i386 ;; -i[3456]86-*-solaris2*) targ_emul=elf_i386_ldso +i[3-7]86-*-sysv[45]*) targ_emul=elf_i386 ;; +i[3-7]86-*-solaris2*) targ_emul=elf_i386_ldso targ_extra_emuls="elf_i386" ;; -i[3456]86-*-unixware) targ_emul=elf_i386 ;; -i[3456]86-*-solaris*) targ_emul=elf_i386_ldso +i[3-7]86-*-unixware) targ_emul=elf_i386 ;; +i[3-7]86-*-solaris*) targ_emul=elf_i386_ldso targ_extra_emuls="elf_i386" ;; -i[3456]86-*-netbsdelf*) targ_emul=elf_i386 +i[3-7]86-*-netbsdelf* | \ +i[3-7]86-*-netbsd*-gnu* | \ +i[3-7]86-*-knetbsd*-gnu) + targ_emul=elf_i386 targ_extra_emuls=i386nbsd ;; -i[3456]86-*-netbsdpe*) targ_emul=i386pe +i[3-7]86-*-netbsdpe*) targ_emul=i386pe targ_extra_ofiles="deffilep.o pe-dll.o" ;; -i[3456]86-*-netbsd*) targ_emul=i386nbsd +i[3-7]86-*-netbsd*) targ_emul=i386nbsd targ_extra_emuls=elf_i386 ;; -i[3456]86-*-openbsd[0-2].* | i[3456]86-*-openbsd3.[0-2]) - targ_emul=i386obsd ;; -i[3456]86-*-openbsd*) targ_emul=elf_i386_obsd ;; -x86_64-*-openbsd*) targ_emul=elf_x86_64_obsd - targ_extra_emuls="elf_i386_obsd elf_i386" - tdir_elf_i386_obsd=`echo ${targ_alias} \ - | sed -e 's/x86_64/i386/'` - ;; x86_64-*-netbsd*) targ_emul=elf_x86_64 targ_extra_emuls="elf_i386 i386nbsd" tdir_elf_i386=`echo ${targ_alias} | \ @@ -198,39 +200,49 @@ x86_64-*-netbsd*) targ_emul=elf_x86_64 ;; esac ;; -i[3456]86-*-netware) targ_emul=i386nw ;; -i[3456]86-*-elf*) targ_emul=elf_i386 ;; -i[3456]86-*-kaos*) targ_emul=elf_i386 ;; -i[3456]86-*-freebsdaout* | i[3456]86-*-freebsd[12].* | i[3456]86-*-freebsd[12]) +i[3-7]86-*-netware) targ_emul=i386nw ;; +i[3-7]86-*-elf*) targ_emul=elf_i386 ;; +i[3-7]86-*-kaos*) targ_emul=elf_i386 ;; +i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | i[3-7]86-*-freebsd[12]) targ_emul=i386bsd ;; -i[3456]86-*-freebsd*) targ_emul=elf_i386_fbsd +i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu) + targ_emul=elf_i386_fbsd targ_extra_emuls="elf_i386 i386bsd" ;; -x86_64-*-freebsd*) targ_emul=elf_x86_64_fbsd +x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) + targ_emul=elf_x86_64_fbsd targ_extra_emuls="elf_i386_fbsd elf_x86_64 elf_i386" tdir_elf_i386=`echo ${targ_alias} \ | sed -e 's/x86_64/i386/'` ;; -i[3456]86-*-sysv*) targ_emul=i386coff ;; -i[3456]86-*-ptx*) targ_emul=i386coff ;; -i[3456]86-*-mach*) targ_emul=i386mach ;; -i[3456]86-*-gnu*) targ_emul=elf_i386 ;; -i[3456]86-*-msdos*) targ_emul=i386msdos; targ_extra_emuls=i386aout ;; -i[3456]86-*-moss*) targ_emul=i386moss; targ_extra_emuls=i386msdos ;; -i[3456]86-*-winnt*) targ_emul=i386pe ; +i[3-7]86-*-openbsd[0-2]* | i[3-7]86-*-openbsd3.[0-2]) + targ_emul=i386obsd ;; +i[3-7]86-*-openbsd*) targ_emul=elf_i386_obsd ;; +x86_64-*-openbsd*) targ_emul=elf_x86_64_obsd + targ_extra_emuls="elf_i386_obsd elf_i386" + tdir_elf_i386_obsd=`echo ${targ_alias} | \ + sed -e 's/x86_64/i386/'` + ;; +i[3-7]86-*-sysv*) targ_emul=i386coff ;; +i[3-7]86-*-ptx*) targ_emul=i386coff ;; +i[3-7]86-*-mach*) targ_emul=i386mach ;; +i[3-7]86-*-gnu*) targ_emul=elf_i386 ;; +i[3-7]86-*-msdos*) targ_emul=i386msdos; targ_extra_emuls=i386aout ;; +i[3-7]86-*-moss*) targ_emul=i386moss; targ_extra_emuls=i386msdos ;; +i[3-7]86-*-winnt*) targ_emul=i386pe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;; -i[3456]86-*-pe) targ_emul=i386pe ; +i[3-7]86-*-pe) targ_emul=i386pe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;; -i[3456]86-*-cygwin*) targ_emul=i386pe ; +i[3-7]86-*-cygwin*) targ_emul=i386pe ; targ_extra_ofiles="deffilep.o pe-dll.o" test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api' ;; -i[3456]86-*-mingw32*) targ_emul=i386pe ; +i[3-7]86-*-mingw32*) targ_emul=i386pe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;; -i[3456]86-*-interix*) targ_emul=i386pe_posix; +i[3-7]86-*-interix*) targ_emul=i386pe_posix; targ_extra_ofiles="deffilep.o pe-dll.o" ;; -i[3456]86-*-beospe*) targ_emul=i386beos ;; -i[3456]86-*-beos*) targ_emul=elf_i386_be ;; -i[3456]86-*-vxworks*) targ_emul=i386aout ;; -i[3456]86-*-chaos) targ_emul=elf_i386_chaos ;; +i[3-7]86-*-beospe*) targ_emul=i386beos ;; +i[3-7]86-*-beos*) targ_emul=elf_i386_be ;; +i[3-7]86-*-vxworks*) targ_emul=elf_i386 ;; +i[3-7]86-*-chaos) targ_emul=elf_i386_chaos ;; m8*-*-*) targ_emul=m88kbcs ;; a29k-*-udi) targ_emul=sa29200 ;; a29k-*-ebmon) targ_emul=ebmon29k ;; @@ -239,8 +251,8 @@ a29k-*-*) targ_emul=a29k ;; arm-*-aout | armel-*-aout) targ_emul=armaoutl ;; armeb-*-aout) targ_emul=armaoutb ;; arm-*-coff) targ_emul=armcoff ;; -arm-*-vxworks) targ_emul=armcoff ;; -arm-*-freebsd*) targ_emul=armelf_fbsd +arm-*-freebsd* | arm-*-kfreebsd*-gnu) + targ_emul=armelf_fbsd targ_extra_emuls="armelf" ;; armeb-*-netbsdelf*) targ_emul=armelfb_nbsd; targ_extra_emuls="armelf_nbsd armelf armnbsd" ;; @@ -254,10 +266,13 @@ armeb-*-openbsd*) targ_emul=armelfb_obsd arm-*-openbsd*) targ_emul=armelf_obsd targ_extra_emuls="armelfb_obsd" ;; arm-*-rtems*) targ_emul=armelf ;; -arm-*-elf) targ_emul=armelf ;; +armeb-*-elf) targ_emul=armelfb ;; +arm-*-elf | arm-*-vxworks) + targ_emul=armelf ;; arm-*-kaos*) targ_emul=armelf ;; arm9e-*-elf) targ_emul=armelf ;; arm-*-oabi) targ_emul=armelf_oabi ;; +arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;; arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; arm*-*-conix*) targ_emul=armelf ;; @@ -275,11 +290,11 @@ thumb-*-pe) targ_emul=armpe ; xscale-*-coff) targ_emul=armcoff ;; xscale-*-elf) targ_emul=armelf ;; h8300-*-hms* | h8300-*-coff* | h8300-*-rtems*) - targ_emul=h8300; targ_extra_emuls="h8300h h8300s h8300hn h8300sn" + targ_emul=h8300; targ_extra_emuls="h8300h h8300s h8300hn h8300sn h8300sx h8300sxn" ;; h8300-*-elf*) targ_emul=h8300elf; - targ_extra_emuls="h8300helf h8300self h8300hnelf h8300snelf" + targ_extra_emuls="h8300helf h8300self h8300hnelf h8300snelf h8300sxelf h8300sxnelf" ;; h8500-*-hms* | h8500-*-coff* | h8500-*-rtems*) targ_emul=h8500 @@ -319,7 +334,7 @@ sh64-*-netbsd*) targ_emul=shelf64_nbsd targ_extra_emuls="shlelf64_nbsd shelf32_nbsd shlelf32_nbsd shelf_nbsd shlelf_nbsd" ;; -sh*le-*-netbsdelf*) +sh*l*-*-netbsdelf*) targ_emul=shlelf_nbsd targ_extra_emuls=shelf_nbsd ;; @@ -331,7 +346,8 @@ shle*-*-elf* | sh[1234]*le*-*-elf | shle*-*-kaos*) targ_emul=shlelf targ_extra_emuls="shelf shl sh" ;; -sh-*-elf* | sh[1234]*-*-elf | sh-*-rtemself* | sh-*-kaos*) +sh-*-rtemscoff*) targ_emul=sh; targ_extra_emuls=shl ;; +sh-*-elf* | sh[1234]*-*-elf | sh-*-rtems* | sh-*-kaos* | sh-*-vxworks) targ_emul=shelf targ_extra_emuls="shlelf sh shl" ;; @@ -340,7 +356,7 @@ sh-*-nto*) targ_emul=shelf_nto ;; sh-*-pe) targ_emul=shpe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;; -sh-*-*|sh-*-rtems*) targ_emul=sh; targ_extra_emuls=shl ;; +sh-*-*) targ_emul=sh; targ_extra_emuls=shl ;; sh64le-*-elf*) targ_emul=shlelf targ_extra_emuls="shelf shlelf32 shelf32 shlelf64 shelf64" @@ -366,6 +382,7 @@ m68k-*-linux-gnu*) targ_emul=m68kelf targ_extra_emuls=m68klinux tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'` ;; +m68k-*-uclinux*) targ_emul=m68kelf ;; m68*-*-gnu*) targ_emul=m68kelf ;; m68*-*-lynxos*) targ_emul=m68klynx ;; m68*-*-netbsd*4k*) targ_emul=m68k4knbsd @@ -393,6 +410,7 @@ vax-*-netbsdelf*) targ_emul=elf32vax vax-*-netbsdaout* | vax-*-netbsd*) targ_emul=vaxnbsd targ_extra_emuls=elf32vax ;; +vax-*-linux-gnu*) targ_emul=elf32vax ;; mips*-*-pe) targ_emul=mipspe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;; mips*-dec-ultrix*) targ_emul=mipslit ;; @@ -405,15 +423,20 @@ mips*-sgi-irix6*) targ_emul=elf32bmipn32 mips*-sgi-irix*) targ_emul=mipsbig ;; mips*el-*-ecoff*) targ_emul=mipsidtl ;; mips*-*-ecoff*) targ_emul=mipsidt ;; -mips*-dec-bsd*) targ_emul=mipsbsd ;; mips*el-*-netbsd*) targ_emul=elf32lmip targ_extra_emuls="elf32bmip" ;; mips*-*-netbsd*) targ_emul=elf32bmip targ_extra_emuls="elf32lmip" ;; -mips*el-*-openbsd*) targ_emul=elf32lmip ;; -mips*-*-openbsd*) targ_emul=elf32bmip ;; +mips64*el-*-openbsd*) targ_emul=elf64ltsmip + targ_extra_emuls="elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip elf64btsmip" + ;; +mips64*-*-openbsd*) targ_emul=elf64btsmip_obsd + targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" + ;; +mips*el-*-openbsd*) targ_emul=elf32ltsmip ;; +mips*-*-openbsd*) targ_emul=elf32btsmip ;; mips*-*-bsd*) targ_emul=mipsbig ;; mips*vr4300el-*-elf*) targ_emul=elf32l4300 ;; mips*vr4300-*-elf*) targ_emul=elf32b4300 ;; @@ -426,7 +449,9 @@ mips*-*-elf*) targ_emul=elf32ebmip ;; mips*el-*-rtems*) targ_emul=elf32elmip ;; mips*-*-rtems*) targ_emul=elf32ebmip ;; mips*el-*-vxworks*) targ_emul=elf32elmip ;; -mips*-*-vxworks*) targ_emul=elf32ebmip ;; +mips*-*-vxworks*) targ_emul=elf32ebmip + targ_extra_emuls="elf32elmip" ;; +mips*-*-windiss) targ_emul=elf32mipswindiss ;; mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32 targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" ;; @@ -446,9 +471,10 @@ mmix-*-*) targ_emul=mmo ;; mn10200-*-*) targ_emul=mn10200 ;; mn10300-*-*) targ_emul=mn10300 ;; -msp430-*-*) targ_emul=msp430x149 - targ_extra_emuls="msp430x148 msp430x147 msp430x133 msp430x135 msp430x110 msp430x112 msp430x122 msp430x123 msp430x412 msp430x413 msp430x311 msp430x312 msp430x313 msp430x314 msp430x315 msp430x323 msp430x325 msp430x336 msp430x337 msp430x1101 msp430x1111 msp430x1121 msp430x1331 msp430x1351 msp430x435 msp430x436 msp430x437 msp430x447 msp430x448 msp430x449 msp430x1222 msp430x1232 msp430x169 msp430x168 msp430x167 msp430x155 msp430x156 msp430x157 msp430x1122 msp430x1132" ;; -alpha*-*-freebsd*) targ_emul=elf64alpha_fbsd +msp430-*-*) targ_emul=msp430x110 + targ_extra_emuls="msp430x112 msp430x1101 msp430x1111 msp430x1121 msp430x1122 msp430x1132 msp430x122 msp430x123 msp430x1222 msp430x1232 msp430x133 msp430x135 msp430x1331 msp430x1351 msp430x147 msp430x148 msp430x149 msp430x155 msp430x156 msp430x157 msp430x167 msp430x168 msp430x169 msp430x311 msp430x312 msp430x313 msp430x314 msp430x315 msp430x323 msp430x325 msp430x336 msp430x337 msp430x412 msp430x413 msp430xE423 msp430xE425 msp430xE427 msp430xW423 msp430xW425 msp430xW427 msp430x435 msp430x436 msp430x437 msp430x447 msp430x448 msp430x449" ;; +alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) + targ_emul=elf64alpha_fbsd targ_extra_emuls="elf64alpha alpha" tdir_alpha=`echo ${targ_alias} | sed -e 's/freebsd/freebsdecoff/'` ;; @@ -469,11 +495,12 @@ ns32k-*-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd ;; openrisc-*-*) targ_emul=elf32openrisc ;; or32-*-coff) targ_emul=or32 ;; or32-*-elf) targ_emul=or32elf ;; -or32-*-rtems) targ_emul=or32 ;; +or32-*-rtems*) targ_emul=or32elf ;; pdp11-*-*) targ_emul=pdp11 ;; pjl*-*-*) targ_emul=pjlelf ; targ_extra_emuls="elf_i386" ;; pj*-*-*) targ_emul=pjelf ;; -powerpc-*-freebsd*) targ_emul=elf32ppc_fbsd; +powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu) + targ_emul=elf32ppc_fbsd; targ_extra_emuls="elf32ppc elf32ppcsim"; targ_extra_libpath=elf32ppc; tdir_elf32ppcsim=`echo ${targ_alias} | sed -e 's/ppc/ppcsim/'` @@ -541,7 +568,8 @@ v850-*-*) targ_emul=v850 ;; v850e-*-*) targ_emul=v850 ;; v850ea-*-*) targ_emul=v850 ;; iq2000-*-elf) targ_emul=elf32iq2000 ; targ_extra_emuls="elf32iq10" ;; -frv-*-*) targ_emul=elf32frv ;; +frv-*-*linux*) targ_emul=elf32frvfd ;; +frv-*-*) targ_emul=elf32frv ; targ_extra_emuls="elf32frvfd" ;; w65-*-*) targ_emul=w65 ;; xstormy16-*-*) targ_emul=elf32xstormy16 ;; xtensa-*-*) targ_emul=elf32xtensa;; @@ -580,15 +608,15 @@ hppa*64*-*-hpux11*) NATIVE_LIB_DIRS=/usr/lib/pa20_64 ;; -i[3456]86-*-sysv4*) +i[3-7]86-*-sysv4*) NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib' ;; -i[3456]86-*-solaris*) +i[3-7]86-*-solaris*) NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib' ;; -i[3456]86-pc-interix*) +i[3-7]86-pc-interix*) NATIVE_LIB_DIRS='/usr/local/lib $$INTERIX_ROOT/usr/lib /lib /usr/lib' ;; diff --git a/gnu/usr.bin/binutils/ld/dep-in.sed b/gnu/usr.bin/binutils/ld/dep-in.sed index aad7d92d8be..83418e2ae87 100644 --- a/gnu/usr.bin/binutils/ld/dep-in.sed +++ b/gnu/usr.bin/binutils/ld/dep-in.sed @@ -8,6 +8,7 @@ s!@BFDDIR@!$(BFDDIR)!g s!@TOPDIR@/bfd!$(BFDDIR)!g s!@SRCDIR@/!!g s! \.\./bfd/hosts/[^ ]*\.h! !g +s! \.\./intl/libintl\.h!!g s/\\\n */ /g diff --git a/gnu/usr.bin/binutils/ld/emulparams/armpe.sh b/gnu/usr.bin/binutils/ld/emulparams/armpe.sh index 257c9ded5f5..aa605366e8c 100644 --- a/gnu/usr.bin/binutils/ld/emulparams/armpe.sh +++ b/gnu/usr.bin/binutils/ld/emulparams/armpe.sh @@ -1,8 +1,12 @@ ARCH=arm SCRIPT_NAME=pe + OUTPUT_FORMAT="pei-arm-little" LITTLE_OUTPUT_FORMAT="pei-arm-little" BIG_OUTPUT_FORMAT="pei-arm-big" + +RELOCATEABLE_OUTPUT_FORMAT="pe-arm-little" + TEMPLATE_NAME=pe ENTRY="_mainCRTStartup" SUBSYSTEM=PE_DEF_SUBSYSTEM diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32_sparc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32_sparc.sh index 15a837df28c..af23252949f 100644 --- a/gnu/usr.bin/binutils/ld/emulparams/elf32_sparc.sh +++ b/gnu/usr.bin/binutils/ld/emulparams/elf32_sparc.sh @@ -10,4 +10,5 @@ MACHINE= TEMPLATE_NAME=elf32 DATA_PLT= GENERATE_SHLIB_SCRIPT=yes +GENERATE_PIE_SCRIPT=yes NO_SMALL_DATA=yes diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32bmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32bmip.sh index fa7d671ffdf..94e1c9c9a24 100644 --- a/gnu/usr.bin/binutils/ld/emulparams/elf32bmip.sh +++ b/gnu/usr.bin/binutils/ld/emulparams/elf32bmip.sh @@ -8,6 +8,7 @@ LITTLE_OUTPUT_FORMAT="elf32-littlemips" TEXT_START_ADDR=0x0400000 test -n "${EMBEDDED}" || DATA_ADDR=0x10000000 MAXPAGESIZE=0x40000 +COMMONPAGESIZE=0x1000 NONPAGED_TEXT_START_ADDR=0x0400000 SHLIB_TEXT_START_ADDR=0x5ffe0000 test -n "${EMBEDDED}" || TEXT_DYNAMIC= diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh index d2d704135a5..d95cb786856 100644 --- a/gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh +++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh @@ -4,10 +4,12 @@ TEMPLATE_NAME=elf32 EXTRA_EM_FILE=ppc32elf GENERATE_SHLIB_SCRIPT=yes +GENERATE_PIE_SCRIPT=yes SCRIPT_NAME=elf OUTPUT_FORMAT="elf32-powerpc" TEXT_START_ADDR=0x01800000 MAXPAGESIZE=0x10000 +COMMONPAGESIZE=0x1000 ARCH=powerpc:common MACHINE= BSS_PLT= diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh index ab3eec0ec60..0c0f5d89e3d 100644 --- a/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh +++ b/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh @@ -8,6 +8,7 @@ ARCH="sparc:v9" MACHINE= DATA_PLT= GENERATE_SHLIB_SCRIPT=yes +GENERATE_PIE_SCRIPT=yes NOP=0x01000000 NO_SMALL_DATA=yes diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64alpha.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64alpha.sh index 2d16e9caba6..093c8dfd8e1 100644 --- a/gnu/usr.bin/binutils/ld/emulparams/elf64alpha.sh +++ b/gnu/usr.bin/binutils/ld/emulparams/elf64alpha.sh @@ -11,6 +11,7 @@ NONPAGED_TEXT_START_ADDR="0x120000000" ARCH=alpha MACHINE= GENERATE_SHLIB_SCRIPT=yes +GENERATE_PIE_SCRIPT=yes DATA_PLT= # Note that the number is always big-endian, thus we have to # reverse the digit string. diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh index f1b8522fe6f..2382286b9af 100644 --- a/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh +++ b/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh @@ -9,4 +9,5 @@ MACHINE= NOP=0x90909090 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes +GENERATE_PIE_SCRIPT=yes NO_SMALL_DATA=yes diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64.sh index 61e8f29f94f..6d3705828b2 100644 --- a/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64.sh +++ b/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64.sh @@ -10,6 +10,7 @@ MACHINE= NOP=0x90909090 TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes +GENERATE_PIE_SCRIPT=yes NO_SMALL_DATA=yes if [ "x${host}" = "x${target}" ]; then diff --git a/gnu/usr.bin/binutils/ld/emulparams/gld960.sh b/gnu/usr.bin/binutils/ld/emulparams/gld960.sh index ef81a78a10e..1e039654fab 100644 --- a/gnu/usr.bin/binutils/ld/emulparams/gld960.sh +++ b/gnu/usr.bin/binutils/ld/emulparams/gld960.sh @@ -1,7 +1,7 @@ SCRIPT_NAME=i960 OUTPUT_FORMAT="" -TEXT_START_ADDR=?? -TARGET_PAGE_SIZE=?? +TEXT_START_ADDR=0 +TARGET_PAGE_SIZE=128 ARCH=i960 TEMPLATE_NAME=gld960 GLD_STYLE=1 diff --git a/gnu/usr.bin/binutils/ld/emulparams/gld960coff.sh b/gnu/usr.bin/binutils/ld/emulparams/gld960coff.sh index 78202208b4f..65b0dcab42f 100644 --- a/gnu/usr.bin/binutils/ld/emulparams/gld960coff.sh +++ b/gnu/usr.bin/binutils/ld/emulparams/gld960coff.sh @@ -1,7 +1,7 @@ SCRIPT_NAME=i960 OUTPUT_FORMAT="" -TEXT_START_ADDR=?? -TARGET_PAGE_SIZE=?? +TEXT_START_ADDR=0 +TARGET_PAGE_SIZE=128 ARCH=i960 TEMPLATE_NAME=gld960c GLD_STYLE=1 diff --git a/gnu/usr.bin/binutils/ld/emulparams/lnk960.sh b/gnu/usr.bin/binutils/ld/emulparams/lnk960.sh index 3cf3fc49769..4a650f750ab 100644 --- a/gnu/usr.bin/binutils/ld/emulparams/lnk960.sh +++ b/gnu/usr.bin/binutils/ld/emulparams/lnk960.sh @@ -1,6 +1,6 @@ SCRIPT_NAME=i960 OUTPUT_FORMAT="" -TEXT_START_ADDR=?? -TARGET_PAGE_SIZE=?? +TEXT_START_ADDR=0 +TARGET_PAGE_SIZE=128 ARCH=i960 TEMPLATE_NAME=lnk960 diff --git a/gnu/usr.bin/binutils/ld/emulparams/m88kbcs.sh b/gnu/usr.bin/binutils/ld/emulparams/m88kbcs.sh index 6c6737c3329..d48a1eba950 100644 --- a/gnu/usr.bin/binutils/ld/emulparams/m88kbcs.sh +++ b/gnu/usr.bin/binutils/ld/emulparams/m88kbcs.sh @@ -1,5 +1,5 @@ SCRIPT_NAME=m88kbcs OUTPUT_FORMAT="coff-m88kbcs" -TEXT_START_ADDR=?? -TARGET_PAGE_SIZE=?? +TEXT_START_ADDR=0 +TARGET_PAGE_SIZE=128 ARCH=m88k diff --git a/gnu/usr.bin/binutils/ld/emulparams/vanilla.sh b/gnu/usr.bin/binutils/ld/emulparams/vanilla.sh index d8a3b72dbf9..eabb7cddd32 100644 --- a/gnu/usr.bin/binutils/ld/emulparams/vanilla.sh +++ b/gnu/usr.bin/binutils/ld/emulparams/vanilla.sh @@ -1,5 +1,5 @@ SCRIPT_NAME=vanilla -TEXT_START_ADDR=?? -TARGET_PAGE_SIZE=?? +TEXT_START_ADDR=0 +TARGET_PAGE_SIZE=128 ARCH=unknown TEMPLATE_NAME=vanilla diff --git a/gnu/usr.bin/binutils/ld/emultempl/aix.em b/gnu/usr.bin/binutils/ld/emultempl/aix.em index 910f831b897..513cd50d859 100644 --- a/gnu/usr.bin/binutils/ld/emultempl/aix.em +++ b/gnu/usr.bin/binutils/ld/emultempl/aix.em @@ -9,7 +9,7 @@ cat >e${EMULATION_NAME}.c <<EOF /* This file is is generated by a shell script. DO NOT EDIT! */ /* AIX emulation code for ${EMULATION_NAME} - Copyright 1991, 1993, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003 + Copyright 1991, 1993, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Steve Chamberlain <sac@cygnus.com> AIX support by Ian Lance Taylor <ian@cygnus.com> @@ -56,40 +56,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libcoff.h" #include "libxcoff.h" -static void gld${EMULATION_NAME}_before_parse - PARAMS ((void)); -static bfd_boolean gld${EMULATION_NAME}_parse_args - PARAMS ((int, char **)); -static void gld${EMULATION_NAME}_add_options - PARAMS ((int, char **, int, struct option **, int, struct option **)); -static bfd_boolean gld${EMULATION_NAME}_handle_option - PARAMS ((int)); -static void gld${EMULATION_NAME}_after_open - PARAMS ((void)); -static char *gld${EMULATION_NAME}_choose_target - PARAMS ((int, char **)); -static void gld${EMULATION_NAME}_before_allocation - PARAMS ((void)); -static void gld${EMULATION_NAME}_read_file - PARAMS ((const char *, bfd_boolean)); -static void gld${EMULATION_NAME}_free - PARAMS ((PTR)); -static void gld${EMULATION_NAME}_find_relocs - PARAMS ((lang_statement_union_type *)); -static void gld${EMULATION_NAME}_find_exp_assignment - PARAMS ((etree_type *)); -static char *gld${EMULATION_NAME}_get_script - PARAMS ((int *isfile)); -static bfd_boolean gld${EMULATION_NAME}_unrecognized_file - PARAMS ((lang_input_statement_type *)); -static void gld${EMULATION_NAME}_create_output_section_statements - PARAMS ((void)); -static void gld${EMULATION_NAME}_set_output_arch - PARAMS ((void)); -static int is_syscall - PARAMS ((char *, unsigned int *)); -static int change_symbol_mode - PARAMS ((char *)); +static void gld${EMULATION_NAME}_read_file (const char *, bfd_boolean); +static void gld${EMULATION_NAME}_free (void *); +static void gld${EMULATION_NAME}_find_relocs (lang_statement_union_type *); +static void gld${EMULATION_NAME}_find_exp_assignment (etree_type *); + /* The file alignment required for each section. */ static unsigned long file_align; @@ -160,17 +131,9 @@ static char *command_line_blibpath = NULL; /* This routine is called before anything else is done. */ static void -gld${EMULATION_NAME}_before_parse () +gld${EMULATION_NAME}_before_parse (void) { - const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}"); - if (arch) - { - ldfile_output_architecture = arch->arch; - ldfile_output_machine = arch->mach; - ldfile_output_machine_name = arch->printable_name; - } - else - ldfile_output_architecture = bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`; + ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`); config.has_shared = TRUE; @@ -210,13 +173,9 @@ enum }; static void -gld${EMULATION_NAME}_add_options (ns, shortopts, nl, longopts, nrl, really_longopts) - int ns; - char **shortopts; - int nl; - struct option **longopts; - int nrl ATTRIBUTE_UNUSED; - struct option **really_longopts ATTRIBUTE_UNUSED; +gld${EMULATION_NAME}_add_options + (int ns, char **shortopts, int nl, struct option **longopts, + int nrl ATTRIBUTE_UNUSED, struct option **really_longopts ATTRIBUTE_UNUSED) { static const char xtra_short[] = "D:H:KT:z"; static const struct option xtra_long[] = { @@ -291,15 +250,13 @@ gld${EMULATION_NAME}_add_options (ns, shortopts, nl, longopts, nrl, really_longo *shortopts = (char *) xrealloc (*shortopts, ns + sizeof (xtra_short)); memcpy (*shortopts + ns, &xtra_short, sizeof (xtra_short)); - *longopts = (struct option *) - xrealloc (*longopts, nl * sizeof (struct option) + sizeof (xtra_long)); + *longopts = xrealloc (*longopts, + nl * sizeof (struct option) + sizeof (xtra_long)); memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long)); } static bfd_boolean -gld${EMULATION_NAME}_parse_args (argc, argv) - int argc; - char **argv; +gld${EMULATION_NAME}_parse_args (int argc, char **argv) { int indx; @@ -327,8 +284,7 @@ gld${EMULATION_NAME}_parse_args (argc, argv) } static bfd_boolean -gld${EMULATION_NAME}_handle_option (optc) - int optc; +gld${EMULATION_NAME}_handle_option (int optc) { bfd_signed_vma val; const char *end; @@ -570,8 +526,7 @@ gld${EMULATION_NAME}_handle_option (optc) as an import file. This is for AIX compatibility. */ static bfd_boolean -gld${EMULATION_NAME}_unrecognized_file (entry) - lang_input_statement_type *entry; +gld${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry) { FILE *e; bfd_boolean ret; @@ -607,21 +562,21 @@ gld${EMULATION_NAME}_unrecognized_file (entry) /* This is called after the input files have been opened. */ static void -gld${EMULATION_NAME}_after_open () +gld${EMULATION_NAME}_after_open (void) { bfd_boolean r; struct set_info *p; /* Call ldctor_build_sets, after pretending that this is a - relocateable link. We do this because AIX requires relocation + relocatable link. We do this because AIX requires relocation entries for all references to symbols, even in a final executable. Of course, we only want to do this if we are producing an XCOFF output file. */ - r = link_info.relocateable; + r = link_info.relocatable; if (strstr (bfd_get_target (output_bfd), "xcoff") != NULL) - link_info.relocateable = TRUE; + link_info.relocatable = TRUE; ldctor_build_sets (); - link_info.relocateable = r; + link_info.relocatable = r; /* For each set, record the size, so that the XCOFF backend can output the correct csect length. */ @@ -652,7 +607,7 @@ gld${EMULATION_NAME}_after_open () sections, but before any sizes or addresses have been set. */ static void -gld${EMULATION_NAME}_before_allocation () +gld${EMULATION_NAME}_before_allocation (void) { struct filelist *fl; struct export_symbol_list *el; @@ -834,9 +789,7 @@ gld${EMULATION_NAME}_before_allocation () } static char * -gld${EMULATION_NAME}_choose_target (argc, argv) - int argc; - char **argv; +gld${EMULATION_NAME}_choose_target (int argc, char **argv) { int i, j, jmax; static char *from_outside; @@ -871,8 +824,7 @@ gld${EMULATION_NAME}_choose_target (argc, argv) 1 : state changed 0 : no change */ static int -change_symbol_mode (input) - char *input; +change_symbol_mode (char *input) { char *symbol_mode_string[] = { "# 32", /* 0x01 */ @@ -906,9 +858,7 @@ change_symbol_mode (input) 0 : ignore -1 : error, try something else */ static int -is_syscall (input, flag) - char *input; - unsigned int *flag; +is_syscall (char *input, unsigned int *flag) { unsigned int bit; char *string; @@ -958,9 +908,7 @@ is_syscall (input, flag) this is called by the handle_option emulation routine. */ static void -gld${EMULATION_NAME}_read_file (filename, import) - const char *filename; - bfd_boolean import; +gld${EMULATION_NAME}_read_file (const char *filename, bfd_boolean import) { struct obstack *o; FILE *f; @@ -1201,8 +1149,7 @@ gld${EMULATION_NAME}_read_file (filename, import) /* This routine saves us from worrying about declaring free. */ static void -gld${EMULATION_NAME}_free (p) - PTR p; +gld${EMULATION_NAME}_free (void *p) { free (p); } @@ -1212,8 +1159,7 @@ gld${EMULATION_NAME}_free (p) to symbols. */ static void -gld${EMULATION_NAME}_find_relocs (s) - lang_statement_union_type *s; +gld${EMULATION_NAME}_find_relocs (lang_statement_union_type *s) { if (s->header.type == lang_reloc_statement_enum) { @@ -1233,8 +1179,7 @@ gld${EMULATION_NAME}_find_relocs (s) /* Look through an expression for an assignment statement. */ static void -gld${EMULATION_NAME}_find_exp_assignment (exp) - etree_type *exp; +gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp) { struct bfd_link_hash_entry *h; @@ -1278,8 +1223,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp) } static char * -gld${EMULATION_NAME}_get_script (isfile) - int *isfile; +gld${EMULATION_NAME}_get_script (int *isfile) EOF if test -n "$COMPILE_IN" @@ -1293,11 +1237,11 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return EOF sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c @@ -1314,9 +1258,9 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 1; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable) + else if (link_info.relocatable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; @@ -1332,7 +1276,7 @@ fi cat >>e${EMULATION_NAME}.c <<EOF static void -gld${EMULATION_NAME}_create_output_section_statements () +gld${EMULATION_NAME}_create_output_section_statements (void) { /* __rtinit */ if ((bfd_get_flavour (output_bfd) == bfd_target_xcoff_flavour) @@ -1371,7 +1315,7 @@ gld${EMULATION_NAME}_create_output_section_statements () } static void -gld${EMULATION_NAME}_set_output_arch () +gld${EMULATION_NAME}_set_output_arch (void) { bfd_set_arch_mach (output_bfd, bfd_xcoff_architecture (output_bfd), diff --git a/gnu/usr.bin/binutils/ld/emultempl/elf32.em b/gnu/usr.bin/binutils/ld/emultempl/elf32.em index da553983441..b3e4639f072 100644 --- a/gnu/usr.bin/binutils/ld/emultempl/elf32.em +++ b/gnu/usr.bin/binutils/ld/emultempl/elf32.em @@ -13,7 +13,7 @@ cat >e${EMULATION_NAME}.c <<EOF /* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME} Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003 Free Software Foundation, Inc. + 2002, 2003, 2004 Free Software Foundation, Inc. Written by Steve Chamberlain <sac@cygnus.com> ELF support by Ian Lance Taylor <ian@cygnus.com> @@ -53,38 +53,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <ldgram.h> #include "elf/common.h" -static void gld${EMULATION_NAME}_before_parse - PARAMS ((void)); -static void gld${EMULATION_NAME}_vercheck - PARAMS ((lang_input_statement_type *)); -static void gld${EMULATION_NAME}_stat_needed - PARAMS ((lang_input_statement_type *)); -static bfd_boolean gld${EMULATION_NAME}_try_needed - PARAMS ((const char *, int)); -static bfd_boolean gld${EMULATION_NAME}_search_needed - PARAMS ((const char *, const char *, int)); -static void gld${EMULATION_NAME}_check_needed - PARAMS ((lang_input_statement_type *)); -static void gld${EMULATION_NAME}_after_open - PARAMS ((void)); -static void gld${EMULATION_NAME}_find_exp_assignment - PARAMS ((etree_type *)); -static void gld${EMULATION_NAME}_find_statement_assignment - PARAMS ((lang_statement_union_type *)); -static void gld${EMULATION_NAME}_before_allocation - PARAMS ((void)); -static bfd_boolean gld${EMULATION_NAME}_open_dynamic_archive - PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *)); -static lang_output_section_statement_type *output_rel_find - PARAMS ((asection *)); -static asection *output_prev_sec_find - PARAMS ((lang_output_section_statement_type *)); +/* Declare functions used by various EXTRA_EM_FILEs. */ +static void gld${EMULATION_NAME}_before_parse (void); +static void gld${EMULATION_NAME}_after_open (void); +static void gld${EMULATION_NAME}_before_allocation (void); static bfd_boolean gld${EMULATION_NAME}_place_orphan - PARAMS ((lang_input_statement_type *, asection *)); -static void gld${EMULATION_NAME}_finish - PARAMS ((void)); -static char *gld${EMULATION_NAME}_get_script - PARAMS ((int *isfile)); + (lang_input_statement_type *file, asection *s); +static void gld${EMULATION_NAME}_finish (void); EOF case ${target} in @@ -335,17 +310,9 @@ if test x"$LDEMUL_BEFORE_PARSE" != xgld"$EMULATION_NAME"_before_parse; then cat >>e${EMULATION_NAME}.c <<EOF static void -gld${EMULATION_NAME}_before_parse () +gld${EMULATION_NAME}_before_parse (void) { - const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}"); - if (arch) - { - ldfile_output_architecture = arch->arch; - ldfile_output_machine = arch->mach; - ldfile_output_machine_name = arch->printable_name; - } - else - ldfile_output_architecture = bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`; + ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`); config.dynamic_link = ${DYNAMIC_LINK-TRUE}; config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; } @@ -353,6 +320,28 @@ gld${EMULATION_NAME}_before_parse () EOF fi +if test x"$LDEMUL_RECOGNIZED_FILE" != xgld"${EMULATION_NAME}"_load_symbols; then +cat >>e${EMULATION_NAME}.c <<EOF +/* Handle as_needed DT_NEEDED. */ + +static bfd_boolean +gld${EMULATION_NAME}_load_symbols (lang_input_statement_type *entry) +{ + if (!entry->as_needed + || (bfd_get_file_flags (entry->the_bfd) & DYNAMIC) == 0) + return FALSE; + + /* Tell the ELF linker that we don't want the output file to have a + DT_NEEDED entry for this file, unless it is used to resolve + references in a regular object. */ + bfd_elf_set_dyn_lib_class (entry->the_bfd, DYN_AS_NEEDED); + + /* Continue on with normal load_symbols processing. */ + return FALSE; +} +EOF +fi + cat >>e${EMULATION_NAME}.c <<EOF /* These variables are required to pass information back and forth @@ -383,8 +372,7 @@ static bfd_boolean global_vercheck_failed; a conflicting version. */ static void -gld${EMULATION_NAME}_vercheck (s) - lang_input_statement_type *s; +gld${EMULATION_NAME}_vercheck (lang_input_statement_type *s) { const char *soname; struct bfd_link_needed_list *l; @@ -421,10 +409,10 @@ gld${EMULATION_NAME}_vercheck (s) if (strncmp (soname, l->name, suffix - l->name) == 0) { /* Here we know that S is a dynamic object FOO.SO.VER1, and - the object we are considering needs a dynamic object - FOO.SO.VER2, and VER1 and VER2 are different. This - appears to be a version mismatch, so we tell the caller - to try a different version of this library. */ + the object we are considering needs a dynamic object + FOO.SO.VER2, and VER1 and VER2 are different. This + appears to be a version mismatch, so we tell the caller + to try a different version of this library. */ global_vercheck_failed = TRUE; return; } @@ -436,8 +424,7 @@ gld${EMULATION_NAME}_vercheck (s) the file. */ static void -gld${EMULATION_NAME}_stat_needed (s) - lang_input_statement_type *s; +gld${EMULATION_NAME}_stat_needed (lang_input_statement_type *s) { struct stat st; const char *suffix; @@ -492,9 +479,7 @@ gld${EMULATION_NAME}_stat_needed (s) to skip the check for a conflicting version. */ static bfd_boolean -gld${EMULATION_NAME}_try_needed (name, force) - const char *name; - int force; +gld${EMULATION_NAME}_try_needed (const char *name, int force) { bfd *abfd; char *soname; @@ -541,16 +526,16 @@ gld${EMULATION_NAME}_try_needed (name, force) { bfd_close (abfd); /* Return FALSE to force the caller to move on to try - another file on the search path. */ + another file on the search path. */ return FALSE; } /* But wait! It gets much worse. On Linux, if a shared - library does not use libc at all, we are supposed to skip - it the first time around in case we encounter a shared - library later on with the same name which does use the - version of libc that we want. This is much too horrible - to use on any system other than Linux. */ + library does not use libc at all, we are supposed to skip + it the first time around in case we encounter a shared + library later on with the same name which does use the + version of libc that we want. This is much too horrible + to use on any system other than Linux. */ EOF case ${target} in @@ -600,19 +585,18 @@ cat >>e${EMULATION_NAME}.c <<EOF if (global_found) { /* Return TRUE to indicate that we found the file, even though - we aren't going to do anything with it. */ - free(soname); + we aren't going to do anything with it. */ + free (soname); return TRUE; } - /* Tell the ELF backend that we don't want the output file to have a - DT_NEEDED entry for this file. */ - bfd_elf_set_dt_needed_name (abfd, ""); + /* Specify the soname to use. */ + bfd_elf_set_dt_needed_name (abfd, soname); - /* Tell the ELF backend that the output file needs a DT_NEEDED - entry for this file if it is used to resolve the reference in - a regular object. */ - bfd_elf_set_dt_needed_soname (abfd, soname); + /* Tell the ELF linker that we don't want the output file to have a + DT_NEEDED entry for this file, unless it is used to resolve + references in a regular object. */ + bfd_elf_set_dyn_lib_class (abfd, DYN_DT_NEEDED); /* Add this file into the symbol table. */ if (! bfd_link_add_symbols (abfd, &link_info)) @@ -625,10 +609,7 @@ cat >>e${EMULATION_NAME}.c <<EOF /* Search for a needed file in a path. */ static bfd_boolean -gld${EMULATION_NAME}_search_needed (path, name, force) - const char *path; - const char *name; - int force; +gld${EMULATION_NAME}_search_needed (const char *path, const char *name, int force) { const char *s; size_t len; @@ -696,11 +677,8 @@ if [ "x${USE_LIBPATH}" = xyes ] ; then /* Add the sysroot to every entry in a colon-separated path. */ -static char * gld${EMULATION_NAME}_add_sysroot PARAMS ((const char *)); - static char * -gld${EMULATION_NAME}_add_sysroot (path) - const char *path; +gld${EMULATION_NAME}_add_sysroot (const char *path) { int len, colons, i; char *ret, *p; @@ -723,7 +701,7 @@ gld${EMULATION_NAME}_add_sysroot (path) while (path[i]) if (path[i] == ':') { - *p++ = path[i++]; + *p++ = path[i++]; strcpy (p, ld_sysroot); p = p + strlen (p); } @@ -742,13 +720,8 @@ EOF in which we may find shared libraries. /etc/ld.so.conf is really only meaningful on Linux. */ -static bfd_boolean gld${EMULATION_NAME}_check_ld_so_conf - PARAMS ((const char *, int)); - static bfd_boolean -gld${EMULATION_NAME}_check_ld_so_conf (name, force) - const char *name; - int force; +gld${EMULATION_NAME}_check_ld_so_conf (const char *name, int force) { static bfd_boolean initialized; static char *ld_so_conf; @@ -839,8 +812,7 @@ cat >>e${EMULATION_NAME}.c <<EOF /* See if an input file matches a DT_NEEDED entry by name. */ static void -gld${EMULATION_NAME}_check_needed (s) - lang_input_statement_type *s; +gld${EMULATION_NAME}_check_needed (lang_input_statement_type *s) { if (global_found) return; @@ -889,12 +861,12 @@ cat >>e${EMULATION_NAME}.c <<EOF /* This is called after all the input files have been opened. */ static void -gld${EMULATION_NAME}_after_open () +gld${EMULATION_NAME}_after_open (void) { struct bfd_link_needed_list *needed, *l; /* We only need to worry about this when doing a final link. */ - if (link_info.relocateable || link_info.shared) + if (link_info.relocatable || !link_info.executable) return; /* Get the list of files which appear in DT_NEEDED entries in @@ -935,7 +907,7 @@ gld${EMULATION_NAME}_after_open () rpath_link, rpath, then the environment variable LD_LIBRARY_PATH (native only), then the DT_RPATH/DT_RUNPATH entries (native only), then the linker script LIB_SEARCH_DIRS. - We look at the -L arguments to build search path. + We look at the -L arguments to build the search path. We search twice. The first time, we skip objects which may introduce version mismatches. The second time, we force @@ -967,7 +939,7 @@ EOF fi if [ "x${NATIVE}" = xyes ] ; then cat >>e${EMULATION_NAME}.c <<EOF - if (getenv("LD_RUN_PATH") != NULL + if (getenv ("LD_RUN_PATH") != NULL && command_line.rpath_link == NULL && command_line.rpath == NULL) { @@ -977,29 +949,29 @@ cat >>e${EMULATION_NAME}.c <<EOF break; } - len = strlen(search_head->name); - lib_path = xstrdup(search_head->name); - for (search = search_head->next; search != NULL; - search = search->next) - { - size_t nlen; - - nlen = strlen(search->name); - lib_path = xrealloc(lib_path, len + nlen + 2); - lib_path[len] = ':'; - strcpy(lib_path + len + 1, search->name); - len += nlen + 1; - } + len = strlen(search_head->name); + lib_path = xstrdup(search_head->name); + for (search = search_head->next; search != NULL; + search = search->next) + { + size_t nlen; - if (gld${EMULATION_NAME}_search_needed (lib_path, l->name, force)) - { - free(lib_path); - break; - } - free(lib_path); + nlen = strlen(search->name); + lib_path = xrealloc(lib_path, len + nlen + 2); + lib_path[len] = ':'; + strcpy(lib_path + len + 1, search->name); + len += nlen + 1; + } - lib_path = getenv ("LD_LIBRARY_PATH"); if (gld${EMULATION_NAME}_search_needed (lib_path, l->name, force)) + { + free(lib_path); + break; + } + free(lib_path); + + lib_path = getenv ("LD_LIBRARY_PATH"); + if (gld${EMULATION_NAME}_search_needed (lib_path, l->name, force)) break; EOF fi @@ -1068,8 +1040,7 @@ cat >>e${EMULATION_NAME}.c <<EOF /* Look through an expression for an assignment statement. */ static void -gld${EMULATION_NAME}_find_exp_assignment (exp) - etree_type *exp; +gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp) { struct bfd_link_hash_entry *h; @@ -1093,7 +1064,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp) case etree_assign: if (strcmp (exp->assign.dst, ".") != 0) { - if (! (bfd_elf${ELFSIZE}_record_link_assignment + if (! (bfd_elf_record_link_assignment (output_bfd, &link_info, exp->assign.dst, exp->type.node_class == etree_provide ? TRUE : FALSE))) einfo ("%P%F: failed to record assignment to %s: %E\n", @@ -1129,8 +1100,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp) symbols which are referred to by dynamic objects. */ static void -gld${EMULATION_NAME}_find_statement_assignment (s) - lang_statement_union_type *s; +gld${EMULATION_NAME}_find_statement_assignment (lang_statement_union_type *s) { if (s->header.type == lang_assignment_statement_enum) gld${EMULATION_NAME}_find_exp_assignment (s->assignment_statement.exp); @@ -1157,11 +1127,14 @@ cat >>e${EMULATION_NAME}.c <<EOF sections, but before any sizes or addresses have been set. */ static void -gld${EMULATION_NAME}_before_allocation () +gld${EMULATION_NAME}_before_allocation (void) { const char *rpath; asection *sinterp; + if (link_info.hash->type == bfd_link_elf_hash_table) + _bfd_elf_tls_setup (output_bfd, &link_info); + /* If we are going to make any variable assignments, we need to let the ELF backend know about them in case the variables are referred to by dynamic objects. */ @@ -1172,8 +1145,8 @@ gld${EMULATION_NAME}_before_allocation () rpath = command_line.rpath; if (rpath == NULL) rpath = (const char *) getenv ("LD_RUN_PATH"); - if (! (bfd_elf${ELFSIZE}_size_dynamic_sections - (output_bfd, command_line.soname, rpath, + if (! (bfd_elf_size_dynamic_sections + (output_bfd, command_line.soname, rpath, command_line.filter_shlib, (const char * const *) command_line.auxiliary_filters, &link_info, &sinterp, lang_elf_version_info))) @@ -1197,8 +1170,10 @@ ${ELF_INTERPRETER_SET_DEFAULT} { asection *s; bfd_size_type sz; + bfd_size_type prefix_len; char *msg; bfd_boolean ret; + const char * gnu_warning_prefix = _("warning: "); if (is->just_syms_flag) continue; @@ -1208,11 +1183,14 @@ ${ELF_INTERPRETER_SET_DEFAULT} continue; sz = bfd_section_size (is->the_bfd, s); - msg = xmalloc ((size_t) sz + 1); - if (! bfd_get_section_contents (is->the_bfd, s, msg, (file_ptr) 0, sz)) + prefix_len = strlen (gnu_warning_prefix); + msg = xmalloc ((size_t) (prefix_len + sz + 1)); + strcpy (msg, gnu_warning_prefix); + if (! bfd_get_section_contents (is->the_bfd, s, msg + prefix_len, + (file_ptr) 0, sz)) einfo ("%F%B: Can't read contents of section .gnu.warning: %E\n", is->the_bfd); - msg[sz] = '\0'; + msg[prefix_len + sz] = '\0'; ret = link_info.callbacks->warning (&link_info, msg, (const char *) NULL, is->the_bfd, (asection *) NULL, @@ -1238,10 +1216,8 @@ cat >>e${EMULATION_NAME}.c <<EOF like hpux). */ static bfd_boolean -gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) - const char *arch; - search_dirs_type *search; - lang_input_statement_type *entry; +gld${EMULATION_NAME}_open_dynamic_archive + (const char *arch, search_dirs_type *search, lang_input_statement_type *entry) { const char *filename; char *string; @@ -1331,12 +1307,12 @@ cat >>e${EMULATION_NAME}.c <<EOF /* A variant of lang_output_section_find. Used by place_orphan. */ static lang_output_section_statement_type * -output_rel_find (sec) - asection *sec; +output_rel_find (asection *sec, int isdyn) { lang_statement_union_type *u; lang_output_section_statement_type *lookup; lang_output_section_statement_type *last = NULL; + lang_output_section_statement_type *last_alloc = NULL; lang_output_section_statement_type *last_rel = NULL; lang_output_section_statement_type *last_rel_alloc = NULL; int rela = sec->name[4] == 'a'; @@ -1346,22 +1322,30 @@ output_rel_find (sec) lookup = &u->output_section_statement; if (strncmp (".rel", lookup->name, 4) == 0) { - /* Don't place after .rel.plt as doing so results in wrong - dynamic tags. Also, place allocated reloc sections before - non-allocated. */ int lookrela = lookup->name[4] == 'a'; - if (strcmp (".plt", lookup->name + 4 + lookrela) == 0 - || (lookup->bfd_section != NULL - && (lookup->bfd_section->flags & SEC_ALLOC) == 0)) + /* .rel.dyn must come before all other reloc sections, to suit + GNU ld.so. */ + if (isdyn) + break; + + /* Don't place after .rel.plt as doing so results in wrong + dynamic tags. */ + if (strcmp (".plt", lookup->name + 4 + lookrela) == 0) break; - last = lookup; - if (rela == lookrela) + + if (rela == lookrela || last_rel == NULL) last_rel = lookup; - if (lookup->bfd_section != NULL + if ((rela == lookrela || last_rel_alloc == NULL) + && lookup->bfd_section != NULL && (lookup->bfd_section->flags & SEC_ALLOC) != 0) last_rel_alloc = lookup; } + + last = lookup; + if (lookup->bfd_section != NULL + && (lookup->bfd_section->flags & SEC_ALLOC) != 0) + last_alloc = lookup; } if (last_rel_alloc) @@ -1370,6 +1354,9 @@ output_rel_find (sec) if (last_rel) return last_rel; + if (last_alloc) + return last_alloc; + return last; } @@ -1377,8 +1364,7 @@ output_rel_find (sec) Used by place_orphan. */ static asection * -output_prev_sec_find (os) - lang_output_section_statement_type *os; +output_prev_sec_find (lang_output_section_statement_type *os) { asection *s = (asection *) NULL; lang_statement_union_type *u; @@ -1410,9 +1396,7 @@ struct orphan_save { }; static bfd_boolean -gld${EMULATION_NAME}_place_orphan (file, s) - lang_input_statement_type *file; - asection *s; +gld${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s) { static struct orphan_save hold_text; static struct orphan_save hold_rodata; @@ -1434,7 +1418,7 @@ gld${EMULATION_NAME}_place_orphan (file, s) int isdyn = 0; secname = bfd_get_section_name (s->owner, s); - if (! link_info.relocateable + if (! link_info.relocatable && link_info.combreloc && (s->flags & SEC_ALLOC) && strncmp (secname, ".rel", 4) == 0) @@ -1468,8 +1452,8 @@ gld${EMULATION_NAME}_place_orphan (file, s) /* If this is a final link, then always put .gnu.warning.SYMBOL sections into the .text section to get them out of the way. */ - if (! link_info.shared - && ! link_info.relocateable + if (link_info.executable + && ! link_info.relocatable && strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0 && hold_text.os != NULL) { @@ -1485,7 +1469,7 @@ gld${EMULATION_NAME}_place_orphan (file, s) #define HAVE_SECTION(hold, name) \ (hold.os != NULL || (hold.os = lang_output_section_find (name)) != NULL) - if ((s->flags & SEC_EXCLUDE) != 0 && !link_info.relocateable) + if ((s->flags & SEC_EXCLUDE) != 0 && !link_info.relocatable) { if (s->output_section == NULL) s->output_section = bfd_abs_section_ptr; @@ -1511,7 +1495,7 @@ gld${EMULATION_NAME}_place_orphan (file, s) else if (strncmp (secname, ".rel", 4) == 0 && (s->flags & SEC_LOAD) != 0 && (hold_rel.os != NULL - || (hold_rel.os = output_rel_find (s)) != NULL)) + || (hold_rel.os = output_rel_find (s, isdyn)) != NULL)) place = &hold_rel; else if ((s->flags & (SEC_CODE | SEC_READONLY)) == SEC_READONLY && HAVE_SECTION (hold_rodata, ".rodata")) @@ -1566,7 +1550,7 @@ gld${EMULATION_NAME}_place_orphan (file, s) } address = NULL; - if (link_info.relocateable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0) + if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0) address = exp_intop ((bfd_vma) 0); load_base = NULL; @@ -1581,7 +1565,6 @@ gld${EMULATION_NAME}_place_orphan (file, s) os_tail = lang_output_section_statement.tail; os = lang_enter_output_section_statement (secname, address, 0, - (bfd_vma) 0, (etree_type *) NULL, (etree_type *) NULL, load_base); @@ -1710,9 +1693,9 @@ if test x"$LDEMUL_FINISH" != xgld"$EMULATION_NAME"_finish; then cat >>e${EMULATION_NAME}.c <<EOF static void -gld${EMULATION_NAME}_finish () +gld${EMULATION_NAME}_finish (void) { - if (bfd_elf${ELFSIZE}_discard_info (output_bfd, &link_info)) + if (bfd_elf_discard_info (output_bfd, &link_info)) { lang_reset_memory_regions (); @@ -1735,8 +1718,7 @@ if test x"$LDEMUL_GET_SCRIPT" != xgld"$EMULATION_NAME"_get_script; then cat >>e${EMULATION_NAME}.c <<EOF static char * -gld${EMULATION_NAME}_get_script (isfile) - int *isfile; +gld${EMULATION_NAME}_get_script (int *isfile) EOF if test -n "$COMPILE_IN" @@ -1750,11 +1732,11 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return EOF sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c @@ -1762,6 +1744,14 @@ if cmp -s ldscripts/${EMULATION_NAME}.x ldscripts/${EMULATION_NAME}.xn; then : ; echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c fi +if test -n "$GENERATE_PIE_SCRIPT" ; then +if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then +echo ' ; else if (link_info.pie && link_info.combreloc) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xdc >> e${EMULATION_NAME}.c +fi +echo ' ; else if (link_info.pie) return' >> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xd >> e${EMULATION_NAME}.c +fi if test -n "$GENERATE_SHLIB_SCRIPT" ; then if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then echo ' ; else if (link_info.shared && link_info.combreloc) return' >> e${EMULATION_NAME}.c @@ -1787,9 +1777,9 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 1; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable) + else if (link_info.relocatable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; @@ -1801,6 +1791,18 @@ cat >>e${EMULATION_NAME}.c <<EOF return "ldscripts/${EMULATION_NAME}.xn"; EOF fi +if test -n "$GENERATE_PIE_SCRIPT" ; then +if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then +cat >>e${EMULATION_NAME}.c <<EOF + else if (link_info.pie && link_info.combreloc) + return "ldscripts/${EMULATION_NAME}.xdc"; +EOF +fi +cat >>e${EMULATION_NAME}.c <<EOF + else if (link_info.pie) + return "ldscripts/${EMULATION_NAME}.xd"; +EOF +fi if test -n "$GENERATE_SHLIB_SCRIPT" ; then if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then cat >>e${EMULATION_NAME}.c <<EOF @@ -1847,17 +1849,10 @@ cat >>e${EMULATION_NAME}.c <<EOF #define OPTION_GROUP (OPTION_ENABLE_NEW_DTAGS + 1) #define OPTION_EH_FRAME_HDR (OPTION_GROUP + 1) -static void gld${EMULATION_NAME}_add_options - PARAMS ((int, char **, int, struct option **, int, struct option **)); - static void -gld${EMULATION_NAME}_add_options (ns, shortopts, nl, longopts, nrl, really_longopts) - int ns; - char **shortopts; - int nl; - struct option **longopts; - int nrl ATTRIBUTE_UNUSED; - struct option **really_longopts ATTRIBUTE_UNUSED; +gld${EMULATION_NAME}_add_options + (int ns, char **shortopts, int nl, struct option **longopts, + int nrl ATTRIBUTE_UNUSED, struct option **really_longopts ATTRIBUTE_UNUSED) { static const char xtra_short[] = "${PARSE_AND_LIST_SHORTOPTS}z:"; static const struct option xtra_long[] = { @@ -1889,12 +1884,8 @@ cat >>e${EMULATION_NAME}.c <<EOF memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long)); } -static bfd_boolean gld${EMULATION_NAME}_handle_option - PARAMS ((int)); - static bfd_boolean -gld${EMULATION_NAME}_handle_option (optc) - int optc; +gld${EMULATION_NAME}_handle_option (int optc) { switch (optc) { @@ -1920,7 +1911,8 @@ cat >>e${EMULATION_NAME}.c <<EOF case OPTION_GROUP: link_info.flags_1 |= (bfd_vma) DF_1_GROUP; /* Groups must be self-contained. */ - link_info.no_undefined = TRUE; + link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR; + link_info.unresolved_syms_in_shared_libs = RM_GENERATE_ERROR; break; case 'z': @@ -1949,7 +1941,7 @@ cat >>e${EMULATION_NAME}.c <<EOF link_info.flags_1 |= (bfd_vma) DF_1_ORIGIN; } else if (strcmp (optarg, "defs") == 0) - link_info.no_undefined = TRUE; + link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR; else if (strcmp (optarg, "muldefs") == 0) link_info.allow_multiple_definition = TRUE; else if (strcmp (optarg, "combreloc") == 0) @@ -1957,7 +1949,17 @@ cat >>e${EMULATION_NAME}.c <<EOF else if (strcmp (optarg, "nocombreloc") == 0) link_info.combreloc = FALSE; else if (strcmp (optarg, "nocopyreloc") == 0) - link_info.nocopyreloc = TRUE; + link_info.nocopyreloc = TRUE; + else if (strcmp (optarg, "execstack") == 0) + { + link_info.execstack = TRUE; + link_info.noexecstack = FALSE; + } + else if (strcmp (optarg, "noexecstack") == 0) + { + link_info.noexecstack = TRUE; + link_info.execstack = FALSE; + } /* What about the other Solaris -z options? FIXME. */ break; EOF @@ -1980,11 +1982,8 @@ EOF if test x"$LDEMUL_LIST_OPTIONS" != xgld"$EMULATION_NAME"_list_options; then cat >>e${EMULATION_NAME}.c <<EOF -static void gld${EMULATION_NAME}_list_options PARAMS ((FILE * file)); - static void -gld${EMULATION_NAME}_list_options (file) - FILE * file; +gld${EMULATION_NAME}_list_options (FILE * file) { EOF @@ -1995,7 +1994,8 @@ cat >>e${EMULATION_NAME}.c <<EOF fprintf (file, _(" --enable-new-dtags\tEnable new dynamic tags\n")); fprintf (file, _(" --eh-frame-hdr\tCreate .eh_frame_hdr section\n")); fprintf (file, _(" -z combreloc\t\tMerge dynamic relocs into one section and sort\n")); - fprintf (file, _(" -z defs\t\tDisallows undefined symbols\n")); + fprintf (file, _(" -z defs\t\tReport unresolved symbols in object files.\n")); + fprintf (file, _(" -z execstack\t\tMark executable as requiring executable stack\n")); fprintf (file, _(" -z initfirst\t\tMark DSO to be initialized first at runtime\n")); fprintf (file, _(" -z interpose\t\tMark object to interpose all DSOs but executable\n")); fprintf (file, _(" -z loadfltr\t\tMark object requiring immediate process\n")); @@ -2006,6 +2006,7 @@ cat >>e${EMULATION_NAME}.c <<EOF fprintf (file, _(" -z nodelete\t\tMark DSO non-deletable at runtime\n")); fprintf (file, _(" -z nodlopen\t\tMark DSO not available to dlopen\n")); fprintf (file, _(" -z nodump\t\tMark DSO not available to dldump\n")); + fprintf (file, _(" -z noexecstack\tMark executable as not requiring executable stack\n")); fprintf (file, _(" -z now\t\tMark object non-lazy runtime binding\n")); fprintf (file, _(" -z origin\t\tMark object requiring immediate \$ORIGIN processing\n\t\t\t at runtime\n")); fprintf (file, _(" -z KEYWORD\t\tIgnored for Solaris compatibility\n")); @@ -2066,7 +2067,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = gld${EMULATION_NAME}_handle_option, ${LDEMUL_UNRECOGNIZED_FILE-NULL}, ${LDEMUL_LIST_OPTIONS-gld${EMULATION_NAME}_list_options}, - ${LDEMUL_RECOGNIZED_FILE-NULL}, + ${LDEMUL_RECOGNIZED_FILE-gld${EMULATION_NAME}_load_symbols}, ${LDEMUL_FIND_POTENTIAL_LIBRARIES-NULL}, ${LDEMUL_NEW_VERS_PATTERN-NULL} }; diff --git a/gnu/usr.bin/binutils/ld/emultempl/generic.em b/gnu/usr.bin/binutils/ld/emultempl/generic.em index 3a7d6115315..4d17ca261ab 100644 --- a/gnu/usr.bin/binutils/ld/emultempl/generic.em +++ b/gnu/usr.bin/binutils/ld/emultempl/generic.em @@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF /* This file is is generated by a shell script. DO NOT EDIT! */ /* emulate the original gld for the given ${EMULATION_NAME} - Copyright 1991, 1992, 1994, 1996, 2000, 2001, 2002 + Copyright 1991, 1992, 1994, 1996, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Steve Chamberlain steve@cygnus.com @@ -39,9 +39,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ldfile.h" #include "ldemul.h" -static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); -static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile)); - EOF # Import any needed special functions and/or overrides. @@ -54,10 +51,10 @@ if test x"$LDEMUL_BEFORE_PARSE" != xgld"$EMULATION_NAME"_before_parse; then cat >>e${EMULATION_NAME}.c <<EOF static void -gld${EMULATION_NAME}_before_parse() +gld${EMULATION_NAME}_before_parse (void) { #ifndef TARGET_ /* I.e., if not generic. */ - ldfile_set_output_arch ("`echo ${ARCH}`"); + ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown); #endif /* not TARGET_ */ } @@ -68,8 +65,7 @@ if test x"$LDEMUL_GET_SCRIPT" != xgld"$EMULATION_NAME"_get_script; then cat >>e${EMULATION_NAME}.c <<EOF static char * -gld${EMULATION_NAME}_get_script(isfile) - int *isfile; +gld${EMULATION_NAME}_get_script (int *isfile) EOF if test -n "$COMPILE_IN" @@ -80,14 +76,14 @@ then sc="-f stringify.sed" cat >>e${EMULATION_NAME}.c <<EOF -{ +{ *isfile = 0; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return EOF sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c @@ -101,12 +97,12 @@ else # Scripts read from the filesystem. cat >>e${EMULATION_NAME}.c <<EOF -{ +{ *isfile = 1; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable) + else if (link_info.relocatable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; @@ -121,7 +117,7 @@ fi cat >>e${EMULATION_NAME}.c <<EOF -struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = +struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = { ${LDEMUL_BEFORE_PARSE-gld${EMULATION_NAME}_before_parse}, ${LDEMUL_SYSLIB-syslib_default}, diff --git a/gnu/usr.bin/binutils/ld/emultempl/gld960.em b/gnu/usr.bin/binutils/ld/emultempl/gld960.em index dd73e6b061e..9b93bac2db3 100644 --- a/gnu/usr.bin/binutils/ld/emultempl/gld960.em +++ b/gnu/usr.bin/binutils/ld/emultempl/gld960.em @@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* +/* * emulate the Intels port of gld */ @@ -39,15 +39,10 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307 #include "ldfile.h" #include "ldemul.h" -static void gld960_before_parse PARAMS ((void)); -static char *gld960_choose_target PARAMS ((int, char **)); -static void gld960_set_output_arch PARAMS ((void)); -static char *gld960_get_script PARAMS ((int *)); - #ifdef GNU960 static void -gld960_before_parse() +gld960_before_parse (void) { static char *env_variables[] = { "G960LIB", "G960BASE", 0 }; char **p; @@ -67,7 +62,7 @@ gld960_before_parse() #else /* not GNU960 */ -static void gld960_before_parse() +static void gld960_before_parse (void) { char *env ; env = getenv("G960LIB"); @@ -84,15 +79,13 @@ static void gld960_before_parse() static void -gld960_set_output_arch() +gld960_set_output_arch (void) { bfd_set_arch_mach(output_bfd, ldfile_output_architecture, bfd_mach_i960_core); } static char * -gld960_choose_target (argc, argv) - int argc ATTRIBUTE_UNUSED; - char **argv ATTRIBUTE_UNUSED; +gld960_choose_target (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { #ifdef GNU960 @@ -113,8 +106,7 @@ gld960_choose_target (argc, argv) } static char * -gld960_get_script(isfile) - int *isfile; +gld960_get_script (int *isfile) EOF if test -n "$COMPILE_IN" @@ -125,14 +117,14 @@ then sc="-f stringify.sed" cat >>e${EMULATION_NAME}.c <<EOF -{ +{ *isfile = 0; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return EOF sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c @@ -146,12 +138,12 @@ else # Scripts read from the filesystem. cat >>e${EMULATION_NAME}.c <<EOF -{ +{ *isfile = 1; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable) + else if (link_info.relocatable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; @@ -166,7 +158,7 @@ fi cat >>e${EMULATION_NAME}.c <<EOF -struct ld_emulation_xfer_struct ld_gld960_emulation = +struct ld_emulation_xfer_struct ld_gld960_emulation = { gld960_before_parse, syslib_default, diff --git a/gnu/usr.bin/binutils/ld/emultempl/gld960c.em b/gnu/usr.bin/binutils/ld/emultempl/gld960c.em index 132afcb5c5e..ef2293e7806 100644 --- a/gnu/usr.bin/binutils/ld/emultempl/gld960c.em +++ b/gnu/usr.bin/binutils/ld/emultempl/gld960c.em @@ -1,7 +1,7 @@ # This shell script emits a C file. -*- C -*- # It does some substitutions. cat >e${EMULATION_NAME}.c <<EOF -/* Copyright 1991, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003 +/* Copyright 1991, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -21,7 +21,7 @@ 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. */ -/* +/* * emulate the Intels port of gld */ @@ -41,15 +41,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "ldfile.h" #include "ldemul.h" -static void gld960_before_parse PARAMS ((void)); -static void gld960_set_output_arch PARAMS ((void)); -static char *gld960_choose_target PARAMS ((int, char **)); -static char *gld960_get_script PARAMS ((int *)); - #ifdef GNU960 static void -gld960_before_parse() +gld960_before_parse (void) { static char *env_variables[] = { "G960LIB", "G960BASE", 0 }; char **p; @@ -69,7 +64,7 @@ gld960_before_parse() #else /* not GNU960 */ -static void gld960_before_parse() +static void gld960_before_parse (void) { char *env ; env = getenv("G960LIB"); @@ -87,7 +82,7 @@ static void gld960_before_parse() static void -gld960_set_output_arch() +gld960_set_output_arch (void) { if (ldfile_output_machine_name != NULL && *ldfile_output_machine_name != '\0') @@ -97,7 +92,7 @@ gld960_set_output_arch() s = concat ("i960:", ldfile_output_machine_name, (char *) NULL); for (s1 = s; *s1 != '\0'; s1++) *s1 = TOLOWER (*s1); - ldfile_set_output_arch (s); + ldfile_set_output_arch (s, bfd_arch_unknown); free (s); } @@ -105,9 +100,7 @@ gld960_set_output_arch() } static char * -gld960_choose_target (argc, argv) - int argc ATTRIBUTE_UNUSED; - char **argv ATTRIBUTE_UNUSED; +gld960_choose_target (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { #ifdef GNU960 @@ -128,8 +121,7 @@ gld960_choose_target (argc, argv) } static char * -gld960_get_script(isfile) - int *isfile; +gld960_get_script (int *isfile) EOF if test -n "$COMPILE_IN" @@ -140,14 +132,14 @@ then sc="-f stringify.sed" cat >>e${EMULATION_NAME}.c <<EOF -{ +{ *isfile = 0; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return EOF sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c @@ -161,12 +153,12 @@ else # Scripts read from the filesystem. cat >>e${EMULATION_NAME}.c <<EOF -{ +{ *isfile = 1; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable) + else if (link_info.relocatable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; @@ -181,7 +173,7 @@ fi cat >>e${EMULATION_NAME}.c <<EOF -struct ld_emulation_xfer_struct ld_gld960coff_emulation = +struct ld_emulation_xfer_struct ld_gld960coff_emulation = { gld960_before_parse, syslib_default, diff --git a/gnu/usr.bin/binutils/ld/emultempl/hppaelf.em b/gnu/usr.bin/binutils/ld/emultempl/hppaelf.em index 4e3b6b957f9..93e88ad655a 100644 --- a/gnu/usr.bin/binutils/ld/emultempl/hppaelf.em +++ b/gnu/usr.bin/binutils/ld/emultempl/hppaelf.em @@ -27,14 +27,6 @@ cat >>e${EMULATION_NAME}.c <<EOF #include "ldctor.h" #include "elf32-hppa.h" -static void hppaelf_after_parse PARAMS ((void)); -static void hppaelf_create_output_section_statements PARAMS ((void)); -static asection *hppaelf_add_stub_section - PARAMS ((const char *, asection *)); -static void hppaelf_layout_sections_again PARAMS ((void)); -static void gld${EMULATION_NAME}_finish PARAMS ((void)); -static void build_section_lists PARAMS ((lang_statement_union_type *)); - /* Fake input file for stubs. */ static lang_input_statement_type *stub_file; @@ -56,9 +48,9 @@ static bfd_signed_vma group_size = 1; and adds millicode library to the list of input files. */ static void -hppaelf_after_parse () +hppaelf_after_parse (void) { - if (link_info.relocateable) + if (link_info.relocatable) lang_add_unique (".text"); #if 0 /* Enable this once we split millicode stuff from libgcc. */ else @@ -72,8 +64,15 @@ hppaelf_after_parse () fake input file to hold the stub sections. */ static void -hppaelf_create_output_section_statements () +hppaelf_create_output_section_statements (void) { + extern const bfd_target bfd_elf32_hppa_linux_vec; + extern const bfd_target bfd_elf32_hppa_vec; + + if (link_info.hash->creator != &bfd_elf32_hppa_linux_vec + && link_info.hash->creator != &bfd_elf32_hppa_vec) + return; + stub_file = lang_add_input_file ("linker stubs", lang_input_file_is_fake_enum, NULL); @@ -99,13 +98,8 @@ struct hook_stub_info /* Traverse the linker tree to find the spot where the stub goes. */ -static bfd_boolean hook_in_stub - PARAMS ((struct hook_stub_info *, lang_statement_union_type **)); - static bfd_boolean -hook_in_stub (info, lp) - struct hook_stub_info *info; - lang_statement_union_type **lp; +hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) { lang_statement_union_type *l; bfd_boolean ret; @@ -177,9 +171,7 @@ hook_in_stub (info, lp) immediately before INPUT_SECTION. */ static asection * -hppaelf_add_stub_section (stub_sec_name, input_section) - const char *stub_sec_name; - asection *input_section; +hppaelf_add_stub_section (const char *stub_sec_name, asection *input_section) { asection *stub_sec; flagword flags; @@ -220,7 +212,7 @@ hppaelf_add_stub_section (stub_sec_name, input_section) /* Another call-back for elf32_hppa_size_stubs. */ static void -hppaelf_layout_sections_again () +hppaelf_layout_sections_again (void) { /* If we have changed sizes of the stub sections, then we need to recalculate all the section offsets. This may mean we need to @@ -243,8 +235,7 @@ hppaelf_layout_sections_again () static void -build_section_lists (statement) - lang_statement_union_type *statement; +build_section_lists (lang_statement_union_type *statement) { if (statement->header.type == lang_input_section_enum && !statement->input_section.ifile->just_syms_flag @@ -261,18 +252,18 @@ build_section_lists (statement) to build linker stubs. */ static void -gld${EMULATION_NAME}_finish () +gld${EMULATION_NAME}_finish (void) { - /* bfd_elf32_discard_info just plays with debugging sections, + /* bfd_elf_discard_info just plays with debugging sections, ie. doesn't affect any code, so we can delay resizing the sections. It's likely we'll resize everything in the process of adding stubs. */ - if (bfd_elf${ELFSIZE}_discard_info (output_bfd, &link_info)) + if (bfd_elf_discard_info (output_bfd, &link_info)) need_laying_out = 1; /* If generating a relocatable output file, then we don't have to examine the relocs. */ - if (! link_info.relocateable) + if (stub_file != NULL && !link_info.relocatable) { int ret = elf32_hppa_setup_section_lists (output_bfd, &link_info); @@ -304,7 +295,7 @@ gld${EMULATION_NAME}_finish () if (need_laying_out) hppaelf_layout_sections_again (); - if (! link_info.relocateable) + if (! link_info.relocatable) { /* Set the global data pointer. */ if (! elf32_hppa_set_gp (output_bfd, &link_info)) @@ -314,7 +305,7 @@ gld${EMULATION_NAME}_finish () } /* Now build the linker stubs. */ - if (stub_file->the_bfd->sections != NULL) + if (stub_file != NULL && stub_file->the_bfd->sections != NULL) { if (! elf32_hppa_build_stubs (&link_info)) einfo ("%X%P: can not build stubs: %E\n"); @@ -326,23 +317,16 @@ gld${EMULATION_NAME}_finish () /* Avoid processing the fake stub_file in vercheck, stat_needed and check_needed routines. */ -static void hppa_for_each_input_file_wrapper - PARAMS ((lang_input_statement_type *)); -static void hppa_lang_for_each_input_file - PARAMS ((void (*) (lang_input_statement_type *))); - -static void (*real_func) PARAMS ((lang_input_statement_type *)); +static void (*real_func) (lang_input_statement_type *); -static void hppa_for_each_input_file_wrapper (l) - lang_input_statement_type *l; +static void hppa_for_each_input_file_wrapper (lang_input_statement_type *l) { if (l != stub_file) (*real_func) (l); } static void -hppa_lang_for_each_input_file (func) - void (*func) PARAMS ((lang_input_statement_type *)); +hppa_lang_for_each_input_file (void (*func) (lang_input_statement_type *)) { real_func = func; lang_for_each_input_file (&hppa_for_each_input_file_wrapper); diff --git a/gnu/usr.bin/binutils/ld/emultempl/linux.em b/gnu/usr.bin/binutils/ld/emultempl/linux.em index fae1252ca60..d041b681df6 100644 --- a/gnu/usr.bin/binutils/ld/emultempl/linux.em +++ b/gnu/usr.bin/binutils/ld/emultempl/linux.em @@ -9,7 +9,7 @@ cat >e${EMULATION_NAME}.c <<EOF /* This file is is generated by a shell script. DO NOT EDIT! */ /* Linux a.out emulation code for ${EMULATION_NAME} - Copyright 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002, 2003 + Copyright 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Steve Chamberlain <sac@cygnus.com> Linux support by Eric Youngdale <ericy@cais.cais.com> @@ -44,28 +44,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ldfile.h" #include "ldemul.h" -static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); -static bfd_boolean gld${EMULATION_NAME}_open_dynamic_archive - PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *)); -static void gld${EMULATION_NAME}_find_address_statement - PARAMS ((lang_statement_union_type *)); -static void gld${EMULATION_NAME}_create_output_section_statements - PARAMS ((void)); -static void gld${EMULATION_NAME}_before_allocation PARAMS ((void)); -static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile)); - static void -gld${EMULATION_NAME}_before_parse() +gld${EMULATION_NAME}_before_parse (void) { - const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}"); - if (arch) - { - ldfile_output_architecture = arch->arch; - ldfile_output_machine = arch->mach; - ldfile_output_machine_name = arch->printable_name; - } - else - ldfile_output_architecture = bfd_arch_${ARCH}; + ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`); config.dynamic_link = TRUE; config.has_shared = TRUE; } @@ -74,10 +56,8 @@ gld${EMULATION_NAME}_before_parse() dynamic libraries have an extension of .sa. */ static bfd_boolean -gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) - const char *arch; - search_dirs_type *search; - lang_input_statement_type *entry; +gld${EMULATION_NAME}_open_dynamic_archive + (const char *arch, search_dirs_type *search, lang_input_statement_type *entry) { char *string; @@ -110,8 +90,7 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) Linux tools. */ static void -gld${EMULATION_NAME}_find_address_statement (s) - lang_statement_union_type *s; +gld${EMULATION_NAME}_find_address_statement (lang_statement_union_type *s) { if (s->header.type == lang_address_statement_enum && strcmp (s->address_statement.section_name, ".text") == 0) @@ -124,7 +103,7 @@ gld${EMULATION_NAME}_find_address_statement (s) /* This is called before opening the input BFD's. */ static void -gld${EMULATION_NAME}_create_output_section_statements () +gld${EMULATION_NAME}_create_output_section_statements (void) { lang_for_each_statement (gld${EMULATION_NAME}_find_address_statement); } @@ -133,9 +112,9 @@ gld${EMULATION_NAME}_create_output_section_statements () sections, but before any sizes or addresses have been set. */ static void -gld${EMULATION_NAME}_before_allocation () +gld${EMULATION_NAME}_before_allocation (void) { - if (link_info.relocateable) + if (link_info.relocatable) return; /* Let the backend work out the sizes of any sections required by @@ -145,8 +124,7 @@ gld${EMULATION_NAME}_before_allocation () } static char * -gld${EMULATION_NAME}_get_script(isfile) - int *isfile; +gld${EMULATION_NAME}_get_script (int *isfile) EOF if test -n "$COMPILE_IN" @@ -160,11 +138,11 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return EOF sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c @@ -181,9 +159,9 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 1; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable) + else if (link_info.relocatable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; diff --git a/gnu/usr.bin/binutils/ld/emultempl/lnk960.em b/gnu/usr.bin/binutils/ld/emultempl/lnk960.em index ba0fe93b6f6..2c294ec63b9 100644 --- a/gnu/usr.bin/binutils/ld/emultempl/lnk960.em +++ b/gnu/usr.bin/binutils/ld/emultempl/lnk960.em @@ -47,23 +47,9 @@ static lib_list_type **hll_list_tail = &hll_list; static lib_list_type *syslib_list; static lib_list_type **syslib_list_tail = &syslib_list; -static void append PARAMS ((lib_list_type ***, char *)); -static void lnk960_hll PARAMS ((char *)); -static void lnk960_syslib PARAMS ((char *)); -static void lnk960_before_parse PARAMS ((void)); -static void add_on PARAMS ((lib_list_type *, lang_input_file_enum_type)); -static void lnk960_after_parse PARAMS ((void)); -static void lnk960_before_allocation PARAMS ((void)); -static void lnk960_after_allocation PARAMS ((void)); -static void lnk960_set_output_arch PARAMS ((void)); -static char *lnk960_choose_target PARAMS ((int, char **)); -static char *lnk960_get_script PARAMS ((int *)); - static void -append (list, name) - lib_list_type ***list; - char *name; +append (lib_list_type ***list, char *name) { lib_list_type *element = (lib_list_type *) xmalloc (sizeof (lib_list_type)); @@ -78,8 +64,7 @@ static bfd_boolean had_hll = FALSE; static bfd_boolean had_hll_name = FALSE; static void -lnk960_hll (name) - char *name; +lnk960_hll (char *name) { had_hll = TRUE; if (name != (char *) NULL) @@ -89,9 +74,8 @@ lnk960_hll (name) } } -static void -lnk960_syslib (name) - char *name; +static void +lnk960_syslib (char *name) { append (&syslib_list_tail, name); } @@ -99,8 +83,8 @@ lnk960_syslib (name) #ifdef GNU960 -static void -lnk960_before_parse () +static void +lnk960_before_parse (void) { static char *env_variables[] = { "G960LIB", "G960BASE", 0 }; char **p; @@ -123,8 +107,8 @@ lnk960_before_parse () #else /* not GNU960 */ -static void -lnk960_before_parse () +static void +lnk960_before_parse (void) { char *name = getenv ("I960BASE"); @@ -145,9 +129,7 @@ lnk960_before_parse () static void -add_on (list, search) - lib_list_type *list; - lang_input_file_enum_type search; +add_on (lib_list_type *list, lang_input_file_enum_type search) { while (list) { @@ -155,15 +137,16 @@ add_on (list, search) list = list->next; } } + static void -lnk960_after_parse () +lnk960_after_parse (void) { /* If there has been no arch, default to -KB */ if (ldfile_output_machine_name[0] == 0) ldfile_add_arch ("KB"); /* if there has been no hll list then add our own */ - + if (had_hll && !had_hll_name) { append (&hll_list_tail, "cg"); @@ -171,20 +154,20 @@ lnk960_after_parse () || ldfile_output_machine == bfd_mach_i960_ca) append (&hll_list_tail, "fpg"); } - + add_on (hll_list, lang_input_file_is_l_enum); add_on (syslib_list, lang_input_file_is_search_file_enum); } static void -lnk960_before_allocation () +lnk960_before_allocation (void) { } static void -lnk960_after_allocation () +lnk960_after_allocation (void) { - if (!link_info.relocateable) + if (!link_info.relocatable) { lang_abs_symbol_at_end_of (".text", "_etext"); lang_abs_symbol_at_end_of (".data", "_edata"); @@ -197,7 +180,7 @@ lnk960_after_allocation () static struct { unsigned long number; - char *name; + char *name; } machine_table[] = { @@ -227,7 +210,7 @@ machine_table[] = }; static void -lnk960_set_output_arch () +lnk960_set_output_arch (void) { /* Set the output architecture and machine if possible */ unsigned int i; @@ -245,9 +228,7 @@ lnk960_set_output_arch () } static char * -lnk960_choose_target (argc, argv) - int argc ATTRIBUTE_UNUSED; - char **argv ATTRIBUTE_UNUSED; +lnk960_choose_target (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { #ifdef GNU960 @@ -268,8 +249,7 @@ lnk960_choose_target (argc, argv) } static char * -lnk960_get_script (isfile) - int *isfile; +lnk960_get_script (int *isfile) EOF if test -n "$COMPILE_IN" @@ -280,14 +260,14 @@ then sc="-f stringify.sed" cat >>e${EMULATION_NAME}.c <<EOF -{ +{ *isfile = 0; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return EOF sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c @@ -301,12 +281,12 @@ else # Scripts read from the filesystem. cat >>e${EMULATION_NAME}.c <<EOF -{ +{ *isfile = 1; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable) + else if (link_info.relocatable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; @@ -321,7 +301,7 @@ fi cat >>e${EMULATION_NAME}.c <<EOF -struct ld_emulation_xfer_struct ld_lnk960_emulation = +struct ld_emulation_xfer_struct ld_lnk960_emulation = { lnk960_before_parse, lnk960_syslib, diff --git a/gnu/usr.bin/binutils/ld/emultempl/mipsecoff.em b/gnu/usr.bin/binutils/ld/emultempl/mipsecoff.em index 6e417ed52c6..dde33c24be5 100644 --- a/gnu/usr.bin/binutils/ld/emultempl/mipsecoff.em +++ b/gnu/usr.bin/binutils/ld/emultempl/mipsecoff.em @@ -1,6 +1,6 @@ # This shell script emits a C file. -*- C -*- # It does some substitutions. -if [ -z "$MACHINE" ]; then +if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH} else OUTPUT_ARCH=${ARCH}:${MACHINE} @@ -9,7 +9,7 @@ cat >e${EMULATION_NAME}.c <<EOF /* This file is is generated by a shell script. DO NOT EDIT! */ /* Handle embedded relocs for MIPS. - Copyright 1994, 1995, 1997, 2000, 2002, 2003 + Copyright 1994, 1995, 1997, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@cygnus.com> based on generic.em. @@ -44,25 +44,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ldfile.h" #include "ldemul.h" -static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); -static void gld${EMULATION_NAME}_after_open PARAMS ((void)); -static void check_sections PARAMS ((bfd *, asection *, PTR)); -static void gld${EMULATION_NAME}_after_allocation PARAMS ((void)); -static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile)); +static void check_sections (bfd *, asection *, void *); static void -gld${EMULATION_NAME}_before_parse() +gld${EMULATION_NAME}_before_parse (void) { #ifndef TARGET_ /* I.e., if not generic. */ - const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}"); - if (arch) - { - ldfile_output_architecture = arch->arch; - ldfile_output_machine = arch->mach; - ldfile_output_machine_name = arch->printable_name; - } - else - ldfile_output_architecture = bfd_arch_${ARCH}; + ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`); #endif /* not TARGET_ */ } @@ -74,12 +62,12 @@ gld${EMULATION_NAME}_before_parse() have been compiled using -membedded-pic. */ static void -gld${EMULATION_NAME}_after_open () +gld${EMULATION_NAME}_after_open (void) { bfd *abfd; if (! command_line.embedded_relocs - || link_info.relocateable) + || link_info.relocatable) return; for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next) @@ -119,7 +107,7 @@ gld${EMULATION_NAME}_after_open () /* Double check that all other data sections are empty, as is required for embedded PIC code. */ - bfd_map_over_sections (abfd, check_sections, (PTR) datasec); + bfd_map_over_sections (abfd, check_sections, datasec); } } @@ -127,13 +115,10 @@ gld${EMULATION_NAME}_after_open () relocs. This is called via bfd_map_over_sections. */ static void -check_sections (abfd, sec, sdatasec) - bfd *abfd; - asection *sec; - PTR sdatasec; +check_sections (bfd *abfd, asection *sec, void *sdatasec) { if ((bfd_get_section_flags (abfd, sec) & SEC_CODE) == 0 - && sec != (asection *) sdatasec + && sec != sdatasec && sec->reloc_count != 0) einfo ("%B%X: section %s has relocs; can not use --embedded-relocs\n", abfd, bfd_get_section_name (abfd, sec)); @@ -144,12 +129,12 @@ check_sections (abfd, sec, sdatasec) BFD backend routine to do the work. */ static void -gld${EMULATION_NAME}_after_allocation () +gld${EMULATION_NAME}_after_allocation (void) { bfd *abfd; if (! command_line.embedded_relocs - || link_info.relocateable) + || link_info.relocatable) return; for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next) @@ -180,8 +165,7 @@ gld${EMULATION_NAME}_after_allocation () } static char * -gld${EMULATION_NAME}_get_script(isfile) - int *isfile; +gld${EMULATION_NAME}_get_script (int *isfile) EOF if test -n "$COMPILE_IN" @@ -192,14 +176,14 @@ then sc="-f stringify.sed" cat >>e${EMULATION_NAME}.c <<EOF -{ +{ *isfile = 0; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return EOF sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c @@ -213,12 +197,12 @@ else # Scripts read from the filesystem. cat >>e${EMULATION_NAME}.c <<EOF -{ +{ *isfile = 1; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable) + else if (link_info.relocatable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; @@ -233,7 +217,7 @@ fi cat >>e${EMULATION_NAME}.c <<EOF -struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = +struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = { gld${EMULATION_NAME}_before_parse, syslib_default, diff --git a/gnu/usr.bin/binutils/ld/emultempl/pe.em b/gnu/usr.bin/binutils/ld/emultempl/pe.em index 10522d75759..7d6c2e8a6d1 100644 --- a/gnu/usr.bin/binutils/ld/emultempl/pe.em +++ b/gnu/usr.bin/binutils/ld/emultempl/pe.em @@ -9,7 +9,7 @@ rm -f e${EMULATION_NAME}.c (echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-) cat >>e${EMULATION_NAME}.c <<EOF /* This file is part of GLD, the Gnu Linker. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -68,8 +68,7 @@ cat >>e${EMULATION_NAME}.c <<EOF #include "deffile.h" #include "pe-dll.h" - -#include <ctype.h> +#include "safe-ctype.h" /* Permit the emulation parameters to override the default section alignment by setting OVERRIDE_SECTION_ALIGNMENT. FIXME: This makes @@ -104,44 +103,6 @@ cat >>e${EMULATION_NAME}.c <<EOF #define PE_DEF_FILE_ALIGNMENT 0x00000200 #endif -static void gld_${EMULATION_NAME}_set_symbols PARAMS ((void)); -static void gld_${EMULATION_NAME}_after_open PARAMS ((void)); -static void gld_${EMULATION_NAME}_before_parse PARAMS ((void)); -static void gld_${EMULATION_NAME}_after_parse PARAMS ((void)); -static void gld_${EMULATION_NAME}_before_allocation PARAMS ((void)); -static asection *output_prev_sec_find - PARAMS ((lang_output_section_statement_type *)); -static bfd_boolean gld_${EMULATION_NAME}_place_orphan - PARAMS ((lang_input_statement_type *, asection *)); -static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *)); -static void gld_${EMULATION_NAME}_finish PARAMS ((void)); -static bfd_boolean gld_${EMULATION_NAME}_open_dynamic_archive - PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *)); -static void gld${EMULATION_NAME}_add_options - PARAMS ((int, char **, int, struct option **, int, struct option **)); -static bfd_boolean gld${EMULATION_NAME}_handle_option PARAMS ((int)); -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 bfd_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 bfd_boolean pr_sym PARAMS ((struct bfd_hash_entry *, PTR)); -static bfd_boolean gld_${EMULATION_NAME}_unrecognized_file - PARAMS ((lang_input_statement_type *)); -static bfd_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; @@ -160,17 +121,9 @@ static char *pe_dll_search_prefix = NULL; extern const char *output_filename; static void -gld_${EMULATION_NAME}_before_parse() +gld_${EMULATION_NAME}_before_parse (void) { - const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}"); - if (arch) - { - ldfile_output_architecture = arch->arch; - ldfile_output_machine = arch->mach; - ldfile_output_machine_name = arch->printable_name; - } - else - ldfile_output_architecture = bfd_arch_${ARCH}; + ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`); output_filename = "${EXECUTABLE_NAME:-a.exe}"; #ifdef DLL_SUPPORT config.dynamic_link = TRUE; @@ -180,9 +133,9 @@ gld_${EMULATION_NAME}_before_parse() #if (PE_DEF_SUBSYSTEM == 9) || (PE_DEF_SUBSYSTEM == 2) #if defined TARGET_IS_mipspe || defined TARGET_IS_armpe - lang_add_entry ("WinMainCRTStartup", 1); + lang_add_entry ("WinMainCRTStartup", FALSE); #else - lang_add_entry ("_WinMainCRTStartup", 1); + lang_add_entry ("_WinMainCRTStartup", FALSE); #endif #endif #endif @@ -202,8 +155,8 @@ gld_${EMULATION_NAME}_before_parse() #define OPTION_MINOR_OS_VERSION (OPTION_MINOR_IMAGE_VERSION + 1) #define OPTION_MINOR_SUBSYSTEM_VERSION (OPTION_MINOR_OS_VERSION + 1) #define OPTION_SECTION_ALIGNMENT (OPTION_MINOR_SUBSYSTEM_VERSION + 1) -#define OPTION_STACK (OPTION_SECTION_ALIGNMENT + 1) -#define OPTION_SUBSYSTEM (OPTION_STACK + 1) +#define OPTION_STACK (OPTION_SECTION_ALIGNMENT + 1) +#define OPTION_SUBSYSTEM (OPTION_STACK + 1) #define OPTION_HEAP (OPTION_SUBSYSTEM + 1) #define OPTION_SUPPORT_OLD_CODE (OPTION_HEAP + 1) #define OPTION_OUT_DEF (OPTION_SUPPORT_OLD_CODE + 1) @@ -231,13 +184,10 @@ gld_${EMULATION_NAME}_before_parse() (OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC + 1) static void -gld${EMULATION_NAME}_add_options (ns, shortopts, nl, longopts, nrl, really_longopts) - int ns ATTRIBUTE_UNUSED; - char **shortopts ATTRIBUTE_UNUSED; - int nl; - struct option **longopts; - int nrl ATTRIBUTE_UNUSED; - struct option **really_longopts ATTRIBUTE_UNUSED; +gld${EMULATION_NAME}_add_options + (int ns ATTRIBUTE_UNUSED, char **shortopts ATTRIBUTE_UNUSED, int nl, + struct option **longopts, int nrl ATTRIBUTE_UNUSED, + struct option **really_longopts ATTRIBUTE_UNUSED) { static const struct option xtra_long[] = { /* PE options */ @@ -337,8 +287,7 @@ static definfo init[] = static void -gld_${EMULATION_NAME}_list_options (file) - FILE * file; +gld_${EMULATION_NAME}_list_options (FILE *file) { fprintf (file, _(" --base_file <basefile> Generate a base file for relocatable DLLs\n")); fprintf (file, _(" --dll Set image base to the default for DLLs\n")); @@ -390,9 +339,7 @@ gld_${EMULATION_NAME}_list_options (file) static void -set_pe_name (name, val) - char *name; - long val; +set_pe_name (char *name, long val) { int i; @@ -411,7 +358,7 @@ set_pe_name (name, val) static void -set_pe_subsystem () +set_pe_subsystem (void) { const char *sver; int len; @@ -484,7 +431,7 @@ set_pe_subsystem () entry = alc_entry; } - lang_add_entry (entry, 0); + lang_add_entry (entry, TRUE); return; } @@ -495,9 +442,7 @@ set_pe_subsystem () static void -set_pe_value (name) - char *name; - +set_pe_value (char *name) { char *end; @@ -511,9 +456,7 @@ set_pe_value (name) static void -set_pe_stack_heap (resname, comname) - char *resname; - char *comname; +set_pe_stack_heap (char *resname, char *comname) { set_pe_value (resname); @@ -528,8 +471,7 @@ set_pe_stack_heap (resname, comname) static bfd_boolean -gld${EMULATION_NAME}_handle_option (optc) - int optc; +gld${EMULATION_NAME}_handle_option (int optc) { switch (optc) { @@ -537,7 +479,7 @@ gld${EMULATION_NAME}_handle_option (optc) return FALSE; case OPTION_BASE_FILE: - link_info.base_file = (PTR) fopen (optarg, FOPEN_WB); + link_info.base_file = fopen (optarg, FOPEN_WB); if (link_info.base_file == NULL) { /* xgettext:c-format */ @@ -698,7 +640,7 @@ compute_dll_image_base (const char *ofile) read. */ static void -gld_${EMULATION_NAME}_set_symbols () +gld_${EMULATION_NAME}_set_symbols (void) { /* Run through and invent symbols for all the names and insert the defaults. */ @@ -707,7 +649,7 @@ gld_${EMULATION_NAME}_set_symbols () if (!init[IMAGEBASEOFF].inited) { - if (link_info.relocateable) + if (link_info.relocatable) init[IMAGEBASEOFF].value = 0; else if (init[DLLOFF].value || link_info.shared) #ifdef DLL_SUPPORT @@ -720,8 +662,8 @@ gld_${EMULATION_NAME}_set_symbols () init[IMAGEBASEOFF].value = NT_EXE_IMAGE_BASE; } - /* Don't do any symbol assignments if this is a relocateable link. */ - if (link_info.relocateable) + /* Don't do any symbol assignments if this is a relocatable link. */ + if (link_info.relocatable) return; /* Glue the assignments into the abs section. */ @@ -762,7 +704,7 @@ gld_${EMULATION_NAME}_set_symbols () have been read. */ static void -gld_${EMULATION_NAME}_after_parse () +gld_${EMULATION_NAME}_after_parse (void) { /* The Windows libraries are designed for the linker to treat the entry point as an undefined symbol. Otherwise, the .obj that @@ -777,7 +719,7 @@ gld_${EMULATION_NAME}_after_parse () opened, so registering the symbol as undefined will make a difference. */ - if (! link_info.relocateable && entry_symbol.name != NULL) + if (! link_info.relocatable && entry_symbol.name != NULL) ldlang_add_undef (entry_symbol.name); } @@ -792,13 +734,12 @@ char * pe_data_import_dll; static struct bfd_link_hash_entry *pe_undef_found_sym; static bfd_boolean -pe_undef_cdecl_match (h, string) - struct bfd_link_hash_entry *h; - PTR string; +pe_undef_cdecl_match (struct bfd_link_hash_entry *h, void *inf) { int sl; + char *string = inf; - sl = strlen (string); /* Silence compiler warning. */ + sl = strlen (string); if (h->type == bfd_link_hash_defined && strncmp (h->root.string, string, sl) == 0 && h->root.string[sl] == '@') @@ -810,7 +751,7 @@ pe_undef_cdecl_match (h, string) } static void -pe_fixup_stdcalls () +pe_fixup_stdcalls (void) { static int gave_warning_message = 0; struct bfd_link_hash_entry *undef, *sym; @@ -818,7 +759,7 @@ pe_fixup_stdcalls () if (pe_dll_extra_pe_debug) printf ("%s\n", __FUNCTION__); - for (undef = link_info.hash->undefs; undef; undef=undef->next) + for (undef = link_info.hash->undefs; undef; undef=undef->und_next) if (undef->type == bfd_link_hash_undefined) { char* at = strchr (undef->root.string, '@'); @@ -859,7 +800,7 @@ pe_fixup_stdcalls () symbols - which means scanning the whole symbol table. */ pe_undef_found_sym = 0; bfd_link_hash_traverse (link_info.hash, pe_undef_cdecl_match, - (PTR) undef->root.string); + (char *) undef->root.string); sym = pe_undef_found_sym; if (sym) { @@ -884,11 +825,9 @@ pe_fixup_stdcalls () } static int -make_import_fixup (rel, s) - arelent *rel; - asection *s; +make_import_fixup (arelent *rel, asection *s) { - struct symbol_cache_entry *sym = *rel->sym_ptr_ptr; + struct bfd_symbol *sym = *rel->sym_ptr_ptr; int addend = 0; if (pe_dll_extra_pe_debug) @@ -905,14 +844,14 @@ make_import_fixup (rel, s) } static void -pe_find_data_imports () +pe_find_data_imports (void) { struct bfd_link_hash_entry *undef, *sym; if (link_info.pei386_auto_import == 0) return; - for (undef = link_info.hash->undefs; undef; undef=undef->next) + for (undef = link_info.hash->undefs; undef; undef=undef->und_next) { if (undef->type == bfd_link_hash_undefined) { @@ -969,23 +908,22 @@ pe_find_data_imports () } } } -#endif /* DLL_SUPPORT */ static bfd_boolean -pr_sym (h, string) - struct bfd_hash_entry *h; - PTR string ATTRIBUTE_UNUSED; +pr_sym (struct bfd_hash_entry *h, void *inf ATTRIBUTE_UNUSED) { if (pe_dll_extra_pe_debug) - printf ("+%s\n",h->string); + printf ("+%s\n", h->string); return TRUE; } +#endif /* DLL_SUPPORT */ static void -gld_${EMULATION_NAME}_after_open () +gld_${EMULATION_NAME}_after_open (void) { +#ifdef DLL_SUPPORT if (pe_dll_extra_pe_debug) { bfd *a; @@ -993,13 +931,14 @@ gld_${EMULATION_NAME}_after_open () printf ("%s()\n", __FUNCTION__); - for (sym = link_info.hash->undefs; sym; sym=sym->next) + for (sym = link_info.hash->undefs; sym; sym=sym->und_next) printf ("-%s\n", sym->root.string); - bfd_hash_traverse (&link_info.hash->table, pr_sym,NULL); + bfd_hash_traverse (&link_info.hash->table, pr_sym, NULL); for (a = link_info.input_bfds; a; a = a->link_next) printf ("*%s\n",a->filename); } +#endif /* Pass the wacky PE command line options into the output bfd. FIXME: This should be done via a function, rather than by @@ -1022,7 +961,7 @@ gld_${EMULATION_NAME}_after_open () #if ! (defined (TARGET_IS_i386pe) || defined (TARGET_IS_armpe)) if (link_info.shared) #else - if (!link_info.relocateable) + if (!link_info.relocatable) #endif pe_dll_build_sections (output_bfd, &link_info); @@ -1122,7 +1061,7 @@ gld_${EMULATION_NAME}_after_open () for (i = 0; i < nrelocs; i++) { - struct symbol_cache_entry *s; + struct bfd_symbol *s; struct bfd_link_hash_entry * blhe; bfd *other_bfd; char *n; @@ -1168,6 +1107,7 @@ gld_${EMULATION_NAME}_after_open () int is_ms_arch = 0; bfd *cur_arch = 0; lang_input_statement_type *is2; + lang_input_statement_type *is3; /* Careful - this is a shell script. Watch those dollar signs! */ /* Microsoft import libraries have every member named the same, @@ -1182,21 +1122,59 @@ gld_${EMULATION_NAME}_after_open () { if (is->the_bfd->my_archive) { + char *pnt; bfd *arch = is->the_bfd->my_archive; + if (cur_arch != arch) { cur_arch = arch; is_ms_arch = 1; - for (is2 = is; - is2 && is2->the_bfd->my_archive == arch; - is2 = (lang_input_statement_type *)is2->next) + + for (is3 = is; + is3 && is3->the_bfd->my_archive == arch; + is3 = (lang_input_statement_type *) is3->next) + { + /* A MS dynamic import library can also contain static + members, so look for the first element with a .dll + extension, and use that for the remainder of the + comparisons. */ + pnt = strrchr (is3->the_bfd->filename, '.'); + if (pnt != NULL && strcmp (pnt, ".dll") == 0) + break; + } + + if (is3 == NULL) + is_ms_arch = 0; + else { - if (strcmp (is->the_bfd->filename, is2->the_bfd->filename)) - is_ms_arch = 0; + /* OK, found one. Now look to see if the remaining + (dynamic import) members use the same name. */ + for (is2 = is; + is2 && is2->the_bfd->my_archive == arch; + is2 = (lang_input_statement_type *) is2->next) + { + /* Skip static members, ie anything with a .obj + extension. */ + pnt = strrchr (is2->the_bfd->filename, '.'); + if (pnt != NULL && strcmp (pnt, ".obj") == 0) + continue; + + if (strcmp (is3->the_bfd->filename, + is2->the_bfd->filename)) + { + is_ms_arch = 0; + break; + } + } } } - if (is_ms_arch) + /* This fragment might have come from an .obj file in a Microsoft + import, and not an actual import record. If this is the case, + then leave the filename alone. */ + pnt = strrchr (is->the_bfd->filename, '.'); + + if (is_ms_arch && (strcmp (pnt, ".dll") == 0)) { int idata2 = 0, reloc_count=0; asection *sec; @@ -1230,7 +1208,7 @@ gld_${EMULATION_NAME}_after_open () } static void -gld_${EMULATION_NAME}_before_allocation () +gld_${EMULATION_NAME}_before_allocation (void) { #ifdef TARGET_IS_ppcpe /* Here we rummage through the found bfds to collect toc information. */ @@ -1279,7 +1257,7 @@ gld_${EMULATION_NAME}_before_allocation () check here for .DEF files and pull them in automatically. */ static int -saw_option (char * option) +saw_option (char *option) { int i; @@ -1291,8 +1269,7 @@ saw_option (char * option) #endif /* DLL_SUPPORT */ static bfd_boolean -gld_${EMULATION_NAME}_unrecognized_file (entry) - lang_input_statement_type *entry ATTRIBUTE_UNUSED; +gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED) { #ifdef DLL_SUPPORT const char *ext = entry->filename + strlen (entry->filename) - 4; @@ -1381,8 +1358,7 @@ gld_${EMULATION_NAME}_unrecognized_file (entry) } static bfd_boolean -gld_${EMULATION_NAME}_recognized_file (entry) - lang_input_statement_type *entry ATTRIBUTE_UNUSED; +gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED) { #ifdef DLL_SUPPORT #ifdef TARGET_IS_i386pe @@ -1415,7 +1391,7 @@ gld_${EMULATION_NAME}_recognized_file (entry) } static void -gld_${EMULATION_NAME}_finish () +gld_${EMULATION_NAME}_finish (void) { #if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe) struct bfd_link_hash_entry * h; @@ -1462,7 +1438,7 @@ gld_${EMULATION_NAME}_finish () #ifdef DLL_SUPPORT if (link_info.shared #if !defined(TARGET_IS_shpe) && !defined(TARGET_IS_mipspe) - || (!link_info.relocateable && pe_def_file->num_exports != 0) + || (!link_info.relocatable && pe_def_file->num_exports != 0) #endif ) { @@ -1499,8 +1475,7 @@ gld_${EMULATION_NAME}_finish () Used by place_orphan. */ static asection * -output_prev_sec_find (os) - lang_output_section_statement_type *os; +output_prev_sec_find (lang_output_section_statement_type *os) { asection *s = (asection *) NULL; lang_statement_union_type *u; @@ -1542,9 +1517,7 @@ struct orphan_save }; static bfd_boolean -gld_${EMULATION_NAME}_place_orphan (file, s) - lang_input_statement_type *file; - asection *s; +gld_${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s) { const char *secname; char *hold_section_name; @@ -1557,7 +1530,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s) /* Look through the script to see where to place this section. */ hold_section_name = xstrdup (secname); - if (!link_info.relocateable) + if (!link_info.relocatable) { dollar = strchr (hold_section_name, '$'); if (dollar != NULL) @@ -1648,7 +1621,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s) /* If the name of the section is representable in C, then create symbols to mark the start and the end of the section. */ for (ps = outsecname; *ps != '\0'; ps++) - if (! isalnum ((unsigned char) *ps) && *ps != '_') + if (! ISALNUM ((unsigned char) *ps) && *ps != '_') break; if (*ps == '\0') { @@ -1663,7 +1636,7 @@ gld_${EMULATION_NAME}_place_orphan (file, s) } } - if (link_info.relocateable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0) + if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0) address = exp_intop ((bfd_vma) 0); else { @@ -1674,7 +1647,6 @@ gld_${EMULATION_NAME}_place_orphan (file, s) } os = lang_enter_output_section_statement (outsecname, address, 0, - (bfd_vma) 0, (etree_type *) NULL, (etree_type *) NULL, (etree_type *) NULL); @@ -1825,10 +1797,9 @@ gld_${EMULATION_NAME}_place_orphan (file, s) } static bfd_boolean -gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) - const char * arch ATTRIBUTE_UNUSED; - search_dirs_type * search; - lang_input_statement_type * entry; +gld_${EMULATION_NAME}_open_dynamic_archive + (const char *arch ATTRIBUTE_UNUSED, search_dirs_type *search, + lang_input_statement_type *entry) { const char * filename; char * string; @@ -1916,16 +1887,14 @@ gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) } static int -gld_${EMULATION_NAME}_find_potential_libraries (name, entry) - char * name; - lang_input_statement_type * entry; +gld_${EMULATION_NAME}_find_potential_libraries + (char *name, lang_input_statement_type *entry) { return ldfile_open_file_search (name, entry, "", ".lib"); } static char * -gld_${EMULATION_NAME}_get_script (isfile) - int *isfile; +gld_${EMULATION_NAME}_get_script (int *isfile) EOF # Scripts compiled in. # sed commands to quote an ld script as a C string. @@ -1935,11 +1904,11 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return EOF sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c diff --git a/gnu/usr.bin/binutils/ld/emultempl/sunos.em b/gnu/usr.bin/binutils/ld/emultempl/sunos.em index 8cabe3a0a2a..358bc9aabb9 100644 --- a/gnu/usr.bin/binutils/ld/emultempl/sunos.em +++ b/gnu/usr.bin/binutils/ld/emultempl/sunos.em @@ -9,8 +9,8 @@ cat >e${EMULATION_NAME}.c <<EOF /* This file is is generated by a shell script. DO NOT EDIT! */ /* SunOS emulation code for ${EMULATION_NAME} - Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 - Free Software Foundation, Inc. + Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, + 2003, 2004 Free Software Foundation, Inc. Written by Steve Chamberlain <sac@cygnus.com> SunOS shared library support by Ian Lance Taylor <ian@cygnus.com> @@ -61,43 +61,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ # endif #endif -static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); -static void gld${EMULATION_NAME}_set_symbols PARAMS ((void)); -static void gld${EMULATION_NAME}_create_output_section_statements - PARAMS ((void)); static void gld${EMULATION_NAME}_find_so - PARAMS ((lang_input_statement_type *)); + (lang_input_statement_type *); static char *gld${EMULATION_NAME}_search_dir - PARAMS ((const char *, const char *, bfd_boolean *)); -static void gld${EMULATION_NAME}_after_open PARAMS ((void)); + (const char *, const char *, bfd_boolean *); static void gld${EMULATION_NAME}_check_needed - PARAMS ((lang_input_statement_type *)); + (lang_input_statement_type *); static bfd_boolean gld${EMULATION_NAME}_search_needed - PARAMS ((const char *, const char *)); + (const char *, const char *); static bfd_boolean gld${EMULATION_NAME}_try_needed - PARAMS ((const char *, const char *)); -static void gld${EMULATION_NAME}_before_allocation PARAMS ((void)); + (const char *, const char *); static void gld${EMULATION_NAME}_find_assignment - PARAMS ((lang_statement_union_type *)); -static void gld${EMULATION_NAME}_find_exp_assignment PARAMS ((etree_type *)); + (lang_statement_union_type *); +static void gld${EMULATION_NAME}_find_exp_assignment + (etree_type *); static void gld${EMULATION_NAME}_count_need - PARAMS ((lang_input_statement_type *)); + (lang_input_statement_type *); static void gld${EMULATION_NAME}_set_need - PARAMS ((lang_input_statement_type *)); -static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile)); + (lang_input_statement_type *); static void -gld${EMULATION_NAME}_before_parse() +gld${EMULATION_NAME}_before_parse (void) { - const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}"); - if (arch) - { - ldfile_output_architecture = arch->arch; - ldfile_output_machine = arch->mach; - ldfile_output_machine_name = arch->printable_name; - } - else - ldfile_output_architecture = bfd_arch_${ARCH}; + ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`); config.dynamic_link = TRUE; config.has_shared = TRUE; } @@ -108,7 +94,7 @@ gld${EMULATION_NAME}_before_parse() list. */ static void -gld${EMULATION_NAME}_set_symbols () +gld${EMULATION_NAME}_set_symbols (void) { EOF if [ "x${host}" = "x${target}" ] ; then @@ -154,7 +140,7 @@ cat >>e${EMULATION_NAME}.c <<EOF search it after including the .so file. */ static void -gld${EMULATION_NAME}_create_output_section_statements () +gld${EMULATION_NAME}_create_output_section_statements (void) { lang_for_each_input_file (gld${EMULATION_NAME}_find_so); } @@ -162,8 +148,7 @@ gld${EMULATION_NAME}_create_output_section_statements () /* Search the directory for a .so file for each library search. */ static void -gld${EMULATION_NAME}_find_so (inp) - lang_input_statement_type *inp; +gld${EMULATION_NAME}_find_so (lang_input_statement_type *inp) { search_dirs_type *search; char *found = NULL; @@ -234,10 +219,8 @@ gld${EMULATION_NAME}_find_so (inp) /* Search a directory for a .so file. */ static char * -gld${EMULATION_NAME}_search_dir (dirname, filename, found_static) - const char *dirname; - const char *filename; - bfd_boolean *found_static; +gld${EMULATION_NAME}_search_dir + (const char *dirname, const char *filename, bfd_boolean *found_static) { int force_maj, force_min; const char *dot; @@ -302,9 +285,9 @@ gld${EMULATION_NAME}_search_dir (dirname, filename, found_static) } /* We accept libfoo.so without a version number, even though the - native linker does not. This is more convenient for packages - which just generate .so files for shared libraries, as on ELF - systems. */ + native linker does not. This is more convenient for packages + which just generate .so files for shared libraries, as on ELF + systems. */ if (strncmp (entry->d_name + 3 + len, ".so", 3) != 0) continue; if (entry->d_name[6 + len] == '\0') @@ -378,12 +361,12 @@ static bfd_boolean global_found; /* This is called after all the input files have been opened. */ static void -gld${EMULATION_NAME}_after_open () +gld${EMULATION_NAME}_after_open (void) { struct bfd_link_needed_list *needed, *l; /* We only need to worry about this when doing a final link. */ - if (link_info.relocateable || link_info.shared) + if (link_info.relocatable || link_info.shared) return; /* Get the list of files which appear in ld_need entries in dynamic @@ -514,9 +497,7 @@ cat >>e${EMULATION_NAME}.c <<EOF /* Search for a needed file in a path. */ static bfd_boolean -gld${EMULATION_NAME}_search_needed (path, name) - const char *path; - const char *name; +gld${EMULATION_NAME}_search_needed (const char *path, const char *name) { const char *s; @@ -559,9 +540,7 @@ gld${EMULATION_NAME}_search_needed (path, name) dynamic object. */ static bfd_boolean -gld${EMULATION_NAME}_try_needed (dir, name) - const char *dir; - const char *name; +gld${EMULATION_NAME}_try_needed (const char *dir, const char *name) { char *file; char *alc; @@ -603,8 +582,7 @@ gld${EMULATION_NAME}_try_needed (dir, name) dynamic object more than once. */ static void -gld${EMULATION_NAME}_check_needed (s) - lang_input_statement_type *s; +gld${EMULATION_NAME}_check_needed (lang_input_statement_type *s) { if (s->filename == NULL) return; @@ -679,7 +657,7 @@ static bfd_byte *need_pnames; sections, but before any sizes or addresses have been set. */ static void -gld${EMULATION_NAME}_before_allocation () +gld${EMULATION_NAME}_before_allocation (void) { struct bfd_link_hash_entry *hdyn = NULL; asection *sneed; @@ -689,11 +667,11 @@ gld${EMULATION_NAME}_before_allocation () /* The SunOS native linker creates a shared library whenever there are any undefined symbols in a link, unless -e is used. This is pretty weird, but we are compatible. */ - if (! link_info.shared && ! link_info.relocateable && ! entry_from_cmdline) + if (! link_info.shared && ! link_info.relocatable && ! entry_from_cmdline) { struct bfd_link_hash_entry *h; - for (h = link_info.hash->undefs; h != NULL; h = h->next) + for (h = link_info.hash->undefs; h != NULL; h = h->und_next) { if (h->type == bfd_link_hash_undefined && h->u.undef.abfd != NULL @@ -718,7 +696,7 @@ gld${EMULATION_NAME}_before_allocation () lang_output_section_statement_type *os; /* Set the .text section to start at 0x20, not 0x2020. FIXME: - This is too magical. */ + This is too magical. */ os = lang_output_section_statement_lookup (".text"); if (os->addr_tree == NULL) os->addr_tree = exp_intop (0x20); @@ -730,7 +708,7 @@ gld${EMULATION_NAME}_before_allocation () one. We need to create the symbol before calling size_dynamic_sections, although we can't set the value until afterward. */ - if (! link_info.relocateable) + if (! link_info.relocatable) { hdyn = bfd_link_hash_lookup (link_info.hash, "__DYNAMIC", TRUE, FALSE, FALSE); @@ -823,7 +801,7 @@ gld${EMULATION_NAME}_before_allocation () /* We must assign a value to __DYNAMIC. It should be zero if we are not doing a dynamic link, or the start of the .dynamic section if we are doing one. */ - if (! link_info.relocateable) + if (! link_info.relocatable) { hdyn->type = bfd_link_hash_defined; hdyn->u.def.value = 0; @@ -842,8 +820,7 @@ gld${EMULATION_NAME}_before_allocation () symbols which are referred to by dynamic objects. */ static void -gld${EMULATION_NAME}_find_assignment (s) - lang_statement_union_type *s; +gld${EMULATION_NAME}_find_assignment (lang_statement_union_type *s) { if (s->header.type == lang_assignment_statement_enum && (find_assign == NULL || ! found_assign)) @@ -853,8 +830,7 @@ gld${EMULATION_NAME}_find_assignment (s) /* Look through an expression for an assignment statement. */ static void -gld${EMULATION_NAME}_find_exp_assignment (exp) - etree_type *exp; +gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp) { switch (exp->type.node_class) { @@ -902,8 +878,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp) for more information. */ static void -gld${EMULATION_NAME}_count_need (inp) - lang_input_statement_type *inp; +gld${EMULATION_NAME}_count_need (lang_input_statement_type *inp) { if (inp->the_bfd != NULL && (inp->the_bfd->flags & DYNAMIC) != 0) @@ -924,8 +899,7 @@ gld${EMULATION_NAME}_count_need (inp) /* Fill in the contents of the .need section. */ static void -gld${EMULATION_NAME}_set_need (inp) - lang_input_statement_type *inp; +gld${EMULATION_NAME}_set_need (lang_input_statement_type *inp) { if (inp->the_bfd != NULL && (inp->the_bfd->flags & DYNAMIC) != 0) @@ -974,8 +948,7 @@ gld${EMULATION_NAME}_set_need (inp) } static char * -gld${EMULATION_NAME}_get_script(isfile) - int *isfile; +gld${EMULATION_NAME}_get_script (int *isfile) EOF if test -n "$COMPILE_IN" @@ -989,11 +962,11 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 0; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return EOF sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c -echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c +echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c @@ -1010,9 +983,9 @@ cat >>e${EMULATION_NAME}.c <<EOF { *isfile = 1; - if (link_info.relocateable && config.build_constructors) + if (link_info.relocatable && config.build_constructors) return "ldscripts/${EMULATION_NAME}.xu"; - else if (link_info.relocateable) + else if (link_info.relocatable) return "ldscripts/${EMULATION_NAME}.xr"; else if (!config.text_read_only) return "ldscripts/${EMULATION_NAME}.xbn"; diff --git a/gnu/usr.bin/binutils/ld/emultempl/vanilla.em b/gnu/usr.bin/binutils/ld/emultempl/vanilla.em index 8d4f6d4d32d..21410836752 100644 --- a/gnu/usr.bin/binutils/ld/emultempl/vanilla.em +++ b/gnu/usr.bin/binutils/ld/emultempl/vanilla.em @@ -35,17 +35,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ldfile.h" #include "ldemul.h" -static void vanilla_before_parse PARAMS ((void)); -static void vanilla_set_output_arch PARAMS ((void)); -static char *vanilla_get_script PARAMS ((int *)); - - -static void vanilla_before_parse() +static void vanilla_before_parse (void) { } static void -vanilla_set_output_arch() +vanilla_set_output_arch (void) { /* Set the output architecture and machine if possible */ unsigned long machine = 0; @@ -53,14 +48,13 @@ vanilla_set_output_arch() } static char * -vanilla_get_script(isfile) - int *isfile; +vanilla_get_script (int *isfile) { *isfile = 0; return ""; } -struct ld_emulation_xfer_struct ld_vanilla_emulation = +struct ld_emulation_xfer_struct ld_vanilla_emulation = { vanilla_before_parse, syslib_default, diff --git a/gnu/usr.bin/binutils/ld/genscripts.sh b/gnu/usr.bin/binutils/ld/genscripts.sh index b3fe1ce6b01..ceb705c9b89 100644 --- a/gnu/usr.bin/binutils/ld/genscripts.sh +++ b/gnu/usr.bin/binutils/ld/genscripts.sh @@ -1,15 +1,61 @@ #!/bin/sh # genscripts.sh - generate the ld-emulation-target specific files # -# Usage: genscripts.sh srcdir libdir exec_prefix \ -# host target target_alias default_emulation \ -# native_lib_dirs use_sysroot this_emulation tool_dir +# Usage: genscripts_extra.sh \ +# srcdir \ +# libdir \ +# exec_prefix \ +# host \ +# target \ +# target_alias \ +# default_emulation \ +# native_lib_dirs \ +# use_sysroot \ +# this_emulation \ +# optional: +# tool_dir \ +# customizer_script # # Sample usage: -# genscripts.sh /djm/ld-devo/devo/ld /usr/local/lib /usr/local \ -# sparc-sun-sunos4.1.3 sparc-sun-sunos4.1.3 sparc-sun-sunos4.1.3 sun4 \ -# "" no sun3 sparc-sun-sunos4.1.3 -# produces sun3.x sun3.xbn sun3.xn sun3.xr sun3.xu em_sun3.c +# +# genscripts_extra.sh \ +# /sources/ld \ +# /usr/local/lib \ +# /usr/local \ +# sparc-sun-sunos4.1.3 \ +# sparc-sun-sunos4.1.3 \ +# sparc-sun-sunos4.1.3 \ +# sun4 \ +# "" \ +# no \ +# sun3 \ +# sparc-sun-sunos4.1.3 \ +# sparc.sh +# +# produces the linker scripts: +# +# sun3.x [default linker script] +# sun3.xbn [used when the linker is invoked with "-N"] +# sun3.xn [used when the linker is invoked with "-n"] +# sun3.xr [used when the linker is invoked with "-r"] +# sun3.xu [used when the linker is invoked with "-Ur"] +# and maybe: +# sun3.xc [used when the linker is invoked with "-z combreloc"] +# sun3.xsc [used when the linker is invoked with "--shared"] +# sun3.xdc [used when the linker is invoked with "-pie"] +# +# It also produced the C source file: +# +# em_sun3.c +# +# which is then compiled into the linker. +# +# The linker scripts are created by running the shell script +# /sources/ld/emulparams/sparc.sh to set the value of ${SCRIPT_NAME} +# (and any other variables it wants to). ${SCRIPT_NAME} is then +# invoked with a variable called ${LD_FLAG} to tell it which version +# of the linker script to create. + srcdir=$1 libdir=$2 @@ -22,16 +68,23 @@ NATIVE_LIB_DIRS=$8 use_sysroot=$9 shift 9 EMULATION_NAME=$1 -shift -# Can't use ${1:-$target_alias} here due to an Ultrix shell bug. -if [ "x$1" = "x" ] ; then +TOOL_LIB=$2 +CUSTOMIZER_SCRIPT=$3 + +# Can't use ${TOOL_LIB:-$target_alias} here due to an Ultrix shell bug. +if [ "x${TOOL_LIB}" = "x" ] ; then tool_lib=${exec_prefix}/${target_alias}/lib else - tool_lib=${exec_prefix}/$1/lib + tool_lib=${exec_prefix}/${TOOL_LIB}/lib +fi + +if [ "x${CUSTOMIZER_SCRIPT}" = "x" ] ; then + CUSTOMIZER_SCRIPT=${EMULATION_NAME} fi +CUSTOMIZER_SCRIPT="${srcdir}/emulparams/${CUSTOMIZER_SCRIPT}.sh" # Include the emulation-specific parameters: -. ${srcdir}/emulparams/${EMULATION_NAME}.sh +. ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME} if test -d ldscripts; then true @@ -74,11 +127,21 @@ fi # the library path with the suffix applied. if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then - if [ x"$use_sysroot" != xyes ] ; then - LIB_PATH=${libdir} + LIB_PATH2= + + libs=${NATIVE_LIB_DIRS} + if [ "x${use_sysroot}" != "xyes" ] ; then + case " ${libs} " in + *" ${libdir} "*) ;; + *) libs="${libdir} ${libs}" ;; + esac + case " ${libs} " in + *" ${tool_lib} "*) ;; + *) libs="${tool_lib} ${libs}" ;; + esac fi - LIB_PATH2="" - for lib in ${NATIVE_LIB_DIRS}; do + + for lib in ${libs}; do # The "=" is harmless if we aren't using a sysroot, but also needless. if [ "x${use_sysroot}" = "xyes" ] ; then lib="=${lib}" @@ -95,23 +158,37 @@ if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then ::) LIB_PATH=${lib}${LIBPATH_SUFFIX} ;; *) LIB_PATH=${LIB_PATH}:${lib}${LIBPATH_SUFFIX} ;; esac - case :${LIB_PATH}${LIB_PATH2}: in + case :${LIB_PATH}:${LIB_PATH2}: in *:${lib}:*) ;; - *) LIB_PATH2=${LIB_PATH2}:${lib} ;; + *::) LIB_PATH2=${lib} ;; + *) LIB_PATH2=${LIB_PATH2}:${lib} ;; esac else - case :${LIB_PATH}: in - *:${lib}:*) ;; - ::) LIB_PATH=${lib} ;; - *) LIB_PATH=${LIB_PATH}:${lib} ;; + case :${LIB_PATH2}: in + *:${lib}:*) ;; + ::) LIB_PATH2=${lib} ;; + *) LIB_PATH2=${LIB_PATH2}:${lib} ;; esac fi done - LIB_PATH=${LIB_PATH}${LIB_PATH2} + + case :${LIB_PATH}:${LIB_PATH2}: in + *:: | ::*) LIB_PATH=${LIB_PATH}${LIB_PATH2} ;; + *) LIB_PATH=${LIB_PATH}:${LIB_PATH2} ;; + esac fi LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'` +# We need it for testsuite. +case " $EMULATION_LIBPATH " in + *" ${EMULATION_NAME} "*) + test -d tmpdir || mkdir tmpdir + test -f tmpdir/libpath.exp || \ + echo "set libpath \"${LIB_PATH}\"" | sed -e 's/:/ /g' > tmpdir/libpath.exp + ;; +esac + # Generate 5 or 6 script files from a master script template in # ${srcdir}/scripttempl/${SCRIPT_NAME}.sh. Which one of the 5 or 6 # script files is actually used depends on command line options given @@ -140,7 +217,7 @@ fi SEGMENT_SIZE=${SEGMENT_SIZE-${MAXPAGESIZE-${TARGET_PAGE_SIZE}}} # Determine DATA_ALIGNMENT for the 5 variants, using -# values specified in the emulparams/<emulation>.sh file or default. +# values specified in the emulparams/<script_to_run>.sh file or default. DATA_ALIGNMENT_="${DATA_ALIGNMENT_-${DATA_ALIGNMENT-ALIGN(${SEGMENT_SIZE})}}" DATA_ALIGNMENT_n="${DATA_ALIGNMENT_n-${DATA_ALIGNMENT_}}" @@ -152,7 +229,7 @@ LD_FLAG=r DATA_ALIGNMENT=${DATA_ALIGNMENT_r} DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})" ( echo "/* Script for ld -r: link without relocation */" - . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xr @@ -160,7 +237,7 @@ LD_FLAG=u DATA_ALIGNMENT=${DATA_ALIGNMENT_u} CONSTRUCTING=" " ( echo "/* Script for ld -Ur: link w/out relocation, do create constructors */" - . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xu @@ -168,7 +245,7 @@ LD_FLAG= DATA_ALIGNMENT=${DATA_ALIGNMENT_} RELOCATING=" " ( echo "/* Default linker script, for normal executables */" - . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.x @@ -176,14 +253,14 @@ LD_FLAG=n DATA_ALIGNMENT=${DATA_ALIGNMENT_n} TEXT_START_ADDR=${NONPAGED_TEXT_START_ADDR-${TEXT_START_ADDR}} ( echo "/* Script for -n: mix text and data on same page */" - . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xn LD_FLAG=N DATA_ALIGNMENT=${DATA_ALIGNMENT_N} ( echo "/* Script for -N: mix text and data on same page; don't align data */" - . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xbn @@ -192,7 +269,7 @@ if test -n "$GENERATE_COMBRELOC_SCRIPT"; then LD_FLAG=c COMBRELOC=ldscripts/${EMULATION_NAME}.xc.tmp ( echo "/* Script for -z combreloc: combine and sort reloc sections */" - . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xc rm -f ${COMBRELOC} @@ -206,7 +283,7 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then # Note that TEXT_START_ADDR is set to NONPAGED_TEXT_START_ADDR. ( echo "/* Script for ld --shared: link shared library */" - . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xs if test -n "$GENERATE_COMBRELOC_SCRIPT"; then @@ -214,7 +291,7 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}} COMBRELOC=ldscripts/${EMULATION_NAME}.xc.tmp ( echo "/* Script for --shared -z combreloc: shared library, combine & sort relocs */" - . ${srcdir}/emulparams/${EMULATION_NAME}.sh + . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsc rm -f ${COMBRELOC} @@ -223,13 +300,37 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then unset CREATE_SHLIB fi +if test -n "$GENERATE_PIE_SCRIPT"; then + LD_FLAG=pie + DATA_ALIGNMENT=${DATA_ALIGNMENT_s-${DATA_ALIGNMENT_}} + CREATE_PIE=" " + # Note that TEXT_START_ADDR is set to NONPAGED_TEXT_START_ADDR. + ( + echo "/* Script for ld -pie: link position independent executable */" + . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME} + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xd + if test -n "$GENERATE_COMBRELOC_SCRIPT"; then + LD_FLAG=cpie + DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}} + COMBRELOC=ldscripts/${EMULATION_NAME}.xc.tmp + ( echo "/* Script for -pie -z combreloc: position independent executable, combine & sort relocs */" + . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME} + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdc + rm -f ${COMBRELOC} + COMBRELOC= + fi + unset CREATE_PIE +fi + LD_FLAG=Z DATA_ALIGNMENT=${DATA_ALIGNMENT_} RELOCATING=" " ( echo "/* Script for -Z: traditional binaries with no PLT/GOT padding */" . ${srcdir}/emulparams/${EMULATION_NAME}.sh . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xz +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xz case " $EMULATION_LIBPATH " in *" ${EMULATION_NAME} "*) COMPILE_IN=true;; diff --git a/gnu/usr.bin/binutils/ld/ld.1 b/gnu/usr.bin/binutils/ld/ld.1 deleted file mode 100644 index 76f6a6117b9..00000000000 --- a/gnu/usr.bin/binutils/ld/ld.1 +++ /dev/null @@ -1,1821 +0,0 @@ -.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.if \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "LD 1" -.TH LD 1 "2003-06-12" "binutils-2.14" "GNU Development Tools" -.SH "NAME" -ld \- Using LD, the GNU linker -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -ld [\fBoptions\fR] \fIobjfile\fR ... -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBld\fR 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 \fBld\fR. -.PP -\&\fBld\fR accepts Linker Command Language files written in -a superset of \s-1AT&T\s0's Link Editor Command Language syntax, -to provide explicit and total control over the linking process. -.PP -This man page does not describe the command language; see the -\&\fBld\fR entry in \f(CW\*(C`info\*(C'\fR, or the manual -ld: the \s-1GNU\s0 linker, for full details on the command language and -on other aspects of the \s-1GNU\s0 linker. -.PP -This version of \fBld\fR uses the general purpose \s-1BFD\s0 libraries -to operate on object files. This allows \fBld\fR to read, combine, and -write object files in many different formats\-\-\-for example, \s-1COFF\s0 or -\&\f(CW\*(C`a.out\*(C'\fR. Different formats may be linked together to produce any -available kind of object file. -.PP -Aside from its flexibility, the \s-1GNU\s0 linker is more helpful than other -linkers in providing diagnostic information. Many linkers abandon -execution immediately upon encountering an error; whenever possible, -\&\fBld\fR continues executing, allowing you to identify other errors -(or, in some cases, to get an output file in spite of the error). -.PP -The \s-1GNU\s0 linker \fBld\fR 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. -.SH "OPTIONS" -.IX Header "OPTIONS" -The linker supports a plethora of command-line options, but in actual -practice few of them are used in any particular context. -For instance, a frequent use of \fBld\fR is to link standard Unix -object files on a standard, supported Unix system. On such a system, to -link a file \f(CW\*(C`hello.o\*(C'\fR: -.PP -.Vb 1 -\& ld -o <output> /lib/crt0.o hello.o -lc -.Ve -.PP -This tells \fBld\fR to produce a file called \fIoutput\fR as the -result of linking the file \f(CW\*(C`/lib/crt0.o\*(C'\fR with \f(CW\*(C`hello.o\*(C'\fR and -the library \f(CW\*(C`libc.a\*(C'\fR, which will come from the standard search -directories. (See the discussion of the \fB\-l\fR option below.) -.PP -Some of the command-line options to \fBld\fR may be specified at any -point in the command line. However, options which refer to files, such -as \fB\-l\fR or \fB\-T\fR, cause the file to be read at the point at -which the option appears in the command line, relative to the object -files and other file options. Repeating non-file options with a -different argument will either have no further effect, or override prior -occurrences (those further to the left on the command line) of that -option. Options which may be meaningfully specified more than once are -noted in the descriptions below. -.PP -Non-option arguments are object files or archives which are to be linked -together. They may follow, precede, or be mixed in with command-line -options, except that an object file argument may not be placed between -an option and its argument. -.PP -Usually the linker is invoked with at least one object file, but you can -specify other forms of binary input files using \fB\-l\fR, \fB\-R\fR, -and the script command language. If \fIno\fR binary input files at all -are specified, the linker does not produce any output, and issues the -message \fBNo input files\fR. -.PP -If the linker cannot recognize the format of an object file, it will -assume that it is a linker script. A script specified in this way -augments the main linker script used for the link (either the default -linker script or the one specified by using \fB\-T\fR). This feature -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 -\&\f(CW\*(C`INPUT\*(C'\fR or \f(CW\*(C`GROUP\*(C'\fR to load other objects. Note that -specifying a script in this way merely augments the main linker script; -use the \fB\-T\fR option to replace the default linker script entirely. -.PP -For options whose names are a single letter, -option arguments must either follow the option letter without intervening -whitespace, or be given as separate arguments immediately following the -option that requires them. -.PP -For options whose names are multiple letters, either one dash or two can -precede the option name; for example, \fB\-trace\-symbol\fR and -\&\fB\-\-trace\-symbol\fR are equivalent. Note\-\-\-there is one exception to -this rule. Multiple letter options that start with a lower case 'o' can -only be preceeded by two dashes. This is to reduce confusion with the -\&\fB\-o\fR option. So for example \fB\-omagic\fR sets the output file -name to \fBmagic\fR whereas \fB\-\-omagic\fR sets the \s-1NMAGIC\s0 flag on the -output. -.PP -Arguments to multiple-letter options must either be separated from the -option name by an equals sign, or be given as separate arguments -immediately following the option that requires them. For example, -\&\fB\-\-trace\-symbol foo\fR and \fB\-\-trace\-symbol=foo\fR are equivalent. -Unique abbreviations of the names of multiple-letter options are -accepted. -.PP -Note\-\-\-if the linker is being invoked indirectly, via a compiler driver -(e.g. \fBgcc\fR) then all the linker command line options should be -prefixed by \fB\-Wl,\fR (or whatever is appropriate for the particular -compiler driver) like this: -.PP -.Vb 1 -\& gcc -Wl,--startgroup foo.o bar.o -Wl,--endgroup -.Ve -.PP -This is important, because otherwise the compiler driver program may -silently drop the linker options, resulting in a bad link. -.PP -Here is a table of the generic command line switches accepted by the \s-1GNU\s0 -linker: -.IP "\fB\-a\fR\fIkeyword\fR" 4 -.IX Item "-akeyword" -This option is supported for \s-1HP/UX\s0 compatibility. The \fIkeyword\fR -argument must be one of the strings \fBarchive\fR, \fBshared\fR, or -\&\fBdefault\fR. \fB\-aarchive\fR is functionally equivalent to -\&\fB\-Bstatic\fR, and the other two keywords are functionally equivalent -to \fB\-Bdynamic\fR. This option may be used any number of times. -.IP "\fB\-A\fR\fIarchitecture\fR" 4 -.IX Item "-Aarchitecture" -.PD 0 -.IP "\fB\-\-architecture=\fR\fIarchitecture\fR" 4 -.IX Item "--architecture=architecture" -.PD -In the current release of \fBld\fR, this option is useful only for the -Intel 960 family of architectures. In that \fBld\fR configuration, the -\&\fIarchitecture\fR argument identifies the particular architecture in -the 960 family, enabling some safeguards and modifying the -archive-library search path. -.Sp -Future releases of \fBld\fR may support similar functionality for -other architecture families. -.IP "\fB\-b\fR \fIinput-format\fR" 4 -.IX Item "-b input-format" -.PD 0 -.IP "\fB\-\-format=\fR\fIinput-format\fR" 4 -.IX Item "--format=input-format" -.PD -\&\fBld\fR may be configured to support more than one kind of object -file. If your \fBld\fR is configured this way, you can use the -\&\fB\-b\fR option to specify the binary format for input object files -that follow this option on the command line. Even when \fBld\fR is -configured to support alternative object formats, you don't usually need -to specify this, as \fBld\fR should be configured to expect as a -default input format the most usual format on each machine. -\&\fIinput-format\fR is a text string, the name of a particular format -supported by the \s-1BFD\s0 libraries. (You can list the available binary -formats with \fBobjdump \-i\fR.) -.Sp -You may want to use this option if you are linking files with an unusual -binary format. You can also use \fB\-b\fR to switch formats explicitly (when -linking object files of different formats), by including -\&\fB\-b\fR \fIinput-format\fR before each group of object files in a -particular format. -.Sp -The default format is taken from the environment variable -\&\f(CW\*(C`GNUTARGET\*(C'\fR. -.Sp -You can also define the input format from a script, using the command -\&\f(CW\*(C`TARGET\*(C'\fR; -.IP "\fB\-c\fR \fIMRI-commandfile\fR" 4 -.IX Item "-c MRI-commandfile" -.PD 0 -.IP "\fB\-\-mri\-script=\fR\fIMRI-commandfile\fR" 4 -.IX Item "--mri-script=MRI-commandfile" -.PD -For compatibility with linkers produced by \s-1MRI\s0, \fBld\fR accepts script -files written in an alternate, restricted command language, described in -the \s-1MRI\s0 Compatible Script Files section of \s-1GNU\s0 ld documentation. -Introduce \s-1MRI\s0 script files with -the option \fB\-c\fR; use the \fB\-T\fR option to run linker -scripts written in the general-purpose \fBld\fR scripting language. -If \fIMRI-cmdfile\fR does not exist, \fBld\fR looks for it in the directories -specified by any \fB\-L\fR options. -.IP "\fB\-d\fR" 4 -.IX Item "-d" -.PD 0 -.IP "\fB\-dc\fR" 4 -.IX Item "-dc" -.IP "\fB\-dp\fR" 4 -.IX Item "-dp" -.PD -These three options are equivalent; multiple forms are supported for -compatibility with other linkers. They assign space to common symbols -even if a relocatable output file is specified (with \fB\-r\fR). The -script command \f(CW\*(C`FORCE_COMMON_ALLOCATION\*(C'\fR has the same effect. -.IP "\fB\-e\fR \fIentry\fR" 4 -.IX Item "-e entry" -.PD 0 -.IP "\fB\-\-entry=\fR\fIentry\fR" 4 -.IX Item "--entry=entry" -.PD -Use \fIentry\fR as the explicit symbol for beginning execution of your -program, rather than the default entry point. If there is no symbol -named \fIentry\fR, the linker will try to parse \fIentry\fR as a number, -and use that as the entry address (the number will be interpreted in -base 10; you may use a leading \fB0x\fR for base 16, or a leading -\&\fB0\fR for base 8). -.IP "\fB\-E\fR" 4 -.IX Item "-E" -.PD 0 -.IP "\fB\-\-export\-dynamic\fR" 4 -.IX Item "--export-dynamic" -.PD -When creating a dynamically linked executable, add all symbols to the -dynamic symbol table. The dynamic symbol table is the set of symbols -which are visible from dynamic objects at run time. -.Sp -If you do not use this option, the dynamic symbol table will normally -contain only those symbols which are referenced by some dynamic object -mentioned in the link. -.Sp -If you use \f(CW\*(C`dlopen\*(C'\fR to load a dynamic object which needs to refer -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. -.Sp -You can also use the version script to control what symbols should -be added to the dynamic symbol table if the output format supports it. -See the description of \fB\-\-version\-script\fR in \f(CW@ref\fR{\s-1VERSION\s0}. -.IP "\fB\-EB\fR" 4 -.IX Item "-EB" -Link big-endian objects. This affects the default output format. -.IP "\fB\-EL\fR" 4 -.IX Item "-EL" -Link little-endian objects. This affects the default output format. -.IP "\fB\-f\fR" 4 -.IX Item "-f" -.PD 0 -.IP "\fB\-\-auxiliary\fR \fIname\fR" 4 -.IX Item "--auxiliary name" -.PD -When creating an \s-1ELF\s0 shared object, set the internal \s-1DT_AUXILIARY\s0 field -to the specified name. This tells the dynamic linker that the symbol -table of the shared object should be used as an auxiliary filter on the -symbol table of the shared object \fIname\fR. -.Sp -If you later link a program against this filter object, then, when you -run the program, the dynamic linker will see the \s-1DT_AUXILIARY\s0 field. If -the dynamic linker resolves any symbols from the filter object, it will -first check whether there is a definition in the shared object -\&\fIname\fR. If there is one, it will be used instead of the definition -in the filter object. The shared object \fIname\fR need not exist. -Thus the shared object \fIname\fR may be used to provide an alternative -implementation of certain functions, perhaps for debugging or for -machine specific performance. -.Sp -This option may be specified more than once. The \s-1DT_AUXILIARY\s0 entries -will be created in the order in which they appear on the command line. -.IP "\fB\-F\fR \fIname\fR" 4 -.IX Item "-F name" -.PD 0 -.IP "\fB\-\-filter\fR \fIname\fR" 4 -.IX Item "--filter name" -.PD -When creating an \s-1ELF\s0 shared object, set the internal \s-1DT_FILTER\s0 field to -the specified name. This tells the dynamic linker that the symbol table -of the shared object which is being created should be used as a filter -on the symbol table of the shared object \fIname\fR. -.Sp -If you later link a program against this filter object, then, when you -run the program, the dynamic linker will see the \s-1DT_FILTER\s0 field. The -dynamic linker will resolve symbols according to the symbol table of the -filter object as usual, but it will actually link to the definitions -found in the shared object \fIname\fR. Thus the filter object can be -used to select a subset of the symbols provided by the object -\&\fIname\fR. -.Sp -Some older linkers used the \fB\-F\fR option throughout a compilation -toolchain for specifying object-file format for both input and output -object files. -The \s-1GNU\s0 linker uses other mechanisms for this purpose: the -\&\fB\-b\fR, \fB\-\-format\fR, \fB\-\-oformat\fR options, the -\&\f(CW\*(C`TARGET\*(C'\fR command in linker scripts, and the \f(CW\*(C`GNUTARGET\*(C'\fR -environment variable. -The \s-1GNU\s0 linker will ignore the \fB\-F\fR option when not -creating an \s-1ELF\s0 shared object. -.IP "\fB\-fini\fR \fIname\fR" 4 -.IX Item "-fini name" -When creating an \s-1ELF\s0 executable or shared object, call \s-1NAME\s0 when the -executable or shared object is unloaded, by setting \s-1DT_FINI\s0 to the -address of the function. By default, the linker uses \f(CW\*(C`_fini\*(C'\fR as -the function to call. -.IP "\fB\-g\fR" 4 -.IX Item "-g" -Ignored. Provided for compatibility with other tools. -.IP "\fB\-G\fR\fIvalue\fR" 4 -.IX Item "-Gvalue" -.PD 0 -.IP "\fB\-\-gpsize=\fR\fIvalue\fR" 4 -.IX Item "--gpsize=value" -.PD -Set the maximum size of objects to be optimized using the \s-1GP\s0 register to -\&\fIsize\fR. This is only meaningful for object file formats such as -\&\s-1MIPS\s0 \s-1ECOFF\s0 which supports putting large and small objects into different -sections. This is ignored for other object file formats. -.IP "\fB\-h\fR\fIname\fR" 4 -.IX Item "-hname" -.PD 0 -.IP "\fB\-soname=\fR\fIname\fR" 4 -.IX Item "-soname=name" -.PD -When creating an \s-1ELF\s0 shared object, set the internal \s-1DT_SONAME\s0 field to -the specified name. When an executable is linked with a shared object -which has a \s-1DT_SONAME\s0 field, then when the executable is run the dynamic -linker will attempt to load the shared object specified by the \s-1DT_SONAME\s0 -field rather than the using the file name given to the linker. -.IP "\fB\-i\fR" 4 -.IX Item "-i" -Perform an incremental link (same as option \fB\-r\fR). -.IP "\fB\-init\fR \fIname\fR" 4 -.IX Item "-init name" -When creating an \s-1ELF\s0 executable or shared object, call \s-1NAME\s0 when the -executable or shared object is loaded, by setting \s-1DT_INIT\s0 to the address -of the function. By default, the linker uses \f(CW\*(C`_init\*(C'\fR as the -function to call. -.IP "\fB\-l\fR\fIarchive\fR" 4 -.IX Item "-larchive" -.PD 0 -.IP "\fB\-\-library=\fR\fIarchive\fR" 4 -.IX Item "--library=archive" -.PD -Add archive file \fIarchive\fR to the list of files to link. This -option may be used any number of times. \fBld\fR will search its -path-list for occurrences of \f(CW\*(C`lib\f(CIarchive\f(CW.a\*(C'\fR for every -\&\fIarchive\fR specified. -.Sp -On systems which support shared libraries, \fBld\fR may also search for -libraries with extensions other than \f(CW\*(C`.a\*(C'\fR. Specifically, on \s-1ELF\s0 -and SunOS systems, \fBld\fR will search a directory for a library with -an extension of \f(CW\*(C`.so\*(C'\fR before searching for one with an extension of -\&\f(CW\*(C`.a\*(C'\fR. By convention, a \f(CW\*(C`.so\*(C'\fR extension indicates a shared -library. -.Sp -The linker will search an archive only once, at the location where it is -specified on the command line. If the archive defines a symbol which -was undefined in some object which appeared before the archive on the -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. -.Sp -See the \fB\-(\fR option for a way to force the linker to search -archives multiple times. -.Sp -You may list the same archive multiple times on the command line. -.Sp -This type of archive searching is standard for Unix linkers. However, -if you are using \fBld\fR on \s-1AIX\s0, note that it is different from the -behaviour of the \s-1AIX\s0 linker. -.IP "\fB\-L\fR\fIsearchdir\fR" 4 -.IX Item "-Lsearchdir" -.PD 0 -.IP "\fB\-\-library\-path=\fR\fIsearchdir\fR" 4 -.IX Item "--library-path=searchdir" -.PD -Add path \fIsearchdir\fR to the list of paths that \fBld\fR will search -for archive libraries and \fBld\fR 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 -\&\fB\-L\fR options apply to all \fB\-l\fR options, regardless of the -order in which the options appear. -.Sp -If \fIsearchdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced -by the \fIsysroot prefix\fR, a path specified when the linker is configured. -.Sp -The default set of paths searched (without being specified with -\&\fB\-L\fR) depends on which emulation mode \fBld\fR is using, and in -some cases also on how it was configured. -.Sp -The paths can also be specified in a link script with the -\&\f(CW\*(C`SEARCH_DIR\*(C'\fR command. Directories specified this way are searched -at the point in which the linker script appears in the command line. -.IP "\fB\-m\fR\fIemulation\fR" 4 -.IX Item "-memulation" -Emulate the \fIemulation\fR linker. You can list the available -emulations with the \fB\-\-verbose\fR or \fB\-V\fR options. -.Sp -If the \fB\-m\fR option is not used, the emulation is taken from the -\&\f(CW\*(C`LDEMULATION\*(C'\fR environment variable, if that is defined. -.Sp -Otherwise, the default emulation depends upon how the linker was -configured. -.IP "\fB\-M\fR" 4 -.IX Item "-M" -.PD 0 -.IP "\fB\-\-print\-map\fR" 4 -.IX Item "--print-map" -.PD -Print a link map to the standard output. A link map provides -information about the link, including the following: -.RS 4 -.IP "\(bu" 4 -Where object files and symbols are mapped into memory. -.IP "\(bu" 4 -How common symbols are allocated. -.IP "\(bu" 4 -All archive members included in the link, with a mention of the symbol -which caused the archive member to be brought in. -.RE -.RS 4 -.RE -.IP "\fB\-n\fR" 4 -.IX Item "-n" -.PD 0 -.IP "\fB\-\-nmagic\fR" 4 -.IX Item "--nmagic" -.PD -Turn off page alignment of sections, and mark the output as -\&\f(CW\*(C`NMAGIC\*(C'\fR if possible. -.IP "\fB\-N\fR" 4 -.IX Item "-N" -.PD 0 -.IP "\fB\-\-omagic\fR" 4 -.IX Item "--omagic" -.PD -Set the text and data sections to be readable and writable. Also, do -not page-align the data segment, and disable linking against shared -libraries. If the output format supports Unix style magic numbers, -mark the output as \f(CW\*(C`OMAGIC\*(C'\fR. -.IP "\fB\-\-no\-omagic\fR" 4 -.IX Item "--no-omagic" -This option negates most of the effects of the \fB\-N\fR option. It -sets the text section to be read\-only, and forces the data segment to -be page\-aligned. Note \- this option does not enable linking against -shared libraries. Use \fB\-Bdynamic\fR for this. -.IP "\fB\-o\fR \fIoutput\fR" 4 -.IX Item "-o output" -.PD 0 -.IP "\fB\-\-output=\fR\fIoutput\fR" 4 -.IX Item "--output=output" -.PD -Use \fIoutput\fR as the name for the program produced by \fBld\fR; if this -option is not specified, the name \fIa.out\fR is used by default. The -script command \f(CW\*(C`OUTPUT\*(C'\fR can also specify the output file name. -.IP "\fB\-O\fR \fIlevel\fR" 4 -.IX Item "-O level" -If \fIlevel\fR is a numeric values greater than zero \fBld\fR optimizes -the output. This might take significantly longer and therefore probably -should only be enabled for the final binary. -.IP "\fB\-q\fR" 4 -.IX Item "-q" -.PD 0 -.IP "\fB\-\-emit\-relocs\fR" 4 -.IX Item "--emit-relocs" -.PD -Leave relocation sections and contents in fully linked exececutables. -Post link analysis and optimization tools may need this information in -order to perform correct modifications of executables. This results -in larger executables. -.Sp -This option is currently only supported on \s-1ELF\s0 platforms. -.IP "\fB\-r\fR" 4 -.IX Item "-r" -.PD 0 -.IP "\fB\-\-relocateable\fR" 4 -.IX Item "--relocateable" -.PD -Generate relocatable output\-\-\-i.e., generate an output file that can in -turn serve as input to \fBld\fR. This is often called \fIpartial -linking\fR. As a side effect, in environments that support standard Unix -magic numbers, this option also sets the output file's magic number to -\&\f(CW\*(C`OMAGIC\*(C'\fR. -If this option is not specified, an absolute file is produced. When -linking \*(C+ programs, this option \fIwill not\fR resolve references to -constructors; to do that, use \fB\-Ur\fR. -.Sp -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 \f(CW\*(C`a.out\*(C'\fR\-based formats do not support partial linking -with input files in other formats at all. -.Sp -This option does the same thing as \fB\-i\fR. -.IP "\fB\-R\fR \fIfilename\fR" 4 -.IX Item "-R filename" -.PD 0 -.IP "\fB\-\-just\-symbols=\fR\fIfilename\fR" 4 -.IX Item "--just-symbols=filename" -.PD -Read symbol names and their addresses from \fIfilename\fR, but do not -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. -.Sp -For compatibility with other \s-1ELF\s0 linkers, if the \fB\-R\fR option is -followed by a directory name, rather than a file name, it is treated as -the \fB\-rpath\fR option. -.IP "\fB\-s\fR" 4 -.IX Item "-s" -.PD 0 -.IP "\fB\-\-strip\-all\fR" 4 -.IX Item "--strip-all" -.PD -Omit all symbol information from the output file. -.IP "\fB\-S\fR" 4 -.IX Item "-S" -.PD 0 -.IP "\fB\-\-strip\-debug\fR" 4 -.IX Item "--strip-debug" -.PD -Omit debugger symbol information (but not all symbols) from the output file. -.IP "\fB\-t\fR" 4 -.IX Item "-t" -.PD 0 -.IP "\fB\-\-trace\fR" 4 -.IX Item "--trace" -.PD -Print the names of the input files as \fBld\fR processes them. -.IP "\fB\-T\fR \fIscriptfile\fR" 4 -.IX Item "-T scriptfile" -.PD 0 -.IP "\fB\-\-script=\fR\fIscriptfile\fR" 4 -.IX Item "--script=scriptfile" -.PD -Use \fIscriptfile\fR as the linker script. This script replaces -\&\fBld\fR's default linker script (rather than adding to it), so -\&\fIcommandfile\fR must specify everything necessary to describe the -output file. If \fIscriptfile\fR does not exist in -the current directory, \f(CW\*(C`ld\*(C'\fR looks for it in the directories -specified by any preceding \fB\-L\fR options. Multiple \fB\-T\fR -options accumulate. -.IP "\fB\-u\fR \fIsymbol\fR" 4 -.IX Item "-u symbol" -.PD 0 -.IP "\fB\-\-undefined=\fR\fIsymbol\fR" 4 -.IX Item "--undefined=symbol" -.PD -Force \fIsymbol\fR to be entered in the output file as an undefined -symbol. Doing this may, for example, trigger linking of additional -modules from standard libraries. \fB\-u\fR may be repeated with -different option arguments to enter additional undefined symbols. This -option is equivalent to the \f(CW\*(C`EXTERN\*(C'\fR linker script command. -.IP "\fB\-Ur\fR" 4 -.IX Item "-Ur" -For anything other than \*(C+ programs, this option is equivalent to -\&\fB\-r\fR: it generates relocatable output\-\-\-i.e., an output file that can in -turn serve as input to \fBld\fR. When linking \*(C+ programs, \fB\-Ur\fR -\&\fIdoes\fR resolve references to constructors, unlike \fB\-r\fR. -It does not work to use \fB\-Ur\fR on files that were themselves linked -with \fB\-Ur\fR; once the constructor table has been built, it cannot -be added to. Use \fB\-Ur\fR only for the last partial link, and -\&\fB\-r\fR for the others. -.IP "\fB\-\-unique[=\fR\fI\s-1SECTION\s0\fR\fB]\fR" 4 -.IX Item "--unique[=SECTION]" -Creates a separate output section for every input section matching -\&\fI\s-1SECTION\s0\fR, or if the optional wildcard \fI\s-1SECTION\s0\fR argument is -missing, for every orphan input section. An orphan section is one not -specifically mentioned in a linker script. You may use this option -multiple times on the command line; It prevents the normal merging of -input sections with the same name, overriding output section assignments -in a linker script. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -.IP "\fB\-V\fR" 4 -.IX Item "-V" -.PD -Display the version number for \fBld\fR. The \fB\-V\fR option also -lists the supported emulations. -.IP "\fB\-x\fR" 4 -.IX Item "-x" -.PD 0 -.IP "\fB\-\-discard\-all\fR" 4 -.IX Item "--discard-all" -.PD -Delete all local symbols. -.IP "\fB\-X\fR" 4 -.IX Item "-X" -.PD 0 -.IP "\fB\-\-discard\-locals\fR" 4 -.IX Item "--discard-locals" -.PD -Delete all temporary local symbols. For most targets, this is all local -symbols whose names begin with \fBL\fR. -.IP "\fB\-Z\fR" 4 -.IX Item "-Z" -.PD 0 -Produce 'Standard' executables, disables Writable XOR Executable features -of resulting binaries. -.IP "\fB\-y\fR \fIsymbol\fR" 4 -.IX Item "-y symbol" -.PD 0 -.IP "\fB\-\-trace\-symbol=\fR\fIsymbol\fR" 4 -.IX Item "--trace-symbol=symbol" -.PD -Print the name of each linked file in which \fIsymbol\fR appears. This -option may be given any number of times. On many systems it is necessary -to prepend an underscore. -.Sp -This option is useful when you have an undefined symbol in your link but -don't know where the reference is coming from. -.IP "\fB\-Y\fR \fIpath\fR" 4 -.IX Item "-Y path" -Add \fIpath\fR to the default library search path. This option exists -for Solaris compatibility. -.IP "\fB\-z\fR \fIkeyword\fR" 4 -.IX Item "-z keyword" -The recognized keywords are \f(CW\*(C`initfirst\*(C'\fR, \f(CW\*(C`interpose\*(C'\fR, -\&\f(CW\*(C`loadfltr\*(C'\fR, \f(CW\*(C`nodefaultlib\*(C'\fR, \f(CW\*(C`nodelete\*(C'\fR, \f(CW\*(C`nodlopen\*(C'\fR, -\&\f(CW\*(C`nodump\*(C'\fR, \f(CW\*(C`now\*(C'\fR, \f(CW\*(C`origin\*(C'\fR, \f(CW\*(C`combreloc\*(C'\fR, \f(CW\*(C`nocombreloc\*(C'\fR -and \f(CW\*(C`nocopyreloc\*(C'\fR. -The other keywords are -ignored for Solaris compatibility. \f(CW\*(C`initfirst\*(C'\fR marks the object -to be initialized first at runtime before any other objects. -\&\f(CW\*(C`interpose\*(C'\fR marks the object that its symbol table interposes -before all symbols but the primary executable. \f(CW\*(C`loadfltr\*(C'\fR marks -the object that its filtees be processed immediately at runtime. -\&\f(CW\*(C`nodefaultlib\*(C'\fR marks the object that the search for dependencies -of this object will ignore any default library search paths. -\&\f(CW\*(C`nodelete\*(C'\fR marks the object shouldn't be unloaded at runtime. -\&\f(CW\*(C`nodlopen\*(C'\fR marks the object not available to \f(CW\*(C`dlopen\*(C'\fR. -\&\f(CW\*(C`nodump\*(C'\fR marks the object can not be dumped by \f(CW\*(C`dldump\*(C'\fR. -\&\f(CW\*(C`now\*(C'\fR marks the object with the non-lazy runtime binding. -\&\f(CW\*(C`origin\*(C'\fR marks the object may contain \f(CW$ORIGIN\fR. -\&\f(CW\*(C`defs\*(C'\fR disallows undefined symbols. -\&\f(CW\*(C`muldefs\*(C'\fR allows multiple definitions. -\&\f(CW\*(C`combreloc\*(C'\fR combines multiple reloc sections and sorts them -to make dynamic symbol lookup caching possible. -\&\f(CW\*(C`nocombreloc\*(C'\fR disables multiple reloc sections combining. -\&\f(CW\*(C`nocopyreloc\*(C'\fR disables production of copy relocs. -.IP "\fB\-(\fR \fIarchives\fR \fB\-)\fR" 4 -.IX Item "-( archives -)" -.PD 0 -.IP "\fB\-\-start\-group\fR \fIarchives\fR \fB\-\-end\-group\fR" 4 -.IX Item "--start-group archives --end-group" -.PD -The \fIarchives\fR should be a list of archive files. They may be -either explicit file names, or \fB\-l\fR options. -.Sp -The specified archives are searched repeatedly until no new undefined -references are created. Normally, an archive is searched only once in -the order that it is specified on the command line. If a symbol in that -archive is needed to resolve an undefined symbol referred to by an -object in an archive that appears later on the command line, the linker -would not be able to resolve that reference. By grouping the archives, -they all be searched repeatedly until all possible references are -resolved. -.Sp -Using this option has a significant performance cost. It is best to use -it only when there are unavoidable circular references between two or -more archives. -.IP "\fB\-\-accept\-unknown\-input\-arch\fR" 4 -.IX Item "--accept-unknown-input-arch" -.PD 0 -.IP "\fB\-\-no\-accept\-unknown\-input\-arch\fR" 4 -.IX Item "--no-accept-unknown-input-arch" -.PD -Tells the linker to accept input files whose architecture cannot be -recognised. The assumption is that the user knows what they are doing -and deliberately wants to link in these unknown input files. This was -the default behaviour of the linker, before release 2.14. The default -behaviour from release 2.14 onwards is to reject such input files, and -so the \fB\-\-accept\-unknown\-input\-arch\fR option has been added to -restore the old behaviour. -.IP "\fB\-assert\fR \fIkeyword\fR" 4 -.IX Item "-assert keyword" -This option is ignored for SunOS compatibility. -.IP "\fB\-Bdynamic\fR" 4 -.IX Item "-Bdynamic" -.PD 0 -.IP "\fB\-dy\fR" 4 -.IX Item "-dy" -.IP "\fB\-call_shared\fR" 4 -.IX Item "-call_shared" -.PD -Link against dynamic libraries. This is only meaningful on platforms -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 -\&\fB\-l\fR options which follow it. -.IP "\fB\-Bgroup\fR" 4 -.IX Item "-Bgroup" -Set the \f(CW\*(C`DF_1_GROUP\*(C'\fR flag in the \f(CW\*(C`DT_FLAGS_1\*(C'\fR entry in the dynamic -section. This causes the runtime linker to handle lookups in this -object and its dependencies to be performed only inside the group. -\&\fB\-\-no\-undefined\fR is implied. This option is only meaningful on \s-1ELF\s0 -platforms which support shared libraries. -.IP "\fB\-Bstatic\fR" 4 -.IX Item "-Bstatic" -.PD 0 -.IP "\fB\-dn\fR" 4 -.IX Item "-dn" -.IP "\fB\-non_shared\fR" 4 -.IX Item "-non_shared" -.IP "\fB\-static\fR" 4 -.IX Item "-static" -.PD -Do not link against shared libraries. This is only meaningful on -platforms for which shared libraries are supported. The different -variants of this option are for compatibility with various systems. You -may use this option multiple times on the command line: it affects -library searching for \fB\-l\fR options which follow it. -.IP "\fB\-Bsymbolic\fR" 4 -.IX Item "-Bsymbolic" -When creating a shared library, bind references to global symbols to the -definition within the shared library, if any. Normally, it is possible -for a program linked against a shared library to override the definition -within the shared library. This option is only meaningful on \s-1ELF\s0 -platforms which support shared libraries. -.IP "\fB\-\-check\-sections\fR" 4 -.IX Item "--check-sections" -.PD 0 -.IP "\fB\-\-no\-check\-sections\fR" 4 -.IX Item "--no-check-sections" -.PD -Asks the linker \fInot\fR to check section addresses after they have -been assigned to see if there any overlaps. Normally the linker will -perform this check, and if it finds any overlaps it will produce -suitable error messages. The linker does know about, and does make -allowances for sections in overlays. The default behaviour can be -restored by using the command line switch \fB\-\-check\-sections\fR. -.IP "\fB\-\-cref\fR" 4 -.IX Item "--cref" -Output a cross reference table. If a linker map file is being -generated, the cross reference table is printed to the map file. -Otherwise, it is printed on the standard output. -.Sp -The format of the table is intentionally simple, so that it may be -easily processed by a script if necessary. The symbols are printed out, -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. -.IP "\fB\-\-no\-define\-common\fR" 4 -.IX Item "--no-define-common" -This option inhibits the assignment of addresses to common symbols. -The script command \f(CW\*(C`INHIBIT_COMMON_ALLOCATION\*(C'\fR has the same effect. -.Sp -The \fB\-\-no\-define\-common\fR 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 \fB\-\-no\-define\-common\fR 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. -.IP "\fB\-\-defsym\fR \fIsymbol\fR\fB=\fR\fIexpression\fR" 4 -.IX Item "--defsym symbol=expression" -Create a global symbol in the output file, containing the absolute -address given by \fIexpression\fR. You may use this option as many -times as necessary to define multiple symbols in the command line. A -limited form of arithmetic is supported for the \fIexpression\fR in this -context: you may give a hexadecimal constant or the name of an existing -symbol, or use \f(CW\*(C`+\*(C'\fR and \f(CW\*(C`\-\*(C'\fR to add or subtract hexadecimal -constants or symbols. If you need more elaborate expressions, consider -using the linker command language from a script. \fINote:\fR there should be no white -space between \fIsymbol\fR, the equals sign (``\fB=\fR''), and -\&\fIexpression\fR. -.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4 -.IX Item "--demangle[=style]" -.PD 0 -.IP "\fB\-\-no\-demangle\fR" 4 -.IX Item "--no-demangle" -.PD -These options control whether to demangle symbol names in error messages -and other output. When the linker is told to demangle, it tries to -present symbol names in a readable fashion: it strips leading -underscores if they are used by the object file format, and converts \*(C+ -mangled symbol names into user readable names. Different compilers have -different mangling styles. The optional demangling style argument can be used -to choose an appropriate demangling style for your compiler. The linker will -demangle by default unless the environment variable \fB\s-1COLLECT_NO_DEMANGLE\s0\fR -is set. These options may be used to override the default. -.IP "\fB\-\-dynamic\-linker\fR \fIfile\fR" 4 -.IX Item "--dynamic-linker file" -Set the name of the dynamic linker. This is only meaningful when -generating dynamically linked \s-1ELF\s0 executables. The default dynamic -linker is normally correct; don't use this unless you know what you are -doing. -.IP "\fB\-\-embedded\-relocs\fR" 4 -.IX Item "--embedded-relocs" -This option is only meaningful when linking \s-1MIPS\s0 embedded \s-1PIC\s0 code, -generated by the \-membedded\-pic option to the \s-1GNU\s0 compiler and -assembler. It causes the linker to create a table which may be used at -runtime to relocate any data which was statically initialized to pointer -values. See the code in testsuite/ld\-empic for details. -.IP "\fB\-\-fatal\-warnings\fR" 4 -.IX Item "--fatal-warnings" -Treat all warnings as errors. -.IP "\fB\-\-force\-exe\-suffix\fR" 4 -.IX Item "--force-exe-suffix" -Make sure that an output file has a .exe suffix. -.Sp -If a successfully built fully linked output file does not have a -\&\f(CW\*(C`.exe\*(C'\fR or \f(CW\*(C`.dll\*(C'\fR suffix, this option forces the linker to copy -the output file to one of the same name with a \f(CW\*(C`.exe\*(C'\fR suffix. This -option is useful when using unmodified Unix makefiles on a Microsoft -Windows host, since some versions of Windows won't run an image unless -it ends in a \f(CW\*(C`.exe\*(C'\fR suffix. -.IP "\fB\-\-no\-gc\-sections\fR" 4 -.IX Item "--no-gc-sections" -.PD 0 -.IP "\fB\-\-gc\-sections\fR" 4 -.IX Item "--gc-sections" -.PD -Enable garbage collection of unused input sections. It is ignored on -targets that do not support this option. This option is not compatible -with \fB\-r\fR, nor should it be used with dynamic linking. The default -behaviour (of not performing this garbage collection) can be restored by -specifying \fB\-\-no\-gc\-sections\fR on the command line. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Print a summary of the command-line options on the standard output and exit. -.IP "\fB\-\-target\-help\fR" 4 -.IX Item "--target-help" -Print a summary of all target specific options on the standard output and exit. -.IP "\fB\-Map\fR \fImapfile\fR" 4 -.IX Item "-Map mapfile" -Print a link map to the file \fImapfile\fR. See the description of the -\&\fB\-M\fR option, above. -.IP "\fB\-\-no\-keep\-memory\fR" 4 -.IX Item "--no-keep-memory" -\&\fBld\fR normally optimizes for speed over memory usage by caching the -symbol tables of input files in memory. This option tells \fBld\fR to -instead optimize for memory usage, by rereading the symbol tables as -necessary. This may be required if \fBld\fR runs out of memory space -while linking a large executable. -.IP "\fB\-\-no\-undefined\fR" 4 -.IX Item "--no-undefined" -.PD 0 -.IP "\fB\-z defs\fR" 4 -.IX Item "-z defs" -.PD -Normally when creating a non-symbolic shared library, undefined symbols -are allowed and left to be resolved by the runtime loader. This option -disallows such undefined symbols if they come from regular object -files. The switch \fB\-\-no\-allow\-shlib\-undefined\fR controls the -behaviour for shared objects being linked into the shared library. -.IP "\fB\-\-allow\-multiple\-definition\fR" 4 -.IX Item "--allow-multiple-definition" -.PD 0 -.IP "\fB\-z muldefs\fR" 4 -.IX Item "-z muldefs" -.PD -Normally when a symbol is defined multiple times, the linker will -report a fatal error. These options allow multiple definitions and the -first definition will be used. -.IP "\fB\-\-allow\-shlib\-undefined\fR" 4 -.IX Item "--allow-shlib-undefined" -.PD 0 -.IP "\fB\-\-no\-allow\-shlib\-undefined\fR" 4 -.IX Item "--no-allow-shlib-undefined" -.PD -Allow (the default) or disallow undefined symbols in shared objects. -The setting of this switch overrides \fB\-\-no\-undefined\fR where -shared objects are concerned. Thus if \fB\-\-no\-undefined\fR is set -but \fB\-\-no\-allow\-shlib\-undefined\fR is not, the net result will be -that undefined symbols in regular object files will trigger an error, -but undefined symbols in shared objects will be ignored. -.Sp -The reason that \fB\-\-allow\-shlib\-undefined\fR is the default is that -the shared object being specified at link time may not be the same one -that is available at load time, so the symbols might actually be -resolvable at load time. Plus there are some systems, (eg BeOS) where -undefined symbols in shared libraries is normal since the kernel -patches them at load time to select which function is most appropriate -for the current architecture. eg. to dynamically select an appropriate -memset function. Apparently it is also normal for \s-1HPPA\s0 shared -libraries to have undefined symbols. -.IP "\fB\-\-no\-undefined\-version\fR" 4 -.IX Item "--no-undefined-version" -Normally when a symbol has an undefined version, the linker will ignore -it. This option disallows symbols with undefined version and a fatal error -will be issued instead. -.IP "\fB\-\-no\-warn\-mismatch\fR" 4 -.IX Item "--no-warn-mismatch" -Normally \fBld\fR will give an error if you try to link together input -files that are mismatched for some reason, perhaps because they have -been compiled for different processors or for different endiannesses. -This option tells \fBld\fR 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. -.IP "\fB\-\-no\-whole\-archive\fR" 4 -.IX Item "--no-whole-archive" -Turn off the effect of the \fB\-\-whole\-archive\fR option for subsequent -archive files. -.IP "\fB\-\-noinhibit\-exec\fR" 4 -.IX Item "--noinhibit-exec" -Retain the executable output file whenever it is still usable. -Normally, the linker will not produce an output file if it encounters -errors during the link process; it exits without writing an output file -when it issues any error whatsoever. -.IP "\fB\-nostdlib\fR" 4 -.IX Item "-nostdlib" -Only search library directories explicitly specified on the -command line. Library directories specified in linker scripts -(including linker scripts specified on the command line) are ignored. -.IP "\fB\-\-oformat\fR \fIoutput-format\fR" 4 -.IX Item "--oformat output-format" -\&\fBld\fR may be configured to support more than one kind of object -file. If your \fBld\fR is configured this way, you can use the -\&\fB\-\-oformat\fR option to specify the binary format for the output -object file. Even when \fBld\fR is configured to support alternative -object formats, you don't usually need to specify this, as \fBld\fR -should be configured to produce as a default output format the most -usual format on each machine. \fIoutput-format\fR is a text string, the -name of a particular format supported by the \s-1BFD\s0 libraries. (You can -list the available binary formats with \fBobjdump \-i\fR.) The script -command \f(CW\*(C`OUTPUT_FORMAT\*(C'\fR can also specify the output format, but -this option overrides it. -.IP "\fB\-qmagic\fR" 4 -.IX Item "-qmagic" -This option is ignored for Linux compatibility. -.IP "\fB\-Qy\fR" 4 -.IX Item "-Qy" -This option is ignored for \s-1SVR4\s0 compatibility. -.IP "\fB\-\-relax\fR" 4 -.IX Item "--relax" -An option with machine dependent effects. -This option is only supported on a few targets. -.Sp -On some platforms, the \fB\-\-relax\fR option performs global -optimizations that become possible when the linker resolves addressing -in the program, such as relaxing address modes and synthesizing new -instructions in the output object file. -.Sp -On some platforms these link time global optimizations may make symbolic -debugging of the resulting executable impossible. -This is known to be -the case for the Matsushita \s-1MN10200\s0 and \s-1MN10300\s0 family of processors. -.Sp -On platforms where this is not supported, \fB\-\-relax\fR is accepted, -but ignored. -.IP "\fB\-\-retain\-symbols\-file\fR \fIfilename\fR" 4 -.IX Item "--retain-symbols-file filename" -Retain \fIonly\fR the symbols listed in the file \fIfilename\fR, -discarding all others. \fIfilename\fR is simply a flat file, with one -symbol name per line. This option is especially useful in environments -(such as VxWorks) -where a large global symbol table is accumulated gradually, to conserve -run-time memory. -.Sp -\&\fB\-\-retain\-symbols\-file\fR does \fInot\fR discard undefined symbols, -or symbols needed for relocations. -.Sp -You may only specify \fB\-\-retain\-symbols\-file\fR once in the command -line. It overrides \fB\-s\fR and \fB\-S\fR. -.IP "\fB\-rpath\fR \fIdir\fR" 4 -.IX Item "-rpath dir" -Add a directory to the runtime library search path. This is used when -linking an \s-1ELF\s0 executable with shared objects. All \fB\-rpath\fR -arguments are concatenated and passed to the runtime linker, which uses -them to locate shared objects at runtime. The \fB\-rpath\fR option is -also used when locating shared objects which are needed by shared -objects explicitly included in the link; see the description of the -\&\fB\-rpath\-link\fR option. If \fB\-rpath\fR is not used when linking an -\&\s-1ELF\s0 executable, the contents of the environment variable -\&\f(CW\*(C`LD_RUN_PATH\*(C'\fR will be used if it is defined. -.Sp -The \fB\-rpath\fR option may also be used on SunOS. By default, on -SunOS, the linker will form a runtime search patch out of all the -\&\fB\-L\fR options it is given. If a \fB\-rpath\fR option is used, the -runtime search path will be formed exclusively using the \fB\-rpath\fR -options, ignoring the \fB\-L\fR options. This can be useful when using -gcc, which adds many \fB\-L\fR options which may be on \s-1NFS\s0 mounted -filesystems. -.Sp -For compatibility with other \s-1ELF\s0 linkers, if the \fB\-R\fR option is -followed by a directory name, rather than a file name, it is treated as -the \fB\-rpath\fR option. -.IP "\fB\-rpath\-link\fR \fI\s-1DIR\s0\fR" 4 -.IX Item "-rpath-link DIR" -When using \s-1ELF\s0 or SunOS, one shared library may require another. This -happens when an \f(CW\*(C`ld \-shared\*(C'\fR link includes a shared library as one -of the input files. -.Sp -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 \fB\-rpath\-link\fR option -specifies the first set of directories to search. The -\&\fB\-rpath\-link\fR option may specify a sequence of directory names -either by specifying a list of names separated by colons, or by -appearing multiple times. -.Sp -This option should be used with caution as it overrides the search path -that may have been hard compiled into a shared library. In such a case it -is possible to use unintentionally a different search path than the -runtime linker would do. -.Sp -The linker uses the following search paths to locate required shared -libraries. -.RS 4 -.IP "1." 4 -Any directories specified by \fB\-rpath\-link\fR options. -.IP "2." 4 -Any directories specified by \fB\-rpath\fR options. The difference -between \fB\-rpath\fR and \fB\-rpath\-link\fR is that directories -specified by \fB\-rpath\fR options are included in the executable and -used at runtime, whereas the \fB\-rpath\-link\fR option is only effective -at link time. It is for the native linker only. -.IP "3." 4 -On an \s-1ELF\s0 system, if the \fB\-rpath\fR and \f(CW\*(C`rpath\-link\*(C'\fR options -were not used, search the contents of the environment variable -\&\f(CW\*(C`LD_RUN_PATH\*(C'\fR. It is for the native linker only. -.IP "4." 4 -On SunOS, if the \fB\-rpath\fR option was not used, search any -directories specified using \fB\-L\fR options. -.IP "5." 4 -For a native linker, the contents of the environment variable -\&\f(CW\*(C`LD_LIBRARY_PATH\*(C'\fR. -.IP "6." 4 -For a native \s-1ELF\s0 linker, the directories in \f(CW\*(C`DT_RUNPATH\*(C'\fR or -\&\f(CW\*(C`DT_RPATH\*(C'\fR of a shared library are searched for shared -libraries needed by it. The \f(CW\*(C`DT_RPATH\*(C'\fR entries are ignored if -\&\f(CW\*(C`DT_RUNPATH\*(C'\fR entries exist. -.IP "7." 4 -The default directories, normally \fI/lib\fR and \fI/usr/lib\fR. -.IP "8." 4 -For a native linker on an \s-1ELF\s0 system, if the file \fI/etc/ld.so.conf\fR -exists, the list of directories found in that file. -.RE -.RS 4 -.Sp -If the required shared library is not found, the linker will issue a -warning and continue with the link. -.RE -.IP "\fB\-shared\fR" 4 -.IX Item "-shared" -.PD 0 -.IP "\fB\-Bshareable\fR" 4 -.IX Item "-Bshareable" -.PD -Create a shared library. This is currently only supported on \s-1ELF\s0, \s-1XCOFF\s0 -and SunOS platforms. On SunOS, the linker will automatically create a -shared library if the \fB\-e\fR option is not used and there are -undefined symbols in the link. -.IP "\fB\-\-sort\-common\fR" 4 -.IX Item "--sort-common" -This option tells \fBld\fR 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 byte, then all the four byte, and then -everything else. This is to prevent gaps between symbols due to -alignment constraints. -.IP "\fB\-\-split\-by\-file [\fR\fIsize\fR\fB]\fR" 4 -.IX Item "--split-by-file [size]" -Similar to \fB\-\-split\-by\-reloc\fR but creates a new output section for -each input file when \fIsize\fR is reached. \fIsize\fR defaults to a -size of 1 if not given. -.IP "\fB\-\-split\-by\-reloc [\fR\fIcount\fR\fB]\fR" 4 -.IX Item "--split-by-reloc [count]" -Tries to creates extra sections in the output file so that no single -output section in the file contains more than \fIcount\fR relocations. -This is useful when generating huge relocatable files for downloading into -certain real time kernels with the \s-1COFF\s0 object file format; since \s-1COFF\s0 -cannot represent more than 65535 relocations in a single section. Note -that this will fail to work with object file formats which do not -support arbitrary sections. The linker will not split up individual -input sections for redistribution, so if a single input section contains -more than \fIcount\fR relocations one output section will contain that -many relocations. \fIcount\fR defaults to a value of 32768. -.IP "\fB\-\-stats\fR" 4 -.IX Item "--stats" -Compute and display statistics about the operation of the linker, such -as execution time and memory usage. -.IP "\fB\-\-traditional\-format\fR" 4 -.IX Item "--traditional-format" -For some targets, the output of \fBld\fR is different in some ways from -the output of some existing linker. This switch requests \fBld\fR to -use the traditional format instead. -.Sp -For example, on SunOS, \fBld\fR 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 -\&\f(CW\*(C`dbx\*(C'\fR program can not read the resulting program (\f(CW\*(C`gdb\*(C'\fR has no -trouble). The \fB\-\-traditional\-format\fR switch tells \fBld\fR to not -combine duplicate entries. -.IP "\fB\-\-section\-start\fR \fIsectionname\fR\fB=\fR\fIorg\fR" 4 -.IX Item "--section-start sectionname=org" -Locate a section in the output file at the absolute -address given by \fIorg\fR. You may use this option as many -times as necessary to locate multiple sections in the command -line. -\&\fIorg\fR must be a single hexadecimal integer; -for compatibility with other linkers, you may omit the leading -\&\fB0x\fR usually associated with hexadecimal values. \fINote:\fR there -should be no white space between \fIsectionname\fR, the equals -sign (``\fB=\fR''), and \fIorg\fR. -.IP "\fB\-Tbss\fR \fIorg\fR" 4 -.IX Item "-Tbss org" -.PD 0 -.IP "\fB\-Tdata\fR \fIorg\fR" 4 -.IX Item "-Tdata org" -.IP "\fB\-Ttext\fR \fIorg\fR" 4 -.IX Item "-Ttext org" -.PD -Same as \-\-section\-start, with \f(CW\*(C`.bss\*(C'\fR, \f(CW\*(C`.data\*(C'\fR or -\&\f(CW\*(C`.text\*(C'\fR as the \fIsectionname\fR. -.IP "\fB\-\-dll\-verbose\fR" 4 -.IX Item "--dll-verbose" -.PD 0 -.IP "\fB\-\-verbose\fR" 4 -.IX Item "--verbose" -.PD -Display the version number for \fBld\fR and list the linker emulations -supported. Display which input files can and cannot be opened. Display -the linker script being used by the linker. -.IP "\fB\-\-version\-script=\fR\fIversion-scriptfile\fR" 4 -.IX Item "--version-script=version-scriptfile" -Specify the name of a version script to the linker. This is typically -used when creating shared libraries to specify additional information -about the version hierarchy for the library being created. This option -is only meaningful on \s-1ELF\s0 platforms which support shared libraries. -.IP "\fB\-\-warn\-common\fR" 4 -.IX Item "--warn-common" -Warn when a common symbol is combined with another common symbol or with -a symbol definition. Unix linkers allow this somewhat sloppy practice, -but linkers on some other operating systems do not. This option allows -you to find potential problems from combining global symbols. -Unfortunately, some C libraries use this practice, so you may get some -warnings about symbols in the libraries as well as in your programs. -.Sp -There are three kinds of global symbols, illustrated here by C examples: -.RS 4 -.IP "\fBint i = 1;\fR" 4 -.IX Item "int i = 1;" -A definition, which goes in the initialized data section of the output -file. -.IP "\fBextern int i;\fR" 4 -.IX Item "extern int i;" -An undefined reference, which does not allocate space. -There must be either a definition or a common symbol for the -variable somewhere. -.IP "\fBint i;\fR" 4 -.IX Item "int i;" -A common symbol. If there are only (one or more) common symbols for a -variable, it goes in the uninitialized data area of the output file. -The linker merges multiple common symbols for the same variable into a -single symbol. If they are of different sizes, it picks the largest -size. The linker turns a common symbol into a declaration, if there is -a definition of the same variable. -.RE -.RS 4 -.Sp -The \fB\-\-warn\-common\fR option can produce five kinds of warnings. -Each warning consists of a pair of lines: the first describes the symbol -just encountered, and the second describes the previous symbol -encountered with the same name. One or both of the two symbols will be -a common symbol. -.IP "1." 4 -Turning a common symbol into a reference, because there is already a -definition for the symbol. -.Sp -.Vb 3 -\& <file>(<section>): warning: common of `<symbol>' -\& overridden by definition -\& <file>(<section>): warning: defined here -.Ve -.IP "2." 4 -Turning a common symbol into a reference, because a later definition for -the symbol is encountered. This is the same as the previous case, -except that the symbols are encountered in a different order. -.Sp -.Vb 3 -\& <file>(<section>): warning: definition of `<symbol>' -\& overriding common -\& <file>(<section>): warning: common is here -.Ve -.IP "3." 4 -Merging a common symbol with a previous same-sized common symbol. -.Sp -.Vb 3 -\& <file>(<section>): warning: multiple common -\& of `<symbol>' -\& <file>(<section>): warning: previous common is here -.Ve -.IP "4." 4 -Merging a common symbol with a previous larger common symbol. -.Sp -.Vb 3 -\& <file>(<section>): warning: common of `<symbol>' -\& overridden by larger common -\& <file>(<section>): warning: larger common is here -.Ve -.IP "5." 4 -Merging a common symbol with a previous smaller common symbol. This is -the same as the previous case, except that the symbols are -encountered in a different order. -.Sp -.Vb 3 -\& <file>(<section>): warning: common of `<symbol>' -\& overriding smaller common -\& <file>(<section>): warning: smaller common is here -.Ve -.RE -.RS 4 -.RE -.IP "\fB\-\-warn\-constructors\fR" 4 -.IX Item "--warn-constructors" -Warn if any global constructors are used. This is only useful for a few -object file formats. For formats like \s-1COFF\s0 or \s-1ELF\s0, the linker can not -detect the use of global constructors. -.IP "\fB\-\-warn\-multiple\-gp\fR" 4 -.IX Item "--warn-multiple-gp" -Warn if multiple global pointer values are required in the output file. -This is only meaningful for certain processors, such as the Alpha. -Specifically, some processors put large-valued constants in a special -section. A special register (the global pointer) points into the middle -of this section, so that constants can be loaded efficiently via a -base-register relative addressing mode. Since the offset in -base-register relative mode is fixed and relatively small (e.g., 16 -bits), this limits the maximum size of the constant pool. Thus, in -large programs, it is often necessary to use multiple global pointer -values in order to be able to address all possible constants. This -option causes a warning to be issued whenever this case occurs. -.IP "\fB\-\-warn\-once\fR" 4 -.IX Item "--warn-once" -Only warn once for each undefined symbol, rather than once per module -which refers to it. -.IP "\fB\-\-warn\-section\-align\fR" 4 -.IX Item "--warn-section-align" -Warn if the address of an output section is changed because of -alignment. Typically, the alignment will be set by an input section. -The address will only be changed if it not explicitly specified; that -is, if the \f(CW\*(C`SECTIONS\*(C'\fR command does not specify a start address for -the section. -.IP "\fB\-\-whole\-archive\fR" 4 -.IX Item "--whole-archive" -For each archive mentioned on the command line after the -\&\fB\-\-whole\-archive\fR 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. -.Sp -Two notes when using this option from gcc: First, gcc doesn't know -about this option, so you have to use \fB\-Wl,\-whole\-archive\fR. -Second, don't forget to use \fB\-Wl,\-no\-whole\-archive\fR 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. -.IP "\fB\-\-wrap\fR \fIsymbol\fR" 4 -.IX Item "--wrap symbol" -Use a wrapper function for \fIsymbol\fR. Any undefined reference to -\&\fIsymbol\fR will be resolved to \f(CW\*(C`_\|_wrap_\f(CIsymbol\f(CW\*(C'\fR. Any -undefined reference to \f(CW\*(C`_\|_real_\f(CIsymbol\f(CW\*(C'\fR will be resolved to -\&\fIsymbol\fR. -.Sp -This can be used to provide a wrapper for a system function. The -wrapper function should be called \f(CW\*(C`_\|_wrap_\f(CIsymbol\f(CW\*(C'\fR. If it -wishes to call the system function, it should call -\&\f(CW\*(C`_\|_real_\f(CIsymbol\f(CW\*(C'\fR. -.Sp -Here is a trivial example: -.Sp -.Vb 6 -\& void * -\& __wrap_malloc (int c) -\& { -\& printf ("malloc called with %ld\en", c); -\& return __real_malloc (c); -\& } -.Ve -.Sp -If you link other code with this file using \fB\-\-wrap malloc\fR, then -all calls to \f(CW\*(C`malloc\*(C'\fR will call the function \f(CW\*(C`_\|_wrap_malloc\*(C'\fR -instead. The call to \f(CW\*(C`_\|_real_malloc\*(C'\fR in \f(CW\*(C`_\|_wrap_malloc\*(C'\fR will -call the real \f(CW\*(C`malloc\*(C'\fR function. -.Sp -You may wish to provide a \f(CW\*(C`_\|_real_malloc\*(C'\fR function as well, so that -links without the \fB\-\-wrap\fR option will succeed. If you do this, -you should not put the definition of \f(CW\*(C`_\|_real_malloc\*(C'\fR in the same -file as \f(CW\*(C`_\|_wrap_malloc\*(C'\fR; if you do, the assembler may resolve the -call before the linker has a chance to wrap it to \f(CW\*(C`malloc\*(C'\fR. -.IP "\fB\-\-enable\-new\-dtags\fR" 4 -.IX Item "--enable-new-dtags" -.PD 0 -.IP "\fB\-\-disable\-new\-dtags\fR" 4 -.IX Item "--disable-new-dtags" -.PD -This linker can create the new dynamic tags in \s-1ELF\s0. But the older \s-1ELF\s0 -systems may not understand them. If you specify -\&\fB\-\-enable\-new\-dtags\fR, the dynamic tags will be created as needed. -If you specify \fB\-\-disable\-new\-dtags\fR, no new dynamic tags will be -created. By default, the new dynamic tags are not created. Note that -those options are only available for \s-1ELF\s0 systems. -.PP -The i386 \s-1PE\s0 linker supports the \fB\-shared\fR option, which causes -the output to be a dynamically linked library (\s-1DLL\s0) instead of a -normal executable. You should name the output \f(CW\*(C`*.dll\*(C'\fR when you -use this option. In addition, the linker fully supports the standard -\&\f(CW\*(C`*.def\*(C'\fR files, which may be specified on the linker command line -like an object file (in fact, it should precede archives it exports -symbols from, to ensure that they get linked in, just like a normal -object file). -.PP -In addition to the options common to all targets, the i386 \s-1PE\s0 linker -support additional command line options that are specific to the i386 -\&\s-1PE\s0 target. Options that take values may be separated from their -values by either a space or an equals sign. -.IP "\fB\-\-add\-stdcall\-alias\fR" 4 -.IX Item "--add-stdcall-alias" -If given, symbols with a stdcall suffix (@\fInn\fR) will be exported -as-is and also with the suffix stripped. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-base\-file\fR \fIfile\fR" 4 -.IX Item "--base-file file" -Use \fIfile\fR as the name of a file in which to save the base -addresses of all the relocations needed for generating DLLs with -\&\fIdlltool\fR. -[This is an i386 \s-1PE\s0 specific option] -.IP "\fB\-\-dll\fR" 4 -.IX Item "--dll" -Create a \s-1DLL\s0 instead of a regular executable. You may also use -\&\fB\-shared\fR or specify a \f(CW\*(C`LIBRARY\*(C'\fR in a given \f(CW\*(C`.def\*(C'\fR -file. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-enable\-stdcall\-fixup\fR" 4 -.IX Item "--enable-stdcall-fixup" -.PD 0 -.IP "\fB\-\-disable\-stdcall\-fixup\fR" 4 -.IX Item "--disable-stdcall-fixup" -.PD -If the link finds a symbol that it cannot resolve, it will attempt to -do ``fuzzy linking'' by looking for another defined symbol that differs -only in the format of the symbol name (cdecl vs stdcall) and will -resolve that symbol by linking to the match. For example, the -undefined symbol \f(CW\*(C`_foo\*(C'\fR might be linked to the function -\&\f(CW\*(C`_foo@12\*(C'\fR, or the undefined symbol \f(CW\*(C`_bar@16\*(C'\fR might be linked -to the function \f(CW\*(C`_bar\*(C'\fR. 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 \fB\-\-enable\-stdcall\-fixup\fR, this -feature is fully enabled and warnings are not printed. If you specify -\&\fB\-\-disable\-stdcall\-fixup\fR, this feature is disabled and such -mismatches are considered to be errors. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-export\-all\-symbols\fR" 4 -.IX Item "--export-all-symbols" -If given, all global symbols in the objects used to build a \s-1DLL\s0 will -be exported by the \s-1DLL\s0. Note that this is the default if there -otherwise wouldn't be any exported symbols. When symbols are -explicitly exported via \s-1DEF\s0 files or implicitly exported via function -attributes, the default is to not export anything else unless this -option is given. Note that the symbols \f(CW\*(C`DllMain@12\*(C'\fR, -\&\f(CW\*(C`DllEntryPoint@0\*(C'\fR, \f(CW\*(C`DllMainCRTStartup@12\*(C'\fR, and -\&\f(CW\*(C`impure_ptr\*(C'\fR will not be automatically -exported. Also, symbols imported from other DLLs will not be -re\-exported, nor will symbols specifying the \s-1DLL\s0's internal layout -such as those beginning with \f(CW\*(C`_head_\*(C'\fR or ending with -\&\f(CW\*(C`_iname\*(C'\fR. In addition, no symbols from \f(CW\*(C`libgcc\*(C'\fR, -\&\f(CW\*(C`libstd++\*(C'\fR, \f(CW\*(C`libmingw32\*(C'\fR, or \f(CW\*(C`crtX.o\*(C'\fR will be exported. -Symbols whose names begin with \f(CW\*(C`_\|_rtti_\*(C'\fR or \f(CW\*(C`_\|_builtin_\*(C'\fR 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: \f(CW\*(C`_cygwin_dll_entry@12\*(C'\fR, -\&\f(CW\*(C`_cygwin_crt0_common@8\*(C'\fR, \f(CW\*(C`_cygwin_noncygwin_dll_entry@12\*(C'\fR, -\&\f(CW\*(C`_fmode\*(C'\fR, \f(CW\*(C`_impure_ptr\*(C'\fR, \f(CW\*(C`cygwin_attach_dll\*(C'\fR, -\&\f(CW\*(C`cygwin_premain0\*(C'\fR, \f(CW\*(C`cygwin_premain1\*(C'\fR, \f(CW\*(C`cygwin_premain2\*(C'\fR, -\&\f(CW\*(C`cygwin_premain3\*(C'\fR, and \f(CW\*(C`environ\*(C'\fR. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-exclude\-symbols\fR \fIsymbol\fR\fB,\fR\fIsymbol\fR\fB,...\fR" 4 -.IX Item "--exclude-symbols symbol,symbol,..." -Specifies a list of symbols which should not be automatically -exported. The symbol names may be delimited by commas or colons. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-exclude\-libs\fR \fIlib\fR\fB,\fR\fIlib\fR\fB,...\fR" 4 -.IX Item "--exclude-libs lib,lib,..." -Specifies a list of archive libraries from which symbols should not be automatically -exported. The library names may be delimited by commas or colons. Specifying -\&\f(CW\*(C`\-\-exclude\-libs ALL\*(C'\fR excludes symbols in all archive libraries from -automatic export. Symbols explicitly listed in a .def file are still exported, -regardless of this option. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-file\-alignment\fR" 4 -.IX Item "--file-alignment" -Specify the file alignment. Sections in the file will always begin at -file offsets which are multiples of this number. This defaults to -512. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-heap\fR \fIreserve\fR" 4 -.IX Item "--heap reserve" -.PD 0 -.IP "\fB\-\-heap\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4 -.IX Item "--heap reserve,commit" -.PD -Specify the amount of memory to reserve (and optionally commit) to be -used as heap for this program. The default is 1Mb reserved, 4K -committed. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-image\-base\fR \fIvalue\fR" 4 -.IX Item "--image-base value" -Use \fIvalue\fR as the base address of your program or dll. This is -the lowest memory location that will be used when your program or dll -is loaded. To reduce the need to relocate and improve performance of -your dlls, each should have a unique base address and not overlap any -other dlls. The default is 0x400000 for executables, and 0x10000000 -for dlls. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-kill\-at\fR" 4 -.IX Item "--kill-at" -If given, the stdcall suffixes (@\fInn\fR) will be stripped from -symbols before they are exported. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-major\-image\-version\fR \fIvalue\fR" 4 -.IX Item "--major-image-version value" -Sets the major number of the ``image version''. Defaults to 1. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-major\-os\-version\fR \fIvalue\fR" 4 -.IX Item "--major-os-version value" -Sets the major number of the ``os version''. Defaults to 4. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-major\-subsystem\-version\fR \fIvalue\fR" 4 -.IX Item "--major-subsystem-version value" -Sets the major number of the ``subsystem version''. Defaults to 4. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-minor\-image\-version\fR \fIvalue\fR" 4 -.IX Item "--minor-image-version value" -Sets the minor number of the ``image version''. Defaults to 0. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-minor\-os\-version\fR \fIvalue\fR" 4 -.IX Item "--minor-os-version value" -Sets the minor number of the ``os version''. Defaults to 0. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-minor\-subsystem\-version\fR \fIvalue\fR" 4 -.IX Item "--minor-subsystem-version value" -Sets the minor number of the ``subsystem version''. Defaults to 0. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-output\-def\fR \fIfile\fR" 4 -.IX Item "--output-def file" -The linker will create the file \fIfile\fR which will contain a \s-1DEF\s0 -file corresponding to the \s-1DLL\s0 the linker is generating. This \s-1DEF\s0 file -(which should be called \f(CW\*(C`*.def\*(C'\fR) may be used to create an import -library with \f(CW\*(C`dlltool\*(C'\fR or may be used as a reference to -automatically or implicitly exported symbols. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-out\-implib\fR \fIfile\fR" 4 -.IX Item "--out-implib file" -The linker will create the file \fIfile\fR which will contain an -import lib corresponding to the \s-1DLL\s0 the linker is generating. This -import lib (which should be called \f(CW\*(C`*.dll.a\*(C'\fR or \f(CW\*(C`*.a\*(C'\fR -may be used to link clients against the generated \s-1DLL\s0; this behavior -makes it possible to skip a separate \f(CW\*(C`dlltool\*(C'\fR import library -creation step. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-enable\-auto\-image\-base\fR" 4 -.IX Item "--enable-auto-image-base" -Automatically choose the image base for DLLs, unless one is specified -using the \f(CW\*(C`\-\-image\-base\*(C'\fR argument. By using a hash generated -from the dllname to create unique image bases for each \s-1DLL\s0, in-memory -collisions and relocations which can delay program execution are -avoided. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-disable\-auto\-image\-base\fR" 4 -.IX Item "--disable-auto-image-base" -Do not automatically generate a unique image base. If there is no -user-specified image base (\f(CW\*(C`\-\-image\-base\*(C'\fR) then use the platform -default. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-dll\-search\-prefix\fR \fIstring\fR" 4 -.IX Item "--dll-search-prefix string" -When linking dynamically to a dll without an import library, -search for \f(CW\*(C`<string><basename>.dll\*(C'\fR in preference to -\&\f(CW\*(C`lib<basename>.dll\*(C'\fR. This behavior allows easy distinction -between DLLs built for the various \*(L"subplatforms\*(R": native, cygwin, -uwin, pw, etc. For instance, cygwin DLLs typically use -\&\f(CW\*(C`\-\-dll\-search\-prefix=cyg\*(C'\fR. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-enable\-auto\-import\fR" 4 -.IX Item "--enable-auto-import" -Do sophisticated linking of \f(CW\*(C`_symbol\*(C'\fR to \f(CW\*(C`_\|_imp_\|_symbol\*(C'\fR for -\&\s-1DATA\s0 imports from DLLs, and create the necessary thunking symbols when -building the import libraries with those \s-1DATA\s0 exports. This generally -will 'just work' \*(-- but sometimes you may see this message: -.Sp -"variable '<var>' can't be auto\-imported. Please read the -documentation for ld's \f(CW\*(C`\-\-enable\-auto\-import\*(C'\fR for details." -.Sp -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 \s-1DLL\s0, as well as using a -constant index into an array variable imported from a \s-1DLL\s0. 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. -.Sp -There are several ways to address this difficulty, regardless of the -data type of the exported variable: -.Sp -One way is to use \-\-enable\-runtime\-pseudo\-reloc switch. This leaves the task -of adjusting references in your client code for runtime environment, so -this method works only when runtime environtment supports this feature. -.Sp -A second solution is to force one of the 'constants' to be a variable \*(-- -that is, unknown and un-optimizable at compile time. For arrays, -there are two possibilities: a) make the indexee (the array's address) -a variable, or b) make the 'constant' index a variable. Thus: -.Sp -.Vb 3 -\& extern type extern_array[]; -\& extern_array[1] --> -\& { volatile type *t=extern_array; t[1] } -.Ve -.Sp -or -.Sp -.Vb 3 -\& extern type extern_array[]; -\& extern_array[1] --> -\& { volatile int t=1; extern_array[t] } -.Ve -.Sp -For structs (and most other multiword data types) the only option -is to make the struct itself (or the long long, or the ...) variable: -.Sp -.Vb 3 -\& extern struct s extern_struct; -\& extern_struct.field --> -\& { volatile struct s *t=&extern_struct; t->field } -.Ve -.Sp -or -.Sp -.Vb 3 -\& extern long long extern_ll; -\& extern_ll --> -\& { volatile long long * local_ll=&extern_ll; *local_ll } -.Ve -.Sp -A third method of dealing with this difficulty is to abandon -\&'auto\-import' for the offending symbol and mark it with -\&\f(CW\*(C`_\|_declspec(dllimport)\*(C'\fR. However, in practice that -requires using compile-time #defines to indicate whether you are -building a \s-1DLL\s0, building client code that will link to the \s-1DLL\s0, or -merely building/linking to a static library. In making the choice -between the various methods of resolving the 'direct address with -constant offset' problem, you should consider typical real-world usage: -.Sp -Original: -.Sp -.Vb 7 -\& --foo.h -\& extern int arr[]; -\& --foo.c -\& #include "foo.h" -\& void main(int argc, char **argv){ -\& printf("%d\en",arr[1]); -\& } -.Ve -.Sp -Solution 1: -.Sp -.Vb 9 -\& --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\en",parr[1]); -\& } -.Ve -.Sp -Solution 2: -.Sp -.Vb 14 -\& --foo.h -\& /* Note: auto-export is assumed (no __declspec(dllexport)) */ -\& #if (defined(_WIN32) || defined(__CYGWIN__)) && \e -\& !(defined(FOO_BUILD_DLL) || defined(FOO_STATIC)) -\& #define FOO_IMPORT __declspec(dllimport) -\& #else -\& #define FOO_IMPORT -\& #endif -\& extern FOO_IMPORT int arr[]; -\& --foo.c -\& #include "foo.h" -\& void main(int argc, char **argv){ -\& printf("%d\en",arr[1]); -\& } -.Ve -.Sp -A fourth way to avoid this problem is to re-code your -library to use a functional interface rather than a data interface -for the offending variables (e.g. \fIset_foo()\fR and \fIget_foo()\fR accessor -functions). -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-disable\-auto\-import\fR" 4 -.IX Item "--disable-auto-import" -Do not attempt to do sophisticalted linking of \f(CW\*(C`_symbol\*(C'\fR to -\&\f(CW\*(C`_\|_imp_\|_symbol\*(C'\fR for \s-1DATA\s0 imports from DLLs. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-enable\-runtime\-pseudo\-reloc\fR" 4 -.IX Item "--enable-runtime-pseudo-reloc" -If your code contains expressions described in \-\-enable\-auto\-import section, -that is, \s-1DATA\s0 imports from \s-1DLL\s0 with non-zero offset, this switch will create -a vector of 'runtime pseudo relocations' which can be used by runtime -environment to adjust references to such data in your client code. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-disable\-runtime\-pseudo\-reloc\fR" 4 -.IX Item "--disable-runtime-pseudo-reloc" -Do not create pseudo relocations for non-zero offset \s-1DATA\s0 imports from -DLLs. This is the default. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-enable\-extra\-pe\-debug\fR" 4 -.IX Item "--enable-extra-pe-debug" -Show additional debug info related to auto-import symbol thunking. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-section\-alignment\fR" 4 -.IX Item "--section-alignment" -Sets the section alignment. Sections in memory will always begin at -addresses which are a multiple of this number. Defaults to 0x1000. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-stack\fR \fIreserve\fR" 4 -.IX Item "--stack reserve" -.PD 0 -.IP "\fB\-\-stack\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4 -.IX Item "--stack reserve,commit" -.PD -Specify the amount of memory to reserve (and optionally commit) to be -used as stack for this program. The default is 2Mb reserved, 4K -committed. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.IP "\fB\-\-subsystem\fR \fIwhich\fR" 4 -.IX Item "--subsystem which" -.PD 0 -.IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR" 4 -.IX Item "--subsystem which:major" -.IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR\fB.\fR\fIminor\fR" 4 -.IX Item "--subsystem which:major.minor" -.PD -Specifies the subsystem under which your program will execute. The -legal values for \fIwhich\fR are \f(CW\*(C`native\*(C'\fR, \f(CW\*(C`windows\*(C'\fR, -\&\f(CW\*(C`console\*(C'\fR, and \f(CW\*(C`posix\*(C'\fR. You may optionally set the -subsystem version also. -[This option is specific to the i386 \s-1PE\s0 targeted port of the linker] -.SH "ENVIRONMENT" -.IX Header "ENVIRONMENT" -You can change the behavior of \fBld\fR with the environment variables -\&\f(CW\*(C`GNUTARGET\*(C'\fR, -\&\f(CW\*(C`LDEMULATION\*(C'\fR and \f(CW\*(C`COLLECT_NO_DEMANGLE\*(C'\fR. -.PP -\&\f(CW\*(C`GNUTARGET\*(C'\fR determines the input-file object format if you don't -use \fB\-b\fR (or its synonym \fB\-\-format\fR). Its value should be one -of the \s-1BFD\s0 names for an input format. If there is no -\&\f(CW\*(C`GNUTARGET\*(C'\fR in the environment, \fBld\fR uses the natural format -of the target. If \f(CW\*(C`GNUTARGET\*(C'\fR is set to \f(CW\*(C`default\*(C'\fR then \s-1BFD\s0 -attempts to discover the input format by examining binary input files; -this method often succeeds, but there are potential ambiguities, since -there is no method of ensuring that the magic number used to specify -object-file formats is unique. However, the configuration procedure for -\&\s-1BFD\s0 on each system places the conventional format for that system first -in the search\-list, so ambiguities are resolved in favor of convention. -.PP -\&\f(CW\*(C`LDEMULATION\*(C'\fR determines the default emulation if you don't use the -\&\fB\-m\fR option. The emulation can affect various aspects of linker -behaviour, particularly the default linker script. You can list the -available emulations with the \fB\-\-verbose\fR or \fB\-V\fR options. If -the \fB\-m\fR option is not used, and the \f(CW\*(C`LDEMULATION\*(C'\fR environment -variable is not defined, the default emulation depends upon how the -linker was configured. -.PP -Normally, the linker will default to demangling symbols. However, if -\&\f(CW\*(C`COLLECT_NO_DEMANGLE\*(C'\fR is set in the environment, then it will -default to not demangling symbols. This environment variable is used in -a similar fashion by the \f(CW\*(C`gcc\*(C'\fR linker wrapper program. The default -may be overridden by the \fB\-\-demangle\fR and \fB\-\-no\-demangle\fR -options. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIar\fR\|(1), \fInm\fR\|(1), \fIobjcopy\fR\|(1), \fIobjdump\fR\|(1), \fIreadelf\fR\|(1) and -the Info entries for \fIbinutils\fR and -\&\fIld\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, -2002, 2003 Free Software Foundation, Inc. -.PP -Permission is granted to copy, distribute and/or modify this document -under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 -or any later version published by the Free Software Foundation; -with no Invariant Sections, with no Front-Cover Texts, and with no -Back-Cover Texts. A copy of the license is included in the -section entitled ``\s-1GNU\s0 Free Documentation License''. diff --git a/gnu/usr.bin/binutils/ld/ld.h b/gnu/usr.bin/binutils/ld/ld.h index 7b99900b1a3..53b20ed422a 100644 --- a/gnu/usr.bin/binutils/ld/ld.h +++ b/gnu/usr.bin/binutils/ld/ld.h @@ -236,18 +236,15 @@ extern bfd_boolean force_make_executable; /* Non-zero if we are processing a --defsym from the command line. */ extern int parsing_defsym; -extern int yyparse PARAMS ((void)); - -extern void add_cref PARAMS ((const char *, bfd *, asection *, bfd_vma)); -extern void output_cref PARAMS ((FILE *)); -extern void check_nocrossrefs PARAMS ((void)); - -extern void ld_abort PARAMS ((const char *, int, const char *)) - ATTRIBUTE_NORETURN; +extern int yyparse (void); +extern void add_cref (const char *, bfd *, asection *, bfd_vma); +extern void output_cref (FILE *); +extern void check_nocrossrefs (void); +extern void ld_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; /* If gcc >= 2.6, we can give a function name, too. */ #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6) -#define __PRETTY_FUNCTION__ ((char*) NULL) +#define __PRETTY_FUNCTION__ NULL #endif #undef abort diff --git a/gnu/usr.bin/binutils/ld/ld.texinfo b/gnu/usr.bin/binutils/ld/ld.texinfo index cfebf096e42..64ca44ff679 100644 --- a/gnu/usr.bin/binutils/ld/ld.texinfo +++ b/gnu/usr.bin/binutils/ld/ld.texinfo @@ -1,7 +1,7 @@ \input texinfo @setfilename ld.info @c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -@c 2001, 2002, 2003 Free Software Foundation, Inc. +@c 2001, 2002, 2003, 2004 Free Software Foundation, Inc. @syncodeindex ky cp @include configdoc.texi @c (configdoc.texi is generated by the Makefile) @@ -61,7 +61,7 @@ END-INFO-DIR-ENTRY This file documents the @sc{gnu} linker LD version @value{VERSION}. Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, -2001, 2002, 2003 Free Software Foundation, Inc. +2001, 2002, 2003, 2004 Free Software Foundation, Inc. @ignore @@ -106,7 +106,7 @@ notice identical to this one except for the removal of this paragraph @vskip 0pt plus 1filll @c man begin COPYRIGHT Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, -2002, 2003 Free Software Foundation, Inc. +2002, 2003, 2004 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 @@ -687,7 +687,9 @@ Turn off page alignment of sections, and mark the output as Set the text and data sections to be readable and writable. Also, do not page-align the data segment, and disable linking against shared libraries. If the output format supports Unix style magic numbers, -mark the output as @code{OMAGIC}. +mark the output as @code{OMAGIC}. Note: Although a writable text section +is allowed for PE-COFF targets, it does not conform to the format +specification published by Microsoft. @kindex --no-omagic @cindex OMAGIC @@ -728,9 +730,9 @@ This option is currently only supported on ELF platforms. @cindex partial link @cindex relocatable output @kindex -r -@kindex --relocateable +@kindex --relocatable @item -r -@itemx --relocateable +@itemx --relocatable Generate relocatable output---i.e., generate an output file that can in turn serve as input to @command{ld}. This is often called @dfn{partial linking}. As a side effect, in environments that support standard Unix @@ -875,29 +877,73 @@ for Solaris compatibility. @kindex -z @var{keyword} @item -z @var{keyword} -The recognized keywords are @code{initfirst}, @code{interpose}, -@code{loadfltr}, @code{nodefaultlib}, @code{nodelete}, @code{nodlopen}, -@code{nodump}, @code{now}, @code{origin}, @code{combreloc}, @code{nocombreloc} -and @code{nocopyreloc}. -The other keywords are -ignored for Solaris compatibility. @code{initfirst} marks the object -to be initialized first at runtime before any other objects. -@code{interpose} marks the object that its symbol table interposes -before all symbols but the primary executable. @code{loadfltr} marks -the object that its filtees be processed immediately at runtime. -@code{nodefaultlib} marks the object that the search for dependencies -of this object will ignore any default library search paths. -@code{nodelete} marks the object shouldn't be unloaded at runtime. -@code{nodlopen} marks the object not available to @code{dlopen}. -@code{nodump} marks the object can not be dumped by @code{dldump}. -@code{now} marks the object with the non-lazy runtime binding. -@code{origin} marks the object may contain $ORIGIN. -@code{defs} disallows undefined symbols. -@code{muldefs} allows multiple definitions. -@code{combreloc} combines multiple reloc sections and sorts them -to make dynamic symbol lookup caching possible. -@code{nocombreloc} disables multiple reloc sections combining. -@code{nocopyreloc} disables production of copy relocs. +The recognized keywords are: +@table @samp + +@item combreloc +Combines multiple reloc sections and sorts them to make dynamic symbol +lookup caching possible. + +@item defs +Disallows undefined symbols in object files. Undefined symbols in +shared libraries are still allowed. + +@item initfirst +This option is only meaningful when building a shared object. +It marks the object so that its runtime initialization will occur +before the runtime initialization of any other objects brought into +the process at the same time. Similarly the runtime finalization of +the object will occur after the runtime finalization of any other +objects. + +@item interpose +Marks the object that its symbol table interposes before all symbols +but the primary executable. + +@item loadfltr +Marks the object that its filters be processed immediately at +runtime. + +@item muldefs +Allows multiple definitions. + +@item nocombreloc +Disables multiple reloc sections combining. + +@item nocopyreloc +Disables production of copy relocs. + +@item nodefaultlib +Marks the object that the search for dependencies of this object will +ignore any default library search paths. + +@item nodelete +Marks the object shouldn't be unloaded at runtime. + +@item nodlopen +Marks the object not available to @code{dlopen}. + +@item nodump +Marks the object can not be dumped by @code{dldump}. + +@item now +When generating an executable or shared library, mark it to tell the +dynamic linker to resolve all symbols when the program is started, or +when the shared library is linked to using dlopen, instead of +deferring function call resolution to the point when the function is +first called. + +@item origin +Marks the object may contain $ORIGIN. + +@end table + +Other keywords are ignored for Solaris compatibility. + +@kindex -Z +@item -Z +Produce 'Standard' executables, disables Writable XOR Executable features +in resulting binaries. @kindex -( @cindex groups of archives @@ -931,6 +977,18 @@ behaviour from release 2.14 onwards is to reject such input files, and so the @samp{--accept-unknown-input-arch} option has been added to restore the old behaviour. +@kindex --as-needed +@kindex --no-as-needed +@item --as-needed +@itemx --no-as-needed +This option affects ELF DT_NEEDED tags for dynamic libraries mentioned +on the command line after the @option{--as-needed} option. Normally, +the linker will add a DT_NEEDED tag for each dynamic library mentioned +on the command line, regardless of whether the library is actually +needed. @option{--as-needed} causes DT_NEEDED tags to only be emitted +for libraries that satisfy some reference from regular objects. +@option{--no-as-needed} restores the default behaviour. + @kindex -assert @var{keyword} @item -assert @var{keyword} This option is ignored for SunOS compatibility. @@ -953,8 +1011,8 @@ multiple times on the command line: it affects library searching for Set the @code{DF_1_GROUP} flag in the @code{DT_FLAGS_1} entry in the dynamic section. This causes the runtime linker to handle lookups in this object and its dependencies to be performed only inside the group. -@option{--no-undefined} is implied. This option is only meaningful on ELF -platforms which support shared libraries. +@option{--unresolved-symbols=report-all} is implied. This option is +only meaningful on ELF platforms which support shared libraries. @kindex -Bstatic @kindex -dn @@ -968,7 +1026,8 @@ Do not link against shared libraries. This is only meaningful on platforms for which shared libraries are supported. The different variants of this option are for compatibility with various systems. You may use this option multiple times on the command line: it affects -library searching for @option{-l} options which follow it. +library searching for @option{-l} options which follow it. This +option also implies @option{--unresolved-symbols=report-all}. @kindex -Bsymbolic @item -Bsymbolic @@ -987,7 +1046,7 @@ been assigned to see if there any overlaps. Normally the linker will perform this check, and if it finds any overlaps it will produce suitable error messages. The linker does know about, and does make allowances for sections in overlays. The default behaviour can be -restored by using the command line switch @samp{--check-sections}. +restored by using the command line switch @option{--check-sections}. @cindex cross reference table @kindex --cref @@ -1108,7 +1167,7 @@ Print a summary of all target specific options on the standard output and exit. @kindex -Map @item -Map @var{mapfile} Print a link map to the file @var{mapfile}. See the description of the -@samp{-M} option, above. +@option{-M} option, above. @cindex memory usage @kindex --no-keep-memory @@ -1123,11 +1182,11 @@ while linking a large executable. @kindex -z defs @item --no-undefined @itemx -z defs -Normally when creating a non-symbolic shared library, undefined symbols -are allowed and left to be resolved by the runtime loader. This option -disallows such undefined symbols if they come from regular object -files. The switch @samp{--no-allow-shlib-undefined} controls the -behaviour for shared objects being linked into the shared library. +Report unresolved symbol references from regular object files. This +is done even if the linker is creating a non-symbolic shared library. +The switch @option{--[no-]allow-shlib-undefined} controls the +behaviour for reporting unresolved references found in shared +libraries being linked in. @kindex --allow-multiple-definition @kindex -z muldefs @@ -1141,22 +1200,21 @@ first definition will be used. @kindex --no-allow-shlib-undefined @item --allow-shlib-undefined @itemx --no-allow-shlib-undefined -Allow (the default) or disallow undefined symbols in shared objects. -The setting of this switch overrides @samp{--no-undefined} where -shared objects are concerned. Thus if @samp{--no-undefined} is set -but @samp{--no-allow-shlib-undefined} is not, the net result will be -that undefined symbols in regular object files will trigger an error, -but undefined symbols in shared objects will be ignored. - -The reason that @samp{--allow-shlib-undefined} is the default is that -the shared object being specified at link time may not be the same one -that is available at load time, so the symbols might actually be +Allows (the default) or disallows undefined symbols in shared libraries. +This switch is similar to @option{--no-undefined} except that it +determines the behaviour when the undefined symbols are in a +shared library rather than a regular object file. It does not affect +how undefined symbols in regular object files are handled. + +The reason that @option{--allow-shlib-undefined} is the default is that +the shared library being specified at link time may not be the same as +the one that is available at load time, so the symbols might actually be resolvable at load time. Plus there are some systems, (eg BeOS) where -undefined symbols in shared libraries is normal since the kernel -patches them at load time to select which function is most appropriate -for the current architecture. eg. to dynamically select an appropriate -memset function. Apparently it is also normal for HPPA shared -libraries to have undefined symbols. +undefined symbols in shared libraries is normal. (The kernel patches +them at load time to select which function is most appropriate +for the current architecture. This is used for example to dynamically +select an appropriate memset function). Apparently it is also normal +for HPPA shared libraries to have undefined symbols. @kindex --no-undefined-version @item --no-undefined-version @@ -1209,6 +1267,18 @@ command @code{OUTPUT_FORMAT} can also specify the output format, but this option overrides it. @xref{BFD}. @end ifclear +@kindex -pie +@kindex --pic-executable +@item -pie +@itemx --pic-executable +@cindex position independent executables +Create a position independent executable. This is currently only supported on +ELF platforms. Position independent executables are similar to shared +libraries in that they are relocated by the dynamic linker to the virtual +address the OS chooses for them (which can vary between invocations). Like +normal dynamically linked executables they can be executed and symbols +defined in the executable cannot be overridden by shared libraries. + @kindex -qmagic @item -qmagic This option is ignored for Linux compatibility. @@ -1436,6 +1506,37 @@ sign (``@key{=}''), and @var{org}. Same as --section-start, with @code{.bss}, @code{.data} or @code{.text} as the @var{sectionname}. +@kindex --unresolved-symbols +@item --unresolved-symbols=@var{method} +Determine how to handle unresolved symbols. There are four possible +values for @samp{method}: + +@table @samp +@item ignore-all +Do not report any unresolved symbols. + +@item report-all +Report all unresolved symbols. This is the default. + +@item ignore-in-object-files +Report unresolved symbols that are contained in shared libraries, but +ignore them if they come from regular object files. + +@item ignore-in-shared-libs +Report unresolved symbols that come from regular object files, but +ignore them if they come from shared libraries. This can be useful +when creating a dynamic binary and it is known that all the shared +libraries that it should be referencing are included on the linker's +command line. +@end table + +The behaviour for shared libraries on their own can also be controlled +by the @option{--[no-]allow-shlib-undefined} option. + +Normally the linker will generate an error message for each reported +unresolved symbol but the option @option{--warn-unresolved-symbols} +can change this to a warning. + @kindex --verbose @cindex verbose @item --dll-verbose @@ -1458,10 +1559,10 @@ is only meaningful on ELF platforms which support shared libraries. @cindex combining symbols, warnings on @item --warn-common Warn when a common symbol is combined with another common symbol or with -a symbol definition. Unix linkers allow this somewhat sloppy practice, +a symbol definition. Unix linkers allow this somewhat sloppy practise, but linkers on some other operating systems do not. This option allows you to find potential problems from combining global symbols. -Unfortunately, some C libraries use this practice, so you may get some +Unfortunately, some C libraries use this practise, so you may get some warnings about symbols in the libraries as well as in your programs. There are three kinds of global symbols, illustrated here by C examples: @@ -1575,6 +1676,17 @@ The address will only be changed if it not explicitly specified; that is, if the @code{SECTIONS} command does not specify a start address for the section (@pxref{SECTIONS}). +@kindex --warn-unresolved-symbols +@item --warn-unresolved-symbols +If the linker is going to report an unresolved symbol (see the option +@option{--unresolved-symbols}) it will normally generate an error. +This option makes it generate a warning instead. + +@kindex --error-unresolved-symbols +@item --error-unresolved-symbols +This restores the linker's default behaviour of generating errors when +it is reporting unresolved symbols. + @kindex --whole-archive @cindex including an entire archive @item --whole-archive @@ -1607,9 +1719,9 @@ Here is a trivial example: @smallexample void * -__wrap_malloc (int c) +__wrap_malloc (size_t c) @{ - printf ("malloc called with %ld\n", c); + printf ("malloc called with %zu\n", c); return __real_malloc (c); @} @end smallexample @@ -1821,7 +1933,7 @@ automatically or implicitly exported symbols. The linker will create the file @var{file} which will contain an import lib corresponding to the DLL the linker is generating. This import lib (which should be called @code{*.dll.a} or @code{*.a} -may be used to link clients against the generated DLL; this behavior +may be used to link clients against the generated DLL; this behaviour makes it possible to skip a separate @code{dlltool} import library creation step. [This option is specific to the i386 PE targeted port of the linker] @@ -1847,7 +1959,7 @@ default. @item --dll-search-prefix @var{string} When linking dynamically to a dll without an import library, search for @code{<string><basename>.dll} in preference to -@code{lib<basename>.dll}. This behavior allows easy distinction +@code{lib<basename>.dll}. This behaviour allows easy distinction between DLLs built for the various "subplatforms": native, cygwin, uwin, pw, etc. For instance, cygwin DLLs typically use @code{--dll-search-prefix=cyg}. @@ -1857,8 +1969,13 @@ uwin, pw, etc. For instance, cygwin DLLs typically use @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 import libraries with those DATA exports. This generally -will 'just work' -- but sometimes you may see this message: +building the import libraries with those DATA exports. Note: Use of the +'auto-import' extension will cause the text section of the image file +to be made writable. This does not conform to the PE-COFF format +specification published by Microsoft. + +Using 'auto-import' generally will 'just work' -- but sometimes you may +see this message: "variable '<var>' can't be auto-imported. Please read the documentation for ld's @code{--enable-auto-import} for details." @@ -1878,7 +1995,7 @@ data type of the exported variable: One way is to use --enable-runtime-pseudo-reloc switch. This leaves the task of adjusting references in your client code for runtime environment, so -this method works only when runtime environtment supports this feature. +this method works only when runtime environment supports this feature. A second solution is to force one of the 'constants' to be a variable -- that is, unknown and un-optimizable at compile time. For arrays, @@ -1918,7 +2035,7 @@ extern_ll --> A third method of dealing with this difficulty is to abandon 'auto-import' for the offending symbol and mark it with -@code{__declspec(dllimport)}. However, in practice that +@code{__declspec(dllimport)}. However, in practise that requires using compile-time #defines to indicate whether you are building a DLL, building client code that will link to the DLL, or merely building/linking to a static library. In making the choice @@ -1975,7 +2092,7 @@ functions). @kindex --disable-auto-import @item --disable-auto-import -Do not attempt to do sophisticalted linking of @code{_symbol} to +Do not attempt to do sophisticated linking of @code{_symbol} to @code{__imp__symbol} for DATA imports from DLLs. [This option is specific to the i386 PE targeted port of the linker] @@ -2033,7 +2150,7 @@ subsystem version also. @c man begin ENVIRONMENT -You can change the behavior of @command{ld} with the environment variables +You can change the behaviour of @command{ld} with the environment variables @ifclear SingleFormat @code{GNUTARGET}, @end ifclear @@ -2674,7 +2791,8 @@ in the first input file. The first section will be at address zero. The full description of an output section looks like this: @smallexample @group -@var{section} [@var{address}] [(@var{type})] : [AT(@var{lma})] +@var{section} [@var{address}] [(@var{type})] : + [AT(@var{lma})] [SUBALIGN(@var{subsection_align})] @{ @var{output-section-command} @var{output-section-command} @@ -3195,7 +3313,8 @@ We showed above that the full description of an output section looked like this: @smallexample @group -@var{section} [@var{address}] [(@var{type})] : [AT(@var{lma})] +@var{section} [@var{address}] [(@var{type})] : + [AT(@var{lma})] [SUBALIGN(@var{subsection_align})] @{ @var{output-section-command} @var{output-section-command} @@ -3210,6 +3329,7 @@ remaining section attributes. @menu * Output Section Type:: Output section type * Output Section LMA:: Output section LMA +* Forced Input Alignment:: Forced Input Alignment * Output Section Region:: Output section region * Output Section Phdr:: Output section phdr * Output Section Fill:: Output section fill @@ -3266,8 +3386,13 @@ Address}). The linker will normally set the LMA equal to the VMA. You can change that by using the @code{AT} keyword. The expression @var{lma} that follows the @code{AT} keyword specifies the load address of the -section. Alternatively, with @samp{AT>@var{lma_region}} expression, -you may specify a memory region for the section's load address. @xref{MEMORY}. +section. + +Alternatively, with @samp{AT>@var{lma_region}} expression, you may +specify a memory region for the section's load address. @xref{MEMORY}. +Note that if the section has not had a VMA assigned to it then the +linker will use the @var{lma_region} as the VMA region as well. +@xref{Output Section Region}. @cindex ROM initialized data @cindex initialized data in ROM @@ -3317,6 +3442,15 @@ for (dst = &_bstart; dst< &_bend; dst++) @end group @end smallexample +@node Forced Input Alignment +@subsubsection Forced Input Alignment +@kindex SUBALIGN(@var{subsection_align}) +@cindex forcing input section alignment +@cindex input section alignment +You can force input section alignment within an output section by using +SUBALIGN. The value specified overrides any alignment given by input +sections, whether larger or smaller. + @node Output Section Region @subsubsection Output Section Region @kindex >@var{region} @@ -4266,17 +4400,25 @@ SECTIONS @{ @dots{} @end group @end smallexample -@item ALIGN(@var{exp}) -@kindex ALIGN(@var{exp}) +@item ALIGN(@var{align}) +@itemx ALIGN(@var{exp},@var{align}) +@kindex ALIGN(@var{align}) +@kindex ALIGN(@var{exp},@var{align}) @cindex round up location counter @cindex align location counter -Return the location counter (@code{.}) aligned to the next @var{exp} -boundary. -@code{ALIGN} doesn't change the value of the location counter---it just -does arithmetic on it. Here is an example which aligns the output -@code{.data} section to the next @code{0x2000} byte boundary after the -preceding section and sets a variable within the section to the next -@code{0x8000} boundary after the input sections: +@cindex round up expression +@cindex align expression +Return the location counter (@code{.}) or arbitrary expression aligned +to the next @var{align} boundary. The single operand @code{ALIGN} +doesn't change the value of the location counter---it just does +arithmetic on it. The two operand @code{ALIGN} allows an arbitrary +expression to be aligned upwards (@code{ALIGN(@var{align})} is +equivalent to @code{ALIGN(., @var{align})}). + +Here is an example which aligns the output @code{.data} section to the +next @code{0x2000} byte boundary after the preceding section and sets a +variable within the section to the next @code{0x8000} boundary after the +input sections: @smallexample @group SECTIONS @{ @dots{} @@ -4344,7 +4486,8 @@ evaluation purposes. @kindex DEFINED(@var{symbol}) @cindex symbol defaults Return 1 if @var{symbol} is in the linker global symbol table and is -defined, otherwise return 0. You can use this function to provide +defined before the statement using DEFINED in the script, otherwise +return 0. You can use this function to provide default values for symbols. For example, the following script fragment shows how to set a global symbol @samp{begin} to the first location in the @samp{.text} section---but if a symbol called @samp{begin} already @@ -5106,7 +5249,7 @@ that are not being renamed, and do @emph{not} use the @samp{--export-all-symbols} option. If you list only the renamed symbols in the DEF file, and use @samp{--export-all-symbols} to handle the other symbols, then the both the new names @emph{and} -the original names for the the renamed symbols will be exported. +the original names for the renamed symbols will be exported. In effect, you'd be aliasing those symbols, not renaming them, which is probably not what you wanted. @end table diff --git a/gnu/usr.bin/binutils/ld/ldcref.c b/gnu/usr.bin/binutils/ld/ldcref.c index fec77b06413..3094735fa19 100644 --- a/gnu/usr.bin/binutils/ld/ldcref.c +++ b/gnu/usr.bin/binutils/ld/ldcref.c @@ -1,5 +1,6 @@ /* ldcref.c -- output a cross reference table - Copyright 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 2000, 2002, 2003 + Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@cygnus.com> This file is part of GLD, the Gnu Linker. @@ -65,18 +66,14 @@ struct cref_hash_table { struct bfd_hash_table root; }; -/* Local functions. */ +/* Forward declarations. */ -static struct bfd_hash_entry *cref_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static bfd_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 bfd_boolean check_nocrossref PARAMS ((struct cref_hash_entry *, PTR)); -static void check_section_sym_xref PARAMS ((lang_input_statement_type *)); -static void check_refs - PARAMS ((const char *, asection *, bfd *, struct lang_nocrossrefs *)); -static void check_reloc_refs PARAMS ((bfd *, asection *, PTR)); +static void output_one_cref (FILE *, struct cref_hash_entry *); +static void check_section_sym_xref (lang_input_statement_type *); +static bfd_boolean check_nocrossref (struct cref_hash_entry *, void *); +static void check_refs (const char *, asection *, bfd *, + struct lang_nocrossrefs *); +static void check_reloc_refs (bfd *, asection *, void *); /* Look up an entry in the cref hash table. */ @@ -89,7 +86,7 @@ static void check_reloc_refs PARAMS ((bfd *, asection *, PTR)); #define cref_hash_traverse(table, func, info) \ (bfd_hash_traverse \ (&(table)->root, \ - (bfd_boolean (*) PARAMS ((struct bfd_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) (struct bfd_hash_entry *, void *)) (func), \ (info))) /* The cref hash table. */ @@ -107,10 +104,9 @@ static size_t cref_symcount; /* Create an entry in a cref hash table. */ static struct bfd_hash_entry * -cref_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +cref_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { struct cref_hash_entry *ret = (struct cref_hash_entry *) entry; @@ -120,7 +116,7 @@ cref_hash_newfunc (entry, table, string) ret = ((struct cref_hash_entry *) bfd_hash_allocate (table, sizeof (struct cref_hash_entry))); if (ret == NULL) - return (struct bfd_hash_entry *) ret; + return NULL; /* Call the allocation method of the superclass. */ ret = ((struct cref_hash_entry *) @@ -132,22 +128,21 @@ cref_hash_newfunc (entry, table, string) ret->refs = NULL; /* Keep a count of the number of entries created in the hash - table. */ + table. */ ++cref_symcount; } - return (struct bfd_hash_entry *) ret; + return &ret->root; } /* Add a symbol to the cref hash table. This is called for every symbol that is seen during the link. */ void -add_cref (name, abfd, section, value) - const char *name; - bfd *abfd; - asection *section; - bfd_vma value ATTRIBUTE_UNUSED; +add_cref (const char *name, + bfd *abfd, + asection *section, + bfd_vma value ATTRIBUTE_UNUSED) { struct cref_hash_entry *h; struct cref_ref *r; @@ -169,7 +164,7 @@ add_cref (name, abfd, section, value) if (r == NULL) { - r = (struct cref_ref *) xmalloc (sizeof *r); + r = xmalloc (sizeof *r); r->next = h->refs; h->refs = r; r->abfd = abfd; @@ -191,11 +186,9 @@ add_cref (name, abfd, section, value) name. */ static bfd_boolean -cref_fill_array (h, data) - struct cref_hash_entry *h; - PTR data; +cref_fill_array (struct cref_hash_entry *h, void *data) { - struct cref_hash_entry ***pph = (struct cref_hash_entry ***) data; + struct cref_hash_entry ***pph = data; ASSERT (h->demangled == NULL); h->demangled = demangle (h->root.string); @@ -210,12 +203,10 @@ cref_fill_array (h, data) /* Sort an array of cref hash table entries by name. */ static int -cref_sort_array (a1, a2) - const PTR a1; - const PTR a2; +cref_sort_array (const void *a1, const void *a2) { - const struct cref_hash_entry **p1 = (const struct cref_hash_entry **) a1; - const struct cref_hash_entry **p2 = (const struct cref_hash_entry **) a2; + const struct cref_hash_entry * const *p1 = a1; + const struct cref_hash_entry * const *p2 = a2; return strcmp ((*p1)->demangled, (*p2)->demangled); } @@ -225,8 +216,7 @@ cref_sort_array (a1, a2) #define FILECOL (50) void -output_cref (fp) - FILE *fp; +output_cref (FILE *fp) { int len; struct cref_hash_entry **csyms, **csym_fill, **csym, **csym_end; @@ -249,8 +239,7 @@ output_cref (fp) return; } - csyms = ((struct cref_hash_entry **) - xmalloc (cref_symcount * sizeof (*csyms))); + csyms = xmalloc (cref_symcount * sizeof (*csyms)); csym_fill = csyms; cref_hash_traverse (&cref_table, cref_fill_array, &csym_fill); @@ -266,9 +255,7 @@ output_cref (fp) /* Output one entry in the cross reference table. */ static void -output_one_cref (fp, h) - FILE *fp; - struct cref_hash_entry *h; +output_one_cref (FILE *fp, struct cref_hash_entry *h) { int len; struct bfd_link_hash_entry *hl; @@ -336,12 +323,12 @@ output_one_cref (fp, h) /* Check for prohibited cross references. */ void -check_nocrossrefs () +check_nocrossrefs (void) { if (! cref_initialized) return; - cref_hash_traverse (&cref_table, check_nocrossref, (PTR) NULL); + cref_hash_traverse (&cref_table, check_nocrossref, NULL); lang_for_each_file (check_section_sym_xref); } @@ -349,8 +336,7 @@ check_nocrossrefs () /* Checks for prohibited cross references to section symbols. */ static void -check_section_sym_xref (statement) - lang_input_statement_type *statement; +check_section_sym_xref (lang_input_statement_type *statement) { bfd *abfd; asection *sec; @@ -382,9 +368,7 @@ check_section_sym_xref (statement) /* Check one symbol to see if it is a prohibited cross reference. */ static bfd_boolean -check_nocrossref (h, ignore) - struct cref_hash_entry *h; - PTR ignore ATTRIBUTE_UNUSED; +check_nocrossref (struct cref_hash_entry *h, void *ignore ATTRIBUTE_UNUSED) { struct bfd_link_hash_entry *hl; asection *defsec; @@ -436,11 +420,10 @@ struct check_refs_info { prohibited sections. */ static void -check_refs (name, sec, abfd, ncrs) - const char *name; - asection *sec; - bfd *abfd; - struct lang_nocrossrefs *ncrs; +check_refs (const char *name, + asection *sec, + bfd *abfd, + struct lang_nocrossrefs *ncrs) { lang_input_statement_type *li; asymbol **asymbols; @@ -452,7 +435,7 @@ check_refs (name, sec, abfd, ncrs) the BFD in which the symbol is defined, since even a single BFD might contain a prohibited cross reference. */ - li = (lang_input_statement_type *) abfd->usrdata; + li = abfd->usrdata; if (li != NULL && li->asymbols != NULL) asymbols = li->asymbols; else @@ -463,7 +446,7 @@ check_refs (name, sec, abfd, ncrs) symsize = bfd_get_symtab_upper_bound (abfd); if (symsize < 0) einfo (_("%B%F: could not read symbols; %E\n"), abfd); - asymbols = (asymbol **) xmalloc (symsize); + asymbols = xmalloc (symsize); symbol_count = bfd_canonicalize_symtab (abfd, asymbols); if (symbol_count < 0) einfo (_("%B%F: could not read symbols: %E\n"), abfd); @@ -478,7 +461,7 @@ check_refs (name, sec, abfd, ncrs) info.defsec = sec; info.ncrs = ncrs; info.asymbols = asymbols; - bfd_map_over_sections (abfd, check_reloc_refs, (PTR) &info); + bfd_map_over_sections (abfd, check_reloc_refs, &info); if (li == NULL) free (asymbols); @@ -491,12 +474,9 @@ check_refs (name, sec, abfd, ncrs) INFO->SYM_NAME, then we report a prohibited cross reference error. */ static void -check_reloc_refs (abfd, sec, iarg) - bfd *abfd; - asection *sec; - PTR iarg; +check_reloc_refs (bfd *abfd, asection *sec, void *iarg) { - struct check_refs_info *info = (struct check_refs_info *) iarg; + struct check_refs_info *info = iarg; asection *outsec; const char *outsecname; asection *outdefsec; @@ -538,7 +518,7 @@ check_reloc_refs (abfd, sec, iarg) if (relsize == 0) return; - relpp = (arelent **) xmalloc (relsize); + relpp = xmalloc (relsize); relcount = bfd_canonicalize_reloc (abfd, sec, relpp, info->asymbols); if (relcount < 0) einfo (_("%B%F: could not read relocs: %E\n"), abfd); @@ -557,9 +537,9 @@ check_reloc_refs (abfd, sec, iarg) && bfd_get_section (*q->sym_ptr_ptr) == info->defsec))) { /* We found a reloc for the symbol. The symbol is defined - in OUTSECNAME. This reloc is from a section which is - mapped into a section from which references to OUTSECNAME - are prohibited. We must report an error. */ + in OUTSECNAME. This reloc is from a section which is + mapped into a section from which references to OUTSECNAME + are prohibited. We must report an error. */ einfo (_("%X%C: prohibited cross reference from %s to `%T' in %s\n"), abfd, sec, q->address, outsecname, bfd_asymbol_name (*q->sym_ptr_ptr), outdefsecname); diff --git a/gnu/usr.bin/binutils/ld/ldctor.c b/gnu/usr.bin/binutils/ld/ldctor.c index a5089cfeaa1..34d5e5295a7 100644 --- a/gnu/usr.bin/binutils/ld/ldctor.c +++ b/gnu/usr.bin/binutils/ld/ldctor.c @@ -1,6 +1,6 @@ /* ldctor.c -- constructor support routines Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002 Free Software Foundation, Inc. + 2002, 2003 Free Software Foundation, Inc. By Steve Chamberlain <sac@cygnus.com> This file is part of GLD, the Gnu Linker. @@ -33,9 +33,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "ldmain.h" #include "ldctor.h" -static int ctor_prio PARAMS ((const char *)); -static int ctor_cmp PARAMS ((const PTR, const PTR)); - /* The list of statements needed to handle constructors. These are invoked by the command CONSTRUCTORS in the linker script. */ lang_statement_list_type constructor_list; @@ -56,24 +53,23 @@ struct set_info *sets; function will construct the sets. */ void -ldctor_add_set_entry (h, reloc, name, section, value) - struct bfd_link_hash_entry *h; - bfd_reloc_code_real_type reloc; - const char *name; - asection *section; - bfd_vma value; +ldctor_add_set_entry (struct bfd_link_hash_entry *h, + bfd_reloc_code_real_type reloc, + const char *name, + asection *section, + bfd_vma value) { struct set_info *p; struct set_element *e; struct set_element **epp; - for (p = sets; p != (struct set_info *) NULL; p = p->next) + for (p = sets; p != NULL; p = p->next) if (p->h == h) break; - if (p == (struct set_info *) NULL) + if (p == NULL) { - p = (struct set_info *) xmalloc (sizeof (struct set_info)); + p = xmalloc (sizeof (struct set_info)); p->next = sets; sets = p; p->h = h; @@ -109,7 +105,7 @@ ldctor_add_set_entry (h, reloc, name, section, value) } } - e = (struct set_element *) xmalloc (sizeof (struct set_element)); + e = xmalloc (sizeof (struct set_element)); e->next = NULL; e->name = name; e->section = section; @@ -126,8 +122,7 @@ ldctor_add_set_entry (h, reloc, name, section, value) symbol name. */ static int -ctor_prio (name) - const char *name; +ctor_prio (const char *name) { /* The name will look something like _GLOBAL_$I$65535$test02__Fv. There might be extra leading underscores, and the $ characters @@ -155,12 +150,10 @@ ctor_prio (name) is called via qsort. */ static int -ctor_cmp (p1, p2) - const PTR p1; - const PTR p2; +ctor_cmp (const void *p1, const void *p2) { - const struct set_element **pe1 = (const struct set_element **) p1; - const struct set_element **pe2 = (const struct set_element **) p2; + const struct set_element * const *pe1 = p1; + const struct set_element * const *pe2 = p2; const char *n1; const char *n2; int prio1; @@ -202,7 +195,7 @@ ctor_cmp (p1, p2) themselves into constructor_list. */ void -ldctor_build_sets () +ldctor_build_sets (void) { static bfd_boolean called; lang_statement_list_type *old; @@ -230,7 +223,7 @@ ldctor_build_sets () for (e = p->elements; e != NULL; e = e->next) ++c; - array = (struct set_element **) xmalloc (c * sizeof *array); + array = xmalloc (c * sizeof *array); i = 0; for (e = p->elements; e != NULL; e = e->next) @@ -257,7 +250,7 @@ ldctor_build_sets () lang_list_init (stat_ptr); header_printed = FALSE; - for (p = sets; p != (struct set_info *) NULL; p = p->next) + for (p = sets; p != NULL; p = p->next) { struct set_element *e; reloc_howto_type *howto; @@ -278,12 +271,12 @@ ldctor_build_sets () .long elementN .long 0 except that we use the right size instead of .long. When - generating relocateable output, we generate relocs instead of + generating relocatable output, we generate relocs instead of addresses. */ howto = bfd_reloc_type_lookup (output_bfd, p->reloc); - if (howto == (reloc_howto_type *) NULL) + if (howto == NULL) { - if (link_info.relocateable) + if (link_info.relocatable) { einfo (_("%P%X: %s does not support reloc %s for set %s\n"), bfd_get_target (output_bfd), @@ -292,7 +285,7 @@ ldctor_build_sets () continue; } - /* If this is not a relocateable link, all we need is the + /* If this is not a relocatable link, all we need is the size, which we can get from the input BFD. */ if (p->elements->section->owner != NULL) howto = bfd_reloc_type_lookup (p->elements->section->owner, @@ -331,9 +324,9 @@ ldctor_build_sets () exp_intop (reloc_size)))); lang_add_assignment (exp_assop ('=', p->h->root.string, exp_nameop (NAME, "."))); - lang_add_data (size, exp_intop ((bfd_vma) p->count)); + lang_add_data (size, exp_intop (p->count)); - for (e = p->elements; e != (struct set_element *) NULL; e = e->next) + for (e = p->elements; e != NULL; e = e->next) { if (config.map_file != NULL) { @@ -369,7 +362,7 @@ ldctor_build_sets () if (! bfd_is_abs_section (e->section)) e->section->flags |= SEC_KEEP; - if (link_info.relocateable) + if (link_info.relocatable) lang_add_reloc (p->reloc, howto, e->section, e->name, exp_intop (e->value)); else diff --git a/gnu/usr.bin/binutils/ld/ldctor.h b/gnu/usr.bin/binutils/ld/ldctor.h index e5e09267e40..436df6c0e3a 100644 --- a/gnu/usr.bin/binutils/ld/ldctor.h +++ b/gnu/usr.bin/binutils/ld/ldctor.h @@ -1,5 +1,5 @@ /* ldctor.h - linker constructor support - Copyright 1991, 1992, 1993, 1994, 1995, 1998, 2000, 2002 + Copyright 1991, 1992, 1993, 1994, 1995, 1998, 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -52,9 +52,9 @@ struct set_element { extern struct set_info *sets; extern void ldctor_add_set_entry - PARAMS ((struct bfd_link_hash_entry *, bfd_reloc_code_real_type, - const char *, asection *, bfd_vma)); + (struct bfd_link_hash_entry *, bfd_reloc_code_real_type, const char *, + asection *, bfd_vma); extern void ldctor_build_sets - PARAMS ((void)); + (void); #endif diff --git a/gnu/usr.bin/binutils/ld/ldemul.c b/gnu/usr.bin/binutils/ld/ldemul.c index d1891270f9e..760c55ddf6b 100644 --- a/gnu/usr.bin/binutils/ld/ldemul.c +++ b/gnu/usr.bin/binutils/ld/ldemul.c @@ -35,89 +35,84 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ld_emulation_xfer_type *ld_emulation; void -ldemul_hll (name) - char *name; +ldemul_hll (char *name) { ld_emulation->hll (name); } void -ldemul_syslib (name) - char *name; +ldemul_syslib (char *name) { ld_emulation->syslib (name); } void -ldemul_after_parse () +ldemul_after_parse (void) { ld_emulation->after_parse (); } void -ldemul_before_parse () +ldemul_before_parse (void) { ld_emulation->before_parse (); } void -ldemul_after_open () +ldemul_after_open (void) { ld_emulation->after_open (); } void -ldemul_after_allocation () +ldemul_after_allocation (void) { ld_emulation->after_allocation (); } void -ldemul_before_allocation () +ldemul_before_allocation (void) { if (ld_emulation->before_allocation) ld_emulation->before_allocation (); } void -ldemul_set_output_arch () +ldemul_set_output_arch (void) { ld_emulation->set_output_arch (); } void -ldemul_finish () +ldemul_finish (void) { if (ld_emulation->finish) ld_emulation->finish (); } void -ldemul_set_symbols () +ldemul_set_symbols (void) { if (ld_emulation->set_symbols) ld_emulation->set_symbols (); } void -ldemul_create_output_section_statements () +ldemul_create_output_section_statements (void) { if (ld_emulation->create_output_section_statements) ld_emulation->create_output_section_statements (); } char * -ldemul_get_script (isfile) - int *isfile; +ldemul_get_script (int *isfile) { return ld_emulation->get_script (isfile); } bfd_boolean -ldemul_open_dynamic_archive (arch, search, entry) - const char *arch; - search_dirs_type *search; - lang_input_statement_type *entry; +ldemul_open_dynamic_archive (const char *arch, search_dirs_type *search, + lang_input_statement_type *entry) { if (ld_emulation->open_dynamic_archive) return (*ld_emulation->open_dynamic_archive) (arch, search, entry); @@ -125,9 +120,7 @@ ldemul_open_dynamic_archive (arch, search, entry) } bfd_boolean -ldemul_place_orphan (file, s) - lang_input_statement_type *file; - asection *s; +ldemul_place_orphan (lang_input_statement_type *file, asection *s) { if (ld_emulation->place_orphan) return (*ld_emulation->place_orphan) (file, s); @@ -135,13 +128,9 @@ ldemul_place_orphan (file, s) } void -ldemul_add_options (ns, shortopts, nl, longopts, nrl, really_longopts) - int ns; - char **shortopts; - int nl; - struct option **longopts; - int nrl; - struct option **really_longopts; +ldemul_add_options (int ns, char **shortopts, int nl, + struct option **longopts, int nrl, + struct option **really_longopts) { if (ld_emulation->add_options) (*ld_emulation->add_options) (ns, shortopts, nl, longopts, @@ -149,8 +138,7 @@ ldemul_add_options (ns, shortopts, nl, longopts, nrl, really_longopts) } bfd_boolean -ldemul_handle_option (optc) - int optc; +ldemul_handle_option (int optc) { if (ld_emulation->handle_option) return (*ld_emulation->handle_option) (optc); @@ -158,9 +146,7 @@ ldemul_handle_option (optc) } bfd_boolean -ldemul_parse_args (argc, argv) - int argc; - char **argv; +ldemul_parse_args (int argc, char **argv) { /* Try and use the emulation parser if there is one. */ if (ld_emulation->parse_args) @@ -171,8 +157,7 @@ ldemul_parse_args (argc, argv) /* Let the emulation code handle an unrecognized file. */ bfd_boolean -ldemul_unrecognized_file (entry) - lang_input_statement_type *entry; +ldemul_unrecognized_file (lang_input_statement_type *entry) { if (ld_emulation->unrecognized_file) return (*ld_emulation->unrecognized_file) (entry); @@ -182,8 +167,7 @@ ldemul_unrecognized_file (entry) /* Let the emulation code handle a recognized file. */ bfd_boolean -ldemul_recognized_file (entry) - lang_input_statement_type *entry; +ldemul_recognized_file (lang_input_statement_type *entry) { if (ld_emulation->recognized_file) return (*ld_emulation->recognized_file) (entry); @@ -191,9 +175,7 @@ ldemul_recognized_file (entry) } char * -ldemul_choose_target (argc, argv) - int argc; - char **argv; +ldemul_choose_target (int argc, char **argv) { return ld_emulation->choose_target (argc, argv); } @@ -202,9 +184,7 @@ ldemul_choose_target (argc, argv) /* The default choose_target function. */ char * -ldemul_default_target (argc, argv) - int argc ATTRIBUTE_UNUSED; - char **argv ATTRIBUTE_UNUSED; +ldemul_default_target (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { char *from_outside = getenv (TARGET_ENVIRON); if (from_outside != (char *) NULL) @@ -213,27 +193,27 @@ ldemul_default_target (argc, argv) } void -after_parse_default () +after_parse_default (void) { } void -after_open_default () +after_open_default (void) { } void -after_allocation_default () +after_allocation_default (void) { } void -before_allocation_default () +before_allocation_default (void) { } void -set_output_arch_default () +set_output_arch_default (void) { /* Set the output architecture and machine if possible. */ bfd_set_arch_mach (output_bfd, @@ -241,15 +221,13 @@ set_output_arch_default () } void -syslib_default (ignore) - char *ignore ATTRIBUTE_UNUSED; +syslib_default (char *ignore ATTRIBUTE_UNUSED) { info_msg (_("%S SYSLIB ignored\n")); } void -hll_default (ignore) - char *ignore ATTRIBUTE_UNUSED; +hll_default (char *ignore ATTRIBUTE_UNUSED) { info_msg (_("%S HLL ignored\n")); } @@ -257,8 +235,7 @@ hll_default (ignore) ld_emulation_xfer_type *ld_emulations[] = { EMULATION_LIST }; void -ldemul_choose_mode (target) - char *target; +ldemul_choose_mode (char *target) { ld_emulation_xfer_type **eptr = ld_emulations; /* Ignore "gld" prefix. */ @@ -279,8 +256,7 @@ ldemul_choose_mode (target) } void -ldemul_list_emulations (f) - FILE *f; +ldemul_list_emulations (FILE *f) { ld_emulation_xfer_type **eptr = ld_emulations; bfd_boolean first = TRUE; @@ -296,8 +272,7 @@ ldemul_list_emulations (f) } void -ldemul_list_emulation_options (f) - FILE *f; +ldemul_list_emulation_options (FILE *f) { ld_emulation_xfer_type **eptr; int options_found = 0; @@ -321,9 +296,7 @@ ldemul_list_emulation_options (f) } int -ldemul_find_potential_libraries (name, entry) - char *name; - lang_input_statement_type *entry; +ldemul_find_potential_libraries (char *name, lang_input_statement_type *entry) { if (ld_emulation->find_potential_libraries) return ld_emulation->find_potential_libraries (name, entry); @@ -332,8 +305,7 @@ ldemul_find_potential_libraries (name, entry) } struct bfd_elf_version_expr * -ldemul_new_vers_pattern (entry) - struct bfd_elf_version_expr *entry; +ldemul_new_vers_pattern (struct bfd_elf_version_expr *entry) { if (ld_emulation->new_vers_pattern) entry = (*ld_emulation->new_vers_pattern) (entry); diff --git a/gnu/usr.bin/binutils/ld/ldemul.h b/gnu/usr.bin/binutils/ld/ldemul.h index b88fedfe25e..8feef6748c2 100644 --- a/gnu/usr.bin/binutils/ld/ldemul.h +++ b/gnu/usr.bin/binutils/ld/ldemul.h @@ -1,5 +1,5 @@ /* ld-emul.h - Linker emulation header file - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002 + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -18,104 +18,103 @@ #define LDEMUL_H extern void ldemul_hll - PARAMS ((char *)); + (char *); extern void ldemul_syslib - PARAMS ((char *)); + (char *); extern void ldemul_after_parse - PARAMS ((void)); + (void); extern void ldemul_before_parse - PARAMS ((void)); + (void); extern void ldemul_after_open - PARAMS ((void)); + (void); extern void ldemul_after_allocation - PARAMS ((void)); + (void); extern void ldemul_before_allocation - PARAMS ((void)); + (void); extern void ldemul_set_output_arch - PARAMS ((void)); + (void); extern char *ldemul_choose_target - PARAMS ((int, char**)); + (int, char**); extern void ldemul_choose_mode - PARAMS ((char *)); + (char *); extern void ldemul_list_emulations - PARAMS ((FILE *)); + (FILE *); extern void ldemul_list_emulation_options - PARAMS ((FILE *)); + (FILE *); extern char *ldemul_get_script - PARAMS ((int *isfile)); + (int *isfile); extern void ldemul_finish - PARAMS ((void)); + (void); extern void ldemul_set_symbols - PARAMS ((void)); + (void); extern void ldemul_create_output_section_statements - PARAMS ((void)); + (void); extern bfd_boolean ldemul_place_orphan - PARAMS ((struct lang_input_statement_struct *, asection *)); + (struct lang_input_statement_struct *, asection *); extern bfd_boolean ldemul_parse_args - PARAMS ((int, char **)); + (int, char **); extern void ldemul_add_options - PARAMS ((int, char **, int, struct option **, int, struct option **)); + (int, char **, int, struct option **, int, struct option **); extern bfd_boolean ldemul_handle_option - PARAMS ((int)); + (int); extern bfd_boolean ldemul_unrecognized_file - PARAMS ((struct lang_input_statement_struct *)); + (struct lang_input_statement_struct *); extern bfd_boolean ldemul_recognized_file - PARAMS ((struct lang_input_statement_struct *)); + (struct lang_input_statement_struct *); extern bfd_boolean ldemul_open_dynamic_archive - PARAMS ((const char *, struct search_dirs *, - struct lang_input_statement_struct *)); + (const char *, struct search_dirs *, struct lang_input_statement_struct *); extern char *ldemul_default_target - PARAMS ((int, char**)); + (int, char**); extern void after_parse_default - PARAMS ((void)); + (void); extern void after_open_default - PARAMS ((void)); + (void); extern void after_allocation_default - PARAMS ((void)); + (void); extern void before_allocation_default - PARAMS ((void)); + (void); extern void set_output_arch_default - PARAMS ((void)); + (void); extern void syslib_default - PARAMS ((char*)); + (char*); extern void hll_default - PARAMS ((char*)); + (char*); extern int ldemul_find_potential_libraries - PARAMS ((char *, struct lang_input_statement_struct *)); + (char *, struct lang_input_statement_struct *); extern struct bfd_elf_version_expr *ldemul_new_vers_pattern - PARAMS ((struct bfd_elf_version_expr *)); + (struct bfd_elf_version_expr *); typedef struct ld_emulation_xfer_struct { /* Run before parsing the command line and script file. Set the architecture, maybe other things. */ - void (*before_parse) PARAMS ((void)); + void (*before_parse) (void); /* Handle the SYSLIB (low level library) script command. */ - void (*syslib) PARAMS ((char *)); + void (*syslib) (char *); /* Handle the HLL (high level library) script command. */ - void (*hll) PARAMS ((char *)); + void (*hll) (char *); /* Run after parsing the command line and script file. */ - void (*after_parse) PARAMS ((void)); + void (*after_parse) (void); /* Run after opening all input files, and loading the symbols. */ - void (*after_open) PARAMS ((void)); + void (*after_open) (void); /* Run after allocating output sections. */ - void (*after_allocation) PARAMS ( (void)); + void (*after_allocation) (void); /* Set the output architecture and machine if possible. */ - void (*set_output_arch) PARAMS ((void)); + void (*set_output_arch) (void); /* Decide which target name to use. */ - char * (*choose_target) PARAMS ((int, char**)); + char * (*choose_target) (int, char**); /* Run before allocating output sections. */ - void (*before_allocation) PARAMS ((void)); + void (*before_allocation) (void); /* Return the appropriate linker script. */ - char * (*get_script) PARAMS ((int *isfile)); + char * (*get_script) (int *isfile); /* The name of this emulation. */ char *emulation_name; @@ -124,65 +123,65 @@ typedef struct ld_emulation_xfer_struct { char *target_name; /* Run after assigning values from the script. */ - void (*finish) PARAMS ((void)); + void (*finish) (void); /* Create any output sections needed by the target. */ - void (*create_output_section_statements) PARAMS ((void)); + void (*create_output_section_statements) (void); /* Try to open a dynamic library. ARCH is an architecture name, and is normally the empty string. ENTRY is the lang_input_statement that should be opened. */ bfd_boolean (*open_dynamic_archive) - PARAMS ((const char *arch, struct search_dirs *, - struct lang_input_statement_struct *entry)); + (const char *arch, struct search_dirs *, + struct lang_input_statement_struct *entry); /* Place an orphan section. Return TRUE if it was placed, FALSE if the default action should be taken. This field may be NULL, in which case the default action will always be taken. */ bfd_boolean (*place_orphan) - PARAMS ((struct lang_input_statement_struct *, asection *)); + (struct lang_input_statement_struct *, asection *); /* Run after assigning parsing with the args, but before reading the script. Used to initialize symbols used in the script. */ - void (*set_symbols) PARAMS ((void)); + void (*set_symbols) (void); /* Parse args which the base linker doesn't understand. Return TRUE if the arg needs no further processing. */ - bfd_boolean (*parse_args) PARAMS ((int, char **)); + bfd_boolean (*parse_args) (int, char **); /* Hook to add options to parameters passed by the base linker to getopt_long and getopt_long_only calls. */ void (*add_options) - PARAMS ((int, char **, int, struct option **, int, struct option **)); + (int, char **, int, struct option **, int, struct option **); /* Companion to the above to handle an option. Returns TRUE if it is one of our options. */ - bfd_boolean (*handle_option) PARAMS ((int)); + bfd_boolean (*handle_option) (int); /* Run to handle files which are not recognized as object files or archives. Return TRUE if the file was handled. */ bfd_boolean (*unrecognized_file) - PARAMS ((struct lang_input_statement_struct *)); + (struct lang_input_statement_struct *); /* Run to list the command line options which parse_args handles. */ - void (* list_options) PARAMS ((FILE *)); + void (* list_options) (FILE *); /* Run to specially handle files which *are* recognized as object files or archives. Return TRUE if the file was handled. */ bfd_boolean (*recognized_file) - PARAMS ((struct lang_input_statement_struct *)); + (struct lang_input_statement_struct *); /* Called when looking for libraries in a directory specified via a linker command line option or linker script option. Files that match the pattern "lib*.a" have already been scanned. (For VMS files matching ":lib*.a" have also been scanned). */ int (* find_potential_libraries) - PARAMS ((char *, struct lang_input_statement_struct *)); + (char *, struct lang_input_statement_struct *); /* Called when adding a new version pattern. PowerPC64-ELF uses this hook to add a pattern matching ".foo" for every "foo". */ struct bfd_elf_version_expr * (*new_vers_pattern) - PARAMS ((struct bfd_elf_version_expr *)); + (struct bfd_elf_version_expr *); } ld_emulation_xfer_type; diff --git a/gnu/usr.bin/binutils/ld/ldexp.c b/gnu/usr.bin/binutils/ld/ldexp.c index 9227dd63f26..4d9a8575fb7 100644 --- a/gnu/usr.bin/binutils/ld/ldexp.c +++ b/gnu/usr.bin/binutils/ld/ldexp.c @@ -1,6 +1,6 @@ /* This module handles expression trees. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 + 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>. @@ -41,43 +41,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "libiberty.h" #include "safe-ctype.h" -static void exp_print_token - PARAMS ((token_code_type code, int infix_p)); -static void make_abs - PARAMS ((etree_value_type *ptr)); -static etree_value_type new_abs - PARAMS ((bfd_vma value)); -static void check - PARAMS ((lang_output_section_statement_type *os, const char *name, - const char *op)); -static etree_value_type new_rel - PARAMS ((bfd_vma, char *, lang_output_section_statement_type *section)); -static etree_value_type new_rel_from_section - PARAMS ((bfd_vma value, lang_output_section_statement_type *section)); -static etree_value_type fold_unary - PARAMS ((etree_type *tree, - lang_output_section_statement_type *current_section, - lang_phase_type allocation_done, - bfd_vma dot, bfd_vma *dotp)); -static etree_value_type fold_binary - PARAMS ((etree_type *tree, - lang_output_section_statement_type *current_section, - lang_phase_type allocation_done, - bfd_vma dot, bfd_vma *dotp)); -static etree_value_type fold_trinary - PARAMS ((etree_type *tree, - lang_output_section_statement_type *current_section, - lang_phase_type allocation_done, - bfd_vma dot, bfd_vma *dotp)); -static etree_value_type fold_name - PARAMS ((etree_type *tree, - lang_output_section_statement_type *current_section, - lang_phase_type allocation_done, - bfd_vma dot)); static etree_value_type exp_fold_tree_no_dot - PARAMS ((etree_type *tree, - lang_output_section_statement_type *current_section, - lang_phase_type allocation_done)); + (etree_type *, lang_output_section_statement_type *, lang_phase_type); +static bfd_vma align_n + (bfd_vma, bfd_vma); struct exp_data_seg exp_data_seg; @@ -85,9 +52,7 @@ struct exp_data_seg exp_data_seg; with spaces if INFIX_P is TRUE. */ static void -exp_print_token (code, infix_p) - token_code_type code; - int infix_p; +exp_print_token (token_code_type code, int infix_p) { static const struct { @@ -134,7 +99,7 @@ exp_print_token (code, infix_p) { ADDR, "ADDR" }, { LOADADDR, "LOADADDR" }, { MAX_K, "MAX_K" }, - { REL, "relocateable" }, + { REL, "relocatable" }, { DATA_SEGMENT_ALIGN, "DATA_SEGMENT_ALIGN" }, { DATA_SEGMENT_END, "DATA_SEGMENT_END" } }; @@ -159,8 +124,7 @@ exp_print_token (code, infix_p) } static void -make_abs (ptr) - etree_value_type *ptr; +make_abs (etree_value_type *ptr) { asection *s = ptr->section->bfd_section; ptr->value += s->vma; @@ -168,8 +132,7 @@ make_abs (ptr) } static etree_value_type -new_abs (value) - bfd_vma value; +new_abs (bfd_vma value) { etree_value_type new; new.valid_p = TRUE; @@ -178,23 +141,10 @@ new_abs (value) return new; } -static void -check (os, name, op) - lang_output_section_statement_type *os; - const char *name; - const char *op; -{ - if (os == NULL) - einfo (_("%F%P: %s uses undefined section %s\n"), op, name); - if (! os->processed) - einfo (_("%F%P: %s forward reference of section %s\n"), op, name); -} - etree_type * -exp_intop (value) - bfd_vma value; +exp_intop (bfd_vma value) { - etree_type *new = (etree_type *) stat_alloc (sizeof (new->value)); + etree_type *new = stat_alloc (sizeof (new->value)); new->type.node_code = INT; new->value.value = value; new->value.str = NULL; @@ -203,11 +153,9 @@ exp_intop (value) } etree_type * -exp_bigintop (value, str) - bfd_vma value; - char *str; +exp_bigintop (bfd_vma value, char *str) { - etree_type *new = (etree_type *) stat_alloc (sizeof (new->value)); + etree_type *new = stat_alloc (sizeof (new->value)); new->type.node_code = INT; new->value.value = value; new->value.str = str; @@ -215,14 +163,12 @@ exp_bigintop (value, str) return new; } -/* Build an expression representing an unnamed relocateable value. */ +/* Build an expression representing an unnamed relocatable value. */ etree_type * -exp_relop (section, value) - asection *section; - bfd_vma value; +exp_relop (asection *section, bfd_vma value) { - etree_type *new = (etree_type *) stat_alloc (sizeof (new->rel)); + etree_type *new = stat_alloc (sizeof (new->rel)); new->type.node_code = REL; new->type.node_class = etree_rel; new->rel.section = section; @@ -231,10 +177,9 @@ exp_relop (section, value) } static etree_value_type -new_rel (value, str, section) - bfd_vma value; - char *str; - lang_output_section_statement_type *section; +new_rel (bfd_vma value, + char *str, + lang_output_section_statement_type *section) { etree_value_type new; new.valid_p = TRUE; @@ -245,9 +190,8 @@ new_rel (value, str, section) } static etree_value_type -new_rel_from_section (value, section) - bfd_vma value; - lang_output_section_statement_type *section; +new_rel_from_section (bfd_vma value, + lang_output_section_statement_type *section) { etree_value_type new; new.valid_p = TRUE; @@ -261,12 +205,11 @@ new_rel_from_section (value, section) } static etree_value_type -fold_unary (tree, current_section, allocation_done, dot, dotp) - etree_type *tree; - lang_output_section_statement_type *current_section; - lang_phase_type allocation_done; - bfd_vma dot; - bfd_vma *dotp; +fold_unary (etree_type *tree, + lang_output_section_statement_type *current_section, + lang_phase_type allocation_done, + bfd_vma dot, + bfd_vma *dotp) { etree_value_type result; @@ -348,12 +291,11 @@ fold_unary (tree, current_section, allocation_done, dot, dotp) } static etree_value_type -fold_binary (tree, current_section, allocation_done, dot, dotp) - etree_type *tree; - lang_output_section_statement_type *current_section; - lang_phase_type allocation_done; - bfd_vma dot; - bfd_vma *dotp; +fold_binary (etree_type *tree, + lang_output_section_statement_type *current_section, + lang_phase_type allocation_done, + bfd_vma dot, + bfd_vma *dotp) { etree_value_type result; @@ -441,6 +383,10 @@ fold_binary (tree, current_section, allocation_done, dot, dotp) result = other; break; + case ALIGN_K: + result.value = align_n (result.value, other.value); + break; + case DATA_SEGMENT_ALIGN: if (allocation_done != lang_first_phase_enum && current_section == abs_output_section @@ -483,12 +429,11 @@ fold_binary (tree, current_section, allocation_done, dot, dotp) } static etree_value_type -fold_trinary (tree, current_section, allocation_done, dot, dotp) - etree_type *tree; - lang_output_section_statement_type *current_section; - lang_phase_type allocation_done; - bfd_vma dot; - bfd_vma *dotp; +fold_trinary (etree_type *tree, + lang_output_section_statement_type *current_section, + lang_phase_type allocation_done, + bfd_vma dot, + bfd_vma *dotp) { etree_value_type result; @@ -504,63 +449,50 @@ fold_trinary (tree, current_section, allocation_done, dot, dotp) return result; } -etree_value_type -invalid () -{ - etree_value_type new; - new.valid_p = FALSE; - return new; -} - static etree_value_type -fold_name (tree, current_section, allocation_done, dot) - etree_type *tree; - lang_output_section_statement_type *current_section; - lang_phase_type allocation_done; - bfd_vma dot; +fold_name (etree_type *tree, + lang_output_section_statement_type *current_section, + lang_phase_type allocation_done, + bfd_vma dot) { etree_value_type result; + result.valid_p = FALSE; + switch (tree->type.node_code) { case SIZEOF_HEADERS: if (allocation_done != lang_first_phase_enum) - { - result = new_abs ((bfd_vma) - bfd_sizeof_headers (output_bfd, - link_info.relocateable)); - } - else - { - result.valid_p = FALSE; - } + result = new_abs (bfd_sizeof_headers (output_bfd, + link_info.relocatable)); break; case DEFINED: if (allocation_done == lang_first_phase_enum) - result.valid_p = FALSE; + lang_track_definedness (tree->name.name); else { struct bfd_link_hash_entry *h; + int def_iteration + = lang_symbol_definition_iteration (tree->name.name); h = bfd_wrapped_link_hash_lookup (output_bfd, &link_info, tree->name.name, FALSE, FALSE, TRUE); - result.value = (h != (struct bfd_link_hash_entry *) NULL + result.value = (h != NULL && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak - || h->type == bfd_link_hash_common)); - result.section = 0; + || h->type == bfd_link_hash_common) + && (def_iteration == lang_statement_iteration + || def_iteration == -1)); + result.section = abs_output_section; result.valid_p = TRUE; } break; case NAME: - result.valid_p = FALSE; if (tree->name.name[0] == '.' && tree->name.name[1] == 0) { if (allocation_done != lang_first_phase_enum) result = new_rel_from_section (dot, current_section); - else - result = invalid (); } else if (allocation_done != lang_first_phase_enum) { @@ -568,10 +500,11 @@ fold_name (tree, current_section, allocation_done, dot) h = bfd_wrapped_link_hash_lookup (output_bfd, &link_info, tree->name.name, - FALSE, FALSE, TRUE); - if (h != NULL - && (h->type == bfd_link_hash_defined - || h->type == bfd_link_hash_defweak)) + TRUE, FALSE, TRUE); + if (!h) + einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n")); + else if (h->type == bfd_link_hash_defined + || h->type == bfd_link_hash_defweak) { if (bfd_is_abs_section (h->u.def.section)) result = new_abs (h->u.def.value); @@ -604,6 +537,12 @@ fold_name (tree, current_section, allocation_done, dot) else if (allocation_done == lang_final_phase_enum) einfo (_("%F%S: undefined symbol `%s' referenced in expression\n"), tree->name.name); + else if (h->type == bfd_link_hash_new) + { + h->type = bfd_link_hash_undefined; + h->u.undef.abfd = NULL; + bfd_link_add_undef (link_info.hash, h); + } } break; @@ -613,11 +552,9 @@ fold_name (tree, current_section, allocation_done, dot) lang_output_section_statement_type *os; os = lang_output_section_find (tree->name.name); - check (os, tree->name.name, "ADDR"); - result = new_rel (0, NULL, os); + if (os && os->processed > 0) + result = new_rel (0, NULL, os); } - else - result = invalid (); break; case LOADADDR: @@ -626,16 +563,16 @@ fold_name (tree, current_section, allocation_done, dot) lang_output_section_statement_type *os; os = lang_output_section_find (tree->name.name); - check (os, tree->name.name, "LOADADDR"); - if (os->load_base == NULL) - result = new_rel (0, NULL, os); - else - result = exp_fold_tree_no_dot (os->load_base, - abs_output_section, - allocation_done); + if (os && os->processed != 0) + { + if (os->load_base == NULL) + result = new_rel (0, NULL, os); + else + result = exp_fold_tree_no_dot (os->load_base, + abs_output_section, + allocation_done); + } } - else - result = invalid (); break; case SIZEOF: @@ -645,11 +582,9 @@ fold_name (tree, current_section, allocation_done, dot) lang_output_section_statement_type *os; os = lang_output_section_find (tree->name.name); - check (os, tree->name.name, "SIZEOF"); - result = new_abs (os->bfd_section->_raw_size / opb); + if (os && os->processed > 0) + result = new_abs (os->bfd_section->_raw_size / opb); } - else - result = invalid (); break; default: @@ -661,12 +596,11 @@ fold_name (tree, current_section, allocation_done, dot) } etree_value_type -exp_fold_tree (tree, current_section, allocation_done, dot, dotp) - etree_type *tree; - lang_output_section_statement_type *current_section; - lang_phase_type allocation_done; - bfd_vma dot; - bfd_vma *dotp; +exp_fold_tree (etree_type *tree, + lang_output_section_statement_type *current_section, + lang_phase_type allocation_done, + bfd_vma dot, + bfd_vma *dotp) { etree_value_type result; @@ -773,14 +707,15 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp) else create = FALSE; h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst, - create, FALSE, FALSE); - if (h == (struct bfd_link_hash_entry *) NULL) + create, FALSE, TRUE); + if (h == NULL) { - if (tree->type.node_class == etree_assign) + if (create) einfo (_("%P%F:%s: hash creation failed\n"), tree->assign.dst); } else if (tree->type.node_class == etree_provide + && h->type != bfd_link_hash_new && h->type != bfd_link_hash_undefined && h->type != bfd_link_hash_common) { @@ -791,6 +726,7 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp) { /* FIXME: Should we worry if the symbol is already defined? */ + lang_update_definedness (tree->assign.dst, h); h->type = bfd_link_hash_defined; h->u.def.value = result.value; h->u.def.section = result.section->bfd_section; @@ -814,20 +750,15 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp) } static etree_value_type -exp_fold_tree_no_dot (tree, current_section, allocation_done) - etree_type *tree; - lang_output_section_statement_type *current_section; - lang_phase_type allocation_done; +exp_fold_tree_no_dot (etree_type *tree, + lang_output_section_statement_type *current_section, + lang_phase_type allocation_done) { - return exp_fold_tree (tree, current_section, allocation_done, - (bfd_vma) 0, (bfd_vma *) NULL); + return exp_fold_tree (tree, current_section, allocation_done, 0, NULL); } etree_type * -exp_binop (code, lhs, rhs) - int code; - etree_type *lhs; - etree_type *rhs; +exp_binop (int code, etree_type *lhs, etree_type *rhs) { etree_type value, *new; etree_value_type r; @@ -843,17 +774,13 @@ exp_binop (code, lhs, rhs) { return exp_intop (r.value); } - new = (etree_type *) stat_alloc (sizeof (new->binary)); - memcpy ((char *) new, (char *) &value, sizeof (new->binary)); + new = stat_alloc (sizeof (new->binary)); + memcpy (new, &value, sizeof (new->binary)); return new; } etree_type * -exp_trinop (code, cond, lhs, rhs) - int code; - etree_type *cond; - etree_type *lhs; - etree_type *rhs; +exp_trinop (int code, etree_type *cond, etree_type *lhs, etree_type *rhs) { etree_type value, *new; etree_value_type r; @@ -862,21 +789,17 @@ exp_trinop (code, cond, lhs, rhs) value.trinary.cond = cond; value.trinary.rhs = rhs; value.type.node_class = etree_trinary; - r = exp_fold_tree_no_dot (&value, - (lang_output_section_statement_type *) NULL, - lang_first_phase_enum); + r = exp_fold_tree_no_dot (&value, NULL, lang_first_phase_enum); if (r.valid_p) return exp_intop (r.value); - new = (etree_type *) stat_alloc (sizeof (new->trinary)); - memcpy ((char *) new, (char *) &value, sizeof (new->trinary)); + new = stat_alloc (sizeof (new->trinary)); + memcpy (new, &value, sizeof (new->trinary)); return new; } etree_type * -exp_unop (code, child) - int code; - etree_type *child; +exp_unop (int code, etree_type *child) { etree_type value, *new; @@ -889,15 +812,13 @@ exp_unop (code, child) if (r.valid_p) return exp_intop (r.value); - new = (etree_type *) stat_alloc (sizeof (new->unary)); - memcpy ((char *) new, (char *) &value, sizeof (new->unary)); + new = stat_alloc (sizeof (new->unary)); + memcpy (new, &value, sizeof (new->unary)); return new; } etree_type * -exp_nameop (code, name) - int code; - const char *name; +exp_nameop (int code, const char *name) { etree_type value, *new; etree_value_type r; @@ -905,23 +826,18 @@ exp_nameop (code, name) value.name.name = name; value.name.type.node_class = etree_name; - r = exp_fold_tree_no_dot (&value, - (lang_output_section_statement_type *) NULL, - lang_first_phase_enum); + r = exp_fold_tree_no_dot (&value, NULL, lang_first_phase_enum); if (r.valid_p) return exp_intop (r.value); - new = (etree_type *) stat_alloc (sizeof (new->name)); - memcpy ((char *) new, (char *) &value, sizeof (new->name)); + new = stat_alloc (sizeof (new->name)); + memcpy (new, &value, sizeof (new->name)); return new; } etree_type * -exp_assop (code, dst, src) - int code; - const char *dst; - etree_type *src; +exp_assop (int code, const char *dst, etree_type *src) { etree_type value, *new; @@ -935,21 +851,19 @@ exp_assop (code, dst, src) if (exp_fold_tree_no_dot (&value, &result)) return exp_intop (result); #endif - new = (etree_type *) stat_alloc (sizeof (new->assign)); - memcpy ((char *) new, (char *) &value, sizeof (new->assign)); + new = stat_alloc (sizeof (new->assign)); + memcpy (new, &value, sizeof (new->assign)); return new; } /* Handle PROVIDE. */ etree_type * -exp_provide (dst, src) - const char *dst; - etree_type *src; +exp_provide (const char *dst, etree_type *src) { etree_type *n; - n = (etree_type *) stat_alloc (sizeof (n->assign)); + n = stat_alloc (sizeof (n->assign)); n->assign.type.node_code = '='; n->assign.type.node_class = etree_provide; n->assign.src = src; @@ -960,13 +874,11 @@ exp_provide (dst, src) /* Handle ASSERT. */ etree_type * -exp_assert (exp, message) - etree_type *exp; - const char *message; +exp_assert (etree_type *exp, const char *message) { etree_type *n; - n = (etree_type *) stat_alloc (sizeof (n->assert_s)); + n = stat_alloc (sizeof (n->assert_s)); n->assert_s.type.node_code = '!'; n->assert_s.type.node_class = etree_assert; n->assert_s.child = exp; @@ -975,8 +887,7 @@ exp_assert (exp, message) } void -exp_print_tree (tree) - etree_type *tree; +exp_print_tree (etree_type *tree) { if (config.map_file == NULL) config.map_file = stderr; @@ -999,7 +910,7 @@ exp_print_tree (tree) return; case etree_assign: #if 0 - if (tree->assign.dst->sdefs != (asymbol *) NULL) + if (tree->assign.dst->sdefs != NULL) fprintf (config.map_file, "%s (%x) ", tree->assign.dst->name, tree->assign.dst->sdefs->value); else @@ -1067,11 +978,10 @@ exp_print_tree (tree) } bfd_vma -exp_get_vma (tree, def, name, allocation_done) - etree_type *tree; - bfd_vma def; - char *name; - lang_phase_type allocation_done; +exp_get_vma (etree_type *tree, + bfd_vma def, + char *name, + lang_phase_type allocation_done) { etree_value_type r; @@ -1087,21 +997,19 @@ exp_get_vma (tree, def, name, allocation_done) } int -exp_get_value_int (tree, def, name, allocation_done) - etree_type *tree; - int def; - char *name; - lang_phase_type allocation_done; +exp_get_value_int (etree_type *tree, + int def, + char *name, + lang_phase_type allocation_done) { - return (int) exp_get_vma (tree, (bfd_vma) def, name, allocation_done); + return exp_get_vma (tree, def, name, allocation_done); } fill_type * -exp_get_fill (tree, def, name, allocation_done) - etree_type *tree; - fill_type *def; - char *name; - lang_phase_type allocation_done; +exp_get_fill (etree_type *tree, + fill_type *def, + char *name, + lang_phase_type allocation_done) { fill_type *fill; etree_value_type r; @@ -1119,7 +1027,7 @@ exp_get_fill (tree, def, name, allocation_done) { unsigned char *dst; unsigned char *s; - fill = (fill_type *) xmalloc ((len + 1) / 2 + sizeof (*fill) - 1); + fill = xmalloc ((len + 1) / 2 + sizeof (*fill) - 1); fill->size = (len + 1) / 2; dst = fill->data; s = r.str; @@ -1144,7 +1052,7 @@ exp_get_fill (tree, def, name, allocation_done) } else { - fill = (fill_type *) xmalloc (4 + sizeof (*fill) - 1); + fill = xmalloc (4 + sizeof (*fill) - 1); val = r.value; fill->data[0] = (val >> 24) & 0xff; fill->data[1] = (val >> 16) & 0xff; @@ -1156,11 +1064,10 @@ exp_get_fill (tree, def, name, allocation_done) } bfd_vma -exp_get_abs_int (tree, def, name, allocation_done) - etree_type *tree; - int def ATTRIBUTE_UNUSED; - char *name; - lang_phase_type allocation_done; +exp_get_abs_int (etree_type *tree, + int def ATTRIBUTE_UNUSED, + char *name, + lang_phase_type allocation_done) { etree_value_type res; res = exp_fold_tree_no_dot (tree, abs_output_section, allocation_done); @@ -1173,9 +1080,8 @@ exp_get_abs_int (tree, def, name, allocation_done) return res.value; } -bfd_vma align_n (value, align) - bfd_vma value; - bfd_vma align; +static bfd_vma +align_n (bfd_vma value, bfd_vma align) { if (align <= 1) return value; diff --git a/gnu/usr.bin/binutils/ld/ldexp.h b/gnu/usr.bin/binutils/ld/ldexp.h index df814df4df0..99e7073b2c4 100644 --- a/gnu/usr.bin/binutils/ld/ldexp.h +++ b/gnu/usr.bin/binutils/ld/ldexp.h @@ -1,6 +1,6 @@ /* ldexp.h - - Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, + 2003, 2004 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -104,41 +104,39 @@ extern struct exp_data_seg { typedef struct _fill_type fill_type; etree_type *exp_intop - PARAMS ((bfd_vma)); + (bfd_vma); etree_type *exp_bigintop - PARAMS ((bfd_vma, char *)); + (bfd_vma, char *); etree_type *exp_relop - PARAMS ((asection *, bfd_vma)); + (asection *, bfd_vma); etree_value_type invalid - PARAMS ((void)); + (void); etree_value_type exp_fold_tree - PARAMS ((etree_type *, struct lang_output_section_statement_struct *, - lang_phase_type, bfd_vma, bfd_vma *)); + (etree_type *, struct lang_output_section_statement_struct *, + lang_phase_type, bfd_vma, bfd_vma *); etree_type *exp_binop - PARAMS ((int, etree_type *, etree_type *)); + (int, etree_type *, etree_type *); etree_type *exp_trinop - PARAMS ((int,etree_type *, etree_type *, etree_type *)); + (int,etree_type *, etree_type *, etree_type *); etree_type *exp_unop - PARAMS ((int, etree_type *)); + (int, etree_type *); etree_type *exp_nameop - PARAMS ((int, const char *)); + (int, const char *); etree_type *exp_assop - PARAMS ((int, const char *, etree_type *)); + (int, const char *, etree_type *); etree_type *exp_provide - PARAMS ((const char *, etree_type *)); + (const char *, etree_type *); etree_type *exp_assert - PARAMS ((etree_type *, const char *)); + (etree_type *, const char *); void exp_print_tree - PARAMS ((etree_type *)); + (etree_type *); bfd_vma exp_get_vma - PARAMS ((etree_type *, bfd_vma, char *, lang_phase_type)); + (etree_type *, bfd_vma, char *, lang_phase_type); int exp_get_value_int - PARAMS ((etree_type *, int, char *, lang_phase_type)); + (etree_type *, int, char *, lang_phase_type); fill_type *exp_get_fill - PARAMS ((etree_type *, fill_type *, char *, lang_phase_type)); + (etree_type *, fill_type *, char *, lang_phase_type); bfd_vma exp_get_abs_int - PARAMS ((etree_type *, int, char *, lang_phase_type)); -bfd_vma align_n - PARAMS ((bfd_vma, bfd_vma)); + (etree_type *, int, char *, lang_phase_type); #endif diff --git a/gnu/usr.bin/binutils/ld/ldfile.c b/gnu/usr.bin/binutils/ld/ldfile.c index 4806534a74a..a6f0d603dde 100644 --- a/gnu/usr.bin/binutils/ld/ldfile.c +++ b/gnu/usr.bin/binutils/ld/ldfile.c @@ -1,6 +1,6 @@ /* Linker file opening and searching. - Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003 - Free Software Foundation, Inc. + Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, + 2003, 2004 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -69,18 +69,11 @@ static search_dirs_type **search_tail_ptr = &search_head; static search_arch_type *search_arch_head; static search_arch_type **search_arch_tail_ptr = &search_arch_head; -static FILE *try_open - PARAMS ((const char *, const char *)); -static bfd_boolean is_sysrooted_pathname - PARAMS ((const char *, bfd_boolean)); - /* Test whether a pathname, after canonicalization, is the same or a sub-directory of the sysroot directory. */ static bfd_boolean -is_sysrooted_pathname (name, notsame) - const char *name; - bfd_boolean notsame; +is_sysrooted_pathname (const char *name, bfd_boolean notsame) { char * realname = ld_canon_sysroot ? lrealpath (name) : NULL; int len; @@ -88,7 +81,7 @@ is_sysrooted_pathname (name, notsame) if (! realname) return FALSE; - + len = strlen (realname); if (((! notsame && len == ld_canon_sysroot_len) @@ -110,16 +103,14 @@ is_sysrooted_pathname (name, notsame) Makes a copy of NAME using xmalloc(). */ void -ldfile_add_library_path (name, cmdline) - const char *name; - bfd_boolean cmdline; +ldfile_add_library_path (const char *name, bfd_boolean cmdline) { search_dirs_type *new; if (!cmdline && config.only_cmd_line_lib_dirs) return; - new = (search_dirs_type *) xmalloc (sizeof (search_dirs_type)); + new = xmalloc (sizeof (search_dirs_type)); new->next = NULL; new->cmdline = cmdline; *search_tail_ptr = new; @@ -142,9 +133,8 @@ ldfile_add_library_path (name, cmdline) /* Try to open a BFD for a lang_input_statement. */ bfd_boolean -ldfile_try_open_bfd (attempt, entry) - const char *attempt; - lang_input_statement_type *entry; +ldfile_try_open_bfd (const char *attempt, + lang_input_statement_type *entry) { entry->the_bfd = bfd_openr (attempt, entry->target); @@ -256,7 +246,7 @@ ldfile_try_open_bfd (attempt, entry) if (yylval.bigint.str) free (yylval.bigint.str); break; - } + } token = yylex (); } ldlex_popstate (); @@ -298,11 +288,10 @@ ldfile_try_open_bfd (attempt, entry) archive, use ARCH, LIB and SUFFIX to modify the file name. */ bfd_boolean -ldfile_open_file_search (arch, entry, lib, suffix) - const char *arch; - lang_input_statement_type *entry; - const char *lib; - const char *suffix; +ldfile_open_file_search (const char *arch, + lang_input_statement_type *entry, + const char *lib, + const char *suffix) { search_dirs_type *search; @@ -332,13 +321,11 @@ ldfile_open_file_search (arch, entry, lib, suffix) return FALSE; } - for (search = search_head; - search != (search_dirs_type *) NULL; - search = search->next) + for (search = search_head; search != NULL; search = search->next) { char *string; - if (entry->dynamic && ! link_info.relocateable) + if (entry->dynamic && ! link_info.relocatable) { if (ldemul_open_dynamic_archive (arch, search, entry)) { @@ -347,13 +334,13 @@ ldfile_open_file_search (arch, entry, lib, suffix) } } - string = (char *) xmalloc (strlen (search->name) - + strlen (slash) - + strlen (lib) - + strlen (entry->filename) - + strlen (arch) - + strlen (suffix) - + 1); + string = xmalloc (strlen (search->name) + + strlen (slash) + + strlen (lib) + + strlen (entry->filename) + + strlen (arch) + + strlen (suffix) + + 1); if (entry->is_archive) sprintf (string, "%s%s%s%s%s%s", search->name, slash, @@ -377,8 +364,7 @@ ldfile_open_file_search (arch, entry, lib, suffix) /* Open the input file specified by ENTRY. */ void -ldfile_open_file (entry) - lang_input_statement_type *entry; +ldfile_open_file (lang_input_statement_type *entry) { if (entry->the_bfd != NULL) return; @@ -388,10 +374,10 @@ ldfile_open_file (entry) if (ldfile_try_open_bfd (entry->filename, entry)) return; if (strcmp (entry->filename, entry->local_sym_name) != 0) - einfo (_("%F%P: cannot open %s for %s: %E\n"), + einfo (_("%F%P: %s (%s): No such file: %E\n"), entry->filename, entry->local_sym_name); else - einfo (_("%F%P: cannot open %s: %E\n"), entry->local_sym_name); + einfo (_("%F%P: %s: No such file: %E\n"), entry->local_sym_name); } else { @@ -399,9 +385,7 @@ ldfile_open_file (entry) bfd_boolean found = FALSE; /* Try to open <filename><suffix> or lib<filename><suffix>.a */ - for (arch = search_arch_head; - arch != (search_arch_type *) NULL; - arch = arch->next) + for (arch = search_arch_head; arch != NULL; arch = arch->next) { found = ldfile_open_file_search (arch->name, entry, "lib", ".a"); if (found) @@ -433,9 +417,7 @@ ldfile_open_file (entry) /* Try to open NAME; if that fails, try NAME with EXTEN appended to it. */ static FILE * -try_open (name, exten) - const char *name; - const char *exten; +try_open (const char *name, const char *exten) { FILE *result; char buff[1000]; @@ -474,9 +456,7 @@ try_open (name, exten) specified with -L, without and with EXTEND appended. */ FILE * -ldfile_find_command_file (name, extend) - const char *name; - const char *extend; +ldfile_find_command_file (const char *name, const char *extend) { search_dirs_type *search; FILE *result; @@ -484,12 +464,10 @@ ldfile_find_command_file (name, extend) /* First try raw name. */ result = try_open (name, ""); - if (result == (FILE *) NULL) + if (result == NULL) { /* Try now prefixes. */ - for (search = search_head; - search != (search_dirs_type *) NULL; - search = search->next) + for (search = search_head; search != NULL; search = search->next) { sprintf (buffer, "%s%s%s", search->name, slash, name); @@ -503,13 +481,12 @@ ldfile_find_command_file (name, extend) } void -ldfile_open_command_file (name) - const char *name; +ldfile_open_command_file (const char *name) { FILE *ldlex_input_stack; ldlex_input_stack = ldfile_find_command_file (name, ""); - if (ldlex_input_stack == (FILE *) NULL) + if (ldlex_input_stack == NULL) { bfd_set_error (bfd_error_system_call); einfo (_("%P%F: cannot open linker script file %s: %E\n"), name); @@ -525,8 +502,7 @@ ldfile_open_command_file (name) #ifdef GNU960 static char * -gnu960_map_archname (name) - char *name; +gnu960_map_archname (char *name) { struct tabentry { char *cmd_switch; char *arch; }; static struct tabentry arch_tab[] = @@ -556,11 +532,9 @@ gnu960_map_archname (name) } void -ldfile_add_arch (name) - char *name; +ldfile_add_arch (char *name) { - search_arch_type *new = - (search_arch_type *) xmalloc ((bfd_size_type) (sizeof (search_arch_type))); + search_arch_type *new = xmalloc (sizeof (search_arch_type)); if (*name != '\0') { @@ -573,7 +547,7 @@ ldfile_add_arch (name) ldfile_output_machine_name = name; } - new->next = (search_arch_type *) NULL; + new->next = NULL; new->name = gnu960_map_archname (name); *search_arch_tail_ptr = new; search_arch_tail_ptr = &new->next; @@ -582,17 +556,15 @@ ldfile_add_arch (name) #else /* not GNU960 */ void -ldfile_add_arch (in_name) - const char *in_name; +ldfile_add_arch (const char *in_name) { char *name = xstrdup (in_name); - search_arch_type *new = - (search_arch_type *) xmalloc (sizeof (search_arch_type)); + search_arch_type *new = xmalloc (sizeof (search_arch_type)); ldfile_output_machine_name = in_name; new->name = name; - new->next = (search_arch_type *) NULL; + new->next = NULL; while (*name) { *name = TOLOWER (*name); @@ -607,8 +579,7 @@ ldfile_add_arch (in_name) /* Set the output architecture. */ void -ldfile_set_output_arch (string) - const char *string; +ldfile_set_output_arch (const char *string, enum bfd_architecture defarch) { const bfd_arch_info_type *arch = bfd_scan_arch (string); @@ -618,8 +589,8 @@ ldfile_set_output_arch (string) ldfile_output_machine = arch->mach; ldfile_output_machine_name = arch->printable_name; } + else if (defarch != bfd_arch_unknown) + ldfile_output_architecture = defarch; else - { - einfo (_("%P%F: cannot represent machine `%s'\n"), string); - } + einfo (_("%P%F: cannot represent machine `%s'\n"), string); } diff --git a/gnu/usr.bin/binutils/ld/ldfile.h b/gnu/usr.bin/binutils/ld/ldfile.h index 0bfea7caba1..6d5f09d1183 100644 --- a/gnu/usr.bin/binutils/ld/ldfile.h +++ b/gnu/usr.bin/binutils/ld/ldfile.h @@ -1,5 +1,5 @@ /* ldfile.h - - Copyright 1991, 1992, 1993, 1994, 1995, 2000, 2002, 2003 + Copyright 1991, 1992, 1993, 1994, 1995, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -16,7 +16,8 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #ifndef LDFILE_H #define LDFILE_H @@ -44,21 +45,21 @@ typedef struct search_dirs { extern search_dirs_type *search_head; extern void ldfile_add_arch - PARAMS ((const char *)); + (const char *); extern void ldfile_add_library_path - PARAMS ((const char *, bfd_boolean cmdline)); + (const char *, bfd_boolean cmdline); extern void ldfile_open_command_file - PARAMS ((const char *name)); + (const char *name); extern void ldfile_open_file - PARAMS ((struct lang_input_statement_struct *)); + (struct lang_input_statement_struct *); extern bfd_boolean ldfile_try_open_bfd - PARAMS ((const char *, struct lang_input_statement_struct *)); + (const char *, struct lang_input_statement_struct *); extern FILE *ldfile_find_command_file - PARAMS ((const char *name, const char *extend)); + (const char *name, const char *extend); extern void ldfile_set_output_arch - PARAMS ((const char *)); + (const char *, enum bfd_architecture); extern bfd_boolean ldfile_open_file_search - PARAMS ((const char *arch, struct lang_input_statement_struct *, - const char *lib, const char *suffix)); + (const char *arch, struct lang_input_statement_struct *, + const char *lib, const char *suffix); #endif diff --git a/gnu/usr.bin/binutils/ld/ldgram.y b/gnu/usr.bin/binutils/ld/ldgram.y index e9c8a9fe490..6c46c854473 100644 --- a/gnu/usr.bin/binutils/ld/ldgram.y +++ b/gnu/usr.bin/binutils/ld/ldgram.y @@ -1,6 +1,6 @@ /* A YACC grammar to parse a superset of the AT&T linker scripting language. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 Free Software Foundation, Inc. + 2001, 2002, 2003 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com). This file is part of GNU ld. @@ -94,7 +94,7 @@ static int error_index; } %type <etree> exp opt_exp_with_type mustbe_exp opt_at phdr_type phdr_val -%type <etree> opt_exp_without_type +%type <etree> opt_exp_without_type opt_subalign %type <fill> fill_opt fill_exp %type <name_list> exclude_name_list %type <wildcard_list> file_NAME_list @@ -142,7 +142,7 @@ static int error_index; %token STARTUP HLL SYSLIB FLOAT NOFLOAT NOCROSSREFS %token ORIGIN FILL %token LENGTH CREATE_OBJECT_SYMBOLS INPUT GROUP OUTPUT CONSTRUCTORS -%token ALIGNMOD AT PROVIDE +%token ALIGNMOD AT SUBALIGN PROVIDE %type <token> assign_op atype attributes_opt %type <name> filename %token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD ASSERT_K @@ -328,7 +328,7 @@ ifile_p1: | OUTPUT_FORMAT '(' NAME ',' NAME ',' NAME ')' { lang_add_output_format ($3, $5, $7, 1); } | OUTPUT_ARCH '(' NAME ')' - { ldfile_set_output_arch($3); } + { ldfile_set_output_arch ($3, bfd_arch_unknown); } | FORCE_COMMON_ALLOCATION { command_line.force_common_definition = TRUE ; } | INHIBIT_COMMON_ALLOCATION @@ -386,6 +386,9 @@ statement_anywhere: ENTRY '(' NAME ')' { lang_add_entry ($3, FALSE); } | assignment end + | ASSERT_K {ldlex_expression ();} '(' exp ',' NAME ')' + { ldlex_popstate (); + lang_add_assignment (exp_assert ($4, $6)); } ; /* The '*' and '?' cases are there because the lexer returns them as @@ -627,7 +630,7 @@ memory_spec_list: memory_spec: NAME - { region = lang_memory_region_lookup($1); } + { region = lang_memory_region_lookup ($1, TRUE); } attributes_opt ':' origin_spec opt_comma length_spec {} @@ -801,6 +804,8 @@ exp : { $$ = exp_unop(ABSOLUTE, $3); } | ALIGN_K '(' exp ')' { $$ = exp_unop(ALIGN_K,$3); } + | ALIGN_K '(' exp ',' exp ')' + { $$ = exp_binop(ALIGN_K,$3,$5); } | DATA_SEGMENT_ALIGN '(' exp ',' exp ')' { $$ = exp_binop (DATA_SEGMENT_ALIGN, $3, $5); } | DATA_SEGMENT_END '(' exp ')' @@ -828,31 +833,37 @@ opt_at: | { $$ = 0; } ; +opt_subalign: + SUBALIGN '(' exp ')' { $$ = $3; } + | { $$ = 0; } + ; + section: NAME { ldlex_expression(); } opt_exp_with_type - opt_at { ldlex_popstate (); ldlex_script (); } + opt_at + opt_subalign { ldlex_popstate (); ldlex_script (); } '{' { lang_enter_output_section_statement($1, $3, sectype, - 0, 0, 0, $4); + 0, $5, $4); } statement_list_opt '}' { ldlex_popstate (); ldlex_expression (); } memspec_opt memspec_at_opt phdr_opt fill_opt { ldlex_popstate (); - lang_leave_output_section_statement ($14, $11, $13, $12); + lang_leave_output_section_statement ($15, $12, $14, $13); } opt_comma {} | OVERLAY { ldlex_expression (); } - opt_exp_without_type opt_nocrossrefs opt_at + opt_exp_without_type opt_nocrossrefs opt_at opt_subalign { ldlex_popstate (); ldlex_script (); } '{' { - lang_enter_overlay ($3); + lang_enter_overlay ($3, $6); } overlay_section '}' @@ -861,7 +872,7 @@ section: NAME { ldlex_expression(); } { ldlex_popstate (); lang_leave_overlay ($5, (int) $4, - $15, $12, $14, $13); + $16, $13, $15, $14); } opt_comma | /* The GROUP case is just enough to support the gcc @@ -918,7 +929,7 @@ opt_nocrossrefs: memspec_opt: '>' NAME { $$ = $2; } - | { $$ = "*default*"; } + | { $$ = DEFAULT_MEMORY_REGION; } ; phdr_opt: @@ -1006,6 +1017,8 @@ phdr_type: { if (strcmp (s, "PT_GNU_EH_FRAME") == 0) $$ = exp_intop (0x6474e550); + else if (strcmp (s, "PT_GNU_STACK") == 0) + $$ = exp_intop (0x6474e551); else { einfo (_("\ diff --git a/gnu/usr.bin/binutils/ld/ldint.texinfo b/gnu/usr.bin/binutils/ld/ldint.texinfo index 489750ac7f6..54867648a52 100644 --- a/gnu/usr.bin/binutils/ld/ldint.texinfo +++ b/gnu/usr.bin/binutils/ld/ldint.texinfo @@ -1,6 +1,6 @@ \input texinfo @setfilename ldint.info -@c Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +@c Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003 @c Free Software Foundation, Inc. @ifinfo @@ -334,7 +334,7 @@ be run when doing a final relocation, they should be enclosed within a variable substitution based on @code{RELOCATING}. For example, on many targets special symbols such as @code{_end} should be defined when doing a final link. Naturally, those symbols should not be defined when doing -a relocateable link using @code{-r}. The @file{scripttempl} script +a relocatable link using @code{-r}. The @file{scripttempl} script could use a construct like this to define those symbols: @smallexample $@{RELOCATING+ _end = .;@} diff --git a/gnu/usr.bin/binutils/ld/ldlang.c b/gnu/usr.bin/binutils/ld/ldlang.c index 884691702c9..0c086014e2a 100644 --- a/gnu/usr.bin/binutils/ld/ldlang.c +++ b/gnu/usr.bin/binutils/ld/ldlang.c @@ -1,6 +1,6 @@ /* Linker command language support. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003 + 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -39,6 +39,7 @@ #include "ldemul.h" #include "fnmatch.h" #include "demangle.h" +#include "hashtab.h" #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) & (((TYPE*) 0)->MEMBER)) @@ -60,171 +61,28 @@ static const char *current_target; static const char *output_target; static lang_statement_list_type statement_list; static struct lang_phdr *lang_phdr_list; +static struct bfd_hash_table lang_definedness_table; /* Forward declarations. */ -static lang_statement_union_type *new_statement - PARAMS ((enum statement_enum, size_t, lang_statement_list_type *)); -static void lang_for_each_statement_worker - PARAMS ((void (*) (lang_statement_union_type *), - lang_statement_union_type *)); -static lang_input_statement_type *new_afile - PARAMS ((const char *, lang_input_file_enum_type, const char *, - bfd_boolean)); -static lang_memory_region_type *lang_memory_default - PARAMS ((asection *)); -static void lang_map_flags - PARAMS ((flagword)); -static void init_os - PARAMS ((lang_output_section_statement_type *)); -static void exp_init_os - PARAMS ((etree_type *)); -static void section_already_linked - PARAMS ((bfd *, asection *, PTR)); -static struct bfd_hash_entry *already_linked_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static void already_linked_table_init - PARAMS ((void)); -static void already_linked_table_free - PARAMS ((void)); -static bfd_boolean wildcardp - PARAMS ((const char *)); -static lang_statement_union_type *wild_sort - PARAMS ((lang_wild_statement_type *, struct wildcard_list *, - lang_input_statement_type *, asection *)); -static void output_section_callback - PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *, - lang_input_statement_type *, PTR)); -static lang_input_statement_type *lookup_name - PARAMS ((const char *)); -static bfd_boolean load_symbols - PARAMS ((lang_input_statement_type *, lang_statement_list_type *)); -static void wild - PARAMS ((lang_wild_statement_type *, - const char *, lang_output_section_statement_type *)); -static bfd *open_output - PARAMS ((const char *)); -static void ldlang_open_output - PARAMS ((lang_statement_union_type *)); -static void open_input_bfds - PARAMS ((lang_statement_union_type *, bfd_boolean)); -static void lang_reasonable_defaults - PARAMS ((void)); -static void insert_undefined - PARAMS ((const char *)); -static void lang_place_undefineds - PARAMS ((void)); -static void map_input_to_output_sections - PARAMS ((lang_statement_union_type *, const char *, - lang_output_section_statement_type *)); -static void strip_excluded_output_sections - PARAMS ((void)); -static void print_output_section_statement - PARAMS ((lang_output_section_statement_type *)); -static void print_assignment - PARAMS ((lang_assignment_statement_type *, - lang_output_section_statement_type *)); -static void print_input_statement - PARAMS ((lang_input_statement_type *)); -static bfd_boolean print_one_symbol - PARAMS ((struct bfd_link_hash_entry *, PTR)); -static void print_input_section - PARAMS ((lang_input_section_type *)); -static void print_fill_statement - PARAMS ((lang_fill_statement_type *)); -static void print_data_statement - PARAMS ((lang_data_statement_type *)); -static void print_address_statement - PARAMS ((lang_address_statement_type *)); -static void print_reloc_statement - PARAMS ((lang_reloc_statement_type *)); -static void print_padding_statement - PARAMS ((lang_padding_statement_type *)); -static void print_wild_statement - PARAMS ((lang_wild_statement_type *, lang_output_section_statement_type *)); -static void print_group - PARAMS ((lang_group_statement_type *, lang_output_section_statement_type *)); -static void print_statement - PARAMS ((lang_statement_union_type *, lang_output_section_statement_type *)); -static void print_statement_list - PARAMS ((lang_statement_union_type *, lang_output_section_statement_type *)); -static void print_statements - PARAMS ((void)); -static void insert_pad - PARAMS ((lang_statement_union_type **, fill_type *, - unsigned int, asection *, bfd_vma)); -static bfd_vma size_input_section - PARAMS ((lang_statement_union_type **, lang_output_section_statement_type *, - fill_type *, bfd_vma)); -static void lang_finish - PARAMS ((void)); -static void ignore_bfd_errors - PARAMS ((const char *, ...)); -static void lang_check - PARAMS ((void)); -static void lang_common - PARAMS ((void)); -static bfd_boolean lang_one_common - PARAMS ((struct bfd_link_hash_entry *, PTR)); -static void lang_place_orphans - PARAMS ((void)); -static int topower - PARAMS ((int)); -static void lang_set_startof - PARAMS ((void)); -static void gc_section_callback - PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *, - lang_input_statement_type *, PTR)); -static void lang_get_regions - PARAMS ((struct memory_region_struct **, struct memory_region_struct **, - const char *, const char *, int)); -static void lang_record_phdrs - PARAMS ((void)); -static void lang_gc_wild - PARAMS ((lang_wild_statement_type *)); -static void lang_gc_sections_1 - PARAMS ((lang_statement_union_type *)); -static void lang_gc_sections - PARAMS ((void)); -static int lang_vers_match_lang_c - PARAMS ((struct bfd_elf_version_expr *, const char *)); -static int lang_vers_match_lang_cplusplus - PARAMS ((struct bfd_elf_version_expr *, const char *)); -static int lang_vers_match_lang_java - PARAMS ((struct bfd_elf_version_expr *, const char *)); -static void lang_do_version_exports_section - PARAMS ((void)); -static void lang_check_section_addresses - PARAMS ((void)); -static void os_region_check - PARAMS ((lang_output_section_statement_type *, - struct memory_region_struct *, etree_type *, bfd_vma)); -static bfd_vma lang_size_sections_1 - PARAMS ((lang_statement_union_type *, lang_output_section_statement_type *, - lang_statement_union_type **, fill_type *, bfd_vma, bfd_boolean *, - bfd_boolean)); -typedef void (*callback_t) - PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *, - lang_input_statement_type *, PTR)); -static void walk_wild - PARAMS ((lang_wild_statement_type *, callback_t, PTR)); -static void walk_wild_section - PARAMS ((lang_wild_statement_type *, lang_input_statement_type *, - callback_t, PTR)); -static void walk_wild_file - PARAMS ((lang_wild_statement_type *, lang_input_statement_type *, - callback_t, PTR)); -static int get_target - PARAMS ((const bfd_target *, PTR)); -static void stricpy - PARAMS ((char *, char *)); -static void strcut - PARAMS ((char *, char *)); -static int name_compare - PARAMS ((char *, char *)); -static int closest_target_match - PARAMS ((const bfd_target *, PTR)); -static char * get_first_input_target - PARAMS ((void)); +static void exp_init_os (etree_type *); +static bfd_boolean wildcardp (const char *); +static lang_input_statement_type *lookup_name (const char *); +static bfd_boolean load_symbols (lang_input_statement_type *, + lang_statement_list_type *); +static struct bfd_hash_entry *lang_definedness_newfunc + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); +static void insert_undefined (const char *); +static void print_statement (lang_statement_union_type *, + lang_output_section_statement_type *); +static void print_statement_list (lang_statement_union_type *, + lang_output_section_statement_type *); +static void print_statements (void); +static bfd_boolean lang_one_common (struct bfd_link_hash_entry *, void *); +static void lang_record_phdrs (void); +static void lang_do_version_exports_section (void); + +typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *, + asection *, lang_input_statement_type *, void *); /* Exported variables. */ lang_output_section_statement_type *abs_output_section; @@ -241,19 +99,12 @@ bfd_boolean delete_output_file_on_failure = FALSE; struct lang_nocrossrefs *nocrossref_list; struct unique_sections *unique_section_list; static bfd_boolean ldlang_sysrooted_script = FALSE; +int lang_statement_iteration = 0; etree_type *base; /* Relocation base - or null */ -#if defined (__STDC__) || defined (ALMOST_STDC) -#define cat(a,b) a##b -#else -#define cat(a,b) a/**/b -#endif - -/* Don't beautify the line below with "innocent" whitespace, it breaks - the K&R C preprocessor! */ #define new_stat(x, y) \ - (cat (x,_type)*) new_statement (cat (x,_enum), sizeof (cat (x,_type)), y) + (x##_type *) new_statement (x##_enum, sizeof (x##_type), y) #define outside_section_address(q) \ ((q)->output_offset + (q)->output_section->vma) @@ -263,16 +114,14 @@ etree_type *base; /* Relocation base - or null */ #define SECTION_NAME_MAP_LENGTH (16) -PTR -stat_alloc (size) - size_t size; +void * +stat_alloc (size_t size) { return obstack_alloc (&stat_obstack, size); } bfd_boolean -unique_section_p (secnam) - const char *secnam; +unique_section_p (const char *secnam) { struct unique_sections *unam; @@ -290,11 +139,10 @@ unique_section_p (secnam) /* Generic traversal routines for finding matching sections. */ static void -walk_wild_section (ptr, file, callback, data) - lang_wild_statement_type *ptr; - lang_input_statement_type *file; - callback_t callback; - PTR data; +walk_wild_section (lang_wild_statement_type *ptr, + lang_input_statement_type *file, + callback_t callback, + void *data) { asection *s; @@ -365,11 +213,10 @@ walk_wild_section (ptr, file, callback, data) /* Handle a wild statement for a single file F. */ static void -walk_wild_file (s, f, callback, data) - lang_wild_statement_type *s; - lang_input_statement_type *f; - callback_t callback; - PTR data; +walk_wild_file (lang_wild_statement_type *s, + lang_input_statement_type *f, + callback_t callback, + void *data) { if (f->the_bfd == NULL || ! bfd_check_format (f->the_bfd, bfd_archive)) @@ -380,7 +227,7 @@ walk_wild_file (s, f, callback, data) /* This is an archive file. We must map each member of the archive separately. */ - member = bfd_openr_next_archived_file (f->the_bfd, (bfd *) NULL); + member = bfd_openr_next_archived_file (f->the_bfd, NULL); while (member != NULL) { /* When lookup_name is called, it will call the add_symbols @@ -390,9 +237,7 @@ walk_wild_file (s, f, callback, data) lang_input_statement. */ if (member->usrdata != NULL) { - walk_wild_section (s, - (lang_input_statement_type *) member->usrdata, - callback, data); + walk_wild_section (s, member->usrdata, callback, data); } member = bfd_openr_next_archived_file (f->the_bfd, member); @@ -401,10 +246,7 @@ walk_wild_file (s, f, callback, data) } static void -walk_wild (s, callback, data) - lang_wild_statement_type *s; - callback_t callback; - PTR data; +walk_wild (lang_wild_statement_type *s, callback_t callback, void *data) { const char *file_spec = s->filename; @@ -439,11 +281,10 @@ walk_wild (s, callback, data) function for each node. */ static void -lang_for_each_statement_worker (func, s) - void (*func) PARAMS ((lang_statement_union_type *)); - lang_statement_union_type *s; +lang_for_each_statement_worker (void (*func) (lang_statement_union_type *), + lang_statement_union_type *s) { - for (; s != (lang_statement_union_type *) NULL; s = s->header.next) + for (; s != NULL; s = s->header.next) { func (s); @@ -486,8 +327,7 @@ lang_for_each_statement_worker (func, s) } void -lang_for_each_statement (func) - void (*func) PARAMS ((lang_statement_union_type *)); +lang_for_each_statement (void (*func) (lang_statement_union_type *)) { lang_for_each_statement_worker (func, statement_list.head); } @@ -495,26 +335,24 @@ lang_for_each_statement (func) /*----------------------------------------------------------------------*/ void -lang_list_init (list) - lang_statement_list_type *list; +lang_list_init (lang_statement_list_type *list) { - list->head = (lang_statement_union_type *) NULL; + list->head = NULL; list->tail = &list->head; } /* Build a new statement node for the parse tree. */ static lang_statement_union_type * -new_statement (type, size, list) - enum statement_enum type; - size_t size; - lang_statement_list_type *list; +new_statement (enum statement_enum type, + size_t size, + lang_statement_list_type *list) { - lang_statement_union_type *new = (lang_statement_union_type *) - stat_alloc (size); + lang_statement_union_type *new; + new = stat_alloc (size); new->header.type = type; - new->header.next = (lang_statement_union_type *) NULL; + new->header.next = NULL; lang_statement_append (list, new, &new->header.next); return new; } @@ -529,11 +367,10 @@ new_statement (type, size, list) got it already so we don't duplicate the bfd. */ static lang_input_statement_type * -new_afile (name, file_type, target, add_to_list) - const char *name; - lang_input_file_enum_type file_type; - const char *target; - bfd_boolean add_to_list; +new_afile (const char *name, + lang_input_file_enum_type file_type, + const char *target, + bfd_boolean add_to_list) { lang_input_statement_type *p; @@ -541,8 +378,7 @@ new_afile (name, file_type, target, add_to_list) p = new_stat (lang_input_statement, stat_ptr); else { - p = ((lang_input_statement_type *) - stat_alloc (sizeof (lang_input_statement_type))); + p = stat_alloc (sizeof (lang_input_statement_type)); p->header.next = NULL; } @@ -571,7 +407,7 @@ new_afile (name, file_type, target, add_to_list) p->is_archive = TRUE; p->filename = name; p->real = TRUE; - p->local_sym_name = concat ("-l", name, (const char *) NULL); + p->local_sym_name = concat ("-l", name, NULL); p->just_syms_flag = FALSE; p->search_dirs_flag = TRUE; break; @@ -603,12 +439,13 @@ new_afile (name, file_type, target, add_to_list) default: FAIL (); } - p->the_bfd = (bfd *) NULL; - p->asymbols = (asymbol **) NULL; - p->next_real_file = (lang_statement_union_type *) NULL; - p->next = (lang_statement_union_type *) NULL; + p->the_bfd = NULL; + p->asymbols = NULL; + p->next_real_file = NULL; + p->next = NULL; p->symbol_count = 0; p->dynamic = config.dynamic_link; + p->as_needed = as_needed; p->whole_archive = whole_archive; p->loaded = FALSE; lang_statement_append (&input_file_chain, @@ -618,10 +455,9 @@ new_afile (name, file_type, target, add_to_list) } lang_input_statement_type * -lang_add_input_file (name, file_type, target) - const char *name; - lang_input_file_enum_type file_type; - const char *target; +lang_add_input_file (const char *name, + lang_input_file_enum_type file_type, + const char *target) { lang_has_input_file = TRUE; return new_afile (name, file_type, target, TRUE); @@ -630,7 +466,7 @@ lang_add_input_file (name, file_type, target) /* Build enough state so that the parser can build its tree. */ void -lang_init () +lang_init (void) { obstack_begin (&stat_obstack, 1000); @@ -641,14 +477,25 @@ lang_init () lang_list_init (&input_file_chain); lang_list_init (&lang_output_section_statement); lang_list_init (&file_chain); - first_file = lang_add_input_file ((char *) NULL, - lang_input_file_is_marker_enum, - (char *) NULL); + first_file = lang_add_input_file (NULL, lang_input_file_is_marker_enum, + NULL); abs_output_section = lang_output_section_statement_lookup (BFD_ABS_SECTION_NAME); abs_output_section->bfd_section = bfd_abs_section_ptr; + /* The value "3" is ad-hoc, somewhat related to the expected number of + DEFINED expressions in a linker script. For most default linker + scripts, there are none. Why a hash table then? Well, it's somewhat + simpler to re-use working machinery than using a linked list in terms + of code-complexity here in ld, besides the initialization which just + looks like other code here. */ + if (bfd_hash_table_init_n (&lang_definedness_table, + lang_definedness_newfunc, 3) != TRUE) + einfo (_("%P%F: out of memory during initialization")); + + /* Callers of exp_fold_tree need to increment this. */ + lang_statement_iteration = 0; } /*---------------------------------------------------------------------- @@ -659,30 +506,34 @@ lang_init () We maintain a list of all the regions here. If no regions are specified in the script, then the default is used - which is created when looked up to be the entire data space. */ + which is created when looked up to be the entire data space. + + If create is true we are creating a region inside a MEMORY block. + In this case it is probably an error to create a region that has + already been created. If we are not inside a MEMORY block it is + dubious to use an undeclared region name (except DEFAULT_MEMORY_REGION) + and so we issue a warning. */ static lang_memory_region_type *lang_memory_region_list; static lang_memory_region_type **lang_memory_region_list_tail = &lang_memory_region_list; lang_memory_region_type * -lang_memory_region_lookup (name) - const char *const name; +lang_memory_region_lookup (const char *const name, bfd_boolean create) { lang_memory_region_type *p; + lang_memory_region_type *new; /* NAME is NULL for LMA memspecs if no region was specified. */ if (name == NULL) return NULL; - for (p = lang_memory_region_list; - p != (lang_memory_region_type *) NULL; - p = p->next) - { - if (strcmp (p->name, name) == 0) - { - return p; - } - } + for (p = lang_memory_region_list; p != NULL; p = p->next) + if (strcmp (p->name, name) == 0) + { + if (create) + einfo (_("%P:%S: warning: redeclaration of memory region '%s'\n"), name); + return p; + } #if 0 /* This code used to always use the first region in the list as the @@ -691,38 +542,35 @@ lang_memory_region_lookup (name) NOLOAD sections to work reasonably without requiring a region. People should specify what region they mean, if they really want a region. */ - if (strcmp (name, "*default*") == 0) + if (strcmp (name, DEFAULT_MEMORY_REGION) == 0) { - if (lang_memory_region_list != (lang_memory_region_type *) NULL) - { - return lang_memory_region_list; - } + if (lang_memory_region_list != NULL) + return lang_memory_region_list; } #endif - { - lang_memory_region_type *new = - (lang_memory_region_type *) stat_alloc (sizeof (lang_memory_region_type)); + if (!create && strcmp (name, DEFAULT_MEMORY_REGION)) + einfo (_("%P:%S: warning: memory region %s not declared\n"), name); - new->name = xstrdup (name); - new->next = (lang_memory_region_type *) NULL; + new = stat_alloc (sizeof (lang_memory_region_type)); - *lang_memory_region_list_tail = new; - lang_memory_region_list_tail = &new->next; - new->origin = 0; - new->flags = 0; - new->not_flags = 0; - new->length = ~(bfd_size_type) 0; - new->current = 0; - new->had_full_message = FALSE; + new->name = xstrdup (name); + new->next = NULL; + + *lang_memory_region_list_tail = new; + lang_memory_region_list_tail = &new->next; + new->origin = 0; + new->flags = 0; + new->not_flags = 0; + new->length = ~(bfd_size_type) 0; + new->current = 0; + new->had_full_message = FALSE; - return new; - } + return new; } static lang_memory_region_type * -lang_memory_default (section) - asection *section; +lang_memory_default (asection *section) { lang_memory_region_type *p; @@ -732,9 +580,7 @@ lang_memory_default (section) if ((sec_flags & (SEC_ALLOC | SEC_READONLY | SEC_CODE)) == SEC_ALLOC) sec_flags |= SEC_DATA; - for (p = lang_memory_region_list; - p != (lang_memory_region_type *) NULL; - p = p->next) + for (p = lang_memory_region_list; p != NULL; p = p->next) { if ((p->flags & sec_flags) != 0 && (p->not_flags & sec_flags) == 0) @@ -742,59 +588,51 @@ lang_memory_default (section) return p; } } - return lang_memory_region_lookup ("*default*"); + return lang_memory_region_lookup (DEFAULT_MEMORY_REGION, FALSE); } lang_output_section_statement_type * -lang_output_section_find (name) - const char *const name; +lang_output_section_find (const char *const name) { lang_statement_union_type *u; lang_output_section_statement_type *lookup; - for (u = lang_output_section_statement.head; - u != (lang_statement_union_type *) NULL; - u = lookup->next) + for (u = lang_output_section_statement.head; u != NULL; u = lookup->next) { lookup = &u->output_section_statement; if (strcmp (name, lookup->name) == 0) - { - return lookup; - } + return lookup; } - return (lang_output_section_statement_type *) NULL; + return NULL; } lang_output_section_statement_type * -lang_output_section_statement_lookup (name) - const char *const name; +lang_output_section_statement_lookup (const char *const name) { lang_output_section_statement_type *lookup; lookup = lang_output_section_find (name); - if (lookup == (lang_output_section_statement_type *) NULL) + if (lookup == NULL) { - - lookup = (lang_output_section_statement_type *) - new_stat (lang_output_section_statement, stat_ptr); - lookup->region = (lang_memory_region_type *) NULL; - lookup->lma_region = (lang_memory_region_type *) NULL; - lookup->fill = (fill_type *) 0; + lookup = new_stat (lang_output_section_statement, stat_ptr); + lookup->region = NULL; + lookup->lma_region = NULL; + lookup->fill = 0; lookup->block_value = 1; lookup->name = name; - lookup->next = (lang_statement_union_type *) NULL; - lookup->bfd_section = (asection *) NULL; - lookup->processed = FALSE; + lookup->next = NULL; + lookup->bfd_section = NULL; + lookup->processed = 0; lookup->sectype = normal_section; - lookup->addr_tree = (etree_type *) NULL; + lookup->addr_tree = NULL; lang_list_init (&lookup->children); - lookup->memspec = (const char *) NULL; + lookup->memspec = NULL; lookup->flags = 0; lookup->subsection_alignment = -1; lookup->section_alignment = -1; - lookup->load_base = (union etree_union *) NULL; + lookup->load_base = NULL; lookup->update_dot_tree = NULL; lookup->phdrs = NULL; @@ -806,8 +644,7 @@ lang_output_section_statement_lookup (name) } static void -lang_map_flags (flag) - flagword flag; +lang_map_flags (flagword flag) { if (flag & SEC_ALLOC) minfo ("a"); @@ -826,7 +663,7 @@ lang_map_flags (flag) } void -lang_map () +lang_map (void) { lang_memory_region_type *m; @@ -834,9 +671,7 @@ lang_map () fprintf (config.map_file, "%-16s %-18s %-18s %s\n", _("Name"), _("Origin"), _("Length"), _("Attributes")); - for (m = lang_memory_region_list; - m != (lang_memory_region_type *) NULL; - m = m->next) + for (m = lang_memory_region_list; m != NULL; m = m->next) { char buf[100]; int len; @@ -882,8 +717,7 @@ lang_map () /* Initialize an output section. */ static void -init_os (s) - lang_output_section_statement_type *s; +init_os (lang_output_section_statement_type *s) { section_userdata_type *new; @@ -893,13 +727,12 @@ init_os (s) if (strcmp (s->name, DISCARD_SECTION_NAME) == 0) einfo (_("%P%F: Illegal use of `%s' section\n"), DISCARD_SECTION_NAME); - new = ((section_userdata_type *) - stat_alloc (sizeof (section_userdata_type))); + new = stat_alloc (sizeof (section_userdata_type)); s->bfd_section = bfd_get_section_by_name (output_bfd, s->name); - if (s->bfd_section == (asection *) NULL) + if (s->bfd_section == NULL) s->bfd_section = bfd_make_section (output_bfd, s->name); - if (s->bfd_section == (asection *) NULL) + if (s->bfd_section == NULL) { einfo (_("%P%F: output format %s cannot represent section called %s\n"), output_bfd->xvec->name, s->name); @@ -909,7 +742,7 @@ init_os (s) /* We initialize an output sections output offset to minus its own vma to allow us to output a section through itself. */ s->bfd_section->output_offset = 0; - get_userdata (s->bfd_section) = (PTR) new; + get_userdata (s->bfd_section) = new; /* If there is a base address, make sure that any sections it might mention are initialized. */ @@ -924,8 +757,7 @@ init_os (s) initialized. */ static void -exp_init_os (exp) - etree_type *exp; +exp_init_os (etree_type *exp) { switch (exp->type.node_class) { @@ -944,6 +776,10 @@ exp_init_os (exp) exp_init_os (exp->trinary.rhs); break; + case etree_assert: + exp_init_os (exp->assert_s.child); + break; + case etree_unary: exp_init_os (exp->unary.child); break; @@ -1000,12 +836,9 @@ struct already_linked static struct bfd_hash_table already_linked_table; static void -section_already_linked (abfd, sec, data) - bfd *abfd; - asection *sec; - PTR data; +section_already_linked (bfd *abfd, asection *sec, void *data) { - lang_input_statement_type *entry = (lang_input_statement_type *) data; + lang_input_statement_type *entry = data; flagword flags; const char *name; struct already_linked *l; @@ -1089,8 +922,11 @@ section_already_linked (abfd, sec, data) /* Set the output_section field so that lang_add_section does not create a lang_input_section structure for this - section. */ + section. Since there might be a symbol in the section + being discarded, we must retain a pointer to the section + which we are really going to use. */ sec->output_section = bfd_abs_section_ptr; + sec->kept_section = l->sec; if (flags & SEC_GROUP) bfd_discard_group (abfd, sec); @@ -1102,8 +938,7 @@ section_already_linked (abfd, sec, data) /* This is the first section with this name. Record it. Allocate the memory from the same obstack as the hash table is kept in. */ - l = ((struct already_linked *) - bfd_hash_allocate (&already_linked_table, sizeof *l)); + l = bfd_hash_allocate (&already_linked_table, sizeof *l); l->sec = sec; l->next = already_linked_list->entry; @@ -1114,21 +949,20 @@ section_already_linked (abfd, sec, data) initialize the table, fill in an entry and remove the table. */ static struct bfd_hash_entry * -already_linked_newfunc (entry, table, string) - struct bfd_hash_entry *entry ATTRIBUTE_UNUSED; - struct bfd_hash_table *table; - const char *string ATTRIBUTE_UNUSED; +already_linked_newfunc (struct bfd_hash_entry *entry ATTRIBUTE_UNUSED, + struct bfd_hash_table *table, + const char *string ATTRIBUTE_UNUSED) { struct already_linked_hash_entry *ret = bfd_hash_allocate (table, sizeof (struct already_linked_hash_entry)); ret->entry = NULL; - return (struct bfd_hash_entry *) ret; + return &ret->root; } static void -already_linked_table_init () +already_linked_table_init (void) { if (! bfd_hash_table_init_n (&already_linked_table, already_linked_newfunc, @@ -1137,7 +971,7 @@ already_linked_table_init () } static void -already_linked_table_free () +already_linked_table_free (void) { bfd_hash_table_free (&already_linked_table); } @@ -1155,8 +989,7 @@ already_linked_table_free () That lets us handle DOS filenames more naturally. */ static bfd_boolean -wildcardp (pattern) - const char *pattern; +wildcardp (const char *pattern) { const char *s; @@ -1173,11 +1006,10 @@ wildcardp (pattern) input file which holds SECTION. */ void -lang_add_section (ptr, section, output, file) - lang_statement_list_type *ptr; - asection *section; - lang_output_section_statement_type *output; - lang_input_statement_type *file; +lang_add_section (lang_statement_list_type *ptr, + asection *section, + lang_output_section_statement_type *output, + lang_input_statement_type *file) { flagword flags; bfd_boolean discard; @@ -1190,7 +1022,7 @@ lang_add_section (ptr, section, output, file) link. Discard debugging sections marked with SEC_EXCLUDE on a relocatable link too. */ if ((flags & SEC_EXCLUDE) != 0 - && ((flags & SEC_DEBUGGING) != 0 || !link_info.relocateable)) + && ((flags & SEC_DEBUGGING) != 0 || !link_info.relocatable)) discard = TRUE; /* Discard input sections which are assigned to a section named @@ -1249,7 +1081,7 @@ lang_add_section (ptr, section, output, file) format targets, .text$foo sections go into .text and it's odd to see .text with SEC_LINK_ONCE set. */ - if (! link_info.relocateable) + if (! link_info.relocatable) flags &= ~ (SEC_LINK_ONCE | SEC_LINK_DUPLICATES); /* If this is not the first input section, and the SEC_READONLY @@ -1270,10 +1102,6 @@ lang_add_section (ptr, section, output, file) flags &= ~ (SEC_MERGE | SEC_STRINGS); } - /* For now make .tbss normal section. */ - if ((flags & SEC_THREAD_LOCAL) && ! link_info.relocateable) - flags |= SEC_LOAD; - section->output_section->flags |= flags; if (flags & SEC_MERGE) @@ -1326,11 +1154,10 @@ lang_add_section (ptr, section, output, file) new section should just go at the end of the current list. */ static lang_statement_union_type * -wild_sort (wild, sec, file, section) - lang_wild_statement_type *wild; - struct wildcard_list *sec; - lang_input_statement_type *file; - asection *section; +wild_sort (lang_wild_statement_type *wild, + struct wildcard_list *sec, + lang_input_statement_type *file, + asection *section) { const char *section_name; lang_statement_union_type *l; @@ -1426,12 +1253,11 @@ wild_sort (wild, sec, file, section) NULL, in which case it is a wild card. */ static void -output_section_callback (ptr, sec, section, file, output) - lang_wild_statement_type *ptr; - struct wildcard_list *sec; - asection *section; - lang_input_statement_type *file; - PTR output; +output_section_callback (lang_wild_statement_type *ptr, + struct wildcard_list *sec, + asection *section, + lang_input_statement_type *file, + void *output) { lang_statement_union_type *before; @@ -1487,25 +1313,29 @@ output_section_callback (ptr, sec, section, file, output) already and had its symbols read. If not then we'll read it. */ static lang_input_statement_type * -lookup_name (name) - const char *name; +lookup_name (const char *name) { lang_input_statement_type *search; for (search = (lang_input_statement_type *) input_file_chain.head; - search != (lang_input_statement_type *) NULL; + search != NULL; search = (lang_input_statement_type *) search->next_real_file) { - if (search->filename == (char *) NULL && name == (char *) NULL) + /* Use the local_sym_name as the name of the file that has + already been loaded as filename might have been transformed + via the search directory lookup mechanism. */ + const char * filename = search->local_sym_name; + + if (filename == NULL && name == NULL) return search; - if (search->filename != (char *) NULL - && name != (char *) NULL - && strcmp (search->filename, name) == 0) + if (filename != NULL + && name != NULL + && strcmp (filename, name) == 0) break; } - if (search == (lang_input_statement_type *) NULL) - search = new_afile (name, lang_input_file_is_file_enum, default_target, + if (search == NULL) + search = new_afile (name, lang_input_file_is_search_file_enum, default_target, FALSE); /* If we have already added this file, or this file is not real @@ -1513,10 +1343,10 @@ lookup_name (name) (FIXME: can that ever actually happen?) don't add this file. */ if (search->loaded || ! search->real - || search->filename == (const char *) NULL) + || search->filename == NULL) return search; - if (! load_symbols (search, (lang_statement_list_type *) NULL)) + if (! load_symbols (search, NULL)) return NULL; return search; @@ -1525,9 +1355,8 @@ lookup_name (name) /* Get the symbols for an input file. */ static bfd_boolean -load_symbols (entry, place) - lang_input_statement_type *entry; - lang_statement_list_type *place; +load_symbols (lang_input_statement_type *entry, + lang_statement_list_type *place) { char **matching; @@ -1658,14 +1487,13 @@ load_symbols (entry, place) the output section. */ static void -wild (s, target, output) - lang_wild_statement_type *s; - const char *target ATTRIBUTE_UNUSED; - lang_output_section_statement_type *output; +wild (lang_wild_statement_type *s, + const char *target ATTRIBUTE_UNUSED, + lang_output_section_statement_type *output) { struct wildcard_list *sec; - walk_wild (s, output_section_callback, (PTR) output); + walk_wild (s, output_section_callback, output); for (sec = s->section_list; sec != NULL; sec = sec->next) { @@ -1683,11 +1511,9 @@ wild (s, target, output) /* Return TRUE iff target is the sought target. */ static int -get_target (target, data) - const bfd_target *target; - PTR data; +get_target (const bfd_target *target, void *data) { - const char *sought = (const char *) data; + const char *sought = data; return strcmp (target->name, sought) == 0; } @@ -1695,9 +1521,7 @@ get_target (target, data) /* Like strcpy() but convert to lower case as well. */ static void -stricpy (dest, src) - char *dest; - char *src; +stricpy (char *dest, char *src) { char c; @@ -1711,9 +1535,7 @@ stricpy (dest, src) from haystack. */ static void -strcut (haystack, needle) - char *haystack; - char *needle; +strcut (char *haystack, char *needle) { haystack = strstr (haystack, needle); @@ -1732,9 +1554,7 @@ strcut (haystack, needle) Return a value indicating how "similar" they are. */ static int -name_compare (first, second) - char *first; - char *second; +name_compare (char *first, char *second) { char *copy1; char *copy2; @@ -1747,7 +1567,7 @@ name_compare (first, second) stricpy (copy1, first); stricpy (copy2, second); - /* Remove and endian strings from the name. */ + /* Remove size and endian strings from the name. */ strcut (copy1, "big"); strcut (copy1, "little"); strcut (copy2, "big"); @@ -1777,11 +1597,9 @@ static const bfd_target *winner; match to the original output target. */ static int -closest_target_match (target, data) - const bfd_target *target; - PTR data; +closest_target_match (const bfd_target *target, void *data) { - const bfd_target *original = (const bfd_target *) data; + const bfd_target *original = data; if (command_line.endian == ENDIAN_BIG && target->byteorder != BFD_ENDIAN_BIG) @@ -1815,7 +1633,7 @@ closest_target_match (target, data) /* Return the BFD target format of the first input file. */ static char * -get_first_input_target () +get_first_input_target (void) { char *target = NULL; @@ -1841,12 +1659,12 @@ get_first_input_target () } const char * -lang_get_output_target () +lang_get_output_target (void) { const char *target; /* Has the user told us which output format to use? */ - if (output_target != (char *) NULL) + if (output_target != NULL) return output_target; /* No - has the current target been set to something other than @@ -1866,8 +1684,7 @@ lang_get_output_target () /* Open the output file. */ static bfd * -open_output (name) - const char *name; +open_output (const char *name) { bfd *output; @@ -1881,7 +1698,7 @@ open_output (name) enum bfd_endian desired_endian; /* Get the chosen target. */ - target = bfd_search_for_target (get_target, (PTR) output_target); + target = bfd_search_for_target (get_target, (void *) output_target); /* If the target is not supported, we cannot do anything. */ if (target != NULL) @@ -1907,8 +1724,8 @@ open_output (name) /* Try to find a target as similar as possible to the default target, but which has the desired endian characteristic. */ - (void) bfd_search_for_target (closest_target_match, - (PTR) target); + bfd_search_for_target (closest_target_match, + (void *) target); /* Oh dear - we could not find any targets that satisfy our requirements. */ @@ -1923,7 +1740,7 @@ open_output (name) output = bfd_openw (name, output_target); - if (output == (bfd *) NULL) + if (output == NULL) { if (bfd_get_error () == bfd_error_invalid_target) einfo (_("%P%F: target %s not found\n"), output_target); @@ -1945,7 +1762,7 @@ open_output (name) einfo (_("%P%F:%s: can not set architecture: %E\n"), name); link_info.hash = bfd_link_hash_table_create (output); - if (link_info.hash == (struct bfd_link_hash_table *) NULL) + if (link_info.hash == NULL) einfo (_("%P%F: can not create link hash table: %E\n")); bfd_set_gp_size (output, g_switch_value); @@ -1953,16 +1770,15 @@ open_output (name) } static void -ldlang_open_output (statement) - lang_statement_union_type *statement; +ldlang_open_output (lang_statement_union_type *statement) { switch (statement->header.type) { case lang_output_statement_enum: - ASSERT (output_bfd == (bfd *) NULL); + ASSERT (output_bfd == NULL); output_bfd = open_output (statement->output_statement.name); ldemul_set_output_arch (); - if (config.magic_demand_paged && !link_info.relocateable) + if (config.magic_demand_paged && !link_info.relocatable) output_bfd->flags |= D_PAGED; else output_bfd->flags &= ~D_PAGED; @@ -1984,14 +1800,36 @@ ldlang_open_output (statement) } } +/* Convert between addresses in bytes and sizes in octets. + For currently supported targets, octets_per_byte is always a power + of two, so we can use shifts. */ +#define TO_ADDR(X) ((X) >> opb_shift) +#define TO_SIZE(X) ((X) << opb_shift) + +/* Support the above. */ +static unsigned int opb_shift = 0; + +static void +init_opb (void) +{ + unsigned x = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, + ldfile_output_machine); + opb_shift = 0; + if (x > 1) + while ((x & 1) == 0) + { + x >>= 1; + ++opb_shift; + } + ASSERT (x == 1); +} + /* Open all the input files. */ static void -open_input_bfds (s, force) - lang_statement_union_type *s; - bfd_boolean force; +open_input_bfds (lang_statement_union_type *s, bfd_boolean force) { - for (; s != (lang_statement_union_type *) NULL; s = s->header.next) + for (; s != NULL; s = s->header.next) { switch (s->header.type) { @@ -2005,7 +1843,7 @@ open_input_bfds (s, force) /* Maybe we should load the file's symbols. */ if (s->wild_statement.filename && ! wildcardp (s->wild_statement.filename)) - (void) lookup_name (s->wild_statement.filename); + lookup_name (s->wild_statement.filename); open_input_bfds (s->wild_statement.children.head, force); break; case lang_group_statement_enum: @@ -2067,7 +1905,7 @@ open_input_bfds (s, force) section. */ static void -lang_reasonable_defaults () +lang_reasonable_defaults (void) { #if 0 lang_output_section_statement_lookup (".text"); @@ -2082,12 +1920,91 @@ lang_reasonable_defaults () &default_common_section->children); new->section_name = "COMMON"; - new->filename = (char *) NULL; + new->filename = NULL; lang_list_init (&new->children); } #endif } +/* Add a symbol to a hash of symbols used in DEFINED (NAME) expressions. */ + +void +lang_track_definedness (const char *name) +{ + if (bfd_hash_lookup (&lang_definedness_table, name, TRUE, FALSE) == NULL) + einfo (_("%P%F: bfd_hash_lookup failed creating symbol %s\n"), name); +} + +/* New-function for the definedness hash table. */ + +static struct bfd_hash_entry * +lang_definedness_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED) +{ + struct lang_definedness_hash_entry *ret + = (struct lang_definedness_hash_entry *) entry; + + if (ret == NULL) + ret = (struct lang_definedness_hash_entry *) + bfd_hash_allocate (table, sizeof (struct lang_definedness_hash_entry)); + + if (ret == NULL) + einfo (_("%P%F: bfd_hash_allocate failed creating symbol %s\n"), name); + + ret->iteration = -1; + return &ret->root; +} + +/* Return the iteration when the definition of NAME was last updated. A + value of -1 means that the symbol is not defined in the linker script + or the command line, but may be defined in the linker symbol table. */ + +int +lang_symbol_definition_iteration (const char *name) +{ + struct lang_definedness_hash_entry *defentry + = (struct lang_definedness_hash_entry *) + bfd_hash_lookup (&lang_definedness_table, name, FALSE, FALSE); + + /* We've already created this one on the presence of DEFINED in the + script, so it can't be NULL unless something is borked elsewhere in + the code. */ + if (defentry == NULL) + FAIL (); + + return defentry->iteration; +} + +/* Update the definedness state of NAME. */ + +void +lang_update_definedness (const char *name, struct bfd_link_hash_entry *h) +{ + struct lang_definedness_hash_entry *defentry + = (struct lang_definedness_hash_entry *) + bfd_hash_lookup (&lang_definedness_table, name, FALSE, FALSE); + + /* We don't keep track of symbols not tested with DEFINED. */ + if (defentry == NULL) + return; + + /* If the symbol was already defined, and not from an earlier statement + iteration, don't update the definedness iteration, because that'd + make the symbol seem defined in the linker script at this point, and + it wasn't; it was defined in some object. If we do anyway, DEFINED + would start to yield false before this point and the construct "sym = + DEFINED (sym) ? sym : X;" would change sym to X despite being defined + in an object. */ + if (h->type != bfd_link_hash_undefined + && h->type != bfd_link_hash_common + && h->type != bfd_link_hash_new + && defentry->iteration == -1) + return; + + defentry->iteration = lang_statement_iteration; +} + /* Add the supplied name to the symbol table as an undefined reference. This is a two step process as the symbol table doesn't even exist at the time the ld command line is processed. First we put the name @@ -2099,12 +2016,10 @@ typedef struct bfd_sym_chain ldlang_undef_chain_list_type; #define ldlang_undef_chain_list_head entry_symbol.next void -ldlang_add_undef (name) - const char *const name; +ldlang_add_undef (const char *const name) { ldlang_undef_chain_list_type *new = - ((ldlang_undef_chain_list_type *) - stat_alloc (sizeof (ldlang_undef_chain_list_type))); + stat_alloc (sizeof (ldlang_undef_chain_list_type)); new->next = ldlang_undef_chain_list_head; ldlang_undef_chain_list_head = new; @@ -2118,13 +2033,12 @@ ldlang_add_undef (name) /* Insert NAME as undefined in the symbol table. */ static void -insert_undefined (name) - const char *name; +insert_undefined (const char *name) { struct bfd_link_hash_entry *h; h = bfd_link_hash_lookup (link_info.hash, name, TRUE, FALSE, TRUE); - if (h == (struct bfd_link_hash_entry *) NULL) + if (h == NULL) einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n")); if (h->type == bfd_link_hash_new) { @@ -2139,27 +2053,22 @@ insert_undefined (name) script file. */ static void -lang_place_undefineds () +lang_place_undefineds (void) { ldlang_undef_chain_list_type *ptr; - for (ptr = ldlang_undef_chain_list_head; - ptr != (ldlang_undef_chain_list_type *) NULL; - ptr = ptr->next) - { - insert_undefined (ptr->name); - } + for (ptr = ldlang_undef_chain_list_head; ptr != NULL; ptr = ptr->next) + insert_undefined (ptr->name); } /* Open input files and attach to output sections. */ static void -map_input_to_output_sections (s, target, output_section_statement) - lang_statement_union_type *s; - const char *target; - lang_output_section_statement_type *output_section_statement; +map_input_to_output_sections + (lang_statement_union_type *s, const char *target, + lang_output_section_statement_type *output_section_statement) { - for (; s != (lang_statement_union_type *) NULL; s = s->header.next) + for (; s != NULL; s = s->header.next) { switch (s->header.type) { @@ -2186,10 +2095,14 @@ map_input_to_output_sections (s, target, output_section_statement) target, output_section_statement); break; + case lang_data_statement_enum: + /* Make sure that any sections mentioned in the expression + are initialized. */ + exp_init_os (s->data_statement.exp); + /* FALLTHROUGH */ case lang_fill_statement_enum: case lang_input_section_enum: case lang_object_symbols_statement_enum: - case lang_data_statement_enum: case lang_reloc_statement_enum: case lang_padding_statement_enum: case lang_input_statement_enum: @@ -2230,7 +2143,7 @@ map_input_to_output_sections (s, target, output_section_statement) sections if they turn out to be not needed. Clean them up here. */ static void -strip_excluded_output_sections () +strip_excluded_output_sections (void) { lang_statement_union_type *u; @@ -2261,8 +2174,8 @@ strip_excluded_output_sections () } static void -print_output_section_statement (output_section_statement) - lang_output_section_statement_type *output_section_statement; +print_output_section_statement + (lang_output_section_statement_type *output_section_statement) { asection *section = output_section_statement->bfd_section; int len; @@ -2307,9 +2220,8 @@ print_output_section_statement (output_section_statement) } static void -print_assignment (assignment, output_section) - lang_assignment_statement_type *assignment; - lang_output_section_statement_type *output_section; +print_assignment (lang_assignment_statement_type *assignment, + lang_output_section_statement_type *output_section) { int i; etree_value_type result; @@ -2347,10 +2259,9 @@ print_assignment (assignment, output_section) } static void -print_input_statement (statm) - lang_input_statement_type *statm; +print_input_statement (lang_input_statement_type *statm) { - if (statm->filename != (char *) NULL) + if (statm->filename != NULL) { fprintf (config.map_file, "LOAD %s\n", statm->filename); } @@ -2360,11 +2271,9 @@ print_input_statement (statm) via bfd_link_hash_traverse. */ static bfd_boolean -print_one_symbol (hash_entry, ptr) - struct bfd_link_hash_entry *hash_entry; - PTR ptr; +print_one_symbol (struct bfd_link_hash_entry *hash_entry, void *ptr) { - asection *sec = (asection *) ptr; + asection *sec = ptr; if ((hash_entry->type == bfd_link_hash_defined || hash_entry->type == bfd_link_hash_defweak) @@ -2388,13 +2297,12 @@ print_one_symbol (hash_entry, ptr) /* Print information about an input section to the map file. */ static void -print_input_section (in) - lang_input_section_type *in; +print_input_section (lang_input_section_type *in) { asection *i = in->section; bfd_size_type size = i->_cooked_size != 0 ? i->_cooked_size : i->_raw_size; - unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, - ldfile_output_machine); + + init_opb (); if (size != 0) { print_space (); @@ -2418,7 +2326,7 @@ print_input_section (in) } minfo ("0x%V %W %B\n", - i->output_section->vma + i->output_offset, size / opb, + i->output_section->vma + i->output_offset, TO_ADDR (size), i->owner); if (i->_cooked_size != 0 && i->_cooked_size != i->_raw_size) @@ -2438,16 +2346,16 @@ print_input_section (in) minfo (_("%W (size before relaxing)\n"), i->_raw_size); } - bfd_link_hash_traverse (link_info.hash, print_one_symbol, (PTR) i); + bfd_link_hash_traverse (link_info.hash, print_one_symbol, i); - print_dot = i->output_section->vma + i->output_offset + size / opb; + print_dot = (i->output_section->vma + i->output_offset + + TO_ADDR (size)); } } } static void -print_fill_statement (fill) - lang_fill_statement_type *fill; +print_fill_statement (lang_fill_statement_type *fill) { size_t size; unsigned char *p; @@ -2458,16 +2366,14 @@ print_fill_statement (fill) } static void -print_data_statement (data) - lang_data_statement_type *data; +print_data_statement (lang_data_statement_type *data) { int i; bfd_vma addr; bfd_size_type size; const char *name; - unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, - ldfile_output_machine); + init_opb (); for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++) print_space (); @@ -2511,16 +2417,14 @@ print_data_statement (data) print_nl (); - print_dot = addr + size / opb; - + print_dot = addr + TO_ADDR (size); } /* Print an address statement. These are generated by options like -Ttext. */ static void -print_address_statement (address) - lang_address_statement_type *address; +print_address_statement (lang_address_statement_type *address) { minfo (_("Address of section %s set to "), address->section_name); exp_print_tree (address->address); @@ -2530,15 +2434,13 @@ print_address_statement (address) /* Print a reloc statement. */ static void -print_reloc_statement (reloc) - lang_reloc_statement_type *reloc; +print_reloc_statement (lang_reloc_statement_type *reloc) { int i; bfd_vma addr; bfd_size_type size; - unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, - ldfile_output_machine); + init_opb (); for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++) print_space (); @@ -2559,18 +2461,16 @@ print_reloc_statement (reloc) print_nl (); - print_dot = addr + size / opb; + print_dot = addr + TO_ADDR (size); } static void -print_padding_statement (s) - lang_padding_statement_type *s; +print_padding_statement (lang_padding_statement_type *s) { int len; bfd_vma addr; - unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, - ldfile_output_machine); + init_opb (); minfo (" *fill*"); len = sizeof " *fill*" - 1; @@ -2595,13 +2495,12 @@ print_padding_statement (s) print_nl (); - print_dot = addr + s->size / opb; + print_dot = addr + TO_ADDR (s->size); } static void -print_wild_statement (w, os) - lang_wild_statement_type *w; - lang_output_section_statement_type *os; +print_wild_statement (lang_wild_statement_type *w, + lang_output_section_statement_type *os) { struct wildcard_list *sec; @@ -2648,9 +2547,8 @@ print_wild_statement (w, os) /* Print a group statement. */ static void -print_group (s, os) - lang_group_statement_type *s; - lang_output_section_statement_type *os; +print_group (lang_group_statement_type *s, + lang_output_section_statement_type *os) { fprintf (config.map_file, "START GROUP\n"); print_statement_list (s->children.head, os); @@ -2661,9 +2559,8 @@ print_group (s, os) This can be called for any statement type. */ static void -print_statement_list (s, os) - lang_statement_union_type *s; - lang_output_section_statement_type *os; +print_statement_list (lang_statement_union_type *s, + lang_output_section_statement_type *os) { while (s != NULL) { @@ -2676,9 +2573,8 @@ print_statement_list (s, os) This can be called for any statement type. */ static void -print_statement (s, os) - lang_statement_union_type *s; - lang_output_section_statement_type *os; +print_statement (lang_statement_union_type *s, + lang_output_section_statement_type *os) { switch (s->header.type) { @@ -2748,7 +2644,7 @@ print_statement (s, os) } static void -print_statements () +print_statements (void) { print_statement_list (statement_list.head, abs_output_section); } @@ -2759,9 +2655,7 @@ print_statements () Intended to be called from GDB. */ void -dprint_statement (s, n) - lang_statement_union_type *s; - int n; +dprint_statement (lang_statement_union_type *s, int n) { FILE *map_save = config.map_file; @@ -2782,12 +2676,11 @@ dprint_statement (s, n) } static void -insert_pad (ptr, fill, alignment_needed, output_section, dot) - lang_statement_union_type **ptr; - fill_type *fill; - unsigned int alignment_needed; - asection *output_section; - bfd_vma dot; +insert_pad (lang_statement_union_type **ptr, + fill_type *fill, + unsigned int alignment_needed, + asection *output_section, + bfd_vma dot) { static fill_type zero_fill = { 1, { 0 } }; lang_statement_union_type *pad; @@ -2804,13 +2697,12 @@ insert_pad (ptr, fill, alignment_needed, output_section, dot) else { /* Make a new padding statement, linked into existing chain. */ - pad = ((lang_statement_union_type *) - stat_alloc (sizeof (lang_padding_statement_type))); + pad = stat_alloc (sizeof (lang_padding_statement_type)); pad->header.next = *ptr; *ptr = pad; pad->header.type = lang_padding_statement_enum; pad->padding_statement.output_section = output_section; - if (fill == (fill_type *) 0) + if (fill == NULL) fill = &zero_fill; pad->padding_statement.fill = fill; } @@ -2822,19 +2714,16 @@ insert_pad (ptr, fill, alignment_needed, output_section, dot) /* Work out how much this section will move the dot point. */ static bfd_vma -size_input_section (this_ptr, output_section_statement, fill, dot) - lang_statement_union_type **this_ptr; - lang_output_section_statement_type *output_section_statement; - fill_type *fill; - bfd_vma dot; +size_input_section (lang_statement_union_type **this_ptr, + lang_output_section_statement_type *output_section_statement, + fill_type *fill, + bfd_vma dot) { lang_input_section_type *is = &((*this_ptr)->input_section); asection *i = is->section; if (!is->ifile->just_syms_flag) { - unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, - ldfile_output_machine); unsigned int alignment_needed; asection *o; @@ -2854,7 +2743,7 @@ size_input_section (this_ptr, output_section_statement, fill, dot) if (alignment_needed != 0) { - insert_pad (this_ptr, fill, alignment_needed * opb, o, dot); + insert_pad (this_ptr, fill, TO_SIZE (alignment_needed), o, dot); dot += alignment_needed; } @@ -2864,10 +2753,10 @@ size_input_section (this_ptr, output_section_statement, fill, dot) /* Mark how big the output section must be to contain this now. */ if (i->_cooked_size != 0) - dot += i->_cooked_size / opb; + dot += TO_ADDR (i->_cooked_size); else - dot += i->_raw_size / opb; - o->_raw_size = (dot - o->vma) * opb; + dot += TO_ADDR (i->_raw_size); + o->_raw_size = TO_SIZE (dot - o->vma); } else { @@ -2878,8 +2767,11 @@ size_input_section (this_ptr, output_section_statement, fill, dot) } #define IGNORE_SECTION(bfd, s) \ - (((bfd_get_section_flags (bfd, s) & (SEC_ALLOC | SEC_LOAD)) \ - != (SEC_ALLOC | SEC_LOAD)) \ + (((bfd_get_section_flags (bfd, s) & SEC_THREAD_LOCAL) \ + ? ((bfd_get_section_flags (bfd, s) & (SEC_LOAD | SEC_NEVER_LOAD)) \ + != SEC_LOAD) \ + : ((bfd_get_section_flags (bfd, s) & (SEC_ALLOC | SEC_NEVER_LOAD)) \ + != SEC_ALLOC)) \ || bfd_section_size (bfd, s) == 0) /* Check to see if any allocated sections overlap with other allocated @@ -2887,10 +2779,9 @@ size_input_section (this_ptr, output_section_statement, fill, dot) the output section addresses of the two sections. */ static void -lang_check_section_addresses () +lang_check_section_addresses (void) { asection *s; - unsigned opb = bfd_octets_per_byte (output_bfd); /* Scan all sections in the output list. */ for (s = output_bfd->sections; s != NULL; s = s->next) @@ -2918,10 +2809,10 @@ lang_check_section_addresses () /* We must check the sections' LMA addresses not their VMA addresses because overlay sections can have overlapping VMAs but they must have distinct LMAs. */ - s_start = bfd_section_lma (output_bfd, s); + s_start = bfd_section_lma (output_bfd, s); os_start = bfd_section_lma (output_bfd, os); - s_end = s_start + bfd_section_size (output_bfd, s) / opb - 1; - os_end = os_start + bfd_section_size (output_bfd, os) / opb - 1; + s_end = s_start + TO_ADDR (bfd_section_size (output_bfd, s)) - 1; + os_end = os_start + TO_ADDR (bfd_section_size (output_bfd, os)) - 1; /* Look for an overlap. */ if ((s_end < os_start) || (s_start > os_end)) @@ -2944,18 +2835,17 @@ _("%X%P: section %s [%V -> %V] overlaps section %s [%V -> %V]\n"), calculation wraps around. */ static void -os_region_check (os, region, tree, base) - lang_output_section_statement_type *os; - struct memory_region_struct *region; - etree_type *tree; - bfd_vma base; +os_region_check (lang_output_section_statement_type *os, + lang_memory_region_type *region, + etree_type *tree, + bfd_vma base) { if ((region->current < region->origin || (region->current - region->origin > region->length)) && ((region->current != region->origin + region->length) || base == 0)) { - if (tree != (etree_type *) NULL) + if (tree != NULL) { einfo (_("%X%P: address 0x%v of %B section %s is not within region %s\n"), region->current, @@ -2978,21 +2868,17 @@ os_region_check (os, region, tree, base) /* Set the sizes for all the output sections. */ static bfd_vma -lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax, - check_regions) - lang_statement_union_type *s; - lang_output_section_statement_type *output_section_statement; - lang_statement_union_type **prev; - fill_type *fill; - bfd_vma dot; - bfd_boolean *relax; - bfd_boolean check_regions; -{ - unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, - ldfile_output_machine); - +lang_size_sections_1 + (lang_statement_union_type *s, + lang_output_section_statement_type *output_section_statement, + lang_statement_union_type **prev, + fill_type *fill, + bfd_vma dot, + bfd_boolean *relax, + bfd_boolean check_regions) +{ /* Size up the sections from their constituent parts. */ - for (; s != (lang_statement_union_type *) NULL; s = s->header.next) + for (; s != NULL; s = s->header.next) { switch (s->header.type) { @@ -3035,36 +2921,49 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax, } else { - if (os->addr_tree == (etree_type *) NULL) + if (os->addr_tree == NULL) { /* No address specified for this section, get one from the region specification. */ - if (os->region == (lang_memory_region_type *) NULL + if (os->region == NULL || (((bfd_get_section_flags (output_bfd, os->bfd_section) & (SEC_ALLOC | SEC_LOAD)) != 0) && os->region->name[0] == '*' - && strcmp (os->region->name, "*default*") == 0)) + && strcmp (os->region->name, DEFAULT_MEMORY_REGION) == 0)) { os->region = lang_memory_default (os->bfd_section); } /* If a loadable section is using the default memory region, and some non default memory regions were - defined, issue a warning. */ - if ((bfd_get_section_flags (output_bfd, os->bfd_section) - & (SEC_ALLOC | SEC_LOAD)) != 0 - && (bfd_get_section_flags (output_bfd, os->bfd_section) - & SEC_NEVER_LOAD) == 0 - && ! link_info.relocateable + defined, issue an error message. */ + if (!IGNORE_SECTION (output_bfd, os->bfd_section) + && ! link_info.relocatable && check_regions - && strcmp (os->region->name, "*default*") == 0 + && strcmp (os->region->name, DEFAULT_MEMORY_REGION) == 0 && lang_memory_region_list != NULL && (strcmp (lang_memory_region_list->name, - "*default*") != 0 + DEFAULT_MEMORY_REGION) != 0 || lang_memory_region_list->next != NULL)) - einfo (_("%P: warning: no memory region specified for section `%s'\n"), - bfd_get_section_name (output_bfd, - os->bfd_section)); + { + /* By default this is an error rather than just a + warning because if we allocate the section to the + default memory region we can end up creating an + excessively large binary, or even seg faulting when + attempting to perform a negative seek. See + http://sources.redhat.com/ml/binutils/2003-04/msg00423.html + for an example of this. This behaviour can be + overridden by the using the --no-check-sections + switch. */ + if (command_line.check_section_addresses) + einfo (_("%P%F: error: no memory region specified for loadable section `%s'\n"), + bfd_get_section_name (output_bfd, + os->bfd_section)); + else + einfo (_("%P: warning: no memory region specified for loadable section `%s'\n"), + bfd_get_section_name (output_bfd, + os->bfd_section)); + } dot = os->region->current; @@ -3085,12 +2984,15 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax, { etree_value_type r; + os->processed = -1; r = exp_fold_tree (os->addr_tree, abs_output_section, lang_allocating_phase_enum, dot, &dot); + os->processed = 0; + if (!r.valid_p) - einfo (_("%F%S: non constant address expression for section %s\n"), + einfo (_("%F%S: non constant or forward reference address expression for section %s\n"), os->name); dot = r.value + r.section->bfd_section->vma; @@ -3112,22 +3014,25 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax, /* Put the section within the requested block size, or align at the block boundary. */ - after = align_n (os->bfd_section->vma - + os->bfd_section->_raw_size / opb, - (bfd_vma) os->block_value); + after = ((os->bfd_section->vma + + TO_ADDR (os->bfd_section->_raw_size) + + os->block_value - 1) + & - (bfd_vma) os->block_value); if (bfd_is_abs_section (os->bfd_section)) ASSERT (after == os->bfd_section->vma); - else if ((os->bfd_section->flags & SEC_HAS_CONTENTS) == 0 - && (os->bfd_section->flags & SEC_THREAD_LOCAL) - && ! link_info.relocateable) - os->bfd_section->_raw_size = 0; else - os->bfd_section->_raw_size = - (after - os->bfd_section->vma) * opb; + os->bfd_section->_raw_size + = TO_SIZE (after - os->bfd_section->vma); - dot = os->bfd_section->vma + os->bfd_section->_raw_size / opb; - os->processed = TRUE; + dot = os->bfd_section->vma; + /* .tbss sections effectively have zero size. */ + if ((os->bfd_section->flags & SEC_HAS_CONTENTS) != 0 + || (os->bfd_section->flags & SEC_THREAD_LOCAL) == 0 + || link_info.relocatable) + dot += TO_ADDR (os->bfd_section->_raw_size); + + os->processed = 1; if (os->update_dot_tree != 0) exp_fold_tree (os->update_dot_tree, abs_output_section, @@ -3141,7 +3046,7 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax, If the SEC_NEVER_LOAD bit is not set, it will affect the addresses of sections after it. We have to update dot. */ - if (os->region != (lang_memory_region_type *) NULL + if (os->region != NULL && ((bfd_get_section_flags (output_bfd, os->bfd_section) & SEC_NEVER_LOAD) == 0 || (bfd_get_section_flags (output_bfd, os->bfd_section) @@ -3164,7 +3069,7 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax, /* Set load_base, which will be handled later. */ os->load_base = exp_intop (os->lma_region->current); os->lma_region->current += - os->bfd_section->_raw_size / opb; + TO_ADDR (os->bfd_section->_raw_size); if (check_regions) os_region_check (os, os->lma_region, NULL, os->bfd_section->lma); @@ -3189,6 +3094,11 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax, s->data_statement.output_section = output_section_statement->bfd_section; + /* We might refer to provided symbols in the expression, and + need to mark them as needed. */ + exp_fold_tree (s->data_statement.exp, abs_output_section, + lang_allocating_phase_enum, dot, &dot); + switch (s->data_statement.type) { default: @@ -3207,9 +3117,9 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax, size = BYTE_SIZE; break; } - if (size < opb) - size = opb; - dot += size / opb; + if (size < TO_SIZE ((unsigned) 1)) + size = TO_SIZE ((unsigned) 1); + dot += TO_ADDR (size); output_section_statement->bfd_section->_raw_size += size; /* The output section gets contents, and then we inspect for any flags set in the input script which override any ALLOC. */ @@ -3231,7 +3141,7 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax, s->reloc_statement.output_section = output_section_statement->bfd_section; size = bfd_get_reloc_size (s->reloc_statement.howto); - dot += size / opb; + dot += TO_ADDR (size); output_section_statement->bfd_section->_raw_size += size; } break; @@ -3299,20 +3209,26 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax, { /* If we don't have an output section, then just adjust the default memory address. */ - lang_memory_region_lookup ("*default*")->current = newdot; + lang_memory_region_lookup (DEFAULT_MEMORY_REGION, FALSE)->current = newdot; } else { /* Insert a pad after this statement. We can't put the pad before when relaxing, in case the assignment references dot. */ - insert_pad (&s->header.next, fill, (newdot - dot) * opb, + insert_pad (&s->header.next, fill, TO_SIZE (newdot - dot), output_section_statement->bfd_section, dot); /* Don't neuter the pad below when relaxing. */ s = s->header.next; } + /* If dot is advanced, this implies that the section should + have space allocated to it, unless the user has explicitly + stated that the section should never be loaded. */ + if (!(output_section_statement->flags & (SEC_NEVER_LOAD | SEC_ALLOC))) + output_section_statement->bfd_section->flags |= SEC_ALLOC; + dot = newdot; } } @@ -3356,17 +3272,20 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax, } bfd_vma -lang_size_sections (s, output_section_statement, prev, fill, dot, relax, - check_regions) - lang_statement_union_type *s; - lang_output_section_statement_type *output_section_statement; - lang_statement_union_type **prev; - fill_type *fill; - bfd_vma dot; - bfd_boolean *relax; - bfd_boolean check_regions; +lang_size_sections + (lang_statement_union_type *s, + lang_output_section_statement_type *output_section_statement, + lang_statement_union_type **prev, + fill_type *fill, + bfd_vma dot, + bfd_boolean *relax, + bfd_boolean check_regions) { bfd_vma result; + asection *o; + + /* Callers of exp_fold_tree need to increment this. */ + lang_statement_iteration++; exp_data_seg.phase = exp_dataseg_none; result = lang_size_sections_1 (s, output_section_statement, prev, fill, @@ -3385,33 +3304,41 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax, && first + last <= exp_data_seg.pagesize) { exp_data_seg.phase = exp_dataseg_adjust; + lang_statement_iteration++; result = lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax, check_regions); } } + /* Some backend relaxers want to refer to the output section size. Give + them a section size that does not change on the next call while they + relax. We can't set this at top because lang_reset_memory_regions + which is called before we get here, sets _raw_size to 0 on relaxing + rounds. */ + for (o = output_bfd->sections; o != NULL; o = o->next) + o->_cooked_size = o->_raw_size; + return result; } -bfd_vma -lang_do_assignments (s, output_section_statement, fill, dot) - lang_statement_union_type *s; - lang_output_section_statement_type *output_section_statement; - fill_type *fill; - bfd_vma dot; -{ - unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, - ldfile_output_machine); +/* Worker function for lang_do_assignments. Recursiveness goes here. */ - for (; s != (lang_statement_union_type *) NULL; s = s->header.next) +static bfd_vma +lang_do_assignments_1 + (lang_statement_union_type *s, + lang_output_section_statement_type *output_section_statement, + fill_type *fill, + bfd_vma dot) +{ + for (; s != NULL; s = s->header.next) { switch (s->header.type) { case lang_constructors_statement_enum: - dot = lang_do_assignments (constructor_list.head, - output_section_statement, - fill, - dot); + dot = lang_do_assignments_1 (constructor_list.head, + output_section_statement, + fill, + dot); break; case lang_output_section_statement_enum: @@ -3422,9 +3349,9 @@ lang_do_assignments (s, output_section_statement, fill, dot) if (os->bfd_section != NULL) { dot = os->bfd_section->vma; - (void) lang_do_assignments (os->children.head, os, - os->fill, dot); - dot = os->bfd_section->vma + os->bfd_section->_raw_size / opb; + lang_do_assignments_1 (os->children.head, os, os->fill, dot); + dot = (os->bfd_section->vma + + TO_ADDR (os->bfd_section->_raw_size)); } if (os->load_base) @@ -3442,9 +3369,9 @@ lang_do_assignments (s, output_section_statement, fill, dot) break; case lang_wild_statement_enum: - dot = lang_do_assignments (s->wild_statement.children.head, - output_section_statement, - fill, dot); + dot = lang_do_assignments_1 (s->wild_statement.children.head, + output_section_statement, + fill, dot); break; @@ -3462,9 +3389,10 @@ lang_do_assignments (s, output_section_statement, fill, dot) value = exp_fold_tree (s->data_statement.exp, abs_output_section, lang_final_phase_enum, dot, &dot); - s->data_statement.value = value.value; if (!value.valid_p) einfo (_("%F%P: invalid data statement\n")); + s->data_statement.value + = value.value + value.section->bfd_section->vma; } { unsigned int size; @@ -3486,9 +3414,9 @@ lang_do_assignments (s, output_section_statement, fill, dot) size = BYTE_SIZE; break; } - if (size < opb) - size = opb; - dot += size / opb; + if (size < TO_SIZE ((unsigned) 1)) + size = TO_SIZE ((unsigned) 1); + dot += TO_ADDR (size); } break; @@ -3503,7 +3431,7 @@ lang_do_assignments (s, output_section_statement, fill, dot) if (!value.valid_p) einfo (_("%F%P: invalid reloc statement\n")); } - dot += bfd_get_reloc_size (s->reloc_statement.howto) / opb; + dot += TO_ADDR (bfd_get_reloc_size (s->reloc_statement.howto)); break; case lang_input_section_enum: @@ -3511,9 +3439,9 @@ lang_do_assignments (s, output_section_statement, fill, dot) asection *in = s->input_section.section; if (in->_cooked_size != 0) - dot += in->_cooked_size / opb; + dot += TO_ADDR (in->_cooked_size); else - dot += in->_raw_size / opb; + dot += TO_ADDR (in->_raw_size); } break; @@ -3533,13 +3461,13 @@ lang_do_assignments (s, output_section_statement, fill, dot) break; case lang_padding_statement_enum: - dot += s->padding_statement.size / opb; + dot += TO_ADDR (s->padding_statement.size); break; case lang_group_statement_enum: - dot = lang_do_assignments (s->group_statement.children.head, - output_section_statement, - fill, dot); + dot = lang_do_assignments_1 (s->group_statement.children.head, + output_section_statement, + fill, dot); break; @@ -3554,6 +3482,17 @@ lang_do_assignments (s, output_section_statement, fill, dot) return dot; } +void +lang_do_assignments (lang_statement_union_type *s, + lang_output_section_statement_type *output_section_statement, + fill_type *fill, + bfd_vma dot) +{ + /* Callers of exp_fold_tree need to increment this. */ + lang_statement_iteration++; + lang_do_assignments_1 (s, output_section_statement, fill, dot); +} + /* Fix any .startof. or .sizeof. symbols. When the assemblers see the operator .startof. (section_name), it produces an undefined symbol .startof.section_name. Similarly, when it sees @@ -3562,11 +3501,11 @@ lang_do_assignments (s, output_section_statement, fill, dot) such symbols, and set them to the correct value. */ static void -lang_set_startof () +lang_set_startof (void) { asection *s; - if (link_info.relocateable) + if (link_info.relocatable) return; for (s = output_bfd->sections; s != NULL; s = s->next) @@ -3591,15 +3530,11 @@ lang_set_startof () h = bfd_link_hash_lookup (link_info.hash, buf, FALSE, FALSE, TRUE); if (h != NULL && h->type == bfd_link_hash_undefined) { - unsigned opb; - - opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, - ldfile_output_machine); h->type = bfd_link_hash_defined; if (s->_cooked_size != 0) - h->u.def.value = s->_cooked_size / opb; + h->u.def.value = TO_ADDR (s->_cooked_size); else - h->u.def.value = s->_raw_size / opb; + h->u.def.value = TO_ADDR (s->_raw_size); h->u.def.section = bfd_abs_section_ptr; } @@ -3608,17 +3543,17 @@ lang_set_startof () } static void -lang_finish () +lang_finish (void) { struct bfd_link_hash_entry *h; bfd_boolean warn; - if (link_info.relocateable || link_info.shared) + if (link_info.relocatable || link_info.shared) warn = FALSE; else warn = TRUE; - if (entry_symbol.name == (const char *) NULL) + if (entry_symbol.name == NULL) { /* No entry has been specified. Look for start, but don't warn if we don't find it. */ @@ -3628,7 +3563,7 @@ lang_finish () h = bfd_link_hash_lookup (link_info.hash, entry_symbol.name, FALSE, FALSE, TRUE); - if (h != (struct bfd_link_hash_entry *) NULL + if (h != NULL && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak) && h->u.def.section->output_section != NULL) @@ -3662,7 +3597,7 @@ lang_finish () /* Can't find the entry symbol, and it's not a number. Use the first address in the text section. */ ts = bfd_get_section_by_name (output_bfd, entry_section); - if (ts != (asection *) NULL) + if (ts != NULL) { if (warn) einfo (_("%P: warning: cannot find entry symbol %s; defaulting to %V\n"), @@ -3681,18 +3616,15 @@ lang_finish () } } } + + bfd_hash_table_free (&lang_definedness_table); } /* This is a small function used when we want to ignore errors from BFD. */ static void -#ifdef ANSI_PROTOTYPES ignore_bfd_errors (const char *s ATTRIBUTE_UNUSED, ...) -#else -ignore_bfd_errors (s) - const char *s ATTRIBUTE_UNUSED; -#endif { /* Don't do anything. */ } @@ -3702,15 +3634,13 @@ ignore_bfd_errors (s) other checking that is needed. */ static void -lang_check () +lang_check (void) { lang_statement_union_type *file; bfd *input_bfd; const bfd_arch_info_type *compatible; - for (file = file_chain.head; - file != (lang_statement_union_type *) NULL; - file = file->input_statement.next) + for (file = file_chain.head; file != NULL; file = file->input_statement.next) { input_bfd = file->input_statement.the_bfd; compatible = bfd_arch_get_compatible (input_bfd, output_bfd, @@ -3722,7 +3652,7 @@ lang_check () input format may not have equivalent representations in the output format (and besides BFD does not translate relocs for other link purposes than a final link). */ - if ((link_info.relocateable || link_info.emitrelocations) + if ((link_info.relocatable || link_info.emitrelocations) && (compatible == NULL || bfd_get_flavour (input_bfd) != bfd_get_flavour (output_bfd)) && (bfd_get_file_flags (input_bfd) & HAS_RELOC) != 0) @@ -3757,7 +3687,7 @@ lang_check () if (! bfd_merge_private_bfd_data (input_bfd, output_bfd)) { if (command_line.warn_mismatch) - einfo (_("%E%X: failed to merge target specific data of file %B\n"), + einfo (_("%P%X: failed to merge target specific data of file %B\n"), input_bfd); } if (! command_line.warn_mismatch) @@ -3771,38 +3701,33 @@ lang_check () to roughly sort the entries by size. */ static void -lang_common () +lang_common (void) { if (command_line.inhibit_common_definition) return; - if (link_info.relocateable + if (link_info.relocatable && ! command_line.force_common_definition) return; if (! config.sort_common) - bfd_link_hash_traverse (link_info.hash, lang_one_common, (PTR) NULL); + bfd_link_hash_traverse (link_info.hash, lang_one_common, NULL); else { int power; for (power = 4; power >= 0; power--) - bfd_link_hash_traverse (link_info.hash, lang_one_common, - (PTR) &power); + bfd_link_hash_traverse (link_info.hash, lang_one_common, &power); } } /* Place one common symbol in the correct section. */ static bfd_boolean -lang_one_common (h, info) - struct bfd_link_hash_entry *h; - PTR info; +lang_one_common (struct bfd_link_hash_entry *h, void *info) { unsigned int power_of_two; bfd_vma size; asection *section; - unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, - ldfile_output_machine); if (h->type != bfd_link_hash_common) return TRUE; @@ -3816,9 +3741,9 @@ lang_one_common (h, info) section = h->u.c.p->section; - /* Increase the size of the section. */ - section->_cooked_size = align_n ((section->_cooked_size + opb - 1) / opb, - (bfd_vma) 1 << power_of_two) * opb; + /* Increase the size of the section to align the common sym. */ + section->_cooked_size += ((bfd_vma) 1 << (power_of_two + opb_shift)) - 1; + section->_cooked_size &= (- (bfd_vma) 1 << (power_of_two + opb_shift)); /* Adjust the alignment if necessary. */ if (power_of_two > section->alignment_power) @@ -3892,17 +3817,15 @@ lang_one_common (h, info) an input request and place it into the statement tree. */ static void -lang_place_orphans () +lang_place_orphans (void) { LANG_FOR_EACH_INPUT_STATEMENT (file) { asection *s; - for (s = file->the_bfd->sections; - s != (asection *) NULL; - s = s->next) + for (s = file->the_bfd->sections; s != NULL; s = s->next) { - if (s->output_section == (asection *) NULL) + if (s->output_section == NULL) { /* This section of the file is not attached, root around for a sensible place for it to go. */ @@ -3916,7 +3839,7 @@ lang_place_orphans () /* This is a lonely common section which must have come from an archive. We attach to the section with the wildcard. */ - if (! link_info.relocateable + if (! link_info.relocatable || command_line.force_common_definition) { if (default_common_section == NULL) @@ -3950,10 +3873,7 @@ lang_place_orphans () } void -lang_set_flags (ptr, flags, invert) - lang_memory_region_type *ptr; - const char *flags; - int invert; +lang_set_flags (lang_memory_region_type *ptr, const char *flags, int invert) { flagword *ptr_flags; @@ -3995,8 +3915,7 @@ lang_set_flags (ptr, flags, invert) on an archive, but not on the elements. */ void -lang_for_each_input_file (func) - void (*func) PARAMS ((lang_input_statement_type *)); +lang_for_each_input_file (void (*func) (lang_input_statement_type *)) { lang_input_statement_type *f; @@ -4011,8 +3930,7 @@ lang_for_each_input_file (func) not be called on the archive file itself. */ void -lang_for_each_file (func) - void (*func) PARAMS ((lang_input_statement_type *)); +lang_for_each_file (void (*func) (lang_input_statement_type *)) { LANG_FOR_EACH_INPUT_STATEMENT (f) { @@ -4020,32 +3938,8 @@ lang_for_each_file (func) } } -#if 0 - -/* Not used. */ - void -lang_for_each_input_section (func) - void (*func) PARAMS ((bfd *ab, asection *as)); -{ - LANG_FOR_EACH_INPUT_STATEMENT (f) - { - asection *s; - - for (s = f->the_bfd->sections; - s != (asection *) NULL; - s = s->next) - { - func (f->the_bfd, s); - } - } -} - -#endif - -void -ldlang_add_file (entry) - lang_input_statement_type *entry; +ldlang_add_file (lang_input_statement_type *entry) { bfd **pp; @@ -4055,14 +3949,12 @@ ldlang_add_file (entry) /* The BFD linker needs to have a list of all input BFDs involved in a link. */ - ASSERT (entry->the_bfd->link_next == (bfd *) NULL); + ASSERT (entry->the_bfd->link_next == NULL); ASSERT (entry->the_bfd != output_bfd); - for (pp = &link_info.input_bfds; - *pp != (bfd *) NULL; - pp = &(*pp)->link_next) + for (pp = &link_info.input_bfds; *pp != NULL; pp = &(*pp)->link_next) ; *pp = entry->the_bfd; - entry->the_bfd->usrdata = (PTR) entry; + entry->the_bfd->usrdata = entry; bfd_set_gp_size (entry->the_bfd, g_switch_value); /* Look through the sections and check for any which should not be @@ -4075,13 +3967,11 @@ ldlang_add_file (entry) each backend which might set the SEC_LINK_ONCE flag. If we do this, we should probably handle SEC_EXCLUDE in the same way. */ - bfd_map_over_sections (entry->the_bfd, section_already_linked, (PTR) entry); + bfd_map_over_sections (entry->the_bfd, section_already_linked, entry); } void -lang_add_output (name, from_script) - const char *name; - int from_script; +lang_add_output (const char *name, int from_script) { /* Make -o on command line override OUTPUT in script. */ if (!had_output_filename || !from_script) @@ -4094,8 +3984,7 @@ lang_add_output (name, from_script) static lang_output_section_statement_type *current_section; static int -topower (x) - int x; +topower (int x) { unsigned int i = 1; int l; @@ -4114,16 +4003,12 @@ topower (x) } lang_output_section_statement_type * -lang_enter_output_section_statement (output_section_statement_name, - address_exp, sectype, block_value, - align, subalign, ebase) - const char *output_section_statement_name; - etree_type *address_exp; - enum section_type sectype; - bfd_vma block_value; - etree_type *align; - etree_type *subalign; - etree_type *ebase; +lang_enter_output_section_statement (const char *output_section_statement_name, + etree_type *address_exp, + enum section_type sectype, + etree_type *align, + etree_type *subalign, + etree_type *ebase) { lang_output_section_statement_type *os; @@ -4138,7 +4023,7 @@ lang_enter_output_section_statement (output_section_statement_name, #endif /* Make next things chain into subchain of this. */ - if (os->addr_tree == (etree_type *) NULL) + if (os->addr_tree == NULL) { os->addr_tree = address_exp; } @@ -4147,7 +4032,7 @@ lang_enter_output_section_statement (output_section_statement_name, os->flags = SEC_NO_FLAGS; else os->flags = SEC_NEVER_LOAD; - os->block_value = block_value ? block_value : 1; + os->block_value = 1; stat_ptr = &os->children; os->subsection_alignment = @@ -4160,7 +4045,7 @@ lang_enter_output_section_statement (output_section_statement_name, } void -lang_final () +lang_final (void) { lang_output_statement_type *new = new_stat (lang_output_statement, stat_ptr); @@ -4171,14 +4056,12 @@ lang_final () /* Reset the current counters in the regions. */ void -lang_reset_memory_regions () +lang_reset_memory_regions (void) { lang_memory_region_type *p = lang_memory_region_list; asection *o; - for (p = lang_memory_region_list; - p != (lang_memory_region_type *) NULL; - p = p->next) + for (p = lang_memory_region_list; p != NULL; p = p->next) { p->old_length = (bfd_size_type) (p->current - p->origin); p->current = p->origin; @@ -4192,12 +4075,11 @@ lang_reset_memory_regions () should be as well. */ static void -gc_section_callback (ptr, sec, section, file, data) - lang_wild_statement_type *ptr; - struct wildcard_list *sec ATTRIBUTE_UNUSED; - asection *section; - lang_input_statement_type *file ATTRIBUTE_UNUSED; - PTR data ATTRIBUTE_UNUSED; +gc_section_callback (lang_wild_statement_type *ptr, + struct wildcard_list *sec ATTRIBUTE_UNUSED, + asection *section, + lang_input_statement_type *file ATTRIBUTE_UNUSED, + void *data ATTRIBUTE_UNUSED) { if (ptr->keep_sections) section->flags |= SEC_KEEP; @@ -4206,8 +4088,7 @@ gc_section_callback (ptr, sec, section, file, data) /* Handle a wild statement, marking it against GC. */ static void -lang_gc_wild (s) - lang_wild_statement_type *s; +lang_gc_wild (lang_wild_statement_type *s) { walk_wild (s, gc_section_callback, NULL); } @@ -4215,10 +4096,9 @@ lang_gc_wild (s) /* Iterate over sections marking them against GC. */ static void -lang_gc_sections_1 (s) - lang_statement_union_type *s; +lang_gc_sections_1 (lang_statement_union_type *s) { - for (; s != (lang_statement_union_type *) NULL; s = s->header.next) + for (; s != NULL; s = s->header.next) { switch (s->header.type) { @@ -4241,7 +4121,7 @@ lang_gc_sections_1 (s) } static void -lang_gc_sections () +lang_gc_sections (void) { struct bfd_link_hash_entry *h; ldlang_undef_chain_list_type *ulist; @@ -4258,7 +4138,7 @@ lang_gc_sections () h = bfd_link_hash_lookup (link_info.hash, ulist->name, FALSE, FALSE, FALSE); - if (h != (struct bfd_link_hash_entry *) NULL + if (h != NULL && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak) && ! bfd_is_abs_section (h->u.def.section)) @@ -4271,13 +4151,14 @@ lang_gc_sections () } void -lang_process () +lang_process (void) { lang_reasonable_defaults (); current_target = default_target; /* Open the output file. */ lang_for_each_statement (ldlang_open_output); + init_opb (); ldemul_create_output_section_statements (); @@ -4328,18 +4209,17 @@ lang_process () /* Run through the contours of the script and attach input sections to the correct output sections. */ - map_input_to_output_sections (statement_list.head, (char *) NULL, - (lang_output_section_statement_type *) NULL); + map_input_to_output_sections (statement_list.head, NULL, NULL); /* Find any sections not attached explicitly and handle them. */ lang_place_orphans (); - if (! link_info.relocateable) + if (! link_info.relocatable) { /* Look for a text section and set the readonly attribute in it. */ asection *found = bfd_get_section_by_name (output_bfd, ".text"); - if (found != (asection *) NULL) + if (found != NULL) { if (config.text_read_only) found->flags |= SEC_READONLY; @@ -4352,7 +4232,7 @@ lang_process () and other back-ends size dynamic sections. */ ldemul_before_allocation (); - if (!link_info.relocateable) + if (!link_info.relocatable) strip_excluded_output_sections (); /* We must record the program headers before we try to fix the @@ -4360,9 +4240,8 @@ lang_process () lang_record_phdrs (); /* Size up the sections. */ - lang_size_sections (statement_list.head, - abs_output_section, - &statement_list.head, 0, (bfd_vma) 0, NULL, + lang_size_sections (statement_list.head, abs_output_section, + &statement_list.head, 0, 0, NULL, command_line.relax ? FALSE : TRUE); /* Now run around and relax if we can. */ @@ -4373,8 +4252,6 @@ lang_process () do { - lang_reset_memory_regions (); - relax_again = FALSE; /* Note: pe-dll.c does something like this also. If you find @@ -4383,36 +4260,33 @@ lang_process () /* Do all the assignments with our current guesses as to section sizes. */ - lang_do_assignments (statement_list.head, - abs_output_section, - (fill_type *) 0, (bfd_vma) 0); + lang_do_assignments (statement_list.head, abs_output_section, + NULL, 0); + + /* We must do this after lang_do_assignments, because it uses + _raw_size. */ + lang_reset_memory_regions (); /* Perform another relax pass - this time we know where the globals are, so can make a better guess. */ - lang_size_sections (statement_list.head, - abs_output_section, - &statement_list.head, 0, (bfd_vma) 0, - &relax_again, FALSE); + lang_size_sections (statement_list.head, abs_output_section, + &statement_list.head, 0, 0, &relax_again, FALSE); /* If the normal relax is done and the relax finalize pass is not performed yet, we perform another relax pass. */ - if (!relax_again && !link_info.relax_finalizing) + if (!relax_again && link_info.need_relax_finalize) { - link_info.relax_finalizing = TRUE; + link_info.need_relax_finalize = FALSE; relax_again = TRUE; } } while (relax_again); /* Final extra sizing to report errors. */ + lang_do_assignments (statement_list.head, abs_output_section, NULL, 0); lang_reset_memory_regions (); - lang_do_assignments (statement_list.head, - abs_output_section, - (fill_type *) 0, (bfd_vma) 0); - lang_size_sections (statement_list.head, - abs_output_section, - & statement_list.head, 0, (bfd_vma) 0, - NULL, TRUE); + lang_size_sections (statement_list.head, abs_output_section, + &statement_list.head, 0, 0, NULL, TRUE); } /* See if anything special should be done now we know how big @@ -4425,12 +4299,10 @@ lang_process () /* Do all the assignments, now that we know the final resting places of all the symbols. */ - lang_do_assignments (statement_list.head, - abs_output_section, - (fill_type *) 0, (bfd_vma) 0); + lang_do_assignments (statement_list.head, abs_output_section, NULL, 0); /* Make sure that the section addresses make sense. */ - if (! link_info.relocateable + if (! link_info.relocatable && command_line.check_section_addresses) lang_check_section_addresses (); @@ -4443,10 +4315,9 @@ lang_process () /* EXPORTED TO YACC */ void -lang_add_wild (filespec, section_list, keep_sections) - struct wildcard_spec *filespec; - struct wildcard_list *section_list; - bfd_boolean keep_sections; +lang_add_wild (struct wildcard_spec *filespec, + struct wildcard_list *section_list, + bfd_boolean keep_sections) { struct wildcard_list *curr, *next; lang_wild_statement_type *new; @@ -4485,9 +4356,7 @@ lang_add_wild (filespec, section_list, keep_sections) } void -lang_section_start (name, address) - const char *name; - etree_type *address; +lang_section_start (const char *name, etree_type *address) { lang_address_statement_type *ad; @@ -4502,9 +4371,7 @@ lang_section_start (name, address) precedence. */ void -lang_add_entry (name, cmdline) - const char *name; - bfd_boolean cmdline; +lang_add_entry (const char *name, bfd_boolean cmdline) { if (entry_symbol.name == NULL || cmdline @@ -4516,8 +4383,7 @@ lang_add_entry (name, cmdline) } void -lang_add_target (name) - const char *name; +lang_add_target (const char *name) { lang_target_statement_type *new = new_stat (lang_target_statement, stat_ptr); @@ -4527,8 +4393,7 @@ lang_add_target (name) } void -lang_add_map (name) - const char *name; +lang_add_map (const char *name) { while (*name) { @@ -4543,8 +4408,7 @@ lang_add_map (name) } void -lang_add_fill (fill) - fill_type *fill; +lang_add_fill (fill_type *fill) { lang_fill_statement_type *new = new_stat (lang_fill_statement, stat_ptr); @@ -4553,9 +4417,7 @@ lang_add_fill (fill) } void -lang_add_data (type, exp) - int type; - union etree_union *exp; +lang_add_data (int type, union etree_union *exp) { lang_data_statement_type *new = new_stat (lang_data_statement, @@ -4574,12 +4436,11 @@ lang_add_data (type, exp) NAME must be NULL. ADDEND is an expression for the addend. */ void -lang_add_reloc (reloc, howto, section, name, addend) - bfd_reloc_code_real_type reloc; - reloc_howto_type *howto; - asection *section; - const char *name; - union etree_union *addend; +lang_add_reloc (bfd_reloc_code_real_type reloc, + reloc_howto_type *howto, + asection *section, + const char *name, + union etree_union *addend) { lang_reloc_statement_type *p = new_stat (lang_reloc_statement, stat_ptr); @@ -4595,8 +4456,7 @@ lang_add_reloc (reloc, howto, section, name, addend) } lang_assignment_statement_type * -lang_add_assignment (exp) - etree_type *exp; +lang_add_assignment (etree_type *exp) { lang_assignment_statement_type *new = new_stat (lang_assignment_statement, stat_ptr); @@ -4606,17 +4466,15 @@ lang_add_assignment (exp) } void -lang_add_attribute (attribute) - enum statement_enum attribute; +lang_add_attribute (enum statement_enum attribute) { new_statement (attribute, sizeof (lang_statement_union_type), stat_ptr); } void -lang_startup (name) - const char *name; +lang_startup (const char *name) { - if (startup_file != (char *) NULL) + if (startup_file != NULL) { einfo (_("%P%Fmultiple STARTUP files\n")); } @@ -4628,8 +4486,7 @@ lang_startup (name) } void -lang_float (maybe) - bfd_boolean maybe; +lang_float (bfd_boolean maybe) { lang_float_flag = maybe; } @@ -4638,43 +4495,47 @@ lang_float (maybe) /* Work out the load- and run-time regions from a script statement, and store them in *LMA_REGION and *REGION respectively. - MEMSPEC is the name of the run-time region, or "*default*" if the - statement didn't specify one. LMA_MEMSPEC is the name of the - load-time region, or null if the statement didn't specify one. - HAVE_LMA_P is TRUE if the statement had an explicit load address. + MEMSPEC is the name of the run-time region, or the value of + DEFAULT_MEMORY_REGION if the statement didn't specify one. + LMA_MEMSPEC is the name of the load-time region, or null if the + statement didn't specify one.HAVE_LMA_P is TRUE if the statement + had an explicit load address. It is an error to specify both a load region and a load address. */ static void -lang_get_regions (region, lma_region, memspec, lma_memspec, have_lma_p) - struct memory_region_struct **region, **lma_region; - const char *memspec, *lma_memspec; - int have_lma_p; -{ - *lma_region = lang_memory_region_lookup (lma_memspec); - - /* If no runtime region has been given, but the load region has - been, use the load region. */ - if (lma_memspec != 0 && strcmp (memspec, "*default*") == 0) +lang_get_regions (lang_memory_region_type **region, + lang_memory_region_type **lma_region, + const char *memspec, + const char *lma_memspec, + bfd_boolean have_lma, + bfd_boolean have_vma) +{ + *lma_region = lang_memory_region_lookup (lma_memspec, FALSE); + + /* If no runtime region or VMA has been specified, but the load region has + been specified, then use the load region for the runtime region as well. */ + if (lma_memspec != NULL + && ! have_vma + && strcmp (memspec, DEFAULT_MEMORY_REGION) == 0) *region = *lma_region; else - *region = lang_memory_region_lookup (memspec); + *region = lang_memory_region_lookup (memspec, FALSE); - if (have_lma_p && lma_memspec != 0) + if (have_lma && lma_memspec != 0) einfo (_("%X%P:%S: section has both a load address and a load region\n")); } void -lang_leave_output_section_statement (fill, memspec, phdrs, lma_memspec) - fill_type *fill; - const char *memspec; - struct lang_output_section_phdr_list *phdrs; - const char *lma_memspec; +lang_leave_output_section_statement (fill_type *fill, const char *memspec, + lang_output_section_phdr_list *phdrs, + const char *lma_memspec) { lang_get_regions (¤t_section->region, ¤t_section->lma_region, memspec, lma_memspec, - current_section->load_base != 0); + current_section->load_base != NULL, + current_section->addr_tree != NULL); current_section->fill = fill; current_section->phdrs = phdrs; stat_ptr = &statement_list; @@ -4686,14 +4547,12 @@ lang_leave_output_section_statement (fill, memspec, phdrs, lma_memspec) If the symbol already exists, then do nothing. */ void -lang_abs_symbol_at_beginning_of (secname, name) - const char *secname; - const char *name; +lang_abs_symbol_at_beginning_of (const char *secname, const char *name) { struct bfd_link_hash_entry *h; h = bfd_link_hash_lookup (link_info.hash, name, TRUE, TRUE, TRUE); - if (h == (struct bfd_link_hash_entry *) NULL) + if (h == NULL) einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n")); if (h->type == bfd_link_hash_new @@ -4704,7 +4563,7 @@ lang_abs_symbol_at_beginning_of (secname, name) h->type = bfd_link_hash_defined; sec = bfd_get_section_by_name (output_bfd, secname); - if (sec == (asection *) NULL) + if (sec == NULL) h->u.def.value = 0; else h->u.def.value = bfd_get_section_vma (output_bfd, sec); @@ -4719,14 +4578,12 @@ lang_abs_symbol_at_beginning_of (secname, name) If the symbol already exists, then do nothing. */ void -lang_abs_symbol_at_end_of (secname, name) - const char *secname; - const char *name; +lang_abs_symbol_at_end_of (const char *secname, const char *name) { struct bfd_link_hash_entry *h; h = bfd_link_hash_lookup (link_info.hash, name, TRUE, TRUE, TRUE); - if (h == (struct bfd_link_hash_entry *) NULL) + if (h == NULL) einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n")); if (h->type == bfd_link_hash_new @@ -4737,22 +4594,20 @@ lang_abs_symbol_at_end_of (secname, name) h->type = bfd_link_hash_defined; sec = bfd_get_section_by_name (output_bfd, secname); - if (sec == (asection *) NULL) + if (sec == NULL) h->u.def.value = 0; else h->u.def.value = (bfd_get_section_vma (output_bfd, sec) - + bfd_section_size (output_bfd, sec) / - bfd_octets_per_byte (output_bfd)); + + TO_ADDR (bfd_section_size (output_bfd, sec))); h->u.def.section = bfd_abs_section_ptr; } } void -lang_statement_append (list, element, field) - lang_statement_list_type *list; - lang_statement_union_type *element; - lang_statement_union_type **field; +lang_statement_append (lang_statement_list_type *list, + lang_statement_union_type *element, + lang_statement_union_type **field) { *(list->tail) = element; list->tail = field; @@ -4761,11 +4616,10 @@ lang_statement_append (list, element, field) /* Set the output format type. -oformat overrides scripts. */ void -lang_add_output_format (format, big, little, from_script) - const char *format; - const char *big; - const char *little; - int from_script; +lang_add_output_format (const char *format, + const char *big, + const char *little, + int from_script) { if (output_target == NULL || !from_script) { @@ -4784,7 +4638,7 @@ lang_add_output_format (format, big, little, from_script) stat_ptr to build new statements within the group. */ void -lang_enter_group () +lang_enter_group (void) { lang_group_statement_type *g; @@ -4799,7 +4653,7 @@ lang_enter_group () but currently they can't. */ void -lang_leave_group () +lang_leave_group (void) { stat_ptr = &statement_list; } @@ -4808,17 +4662,16 @@ lang_leave_group () command in a linker script. */ void -lang_new_phdr (name, type, filehdr, phdrs, at, flags) - const char *name; - etree_type *type; - bfd_boolean filehdr; - bfd_boolean phdrs; - etree_type *at; - etree_type *flags; +lang_new_phdr (const char *name, + etree_type *type, + bfd_boolean filehdr, + bfd_boolean phdrs, + etree_type *at, + etree_type *flags) { struct lang_phdr *n, **pp; - n = (struct lang_phdr *) stat_alloc (sizeof (struct lang_phdr)); + n = stat_alloc (sizeof (struct lang_phdr)); n->next = NULL; n->name = name; n->type = exp_get_value_int (type, 0, "program header type", @@ -4837,16 +4690,16 @@ lang_new_phdr (name, type, filehdr, phdrs, at, flags) should not be calling an ELF specific function here. */ static void -lang_record_phdrs () +lang_record_phdrs (void) { unsigned int alc; asection **secs; - struct lang_output_section_phdr_list *last; + lang_output_section_phdr_list *last; struct lang_phdr *l; lang_statement_union_type *u; alc = 10; - secs = (asection **) xmalloc (alc * sizeof (asection *)); + secs = xmalloc (alc * sizeof (asection *)); last = NULL; for (l = lang_phdr_list; l != NULL; l = l->next) { @@ -4860,7 +4713,7 @@ lang_record_phdrs () u = u->output_section_statement.next) { lang_output_section_statement_type *os; - struct lang_output_section_phdr_list *pl; + lang_output_section_phdr_list *pl; os = &u->output_section_statement; @@ -4886,8 +4739,7 @@ lang_record_phdrs () if (c >= alc) { alc *= 2; - secs = ((asection **) - xrealloc (secs, alc * sizeof (asection *))); + secs = xrealloc (secs, alc * sizeof (asection *)); } secs[c] = os->bfd_section; ++c; @@ -4921,7 +4773,7 @@ lang_record_phdrs () u != NULL; u = u->output_section_statement.next) { - struct lang_output_section_phdr_list *pl; + lang_output_section_phdr_list *pl; if (u->output_section_statement.bfd_section == NULL) continue; @@ -4938,12 +4790,11 @@ lang_record_phdrs () /* Record a list of sections which may not be cross referenced. */ void -lang_add_nocrossref (l) - struct lang_nocrossref *l; +lang_add_nocrossref (lang_nocrossref_type *l) { struct lang_nocrossrefs *n; - n = (struct lang_nocrossrefs *) xmalloc (sizeof *n); + n = xmalloc (sizeof *n); n->next = nocrossref_list; n->list = l; nocrossref_list = n; @@ -4956,6 +4807,8 @@ lang_add_nocrossref (l) /* The overlay virtual address. */ static etree_type *overlay_vma; +/* And subsection alignment. */ +static etree_type *overlay_subalign; /* An expression for the maximum section size seen so far. */ static etree_type *overlay_max; @@ -4972,13 +4825,15 @@ static struct overlay_list *overlay_list; /* Start handling an overlay. */ void -lang_enter_overlay (vma_expr) - etree_type *vma_expr; +lang_enter_overlay (etree_type *vma_expr, etree_type *subalign) { /* The grammar should prevent nested overlays from occurring. */ - ASSERT (overlay_vma == NULL && overlay_max == NULL); + ASSERT (overlay_vma == NULL + && overlay_subalign == NULL + && overlay_max == NULL); overlay_vma = vma_expr; + overlay_subalign = subalign; } /* Start a section in an overlay. We handle this by calling @@ -4986,14 +4841,13 @@ lang_enter_overlay (vma_expr) lang_leave_overlay sets up the LMA and memory regions. */ void -lang_enter_overlay_section (name) - const char *name; +lang_enter_overlay_section (const char *name) { struct overlay_list *n; etree_type *size; lang_enter_output_section_statement (name, overlay_vma, normal_section, - 0, 0, 0, 0); + 0, overlay_subalign, 0); /* If this is the first section, then base the VMA of future sections on this one. This will work correctly even if `.' is @@ -5002,7 +4856,7 @@ lang_enter_overlay_section (name) overlay_vma = exp_nameop (ADDR, name); /* Remember the section. */ - n = (struct overlay_list *) xmalloc (sizeof *n); + n = xmalloc (sizeof *n); n->os = current_section; n->next = overlay_list; overlay_list = n; @@ -5020,9 +4874,8 @@ lang_enter_overlay_section (name) here. */ void -lang_leave_overlay_section (fill, phdrs) - fill_type *fill; - struct lang_output_section_phdr_list *phdrs; +lang_leave_overlay_section (fill_type *fill, + lang_output_section_phdr_list *phdrs) { const char *name; char *clean, *s2; @@ -5031,10 +4884,11 @@ lang_leave_overlay_section (fill, phdrs) name = current_section->name; - /* For now, assume that "*default*" is the run-time memory region and - that no load-time region has been specified. It doesn't really - matter what we say here, since lang_leave_overlay will override it. */ - lang_leave_output_section_statement (fill, "*default*", phdrs, 0); + /* For now, assume that DEFAULT_MEMORY_REGION is the run-time memory + region and that no load-time region has been specified. It doesn't + really matter what we say here, since lang_leave_overlay will + override it. */ + lang_leave_output_section_statement (fill, DEFAULT_MEMORY_REGION, phdrs, 0); /* Define the magic symbols. */ @@ -5064,22 +4918,21 @@ lang_leave_overlay_section (fill, phdrs) looks through all the sections in the overlay and sets them. */ void -lang_leave_overlay (lma_expr, nocrossrefs, fill, memspec, phdrs, lma_memspec) - etree_type *lma_expr; - int nocrossrefs; - fill_type *fill; - const char *memspec; - struct lang_output_section_phdr_list *phdrs; - const char *lma_memspec; +lang_leave_overlay (etree_type *lma_expr, + int nocrossrefs, + fill_type *fill, + const char *memspec, + lang_output_section_phdr_list *phdrs, + const char *lma_memspec) { lang_memory_region_type *region; lang_memory_region_type *lma_region; struct overlay_list *l; - struct lang_nocrossref *nocrossref; + lang_nocrossref_type *nocrossref; lang_get_regions (®ion, &lma_region, memspec, lma_memspec, - lma_expr != 0); + lma_expr != NULL, FALSE); nocrossref = NULL; @@ -5094,7 +4947,7 @@ lang_leave_overlay (lma_expr, nocrossrefs, fill, memspec, phdrs, lma_memspec) { struct overlay_list *next; - if (fill != (fill_type *) 0 && l->os->fill == (fill_type *) 0) + if (fill != NULL && l->os->fill == NULL) l->os->fill = fill; l->os->region = region; @@ -5116,9 +4969,9 @@ lang_leave_overlay (lma_expr, nocrossrefs, fill, memspec, phdrs, lma_memspec) if (nocrossrefs) { - struct lang_nocrossref *nc; + lang_nocrossref_type *nc; - nc = (struct lang_nocrossref *) xmalloc (sizeof *nc); + nc = xmalloc (sizeof *nc); nc->name = l->os->name; nc->next = nocrossref; nocrossref = nc; @@ -5143,97 +4996,181 @@ lang_leave_overlay (lma_expr, nocrossrefs, fill, memspec, phdrs, lma_memspec) struct bfd_elf_version_tree *lang_elf_version_info; -static int -lang_vers_match_lang_c (expr, sym) - struct bfd_elf_version_expr *expr; - const char *sym; -{ - if (expr->pattern[0] == '*' && expr->pattern[1] == '\0') - return 1; - return fnmatch (expr->pattern, sym, 0) == 0; -} +/* If PREV is NULL, return first version pattern matching particular symbol. + If PREV is non-NULL, return first version pattern matching particular + symbol after PREV (previously returned by lang_vers_match). */ -static int -lang_vers_match_lang_cplusplus (expr, sym) - struct bfd_elf_version_expr *expr; - const char *sym; +static struct bfd_elf_version_expr * +lang_vers_match (struct bfd_elf_version_expr_head *head, + struct bfd_elf_version_expr *prev, + const char *sym) { - char *alt_sym; - int result; + const char *cxx_sym = sym; + const char *java_sym = sym; + struct bfd_elf_version_expr *expr = NULL; - if (expr->pattern[0] == '*' && expr->pattern[1] == '\0') - return 1; + if (head->mask & BFD_ELF_VERSION_CXX_TYPE) + { + cxx_sym = cplus_demangle (sym, DMGL_PARAMS | DMGL_ANSI); + if (!cxx_sym) + cxx_sym = sym; + } + if (head->mask & BFD_ELF_VERSION_JAVA_TYPE) + { + java_sym = cplus_demangle (sym, DMGL_JAVA); + if (!java_sym) + java_sym = sym; + } - alt_sym = cplus_demangle (sym, /* DMGL_NO_TPARAMS */ 0); - if (!alt_sym) + if (head->htab && (prev == NULL || prev->symbol)) { - /* cplus_demangle (also) returns NULL when it is not a C++ symbol. - Should we early out FALSE in this case? */ - result = fnmatch (expr->pattern, sym, 0) == 0; + struct bfd_elf_version_expr e; + + switch (prev ? prev->mask : 0) + { + case 0: + if (head->mask & BFD_ELF_VERSION_C_TYPE) + { + e.symbol = sym; + expr = htab_find (head->htab, &e); + while (expr && strcmp (expr->symbol, sym) == 0) + if (expr->mask == BFD_ELF_VERSION_C_TYPE) + goto out_ret; + else + expr = expr->next; + } + /* Fallthrough */ + case BFD_ELF_VERSION_C_TYPE: + if (head->mask & BFD_ELF_VERSION_CXX_TYPE) + { + e.symbol = cxx_sym; + expr = htab_find (head->htab, &e); + while (expr && strcmp (expr->symbol, cxx_sym) == 0) + if (expr->mask == BFD_ELF_VERSION_CXX_TYPE) + goto out_ret; + else + expr = expr->next; + } + /* Fallthrough */ + case BFD_ELF_VERSION_CXX_TYPE: + if (head->mask & BFD_ELF_VERSION_JAVA_TYPE) + { + e.symbol = java_sym; + expr = htab_find (head->htab, &e); + while (expr && strcmp (expr->symbol, java_sym) == 0) + if (expr->mask == BFD_ELF_VERSION_JAVA_TYPE) + goto out_ret; + else + expr = expr->next; + } + /* Fallthrough */ + default: + break; + } } + + /* Finally, try the wildcards. */ + if (prev == NULL || prev->symbol) + expr = head->remaining; else + expr = prev->next; + while (expr) { - result = fnmatch (expr->pattern, alt_sym, 0) == 0; - free (alt_sym); + const char *s; + + if (expr->pattern[0] == '*' && expr->pattern[1] == '\0') + break; + + if (expr->mask == BFD_ELF_VERSION_JAVA_TYPE) + s = java_sym; + else if (expr->mask == BFD_ELF_VERSION_CXX_TYPE) + s = cxx_sym; + else + s = sym; + if (fnmatch (expr->pattern, s, 0) == 0) + break; + expr = expr->next; } - return result; +out_ret: + if (cxx_sym != sym) + free ((char *) cxx_sym); + if (java_sym != sym) + free ((char *) java_sym); + return expr; } -static int -lang_vers_match_lang_java (expr, sym) - struct bfd_elf_version_expr *expr; - const char *sym; +/* Return NULL if the PATTERN argument is a glob pattern, otherwise, + return a string pointing to the symbol name. */ + +static const char * +realsymbol (const char *pattern) { - char *alt_sym; - int result; + const char *p; + bfd_boolean changed = FALSE, backslash = FALSE; + char *s, *symbol = xmalloc (strlen (pattern) + 1); - if (expr->pattern[0] == '*' && expr->pattern[1] == '\0') - return 1; + for (p = pattern, s = symbol; *p != '\0'; ++p) + { + /* It is a glob pattern only if there is no preceding + backslash. */ + if (! backslash && (*p == '?' || *p == '*' || *p == '[')) + { + free (symbol); + return NULL; + } - alt_sym = cplus_demangle (sym, DMGL_JAVA); - if (!alt_sym) + if (backslash) + { + /* Remove the preceding backslash. */ + *(s - 1) = *p; + changed = TRUE; + } + else + *s++ = *p; + + backslash = *p == '\\'; + } + + if (changed) { - /* cplus_demangle (also) returns NULL when it is not a Java symbol. - Should we early out FALSE in this case? */ - result = fnmatch (expr->pattern, sym, 0) == 0; + *s = '\0'; + return symbol; } else { - result = fnmatch (expr->pattern, alt_sym, 0) == 0; - free (alt_sym); + free (symbol); + return pattern; } - - return result; } /* This is called for each variable name or match expression. */ struct bfd_elf_version_expr * -lang_new_vers_pattern (orig, new, lang) - struct bfd_elf_version_expr *orig; - const char *new; - const char *lang; +lang_new_vers_pattern (struct bfd_elf_version_expr *orig, + const char *new, + const char *lang) { struct bfd_elf_version_expr *ret; - ret = (struct bfd_elf_version_expr *) xmalloc (sizeof *ret); + ret = xmalloc (sizeof *ret); ret->next = orig; ret->pattern = new; ret->symver = 0; ret->script = 0; + ret->symbol = realsymbol (new); if (lang == NULL || strcasecmp (lang, "C") == 0) - ret->match = lang_vers_match_lang_c; + ret->mask = BFD_ELF_VERSION_C_TYPE; else if (strcasecmp (lang, "C++") == 0) - ret->match = lang_vers_match_lang_cplusplus; + ret->mask = BFD_ELF_VERSION_CXX_TYPE; else if (strcasecmp (lang, "Java") == 0) - ret->match = lang_vers_match_lang_java; + ret->mask = BFD_ELF_VERSION_JAVA_TYPE; else { einfo (_("%X%P: unknown language `%s' in version information\n"), lang); - ret->match = lang_vers_match_lang_c; + ret->mask = BFD_ELF_VERSION_C_TYPE; } return ldemul_new_vers_pattern (ret); @@ -5243,21 +5180,16 @@ lang_new_vers_pattern (orig, new, lang) expressions. */ struct bfd_elf_version_tree * -lang_new_vers_node (globals, locals) - struct bfd_elf_version_expr *globals; - struct bfd_elf_version_expr *locals; +lang_new_vers_node (struct bfd_elf_version_expr *globals, + struct bfd_elf_version_expr *locals) { struct bfd_elf_version_tree *ret; - ret = (struct bfd_elf_version_tree *) xmalloc (sizeof *ret); - ret->next = NULL; - ret->name = NULL; - ret->vernum = 0; - ret->globals = globals; - ret->locals = locals; - ret->deps = NULL; + ret = xcalloc (1, sizeof *ret); + ret->globals.list = globals; + ret->locals.list = locals; + ret->match = lang_vers_match; ret->name_indx = (unsigned int) -1; - ret->used = 0; return ret; } @@ -5265,14 +5197,109 @@ lang_new_vers_node (globals, locals) static int version_index; +static hashval_t +version_expr_head_hash (const void *p) +{ + const struct bfd_elf_version_expr *e = p; + + return htab_hash_string (e->symbol); +} + +static int +version_expr_head_eq (const void *p1, const void *p2) +{ + const struct bfd_elf_version_expr *e1 = p1; + const struct bfd_elf_version_expr *e2 = p2; + + return strcmp (e1->symbol, e2->symbol) == 0; +} + +static void +lang_finalize_version_expr_head (struct bfd_elf_version_expr_head *head) +{ + size_t count = 0; + struct bfd_elf_version_expr *e, *next; + struct bfd_elf_version_expr **list_loc, **remaining_loc; + + for (e = head->list; e; e = e->next) + { + if (e->symbol) + count++; + head->mask |= e->mask; + } + + if (count) + { + head->htab = htab_create (count * 2, version_expr_head_hash, + version_expr_head_eq, NULL); + list_loc = &head->list; + remaining_loc = &head->remaining; + for (e = head->list; e; e = next) + { + next = e->next; + if (!e->symbol) + { + *remaining_loc = e; + remaining_loc = &e->next; + } + else + { + void **loc = htab_find_slot (head->htab, e, INSERT); + + if (*loc) + { + struct bfd_elf_version_expr *e1, *last; + + e1 = *loc; + last = NULL; + do + { + if (e1->mask == e->mask) + { + last = NULL; + break; + } + last = e1; + e1 = e1->next; + } + while (e1 && strcmp (e1->symbol, e->symbol) == 0); + + if (last == NULL) + { + /* This is a duplicate. */ + /* FIXME: Memory leak. Sometimes pattern is not + xmalloced alone, but in larger chunk of memory. */ + /* free (e->symbol); */ + free (e); + } + else + { + e->next = last->next; + last->next = e; + } + } + else + { + *loc = e; + *list_loc = e; + list_loc = &e->next; + } + } + } + *remaining_loc = NULL; + *list_loc = head->remaining; + } + else + head->remaining = head->list; +} + /* This is called when we know the name and dependencies of the version. */ void -lang_register_vers_node (name, version, deps) - const char *name; - struct bfd_elf_version_tree *version; - struct bfd_elf_version_deps *deps; +lang_register_vers_node (const char *name, + struct bfd_elf_version_tree *version, + struct bfd_elf_version_deps *deps) { struct bfd_elf_version_tree *t, **pp; struct bfd_elf_version_expr *e1; @@ -5293,32 +5320,59 @@ lang_register_vers_node (name, version, deps) if (strcmp (t->name, name) == 0) einfo (_("%X%P: duplicate version tag `%s'\n"), name); + lang_finalize_version_expr_head (&version->globals); + lang_finalize_version_expr_head (&version->locals); + /* Check the global and local match names, and make sure there aren't any duplicates. */ - for (e1 = version->globals; e1 != NULL; e1 = e1->next) + for (e1 = version->globals.list; e1 != NULL; e1 = e1->next) { for (t = lang_elf_version_info; t != NULL; t = t->next) { struct bfd_elf_version_expr *e2; - for (e2 = t->locals; e2 != NULL; e2 = e2->next) - if (strcmp (e1->pattern, e2->pattern) == 0) - einfo (_("%X%P: duplicate expression `%s' in version information\n"), - e1->pattern); + if (t->locals.htab && e1->symbol) + { + e2 = htab_find (t->locals.htab, e1); + while (e2 && strcmp (e1->symbol, e2->symbol) == 0) + { + if (e1->mask == e2->mask) + einfo (_("%X%P: duplicate expression `%s' in version information\n"), + e1->symbol); + e2 = e2->next; + } + } + else if (!e1->symbol) + for (e2 = t->locals.remaining; e2 != NULL; e2 = e2->next) + if (strcmp (e1->pattern, e2->pattern) == 0 && e1->mask == e2->mask) + einfo (_("%X%P: duplicate expression `%s' in version information\n"), + e1->pattern); } } - for (e1 = version->locals; e1 != NULL; e1 = e1->next) + for (e1 = version->locals.list; e1 != NULL; e1 = e1->next) { for (t = lang_elf_version_info; t != NULL; t = t->next) { struct bfd_elf_version_expr *e2; - for (e2 = t->globals; e2 != NULL; e2 = e2->next) - if (strcmp (e1->pattern, e2->pattern) == 0) - einfo (_("%X%P: duplicate expression `%s' in version information\n"), - e1->pattern); + if (t->globals.htab && e1->symbol) + { + e2 = htab_find (t->globals.htab, e1); + while (e2 && strcmp (e1->symbol, e2->symbol) == 0) + { + if (e1->mask == e2->mask) + einfo (_("%X%P: duplicate expression `%s' in version information\n"), + e1->symbol); + e2 = e2->next; + } + } + else if (!e1->symbol) + for (e2 = t->globals.remaining; e2 != NULL; e2 = e2->next) + if (strcmp (e1->pattern, e2->pattern) == 0 && e1->mask == e2->mask) + einfo (_("%X%P: duplicate expression `%s' in version information\n"), + e1->pattern); } } @@ -5340,14 +5394,12 @@ lang_register_vers_node (name, version, deps) /* This is called when we see a version dependency. */ struct bfd_elf_version_deps * -lang_add_vers_depend (list, name) - struct bfd_elf_version_deps *list; - const char *name; +lang_add_vers_depend (struct bfd_elf_version_deps *list, const char *name) { struct bfd_elf_version_deps *ret; struct bfd_elf_version_tree *t; - ret = (struct bfd_elf_version_deps *) xmalloc (sizeof *ret); + ret = xmalloc (sizeof *ret); ret->next = list; for (t = lang_elf_version_info; t != NULL; t = t->next) @@ -5365,7 +5417,7 @@ lang_add_vers_depend (list, name) } static void -lang_do_version_exports_section () +lang_do_version_exports_section (void) { struct bfd_elf_version_expr *greg = NULL, *lreg; @@ -5403,8 +5455,7 @@ lang_do_version_exports_section () } void -lang_add_unique (name) - const char *name; +lang_add_unique (const char *name) { struct unique_sections *ent; @@ -5412,7 +5463,7 @@ lang_add_unique (name) if (strcmp (ent->name, name) == 0) return; - ent = (struct unique_sections *) xmalloc (sizeof *ent); + ent = xmalloc (sizeof *ent); ent->name = xstrdup (name); ent->next = unique_section_list; unique_section_list = ent; diff --git a/gnu/usr.bin/binutils/ld/ldlang.h b/gnu/usr.bin/binutils/ld/ldlang.h index 3c4936b7fa9..649fea16cc4 100644 --- a/gnu/usr.bin/binutils/ld/ldlang.h +++ b/gnu/usr.bin/binutils/ld/ldlang.h @@ -1,6 +1,6 @@ /* ldlang.h - linker command language support Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003 + 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -23,7 +23,10 @@ #ifndef LDLANG_H #define LDLANG_H -typedef enum { +#define DEFAULT_MEMORY_REGION "*default*" + +typedef enum +{ lang_input_file_is_l_enum, lang_input_file_is_symbols_only_enum, lang_input_file_is_marker_enum, @@ -32,17 +35,20 @@ typedef enum { lang_input_file_is_file_enum } lang_input_file_enum_type; -struct _fill_type { +struct _fill_type +{ size_t size; unsigned char data[1]; }; -typedef struct statement_list { +typedef struct statement_list +{ union lang_statement_union *head; union lang_statement_union **tail; } lang_statement_list_type; -typedef struct memory_region_struct { +typedef struct memory_region_struct +{ char *name; struct memory_region_struct *next; bfd_vma origin; @@ -54,9 +60,11 @@ typedef struct memory_region_struct { bfd_boolean had_full_message; } lang_memory_region_type; -typedef struct lang_statement_header_struct { +typedef struct lang_statement_header_struct +{ union lang_statement_union *next; - enum statement_enum { + enum statement_enum + { lang_output_section_statement_enum, lang_assignment_statement_enum, lang_input_statement_enum, @@ -77,24 +85,28 @@ typedef struct lang_statement_header_struct { } type; } lang_statement_header_type; -typedef struct { +typedef struct +{ lang_statement_header_type header; union etree_union *exp; } lang_assignment_statement_type; -typedef struct lang_target_statement_struct { +typedef struct lang_target_statement_struct +{ lang_statement_header_type header; const char *target; } lang_target_statement_type; -typedef struct lang_output_statement_struct { +typedef struct lang_output_statement_struct +{ lang_statement_header_type header; const char *name; } lang_output_statement_type; /* Section types specified in a linker script. */ -enum section_type { +enum section_type +{ normal_section, dsect_section, copy_section, @@ -103,16 +115,18 @@ enum section_type { overlay_section }; -/* This structure holds a list of program headers describing segments - in which this section should be placed. */ +/* This structure holds a list of program headers describing + segments in which this section should be placed. */ -struct lang_output_section_phdr_list { +typedef struct lang_output_section_phdr_list +{ struct lang_output_section_phdr_list *next; const char *name; bfd_boolean used; -}; +} lang_output_section_phdr_list; -typedef struct lang_output_section_statement_struct { +typedef struct lang_output_section_statement_struct +{ lang_statement_header_type header; union etree_union *addr_tree; lang_statement_list_type children; @@ -120,18 +134,18 @@ typedef struct lang_output_section_statement_struct { union lang_statement_union *next; const char *name; - bfd_boolean processed; + int processed; asection *bfd_section; - flagword flags; /* Or together of all input sections */ + flagword flags; /* Or together of all input sections. */ enum section_type sectype; - struct memory_region_struct *region; - struct memory_region_struct *lma_region; + lang_memory_region_type *region; + lang_memory_region_type *lma_region; size_t block_value; fill_type *fill; - int subsection_alignment; /* alignment of components */ - int section_alignment; /* alignment of start of section */ + int subsection_alignment; /* Alignment of components. */ + int section_alignment; /* Alignment of start of section. */ union etree_union *load_base; @@ -141,25 +155,29 @@ typedef struct lang_output_section_statement_struct { to move '.' past all the overlaid sections. */ union etree_union *update_dot_tree; - struct lang_output_section_phdr_list *phdrs; + lang_output_section_phdr_list *phdrs; } lang_output_section_statement_type; -typedef struct { +typedef struct +{ lang_statement_header_type header; } lang_common_statement_type; -typedef struct { +typedef struct +{ lang_statement_header_type header; } lang_object_symbols_statement_type; -typedef struct { +typedef struct +{ lang_statement_header_type header; fill_type *fill; int size; asection *output_section; } lang_fill_statement_type; -typedef struct { +typedef struct +{ lang_statement_header_type header; unsigned int type; union etree_union *exp; @@ -170,7 +188,8 @@ typedef struct { /* Generate a reloc in the output file. */ -typedef struct { +typedef struct +{ lang_statement_header_type header; /* Reloc to generate. */ @@ -179,12 +198,12 @@ typedef struct { /* Reloc howto structure. */ reloc_howto_type *howto; - /* Section to generate reloc against. Exactly one of section and - name must be NULL. */ + /* Section to generate reloc against. + Exactly one of section and name must be NULL. */ asection *section; - /* Name of symbol to generate reloc against. Exactly one of section - and name must be NULL. */ + /* Name of symbol to generate reloc against. + Exactly one of section and name must be NULL. */ const char *name; /* Expression for addend. */ @@ -200,13 +219,14 @@ typedef struct { bfd_vma output_vma; } lang_reloc_statement_type; -typedef struct lang_input_statement_struct { +typedef struct lang_input_statement_struct +{ lang_statement_header_type header; /* Name of this file. */ const char *filename; - /* Name to use for the symbol giving address of text start */ - /* Usually the same as filename, but for a file spec'd with -l - this is the -l switch itself rather than the filename. */ + /* Name to use for the symbol giving address of text start. + Usually the same as filename, but for a file spec'd with + -l this is the -l switch itself rather than the filename. */ const char *local_sym_name; bfd *the_bfd; @@ -220,9 +240,9 @@ typedef struct lang_input_statement_struct { /* Point to the next file - whatever it is, wanders up and down archives */ - union lang_statement_union *next; - /* Point to the next file, but skips archive contents */ + + /* Point to the next file, but skips archive contents. */ union lang_statement_union *next_real_file; bfd_boolean is_archive; @@ -239,12 +259,15 @@ typedef struct lang_input_statement_struct { /* 1 means this is base file of incremental load. Do not load this file's text or data. Also default text_start to after this file's bss. */ - bfd_boolean just_syms_flag; /* Whether to search for this entry as a dynamic archive. */ bfd_boolean dynamic; + /* Whether this entry should cause a DT_NEEDED tag only when + satisfying references from regular files, or always. */ + bfd_boolean as_needed; + /* Whether to include the entire contents of an archive. */ bfd_boolean whole_archive; @@ -257,20 +280,23 @@ typedef struct lang_input_statement_struct { bfd_boolean real; } lang_input_statement_type; -typedef struct { +typedef struct +{ lang_statement_header_type header; asection *section; lang_input_statement_type *ifile; } lang_input_section_type; -typedef struct { +typedef struct +{ lang_statement_header_type header; asection *section; union lang_statement_union *file; } lang_afile_asection_pair_statement_type; -typedef struct lang_wild_statement_struct { +typedef struct lang_wild_statement_struct +{ lang_statement_header_type header; const char *filename; bfd_boolean filenames_sorted; @@ -279,13 +305,15 @@ typedef struct lang_wild_statement_struct { lang_statement_list_type children; } lang_wild_statement_type; -typedef struct lang_address_statement_struct { +typedef struct lang_address_statement_struct +{ lang_statement_header_type header; const char *section_name; union etree_union *address; } lang_address_statement_type; -typedef struct { +typedef struct +{ lang_statement_header_type header; bfd_vma output_offset; size_t size; @@ -298,12 +326,14 @@ typedef struct { symbols are found. The effect is to search a group of libraries as though they were a single library. */ -typedef struct { +typedef struct +{ lang_statement_header_type header; lang_statement_list_type children; } lang_group_statement_type; -typedef union lang_statement_union { +typedef union lang_statement_union +{ lang_statement_header_type header; lang_wild_statement_type wild_statement; lang_data_statement_type data_statement; @@ -326,7 +356,8 @@ typedef union lang_statement_union { /* This structure holds information about a program header, from the PHDRS command in the linker script. */ -struct lang_phdr { +struct lang_phdr +{ struct lang_phdr *next; const char *name; unsigned long type; @@ -339,16 +370,18 @@ struct lang_phdr { /* This structure is used to hold a list of sections which may not cross reference each other. */ -struct lang_nocrossref { +typedef struct lang_nocrossref +{ struct lang_nocrossref *next; const char *name; -}; +} lang_nocrossref_type; /* The list of nocrossref lists. */ -struct lang_nocrossrefs { +struct lang_nocrossrefs +{ struct lang_nocrossrefs *next; - struct lang_nocrossref *list; + lang_nocrossref_type *list; }; extern struct lang_nocrossrefs *nocrossref_list; @@ -356,11 +389,21 @@ extern struct lang_nocrossrefs *nocrossref_list; /* This structure is used to hold a list of input section names which will not match an output section in the linker script. */ -struct unique_sections { +struct unique_sections +{ struct unique_sections *next; const char *name; }; +/* This structure records symbols for which we need to keep track of + definedness for use in the DEFINED () test. */ + +struct lang_definedness_hash_entry +{ + struct bfd_hash_entry root; + int iteration; +}; + extern struct unique_sections *unique_section_list; extern lang_output_section_statement_type *abs_output_section; @@ -375,71 +418,70 @@ extern const char *entry_section; extern bfd_boolean entry_from_cmdline; extern lang_statement_list_type file_chain; +extern int lang_statement_iteration; + extern void lang_init - PARAMS ((void)); -extern struct memory_region_struct *lang_memory_region_lookup - PARAMS ((const char *const)); -extern struct memory_region_struct *lang_memory_region_default - PARAMS ((asection *)); + (void); +extern lang_memory_region_type *lang_memory_region_lookup + (const char *const, bfd_boolean); +extern lang_memory_region_type *lang_memory_region_default + (asection *); extern void lang_map - PARAMS ((void)); + (void); extern void lang_set_flags - PARAMS ((lang_memory_region_type *, const char *, int)); + (lang_memory_region_type *, const char *, int); extern void lang_add_output - PARAMS ((const char *, int from_script)); + (const char *, int from_script); extern lang_output_section_statement_type *lang_enter_output_section_statement - PARAMS ((const char *output_section_statement_name, - etree_type *address_exp, - enum section_type sectype, - bfd_vma block_value, - etree_type *align, - etree_type *subalign, - etree_type *)); + (const char *output_section_statement_name, + etree_type *address_exp, + enum section_type sectype, + etree_type *align, + etree_type *subalign, + etree_type *); extern void lang_final - PARAMS ((void)); + (void); extern void lang_process - PARAMS ((void)); + (void); extern void lang_section_start - PARAMS ((const char *, union etree_union *)); + (const char *, union etree_union *); extern void lang_add_entry - PARAMS ((const char *, bfd_boolean)); + (const char *, bfd_boolean); extern void lang_add_target - PARAMS ((const char *)); + (const char *); extern void lang_add_wild - PARAMS ((struct wildcard_spec *, struct wildcard_list *, bfd_boolean)); + (struct wildcard_spec *, struct wildcard_list *, bfd_boolean); extern void lang_add_map - PARAMS ((const char *)); + (const char *); extern void lang_add_fill - PARAMS ((fill_type *)); -extern lang_assignment_statement_type * lang_add_assignment - PARAMS ((union etree_union *)); + (fill_type *); +extern lang_assignment_statement_type *lang_add_assignment + (union etree_union *); extern void lang_add_attribute - PARAMS ((enum statement_enum)); + (enum statement_enum); extern void lang_startup - PARAMS ((const char *)); + (const char *); extern void lang_float - PARAMS ((bfd_boolean)); + (bfd_boolean); extern void lang_leave_output_section_statement - PARAMS ((fill_type *, const char *, struct lang_output_section_phdr_list *, - const char *)); + (fill_type *, const char *, lang_output_section_phdr_list *, + const char *); extern void lang_abs_symbol_at_end_of - PARAMS ((const char *, const char *)); + (const char *, const char *); extern void lang_abs_symbol_at_beginning_of - PARAMS ((const char *, const char *)); + (const char *, const char *); extern void lang_statement_append - PARAMS ((struct statement_list *, union lang_statement_union *, - union lang_statement_union **)); + (lang_statement_list_type *, lang_statement_union_type *, + lang_statement_union_type **); extern void lang_for_each_input_file - PARAMS ((void (*dothis) (lang_input_statement_type *))); + (void (*dothis) (lang_input_statement_type *)); extern void lang_for_each_file - PARAMS ((void (*dothis) (lang_input_statement_type *))); + (void (*dothis) (lang_input_statement_type *)); extern void lang_reset_memory_regions - PARAMS ((void)); -extern bfd_vma lang_do_assignments - PARAMS ((lang_statement_union_type * s, - lang_output_section_statement_type *output_section_statement, - fill_type *fill, - bfd_vma dot)); + (void); +extern void lang_do_assignments + (lang_statement_union_type *, lang_output_section_statement_type *, + fill_type *, bfd_vma); #define LANG_FOR_EACH_INPUT_STATEMENT(statement) \ lang_input_statement_type *statement; \ @@ -448,80 +490,80 @@ extern bfd_vma lang_do_assignments statement = (lang_input_statement_type *) statement->next) \ extern void lang_process - PARAMS ((void)); + (void); extern void ldlang_add_file - PARAMS ((lang_input_statement_type *)); + (lang_input_statement_type *); extern lang_output_section_statement_type *lang_output_section_find - PARAMS ((const char * const)); + (const char * const); extern lang_input_statement_type *lang_add_input_file - PARAMS ((const char *name, lang_input_file_enum_type file_type, - const char *target)); + (const char *, lang_input_file_enum_type, const char *); extern void lang_add_keepsyms_file - PARAMS ((const char *filename)); + (const char *); extern lang_output_section_statement_type * lang_output_section_statement_lookup - PARAMS ((const char * const name)); + (const char *const); extern void ldlang_add_undef - PARAMS ((const char *const name)); + (const char *const); extern void lang_add_output_format - PARAMS ((const char *, const char *, const char *, int from_script)); + (const char *, const char *, const char *, int); extern void lang_list_init - PARAMS ((lang_statement_list_type*)); + (lang_statement_list_type *); extern void lang_add_data - PARAMS ((int type, union etree_union *)); + (int type, union etree_union *); extern void lang_add_reloc - PARAMS ((bfd_reloc_code_real_type reloc, reloc_howto_type *howto, - asection *section, const char *name, union etree_union *addend)); + (bfd_reloc_code_real_type, reloc_howto_type *, asection *, const char *, + union etree_union *); extern void lang_for_each_statement - PARAMS ((void (*func) (lang_statement_union_type *))); -extern PTR stat_alloc - PARAMS ((size_t size)); + (void (*) (lang_statement_union_type *)); +extern void *stat_alloc + (size_t); extern void dprint_statement - PARAMS ((lang_statement_union_type *, int)); + (lang_statement_union_type *, int); extern bfd_vma lang_size_sections - PARAMS ((lang_statement_union_type *s, - lang_output_section_statement_type *output_section_statement, - lang_statement_union_type **prev, fill_type *fill, - bfd_vma dot, bfd_boolean *relax, bfd_boolean check_regions)); + (lang_statement_union_type *, lang_output_section_statement_type *, + lang_statement_union_type **, fill_type *, bfd_vma, bfd_boolean *, + bfd_boolean); extern void lang_enter_group - PARAMS ((void)); + (void); extern void lang_leave_group - PARAMS ((void)); + (void); extern void lang_add_section - PARAMS ((lang_statement_list_type *ptr, asection *section, - lang_output_section_statement_type *output, - lang_input_statement_type *file)); + (lang_statement_list_type *, asection *, + lang_output_section_statement_type *, lang_input_statement_type *); extern void lang_new_phdr - PARAMS ((const char *, etree_type *, bfd_boolean, bfd_boolean, etree_type *, - etree_type *)); + (const char *, etree_type *, bfd_boolean, bfd_boolean, etree_type *, + etree_type *); extern void lang_add_nocrossref - PARAMS ((struct lang_nocrossref *)); + (lang_nocrossref_type *); extern void lang_enter_overlay - PARAMS ((etree_type *)); + (etree_type *, etree_type *); extern void lang_enter_overlay_section - PARAMS ((const char *)); + (const char *); extern void lang_leave_overlay_section - PARAMS ((fill_type *, struct lang_output_section_phdr_list *)); + (fill_type *, lang_output_section_phdr_list *); extern void lang_leave_overlay - PARAMS ((etree_type *, int, fill_type *, const char *, - struct lang_output_section_phdr_list *, const char *)); + (etree_type *, int, fill_type *, const char *, + lang_output_section_phdr_list *, const char *); extern struct bfd_elf_version_tree *lang_elf_version_info; extern struct bfd_elf_version_expr *lang_new_vers_pattern - PARAMS ((struct bfd_elf_version_expr *, const char *, const char *)); + (struct bfd_elf_version_expr *, const char *, const char *); extern struct bfd_elf_version_tree *lang_new_vers_node - PARAMS ((struct bfd_elf_version_expr *, struct bfd_elf_version_expr *)); + (struct bfd_elf_version_expr *, struct bfd_elf_version_expr *); extern struct bfd_elf_version_deps *lang_add_vers_depend - PARAMS ((struct bfd_elf_version_deps *, const char *)); + (struct bfd_elf_version_deps *, const char *); extern void lang_register_vers_node - PARAMS ((const char *, struct bfd_elf_version_tree *, - struct bfd_elf_version_deps *)); + (const char *, struct bfd_elf_version_tree *, struct bfd_elf_version_deps *); bfd_boolean unique_section_p - PARAMS ((const char *)); + (const char *); extern void lang_add_unique - PARAMS ((const char *)); + (const char *); extern const char *lang_get_output_target - PARAMS ((void)); + (void); +extern void lang_track_definedness (const char *); +extern int lang_symbol_definition_iteration (const char *); +extern void lang_update_definedness + (const char *, struct bfd_link_hash_entry *); #endif diff --git a/gnu/usr.bin/binutils/ld/ldlex.h b/gnu/usr.bin/binutils/ld/ldlex.h index 36f2ad309b9..f956e9c32e0 100644 --- a/gnu/usr.bin/binutils/ld/ldlex.h +++ b/gnu/usr.bin/binutils/ld/ldlex.h @@ -1,5 +1,5 @@ /* ldlex.h - - Copyright 1991, 1992, 1993, 1994, 1995, 1997, 2000 + Copyright 1991, 1992, 1993, 1994, 1995, 1997, 2000, 2003 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -39,25 +39,25 @@ extern unsigned int lineno; extern const char *lex_string; /* In ldlex.l. */ -extern int yylex PARAMS ((void)); -extern void lex_push_file PARAMS ((FILE *, const char *)); -extern void lex_redirect PARAMS ((const char *)); -extern void ldlex_script PARAMS ((void)); -extern void ldlex_mri_script PARAMS ((void)); -extern void ldlex_version_script PARAMS ((void)); -extern void ldlex_version_file PARAMS ((void)); -extern void ldlex_defsym PARAMS ((void)); -extern void ldlex_expression PARAMS ((void)); -extern void ldlex_both PARAMS ((void)); -extern void ldlex_command PARAMS ((void)); -extern void ldlex_popstate PARAMS ((void)); +extern int yylex (void); +extern void lex_push_file (FILE *, const char *); +extern void lex_redirect (const char *); +extern void ldlex_script (void); +extern void ldlex_mri_script (void); +extern void ldlex_version_script (void); +extern void ldlex_version_file (void); +extern void ldlex_defsym (void); +extern void ldlex_expression (void); +extern void ldlex_both (void); +extern void ldlex_command (void); +extern void ldlex_popstate (void); /* In lexsup.c. */ -extern int lex_input PARAMS ((void)); -extern void lex_unput PARAMS ((int)); +extern int lex_input (void); +extern void lex_unput (int); #ifndef yywrap -extern int yywrap PARAMS ((void)); +extern int yywrap (void); #endif -extern void parse_args PARAMS ((unsigned, char **)); +extern void parse_args (unsigned, char **); #endif diff --git a/gnu/usr.bin/binutils/ld/ldlex.l b/gnu/usr.bin/binutils/ld/ldlex.l index c9eb1afe395..aeac817c84f 100644 --- a/gnu/usr.bin/binutils/ld/ldlex.l +++ b/gnu/usr.bin/binutils/ld/ldlex.l @@ -1,7 +1,7 @@ %{ /* Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -26,7 +26,6 @@ This was written by steve chamberlain */ -#include "ansidecl.h" #include <stdio.h> #ifdef MPW @@ -69,7 +68,7 @@ const char *lex_string = NULL; Otherwise, stack elements 0 through `include_stack_ptr - 1' are valid. */ #undef YY_INPUT -#define YY_INPUT(buf,result,max_size) yy_input(buf, &result, max_size) +#define YY_INPUT(buf,result,max_size) yy_input (buf, &result, max_size) #define MAX_INCLUDE_DEPTH 10 static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; @@ -78,14 +77,11 @@ static unsigned int lineno_stack[MAX_INCLUDE_DEPTH]; static unsigned int include_stack_ptr = 0; static int vers_node_nesting = 0; -static YY_BUFFER_STATE yy_create_string_buffer PARAMS ((const char *string, - size_t size)); -static void yy_input PARAMS ((char *, int *result, int max_size)); +static void yy_input (char *, int *, int); +static void comment (void); +static void lex_warn_invalid (char *where, char *what); -static void comment PARAMS ((void)); -static void lex_warn_invalid PARAMS ((char *where, char *what)); - -/* STATES +/* STATES EXPRESSION definitely in an expression SCRIPT definitely in a script BOTH either EXPRESSION or SCRIPT @@ -99,7 +95,7 @@ static void lex_warn_invalid PARAMS ((char *where, char *what)); /* Some versions of flex want this. */ #ifndef yywrap -int yywrap () { return 1; } +int yywrap (void) { return 1; } #endif %} @@ -112,12 +108,12 @@ FILENAMECHAR1 [_a-zA-Z\/\.\\\$\_\~] SYMBOLCHARN [_a-zA-Z\/\.\\\$\_\~0-9] FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~] WILDCHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~\?\*] -WHITE [ \t\n\r]+ +WHITE [ \t\n\r]+ NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~] V_TAG [.$_a-zA-Z][._a-zA-Z0-9]* -V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)* +V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* %s SCRIPT %s EXPRESSION @@ -144,24 +140,24 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)* } } -<BOTH,SCRIPT,EXPRESSION,VERS_START,VERS_NODE,VERS_SCRIPT>"/*" { comment(); } +<BOTH,SCRIPT,EXPRESSION,VERS_START,VERS_NODE,VERS_SCRIPT>"/*" { comment (); } <DEFSYMEXP>"-" { RTOKEN('-');} <DEFSYMEXP>"+" { RTOKEN('+');} -<DEFSYMEXP>{FILENAMECHAR1}{SYMBOLCHARN}* { yylval.name = xstrdup(yytext); return NAME; } +<DEFSYMEXP>{FILENAMECHAR1}{SYMBOLCHARN}* { yylval.name = xstrdup (yytext); return NAME; } <DEFSYMEXP>"=" { RTOKEN('='); } <MRI,EXPRESSION>"$"([0-9A-Fa-f])+ { - yylval.integer = bfd_scan_vma (yytext+1, 0,16); - yylval.bigint.str = (char *) 0; + yylval.integer = bfd_scan_vma (yytext + 1, 0, 16); + yylval.bigint.str = NULL; return INT; } <MRI,EXPRESSION>([0-9A-Fa-f])+(H|h|X|x|B|b|O|o|D|d) { int ibase ; - switch (yytext[yyleng-1]) { - case 'X': + switch (yytext[yyleng - 1]) { + case 'X': case 'x': case 'H': case 'h': @@ -180,7 +176,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)* } yylval.integer = bfd_scan_vma (yytext, 0, ibase); - yylval.bigint.str = (char *) 0; + yylval.bigint.str = NULL; return INT; } <SCRIPT,DEFSYMEXP,MRI,BOTH,EXPRESSION>((("$"|0[xX])([0-9A-Fa-f])+)|(([0-9])+))(M|K|m|k)? { @@ -193,14 +189,14 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)* ibase = 16; } yylval.integer = bfd_scan_vma (s, 0, ibase); - yylval.bigint.str = (char *) 0; - if (yytext[yyleng-1] == 'M' - || yytext[yyleng-1] == 'm') + yylval.bigint.str = NULL; + if (yytext[yyleng - 1] == 'M' + || yytext[yyleng - 1] == 'm') { yylval.integer *= 1024 * 1024; } - else if (yytext[yyleng-1] == 'K' - || yytext[yyleng-1]=='k') + else if (yytext[yyleng - 1] == 'K' + || yytext[yyleng - 1]=='k') { yylval.integer *= 1024; } @@ -310,6 +306,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)* <BOTH,SCRIPT>"INCLUDE" { RTOKEN(INCLUDE);} <BOTH,SCRIPT>"PHDRS" { RTOKEN (PHDRS); } <EXPRESSION,BOTH,SCRIPT>"AT" { RTOKEN(AT);} +<EXPRESSION,BOTH,SCRIPT>"SUBALIGN" { RTOKEN(SUBALIGN);} <EXPRESSION,BOTH,SCRIPT>"PROVIDE" { RTOKEN(PROVIDE); } <EXPRESSION,BOTH,SCRIPT>"KEEP" { RTOKEN(KEEP); } <EXPRESSION,BOTH,SCRIPT>"EXCLUDE_FILE" { RTOKEN(EXCLUDE_FILE); } @@ -355,13 +352,13 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)* <MRI>{FILENAMECHAR1}{NOCFILENAMECHAR}* { /* Filename without commas, needed to parse mri stuff */ - yylval.name = xstrdup(yytext); + yylval.name = xstrdup (yytext); return NAME; } <BOTH,EXPRESSION>{FILENAMECHAR1}{FILENAMECHAR}* { - yylval.name = xstrdup(yytext); + yylval.name = xstrdup (yytext); return NAME; } <BOTH,EXPRESSION>"-l"{FILENAMECHAR}+ { @@ -375,12 +372,12 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)* try again. */ if (yytext[0] == '/' && yytext[1] == '*') { - yyless(2); + yyless (2); comment (); } else { - yylval.name = xstrdup(yytext); + yylval.name = xstrdup (yytext); return NAME; } } @@ -388,8 +385,8 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)* <EXPRESSION,BOTH,SCRIPT,VERS_NODE>"\""[^\"]*"\"" { /* No matter the state, quotes give what's inside */ - yylval.name = xstrdup(yytext+1); - yylval.name[yyleng-2] = 0; + yylval.name = xstrdup (yytext + 1); + yylval.name[yyleng - 2] = 0; return NAME; } <BOTH,SCRIPT,EXPRESSION>"\n" { lineno++;} @@ -411,7 +408,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)* <VERS_START>"{" { BEGIN(VERS_SCRIPT); return *yytext; } -<VERS_SCRIPT>"{" { BEGIN(VERS_NODE); +<VERS_SCRIPT>"{" { BEGIN(VERS_NODE); vers_node_nesting = 0; return *yytext; } @@ -430,14 +427,14 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)* <<EOF>> { include_stack_ptr--; - - if (include_stack_ptr == 0) + + if (include_stack_ptr == 0) { - yyterminate(); + yyterminate (); } - else + else { - yy_switch_to_buffer(include_stack[include_stack_ptr]); + yy_switch_to_buffer (include_stack[include_stack_ptr]); } ldfile_input_filename = file_name_stack[include_stack_ptr - 1]; @@ -446,9 +443,9 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)* return END; } -<SCRIPT,MRI,VERS_START,VERS_SCRIPT,VERS_NODE>. lex_warn_invalid(" in script", yytext); -<EXPRESSION,DEFSYMEXP,BOTH>. lex_warn_invalid(" in expression", yytext); - +<SCRIPT,MRI,VERS_START,VERS_SCRIPT,VERS_NODE>. lex_warn_invalid (" in script", yytext); +<EXPRESSION,DEFSYMEXP,BOTH>. lex_warn_invalid (" in expression", yytext); + %% @@ -456,13 +453,11 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?.$_a-zA-Z0-9\[\]\-\!\^]|::)* saving the current input info on the include stack. */ void -lex_push_file (file, name) - FILE *file; - const char *name; +lex_push_file (FILE *file, const char *name) { - if (include_stack_ptr >= MAX_INCLUDE_DEPTH) + if (include_stack_ptr >= MAX_INCLUDE_DEPTH) { - einfo("%F:includes nested too deeply\n"); + einfo ("%F:includes nested too deeply\n"); } file_name_stack[include_stack_ptr] = name; lineno_stack[include_stack_ptr] = lineno; @@ -471,27 +466,25 @@ lex_push_file (file, name) include_stack_ptr++; lineno = 1; yyin = file; - yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); + yy_switch_to_buffer (yy_create_buffer (yyin, YY_BUF_SIZE)); } /* Return a newly created flex input buffer containing STRING, which is SIZE bytes long. */ -static YY_BUFFER_STATE -yy_create_string_buffer (string, size) - const char *string; - size_t size; +static YY_BUFFER_STATE +yy_create_string_buffer (const char *string, size_t size) { YY_BUFFER_STATE b; /* Calls to m-alloc get turned by sed into xm-alloc. */ - b = (YY_BUFFER_STATE) malloc (sizeof (struct yy_buffer_state)); + b = malloc (sizeof (struct yy_buffer_state)); b->yy_input_file = 0; b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) malloc ((unsigned) (b->yy_buf_size + 3)); + b->yy_ch_buf = malloc ((unsigned) (b->yy_buf_size + 3)); b->yy_ch_buf[0] = '\n'; strcpy (b->yy_ch_buf+1, string); @@ -520,13 +513,12 @@ yy_create_string_buffer (string, size) on the include stack. */ void -lex_redirect (string) - const char *string; +lex_redirect (const char *string) { YY_BUFFER_STATE tmp; yy_init = 0; - if (include_stack_ptr >= MAX_INCLUDE_DEPTH) + if (include_stack_ptr >= MAX_INCLUDE_DEPTH) { einfo("%F: macros nested too deeply\n"); } @@ -546,56 +538,56 @@ static int state_stack[MAX_INCLUDE_DEPTH * 2]; static int *state_stack_p = state_stack; void -ldlex_script () +ldlex_script (void) { *(state_stack_p)++ = yy_start; BEGIN (SCRIPT); } void -ldlex_mri_script () +ldlex_mri_script (void) { *(state_stack_p)++ = yy_start; BEGIN (MRI); } void -ldlex_version_script () +ldlex_version_script (void) { *(state_stack_p)++ = yy_start; BEGIN (VERS_START); } void -ldlex_version_file () +ldlex_version_file (void) { *(state_stack_p)++ = yy_start; BEGIN (VERS_SCRIPT); } void -ldlex_defsym () +ldlex_defsym (void) { *(state_stack_p)++ = yy_start; BEGIN (DEFSYMEXP); } - + void -ldlex_expression () +ldlex_expression (void) { *(state_stack_p)++ = yy_start; BEGIN (EXPRESSION); } void -ldlex_both () +ldlex_both (void) { *(state_stack_p)++ = yy_start; BEGIN (BOTH); } void -ldlex_popstate () +ldlex_popstate (void) { yy_start = *(--state_stack_p); } @@ -605,18 +597,15 @@ ldlex_popstate () either the number of characters read, or 0 to indicate EOF. */ static void -yy_input (buf, result, max_size) - char *buf; - int *result; - int max_size; +yy_input (char *buf, int *result, int max_size) { - *result = 0; + *result = 0; if (YY_CURRENT_BUFFER->yy_input_file) { if (yyin) { - *result = fread ((char *) buf, 1, max_size, yyin); - if (*result < max_size && ferror (yyin)) + *result = fread (buf, 1, max_size, yyin); + if (*result < max_size && ferror (yyin)) einfo ("%F%P: read in flex scanner failed\n"); } } @@ -625,14 +614,14 @@ yy_input (buf, result, max_size) /* Eat the rest of a C-style comment. */ static void -comment () +comment (void) { int c; while (1) { c = input(); - while (c != '*' && c != EOF) + while (c != '*' && c != EOF) { if (c == '\n') lineno++; @@ -663,8 +652,7 @@ comment () in context WHERE. */ static void -lex_warn_invalid (where, what) - char *where, *what; +lex_warn_invalid (char *where, char *what) { char buf[5]; diff --git a/gnu/usr.bin/binutils/ld/ldmain.c b/gnu/usr.bin/binutils/ld/ldmain.c index 0b78f475f7e..a5387abf0d7 100644 --- a/gnu/usr.bin/binutils/ld/ldmain.c +++ b/gnu/usr.bin/binutils/ld/ldmain.c @@ -1,6 +1,6 @@ /* Main program of GNU linker. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003 + 2002, 2003, 2004 Free Software Foundation, Inc. Written by Steve Chamberlain steve@cygnus.com @@ -51,7 +51,7 @@ #ifdef HAVE_SBRK #ifdef NEED_DECLARATION_SBRK -extern PTR sbrk (); +extern void *sbrk (); #endif #endif @@ -59,8 +59,6 @@ extern PTR sbrk (); #define TARGET_SYSTEM_ROOT "" #endif -int main PARAMS ((int, char **)); - /* EXPORTS */ char *default_target; @@ -95,6 +93,10 @@ bfd_boolean version_printed; /* Nonzero means link in every member of an archive. */ bfd_boolean whole_archive; +/* Nonzero means create DT_NEEDED entries only if a dynamic library + actually satisfies some reference in a regular object. */ +bfd_boolean as_needed; + /* TRUE if we should demangle symbol names. */ bfd_boolean demangling; @@ -103,45 +105,40 @@ args_type command_line; ld_config_type config; static char *get_emulation - PARAMS ((int, char **)); + (int, char **); static void set_scripts_dir - PARAMS ((void)); -static void remove_output - PARAMS ((void)); -static bfd_boolean check_for_scripts_dir - PARAMS ((char *)); + (void); static bfd_boolean add_archive_element - PARAMS ((struct bfd_link_info *, bfd *, const char *)); + (struct bfd_link_info *, bfd *, const char *); static bfd_boolean multiple_definition - PARAMS ((struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma, - bfd *, asection *, bfd_vma)); + (struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma, + bfd *, asection *, bfd_vma); static bfd_boolean multiple_common - PARAMS ((struct bfd_link_info *, const char *, bfd *, - enum bfd_link_hash_type, bfd_vma, bfd *, enum bfd_link_hash_type, - bfd_vma)); + (struct bfd_link_info *, const char *, bfd *, enum bfd_link_hash_type, + bfd_vma, bfd *, enum bfd_link_hash_type, bfd_vma); static bfd_boolean add_to_set - PARAMS ((struct bfd_link_info *, struct bfd_link_hash_entry *, - bfd_reloc_code_real_type, bfd *, asection *, bfd_vma)); + (struct bfd_link_info *, struct bfd_link_hash_entry *, + bfd_reloc_code_real_type, bfd *, asection *, bfd_vma); static bfd_boolean constructor_callback - PARAMS ((struct bfd_link_info *, bfd_boolean, const char *, bfd *, - asection *, bfd_vma)); + (struct bfd_link_info *, bfd_boolean, const char *, bfd *, + asection *, bfd_vma); static bfd_boolean warning_callback - PARAMS ((struct bfd_link_info *, const char *, const char *, bfd *, - asection *, bfd_vma)); + (struct bfd_link_info *, const char *, const char *, bfd *, + asection *, bfd_vma); static void warning_find_reloc - PARAMS ((bfd *, asection *, PTR)); + (bfd *, asection *, void *); static bfd_boolean undefined_symbol - PARAMS ((struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma, - bfd_boolean)); + (struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma, + bfd_boolean); static bfd_boolean reloc_overflow - PARAMS ((struct bfd_link_info *, const char *, const char *, bfd_vma, - bfd *, asection *, bfd_vma)); + (struct bfd_link_info *, const char *, const char *, bfd_vma, + bfd *, asection *, bfd_vma); static bfd_boolean reloc_dangerous - PARAMS ((struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma)); + (struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma); static bfd_boolean unattached_reloc - PARAMS ((struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma)); + (struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma); static bfd_boolean notice - PARAMS ((struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma)); + (struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma); static struct bfd_link_callbacks link_callbacks = { @@ -162,21 +159,19 @@ static struct bfd_link_callbacks link_callbacks = struct bfd_link_info link_info; static void -remove_output () +remove_output (void) { if (output_filename) { - if (output_bfd && output_bfd->iostream) - fclose ((FILE *) (output_bfd->iostream)); + if (output_bfd) + bfd_cache_close (output_bfd); if (delete_output_file_on_failure) unlink (output_filename); } } int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { char *emulation; long start_time = get_run_time (); @@ -287,17 +282,19 @@ main (argc, argv) interface by default. */ demangling = getenv ("COLLECT_NO_DEMANGLE") == NULL; - link_info.relocateable = FALSE; + link_info.relocatable = FALSE; link_info.emitrelocations = FALSE; link_info.task_link = FALSE; link_info.shared = FALSE; + link_info.pie = FALSE; + link_info.executable = FALSE; link_info.symbolic = FALSE; link_info.export_dynamic = FALSE; link_info.static_link = FALSE; link_info.traditional_format = FALSE; link_info.optimize = FALSE; - link_info.no_undefined = FALSE; - link_info.allow_shlib_undefined = TRUE; + link_info.unresolved_syms_in_objects = RM_NOT_YET_SET; + link_info.unresolved_syms_in_shared_libs = RM_NOT_YET_SET; link_info.allow_multiple_definition = FALSE; link_info.allow_undefined_version = TRUE; link_info.keep_memory = TRUE; @@ -323,13 +320,12 @@ main (argc, argv) and _fini symbols. We are compatible. */ link_info.init_function = "_init"; link_info.fini_function = "_fini"; - link_info.mpc860c0 = 0; link_info.pei386_auto_import = -1; link_info.pei386_runtime_pseudo_reloc = FALSE; link_info.spare_dynamic_tags = 5; - link_info.flags = (bfd_vma) 0; - link_info.flags_1 = (bfd_vma) 0; - link_info.relax_finalizing = FALSE; + link_info.flags = 0; + link_info.flags_1 = 0; + link_info.need_relax_finalize = FALSE; ldfile_add_arch (""); @@ -349,12 +345,10 @@ main (argc, argv) ldemul_set_symbols (); - if (link_info.relocateable) + if (link_info.relocatable) { if (command_line.gc_sections) einfo ("%P%F: --gc-sections and -r may not be used together\n"); - if (link_info.mpc860c0) - einfo (_("%P%F: -r and --mpc860c0 may not be used together\n")); else if (command_line.relax) einfo (_("%P%F: --relax and -r may not be used together\n")); if (link_info.shared) @@ -369,10 +363,13 @@ main (argc, argv) einfo (_("%P%F: -f may not be used without -shared\n")); } + if (! link_info.shared || link_info.pie) + link_info.executable = TRUE; + /* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols). I don't see how else this can be handled, since in this case we must preserve all externally visible symbols. */ - if (link_info.relocateable && link_info.strip == strip_all) + if (link_info.relocatable && link_info.strip == strip_all) { link_info.strip = strip_debugger; if (link_info.discard == discard_sec_merge) @@ -471,7 +468,7 @@ main (argc, argv) /* Print error messages for any missing symbols, for any warning symbols, and possibly multiple definitions. */ - if (link_info.relocateable) + if (link_info.relocatable) output_bfd->flags &= ~EXEC_P; else output_bfd->flags |= EXEC_P; @@ -485,9 +482,9 @@ main (argc, argv) if (nocrossref_list != NULL) check_nocrossrefs (); - /* Even if we're producing relocateable output, some non-fatal errors should + /* Even if we're producing relocatable output, some non-fatal errors should be reported in the exit status. (What non-fatal errors, if any, do we - want to ignore for relocateable output?) */ + want to ignore for relocatable output?) */ if (!config.make_executable && !force_make_executable) { if (trace_files) @@ -505,7 +502,7 @@ main (argc, argv) /* If the --force-exe-suffix is enabled, and we're making an executable file and it doesn't end in .exe, copy it to one which does. */ - if (! link_info.relocateable && command_line.force_exe_suffix) + if (! link_info.relocatable && command_line.force_exe_suffix) { int len = strlen (output_filename); @@ -526,9 +523,11 @@ main (argc, argv) dst = fopen (dst_name, FOPEN_WB); if (!src) - einfo (_("%X%P: unable to open for source of copy `%s'\n"), output_filename); + einfo (_("%X%P: unable to open for source of copy `%s'\n"), + output_filename); if (!dst) - einfo (_("%X%P: unable to open for destination of copy `%s'\n"), dst_name); + einfo (_("%X%P: unable to open for destination of copy `%s'\n"), + dst_name); while ((l = fread (buf, 1, bsize, src)) > 0) { int done = fwrite (buf, 1, l, dst); @@ -551,7 +550,7 @@ main (argc, argv) if (config.stats) { #ifdef HAVE_SBRK - char *lim = (char *) sbrk (0); + char *lim = sbrk (0); #endif long run_time = get_run_time () - start_time; @@ -574,9 +573,7 @@ main (argc, argv) state that's needed by the lex&yacc argument parser (parse_args). */ static char * -get_emulation (argc, argv) - int argc; - char **argv; +get_emulation (int argc, char **argv) { char *emulation; int i; @@ -607,7 +604,8 @@ get_emulation (argc, argv) || strcmp (argv[i], "-mips5") == 0 || strcmp (argv[i], "-mips32") == 0 || strcmp (argv[i], "-mips32r2") == 0 - || strcmp (argv[i], "-mips64") == 0) + || strcmp (argv[i], "-mips64") == 0 + || strcmp (argv[i], "-mips64r2") == 0) { /* FIXME: The arguments -mips1, -mips2, -mips3, etc. are passed to the linker by some MIPS compilers. They @@ -639,8 +637,7 @@ get_emulation (argc, argv) else return FALSE. */ static bfd_boolean -check_for_scripts_dir (dir) - char *dir; +check_for_scripts_dir (char *dir) { size_t dirlen; char *buf; @@ -649,7 +646,7 @@ check_for_scripts_dir (dir) dirlen = strlen (dir); /* sizeof counts the terminating NUL. */ - buf = (char *) xmalloc (dirlen + sizeof ("/ldscripts")); + buf = xmalloc (dirlen + sizeof ("/ldscripts")); sprintf (buf, "%s/ldscripts", dir); res = stat (buf, &s) == 0 && S_ISDIR (s.st_mode); @@ -671,7 +668,7 @@ check_for_scripts_dir (dir) (for installing the tool suite elsewhere). */ static void -set_scripts_dir () +set_scripts_dir (void) { char *end, *dir; size_t dirlen; @@ -719,7 +716,7 @@ set_scripts_dir () dirlen = end - program_name; /* Make a copy of program_name in dir. Leave room for later "/../lib". */ - dir = (char *) xmalloc (dirlen + 8); + dir = xmalloc (dirlen + 8); strncpy (dir, program_name, dirlen); dir[dirlen] = '\0'; @@ -736,34 +733,29 @@ set_scripts_dir () } void -add_ysym (name) - const char *name; +add_ysym (const char *name) { - if (link_info.notice_hash == (struct bfd_hash_table *) NULL) + if (link_info.notice_hash == NULL) { - link_info.notice_hash = ((struct bfd_hash_table *) - xmalloc (sizeof (struct bfd_hash_table))); + link_info.notice_hash = xmalloc (sizeof (struct bfd_hash_table)); if (! bfd_hash_table_init_n (link_info.notice_hash, bfd_hash_newfunc, 61)) einfo (_("%P%F: bfd_hash_table_init failed: %E\n")); } - if (bfd_hash_lookup (link_info.notice_hash, name, TRUE, TRUE) - == (struct bfd_hash_entry *) NULL) + if (bfd_hash_lookup (link_info.notice_hash, name, TRUE, TRUE) == NULL) einfo (_("%P%F: bfd_hash_lookup failed: %E\n")); } /* Record a symbol to be wrapped, from the --wrap option. */ void -add_wrap (name) - const char *name; +add_wrap (const char *name) { if (link_info.wrap_hash == NULL) { - link_info.wrap_hash = ((struct bfd_hash_table *) - xmalloc (sizeof (struct bfd_hash_table))); + link_info.wrap_hash = xmalloc (sizeof (struct bfd_hash_table)); if (! bfd_hash_table_init_n (link_info.wrap_hash, bfd_hash_newfunc, 61)) @@ -777,8 +769,7 @@ add_wrap (name) /* Handle the -retain-symbols-file option. */ void -add_keepsyms_file (filename) - const char *filename; +add_keepsyms_file (const char *filename) { FILE *file; char *buf; @@ -789,20 +780,19 @@ add_keepsyms_file (filename) einfo (_("%X%P: error: duplicate retain-symbols-file\n")); file = fopen (filename, "r"); - if (file == (FILE *) NULL) + if (file == NULL) { bfd_set_error (bfd_error_system_call); einfo ("%X%P: %s: %E\n", filename); return; } - link_info.keep_hash = ((struct bfd_hash_table *) - xmalloc (sizeof (struct bfd_hash_table))); + link_info.keep_hash = xmalloc (sizeof (struct bfd_hash_table)); if (! bfd_hash_table_init (link_info.keep_hash, bfd_hash_newfunc)) einfo (_("%P%F: bfd_hash_table_init failed: %E\n")); bufsize = 100; - buf = (char *) xmalloc (bufsize); + buf = xmalloc (bufsize); c = getc (file); while (c != EOF) @@ -828,8 +818,7 @@ add_keepsyms_file (filename) buf[len] = '\0'; - if (bfd_hash_lookup (link_info.keep_hash, buf, TRUE, TRUE) - == (struct bfd_hash_entry *) NULL) + if (bfd_hash_lookup (link_info.keep_hash, buf, TRUE, TRUE) == NULL) einfo (_("%P%F: bfd_hash_lookup for insertion failed: %E\n")); } } @@ -847,15 +836,13 @@ add_keepsyms_file (filename) a link. */ static bfd_boolean -add_archive_element (info, abfd, name) - struct bfd_link_info *info ATTRIBUTE_UNUSED; - bfd *abfd; - const char *name; +add_archive_element (struct bfd_link_info *info ATTRIBUTE_UNUSED, + bfd *abfd, + const char *name) { lang_input_statement_type *input; - input = ((lang_input_statement_type *) - xmalloc (sizeof (lang_input_statement_type))); + input = xmalloc (sizeof (lang_input_statement_type)); input->filename = abfd->filename; input->local_sym_name = abfd->filename; input->the_bfd = abfd; @@ -873,7 +860,7 @@ add_archive_element (info, abfd, name) ldlang_add_file (input); - if (config.map_file != (FILE *) NULL) + if (config.map_file != NULL) { static bfd_boolean header_printed; struct bfd_link_hash_entry *h; @@ -960,15 +947,14 @@ add_archive_element (info, abfd, name) multiple times. */ static bfd_boolean -multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval) - struct bfd_link_info *info ATTRIBUTE_UNUSED; - const char *name; - bfd *obfd; - asection *osec; - bfd_vma oval; - bfd *nbfd; - asection *nsec; - bfd_vma nval; +multiple_definition (struct bfd_link_info *info ATTRIBUTE_UNUSED, + const char *name, + bfd *obfd, + asection *osec, + bfd_vma oval, + bfd *nbfd, + asection *nsec, + bfd_vma nval) { /* If either section has the output_section field set to bfd_abs_section_ptr, it means that the section is being @@ -985,7 +971,7 @@ multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval) einfo (_("%X%C: multiple definition of `%T'\n"), nbfd, nsec, nval, name); - if (obfd != (bfd *) NULL) + if (obfd != NULL) einfo (_("%D: first defined here\n"), obfd, osec, oval); if (command_line.relax) @@ -1003,15 +989,14 @@ multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval) -warn-common was used. */ static bfd_boolean -multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize) - struct bfd_link_info *info ATTRIBUTE_UNUSED; - const char *name; - bfd *obfd; - enum bfd_link_hash_type otype; - bfd_vma osize; - bfd *nbfd; - enum bfd_link_hash_type ntype; - bfd_vma nsize; +multiple_common (struct bfd_link_info *info ATTRIBUTE_UNUSED, + const char *name, + bfd *obfd, + enum bfd_link_hash_type otype, + bfd_vma osize, + bfd *nbfd, + enum bfd_link_hash_type ntype, + bfd_vma nsize) { if (! config.warn_common) return TRUE; @@ -1069,13 +1054,12 @@ multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize) represent a value which should be added to the set. */ static bfd_boolean -add_to_set (info, h, reloc, abfd, section, value) - struct bfd_link_info *info ATTRIBUTE_UNUSED; - struct bfd_link_hash_entry *h; - bfd_reloc_code_real_type reloc; - bfd *abfd; - asection *section; - bfd_vma value; +add_to_set (struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_hash_entry *h, + bfd_reloc_code_real_type reloc, + bfd *abfd, + asection *section, + bfd_vma value) { if (config.warn_constructors) einfo (_("%P: warning: global constructor %s used\n"), @@ -1084,7 +1068,7 @@ add_to_set (info, h, reloc, abfd, section, value) if (! config.build_constructors) return TRUE; - ldctor_add_set_entry (h, reloc, (const char *) NULL, section, value); + ldctor_add_set_entry (h, reloc, NULL, section, value); if (h->type == bfd_link_hash_new) { @@ -1104,13 +1088,12 @@ add_to_set (info, h, reloc, abfd, section, value) adding an element to a set, but less general. */ static bfd_boolean -constructor_callback (info, constructor, name, abfd, section, value) - struct bfd_link_info *info; - bfd_boolean constructor; - const char *name; - bfd *abfd; - asection *section; - bfd_vma value; +constructor_callback (struct bfd_link_info *info, + bfd_boolean constructor, + const char *name, + bfd *abfd, + asection *section, + bfd_vma value) { char *s; struct bfd_link_hash_entry *h; @@ -1125,7 +1108,7 @@ constructor_callback (info, constructor, name, abfd, section, value) /* Ensure that BFD_RELOC_CTOR exists now, so that we can give a useful error message. */ if (bfd_reloc_type_lookup (output_bfd, BFD_RELOC_CTOR) == NULL - && (link_info.relocateable + && (link_info.relocatable || bfd_reloc_type_lookup (abfd, BFD_RELOC_CTOR) == NULL)) einfo (_("%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n")); @@ -1167,13 +1150,12 @@ struct warning_callback_info /* This is called when there is a reference to a warning symbol. */ static bfd_boolean -warning_callback (info, warning, symbol, abfd, section, address) - struct bfd_link_info *info ATTRIBUTE_UNUSED; - const char *warning; - const char *symbol; - bfd *abfd; - asection *section; - bfd_vma address; +warning_callback (struct bfd_link_info *info ATTRIBUTE_UNUSED, + const char *warning, + const char *symbol, + bfd *abfd, + asection *section, + bfd_vma address) { /* This is a hack to support warn_multiple_gp. FIXME: This should have a cleaner interface, but what? */ @@ -1206,7 +1188,7 @@ warning_callback (info, warning, symbol, abfd, section, address) symsize = bfd_get_symtab_upper_bound (abfd); if (symsize < 0) einfo (_("%B%F: could not read symbols: %E\n"), abfd); - asymbols = (asymbol **) xmalloc (symsize); + asymbols = xmalloc (symsize); symbol_count = bfd_canonicalize_symtab (abfd, asymbols); if (symbol_count < 0) einfo (_("%B%F: could not read symbols: %E\n"), abfd); @@ -1221,7 +1203,7 @@ warning_callback (info, warning, symbol, abfd, section, address) info.warning = warning; info.symbol = symbol; info.asymbols = asymbols; - bfd_map_over_sections (abfd, warning_find_reloc, (PTR) &info); + bfd_map_over_sections (abfd, warning_find_reloc, &info); if (! info.found) einfo ("%B: %s\n", abfd, warning); @@ -1239,12 +1221,9 @@ warning_callback (info, warning, symbol, abfd, section, address) to give an error message with a file and line number. */ static void -warning_find_reloc (abfd, sec, iarg) - bfd *abfd; - asection *sec; - PTR iarg; +warning_find_reloc (bfd *abfd, asection *sec, void *iarg) { - struct warning_callback_info *info = (struct warning_callback_info *) iarg; + struct warning_callback_info *info = iarg; long relsize; arelent **relpp; long relcount; @@ -1259,7 +1238,7 @@ warning_find_reloc (abfd, sec, iarg) if (relsize == 0) return; - relpp = (arelent **) xmalloc (relsize); + relpp = xmalloc (relsize); relcount = bfd_canonicalize_reloc (abfd, sec, relpp, info->asymbols); if (relcount < 0) einfo (_("%B%F: could not read relocs: %E\n"), abfd); @@ -1287,13 +1266,12 @@ warning_find_reloc (abfd, sec, iarg) /* This is called when an undefined symbol is found. */ static bfd_boolean -undefined_symbol (info, name, abfd, section, address, fatal) - struct bfd_link_info *info ATTRIBUTE_UNUSED; - const char *name; - bfd *abfd; - asection *section; - bfd_vma address; - bfd_boolean fatal ATTRIBUTE_UNUSED; +undefined_symbol (struct bfd_link_info *info ATTRIBUTE_UNUSED, + const char *name, + bfd *abfd, + asection *section, + bfd_vma address, + bfd_boolean error) { static char *error_name; static unsigned int error_count; @@ -1307,8 +1285,7 @@ undefined_symbol (info, name, abfd, section, address, fatal) /* Only warn once about a particular undefined symbol. */ if (hash == NULL) { - hash = ((struct bfd_hash_table *) - xmalloc (sizeof (struct bfd_hash_table))); + hash = xmalloc (sizeof (struct bfd_hash_table)); if (! bfd_hash_table_init (hash, bfd_hash_newfunc)) einfo (_("%F%P: bfd_hash_table_init failed: %E\n")); } @@ -1322,13 +1299,13 @@ undefined_symbol (info, name, abfd, section, address, fatal) /* We never print more than a reasonable number of errors in a row for a single symbol. */ - if (error_name != (char *) NULL + if (error_name != NULL && strcmp (name, error_name) == 0) ++error_count; else { error_count = 0; - if (error_name != (char *) NULL) + if (error_name != NULL) free (error_name); error_name = xstrdup (name); } @@ -1337,48 +1314,87 @@ undefined_symbol (info, name, abfd, section, address, fatal) { if (error_count < MAX_ERRORS_IN_A_ROW) { - einfo (_("%C: undefined reference to `%T'\n"), - abfd, section, address, name); - if (fatal) - einfo ("%X"); + if (error) + einfo (_("%X%C: undefined reference to `%T'\n"), + abfd, section, address, name); + else + einfo (_("%C: warning: undefined reference to `%T'\n"), + abfd, section, address, name); } else if (error_count == MAX_ERRORS_IN_A_ROW) - einfo (_("%D: more undefined references to `%T' follow\n"), - abfd, section, address, name); + { + if (error) + einfo (_("%X%D: more undefined references to `%T' follow\n"), + abfd, section, address, name); + else + einfo (_("%D: warning: more undefined references to `%T' follow\n"), + abfd, section, address, name); + } + else if (error) + einfo ("%X"); } else { if (error_count < MAX_ERRORS_IN_A_ROW) { - einfo (_("%B: undefined reference to `%T'\n"), - abfd, name); - if (fatal) - einfo ("%X"); + if (error) + einfo (_("%X%B: undefined reference to `%T'\n"), + abfd, name); + else + einfo (_("%B: warning: undefined reference to `%T'\n"), + abfd, name); } else if (error_count == MAX_ERRORS_IN_A_ROW) - einfo (_("%B: more undefined references to `%T' follow\n"), - abfd, name); + { + if (error) + einfo (_("%X%B: more undefined references to `%T' follow\n"), + abfd, name); + else + einfo (_("%B: warning: more undefined references to `%T' follow\n"), + abfd, name); + } + else if (error) + einfo ("%X"); } return TRUE; } +/* Counter to limit the number of relocation overflow error messages + to print. Errors are printed as it is decremented. When it's + called and the counter is zero, a final message is printed + indicating more relocations were omitted. When it gets to -1, no + such errors are printed. If it's initially set to a value less + than -1, all such errors will be printed (--verbose does this). */ + +int overflow_cutoff_limit = 10; + /* This is called when a reloc overflows. */ static bfd_boolean -reloc_overflow (info, name, reloc_name, addend, abfd, section, address) - struct bfd_link_info *info ATTRIBUTE_UNUSED; - const char *name; - const char *reloc_name; - bfd_vma addend; - bfd *abfd; - asection *section; - bfd_vma address; +reloc_overflow (struct bfd_link_info *info ATTRIBUTE_UNUSED, + const char *name, + const char *reloc_name, + bfd_vma addend, + bfd *abfd, + asection *section, + bfd_vma address) { - if (abfd == (bfd *) NULL) + if (overflow_cutoff_limit == -1) + return TRUE; + + if (abfd == NULL) einfo (_("%P%X: generated")); else einfo ("%X%C:", abfd, section, address); + + if (overflow_cutoff_limit >= 0 + && overflow_cutoff_limit-- == 0) + { + einfo (_(" additional relocation overflows omitted from the output\n")); + return TRUE; + } + einfo (_(" relocation truncated to fit: %s %T"), reloc_name, name); if (addend != 0) einfo ("+%v", addend); @@ -1389,14 +1405,13 @@ reloc_overflow (info, name, reloc_name, addend, abfd, section, address) /* This is called when a dangerous relocation is made. */ static bfd_boolean -reloc_dangerous (info, message, abfd, section, address) - struct bfd_link_info *info ATTRIBUTE_UNUSED; - const char *message; - bfd *abfd; - asection *section; - bfd_vma address; +reloc_dangerous (struct bfd_link_info *info ATTRIBUTE_UNUSED, + const char *message, + bfd *abfd, + asection *section, + bfd_vma address) { - if (abfd == (bfd *) NULL) + if (abfd == NULL) einfo (_("%P%X: generated")); else einfo ("%X%C:", abfd, section, address); @@ -1408,14 +1423,13 @@ reloc_dangerous (info, message, abfd, section, address) that is not being output. */ static bfd_boolean -unattached_reloc (info, name, abfd, section, address) - struct bfd_link_info *info ATTRIBUTE_UNUSED; - const char *name; - bfd *abfd; - asection *section; - bfd_vma address; +unattached_reloc (struct bfd_link_info *info ATTRIBUTE_UNUSED, + const char *name, + bfd *abfd, + asection *section, + bfd_vma address) { - if (abfd == (bfd *) NULL) + if (abfd == NULL) einfo (_("%P%X: generated")); else einfo ("%X%C:", abfd, section, address); @@ -1428,12 +1442,11 @@ unattached_reloc (info, name, abfd, section, address) using the -y option. */ static bfd_boolean -notice (info, name, abfd, section, value) - struct bfd_link_info *info; - const char *name; - bfd *abfd; - asection *section; - bfd_vma value; +notice (struct bfd_link_info *info, + const char *name, + bfd *abfd, + asection *section, + bfd_vma value) { if (! info->notice_all || (info->notice_hash != NULL diff --git a/gnu/usr.bin/binutils/ld/ldmain.h b/gnu/usr.bin/binutils/ld/ldmain.h index d21b3fdbca9..8cab5fe1f22 100644 --- a/gnu/usr.bin/binutils/ld/ldmain.h +++ b/gnu/usr.bin/binutils/ld/ldmain.h @@ -1,5 +1,5 @@ /* ldmain.h - - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2002, 2003 + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -32,13 +32,15 @@ extern bfd_boolean trace_files; extern bfd_boolean trace_file_tries; extern bfd_boolean version_printed; extern bfd_boolean whole_archive; +extern bfd_boolean as_needed; extern bfd_boolean demangling; extern int g_switch_value; extern const char *output_filename; extern struct bfd_link_info link_info; +extern int overflow_cutoff_limit; -extern void add_ysym PARAMS ((const char *)); -extern void add_wrap PARAMS ((const char *)); -extern void add_keepsyms_file PARAMS ((const char *)); +extern void add_ysym (const char *); +extern void add_wrap (const char *); +extern void add_keepsyms_file (const char *); #endif diff --git a/gnu/usr.bin/binutils/ld/ldmisc.c b/gnu/usr.bin/binutils/ld/ldmisc.c index a2e496da9c0..def598d639a 100644 --- a/gnu/usr.bin/binutils/ld/ldmisc.c +++ b/gnu/usr.bin/binutils/ld/ldmisc.c @@ -22,16 +22,11 @@ 02111-1307, USA. */ #include "bfd.h" +#include "bfdlink.h" #include "sysdep.h" #include "libiberty.h" #include "demangle.h" - -#ifdef ANSI_PROTOTYPES #include <stdarg.h> -#else -#include <varargs.h> -#endif - #include "ld.h" #include "ldmisc.h" #include "ldexp.h" @@ -41,8 +36,6 @@ #include "ldmain.h" #include "ldfile.h" -static void vfinfo PARAMS ((FILE *, const char *, va_list)); - /* %% literal % %F error is fatal @@ -66,10 +59,7 @@ static void vfinfo PARAMS ((FILE *, const char *, va_list)); */ static void -vfinfo (fp, fmt, arg) - FILE *fp; - const char *fmt; - va_list arg; +vfinfo (FILE *fp, const char *fmt, va_list arg) { bfd_boolean fatal = FALSE; @@ -125,7 +115,7 @@ vfinfo (fp, fmt, arg) case 'W': /* hex bfd_vma with 0x with no leading zeroes taking up - 8 spaces. */ + 8 spaces. */ { char buf[100]; bfd_vma value; @@ -153,7 +143,7 @@ vfinfo (fp, fmt, arg) { const char *name = va_arg (arg, const char *); - if (name == (const char *) NULL || *name == 0) + if (name == NULL || *name == 0) fprintf (fp, _("no symbol")); else if (! demangling) fprintf (fp, "%s", name); @@ -268,7 +258,7 @@ vfinfo (fp, fmt, arg) symsize = bfd_get_symtab_upper_bound (abfd); if (symsize < 0) einfo (_("%B%F: could not read symbols\n"), abfd); - asymbols = (asymbol **) xmalloc (symsize); + asymbols = xmalloc (symsize); symbol_count = bfd_canonicalize_symtab (abfd, asymbols); if (symbol_count < 0) einfo (_("%B%F: could not read symbols\n"), abfd); @@ -377,8 +367,7 @@ vfinfo (fp, fmt, arg) other such chars that would otherwise confuse the demangler. */ char * -demangle (name) - const char *name; +demangle (const char *name) { char *res; const char *p; @@ -419,34 +408,32 @@ demangle (name) /* Format info message and print on stdout. */ /* (You would think this should be called just "info", but then you - would hosed by LynxOS, which defines that name in its libc.) */ + would be hosed by LynxOS, which defines that name in its libc.) */ void -info_msg VPARAMS ((const char *fmt, ...)) +info_msg (const char *fmt, ...) { - VA_OPEN (arg, fmt); - VA_FIXEDARG (arg, const char *, fmt); + va_list arg; + va_start (arg, fmt); vfinfo (stdout, fmt, arg); - VA_CLOSE (arg); + va_end (arg); } /* ('e' for error.) Format info message and print on stderr. */ void -einfo VPARAMS ((const char *fmt, ...)) +einfo (const char *fmt, ...) { - VA_OPEN (arg, fmt); - VA_FIXEDARG (arg, const char *, fmt); + va_list arg; + va_start (arg, fmt); vfinfo (stderr, fmt, arg); - VA_CLOSE (arg); + va_end (arg); } void -info_assert (file, line) - const char *file; - unsigned int line; +info_assert (const char *file, unsigned int line) { einfo (_("%F%P: internal error %s %d\n"), file, line); } @@ -454,36 +441,35 @@ info_assert (file, line) /* ('m' for map) Format info message and print on map. */ void -minfo VPARAMS ((const char *fmt, ...)) +minfo (const char *fmt, ...) { - VA_OPEN (arg, fmt); - VA_FIXEDARG (arg, const char *, fmt); + va_list arg; + va_start (arg, fmt); vfinfo (config.map_file, fmt, arg); - VA_CLOSE (arg); + va_end (arg); } void -lfinfo VPARAMS ((FILE *file, const char *fmt, ...)) +lfinfo (FILE *file, const char *fmt, ...) { - VA_OPEN (arg, fmt); - VA_FIXEDARG (arg, FILE *, file); - VA_FIXEDARG (arg, const char *, fmt); + va_list arg; + va_start (arg, fmt); vfinfo (file, fmt, arg); - VA_CLOSE (arg); + va_end (arg); } /* Functions to print the link map. */ void -print_space () +print_space (void) { fprintf (config.map_file, " "); } void -print_nl () +print_nl (void) { fprintf (config.map_file, "\n"); } @@ -492,10 +478,7 @@ print_nl () call this function. */ void -ld_abort (file, line, fn) - const char *file; - int line; - const char *fn; +ld_abort (const char *file, int line, const char *fn) { if (fn != NULL) einfo (_("%P: internal error: aborting at %s line %d in %s\n"), @@ -508,12 +491,62 @@ ld_abort (file, line, fn) } bfd_boolean -error_handler VPARAMS ((int id ATTRIBUTE_UNUSED, const char *fmt, ...)) +error_handler (int id, const char *fmt, ...) { - VA_OPEN (arg, fmt); - VA_FIXEDARG (arg, const char *, fmt); + va_list arg; + + va_start (arg, fmt); + switch (id) + { + default: + break; + + /* We can be called with + + error_handler (-LD_DEFINITION_IN_DISCARDED_SECTION, "", 0); + + to make this error non-fatal and + + error_handler (-LD_DEFINITION_IN_DISCARDED_SECTION, "", 1); + + to make this error fatal. */ + case -LD_DEFINITION_IN_DISCARDED_SECTION: + case LD_DEFINITION_IN_DISCARDED_SECTION: + { + static struct bfd_hash_table *hash; + static int fatal = 1; + const char *name; + + if (id == -LD_DEFINITION_IN_DISCARDED_SECTION) + { + fatal = va_arg (arg, int); + goto out; + } + + name = va_arg (arg, const char *); + /* Only warn once about a particular undefined symbol. */ + if (hash == NULL) + { + hash = xmalloc (sizeof (struct bfd_hash_table)); + if (! bfd_hash_table_init (hash, bfd_hash_newfunc)) + einfo (_("%F%P: bfd_hash_table_init failed: %E\n")); + } + + if (bfd_hash_lookup (hash, name, FALSE, FALSE) != NULL) + goto out; + + if (bfd_hash_lookup (hash, name, TRUE, TRUE) == NULL) + einfo (_("%F%P: bfd_hash_lookup failed: %E\n")); + + if (fatal) + config.make_executable = FALSE; + } + break; + } vfinfo (stderr, fmt, arg); - VA_CLOSE (arg); + +out: + va_end (arg); return TRUE; } diff --git a/gnu/usr.bin/binutils/ld/ldmisc.h b/gnu/usr.bin/binutils/ld/ldmisc.h index c03ed973dc5..b2812fbd828 100644 --- a/gnu/usr.bin/binutils/ld/ldmisc.h +++ b/gnu/usr.bin/binutils/ld/ldmisc.h @@ -1,5 +1,5 @@ /* ldmisc.h - - Copyright 1991, 1992, 1993, 1994, 1996, 1997, 2001 + Copyright 1991, 1992, 1993, 1994, 1996, 1997, 2001, 2003 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -22,16 +22,16 @@ #ifndef LDMISC_H #define LDMISC_H -extern bfd_boolean error_handler PARAMS ((int, const char *, ...)); -extern void einfo PARAMS ((const char *, ...)); -extern void minfo PARAMS ((const char *, ...)); -extern void info_msg PARAMS ((const char *, ...)); -extern void lfinfo PARAMS ((FILE *, const char *, ...)); -extern void info_assert PARAMS ((const char *, unsigned int)); -extern void yyerror PARAMS ((const char *)); -extern PTR xmalloc PARAMS ((size_t)); -extern PTR xrealloc PARAMS ((PTR, size_t)); -extern void xexit PARAMS ((int)); +extern bfd_boolean error_handler (int, const char *, ...); +extern void einfo (const char *, ...); +extern void minfo (const char *, ...); +extern void info_msg (const char *, ...); +extern void lfinfo (FILE *, const char *, ...); +extern void info_assert (const char *, unsigned int); +extern void yyerror (const char *); +extern void *xmalloc (size_t); +extern void *xrealloc (void *, size_t); +extern void xexit (int); #define ASSERT(x) \ do { if (!(x)) info_assert(__FILE__,__LINE__); } while (0) @@ -39,8 +39,8 @@ do { if (!(x)) info_assert(__FILE__,__LINE__); } while (0) #define FAIL() \ do { info_assert(__FILE__,__LINE__); } while (0) -extern void print_space PARAMS ((void)); -extern void print_nl PARAMS ((void)); -extern char *demangle PARAMS ((const char *)); +extern void print_space (void); +extern void print_nl (void); +extern char *demangle (const char *); #endif diff --git a/gnu/usr.bin/binutils/ld/ldver.c b/gnu/usr.bin/binutils/ld/ldver.c index e6c7b090a89..710bf909ba5 100644 --- a/gnu/usr.bin/binutils/ld/ldver.c +++ b/gnu/usr.bin/binutils/ld/ldver.c @@ -32,8 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ldmain.h" void -ldversion (noisy) - int noisy; +ldversion (int noisy) { /* Output for noisy == 2 is intended to follow the GNU standards. */ fprintf (stdout, _("GNU ld version %s\n"), BFD_VERSION_STRING); diff --git a/gnu/usr.bin/binutils/ld/ldver.h b/gnu/usr.bin/binutils/ld/ldver.h index ef069374679..fd840a8b55d 100644 --- a/gnu/usr.bin/binutils/ld/ldver.h +++ b/gnu/usr.bin/binutils/ld/ldver.h @@ -1,5 +1,5 @@ /* ldver.h -- Header file for ldver.c. - Copyright 1991, 1992, 1993, 1996 Free Software Foundation, Inc. + Copyright 1991, 1992, 1993, 1996, 2003 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -17,4 +17,4 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -void ldversion PARAMS ((int)); +void ldversion (int); diff --git a/gnu/usr.bin/binutils/ld/ldwrite.c b/gnu/usr.bin/binutils/ld/ldwrite.c index cbd879dc7e8..e4bec32cac8 100644 --- a/gnu/usr.bin/binutils/ld/ldwrite.c +++ b/gnu/usr.bin/binutils/ld/ldwrite.c @@ -1,5 +1,5 @@ /* ldwrite.c -- write out the linked file - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002 + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc. Written by Steve Chamberlain sac@cygnus.com @@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "bfdlink.h" #include "libiberty.h" +#include "safe-ctype.h" #include "ld.h" #include "ldexp.h" @@ -32,15 +33,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <ldgram.h> #include "ldmain.h" -static void build_link_order PARAMS ((lang_statement_union_type *)); -static asection *clone_section PARAMS ((bfd *, asection *, const char *, int *)); -static void split_sections PARAMS ((bfd *, struct bfd_link_info *)); - /* Build link_order structures for the BFD linker. */ static void -build_link_order (statement) - lang_statement_union_type *statement; +build_link_order (lang_statement_union_type *statement) { switch (statement->header.type) { @@ -60,7 +56,7 @@ build_link_order (statement) link_order->type = bfd_data_link_order; link_order->offset = statement->data_statement.output_vma; - link_order->u.data.contents = (bfd_byte *) xmalloc (QUAD_SIZE); + link_order->u.data.contents = xmalloc (QUAD_SIZE); value = statement->data_statement.value; @@ -197,9 +193,7 @@ build_link_order (statement) link_order->offset = rs->output_vma; link_order->size = bfd_get_reloc_size (rs->howto); - link_order->u.reloc.p = - ((struct bfd_link_order_reloc *) - xmalloc (sizeof (struct bfd_link_order_reloc))); + link_order->u.reloc.p = xmalloc (sizeof (struct bfd_link_order_reloc)); link_order->u.reloc.p->reloc = rs->reloc; link_order->u.reloc.p->addend = rs->addend_value; @@ -292,9 +286,24 @@ build_link_order (statement) } } -/* Call BFD to write out the linked file. */ +/* Return true if NAME is the name of an unsplittable section. These + are the stabs strings, dwarf strings. */ -/**********************************************************************/ +static bfd_boolean +unsplittable_name (const char *name) +{ + if (strncmp (name, ".stab", 5) == 0) + { + /* There are several stab like string sections. We pattern match on + ".stab...str" */ + unsigned len = strlen (name); + if (strcmp (&name[len-3], "str") == 0) + return TRUE; + } + else if (strcmp (name, "$GDB_STRINGS$") == 0) + return TRUE; + return FALSE; +} /* Wander around the input sections, make sure that we'll never try and create an output section with more relocs @@ -302,22 +311,43 @@ build_link_order (statement) creating new output sections with all the right bits. */ #define TESTIT 1 static asection * -clone_section (abfd, s, name, count) - bfd *abfd; - asection *s; - const char *name; - int *count; +clone_section (bfd *abfd, asection *s, const char *name, int *count) { - char templ[6]; + char *tname; char *sname; + unsigned int len; asection *n; struct bfd_link_hash_entry *h; - /* Invent a section name from the first five chars of the base - section name and a digit suffix. */ - strncpy (templ, name, sizeof (templ) - 1); - templ[sizeof (templ) - 1] = '\0'; - if ((sname = bfd_get_unique_section_name (abfd, templ, count)) == NULL + /* Invent a section name from the section name and a dotted numeric + suffix. */ + len = strlen (name); + tname = xmalloc (len + 1); + memcpy (tname, name, len + 1); + /* Remove a dotted number suffix, from a previous split link. */ + while (len && ISDIGIT (tname[len-1])) + len--; + if (len > 1 && tname[len-1] == '.') + /* It was a dotted number. */ + tname[len-1] = 0; + + /* We want to use the whole of the original section name for the + split name, but coff can be restricted to 8 character names. */ + if (bfd_family_coff (abfd) && strlen (tname) > 5) + { + /* Some section names cannot be truncated, as the name is + used to locate some other section. */ + if (strncmp (name, ".stab", 5) == 0 + || strcmp (name, "$GDB_SYMBOLS$") == 0) + { + einfo (_ ("%F%P: cannot create split section name for %s\n"), name); + /* Silence gcc warnings. einfo exits, so we never reach here. */ + return NULL; + } + tname[5] = 0; + } + + if ((sname = bfd_get_unique_section_name (abfd, tname, count)) == NULL || (n = bfd_make_section_anyway (abfd, sname)) == NULL || (h = bfd_link_hash_lookup (link_info.hash, sname, TRUE, TRUE, FALSE)) == NULL) @@ -326,7 +356,8 @@ clone_section (abfd, s, name, count) /* Silence gcc warnings. einfo exits, so we never reach here. */ return NULL; } - + free (tname); + /* Set up section symbol. */ h->type = bfd_link_hash_defined; h->u.def.value = 0; @@ -348,8 +379,7 @@ clone_section (abfd, s, name, count) #if TESTING static void -ds (s) - asection *s; +ds (asection *s) { struct bfd_link_order *l = s->link_order_head; printf ("vma %x size %x\n", s->vma, s->_raw_size); @@ -368,10 +398,7 @@ ds (s) printf ("\n"); } -dump (s, a1, a2) - char *s; - asection *a1; - asection *a2; +dump (char *s, asection *a1, asection *a2) { printf ("%s\n", s); ds (a1); @@ -379,8 +406,7 @@ dump (s, a1, a2) } static void -sanity_check (abfd) - bfd *abfd; +sanity_check (bfd *abfd) { asection *s; for (s = abfd->sections; s; s = s->next) @@ -403,9 +429,7 @@ sanity_check (abfd) #endif static void -split_sections (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +split_sections (bfd *abfd, struct bfd_link_info *info) { asection *original_sec; int nsecs = abfd->section_count; @@ -441,7 +465,7 @@ split_sections (abfd, info) || info->strip == strip_some) thislines = sec->lineno_count; - if (info->relocateable) + if (info->relocatable) thisrelocs = sec->reloc_count; if (sec->_cooked_size != 0) @@ -450,7 +474,7 @@ split_sections (abfd, info) thissize = sec->_raw_size; } - else if (info->relocateable + else if (info->relocatable && (p->type == bfd_section_reloc_link_order || p->type == bfd_symbol_reloc_link_order)) thisrelocs++; @@ -458,7 +482,8 @@ split_sections (abfd, info) if (l != NULL && (thisrelocs + relocs >= config.split_by_reloc || thislines + lines >= config.split_by_reloc - || thissize + sec_size >= config.split_by_file)) + || (thissize + sec_size >= config.split_by_file)) + && !unsplittable_name (cursor->name)) { /* Create a new section and put this link order and the following link orders into it. */ @@ -524,10 +549,10 @@ split_sections (abfd, info) sanity_check (abfd); } -/**********************************************************************/ +/* Call BFD to write out the linked file. */ void -ldwrite () +ldwrite (void) { /* Reset error indicator, which can typically something like invalid format from opening up the .o files. */ diff --git a/gnu/usr.bin/binutils/ld/ldwrite.h b/gnu/usr.bin/binutils/ld/ldwrite.h index 68d8b52db0a..13617c0a4e7 100644 --- a/gnu/usr.bin/binutils/ld/ldwrite.h +++ b/gnu/usr.bin/binutils/ld/ldwrite.h @@ -1,5 +1,5 @@ /* ldwrite.h - - Copyright 1991, 1992, 1993 Free Software Foundation, Inc. + Copyright 1991, 1992, 1993, 2003 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -void ldwrite PARAMS ((void)); +void ldwrite (void); diff --git a/gnu/usr.bin/binutils/ld/lexsup.c b/gnu/usr.bin/binutils/ld/lexsup.c index c219366961b..a1a67be880d 100644 --- a/gnu/usr.bin/binutils/ld/lexsup.c +++ b/gnu/usr.bin/binutils/ld/lexsup.c @@ -1,6 +1,6 @@ /* Parse options for the GNU linker. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003 + 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -53,91 +53,97 @@ #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif -static int is_num PARAMS ((const char *, int, int, int)); -static void set_default_dirlist PARAMS ((char *)); -static void set_section_start PARAMS ((char *, char *)); -static void help PARAMS ((void)); +static void set_default_dirlist (char *); +static void set_section_start (char *, char *); +static void help (void); /* Non-zero if we are processing a --defsym from the command line. */ int parsing_defsym = 0; /* Codes used for the long options with no short synonyms. 150 isn't special; it's just an arbitrary non-ASCII char value. */ - -#define OPTION_ASSERT 150 -#define OPTION_CALL_SHARED (OPTION_ASSERT + 1) -#define OPTION_CREF (OPTION_CALL_SHARED + 1) -#define OPTION_DEFSYM (OPTION_CREF + 1) -#define OPTION_DEMANGLE (OPTION_DEFSYM + 1) -#define OPTION_DYNAMIC_LINKER (OPTION_DEMANGLE + 1) -#define OPTION_EB (OPTION_DYNAMIC_LINKER + 1) -#define OPTION_EL (OPTION_EB + 1) -#define OPTION_EMBEDDED_RELOCS (OPTION_EL + 1) -#define OPTION_EXPORT_DYNAMIC (OPTION_EMBEDDED_RELOCS + 1) -#define OPTION_HELP (OPTION_EXPORT_DYNAMIC + 1) -#define OPTION_IGNORE (OPTION_HELP + 1) -#define OPTION_MAP (OPTION_IGNORE + 1) -#define OPTION_NO_DEMANGLE (OPTION_MAP + 1) -#define OPTION_NO_KEEP_MEMORY (OPTION_NO_DEMANGLE + 1) -#define OPTION_NO_WARN_MISMATCH (OPTION_NO_KEEP_MEMORY + 1) -#define OPTION_NOINHIBIT_EXEC (OPTION_NO_WARN_MISMATCH + 1) -#define OPTION_NON_SHARED (OPTION_NOINHIBIT_EXEC + 1) -#define OPTION_NO_WHOLE_ARCHIVE (OPTION_NON_SHARED + 1) -#define OPTION_OFORMAT (OPTION_NO_WHOLE_ARCHIVE + 1) -#define OPTION_RELAX (OPTION_OFORMAT + 1) -#define OPTION_RETAIN_SYMBOLS_FILE (OPTION_RELAX + 1) -#define OPTION_RPATH (OPTION_RETAIN_SYMBOLS_FILE + 1) -#define OPTION_RPATH_LINK (OPTION_RPATH + 1) -#define OPTION_SHARED (OPTION_RPATH_LINK + 1) -#define OPTION_SONAME (OPTION_SHARED + 1) -#define OPTION_SORT_COMMON (OPTION_SONAME + 1) -#define OPTION_STATS (OPTION_SORT_COMMON + 1) -#define OPTION_SYMBOLIC (OPTION_STATS + 1) -#define OPTION_TASK_LINK (OPTION_SYMBOLIC + 1) -#define OPTION_TBSS (OPTION_TASK_LINK + 1) -#define OPTION_TDATA (OPTION_TBSS + 1) -#define OPTION_TTEXT (OPTION_TDATA + 1) -#define OPTION_TRADITIONAL_FORMAT (OPTION_TTEXT + 1) -#define OPTION_UR (OPTION_TRADITIONAL_FORMAT + 1) -#define OPTION_VERBOSE (OPTION_UR + 1) -#define OPTION_VERSION (OPTION_VERBOSE + 1) -#define OPTION_VERSION_SCRIPT (OPTION_VERSION + 1) -#define OPTION_VERSION_EXPORTS_SECTION (OPTION_VERSION_SCRIPT + 1) -#define OPTION_WARN_COMMON (OPTION_VERSION_EXPORTS_SECTION + 1) -#define OPTION_WARN_CONSTRUCTORS (OPTION_WARN_COMMON + 1) -#define OPTION_WARN_FATAL (OPTION_WARN_CONSTRUCTORS + 1) -#define OPTION_WARN_MULTIPLE_GP (OPTION_WARN_FATAL + 1) -#define OPTION_WARN_ONCE (OPTION_WARN_MULTIPLE_GP + 1) -#define OPTION_WARN_SECTION_ALIGN (OPTION_WARN_ONCE + 1) -#define OPTION_SPLIT_BY_RELOC (OPTION_WARN_SECTION_ALIGN + 1) -#define OPTION_SPLIT_BY_FILE (OPTION_SPLIT_BY_RELOC + 1) -#define OPTION_WHOLE_ARCHIVE (OPTION_SPLIT_BY_FILE + 1) -#define OPTION_WRAP (OPTION_WHOLE_ARCHIVE + 1) -#define OPTION_FORCE_EXE_SUFFIX (OPTION_WRAP + 1) -#define OPTION_GC_SECTIONS (OPTION_FORCE_EXE_SUFFIX + 1) -#define OPTION_NO_GC_SECTIONS (OPTION_GC_SECTIONS + 1) -#define OPTION_CHECK_SECTIONS (OPTION_NO_GC_SECTIONS + 1) -#define OPTION_NO_CHECK_SECTIONS (OPTION_CHECK_SECTIONS + 1) -#define OPTION_MPC860C0 (OPTION_NO_CHECK_SECTIONS + 1) -#define OPTION_NO_UNDEFINED (OPTION_MPC860C0 + 1) -#define OPTION_INIT (OPTION_NO_UNDEFINED + 1) -#define OPTION_FINI (OPTION_INIT + 1) -#define OPTION_SECTION_START (OPTION_FINI + 1) -#define OPTION_UNIQUE (OPTION_SECTION_START + 1) -#define OPTION_TARGET_HELP (OPTION_UNIQUE + 1) -#define OPTION_ALLOW_SHLIB_UNDEFINED (OPTION_TARGET_HELP + 1) -#define OPTION_NO_ALLOW_SHLIB_UNDEFINED (OPTION_ALLOW_SHLIB_UNDEFINED + 1) -#define OPTION_ALLOW_MULTIPLE_DEFINITION (OPTION_NO_ALLOW_SHLIB_UNDEFINED + 1) -#define OPTION_NO_UNDEFINED_VERSION (OPTION_ALLOW_MULTIPLE_DEFINITION + 1) -#define OPTION_DISCARD_NONE (OPTION_NO_UNDEFINED_VERSION + 1) -#define OPTION_SPARE_DYNAMIC_TAGS (OPTION_DISCARD_NONE + 1) -#define OPTION_NO_DEFINE_COMMON (OPTION_SPARE_DYNAMIC_TAGS + 1) -#define OPTION_NOSTDLIB (OPTION_NO_DEFINE_COMMON + 1) -#define OPTION_NO_OMAGIC (OPTION_NOSTDLIB + 1) -#define OPTION_STRIP_DISCARDED (OPTION_NO_OMAGIC + 1) -#define OPTION_NO_STRIP_DISCARDED (OPTION_STRIP_DISCARDED + 1) -#define OPTION_ACCEPT_UNKNOWN_INPUT_ARCH (OPTION_NO_STRIP_DISCARDED + 1) -#define OPTION_NO_ACCEPT_UNKNOWN_INPUT_ARCH (OPTION_ACCEPT_UNKNOWN_INPUT_ARCH + 1) +enum option_values +{ + OPTION_ASSERT = 150, + OPTION_CALL_SHARED, + OPTION_CREF, + OPTION_DEFSYM, + OPTION_DEMANGLE, + OPTION_DYNAMIC_LINKER, + OPTION_EB, + OPTION_EL, + OPTION_EMBEDDED_RELOCS, + OPTION_EXPORT_DYNAMIC, + OPTION_HELP, + OPTION_IGNORE, + OPTION_MAP, + OPTION_NO_DEMANGLE, + OPTION_NO_KEEP_MEMORY, + OPTION_NO_WARN_MISMATCH, + OPTION_NOINHIBIT_EXEC, + OPTION_NON_SHARED, + OPTION_NO_WHOLE_ARCHIVE, + OPTION_OFORMAT, + OPTION_RELAX, + OPTION_RETAIN_SYMBOLS_FILE, + OPTION_RPATH, + OPTION_RPATH_LINK, + OPTION_SHARED, + OPTION_SONAME, + OPTION_SORT_COMMON, + OPTION_STATS, + OPTION_SYMBOLIC, + OPTION_TASK_LINK, + OPTION_TBSS, + OPTION_TDATA, + OPTION_TTEXT, + OPTION_TRADITIONAL_FORMAT, + OPTION_UR, + OPTION_VERBOSE, + OPTION_VERSION, + OPTION_VERSION_SCRIPT, + OPTION_VERSION_EXPORTS_SECTION, + OPTION_WARN_COMMON, + OPTION_WARN_CONSTRUCTORS, + OPTION_WARN_FATAL, + OPTION_WARN_MULTIPLE_GP, + OPTION_WARN_ONCE, + OPTION_WARN_SECTION_ALIGN, + OPTION_SPLIT_BY_RELOC, + OPTION_SPLIT_BY_FILE , + OPTION_WHOLE_ARCHIVE, + OPTION_AS_NEEDED, + OPTION_NO_AS_NEEDED, + OPTION_WRAP, + OPTION_FORCE_EXE_SUFFIX, + OPTION_GC_SECTIONS, + OPTION_NO_GC_SECTIONS, + OPTION_CHECK_SECTIONS, + OPTION_NO_CHECK_SECTIONS, + OPTION_NO_UNDEFINED, + OPTION_INIT, + OPTION_FINI, + OPTION_SECTION_START, + OPTION_UNIQUE, + OPTION_TARGET_HELP, + OPTION_ALLOW_SHLIB_UNDEFINED, + OPTION_NO_ALLOW_SHLIB_UNDEFINED, + OPTION_ALLOW_MULTIPLE_DEFINITION, + OPTION_NO_UNDEFINED_VERSION, + OPTION_DISCARD_NONE, + OPTION_SPARE_DYNAMIC_TAGS, + OPTION_NO_DEFINE_COMMON, + OPTION_NOSTDLIB, + OPTION_NO_OMAGIC, + OPTION_STRIP_DISCARDED, + OPTION_NO_STRIP_DISCARDED, + OPTION_ACCEPT_UNKNOWN_INPUT_ARCH, + OPTION_NO_ACCEPT_UNKNOWN_INPUT_ARCH, + OPTION_PIE, + OPTION_UNRESOLVED_SYMBOLS, + OPTION_WARN_UNRESOLVED_SYMBOLS, + OPTION_ERROR_UNRESOLVED_SYMBOLS +}; /* The long options. This structure is used for both the option parsing and the help text. */ @@ -223,9 +229,6 @@ static const struct ld_option ld_options[] = { {"omagic", no_argument, NULL, 'N'}, 'N', NULL, N_("Do not page align data, do not make text readonly"), EXACTLY_TWO_DASHES }, - { {"Zmagic", no_argument, NULL, 'Z'}, - 'Z', NULL, N_("Do not page align got/plt, old style executable"), - EXACTLY_TWO_DASHES }, { {"no-omagic", no_argument, NULL, OPTION_NO_OMAGIC}, '\0', NULL, N_("Page align data, make text readonly"), EXACTLY_TWO_DASHES }, { {"output", required_argument, NULL, 'o'}, @@ -236,8 +239,8 @@ static const struct ld_option ld_options[] = '\0', NULL, N_("Ignored for SVR4 compatibility"), ONE_DASH }, { {"emit-relocs", no_argument, NULL, 'q'}, 'q', NULL, "Generate relocations in final output", TWO_DASHES }, - { {"relocateable", no_argument, NULL, 'r'}, - 'r', NULL, N_("Generate relocateable output"), TWO_DASHES }, + { {"relocatable", no_argument, NULL, 'r'}, + 'r', NULL, N_("Generate relocatable output"), TWO_DASHES }, { {NULL, no_argument, NULL, '\0'}, 'i', NULL, NULL, ONE_DASH }, { {"just-symbols", required_argument, NULL, 'R'}, @@ -275,6 +278,9 @@ static const struct ld_option ld_options[] = 'y', N_("SYMBOL"), N_("Trace mentions of SYMBOL"), TWO_DASHES }, { {NULL, required_argument, NULL, '\0'}, 'Y', N_("PATH"), N_("Default search path for Solaris compatibility"), ONE_DASH }, + { {"Zmagic", no_argument, NULL, 'Z'}, + 'Z', NULL, N_("Do not page align got/plt, old style executable"), + EXACTLY_TWO_DASHES }, { {"start-group", no_argument, NULL, '('}, '(', NULL, N_("Start a group"), TWO_DASHES }, { {"end-group", no_argument, NULL, ')'}, @@ -337,11 +343,11 @@ static const struct ld_option ld_options[] = { {"no-keep-memory", no_argument, NULL, OPTION_NO_KEEP_MEMORY}, '\0', NULL, N_("Use less memory and more disk I/O"), TWO_DASHES }, { {"no-undefined", no_argument, NULL, OPTION_NO_UNDEFINED}, - '\0', NULL, N_("Allow no undefined symbols"), TWO_DASHES }, + '\0', NULL, N_("Do not allow unresolved references in object files"), TWO_DASHES }, { {"allow-shlib-undefined", no_argument, NULL, OPTION_ALLOW_SHLIB_UNDEFINED}, - '\0', NULL, N_("Allow undefined symbols in shared objects (the default)"), TWO_DASHES }, + '\0', NULL, N_("Allow unresolved references in shared libaries"), TWO_DASHES }, { {"no-allow-shlib-undefined", no_argument, NULL, OPTION_NO_ALLOW_SHLIB_UNDEFINED}, - '\0', NULL, N_("Do not allow undefined symbols in shared objects"), TWO_DASHES }, + '\0', NULL, N_("Do not allow unresolved references in shared libs"), TWO_DASHES }, { {"allow-multiple-definition", no_argument, NULL, OPTION_ALLOW_MULTIPLE_DEFINITION}, '\0', NULL, N_("Allow multiple definitions"), TWO_DASHES }, { {"no-undefined-version", no_argument, NULL, OPTION_NO_UNDEFINED_VERSION}, @@ -373,6 +379,10 @@ static const struct ld_option ld_options[] = '\0', NULL, N_("Create a shared library"), ONE_DASH }, { {"Bshareable", no_argument, NULL, OPTION_SHARED }, /* FreeBSD. */ '\0', NULL, NULL, ONE_DASH }, + { {"pie", no_argument, NULL, OPTION_PIE}, + '\0', NULL, N_("Create a position independent executable"), ONE_DASH }, + { {"pic-executable", no_argument, NULL, OPTION_PIE}, + '\0', NULL, NULL, TWO_DASHES }, { {"sort-common", no_argument, NULL, OPTION_SORT_COMMON}, '\0', NULL, N_("Sort common symbols by size"), TWO_DASHES }, { {"sort_common", no_argument, NULL, OPTION_SORT_COMMON}, @@ -399,6 +409,9 @@ static const struct ld_option ld_options[] = '\0', N_("ADDRESS"), N_("Set address of .data section"), ONE_DASH }, { {"Ttext", required_argument, NULL, OPTION_TTEXT}, '\0', N_("ADDRESS"), N_("Set address of .text section"), ONE_DASH }, + { {"unresolved-symbols=<method>", required_argument, NULL, OPTION_UNRESOLVED_SYMBOLS}, + '\0', NULL, N_("How to handle unresolved symbols. <method> is:\n\t\t\t\tignore-all, report-all, ignore-in-object-files,\n\t\t\t\tignore-in-shared-libs"), + TWO_DASHES }, { {"verbose", no_argument, NULL, OPTION_VERBOSE}, '\0', NULL, N_("Output lots of information during link"), TWO_DASHES }, { {"dll-verbose", no_argument, NULL, OPTION_VERBOSE}, /* Linux. */ @@ -421,50 +434,27 @@ static const struct ld_option ld_options[] = { {"warn-section-align", no_argument, NULL, OPTION_WARN_SECTION_ALIGN}, '\0', NULL, N_("Warn if start of section changes due to alignment"), TWO_DASHES }, + { {"warn-unresolved-symbols", no_argument, NULL, OPTION_WARN_UNRESOLVED_SYMBOLS}, + '\0', NULL, N_("Report unresolved symbols as warnings"), TWO_DASHES }, + { {"error-unresolved-symbols", no_argument, NULL, OPTION_ERROR_UNRESOLVED_SYMBOLS}, + '\0', NULL, N_("Report unresolved symbols as errors"), TWO_DASHES }, { {"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL}, '\0', NULL, N_("Treat warnings as errors"), TWO_DASHES }, { {"whole-archive", no_argument, NULL, OPTION_WHOLE_ARCHIVE}, '\0', NULL, N_("Include all objects from following archives"), TWO_DASHES }, + { {"as-needed", no_argument, NULL, OPTION_AS_NEEDED}, + '\0', NULL, N_("Only set DT_NEEDED for following dynamic libs if used"), TWO_DASHES }, + { {"no-as-needed", no_argument, NULL, OPTION_NO_AS_NEEDED}, + '\0', NULL, N_("Always set DT_NEEDED for following dynamic libs"), TWO_DASHES }, { {"wrap", required_argument, NULL, OPTION_WRAP}, - '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES }, - { {"mpc860c0", optional_argument, NULL, OPTION_MPC860C0}, - '\0', N_("[=WORDS]"), N_("Modify problematic branches in last WORDS (1-10,\n\t\t\t\tdefault 5) words of a page"), TWO_DASHES } + '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES } }; #define OPTION_COUNT ARRAY_SIZE (ld_options) -/* Test STRING for containing a string of digits that form a number - between MIN and MAX. The return value is the number or ERR. */ - -static int -is_num (string, min, max, err) - const char *string; - int min; - int max; - int err; -{ - int result = 0; - - for (; *string; ++string) - { - if (! ISDIGIT (*string)) - { - result = err; - break; - } - result = result * 10 + (*string - '0'); - } - if (result < min || result > max) - result = err; - - return result; -} - void -parse_args (argc, argv) - unsigned argc; - char **argv; +parse_args (unsigned argc, char **argv) { unsigned i; int is, il, irl; @@ -474,12 +464,11 @@ parse_args (argc, argv) struct option *longopts; struct option *really_longopts; int last_optind; + enum report_method how_to_report_unresolved_symbols = RM_GENERATE_ERROR; - shortopts = (char *) xmalloc (OPTION_COUNT * 3 + 2); - longopts = (struct option *) xmalloc (sizeof (*longopts) - * (OPTION_COUNT + 1)); - really_longopts = (struct option *) xmalloc (sizeof (*really_longopts) - * (OPTION_COUNT + 1)); + shortopts = xmalloc (OPTION_COUNT * 3 + 2); + longopts = xmalloc (sizeof (*longopts) * (OPTION_COUNT + 1)); + really_longopts = xmalloc (sizeof (*really_longopts) * (OPTION_COUNT + 1)); /* Starting the short option string with '-' is for programs that expect options and other ARGV-elements in any order and that care about @@ -564,7 +553,7 @@ parse_args (argc, argv) { char *n; - n = (char *) xmalloc (strlen (argv[i]) + 20); + n = xmalloc (strlen (argv[i]) + 20); sprintf (n, "--library=%s", argv[i] + 2); argv[i] = n; } @@ -611,16 +600,15 @@ parse_args (argc, argv) einfo (_("%P%F: use the --help option for usage information\n")); case 1: /* File name. */ - lang_add_input_file (optarg, lang_input_file_is_file_enum, - (char *) NULL); + lang_add_input_file (optarg, lang_input_file_is_file_enum, NULL); break; case OPTION_IGNORE: break; case 'a': /* For HP/UX compatibility. Actually -a shared should mean - ``use only shared libraries'' but, then, we don't - currently support shared libraries on HP/UX anyhow. */ + ``use only shared libraries'' but, then, we don't + currently support shared libraries on HP/UX anyhow. */ if (strcmp (optarg, "archive") == 0) config.dynamic_link = FALSE; else if (strcmp (optarg, "shared") == 0 @@ -712,8 +700,7 @@ parse_args (argc, argv) case 'f': if (command_line.auxiliary_filters == NULL) { - command_line.auxiliary_filters = - (char **) xmalloc (2 * sizeof (char *)); + command_line.auxiliary_filters = xmalloc (2 * sizeof (char *)); command_line.auxiliary_filters[0] = optarg; command_line.auxiliary_filters[1] = NULL; } @@ -725,9 +712,9 @@ parse_args (argc, argv) c = 0; for (p = command_line.auxiliary_filters; *p != NULL; p++) ++c; - command_line.auxiliary_filters = - (char **) xrealloc (command_line.auxiliary_filters, - (c + 2) * sizeof (char *)); + command_line.auxiliary_filters + = xrealloc (command_line.auxiliary_filters, + (c + 2) * sizeof (char *)); command_line.auxiliary_filters[c] = optarg; command_line.auxiliary_filters[c + 1] = NULL; } @@ -760,8 +747,7 @@ parse_args (argc, argv) ldfile_add_library_path (optarg, TRUE); break; case 'l': - lang_add_input_file (optarg, lang_input_file_is_l_enum, - (char *) NULL); + lang_add_input_file (optarg, lang_input_file_is_l_enum, NULL); break; case 'M': config.map_filename = "-"; @@ -787,9 +773,6 @@ parse_args (argc, argv) config.magic_demand_paged = FALSE; config.dynamic_link = FALSE; break; - case 'Z': - config.data_bss_contig = TRUE; - break; case OPTION_NO_DEFINE_COMMON: command_line.inhibit_common_definition = TRUE; break; @@ -803,14 +786,53 @@ parse_args (argc, argv) link_info.keep_memory = FALSE; break; case OPTION_NO_UNDEFINED: - link_info.no_undefined = TRUE; + link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols; break; case OPTION_ALLOW_SHLIB_UNDEFINED: - link_info.allow_shlib_undefined = TRUE; + link_info.unresolved_syms_in_shared_libs = RM_IGNORE; break; case OPTION_NO_ALLOW_SHLIB_UNDEFINED: - link_info.allow_shlib_undefined = FALSE; + link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols; break; + case OPTION_UNRESOLVED_SYMBOLS: + if (strcmp (optarg, "ignore-all") == 0) + { + link_info.unresolved_syms_in_objects = RM_IGNORE; + link_info.unresolved_syms_in_shared_libs = RM_IGNORE; + } + else if (strcmp (optarg, "report-all") == 0) + { + link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols; + link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols; + } + else if (strcmp (optarg, "ignore-in-object-files") == 0) + { + link_info.unresolved_syms_in_objects = RM_IGNORE; + link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols; + } + else if (strcmp (optarg, "ignore-in-shared-libs") == 0) + { + link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols; + link_info.unresolved_syms_in_shared_libs = RM_IGNORE; + } + else + einfo (_("%P%F: bad --unresolved-symbols option: %s\n"), optarg); + break; + case OPTION_WARN_UNRESOLVED_SYMBOLS: + how_to_report_unresolved_symbols = RM_GENERATE_WARNING; + if (link_info.unresolved_syms_in_objects == RM_GENERATE_ERROR) + link_info.unresolved_syms_in_objects = RM_GENERATE_WARNING; + if (link_info.unresolved_syms_in_shared_libs == RM_GENERATE_ERROR) + link_info.unresolved_syms_in_shared_libs = RM_GENERATE_WARNING; + break; + + case OPTION_ERROR_UNRESOLVED_SYMBOLS: + how_to_report_unresolved_symbols = RM_GENERATE_ERROR; + if (link_info.unresolved_syms_in_objects == RM_GENERATE_WARNING) + link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR; + if (link_info.unresolved_syms_in_shared_libs == RM_GENERATE_WARNING) + link_info.unresolved_syms_in_shared_libs = RM_GENERATE_ERROR; + break; case OPTION_ALLOW_MULTIPLE_DEFINITION: link_info.allow_multiple_definition = TRUE; break; @@ -843,7 +865,7 @@ parse_args (argc, argv) lang_add_output (optarg, 0); break; case OPTION_OFORMAT: - lang_add_output_format (optarg, (char *) NULL, (char *) NULL, 0); + lang_add_output_format (optarg, NULL, NULL, 0); break; case 'q': link_info.emitrelocations = TRUE; @@ -861,7 +883,7 @@ parse_args (argc, argv) and will seg-fault the next time around. */ einfo(_("%P%F: bad -rpath option\n")); - link_info.relocateable = TRUE; + link_info.relocatable = TRUE; config.build_constructors = FALSE; config.magic_demand_paged = FALSE; config.text_read_only = FALSE; @@ -883,7 +905,7 @@ parse_args (argc, argv) { lang_add_input_file (optarg, lang_input_file_is_symbols_only_enum, - (char *) NULL); + NULL); break; } } @@ -961,10 +983,27 @@ parse_args (argc, argv) break; case OPTION_SHARED: if (config.has_shared) - link_info.shared = TRUE; + { + link_info.shared = TRUE; + /* When creating a shared library, the default + behaviour is to ignore any unresolved references. */ + if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET) + link_info.unresolved_syms_in_objects = RM_IGNORE; + if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET) + link_info.unresolved_syms_in_shared_libs = RM_IGNORE; + } else einfo (_("%P%F: -shared not supported\n")); break; + case OPTION_PIE: + if (config.has_shared) + { + link_info.shared = TRUE; + link_info.pie = TRUE; + } + else + einfo (_("%P%F: -pie not supported\n")); + break; case 'h': /* Used on Solaris. */ case OPTION_SONAME: command_line.soname = optarg; @@ -1034,7 +1073,7 @@ parse_args (argc, argv) link_info.task_link = TRUE; /* Fall through - do an implied -r option. */ case OPTION_UR: - link_info.relocateable = TRUE; + link_info.relocatable = TRUE; config.build_constructors = TRUE; config.magic_demand_paged = FALSE; config.text_read_only = FALSE; @@ -1053,6 +1092,7 @@ parse_args (argc, argv) ldversion (1); version_printed = TRUE; trace_file_tries = TRUE; + overflow_cutoff_limit = -2; break; case 'v': ldversion (0); @@ -1068,8 +1108,8 @@ parse_args (argc, argv) break; case OPTION_VERSION_SCRIPT: /* This option indicates a small script that only specifies - version information. Read it, but don't assume that - we've seen a linker script. */ + version information. Read it, but don't assume that + we've seen a linker script. */ { FILE *hold_script_handle; @@ -1107,6 +1147,12 @@ parse_args (argc, argv) case OPTION_WHOLE_ARCHIVE: whole_archive = TRUE; break; + case OPTION_AS_NEEDED: + as_needed = TRUE; + break; + case OPTION_NO_AS_NEEDED: + as_needed = FALSE; + break; case OPTION_WRAP: add_wrap (optarg); break; @@ -1129,6 +1175,9 @@ parse_args (argc, argv) case 'y': add_ysym (optarg); break; + case 'Z': + config.data_bss_contig = TRUE; + break; case OPTION_SPARE_DYNAMIC_TAGS: link_info.spare_dynamic_tags = strtoul (optarg, NULL, 0); break; @@ -1170,22 +1219,6 @@ parse_args (argc, argv) lang_leave_group (); ingroup = 0; break; - case OPTION_MPC860C0: - /* Default value (in bytes). */ - link_info.mpc860c0 = 20; - if (optarg) - { - unsigned words; - - words = is_num (optarg, 1, 10, 0); - if (words == 0) - einfo (_("%P%F: invalid argument to option \"mpc860c0\"\n")); - - /* Convert words to bytes. */ - link_info.mpc860c0 = words * 4; - } - command_line.relax = TRUE; - break; case OPTION_INIT: link_info.init_function = optarg; @@ -1205,14 +1238,21 @@ parse_args (argc, argv) set_default_dirlist (default_dirlist); free (default_dirlist); } + + if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET) + /* FIXME: Should we allow emulations a chance to set this ? */ + link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols; + + if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET) + /* FIXME: Should we allow emulations a chance to set this ? */ + link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols; } /* Add the (colon-separated) elements of DIRLIST_PTR to the library search path. */ static void -set_default_dirlist (dirlist_ptr) - char *dirlist_ptr; +set_default_dirlist (char *dirlist_ptr) { char *p; @@ -1230,8 +1270,7 @@ set_default_dirlist (dirlist_ptr) } static void -set_section_start (sect, valstr) - char *sect, *valstr; +set_section_start (char *sect, char *valstr) { const char *end; bfd_vma val = bfd_scan_vma (valstr, &end, 16); @@ -1243,7 +1282,7 @@ set_section_start (sect, valstr) /* Print help messages for the options. */ static void -help () +help (void) { unsigned i; const char **targets, **pp; diff --git a/gnu/usr.bin/binutils/ld/mri.c b/gnu/usr.bin/binutils/ld/mri.c index cc9de64d8cd..f7edd8817ff 100644 --- a/gnu/usr.bin/binutils/ld/mri.c +++ b/gnu/usr.bin/binutils/ld/mri.c @@ -1,6 +1,6 @@ /* mri.c -- handle MRI style linker scripts - Copyright 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2002 - Free Software Foundation, Inc. + Copyright 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2002, + 2003, 2004 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -53,17 +53,8 @@ struct section_name_struct *alias; struct section_name_struct *alignment; struct section_name_struct *subalignment; -static struct section_name_struct **lookup - PARAMS ((const char *name, struct section_name_struct **list)); -static void mri_add_to_list PARAMS ((struct section_name_struct **list, - const char *name, etree_type *vma, - const char *zalias, etree_type *align, - etree_type *subalign)); - static struct section_name_struct ** -lookup (name, list) - const char *name; - struct section_name_struct **list; +lookup (const char *name, struct section_name_struct **list) { struct section_name_struct **ptr = list; @@ -77,24 +68,23 @@ lookup (name, list) ptr = &((*ptr)->next); } - *ptr = (struct section_name_struct *) xmalloc (sizeof (struct section_name_struct)); + *ptr = xmalloc (sizeof (struct section_name_struct)); return ptr; } static void -mri_add_to_list (list, name, vma, zalias, align, subalign) - struct section_name_struct **list; - const char *name; - etree_type *vma; - const char *zalias; - etree_type *align; - etree_type *subalign; +mri_add_to_list (struct section_name_struct **list, + const char *name, + etree_type *vma, + const char *zalias, + etree_type *align, + etree_type *subalign) { struct section_name_struct **ptr = lookup (name, list); (*ptr)->name = name; (*ptr)->vma = vma; - (*ptr)->next = (struct section_name_struct *) NULL; + (*ptr)->next = NULL; (*ptr)->ok_to_load = 0; (*ptr)->alias = zalias; (*ptr)->align = align; @@ -102,9 +92,7 @@ mri_add_to_list (list, name, vma, zalias, align, subalign) } void -mri_output_section (name, vma) - const char *name; - etree_type *vma; +mri_output_section (const char *name, etree_type *vma) { mri_add_to_list (&address, name, vma, 0, 0, 0); } @@ -113,15 +101,13 @@ mri_output_section (name, vma) marked thus. */ void -mri_only_load (name) - const char *name; +mri_only_load (const char *name) { mri_add_to_list (&only_load, name, 0, 0, 0, 0); } void -mri_base (exp) - etree_type *exp; +mri_base (etree_type *exp) { base = exp; } @@ -129,7 +115,7 @@ mri_base (exp) static int done_tree = 0; void -mri_draw_tree () +mri_draw_tree (void) { if (done_tree) return; @@ -142,8 +128,8 @@ mri_draw_tree () r = lang_memory_region_lookup("long"); r->current = r->origin = exp_get_vma (base, (bfd_vma)0, "origin", lang_first_phase_enum); - r->length = (bfd_size_type) exp_get_vma (0, (bfd_vma) ~((bfd_size_type)0), - "length", lang_first_phase_enum); + r->length = (bfd_size_type) exp_get_vma (0, ~(bfd_vma) 0, "length", + lang_first_phase_enum); } #endif @@ -151,23 +137,21 @@ mri_draw_tree () /* Attach the addresses of any which have addresses, and add the ones not mentioned. */ - if (address != (struct section_name_struct *) NULL) + if (address != NULL) { struct section_name_struct *alist; struct section_name_struct *olist; - if (order == (struct section_name_struct *) NULL) + if (order == NULL) order = address; for (alist = address; - alist != (struct section_name_struct *) NULL; + alist != NULL; alist = alist->next) { int done = 0; - for (olist = order; - done == 0 && olist != (struct section_name_struct *) NULL; - olist = olist->next) + for (olist = order; done == 0 && olist != NULL; olist = olist->next) { if (strcmp (alist->name, olist->name) == 0) { @@ -186,12 +170,12 @@ mri_draw_tree () /* If we're only supposed to load a subset of them in, then prune the list. */ - if (only_load != (struct section_name_struct *) NULL) + if (only_load != NULL) { struct section_name_struct *ptr1; struct section_name_struct *ptr2; - if (order == (struct section_name_struct *) NULL) + if (order == NULL) order = only_load; /* See if this name is in the list, if it is then we can load it. */ @@ -210,7 +194,7 @@ mri_draw_tree () } /* Create the order of sections to load. */ - if (order != (struct section_name_struct *) NULL) + if (order != NULL) { /* Been told to output the sections in a certain order. */ struct section_name_struct *p = order; @@ -236,10 +220,9 @@ mri_draw_tree () lang_enter_output_section_statement (p->name, base, p->ok_to_load ? 0 : noload_section, - 1, align, subalign, - (etree_type *) NULL); + align, subalign, NULL); base = 0; - tmp = (struct wildcard_list *) xmalloc (sizeof *tmp); + tmp = xmalloc (sizeof *tmp); tmp->next = NULL; tmp->spec.name = p->name; tmp->spec.exclude_name_list = NULL; @@ -250,7 +233,7 @@ mri_draw_tree () for (aptr = alias; aptr; aptr = aptr->next) if (strcmp (aptr->alias, p->name) == 0) { - tmp = (struct wildcard_list *) xmalloc (sizeof *tmp); + tmp = xmalloc (sizeof *tmp); tmp->next = NULL; tmp->spec.name = aptr->name; tmp->spec.exclude_name_list = NULL; @@ -258,9 +241,7 @@ mri_draw_tree () lang_add_wild (NULL, tmp, FALSE); } - lang_leave_output_section_statement - (0, "*default*", (struct lang_output_section_phdr_list *) NULL, - NULL); + lang_leave_output_section_statement (0, "*default*", NULL, NULL); p = p->next; } @@ -270,29 +251,23 @@ mri_draw_tree () } void -mri_load (name) - const char *name; +mri_load (const char *name) { base = 0; - lang_add_input_file (name, - lang_input_file_is_file_enum, (char *) NULL); + lang_add_input_file (name, lang_input_file_is_file_enum, NULL); #if 0 lang_leave_output_section_statement (0, "*default*"); #endif } void -mri_order (name) - const char *name; +mri_order (const char *name) { mri_add_to_list (&order, name, 0, 0, 0, 0); } void -mri_alias (want, is, isn) - const char *want; - const char *is; - int isn; +mri_alias (const char *want, const char *is, int isn) { if (!is) { @@ -311,56 +286,47 @@ mri_alias (want, is, isn) } void -mri_name (name) - const char *name; +mri_name (const char *name) { lang_add_output (name, 1); } void -mri_format (name) - const char *name; +mri_format (const char *name) { if (strcmp (name, "S") == 0) - lang_add_output_format ("srec", (char *) NULL, (char *) NULL, 1); + lang_add_output_format ("srec", NULL, NULL, 1); else if (strcmp (name, "IEEE") == 0) - lang_add_output_format ("ieee", (char *) NULL, (char *) NULL, 1); + lang_add_output_format ("ieee", NULL, NULL, 1); else if (strcmp (name, "COFF") == 0) - lang_add_output_format ("coff-m68k", (char *) NULL, (char *) NULL, 1); + lang_add_output_format ("coff-m68k", NULL, NULL, 1); else einfo (_("%P%F: unknown format type %s\n"), name); } void -mri_public (name, exp) - const char *name; - etree_type *exp; +mri_public (const char *name, etree_type *exp) { lang_add_assignment (exp_assop ('=', name, exp)); } void -mri_align (name, exp) - const char *name; - etree_type *exp; +mri_align (const char *name, etree_type *exp) { mri_add_to_list (&alignment, name, 0, 0, exp, 0); } void -mri_alignmod (name, exp) - const char *name; - etree_type *exp; +mri_alignmod (const char *name, etree_type *exp) { mri_add_to_list (&subalignment, name, 0, 0, 0, exp); } void -mri_truncate (exp) - unsigned int exp; +mri_truncate (unsigned int exp) { symbol_truncate = exp; } diff --git a/gnu/usr.bin/binutils/ld/mri.h b/gnu/usr.bin/binutils/ld/mri.h index e857e3d738c..b430d20a056 100644 --- a/gnu/usr.bin/binutils/ld/mri.h +++ b/gnu/usr.bin/binutils/ld/mri.h @@ -1,5 +1,5 @@ /* mri.h -- header file for MRI scripting functions - Copyright 1993, 1995, 1996 Free Software Foundation, Inc. + Copyright 1993, 1995, 1996, 2003 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -22,18 +22,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ extern unsigned int symbol_truncate; -extern void mri_output_section PARAMS ((const char *name, etree_type *vma)); -extern void mri_only_load PARAMS ((const char *name)); -extern void mri_base PARAMS ((etree_type *exp)); -extern void mri_load PARAMS ((const char *name)); -extern void mri_order PARAMS ((const char *name)); -extern void mri_alias PARAMS ((const char *want, const char *is, int isn)); -extern void mri_name PARAMS ((const char *name)); -extern void mri_format PARAMS ((const char *name)); -extern void mri_public PARAMS ((const char *name, etree_type *exp)); -extern void mri_align PARAMS ((const char *name, etree_type *exp)); -extern void mri_alignmod PARAMS ((const char *name, etree_type *exp)); -extern void mri_truncate PARAMS ((unsigned int exp)); -extern void mri_draw_tree PARAMS ((void)); +extern void mri_output_section (const char *, etree_type *); +extern void mri_only_load (const char *); +extern void mri_base (etree_type *); +extern void mri_load (const char *); +extern void mri_order (const char *); +extern void mri_alias (const char *, const char *, int); +extern void mri_name (const char *); +extern void mri_format (const char *); +extern void mri_public (const char *, etree_type *); +extern void mri_align (const char *, etree_type *); +extern void mri_alignmod (const char *, etree_type *); +extern void mri_truncate (unsigned int); +extern void mri_draw_tree (void); #endif diff --git a/gnu/usr.bin/binutils/ld/scripttempl/elf.sc b/gnu/usr.bin/binutils/ld/scripttempl/elf.sc index a83739d1cc0..dc95d85569c 100644 --- a/gnu/usr.bin/binutils/ld/scripttempl/elf.sc +++ b/gnu/usr.bin/binutils/ld/scripttempl/elf.sc @@ -72,8 +72,8 @@ if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHI test -z "${ELFSIZE}" && ELFSIZE=32 test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8" test "$LD_FLAG" = "N" && DATA_ADDR=. -test -n "$CREATE_SHLIB" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE="" -test -z "$CREATE_SHLIB" && test -n "$DATA_ADDR" && COMMONPAGESIZE="" +test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE="" +test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE="" DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))" DATA_SEGMENT_END="" if test -n "${COMMONPAGESIZE}"; then @@ -82,8 +82,10 @@ if test -n "${COMMONPAGESIZE}"; then fi INTERP=".interp ${RELOCATING-0} : { *(.interp) }" PLT=".plt ${RELOCATING-0} : { *(.plt) }" +test -z "$GOT" && GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }" DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" +STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }" if test -z "${NO_SMALL_DATA}"; then SBSS=".sbss ${RELOCATING-0} : { @@ -116,12 +118,14 @@ if test -z "${NO_SMALL_DATA}"; then fi RODATA_ALIGN_ADD_VAL="${CREATE_SHLIB-${RODATA_ALIGN_ADD:-0}} ${CREATE_SHLIB+0}" test "$LD_FLAG" = "n" || test "$LD_FLAG" = "N" || test "$LD_FLAG" = "Z" || NO_PAD="y" -test "$NO_PAD" = "y" && PAD_RO0="${RELOCATING+${RODATA_ALIGN} + ${RODATA_ALIGN_ADD_VAL};}" -test "$NO_PAD" = "y" && PAD_PLT0="${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));} .pltpad0 ${RELOCATING-0} : { ${RELOCATING+__plt_start = .;} }" -test "$NO_PAD" = "y" && PAD_PLT1=".pltpad1 ${RELOCATING-0} : { ${RELOCATING+__plt_end = .;}} ${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));}" -test "$NO_PAD" = "y" && PAD_GOT0="${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));} .gotpad0 ${RELOCATING-0} : { ${RELOCATING+__got_start = .;} }" -test "$NO_PAD" = "y" && PAD_GOT1=".gotpad1 ${RELOCATING-0} : { ${RELOCATING+__got_end = .;}} ${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));}" -test "$NO_PAD" = "y" && PAD_CDTOR= +if test "$NO_PAD" = "y" ; then + PAD_RO0="${RELOCATING+${RODATA_ALIGN} + ${RODATA_ALIGN_ADD_VAL};}" + PAD_PLT0="${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));} .pltpad0 ${RELOCATING-0} : { ${RELOCATING+__plt_start = .;} }" + PAD_PLT1=".pltpad1 ${RELOCATING-0} : { ${RELOCATING+__plt_end = .;}} ${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));}" + PAD_GOT0="${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));} .gotpad0 ${RELOCATING-0} : { ${RELOCATING+__got_start = .;} }" + PAD_GOT1=".gotpad1 ${RELOCATING-0} : { ${RELOCATING+__got_end = .;}} ${RELOCATING+. = ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1));}" + test "$NO_PAD_CDTOR" = "y" || PAD_CDTOR= +fi CTOR=".ctors ${CONSTRUCTING-0} : { @@ -189,8 +193,9 @@ ${RELOCATING- /* For some reason, the Solaris linker makes bad executables SECTIONS { /* Read-only sections, merged into text segment: */ - ${CREATE_SHLIB-${RELOCATING+. = ${TEXT_BASE_ADDRESS};}} + ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}} ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}} + ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}} ${CREATE_SHLIB-${INTERP}} ${INITIAL_READONLY_SECTIONS} ${TEXT_DYNAMIC+${DYNAMIC}} @@ -293,8 +298,9 @@ cat <<EOF /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ - ${CREATE_SHLIB-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}} + ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}} ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}} + ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}} /* Ensure the __preinit_array_start label is properly aligned. We could instead move the label definition inside the section, but @@ -338,7 +344,7 @@ cat <<EOF ${PAD_GOT+${PAD_GOT0}} ${DATA_NONEXEC_PLT+${PLT}} ${RELOCATING+${OTHER_GOT_SYMBOLS}} - .got ${RELOCATING-0} : { *(.got.plt) *(.got) } + ${GOT} /* If PAD_CDTOR, CTOR and DTOR relocated here to receive mprotect protection after relocation are finished same as GOT */ ${PAD_CDTOR+${RELOCATING+${CTOR}}} @@ -418,5 +424,6 @@ cat <<EOF ${STACK_ADDR+${STACK}} ${OTHER_SECTIONS} ${RELOCATING+${OTHER_END_SYMBOLS}} + ${RELOCATING+${STACKNOTE}} } EOF diff --git a/gnu/usr.bin/binutils/ld/scripttempl/pe.sc b/gnu/usr.bin/binutils/ld/scripttempl/pe.sc index 2fd27f93d26..da09eb43048 100644 --- a/gnu/usr.bin/binutils/ld/scripttempl/pe.sc +++ b/gnu/usr.bin/binutils/ld/scripttempl/pe.sc @@ -25,6 +25,10 @@ if test "${RELOCATING}"; then SORT(*)(.idata$6) SORT(*)(.idata$7)' R_CRT='*(SORT(.CRT$*))' + R_TLS=' + *(.tls) + *(.tls$) + *(SORT(.tls$*))' R_RSRC='*(SORT(.rsrc$*))' else R_TEXT= @@ -129,6 +133,11 @@ SECTIONS ${R_CRT} } + .tls ${RELOCATING+BLOCK(__section_alignment__)} : + { + ${R_TLS} + } + .endjunk ${RELOCATING+BLOCK(__section_alignment__)} : { /* end is deprecated, don't use it */ diff --git a/gnu/usr.bin/binutils/ld/sysdep.h b/gnu/usr.bin/binutils/ld/sysdep.h index 7151f14adfa..f164e74e1f0 100644 --- a/gnu/usr.bin/binutils/ld/sysdep.h +++ b/gnu/usr.bin/binutils/ld/sysdep.h @@ -1,5 +1,6 @@ /* sysdep.h -- handle host dependencies for the GNU linker - Copyright 1995, 1996, 1997, 1999, 2002 Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1999, 2002, 2003 + Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -21,8 +22,6 @@ #ifndef LD_SYSDEP_H #define LD_SYSDEP_H -#include "ansidecl.h" - #include "config.h" #include <stdio.h> |