3 * ldexp.c (fold_name): Don't crash if the symbol is defined in a
4 section with no output section, such as a shared library section.
8 * lexsup.c (parse_args): Keep track of where we are in the option
9 parsing before calling ldemul_parse_args, so that we don't call it
10 multiple times on the same argument and confuse the getopt
15 * configure.tgt (d30v-elf-*): Rename d30velf_e to d30v_e and
16 d30velf_o to d30v_o to work in DOS environments.
17 * Makefile.{am,in}: Ditto.
19 * emulparams/d30v_{o,e}.sh: Rename from d30velf_{o,e}.
20 * emulparams/d30velf_{o,e}.sh: Deleted.
24 * scripttempl/armcoff.sc: Add glue sections (code taken from Arm
27 * emulparams/armcoff.sh (TEMPLATE_NAME): Set to armcoff.
29 * emultempl/armcoff.em: New file, imported from Arm branch.
33 * scripttempl/elfd30v.sc: Add .rel and .rela sections for all
34 defined sections. Set up __{D,C}TOR_{LIST,END}__. Add onchip and
35 external memory sections for rodata. Delete .string, .rodata1,
40 * Makefile.am: Add Oct 23 changes to Makefile.in here.
42 * Makefile.{am,in}: (ALL_EMULATIONS): Add ed10velf.o.
44 * Makefile.{am,in}: (ALL_EMULATIONS): Add etic80coff.o.
46 * Makefile.{am,in}: (ALL_EMULATIONS): Add ed30velf{,_e,_o}.o.
47 (ed30velf_e.c): Like d30velf, except .text/.data/etc always go in
49 (ed30velf_o.c): Like d30velf, except .text/.data/etc always go in
52 * emulparams/d30velf.sh (STACK_START_ADDR): Top of default
54 ({TEXT,DATA,EMEM}_SIZE): Sizes of the 3 memory areas.
55 ({TEXT,DATA,BSS}_MEMORY): Which memory region .text, .data, and
58 * emulparams/d30velf_{e,o}.sh: New files to be explicit whether
59 .text, .data, etc go in external memory or onchip memory.
61 * configure.tgt (d30v-*-*ext*): New configuration to default
62 .text, .data, etc. in external memory.
63 (d30v-*-*onchip*): New configuration to default .text, .data,
64 etc. in onchip memory.
65 (d30v-*-*): Add d30velf_{e,o} emulations.
67 * scripttempl/elfd30v.sc: Allow .text, .data, .bss to be put in
68 either the onchip text/data areas or the external memory area.
69 (MEMORY): Get sizes from d30velf.sh.
70 (.e{data,text,bss}): Put sections in the external memory region.
71 (.stext): Put section in the onchip text region.
72 (.s{data,bss}): Put sections in the onchip data region.
73 (__stack): Assign from ${STACK_START_ADDR}.
74 (.text): Put in ${TEXT_MEMORY} memory region.
75 (.data{,1}/.strings/.rodata{,1}): Put in ${DATA_MEMORY} memory
77 (.bss): Put in ${BSS_MEMORY} memory region.
81 * configure.tgt (targ_extra_emuls): Add support for Thumb target.
85 * ldlex.l: Don't define hex_mode. Correct number regexp to not
86 accept hex digits without a leading $ or 0x. Handle leading $
87 correctly. Pass 0 rather than hex_mode to bfd_scan_vma.
88 * ldlex.h (hex_mode): Don't declare.
92 * emulparams/d30velf.sh ({DATA,EMEM}_START_ADDR): Define as start
93 of internal data area and external memory on chip.
95 * scripttempl/elfd30v.sc: Define a MEMORY region that describes
96 the 3 regions of memory on the chip. Put .text/.init/.fini into
97 the text memory region, put other segments into the data memory
98 region. Add more of the standard elf sections. Default __stack
99 to be 0x20008000, which is 1 byte beyond end of the internal data
104 * configure.tgt (targ_extra_emuls): Make FreeBSD a i386bsd
109 * configure.host (alpha*-*-linux*): Correct HOSTING_CRT0. Set
114 * ld.h (args_type): Add warn_mismatch field.
115 * ldmain.c (main): Initialize warn_mismatch field.
116 * lexsup.c (parse_args): Handle --no-warn-mismatch option.
117 * ldlang.c (ignore_bfd_error): New static function.
118 (lang_check): If warn_mismatch is false, don't warn about
119 mismatched input files.
120 * ld.texinfo, ld.1: Document new option.
124 * scripttempl/v850.sc: Rename linker symbol '_stack' to '__stack'
125 to avoid conflicts with C code which is defining a variable called
130 * Makefile.in (ALL_EMULATIONS): Move eelf64_sparc.o ...
131 (ALL_64_EMULATIONS): ... here.
132 (eelf64_sparc.c): Template should be elf32 not generic.
133 * emulparams/elf64_sparc.sh (TEMPLATE_NAME): New definition.
137 * configure.tgt: Add sparc64-*-linux*.
138 * emulparams/elf64_sparc.sh (GENERATE_SHLIB_SCRIPT, NOP): New.
142 * scripttempl/pe.sc: Put .eh_frame in .rdata.
146 * ldlang.c (lang_register_vers_node): Only check globals<=>locals,
147 since we need to be able to export different versions of the same
152 * scripttempl/pe.sc: Put .stab and .stabstr sections at end.
156 * configure.tgt, configure.host: Change alpha-*-* to alpha*-*-*;
157 config.guess now recognizes alphaev5 etc.
161 * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Don't treat
162 -s and -u as -static and -unix.
166 * ldlang.c (wild_doit): Rewrite flag handling for clarity. If we
167 are not adding the first input section, and SEC_READONLY is clear
168 on the output section, then don't copy it from the input section.
169 If SEC_READONLY is not set on the input section, then clear it on
172 * configure.tgt (mips*-sgi-irix[56]*): Use elf32bsmip rather than
174 (mips*el-*-linux*): Change elf32lmip to elf32lsmip and elf32bmip
176 (mips*-*-linux*): Likewise.
177 * emulparams/elf32bsmip.sh: New file; just like elf32bmip.sh, but
178 setting ENTRY to __start.
179 * emulparams/elf32lsmip.sh: New file; just like elf32lmip.sh, but
180 setting ENTRY to __start.
181 * scripttempl/elf.sc: Always set ENTRY to _start if it was not
186 * emulparams/v850.sh (ROZDATA_START_ADDR, ROSDATA_START_ADDR): New
189 * scripttempl/v850.sc: Move read only areas out of zero and small
190 data sections and into their own sections.
194 * configure.tgt (sh*-*-rtems*): New target, like sh-*-elf*.
198 * ld.texinfo (Section Options): Improve documentation of NOLOAD
201 * aclocal.m4: Rebuild with new libtool.
202 * configure: Rebuild.
206 * ldlang.c (wild_doit): Revert patch of September 3.
210 * Makefile.am, Makefile.in: Add rule for ev850.c
211 * configure.tgt (targ_extra_emuls): Add v850 target.
215 * emulparams/v850.sh (CALL_TABLE_START_ADDR): New entry.
216 * scripttempl/v850.sc: Add call table data area
220 Merge change from Martin Hunt:
222 * scripttempl/elfd30v.sc: Put .rodata in the .text section.
226 * ldlang.c (lang_memory_region_lookup): Remove extraneous
231 * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): In
232 expression produced for -bpT and -bpD options, align to a 32 byte
233 boundary rather than an 8 byte boundary.
234 * scripttempl/aix.sc: Put .tocbss at start of .bss section.
236 * ldmisc.h, ldmisc.c, ldcref.c: Rename finfo to lfinfo, to avoid
237 function name conflict with AIX 4.2 unistd.h header file.
241 * ldlang.c (wild_doit): Clear SEC_HAS_CONTENTS from a
246 * Makefile.am (ld_new_DEPENDENCIES): Remove @LEXLIB@.
247 * Makefile.in: Rebuild.
251 * configure.tgt (arc-*-elf*): Recognize.
252 * Makefile.am (ALL_EMULATIONS): Add earcelf.o.
253 * Makefile.in: Regenerate.
254 * emulparams/arcelf.sh: New file.
258 * ldlang.c (wildcardp): Don't let a backslash by itself cause a
259 pattern to be treated as a wildcard pattern.
261 * ldgram.y (atype): Accept parentheses with no type.
263 * ld.texinfo (Section Definition): Clarify use of whitespace.
264 (Section Placement): Likewise.
268 * configure.tgt (targ_extra_emuls): Add support for v850e target.
272 * configure.tgt (targ_extra_emuls): Add support for v850e target.
276 * Makefile.am (ld.info): Change dependency from
277 $(BFDDIR)/doc/bfdsumm.texi to bfdsumm.texi.
279 (bfdsumm.texi): New target.
280 (CLEANFILES): Add bfdsumm.texi.
281 * Makefile.in: Rebuild.
283 * Makefile.am: New file, based on old Makefile.in.
284 * acinclude.m4: New file, from old aclocal.m4.
285 * configure.in: Call AM_INIT_AUTOMAKE and AM_PROG_LIBTOOL. Remove
286 shared library handling; now handled by libtool. Replace
287 AC_CONFIG_HEADER with AM_CONFIG_HEADER. Call AC_PROG_YACC,
288 AC_PROG_LEX, and AC_DECL_YYTEXT. Call AM_MAINTAINER_MODE,
289 AM_CYGWIN32, and AM_EXEEXT. Don't call CY_CYGWIN32 or CY_EXEEXT.
290 * configure.host: Don't set HLDFLAGS, HLDENV, or RPATH_ENVVAR.
291 * acconfig.h: Mention PACKAGE and VERSION.
292 * stamp-h.in: New file.
293 * ldver.c (ld_program_version): Set ld_program_version from
295 * ldgram.y, ldlex.l: Replace VERSION with VERSIONK.
296 * Makefile.in: Now built with automake.
297 * aclocal.m4: Now built with aclocal.
298 * configure, config.in: Rebuild.
302 * configure.in: Use CYGWIN and EXEEXT autoconf macro to look for
304 * configure: Regenerated with autoconf 2.12.
305 * Makefile.in: Add $(EXEEXT) to executable.
309 * emulparams/i386go32.sh (OUTPUT_FORMAT): Set to "coff-go32".
310 (SEGMENT_SIZE): Set to 0x200.
311 * scripttempl/i386go32.sc: Rewrite.
312 * configure.tgt (i[3456]86-*-msdosdjgpp*): New target.
317 * configure.host (i[3456]86-*-linux*libc1*): Renamed from
319 (i[3456]86-*-linux*): New host.
323 * scripttempl/pe.sc: Put .rsrc after .reloc. Put input .rsrc
324 sections in the output .rsrc section.
328 * configure.host (m68*-*-linux*libc1*): Renamed from
330 (m68*-*-linux*): New configuration for use with GNU libc 2.
334 * scripttempl/elfppc.sc: Correct .rela.sdata entries.
336 * scripttempl/elfppc.sc: Put the PLT between the small and large
338 * emulparams/elf32ppc.sh (TEXT_START_ADDR): The ABI says `A
339 program base of 0x02000000 is recommended...' because otherwise
340 shared libraries are less efficient. We use 0x01800000 because
341 otherwise it's impossible to branch to location 0, for instance if
342 you have an undefined weak symbol.
346 * ldlang.c (lang_place_undefineds): Add \n in einfo call.
347 (lang_size_sections): Likewise.
349 * emultempl/aix.em (gld${EMULATION_NAME}_read_file): Likewise.
350 * emultempl/mipsecoff.em (gld${EMULATION_NAME}_after_open):
352 (check_sections): Likewise.
353 (gld${EMULATION_NAME}_after_allocation): Likewise.
354 * emultempl/pe.em (gld_$${EMULATION_NAME}_before_allocation):
356 * mpw-eppcmac.c (gldppcmacos_read_file): Likewise.
357 * mpw-idtmips.c (gldmipsidt_after_open): Likewise.
358 (check_sections): Likewise.
359 (gldmipsidt_after_allocation): Likewise.
361 * ldemul.c (ldemul_choose_mode): Remove unused einfo argument.
365 * scripttempl/pe.sc: Add zeroes after .idata$3 to mark the end of
370 * emultempl/elf32.em (gld${EMULATION_NAME}_place_section): Don't
371 crash if an output section has no BFD section.
375 * lexsup.c (ld_options): Add entry for the new "task-link" option.
376 (parse_args): Handle the "task-link" option.
377 (OPTION_TASK_LINK): Add define.
381 * ldmain.c (main): Correct check of fclose return value when
382 handling --force-exe-suffix.
386 * ldlang.c (lang_check): Add test of the return value from the
387 call to bfd_merge_private_bfd_data().
391 * scripttempl/elfmips.sc: Remove.
392 * scripttempl/elf.sc: Set ENTRY based on target. Permit
393 TEXT_DYNAMIC to control .dynamic segment. Permit
394 SHLIB_TEXT_START_ADDR to set start of shared object. Support
395 INITIAL_READONLY_SECTIONS. Put .stub in .text. Only put
396 .gnu.linkonce.t* in .text when relocating. Support
397 OTHER_TEXT_SECTIONS. Support SHLIB_DATA_ADDR as well as
398 DATA_ADDR. Support OTHER_GOT_SYMBOLS and OTHER_GOT_SECTIONS.
399 * emulparams/elf32b4300.sh (SCRIPT_NAME): Set to elf.
400 (DATA_ADDR): Don't set.
401 (INITIAL_READONLY_SECTIONS): Rename from OTHER_READONLY_SECTIONS.
402 (OTHER_TEXT_SECTIONS): Set.
403 (OTHER_GOT_SECTIONS): Rename from OTHER_READWRITE_SECTIONS.
404 (MACHINE): Set to empty string.
405 * emulparams/elf32l4300.sh: Likewise.
406 * emulparams/elf32ebmip.sh: Likewise.
407 * emulparams/elf32elmip.sh: Likewise.
408 * emulparams/elf32bmip.sh: Likewise. Also:
410 * emulparams/elf32lmips.sh: Likewise.
411 * Makefile.in (eelf32bmips.c): Depend upon elf.sc rather than
413 (eelf32ebmips.c, eelf32elmips.c, eelf32lmip.c): Likewise.
417 * scripttempl/elf.sc: Don't align the data segment on the next 8
418 byte boundary, instead let the linker use whatever the individual
423 * configure.tgt (i[3456]86-*-gnu*): Don't include Mach support.
428 * emultempl/pe.em (sort_by_file_name): Sort by archive name
430 (sort_sections): Sort all sections, not just sections in the same
435 * configure.tgt, configure.host: cope with '*-*-linux-gnuaout'
440 * scripttempl/tic80coff.sc (.text): Add a leading underscore to
441 __{D,C}TOR_{LIST,END}__ definations. Rearrange the order of items
442 in the .text section. Move .const, .ctors, .dtors into separate
447 * scripttempl/m88kbcs.sc (__.initp.end, _etext): Added whitespace
448 around assignment of current location pointer.
452 * ldctor.c (ldctor_build_sets): Make sure the set is aligned
457 * Makefile.in (INSTALL): Set to @INSTALL@.
458 (INSTALL_XFORM, INSTALL_XFORM1): Remove.
459 (install): Depend upon ld.new and installdirs. Use
460 $(program_transform_name) directly, rather than using
461 $(INSTALL_XFORM) and $(INSTALL_XFORM1).
462 (installdirs): New target.
463 (install-info): Run mkinstalldirs.
467 * Makefile.in (INSTALL): Change install.sh to install-sh.
470 * configure.in: Use ${CONFIG_SHELL} when running $ac_config_sub.
471 * configure: Rebuild.
475 * emultempl/pe.em: Include "libiberty.h".
476 (sort_sections_1): Use xmalloc rather than alloca.
478 * ldlex.l: Recognize SQUAD.
479 * ldgram.y (length): Add SQUAD.
480 * ldctor.c (ldctor_build_sets): Use SQUAD for a signed 8 byte
482 * ldlang.c (print_data_statement): Handle SQUAD.
483 (lang_size_sections, lang_do_assignments): Likewise.
484 * ldexp.c (exp_print_token): Add SQUAD to table.
485 * ldwrite.c (build_link_order): Handle SQUAD.
486 * ld.texinfo (Section Data Expressions): Document SQUAD.
490 * ldver.c (ld_program_version): Set to 2.8.1.
492 * Branched binutils 2.8.
496 * mpw-idtmips.c: Rename from mpw-emipsidt.c.
497 * mpw-elfmips.c: Rename from mpw-emipself.c.
498 * mpw-config.in: Update accordingly.
500 * ldlang.c (lang_process): Call lang_check immediately after
501 opening the input files, rather than at the end of the link.
505 * emultempl/pe.em (init): Fully bracket initializer.
506 (set_pe_stack_heap): Remove locals begin_commit and end.
507 (gld_${EMULATION_NAME}_after_open): Remove unused local i.
508 (gld${EMULATION_NAME}_place_orphan): Remove unused local ptr.
512 * configure.tgt (hppa*-*-rtems*): New target, like hppa-*-*elf*.
517 * configure.tgt (sparc*-*-linuxaout*): New target.
518 (sparc*-*-linux*): New target.
519 * emulparams/sparclinux.sh: New file.
520 * Makefile.in (ALL_EMULATIONS): Add esparclinux.o.
521 (esparclinux.c): New target.
526 * configure.tgt: Set targ_extra_emuls for mips*el-*-linux* and
527 mips*-*-linux*. Use elf32bmip and elf32lmip, not elf32ebmip and
532 * lexsup.c (parse_args): Update copyright date in version
537 * emulparams/delta68.sh (OUTPUT_FORMAT): Set to "coff-m68k-sysv".
541 * Makefile.in: Rebuild dependencies.
543 * emultempl/aix.em: Include "obstack.h".
547 * ldlang.c: Include "obstack.h".
551 * configure.tgt (powerpc-*-beos*): Use aixppc for targ_emul.
555 * ldemul.h (ldemul_list_emulations): Use full prototype.
556 * ldlang.c (print_one_symbol): Add declaration.
557 * ldlang.h (dprint_statements): Declare.
558 * ldmain.c (remove_output): Declare.
559 * ldmisc.c (vfinfo): Declare.
560 * ldwrite.c (clone_section): Declare.
561 (split_sections): Make static. Declare.
562 * mri.c: Include libiberty.h.
563 (strdup): Don't declare.
564 (mri_alias): Use xstrdup rather than strdup.
568 * scripttempl/elfmips.sc: Change handling of data area when
569 generating a shared library to not skip a large block of memory.
574 * ldmain.c (multiple_definition): Only skip the warning if the
575 output section is absolute when the input section is not
578 * ldlex.l: Accept whitespace in VERS_START state. Warn about
579 invalid characters in VERS_* states.
583 * emultempl/aix.em (gld${EMULATION_NAME}_read_file): Don't let a
584 trailing space lead us to think that there is a zero address.
588 * ldgram.y (vers_node): Correct typo of '(' for '{'.
592 * scripttempl/tic80coff.sc (ENTRY): Entry symbol is __start
594 (__edata): Define this rather than "edata".
595 (__end): Define this rather than "end".
599 * configure.tgt (tic80-*-*): Allow dropping of -coff.
603 * Makefile.in (ld.dvi): Set MAKEINFO environment variable as well
604 as TEXINPUTS. Needed for building in separate build dir.
605 * ldint.texinfo (SCRIPT_NAME): Fix typo.
606 * emulparams/tic80coff.sh: Rewrite to include internal documentation
607 about each shell variable that is set (or not set).
608 * scripttempl/tic80coff.sc: Complete rewrite.
612 * ldmain.c (main): Call bfd_set_default_target.
613 * Makefile.in (ldmain.o): Define TARGET when compiling.
617 * ldmain.c (main): Don't initialize link_info.lprefix or
618 link_info.lprefix_len.
619 * emultempl/hppaelf.em (hppaelf_before_parse): Likewise.
621 * emultempl/m88kbcs.em: Remove.
622 * emulparams/m88kbcs.sh (TEMPLATE_NAME): Don't set.
623 * Makefile.in (em88kbcs.c): Depend upon generic.em rather than
626 * mri.c (mri_draw_tree): Pass noload_section, not SEC_NEVER_LOAD,
627 to lang_enter_output_section_statement. From Mark Rasin
632 * ldlang.c (lang_one_common): Clear SEC_IS_COMMON from common
637 * configure.tgt (mips*-*-lnews*): New target.
638 * Makefile.in (emipslnews.c): New target.
639 * emulparams/mipslnews.sh: New file.
643 * emultempl/elf32.em (hold_interp): New static variable.
644 (gld${EMULATION_NAME}_place_orphan): Put loadable .note sections
645 after hold_interp. Choose a unique output section name.
646 (gld${EMULATION_NAME}_place_section): Don't set hold_use if the
647 SEC_LOAD or SEC_ALLOC flags differ. Set hold_interp.
652 * ldlex.l (V_TAG, V_IDENTIFIER): New macros.
653 (VERS_START, VERS_SCRIPT, VERS_NODE): New states to parse version
655 (ldlex_version_script, ldlex_version_file): New functions.
656 * ldlex.h (enum input_enum): Add input_version_script.
657 (ldlex_version_script): Declare.
658 (ldlex_version_file): Declare.
659 * ldgram.y (%union): Add deflist, versyms, and versnode.
660 (VERS_TAG, VERS_IDENTIFIER): New terminals.
661 (GLOBAL, LOCAL, VERSION, INPUT_VERSION_SCRIPT): New terminals.
662 (file): Accept INPUT_VERSION_SCRIPT.
663 (ifile_p1): Accept version.
664 (version_script_file): New nonterminal.
665 (version, vers_nodes, vers_node): Likewise.
666 (verdep, vers_tag, ver_defns): Likewise.
667 * ldlang.c (lang_elf_version_info): New global variable.
668 (lang_new_vers_regex): New function.
669 (lang_new_vers_node): New function.
670 (version_index): New static variable.
671 (lang_register_vers_node): New function.
672 (lang_add_vers_depend): New function.
673 * ldlang.h (lang_elf_version_info): Declare.
674 (lang_new_vers_regex, lang_new_vers_node): Declare.
675 (lang_add_vers_depend, lang_register_vers_node): Declare.
676 * lexsup.c (OPTION_VERSION_SCRIPT): Define.
677 (ld_options): Add "version-script".
678 (parse_args): Handle OPTION_VERSION_SCRIPT.
679 * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
680 Pass lang_elf_version_info to size_dynamic_sections.
681 * scripttempl/elf.sc: Add .gnu.version sections.
682 * ld.texinfo: Document symbol versioning.
686 * Makefile.in (ed30velf.c): New target.
687 * configure.tgt (d30v-*-*): New target.
688 * emulparams/d30velf.sh: New file.
689 * scripttempl/elfd30v.sc: New file.
693 * ld.texinfo (Option Commands): Document the INCLUDE command.
697 * configure.in: Call BFD_NEED_DECLARATION on getenv.
698 * acconfig.h (NEED_DECLARATION_GETENV): New macro.
699 * sysdep.h (getenv): Declare if NEED_DECLARATION_GETENV.
700 * ldemul.c (ld_emul_default_target): Do not cast getenv return
702 * ldmain.c (get_emulation): Likewise.
703 * configure, config.in: Rebuild.
707 * scripttempl/elfmips.sc: When relocating, put .mips16.fn.* and
708 .mips16.call.* in .text.
712 * emulparams/tic80coff.sh: New (dummy) file for TIc80.
713 * scripttempl/tic80coff.sc: New (dummy) file for TIc80.
714 * Makefile.in (etic80coff.c): Add target and rule to build it.
715 * configure.tgt (tic80-*-coff): Set targ_emul to tic80coff.
719 * emultempl/sunos.em (gld${EMULATION_NAME}_find_so): Search for
720 ".so" in the name, not ".so.".
721 (gld${EMULATION_NAME}_search_dir): Accept a plain .so file.
723 * Makefile.in (ld.info): Add -I$(srcdir). From Alan Modra
728 * emultempl/sunos.em: Include <ctype.h>.
729 (gld${EMULATION_NAME}_find_so): Skip the directory name when
730 searching for ".so.".
731 (gld${EMULATION_NAME}_search_dir): Make sure that the library name
732 has a version number, and that only version numbers follow .so.
737 * scripttempl/ppcpe.sc: add *(.gcc_except_table) to the text
738 section so Win32 executables are valid.
742 * scripttempl/elf.sc: Put linkonce reloc section in other
743 appropriate reloc sections.
744 * scripttempl/elfmips.sc: Add linkonce support.
745 * scripttempl/elfppc.sc: Likewise.
749 * emulparms/mn10200.sh (OTHER_RELOCATING_SECTIONS): Move the
751 * emulparms/mn10300.sh (OTHER_RELOCATING_SECTIONS): Likewise.
755 * emulparams/m32relf.sh (OTHER_RELOCATING_SECTIONS): Use PROVIDE
760 * ld.h (args_type): Rename auxiliary_filter_shlib to
761 auxiliary_filters, and make it char **.
762 * lexsup.c (parse_args): Handle -f by setting up an array.
763 * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Use
764 new name of auxiliary_filters.
766 * ld.texinfo (Options): Improve documentation of --filter and
771 * ld.texinfo (Options): Clarify that the normal usage is -T.
772 (Commands): Likewise.
776 * scripttempl/armcoff.sc: Correct mask used for .data address.
780 * emultempl/pe.em: make default executable a.exe instead of
785 * scripttempl/elf.sc: Move .got closer to .sdata and .sbss by
786 shifting .plt back. Rumour has it that the NetBSD ld.so depends
787 on .dynamic being after .got, so we leave that.
791 * Makefile.in (clean): Don't remove configdoc.texi.
792 (maintainer-clean): Do remove configdoc.texi.
794 * ld.texinfo (Operators): Remove '@' from @smallexmple in comment
795 to avoid confusing texi2roff.
799 * scripttempl/v850.sc (.zdata): Add .zcommon section.
800 (.tdata): Add .tcommon and .tcommon_byte sections.
804 * configure.tgt (mips*el-*-linux*, mips*-*-linux*): New targets.
805 * scripttempl/elfmips.sc: Use __start as the entry address for
810 * Makefile.in (ALL_CFLAGS): Add -D_GNU_SOURCE.
812 * ld.h (args_type): Add filter_shlib and auxiliary_filter_shlib
814 * lexsup.c (parse_args): Recognize --auxiliary/-f and
816 * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
817 Pass filter_shlib and auxiliary_filter_shlib to
818 size_dynamic_sections.
819 * ld.texinfo, ld.1: Document --filter/-F and --auxiliary/-f.
823 * scripttempl/v850.sc (.tdata) Add .tbss and .tbyte sections.
827 * mpw-make.sed: Use NewFolderRecursive for installation.
831 * scripttempl/v850.sc: Make sure __{e,g}p start relative to the
832 {s,t}data sections. Do not emit any linker generated symbols if
833 -r. Use {TEXT,{Z,S,T}DATA}_START_ADDR variables to initialize
834 where the different sections go. Change some whitespace.
836 * emulparams/v850.sh ({TEXT,{Z,S,T}DATA}_START_ADDR): Define
837 appropriately. Remove crud not used anymore.
841 * Makefile.in (emn10200.c): Add dependencies.
842 * configure.tgt: Handle mn10200.
843 * emulparms/mn10200.sh: New file.
847 * emultempl/gld960c.em: Include <ctype.h>.
848 (gld960_set_output_arch): Get the machine type from the -A option
849 if there is one, rather than always using core.
853 * emulparms/mn10300.sh: Handle leading underscores.
857 * emultempl/elf32.em (gld${EMULATION_NAME}_place_section): Only
858 set hold_rel if SEC_ALLOC is set.
862 * ldlang.c (section_already_linked): Set the output_offset as well
863 as the output_section when only reading symbols from a file.
867 * emulparams/*.sh: Make sure that each set of parameters which
868 uses the elf.sc script sets MACHINE.
872 * scripttempl/elf{,mips,ppc}.sc: Add the remaining DWARF sections.
873 * scripttempl/elfd10v.sc: Likewise.
874 * scripttempl/v850.sc: Likewise.
878 * configure: Rebuild with autoconf 2.12.
882 * emultempl/pe.em (gld_${EMULATION_NAME}_set_symbols): Add case
883 for bfd_vma to init loop.
887 * emulparms/mn10300.sh: Remove bogus '_' prefix for
888 entry symbol and ctor/dtor stuff.
892 * Makefile.in (emn10300.c): Add dependencies.
893 * configure.tgt: Handle mn10300.
894 * emulparms/mn10300.sh: New file.
898 * emulparams/d10velf.sh (READONLY_START_ADDR): Changed to 0x2000004.
903 * ld.texinfo: Add section on reporting bugs.
905 * scripttempl/m68kcoff.sc: Make sure the etext and __CTOR_LIST__
906 symbols are correctly aligned.
910 * scripttempl/v850.sc (zdata): Handle reszdata, romzdata and
915 * emulparams/d10velf.sh: Changes needed for D10V-EVA board.
916 Set TEXT_START_ADDR to 0x1000000. Set READONLY_START_ADDR to
919 * scripttempl/elfd10v.sc: Fix calculation of .text. Change
920 .stack to start at 0x2007ffe.
924 * configure.tgt (sparclet*-*-aout*): Delete, use sparc*-*-aout*.
928 * scripttempl/v850.sc (zdata): Fix typo "zrodata" -> "rozdata".
930 * scripttempl/v850.sc (zdata): Make sure this stays
935 * scripttempl/v850.sc (__ep): Put it at the start
938 * scripttempl/v850.sc: Move all "normal" sections into
939 the external memory region (0x100000 - 0x200000).
943 * scripttempl/elfd10v.sc: Clone from elf.sc, move .text to
944 0x10000, so that is more room for data.
946 * emulparams/d10velf.sh (TEXT_START_ADDR): Now 0x100000.
947 (READONLY_START_ADDR): Now 0x0.
948 (SCRIPT_NAME): Now elfd10v.
950 * Makefile.in (ed10velf.c): Depend on elfd10v.sc, not elf.sc.
954 * emulparams/m32relf.sh (TEXT_START_ADDR): Change from 0 to 0x100.
958 * Makefile.in (ALL_EMULATIONS): Remove eelf64alpha.o.
959 (ALL_64_EMULATIONS): New variable.
960 * configure.in: Accept --enable-64-bit-bfd option. If it is set
961 with --enable-targets=all, include ALL_64_EMULATIONS in
963 * configure: Rebuild.
967 * scripttempl/v850.sc (__gp, __ep): Define.
971 * ld.texinfo: Try to consistently use a single or a double dash
976 * emulparams/m32relf.sh (EMBEDDED): Define.
980 * scripttempl/v850.sc (.zdata): Add this before .text.
981 (.sdata): Also include .rosdata as part of the .sdata.
982 (.tdata): Include this just before .sdata.
984 * emulparms/v850.sh (SCRIPT_NAME): Use "v850" not "elf".
985 * scripttempl/v850.sc: Wrap script with a "cat << EOF".
989 * scripttempl/v850.sc: New linker script for the V850.
990 * Makefile.in: Use it.
994 * emulparams/elf32b4300.sh: Define _gp in OTHER_GOT_SYMBOLS, not
995 OTHER_READWRITE_SECTIONS.
996 * emulparams/elf32l4300.sh: Likewise.
1000 * ld.h (ld_config_type): Add warn_section_align field.
1001 * lexsup.c (OPTION_WARN_SECTION_ALIGN): Define.
1002 (ld_options): Add --warn-section-align.
1003 (parse_args): Handle --warn-section-align.
1004 * ldlang.c (lang_size_sections): If warn_section_align, warn if
1005 the start of a section changes due to alignment.
1006 * ld.texinfo, ld.1: Document --warn-section-align.
1007 * ld.texinfo: Change some single dashes to double dashes.
1009 * emultempl/pe.em (set_pe_subsystem): Record entry symbol for each
1010 subsystem type. Ifdef out os2 type. Recognize a version number.
1014 * emultempl/pe.em (set_pe_subsystem): When setting the subsystem
1015 to windows, set the entry point.
1017 * Makefile.in (ldlex.c): Don't pass any options to $(LEX).
1021 * ld.texinfo (Options): Mention .so extensions for shared
1026 * scripttempl/elf{,mips,ppc}.sc: Add DWARF 2 sections.
1030 * scripttempl/m68kcoff.sc: Only set the address of .text if
1035 * emulparams/sparcaout.sh ({BIG,LITTLE}_OUTPUT_FORMAT): Define.
1036 * scripttempl/aout.sc ({BIG,LITTLE}_OUTPUT_FORMAT): Provide default.
1037 (OUTPUT_FORMAT): Support bi-endian targets.
1041 * fnmatch.h, fnmatch.c: Remove (now in libiberty).
1042 * Makefile.in: Rebuild dependencies.
1043 (CFILES): Remove fnmatch.c.
1044 (HFILES): Remove fnmatch.h.
1045 (OFILES): Remove fnmatch.o.
1049 * Makefile.in (mostlyclean): Move config.log to distclean.
1053 * emultempl/pe.em: increase size of stack reserve to 0x2000000
1054 (necessary in order to compile parse.c in gcc sources under NT)
1058 * lexsup.c (ld_options): Fix typo in --rpath-link description.
1059 * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Suggest
1060 --rpath if a needed library is not found.
1064 * configure.tgt (mips*-*-rtems*): New target, like mips*-*-elf*.
1068 * ld.texinfo (Options): Give more detail on -l option.
1070 * scripttempl/elfmips.sc: Handle CREATE_SHLIB the same way that
1071 elf.sc does, so that glibc works better.
1073 * ldver.c (ld_program_version): New variable.
1074 (ldversion): Use it.
1075 * ldver.h (ld_program_version): Declare.
1076 * lexsup.c (ld_options): Handle --dll-verbose like --verbose, not
1077 --version. Change --version handling to match current GNU
1079 (help): Print bug report address.
1083 * Makefile.in (em32relf.c): Add rule for.
1084 * configure.tgt (m32r-*-*): Recognize.
1085 * emulparams/m32relf.sh: New file.
1089 * mpw-make.sed: Add symbolic doublequoting to ldmain compile edit.
1090 * mpw-config.in: Add mips-*-* case as mips-elf, and use more
1091 wildcards in matching.
1092 * mpw-emipself.c: New file, pregenerated mips elf emulation.
1096 * ldint.texinfo: Rewrote.
1098 * configure.tgt: Add cases for MIPS 5000 like MIPS 4300.
1102 * scripttempl/armcoff.sc: Only define symbols if RELOCATING. Fix
1103 syntax error on __end__ line.
1105 * scripttempl/armcoff.sc: For -N or -n, don't align .data. From
1110 * emulparms/v850.sh: Fix OTHER_RELOCATING_SECTIONS.
1114 * emulparms/d10v.sh: Set OTHER_RELOCATING_SECTIONS to put
1115 stack at top of simulator memory.
1119 * ldlex.l (SYMBOLCHARN): Add $, _, and ~.
1123 * ldmain.c (get_emulation): Check for -mips4 like -mips1, et. al.
1127 * ldlang.c (section_already_linked): Accept a lang_input_statement
1128 as the PTR argument. If the file is symbols only, discard all
1130 (ldlang_add_file): Pass entry to bfd_map_over_sections.
1134 * configure.tgt (alpha-*-gnu*): New target. From Fila Kolodny
1139 * emulparms/v850.sh: Set OTHER_RELOCATING_SECTIONS
1143 * emulparms/v850.sh: Set EMBEDDED.
1147 * emulparms/v850.sh: Entry symbol is "_start", tweak
1152 * configure.tgt (sh-*-elf*): New target.
1153 * emulparams/shelf.sh: New file.
1154 * emulparams/shlelf.sh: New file.
1155 * Makefile.in (ALL_EMULATIONS): Add eshelf.o and eshlelf.o.
1156 (eshelf.c, eshlelf.c): New targets.
1157 * scripttempl/elf.sc: If EMBEDDED is defined, then don't add
1158 SIZEOF_HEADERS to TEXT_START_ADDR. Expand CTOR_START and CTOR_END
1159 around .ctors, and DTOR_START and DTOR_END around .dtors. Expand
1160 OTHER_RELOCATING_SECTIONS if RELOCATING.
1164 * configure.{host,tgt} (i[345]86-*-*): Recognize i686 for pentium
1169 * ldgram.y (section): Add opt_nocrossrefs; pass value to
1171 (opt_nocrossrefs): New nonterminal.
1172 * ldlex.l: Recognize NOCROSSREFS keyword in EXPRESSION mode.
1173 * ldlang.c (overlay_nocrossrefs): New static variable.
1174 (lang_enter_overlay): Add nocrossrefs parameter.
1175 (lang_leave_overlay): Only add nocrossrefs if overlay_nocrossrefs
1176 is set. Initialize overlay_nocrossrefs.
1177 * ldlang.h (lang_enter_overlay): Update declaration.
1178 * ld.texinfo (Overlays): Update documentation.
1180 * ldver.c (ldversion): Print GNU ld in the version message.
1184 * configure.host: Set HLDENV.
1185 * configure.in: Substitute HLDENV.
1186 * configure: Rebuild.
1187 * Makefile.in (HLDENV): New variable.
1188 ($(LD_PROG)): Use $(HLDENV).
1192 * Makefile.in (ev850.c): New target.
1193 * configure.tgt (v850-*-*): New target.
1194 * emulparams/v850.sh: New file.
1198 * mpw-make.sed: Add @DASH_C_FLAG@ to compiler edit.
1202 * scripttempl/elf.sc: Put .gnu.linkonce* sections in appropriate
1203 containing sections.
1207 * fnmatch.c: Include sysdep.h.
1211 * genscripts.sh: Undo 8/16 change.
1213 * emulparams/d10velf.sh (MACHINE): Explicitly set to nothing.
1217 * genscripts.sh: Explicitly reset any shell variables set or used
1218 by the various .sc scripts to allow inadvertant use of these
1219 names as normal environment variables by the person running
1222 * Makefile.in (ed10velf.c): Use tdir_d10v, not tdir_arcelf.
1226 * scripttempl/armcoff.sc (__bss_start__, __bss_end__,
1227 __data_start__, __data_end__): Added to keep in sync. with the
1228 default ARM crt0.s. Added __CTOR_LIST__ and __DTOR_LIST__ support.
1232 * ldcref.c (check_reloc_refs): If info->same, look for any symbol
1233 defined in info->defsec, not just the section symbol.
1237 * configure.in: Call BFD_NEED_DECLARATION on strstr and sbrk.
1238 * acconfig.h (NEED_DECLARATION_STRSTR): New macro.
1239 (NEED_DECLARATION_SBRK): New macro.
1240 * configure, config.in: Rebuild.
1241 * sysdep.h (strstr): Declare if NEED_DECLARATION_STRSTR.
1242 * ldmain.c (sbrk): Declare if HAVE_SBRK and
1243 NEED_DECLARATION_SBRK.
1245 * ldlang.c (lang_record_phdrs): Cast xmalloc and xrealloc return.
1249 * ldlex.l: Recognize OVERLAY.
1250 * ldgram.y: Add section_phdr field to %union.
1251 (section): Handle phdr_opt result. Add OVERLAY case.
1252 (opt_exp_without_type): New nonterminal.
1253 (phdr_opt): Return list of phdrs.
1254 (overlay_section): New nonterminal.
1255 * ldlang.c: Include <ctype.h>.
1256 (lang_leave_output_section_statement): Add phdrs parameter.
1258 (lang_section_in_phdr): Remove.
1259 (overlay_vma, overlay_lmn, overlay_max): New static variables.
1260 (struct overlay_list): Define.
1261 (overlay_list): New static variable.
1262 (lang_enter_overlay, lang_enter_overlay_section): New functions.
1263 (lang_leave_overlay_section, lang_leave_overlay): New functions.
1264 * ldlang.h (lang_leave_output_section_statement): Update
1265 declaration for new parameter.
1266 (lang_section_in_phdr): Don't declare.
1267 (lang_enter_overlay, lang_enter_overlay_section): Declare.
1268 (lang_leave_overlay_section, lang_leave_overlay): Declare.
1269 * ld.texinfo (Overlays): New node under SECTIONS, documenting
1272 * ldlex.l: Recognize MAX and MIN.
1273 * ldgram.y (MAX, MIN): New terminals.
1274 (exp): Recognize MAX and MIN.
1275 * ldexp.c (fold_binary): Handle MAX and MIN.
1276 * ld.texinfo (Arithmetic Functions): Document MAX and MIN.
1278 * ld.texinfo (PHDRS): Use @cindex, not @kindex, for program header
1281 * ldgram.y (SIZEOF, ADDR): Do not specify type.
1283 * ldcref.c (check_nocrossref): Skip symbols with no output
1288 * ldgram.y (LOADADDR): New terminal.
1289 (exp): Handle LOADADDR.
1290 * ldlex.l: Recognize LOADADDR.
1291 * ldexp.c (exp_print_token): Add LOADADDR.
1292 (fold_name): Implement LOADADDR.
1293 * ldlang.c (exp_init_os): Treat LOADADDR like ADDR.
1294 * ld.texinfo (Arithmetic Functions): Document LOADADDR.
1298 * ld.h (check_nocrossrefs): Declare.
1299 * ldlang.h (struct lang_nocrossref): Define.
1300 (struct lang_nocrossrefs): Define.
1301 (nocrossref_list): Declare.
1302 (lang_add_nocrossref): Declare.
1303 * ldlex.l: Recognize NOCROSSREFS keyword.
1304 * ldgram.y (%union): Add nocrossref field.
1305 (NOCROSSREFS): New terminal.
1306 (ifile_p1): Recognize NOCROSSREFS.
1307 (nocrossref_list): New nonterminal.
1308 * ldlang.c (nocrossref_list): Define.
1309 (lang_add_nocrossref): New function.
1310 * ldmain.c (main): If nocrossref_list is not NULL, call
1312 (warning_callback): Free symbols if there is no place to store
1314 (notice): Call add_cref if nocrossref_list is not NULL.
1315 * ldcref.c: Include "ldexp.h" and "ldlang.h".
1316 (check_nocrossrefs): New function.
1317 (check_nocrossref): New static function.
1318 (struct check_refs_info): Define.
1319 (check_refs, check_reloc_refs): New static functions.
1320 * Makefile.in: Rebuild dependencies.
1321 * ld.texinfo (Option Commands): Document NOCROSSREFS.
1323 * ld.texinfo (Section Placement): Improve the wording of the
1324 wildcard documentation. Mention that wildcards are only searched
1325 for on the command line, not in the file system.
1327 * emultempl/sunos.em (gld${EMULATION_NAME}_after_open): Move
1328 definition of lib_path inside condition where it is used.
1332 * emulparams/d10velf.sh: Now works with elf.sc.
1336 * emulparams/d10velf.sh (SCRIPT_NAME): Change to vanilla.
1340 * ldlang.c (lang_size_sections): Add the section VMA to the result
1341 value when computing the address of a section.
1343 * ld.h (args_type): Add cref field.
1344 * lexsup.c (parse_args): Set command_line.cref.
1345 * ldmain.c (main): Check command_line.cref rather than
1346 link_info.notice_all.
1349 * ldcref.c (output_one_cref): Don't crash if a symbol is defined
1350 in a section without an owner.
1354 * fnmatch.h, fnmatch.c: New files.
1355 * ldlex.l: Remove unused definition of FILENAME. Add definition
1356 of WILDCHAR. In SCRIPT mode, accept any sequence of WILDCHAR as a
1358 * ldgram.y (file_NAME_list): Accept '*' and '?' specially.
1359 (input_section_spec): Accept '?' specially.
1360 (statement): Change exp to mustbe_exp in length and FILL cases.
1361 (section): Call ldlex_script before section statements, and call
1362 ldlex_popstate after them.
1363 * ldlang.c: Include "fnmatch.h".
1364 (wildcardp): New static function.
1365 (wild_section): Permit the section name to be a wildcard.
1366 (wild_file): New static function, broken out of wild.
1367 (wild): Call wild_file. Permit the file name to be a wildcard.
1368 (open_input_bfds): Don't call lookup_name for a wildcard pattern.
1369 * Makefile.in: Rebuild dependencies.
1370 (CFILES): Add fnmatch.c.
1371 (HFILES): Add fnmatch.h.
1372 (OFILES): Add fnmatch.o.
1373 * ld.texinfo: Document that file and section names can now be
1376 * ldlang.c (lang_place_orphans): Correct condition: place a common
1377 section if not relocateable or if common definitions are forced.
1381 * emulparams/d10velf.sh (SCRIPT_NAME): Change to elf.
1385 * configure.tgt (d10v-*-*): Don't require the -elf, allow plain d10v.
1389 * Makefile.in (ed10velf.c): New target.
1390 * configure.tgt (d10v-*-elf*): New target.
1391 * emulparams/d10velf.sh: New file.
1395 * configure.tgt (sparc*-*-sysv4*): New target. From Andrew Gierth
1398 * configure.host: Change irix5 to irix[56]*.
1399 * configure.tgt: Likewise.
1403 * emultempl/pe.em (sort_sections): Pay attention to return code.
1405 * ldmisc.c (demangle): Remove all prefix '.'s from a name.
1409 * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Round
1410 the value of __start_SECNAME to the alignment required by the
1411 section to be placed.
1415 * configure.tgt (mips*el-*-elf*): Use elf32elmip.
1416 (mips*-*-elf*): Use elf32ebmip.
1417 * emulparams/elf32bmip.sh (EMBEDDED): Don't define.
1418 * emulparams/elf32lmip.sh (EMBEDDED): Don't define.
1419 * emulparams/elf32elmip.sh: New file; copy of elf32lmip.sh with
1421 * emulparams/elf32ebmip.sh: New file; copy of elf32bmip.sh with
1423 * emulparams/elf32b4300.sh (EMBEDDED): Define.
1424 * emulparams/elf32l4300.sh (EMBEDDED): Define.
1425 * Makefile.in (ALL_EMULATIONS): Add eelf32ebmip.o eelf32elmip.o.
1426 (eelf32ebmip.c, eelf32elmip.c): New targets.
1430 * ldver.c (ldversion): Set version to cygnus-2.7.1.
1432 * Released binutils 2.7.
1434 * emulparams/pc532macha.sh: Rename from pc532machaout.sh to avoid
1435 System V file name limitations.
1436 * configure.tgt (nc32k-pc532-mach*, ns32k-pc532-ux*): Use
1437 pc532macha rather than pc532machaout.
1438 * Makefile.in (ALL_EMULATIONS): Change epc532machaout.o to
1440 (epc532macha.c): Rename target from epc532machaout.c.
1444 * ldlang.c (print_padding_statement): Use %u, not %x, to print
1449 * mpw-eppcmac.c: Update to reflect May 23 change to aix.em.
1453 * emultempl/sunos.em (gld${EMULATION_NAME}_find_so): Put the .sa
1454 file just before the .so file, rather than just after.
1456 * configure.host: Use -print-file-name=FILE rather than piping
1457 -print-libgcc-file-name through sed.
1458 (i[345]86*-*-sco*, i[345]86-*-isc*): Create crtbegin.o and
1459 crtend.o files, in case gcc doesn't use them.
1460 * Makefile.in (mostlyclean): Remove crtbegin.o and crtend.o.
1464 * configure.tgt (mips*-dec-osf*): New target.
1468 * Makefile.in (bindir, libdir, datadir, mandir, infodir, includedir,
1469 INSTALL_PROGRAM, INSTALL_DATA): Use autoconf-set values.
1471 * configure.in (AC_PREREQ): autoconf 2.5 or higher.
1472 (AC_PROG_INSTALL): Added.
1473 * configure: Rebuilt.
1477 * scripttempl/elfppc.sc (_GLOBAL_OFFSET_TABLE_): Don't do a
1478 PROVIDE of _GLOBAL_OFFSET_TABLE_, since it needs to be at a
1483 * ldlang.h (enum section_type): Define.
1484 (lang_output_section_statement_type): Remove loadable field. Add
1486 (lang_enter_output_section_statement): Change flags parameter in
1487 prototype to sectype.
1488 * ldgram.y (typebits): Remove.
1489 (sectype): New static variable.
1490 (opt_at): Use sectype rather than typebits.
1491 (type): Set sectype rather than typebits.
1493 * ldlex.l: Recognize DSECT, COPY, INFO, and OVERLAY in
1495 * ldlang.c (lang_output_section_statement_lookup): Set sectype
1496 field rather than loadable field.
1497 (wild_doit): Check sectype rather than loadable.
1498 (lang_record_phdrs): Likewise.
1499 (lang_enter_output_section_statement): Rename flags parameter to
1500 sectype. Set sectype field rather than loadable field. Set flags
1501 field based on sectype.
1505 * scripttempl/elf.sc: Force .stab* and .comment sections to start
1508 * configure.in: On alpha*-*-osf*, link against libbfd.a if not
1509 using shared libraries.
1510 * configure: Rebuild with autoconf 2.10.
1514 * configure.tgt: Add support for *-*-rtems* configurations.
1518 * configure.tgt (alpha-*-linuxecoff*): New target.
1519 (alpha-*-linux*): Use elf64alpha.
1520 * emulparams/elf64alpha.sh: New file.
1521 * emultempl/elf32.em: If ELFSIZE is not set, set it to 32. Use
1522 ${ELFSIZE} rather than 32 when calling BFD routines.
1523 (hold_rodata): New static variable.
1524 (gld${EMULATION_NAME}_place_orphan): Use hold_rodata for a
1525 readonly section that is not code.
1526 (gld${EMULATION_NAME}_place_section): Set hold_rodata. Don't use
1527 a .rel section unless its bfd_section field is not NULL.
1528 * Makefile.in (ALL_EMULATIONS): Add eelf64alpha.o.
1529 (eelf64alpha.c): New target.
1533 * ldmisc.c (vfinfo): Correct handling of 0 in %W case.
1537 Add enough support to understand the gcc svr3.ifile script:
1538 * ldlex.l: Recognize BLOCK and GROUP in EXPRESSION context. Add
1540 * ldgram.y: Add BIND token.
1541 (section): Recognize GROUP.
1542 (opt_ext_with_type): Recognize a couple of cases of BIND.
1543 * ldlang.c (init_os): Don't do anything if section is already
1544 initialized. Call exp_init_os on addr_tree field.
1545 (exp_init_os): New static function.
1546 (map_input_to_output_sections): Call exp_init_os on assignment
1548 (lang_place_orphans): Check for common sections by name COMMON
1549 rather than by common_section field. Don't warn about absence of
1552 * ldlang.h (lang_input_statement_type): Remove useless fields
1553 common_section, common_output_section, and complained, as well as
1554 all references to them.
1556 * ldexp.c: Reindent a lot of code.
1557 (exp_fold_tree): Call FAIL rather than einfo in default case.
1561 * configure.host (m88*-*-dgux*): Quote HOSTING_CRT0. From
1566 * scripttempl/h8300s.sc: New file for H8/S.
1567 * emulpararms/h8300s.sh: New file for H8/S.
1568 * Makefile.in (ALL_EMULATIONS): Add H8/S.
1569 (e_h8300s.c): Add dependencies.
1570 * configure.tgt: Add H8/S to targ_extra_emuls.
1574 * configure.tgt (i[345]86*-*-isc*): New target. From
1579 * lexsup.c: Include "libiberty.h".
1580 (parse_args): Copy the -Y argument into memory.
1581 (set_default_dirlist): Don't put the ':' back into the directory
1586 * emultempl/sunos.em: Include libiberty.h.
1587 (gld${EMULATION_NAME}_set_symbols): New static function to add
1588 LD_LIBRARY_PATH to the list of search directories.
1589 (ld_${EMULATION_NAME}_emulation): Add new set_symbols routine.
1593 * emulparams/elf32bmip.sh (OTHER_GOT_SYMBOLS): Use ALIGN(16)
1594 rather than . when computing _gp value. From Per Fogelstrom.
1595 * emulparams/elf32lmip.sh (OTHER_GOT_SYMBOLS): Likewise.
1597 * ldmain.c (main): Don't close and unlink the file on error, since
1598 remove_output will do it anyhow.
1599 * ldlang.c (open_output): Set boolean variable to true, not 1.
1603 * emulparams/{elf32b4300.sh,elf32l4300.sh} (SCRIPT_NAME): Use
1604 elfmips instead of elf.
1608 * ldcref.c: New file.
1609 * ld.h (add_cref, output_cref): Declare.
1610 * ldmain.c (main): Initialize notice_all field. If it is set at
1611 end of link, call output_cref.
1612 (notice): Rename from notice_ysym. Check notice_all.
1613 * ldmisc.c (finfo): Make globally visible.
1614 * ldmisc.h (finfo): Declare.
1615 * lexsup.c (OPTION_CREF): Define.
1616 (ld_options): Add "cref".
1617 (parse_args): Handle OPTION_CREF.
1618 * Makefile.in: Rebuild dependencies.
1619 (CFILES): Add ldcref.c.
1620 (OFILES): Add ldcref.o.
1621 * ld.texinfo, ld.1: Document --cref.
1625 * Makefile.in (install): Make $(tooldir) and $(tooldir)/bin.
1629 * emultempl/pe.em (sort_sections): Don't assume that a
1630 wild_statement has a section name.
1634 * scripttempl/elfmips.sc: Quote test -z argument.
1636 * ld.texinfo: Clarify the CONSTRUCTORS command.
1640 * emultempl/aix.em (gld${EMULATION_NAME}_read_file): Initialize
1645 * ldlang.c (wild_doit): Don't copy over SEC_LINK_{ONCE,DUPLICATES}
1647 * emultempl/pe.em (sfunc): Renamed to sort_by_file_name.
1648 (sort_by_section_name, sort_sections_1): New functions.
1649 (sort_sections): Only sort by file name sections in .idata.
1650 Add "Grouped Sections" support.
1651 (gld${EMULATION_NAME}_place_orphan): Rewrite to support Grouped
1653 (gld${EMULATION_NAME}_place_section): Delete.
1654 * scripttempl/pe.sc (.text,.data,.rdata): Add *(.foo\$).
1655 (.CRT,.rsrc): Rewrite to use Grouped Section support.
1659 * mpw-eppcmac.c: Update to reflect changes to aix.em.
1663 * ldlang.c (dprint_statement): Stop printing at end of list.
1667 Support for --force-exe-suffix
1668 * ld.h (args_type): Add force_exe_suffix.
1669 * ld.texinfo: Add documentation.
1670 * ldmain.c (main): Add support for option.
1671 * lexsup.c (OPTION_FORCE_EXE_SUFFIX): New.
1672 (ld_options, parse_args): Add support for option.
1676 * emultempl/pe.em (set_pe_value): Pass 0 not 16 to strtoul call.
1680 * scripttempl/elfppc.sc (__stack): Make __stack 0 if it was
1681 referenced but not defined.
1685 * emulparams/{elf32bmip.sh,elf32lmip.sh,mipsidt.sh,mipsidtl.sh}:
1686 Set a new variable to signify if the final target is an embedded
1688 * scripttempl/{mips.sc,elfmips.sc}: Don't add SIZEOF_HEADERS to
1689 .text for an embedded system.
1693 * emultempl/pe.em (gld${EMULATION_NAME}_place_orphan): New function.
1694 (gld${EMULATION_NAME}_place_section): New function.
1695 (hold_{section,use,text,rdata,data}): New static locals.
1696 (ld_${EMULATION_NAME}_emulation): Update orphan field.
1697 * scripttempl/pe.sc: Whitespace cleanup. Semicolon usage cleanup.
1698 (INIT,FINI): Delete, unused.
1699 (.text): Document orphan .text.foo sections.
1700 (.rdata): Document orphan .rdata.foo sections.
1701 (.data): Document orphan .data.foo sections.
1705 * scripttempl/h8300.sc: Place ".tiny" sections right
1706 after ".data" sections.
1707 * scripttempl/h8300h.sc: Place ".tiny" sections into
1708 the "tiny" memory region, 0xff8000 through 0xffff00.
1710 * scripttempl/h8300.sc: Set the entry point to the value of
1711 "_start" rather than the start of the text segment.
1712 * scripttempl/h8300h.sc: Likewise.
1714 * scripttempl/h8300.sc: Place .rodata sections before .text
1715 sections in main ram.
1716 * scripttempl/h8300h.sc: Likewise.
1720 * scripttempl/h8300h.sc: Use "eight", not "eightbit" for the
1721 8-bit region and 8-bit sections.
1725 * ldlang.c (section_already_linked): Fix typos.
1729 * scripttempl/pe.sc (.endjunk): Define __end__.
1733 * ldlang.c (longest_section_name): Remove.
1734 (SECTION_NAME_MAP_LENGTH): Define.
1735 (print_size, print_alignment, print_fill, print_section): Remove.
1736 (print_flags): Remove.
1737 (lang_map): Rewrite.
1738 (print_output_section_statement): Rewrite.
1739 (print_assignment): Rewrite.
1740 (print_one_symbol): Rewrite.
1741 (print_input_section): Rewrite.
1742 (print_fill_statement): Rewrite.
1743 (print_data_statement): Rewrite.
1744 (print_address_statement): New static function.
1745 (print_reloc_statement): Rewrite.
1746 (print_padding_statement): Rewrite.
1747 (print_wild_statement): Rewrite.
1748 (print_statement_list): Clean up.
1749 (print_statement): Clean up. Some minor output changes.
1750 (print_statements): Clean up.
1751 (load_symbols): Put another - before -whole-archive.
1752 * ldexp.c (exp_print_tree): Change etree_value and etree_rel to
1753 print 0x and to omit leading zeroes. For etree_rel, use %B to
1754 print the BFD. For etree_assign, remove the space after the
1756 * ldwrite.c: Include "libiberty.h".
1757 (clone_section): Call xstrdup, not strdup.
1758 (ldwrite): Don't print any map information.
1759 (print_symbol_table, print_file_stuff, print_symbol): Remove.
1760 * ldmain.c (main): Call lang_map when appropriate.
1761 * ldmisc.c (vfinfo): Add support for %W.
1762 (print_address): Remove.
1763 * ldmisc.h (print_address): Don't declare.
1764 * Makefile.in: Rebuild dependencies.
1768 * configure.host (m68*-*-linux*): Add -dynamic-linker to
1769 HOSTING_CRT0. Search -lgcc both before and after -lc in
1770 HOSTING_LIBS. Look for crt{begin,end}.o in the compiler directory
1772 (i[345]86-*-linux*): Look for crt{begin,end}.o in the compiler
1777 * ldmisc.h (demangle): Declare.
1778 * ldmisc.c: Include "libiberty.h". Include demangle.h with "",
1780 (demangle): Make non-static. Remove remove_underscore paramter.
1781 Always return an allocated string.
1782 (vfinfo): Free result of demangle. Add case 'G'. Use %T to print
1783 functionname, rather than calling demangle. Print a colon between
1784 the BFD(section+offset) and the line number.
1785 * ldmain.c (add_archive_element): Improve format of archive
1786 information in map file.
1787 (constructor_callback): Don't print anything to the map file.
1788 * ldlang.c (lang_one_common): Improve format of common symbol
1789 information in map file.
1790 * ldctor.c (ldctor_build_sets): If producing a map file, print set
1792 * ldwrite.c (print_symbol_table): Print a newline before the
1793 header in the map file.
1794 * Makefile.in: Rebuild dependencies.
1796 * ldmisc.c (vfinfo): Reindent.
1800 * ldlang.c (lang_size_sections): If _cooked_size is not 0, then
1801 don't clobber it when not relaxing.
1803 * ld.h (ld_config_type): Remove traditional_format field.
1804 * ldmain.c (main): Use link_info.traditional_format rather than
1805 config.traditional_format.
1806 * ldlang.c (ldlang_open_output): Likewise.
1807 * lexsup.c (parse_args): Likewise.
1808 * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Likewise.
1809 * mpw-eppcmac.c (gldppcmacos_parse_args): Likewise.
1811 * ldlang.c (wild_doit): Discard debugging sections if we are
1812 stripping debugging information.
1814 * emulparams/z8002.sh (ARCH): Set to z8002, not z8k.
1818 * ldexp.c (fold_binary): Correct handling of subtraction with
1820 (fold_name): Permit symbols in lang_allocating_phase_enum.
1822 * scripttempl/aout.sc: Only PROVIDE __stack when RELOCATING. Undo
1823 accidental changes in last patch.
1827 * configure.tgt (powerpc*-*-{sysv,linux}): Add aliases.
1828 (powerpcle*-*-{sysv,solaris}): Ditto.
1832 * scripttempl/aout.sc: Add PROVIDE (__stack = 0) so I can use it
1833 in m68k/crt0.S without things blowing up.
1837 * scripttempl/m68kcoff.sc: Remove default address for .data so
1838 .text, .data, and .bss are all sequential.
1842 * scripttempl/m68kcoff.sc: Remove regions and simplify.
1846 * scripttempl/h8300.sc: Add the "8-bit area" in the upper 256
1847 bytes of the address space. Put data from the ".eight" sections
1848 into the 8-bit area.
1849 * scripttempl/h8300h.sc: Likewise.
1853 * emultempl/generic.em (gld${EMULATION_NAME}_before_parse):
1854 Pass $ARCH to ldfile_set_output_arch instead of setting
1855 ldfile_output_architecture directly.
1859 * scripttempl/elfppc.sc (.init,.fini): Put .init, .fini section
1860 next to .text. Put _etext after .text, .init, .fini, and
1861 .rodata{,2} sections.
1865 * ld.texinfo: Rearrange option documentation.
1867 * lexsup.c (ld_options): New static array.
1868 (parse_args): Build shortopts and longopts from ld_options array.
1869 (help): New static function.
1870 * ldver.h (help): Don't declare.
1871 * ldver.c (ldversion): Reindent.
1874 * ld.texinfo, ld.1: Mention -E as a synonym for -export-dynamic.
1878 * emultempl/elf32.em: When checking for a native emulation, check
1879 that the current emulation is the default emulation.
1880 * emultempl/sunos.em: Likewise.
1882 * configure.in: Permit --enable-shared to specify a list of
1884 * configure: Rebuild.
1886 * lexsup.c (parse_args): Add -E as a synonym for -export-dynamic,
1887 for HP/UX compatibility.
1891 * emultempl/elf32.em (gld${EMULATION_NAME}_check_ld_so_conf): New
1892 static function, if ${host} = ${target}.
1893 (gld${EMULATION_NAME}_after_open): Call check_ld_so_conf to find a
1894 needed shared library if ${host} = $[target}.
1896 * configure.host (i[345]86-*-linux*): Add -dynamic-linker to
1897 HOSTING_CRT0. Search -lgcc both before and after -lc in
1900 * configure.tgt: Add i[345]86-*-freebsdelf* target; from John
1905 * emulparams/elf32{b,l}4300.sh (MACHINE): Add explicit
1906 architecture number.
1907 * scripttempl/elf.sc: Use $MACHINE definition if present.
1908 * configure.tgt (targ_extra_emuls): Force 4100 build to use same
1913 * ldlang.c (lang_size_sections): Change region check to handle
1914 regions which end at the highest possible address correctly.
1917 * ldlang.c (section_already_linked): New static function.
1918 (wild_doit): Discard sections with SEC_EXCLUDE set if not doing a
1919 relocateable link. Don't worry about section being NULL, since it
1920 never should be. Don't call init_os unless the section is going
1922 (ldlang_add_file): Call section_already_linked for each section.
1923 * ldmain.c (multiple_definition): Don't warn about multiple
1924 definitions in sections which are being discarded.
1928 * scripttempl/{ppcpe.sc, pe.sc} (.junk): Remove and use /DISCARD/.
1929 * emultempl/pe.em (init): Remove special case PPC code.
1933 * scripttempl/h8300.sc: Make vectors section 0xc4 bytes long
1934 so as not to overwrite the magic syscall entry at 0xc4.
1935 * scripttempl/h8300h.sc: Likewise.
1939 * configure.tgt (sparc64-*-solaris2*): Delete.
1940 Stick with sparc-*-solaris2*.
1944 * ld.h (DISCARD_SECTION_NAME): Define to "/DISCARD/".
1945 * ldlang.c (init_os): Fail on an attempt to initialize any section
1946 named DISCARD_SECTION_NAME.
1947 (wild_doit): Discard input sections assigned to an output section
1948 named DISCARD_SECTION_NAME.
1949 * ld.texinfo: Document use of /DISCARD/.
1951 * ldlang.c: Fix some indentation and comments.
1955 * ldmain.c (main): Call bfd_set_error_program_name.
1959 * ld.texinfo: Fix a couple of indexing entries. Mention that
1960 --verbose displays builtin linker scripts.
1962 * ldmisc.c (vfinfo): case 'I': If the file is not in an archive,
1963 and the local symbol name does not match the filename, print the
1967 * lexsup.c (parse_args): -Bshareable is a synonym for -shared.
1968 * emulparams/elf_i386.sh (NONPAGED_TEXT_START_ADDR): Make the same
1973 * ld.texinfo: Fix typos. Use @pxref only inside parentheses.
1977 * ldmain.c (add_wrap): New function.
1978 * ldmain.h (add_wrap): Declare.
1979 * lexsup.c (parse_args): Call add_wrap.
1983 * configure.host (sparc*-*-solaris2* host): Accept any sparc variant.
1987 * scripttempl/h8300.sc: Change name of page zero memory
1988 from "null" to "vectors". Create an output section for
1989 vectors. Add comments on how to explicitly place items
1990 in the vector table.
1991 * scripttempl/h8300h.sc: Likewise.
1995 * emultempl/lnk960.em (machine_table): Add jx and hx.
1997 * genscripts.sh: Don't use ${9:-xx}, since Ultrix /bin/sh doesn't
2002 * ld.h (ld_config_type): Add warn_multiple_gp field.
2003 * lexsup.c (parse_args): Handle --warn-multiple-gp.
2004 * ldmain.c (warning_callback): Suppress multiple gp values warning
2005 if --warn_multiple_gp was not used.
2006 * ld.texinfo, ld.1: Document --warn-multiple-gp.
2010 * lexsup.c (parse_args): Handle --wrap.
2011 * ldmain.c (main): Initialize link_info.wrap_hash.
2012 * ldexp.c (fold_name): Use bfd_wrapped_link_hash_lookup in DEFINED
2014 * ld.texinfo, ld.1: Document --wrap.
2016 * configure: Rebuild with autoconf 2.8.
2018 Don't do SunOS style dynamic linking for sparc-aout:
2019 * configure.tgt (sparc64-*-aout*): Use sparcaout, not sun4.
2020 (sparclite*-fujitsu-*, sparc*-*-aout): Likewise.
2021 (sparc*-wrs-vxworks*): Likewise.
2022 * emulparams/sparcaout.sh: New file.
2023 * Makefile.in (ALL_EMULATIONS): Add esparcaout.o.
2024 (esparcaout.c): New target.
2028 * scripttempl/elfppc.sc (.sdata2, .sbss2): Implement Feb 2 change
2029 in a different manner to work around differences in shell variable
2034 * ldemul.h (ldemul_unrecognized_file): Declare.
2035 (ldemulation_xfer_type): Add unrecognized_file field.
2036 * ldemul.c (ldemul_unrecognized_file): New function.
2037 * ldlang.c (load_symbols): If a file can not be recognized, call
2038 ldemul_unrecognized_file before trying it as a linker script.
2039 * emultempl/aix.em (gld${EMULATION_NAME}_unrecognized_file): New
2041 (gld${EMULATION_NAME}_read_file): Use FOPEN_RT, not "r".
2042 (ld_${EMULATION_NAME}_emulation): Initialize unrecognized_file.
2046 * ldlang.c (wild): Handle foo.a(.text) by mapping each included
2051 * emultempl/elf32.em (gld${EMULATION_NAME}_find_exp_assignment):
2052 Search trinary.cond rather than searching trinary.lhs twice.
2056 * mpw-make.sed: Edit out shared library support.
2057 (@TDIRS@): Edit out, can't use genscripts.
2061 * configure.tgt (m68k-*-linuxaout*, m68k-*-linux*): New targets.
2062 * emulparams/m68klinux.sh: New file.
2063 * emultempl/linux.em (gld${EMULATION_NAME}_before_allocation):
2064 Call bfd_${EMULATION_NAME}_size_dynamic_sections instead of
2065 bfd_linux_size_dynamic_sections.
2066 * Makefile.in (ALL_EMULATIONS): Add em68klinux.o.
2067 (em68klinux.c): New target.
2068 * configure.host (m68*-*-linuxaout*, m68*-*-linux*): New hosts.
2072 * Makefile.in (ALL_EMULATIONS): Sort into alphabetical order.
2073 Fill in missing entries.
2075 * lexsup.c (parse_args): Recognize --no-whole-archive.
2076 * ldlang.h (lang_input_statement_type): Add whole_archive field.
2077 * ldlang.c (new_afile): Set whole_archive field.
2078 (load_symbols): Check input file specific whole_archive field
2079 rather than global variable.
2080 * ld.texinfo, ld.1: Document --no-whole-archive.
2084 * configure.tgt: Correct gldi960 to gld960.
2088 * emultempl/elf32.em (gld${EMULATION_NAME}_check_needed): Check
2089 the SONAME if it is available.
2090 (gld${EMULATION_NAME}_stat_needed): Use the SONAME, not the
2091 filename, when checking for conflicting library versions. Don't
2092 assume that the suffix is only numbers and dots.
2094 * ld.texinfo: Mention that -R can be used for -rpath.
2098 * configure.host: Check for 'do not mix' from native linker before
2099 trying to use -rpath.
2103 * configure.in: Remove explicit substitution of CFLAGS; autoconf
2105 * configure: Rebuild.
2106 * Makefile.in (LDFLAGS): Set to @LDFLAGS@.
2108 * configure.in: Call AC_PROG_CC before configure.host.
2109 * configure: Rebuild.
2110 * configure.host: Remove go32 host, since it should no longer be
2111 necessary. Don't set CC for romp host.
2113 * scripttempl/elf.sc: Don't skip a page in virtual memory space if
2114 the text segment ends exactly on a page boundary.
2116 * configure.in: Substitute RPATH_ENVVAR.
2117 * configure: Rebuild.
2118 * configure.host: Set RPATH_ENVVAR.
2119 * Makefile.in (RPATH_ENVVAR): New variable.
2120 (check): Use $(RPATH_ENVVAR) rather than LD_LIBRARY_PATH.
2124 * configure.in: Redo emulation handling so that each emulation
2125 searches the correct tool directory, based on the target alias.
2126 For example, "configure --enable-targets=m68k-coff i386-linux"
2127 will search /usr/local/i386-linux/lib for linux and
2128 /usr/local/m68k-coff/lib for m68k-coff.
2129 * configure: Rebuild.
2130 * configure.tgt: Add special tdir settings for Linux.
2131 * Makefile.in: Add @TDIRS@. Pass "$(tdir_EMUL)" to ${GENSCRIPTS}
2132 for each eEMUL.c target.
2133 * genscripts.sh: Accept specific alias as 9th argument, and use it
2138 * ldlang.c (lang_set_startof): Don't do anything for a
2141 * ldgram.y (mri_script_file): Call mri_draw_tree.
2142 * mri.c (mri_draw_tree): Make globally visible. Don't bother to
2143 create memory regions.
2144 (mri_load): Don't call mri_draw_tree.
2145 * mri.h (mri_draw_tree): Declare.
2147 * configure.tgt (m68*-*-psos): New target.
2148 * emulparams/m68kpsos.sh: New file.
2149 * scripttempl/psos.sc: New file.
2150 * Makefile.in (ALL_EMULATIONS): Add em68kpsos.o.
2151 (em68kpsos.c): New target.
2155 * configure.tgt (*-*-ieee*): New target; use vanilla.
2157 * emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Strip
2158 `:foo' from ${ARCH}.
2162 * scripttempl/i386msdos.sc: Don't pad the .text section. Put
2167 * configure.host: Set HDLFLAGS for *-*-hpux with --enable-shared.
2169 * emultempl/elf32.em (gld${EMULATION_NAME}_stat_needed): Warn if
2170 it looks like we might be linking in two different versions of the
2175 * ldlang.c (lang_size_sections): Increment the section size when a
2176 padding statement is encountered.
2180 * configure.in: Look for --enable-shared. Change the value of
2181 BFDLIB when linking against a shared library on SunOS.
2182 * configure: Rebuild.
2183 * configure.host: If using a shared BFD library, try to pass a
2184 reasonable -rpath option when linking.
2185 * Makefile.in (BFDLIB): Set to @BFDLIB@.
2189 * emulparams/elf64_sparc.sh (ARCH): Change to `sparc:v9'.
2190 * emultempl/generic.em: Strip `:foo' from ${ARCH}.
2194 Support for building bfd and opcodes as shared libraries, based on
2196 * configure.in (HLDFLAGS): New substitution.
2197 * configure: Rebuild.
2198 * configure.host: Set HLDFLAGS on SunOS.
2199 * Makefile.in (HLDFLAGS): New variable.
2200 (BFDDEP): New variable.
2201 (BFDLIB): Change to -L../bfd -lbfd.
2202 ($(LD_PROG)): Depend upon $(BFDDEP) rathern than $(BFDLIB). Use
2203 $(HLDFLAGS) in link.
2204 (check): Set LD_LIBRARY_PATH in the environment.
2208 * scripttempl/elfppc.sc (.sdata2, .sbss2): Put .sdata2 and .sbss
2209 in the read-only section, not read/write unless we are making a
2211 (.debug*): Add dwarf debug sections.
2212 (.rela.{sdata*,sbss*}): Add sections.
2216 * configure: Regenerate.
2220 * emulparams/elf_i386.sh (TEXT_START_ADDR): Change to 0x8048000,
2221 for SVR4 compatibility.
2223 * ldexp.c (exp_fold_tree): Correct handling of ABSOLUTE.
2227 * configure.tgt (i[345]86-*-cygwin32, powerpcle-*-cygwin32): New.
2228 * emultempl/pe.em (definfo init): Make the default stack reserve
2233 * configure.tgt (m68*-apple-aux*): New target.
2234 * emulparams/m68kaux.sh: New file.
2235 * scripttempl/m68kaux.sc: New file.
2236 * Makefile.in (ALL_EMULATIONS): Add em68kaux.o.
2237 (em68kaux.c): New target.
2241 * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Ignore
2242 -bnoentry, since the right thing tends to happen anyhow.
2246 * ld.texinfo, ld.1: Document -export-dynamic.
2250 * emultempl/sunos.em: Check for native compile by comparing
2251 ${target} and ${host}.
2255 * emulparams/{elf32b4300.sh, elf32l4300.sh}: Changed
2256 TEXT_START_ADDR to allow use on IDT and PMON systems.
2260 * emultempl/pe.em (gld_${EMULATION_NAME}_parse_args):
2265 * configure.tgt (sparc64-*-solaris2*): New configuration.
2266 (sparc64-*-aout*): Renamed from sparc64*.
2270 * Makefile.in (GENSCRIPTS): Pass @host@ @target@ @target_alias@.
2271 * genscripts.sh: Set host, target and target_alias variables.
2272 Check for native compile by comparing ${target} and ${host}.
2273 * emultempl/elf32.em: Likewise.
2274 * scripttempl/elfmips.sc: Test ${target}, not ${target_alias}.
2278 * scripttempl/elfppc.sc: Refine eabi support to better support
2279 .sdata, .sdata2, .sbss, etc. sections.
2283 * ldgram.y (%union): Add phdr field.
2284 (phdr): Use phdr_qualifiers rather than opt_hdrs and opt_at.
2285 (phdr_qualifiers): New nonterminal. Add support for FLAGS.
2286 (opt_hdrs, hdr): Remove.
2287 (phdr_val): New nonterminal.
2288 * ldlang.c (lang_new_phdr): Replace hdrs parameter with filehdr
2289 and phdrs parameters. Add flags parameter.
2290 (lang_record_phdrs): Update for changes to lang_phdr. Pass flags
2292 * ldlang.h (struct lang_phdr): Replace hdrs field with filehdr and
2293 phdrs fields. Add flags field.
2294 (LANG_PHDR_FILEHDR, LANG_PHDR_PHDRS): Remove.
2295 (lang_new_phdr): Update declaration.
2296 * ld.texinfo: Document FLAGS.
2300 * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation):
2301 Don't make a shared library because of an undefined reference to
2302 __GLOBAL_OFFSET_TABLE_.
2304 Add some Irix 5 support, mostly from Kazumoto Kojima
2306 * emulparams/elf32bmip.sh (SCRIPT_NAME): Change to elfmips.
2307 (SHLIB_TEXT_START_ADDR): Define.
2308 (OTHER_GOT_SYMBOLS): Define.
2309 (OTHER_READWRITE_SECTIONS): Remove initialization of _gp.
2310 (EXECUTABLE_SYMBOLS): Don't define.
2311 (DYNAMIC_LINK): Don't define.
2312 * emulparams/elf32lmip.sh: Same changes as elf32bmip.sh.
2313 * scripttempl/elfmips.sc: New file.
2314 * configure.host (mips*-dec-bsd*): Change mips to mips*.
2315 (mips*-sgi-irix4*): Likewise.
2316 (mips*-sgi-irix5*): New entry.
2317 * Makefile.in (eelf32bmip.c): Depend upon elfmips.sc rather than
2319 (eelf32lmip.c): Likewise.
2323 * scripttempl/elfppc.sc: Remove support for .rel.* sections. Add
2324 .rela.got.neg section.
2328 * scripttempl/sh.sc: Only build constructors when CONSTRUCTING.
2330 * ldmisc.c: Include <stdarg.h> rather than <varargs.h> if
2331 ANSI_PROTOTYPES is defined. Remove special handling of
2332 WINDOWS_NT. Various indendation fixes.
2333 (vfinfo): Change fmt parameter to const char *.
2334 (info_msg): Write <stdarg.h> version.
2335 (einfo, minfo, finfo): Likewise.
2336 (info_assert): Change file parameter to const char *.
2337 * ldmisc.h (einfo, minfo, info_msg): If ANSI_PROTOTYPES is
2338 defined, use a real prototype.
2339 (info_assert): Change first parameter to be const char *.
2343 * scripttempl/elfppc.sc: Add support for .sdata2/.sbss2, etc. Add
2344 in old support that 2.7.2 needs, but the current compiler does
2347 * Makefile.in (eelf32{,l}ppc.c): Fix up dependencies to use the
2348 correct Linker script template.
2350 * emulparams/elf32{,l}ppc.sh (TEXT_START_ADDR): Set to 0x40000,
2352 (DATA_ADDR,NONPAGED_TEXT_START_ADDR): Delete.
2356 * scripttempl/alpha.sc: Put .rconst right after .rdata.
2360 * emultempl/pe.em (gld_${EMULATION_NAME}_before_allocation):
2361 sort using right pointer.
2365 * scripttempl/elfppc.sc: Remove support for creating special
2366 labels for eabi section begin/end here. The compiler now uses
2367 crt{i,n}.o to create these symbols.
2371 * configure.host: Change existing Linux HOSTING_CRT0 to be used
2372 for a.out only, and put in appropriate HOSTING_CRT0 and
2373 HOSTING_LIBS values for Linux ELF.
2377 * scripttempl/h8300.sc: Use all 64K for ram.
2378 * scripttempl/h8300h.sc: Define 256K ram size.
2382 * emultempl/aix.em (gld${EMULATION_NAME}_before_allocation): Pass
2383 export_defines as true to bfd_xcoff_size_dynamic_sections if -unix
2384 was used, regardless of whether -bE was used.
2388 * emultempl/aix.em (gld${EMULATION_NAME}_after_open): Only set
2389 relocateable before calling ldctor_build_sets if the output file
2390 is in an XCOFF format.
2394 * ldwrite.c (build_link_order): When handling a data statement, if
2395 the endianness of the output file is unknown, use the endianness
2400 * mpw-config.in: Recognize mips-*-* as equivalent to
2402 * mpw-eppcmacos.c: Rename to shorter mpw-eppcmac.c.
2403 * mpw-ld.r: Add version resources.
2404 (cfrg): Use symbolic instead of literal name for executable.
2408 * scripttempl/ppcpe.sc (FINI): Moved the .reloc section.
2412 * ldlang.c (print_statement{,s}): Delete duplicate prototype.
2413 (print_statement_list): Renamed from print_statement. All callers
2415 (print_statement): New function to print just one statement.
2416 (print_{data,reloc,padding}_statement): Don't crash if
2417 output_section == NULL.
2418 (dprint_statement): New function.
2420 * emultempl/pe.em (gld_${EMULATION_NAME}_before_allocation): Fix
2421 call to sort_sections.
2425 * emultempl/aix.em (unix_ld): New static variable.
2426 (gld${EMULATION_NAME}_parse_args): Handle -unix.
2427 (gld${EMULATION_NAME}_before_allocation): If unix_ld, pass
2428 gc as false and export_defineds as true to size_dynamic_sections.
2430 * ldexp.c (exp_fold_tree): Permit assignments to dot in the final
2431 phase if the current section is abs_output_section.
2436 * emultempl/pe.em (gld_${EMULATION_NAME}_before_allocation): Fix call
2441 * ldgram.y (PHDRS): New token.
2442 (ifile_p1): Accept phdrs.
2443 (section): Accept phdr_opt at the end of the section definition.
2444 (phdr_op): New nonterminal.
2445 (phdrs, phdr_list, phdr, phdr_type, opt_hdrs, hdr): Likewise.
2446 * ldlex.l: Accept PHDRS.
2447 * ldlang.h (struct lang_output_section_phdr_list): Define.
2448 (lang_output_section_statement_type): Add phdrs field.
2449 (struct lang_phdr): Define.
2450 (LANG_PHDR_FILEHDR, LANG_PHDR_PHDRS): Define.
2451 (lang_new_phdr): Declare.
2452 * ldlang.c (lang_phdr_list): New static variable.
2453 (lang_output_section_statement_lookup): Initialize phdrs field.
2454 (lang_process): Call lang_record_phdrs.
2455 (lang_new_phdr): New function.
2456 (lang_section_in_phdr): New function.
2457 (lang_record_phdrs): New static function.
2458 * ld.texinfo: Document PHDRS.
2462 * scripttempl/ppcpe.sc: Moved .edata into its own section to
2467 * configure.host (m68*-motorola-sysv): Define HOSTING_CRT0 and
2468 HOSTING_LIBS for testing.
2469 (m88*-motorola-sysv3): Define HOSTING_CRT0 and HOSTING_LIBS for
2474 * lexsup.c (parse_args): Set config.dynamic_link to false for -N
2479 * configure: Rebuild with autoconf 2.7.
2483 * scripttempl/pe.sc: Two .junk's is too much junk.
2487 * configure.in: Use BFD_NEED_DECLARATION.
2488 * acconfig.h: Put NEED_DECLARATION_FREE in @TOP@ section.
2489 * configure, config.in: Rebuild with autoconf 2.6.
2491 * ldmain.c (constructor_callback): Don't warn about BFD_RELOC_CTOR
2492 being unsupported if this is not a relocateable link and the input
2493 BFD supports it, since ldctor_build_sets can cope with that case.
2497 * configure.tgt (powerpc-*-macos*): New target.
2498 * emulparams/ppcmacos.sh: New file, PowerMac emulation.
2499 * Makefile.in (ALL_EMULATIONS): Add eppcmacos.o.
2500 (eppcmacos.c): New target.
2501 * mpw-eppcmacos.c: Update.
2502 * mpw-make.sed: Edit out attempts to use {GENSCRIPTS}.
2506 * Makefile.in (CC_FOR_TARGET): Use @host@ and @target@, not
2507 $(host_canonical) and $(target_canonical).
2508 (CXX_FOR_TARGET): Likewise.
2512 * scripttempl/pe.sc (.endjunk): Move definition of `end' to here
2513 so the malloc heap begins at a sane place.
2517 Version 2.6 released.
2518 * ldver.c (ldversion): Update to 2.6.
2520 * Makefile.in (mostlyclean): Delete ldemul-list.h here, but not
2521 $(GENERATED_*FILES), since they need to be retained by distclean.
2522 (maintainer-clean, realclean): Delete them here.
2526 * emultempl/pe.em (gld_${EMULATION_NAME}_parse_args): Open the
2527 base file with FOPEN_WB, not "w".
2529 * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Use the
2530 environment variable LD_RUN_PATH if neither -rpath nor -rpath-link
2532 (gld${EMULATION_NAME}_before_allocation): Use the environment
2533 variable LD_RUN_PATH if -rpath was not used.
2534 * ld.texinfo, ld.1: Document LD_RUN_PATH.
2538 * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Recognize
2539 -bl and -bloadmap options.
2541 * ldfile.c (ldfile_try_open_bfd): If bfd_error_invalid_target,
2542 report a better error.
2544 * emultempl/aix.em (gld${EMULATION_NAME}_before_allocation): Add
2545 new local variable special_sections, and pass it to
2546 size_dynamic_sections. Look through the results, and move the
2547 sections around in the mapping so that they are defined correctly.
2551 * ldemul.c (ldemul_default_target): Cast getenv return value.
2555 * emulparams/ppcpe.sh (ARCH): New file for PowerPC Portable
2557 * scripttempl/ppcpe.sc: New file for PowerPC Portable Executable
2560 * configure.tgt (targ_extra_emuls): Added powerpcle-pe target.
2561 * Makefile.in (ALL_EMULATIONS): Added eppcpe.o target.
2563 * emultempl/pe.em (TARGET_IS_ppcpe): file tailoring macro
2564 (gld_$_before_allocation): added hooks for toc construction based
2569 * ld.texinfo: The linker does not use _main as an entry point.
2573 * scripttempl/m88kbcs.sc (.data): Calculate next boundary modulo
2578 * configure.in: Add test for whether free must be declared.
2579 * sysdep.h: Declare free if necessary. Include "ansidecl.h".
2580 * acconfig.h: Explain NEED_DECLARATION_FREE.
2581 * configure, config.in: Rebuild.
2583 * lexsup.c (parse_args): Take B:: out of shortopts.
2587 * emulparams/i386nbsd.sh (EXECUTABLE_SYMBOLS): Set __DYNAMIC to 0
2588 for now, as with m68k4kbsd, until shared library support gets
2591 * configure.host: For i386 BSD variants, crt0.o lives in
2592 /usr/lib. (True for NetBSD at least, unconfirmed for others.)
2596 * Makefile.in (ALL_EMULATIONS): Add edelta68.o.
2597 (edelta68.c): New target.
2598 * configure.tgt (m68*-motorola-sysv*): New target.
2599 * emulparams/delta68.sh: New file.
2600 * scripttempl/delta68.sc: New file.
2602 * scripttempl/m88kbcs.sc: Handle .init and .fini. Change section
2607 * ldgram.y (mri_script_command): Accept ',' as well as '=' in
2608 ALIGN and ALIGNMOD statements.
2610 * emultempl/aix.em: Include ldgram.h.
2611 (gld${EMULATION_NAME}_parse_args): Handle -pD and -pT, as used on
2613 * Makefile.in ($(EMULATION_OFILES)): Depend upon ldgram.h.
2617 * configure.host (alpha-*-linux*): New host.
2618 * configure.tgt (alpha-*-linux*): New target.
2622 * emultempl/aix.em (export_files): Remove.
2623 (import_files): Make static.
2624 (struct export_symbol_list): Define.
2625 (export_symbols): New static variable.
2626 (gld${EMULATION_NAME}_parse_args): Handle an initial -b option
2627 correctly. Call read_file for an export file.
2628 (gld${EMULATION_NAME}_before_allocation): Call
2629 bfd_xcoff_export_symbol for each export symbol, rather than
2630 calling read_file for each export file.
2631 (gld${EMULATION_NAME}_read_file): For an export file, make the
2632 exported symbols undefined, and store them on the export_symbols
2637 * emultempl/pe.em (gld_${EMULATION_NAME}_parse_args):
2638 Don't hang if last option is unrecognised.
2639 (gld_${EMULATION_NAME}_set_symbols): Insert created
2640 symbols into ABS output section.
2644 * Makefile.in (ALL_EMULATIONS): Added support for the NetBSD
2646 (em68k4knbsd.c): New rule.
2648 * configure.tgt: Added support for the NetBSD m68k4k arch.
2650 * genscripts.sh, ldint.texinfo,
2651 emulparams/{a29k,armaoutb,armaoutl,coff_sparc,ebmon29k,gld960,
2652 gld960coff,go32,h8300,h8300h,h8500,h8500b,h8500c,h8500m,h8500s,
2653 hp300bsd,hp3hpux,hppaelf.sh,i386aout,i386bsd,i386coff,i386go32,
2654 i386linux,i386lynx,i386nbsd,lnk960,m68kaout,m68kcoff,m68klynx,
2655 m88kbcs,mipsbig,mipsbsd,mipsidt,mipsidtl,mipslit,news,ns32knbsd,
2656 pc532machaout,riscix,sa29200,sh,shl,sparclynx,sparcnbsd,
2657 st2000,sun3,sun4,vanilla,vax,vsta,w65,z8001,z8002}.sh: Changed
2658 PAGE_SIZE to TARGET_PAGE_SIZE.
2660 * emulparams/m68knbsd.h: Ditto.
2661 (TEXT_START_ADDR, NONPAGED_TEXT_START_ADDR): We have 8K pagesize.
2662 (EXECUTABLE_SYMBOLS): Hardcode __DYNAMIC to zero for the time
2665 * emulparams/m68k4knbsd.sh: New file.
2667 * scripttempl/aout.sc: Expand EXECUTABLE_SYMBOLS if relocating.
2671 * emultempl/aix.em: Include ldctor.h.
2672 (gld${EMULATION_NAME}_after_open): New static function.
2673 (gld${EMULATION_NAME}_before_allocation): Call find_relocs.
2674 (gld${EMULATION_NAME}_find_relocs): New static function.
2675 (gld${EMULATION_NAME}_find_exp_assignment): New static function.
2676 (ld_${EMULATION_NAME}_emulation): Use new after_open function.
2677 * scripttempl/aix.sc: Use CONSTRUCTORS in .data.
2678 * ldctor.c (struct set_info): Move definition into ldctor.h.
2679 (struct set_element): Likewise.
2680 (sets): Make non-static.
2681 (ldctor_add_set_entry): Add name parameter. Save it in the new
2683 (ldctor_build_sets): Avoid being called twice. Pass set element
2684 name to lang_add_reloc.
2685 * ldctor.h (struct set_info): Move definition here from ldctor.c.
2686 (struct set_element): Likewise. Add new field name.
2688 (ldctor_add_set_entry): Declare new name parameter.
2689 * ldwrite.c (build_link_order): Don't insist that either name or
2690 section be NULL in a lang_reloc_statement.
2691 * ldmain.c (add_to_set): Pass NULL to ldctor_add_new_set_entry for
2693 (constructor_callback): Pass name to ldctor_add_new_set_entry for
2696 * ldmisc.c (demangle): Fix indentation. Remove a leading period.
2700 * mpw-config.in: Add PowerMac target support, generate config.h.
2701 * mac-ld.r: New file, Mac resources.
2702 * mpw-make.sed: New file, edits Makefile.in into MPW syntax.
2703 * mpw-make.in: Remove.
2704 * mpw-eppcmacos.c: Prebuilt version of PowerMac linking script.
2708 * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Treat
2709 -static as a synonym for -bnso.
2711 * scripttempl/aix.sc: Move special symbols inside sections.
2712 Always start .data at 0.
2716 * Makefile.in (diststuff): Also make info.
2717 (maintainer-clean realclean): Also delete *.info*.
2721 * emultempl/aix.em: Add support for various AIX linker options,
2722 for AIX import and export files, and for AIX shared objects.
2723 * scripttempl/aix.sc: Add .pad. Put .ds just before the TOC.
2725 * ldmain.c (main): Initialize new field link_info.static_link.
2727 * ldmain.c (add_keepsyms_file): Add \n at end of einfo calls.
2728 (constructor_callback): Likewise.
2729 * ldmisc.c (vfinfo): Likewise.
2730 * ldwrite.c (build_link_order): Likewise.
2732 * ld.texinfo: The MRI ALIGN directive is supported.
2736 * emulparams/elf32vr4300.sh: Deleted.
2737 * emulparams/elf32vr4300el.sh: Deleted.
2738 * emulparams/elf32b4300.sh: Added.
2739 * emulparams/elf32l4300.sh: Added.
2740 * configure.tgt, Makefile.in: Updated the build to use the
2741 new 8.3 unique names.
2745 * ldlang.c (entry_symbol): Make non-static.
2746 * ldlang.h (entry_symbol): Declare.
2748 * ldlex.l: Treat PROVIDE as a keyword in expression state.
2752 * scripttempl/pe.sc (.bss): Move to be after .text
2756 * emultempl/sunos.em (gld${EMULATION_NAME}_find_exp_assignment):
2757 Search trinary.cond rather than searching trinary.lhs twice. From
2760 * emultempl/sunos.em (gld${EMULATION_NAME}_find_so): Move
2761 directory searching code into gld${EMULATION_NAME}_search_dir.
2762 (gld${EMULATION_NAME}_search_dir): New static function, extracted
2763 from gld${EMULATION_NAME}_find_so.
2764 (global_needed, global_found): New static variables.
2765 (gld${EMULATION_NAME}_after_open): New static function.
2766 (gld${EMULATION_NAME}_search_needed): New static function.
2767 (gld${EMULATION_NAME}_try_needed): New static function.
2768 (gld${EMULATION_NAME}_check_needed): New static function.
2769 (ld_${EMULATION_NAME}_emulation): Use new after_open function.
2770 * ld.texinfo, ld.1: Mention -rpath-link on SunOS.
2772 * Makefile.in (eelf32ppc.c): Depend upon elf32.em, not generic.em.
2773 (eelf32lppc.c): Likewise.
2774 * emulparams/elf32lppc.sh (TEMPLATE_NAME): Define as elf32.
2775 (GENERATE_SHLIB_SCRIPT): Define as yes.
2779 * emultempl/elf32.em: Struct bfd_elf_link_needed_list is now named
2780 bfd_link_needed-list; make appropriate changes.
2782 * configure.tgt (powerpc-*-aix*): New target; use aixppc.
2783 (rs6000-*-aix*): New target; use aixrs6.
2784 * emulparams/aixppc.sh, emulparams/aixrs6.sh: New files.
2785 * emultempl/aix.em: New file.
2786 * scripttempl/aix.sc: New file.
2787 * Makefile.in (ALL_EMULATIONS): Add eaixppc.o and eaixrs6.o.
2788 (eaixppc.c, eaixrs6.c): New targets.
2792 * scripttempl/pe.sc (.reloc): Move to the end.
2796 * ldlang.c (lang_finish): Don't try to use an entry_symbol from a
2797 section which was not linked into the final output.
2801 * emultempl/pe.em (gld_${EMULATION_NAME}_parse_args): Fix
2806 * ld.h (args_type): Add rpath_link field.
2807 * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Search for
2808 required dependencies in rpath_link path. Only search
2809 LD_LIBRARY_PATH when configured native.
2810 * lexsup.c (parse_args): Recognize -rpath-link.
2811 * ld.1, ld.texinfo: Document -rpath-link.
2815 * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Don't
2816 bother searching for needed libraries unless doing a final link.
2822 * ld.1: Fix formatting bugs.
2826 * ldexp.c (exp_get_abs_int): Return bfd_vma, not int.
2827 * ldexp.h (exp_get_abs_int): Update declaration.
2828 * ldlang.c (print_output_section_statement): Use fprintf_vma to
2829 print return value of exp_get_abs_int.
2833 * emultempl/elf32.em (global_stat): New file static variable.
2834 (gld${EMULATION_NAME}_try_needed): Call stat_needed to make sure
2835 that the file has not already been included under another name.
2836 (gld${EMULATION_NAME}_stat_needed): New static function.
2840 * scripttempl/armcoff.sc: Start .text at 0x8000.
2841 Start .data at 0x40000.
2845 * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): If
2846 command_line.rpath is set, use it, rather than the -L options, to
2847 build the rules section.
2848 * ld.texinfo: Document this use of -rpath.
2850 * lexsup.c (parse_args): Don't set link_info.shared for -assert
2851 pure-text. Pass true, not 1, to lang_add_entry.
2852 * emultempl/sunos.em (find_assign): New static variable.
2853 (found_assign): New static variable.
2854 (gld${EMULATION_NAME}_before_allocation): Rename local h to hdyn.
2855 If not a relocateable link, and no start symbol was specified on
2856 the command line, and there are any undefined symbols, set
2857 link_info.shared. If link_info.shared is set, set the address of
2858 the .text section to 0x20.
2859 (gld${EMULATION_NAME}_find_assignment): Rename from
2860 gld${EMULATION_NAME}_find_statement_assignment. If find_assign is
2861 set, then just set found_assign based on whether an assignment is
2862 found to find_assign.
2863 (gld${EMULATION_NAME}_get_script): Don't use a special script when
2864 producing a shared library.
2865 * emulparams/sun4.sh (GENERATE_SHLIB_SCRIPT): Remove.
2866 * scripttempl/aout.sc: Remove CREATE_SHLIB tests.
2867 * ldlang.c (entry_from_cmdline): New global variable.
2868 (lang_add_entry): Change cmdline parameter from int to boolean.
2869 Use global entry_from_cmdline rather than function static
2871 * ldlang.h (entry_from_cmdline): Declare.
2872 (lang_add_entry): Change declaration of second parameter from int
2874 * ldgram.y: Pass false, not 0, to lang_add_entry.
2878 * ld.h (parsing_defsym): Declare.
2879 * ldlex.h (lex_string): Declare.
2880 * ldlex.l (lex_string): Define.
2881 * lexsup.c (parsing_defsym): Define.
2882 (parse_args): In OPTION_DEFSYM case, set lex_string before calling
2883 lex_redirect, and clear it after calling yyparse. Set
2884 parsing_defsym around call to yyparse.
2885 * ldmain.c (main): Set lex_string before calling lex_redirect, and
2886 clear it after calling yyparse.
2887 * ldmisc.c (vfinfo): For %S, handle --defsym arguments and built
2888 in linker scripts correctly.
2890 * scripttempl/sparccoff.sc: Add .ctors/.dtors handling like other
2891 COFF targets, allowing for the leading underscore used on SPARC
2894 * lexsup.c (parse_args): Handle -assert.
2895 * emulparams/sun4.sh (GENERATE_SHLIB_SCRIPT): Define.
2896 * emultempl/sunos.em (gld${EMULATION_NAME}_get_script): Use the
2897 shared library script when appropriate.
2898 * scripttempl/aout.sc: If CREATE_SHLIB is set, start the .text
2899 section at SIZEOF_HEADERS.
2903 * Makefile.in (earmcoff.c): Build.
2904 * configure.tgt (arm-*-coff): New target
2905 * emulparms/armcoff.sh: New file.
2906 * scripttempl/armcoff.sc: New file.
2910 * scripttempl/i386coff.sc: Remove .data2; no longer needed.
2914 * ldfile.c (ldfile_set_output_arch): Make arch const.
2918 * scripttempl/elfppc.sc: Correctly locate __bss_start at the
2919 beginning of the .bss area, not at the end of data. Add
2920 __sbss_{start,end} symbols.
2924 * Makefile.in (CC_FOR_TARGET): Quote $(program_transform_name).
2925 (CXX_FOR_TARGET, install): Likewise.
2930 * Makefile.in (CC_FOR_TARGET): Remove brokensed stuff.
2931 (CXX_FOR_TARGET): Likewise.
2932 (install): Likewise.
2933 (GENERATED_HFILES): Remove config.h.
2934 (.dep): Depend upon config.h.
2938 * configure.tgt (mips*-dec-netbsd*): New target.
2942 * configure.host (m88*-*-dgux*): Fix another shell syntax error.
2946 * configure.host (i[345]86-*-bsd*): Fix shell syntax error.
2950 * scripttempl/pe.sc: Allow both spellings of .ctors/.dtors.
2951 Start .text section on the right boundary. Always align
2956 * Makefile.in (maintainer-clean): New target.
2958 * ldmain.c (struct warning_callback_info): Define.
2959 (warning_callback): Add new parameter symbol. Call
2960 warning_find_reloc to try to find the section and VMA.
2961 (warning_find_reloc): New static function.
2962 * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
2963 Pass NULL as symbol parameter to warning callback.
2965 * ld.texinfo: Clarify -L option.
2967 * ldlang.c (lang_one_common): Add cast to avoid warning.
2968 (topower): Likewise. Also, reindent.
2969 * ldwrite.c (clone_section): Change i to unsigned int.
2970 * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): Add
2971 cast to avoid warning.
2975 * Makefile.in (config.status): Depend upon configure.tgt.
2977 * ldemul.h (ldemul_set_symbols): Declare.
2978 (ldemul_parse_args): Declare.
2979 * ldemul.c (ldemul_parse_args): Fix indentation.
2981 * configure.in: Call AC_HEADER_DIRENT.
2982 * configure, config.in: Rebuild.
2983 * emultempl/sunos.em: Use autoconf recommend mechanism to define
2984 DIR and struct dirent.
2986 * configure.tgt (mips*-*-bsd*): New case.
2988 * configure.host (i[345]86-sequent-ptx* | i[345]86-sequent-sysv*)
2990 * configure.tgt (i[345]86-*-ptx*): New case.
2994 * config.in: Rename from config.h.in.
2995 * configure.in: Call AC_CONFIG_HEADER with config.h:config.in.
2996 Check for config.h:config.in when creating stamp-h.
2997 * configure: Rebuild.
2998 * Makefile.in (stamp-h): Depend upon config.in rather than
2999 config.h.in. Set CONFIG_HEADERS to config.h:config.in when
3000 calling config.status.
3002 * Makefile.in (distclean): Remove config.h and stamp-h.
3004 * configure.host (sparc-*-sunos64*): Remove.
3005 * ldlang.c (lang_map): Check BFD64, not HOST_64_BIT.
3007 * ldexp.c (exp_fold_tree): Don't warn about moving the location
3008 counter backward in the absolute section.
3012 * configure.in: Rewrite to use autoconf.
3013 * configure.host: New file.
3014 * configure.tgt: New file.
3015 * aclocal.m4: New file.
3016 * configure: New file, built by autoconf.
3017 * acconfig.h: New file.
3018 * config.h.in: New file, built by autoheader.
3019 * sysdep.h: New file.
3020 * ld.h: Incorporate old contents of config.h.
3022 * Makefile.in: Various changes for new configure script. Also:
3023 (CC_FOR_BUILD): Remove.
3024 (ldmain.o): Don't bother to ensure that EMUL is non-empty.
3025 (dep.sed): Use @SRCDIR@, not @srcdir@.
3026 * dep-in.sed: Use @SRCDIR@, not @srcdir@.
3027 * genscripts.sh: Create ldscripts if it does not exist.
3028 * ldemul.c, lexsup.c, mpw-emipsidt.c: Don't include "config.h".
3029 * mpw-esh.c, emultempl/*.em: Likewise.
3030 * ldmain.c: Likewise. Include <ctype.h>. Don't try to set
3032 * config/*.mt, config/*.mh: Remove.
3036 * configure.in: Treat ns32k-pc532-ux* like ns32k-pc532-mach*, and
3037 ns32k-pc532-lites* like ns32k-pc532-netbsd*. From Ian Dall.
3041 * scripttempl/pe.sc: Fix typo in spelling of .ctors/.dtors.
3045 * ldmain.c (warning_callback): Add abfd, section, and address
3047 * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
3048 Change call to warning accordingly.
3050 * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): If not
3051 relocateable and not shared, put .gnu.warning.SYMBOL sections into
3056 * configure.in: Added mips*vr4300-idt-elf* and
3057 mips*vr4300el-idt-elf* targets.
3058 * Makefile.in: Added eelf32vr4300* targets.
3059 * emulparams/{elf32vr4300.sh, elf32vr4300el.sh}: Added.
3060 * config/{mips-vr4300.mt, mips-vr4300el.mt}: Added.
3064 * scripttempl/a29k.sc: Fix to be reasonable. From Brendan Kehoe
3069 * ldemul.c (ldemul_parse_args): New.
3070 * ldemul.h (ld_emulation_xfer_struct): Add parse_args.
3071 * lexsup.c (all pe stuff): Moved into pe.em
3072 (parse_args): Call emulation arg parser.
3073 * emultempl/pe.em (parse_args): handle PE specfic args.
3077 * ldlang.c (lang_memory_region_lookup): Don't use the first region
3078 as the default region. Create a new region instead.
3082 * ldemul.c (ldemul_set_symbols): New function.
3083 * ldemul.h (ld_emulation_xfer_struct): Add set_symbols.
3084 * ldmain.c (main): Add call to ldemul_set_symbols.
3085 * lexsup.c (set_pe_value): New args.
3087 (parse_args): Cope with new set_pe_value args.
3088 * emultempl/pe.em (set_symbols): New function.
3089 (ld_emulation_xfer_struct): Add set_symbols.
3090 * scripttempl/pe.sc: Use new symbols.
3094 * lexsup.c (parse_args): Don't call set_default_dirlist for -O.
3095 For -Y, ignore a leading `P,', and only call set_default_dirlist
3096 after processing all the other arguments.
3100 * scripttempl/pe.sc: Keep .edata, don't base stabs at 0.
3101 * emulparams/armpe.sh: Run PE script.
3105 * ldmain.c (main): Remove PE stuff.
3106 * lexsup.c (options): Load more PE options.
3107 (set_pe_value): New function.
3112 * emultempl/{armpe.sc, i386pe.sc}: Deleted.
3113 * emultempl/pe.sc: New file performs generic PE support and sorts
3115 * emulparams/{armpe.sh,i386pe.sh}: Use new file.
3116 * scripttempl/{armpe.sc, i386pe.sc}: Deleted
3117 * scripttempl/pe.sc: New.
3118 * Makefile.in: Use new files.
3122 * scripttempl/h8500s.sc (.rdata): All data must go in data segment.
3123 (.strings,.ctors,.dtors): Likewise.
3127 * scripttempl/armpe.sc: Always start code at 0x401000, even
3129 * ldwrite.c (strdup): New extern declaration.
3130 * ldgram.y (atype): New rule to clarify type parsing.
3131 * ldlang.c (init_os): Remove commented out code.
3132 (lang_size_sections): Set SEC_ALLOC and SEC_LOAD bits
3133 unless told not to by the link script.
3137 * ldlang.c (lang_set_startof): New static function.
3138 (lang_process): Call it.
3140 * ldgram.y: Tweak casesymlist to avoid bison errors.
3142 * lexsup.c (parse_args): Accept -h as a synonym for --soname, for
3143 Solaris compatibility.
3147 * ldgram.y (YYDEBUG): If not defined, define as 1.
3148 (CASE, EXTERN, START): New tokens.
3149 (mri_script_command): Handle CASE, EXTERN, INCLUDE, START.
3150 (casesymlist): New nonterminal.
3151 (extern_name_list): New nonterminal.
3152 * ldlex.l: Accept lower case trailing base specifiers. Don't
3153 ignore the first digit when the base is a suffix. Accept many
3154 EXPRESSION state tokens in MRI state. Support MRI continuation
3155 lines and MRI semicolon comments. Accept all MRI keywords in
3156 lower case. Add CASE, EXTERN, and START MRI keywords.
3160 * emultempl/sunos.em (gld${EMULATION_NAME}_find_so): Use xmalloc
3165 * Makefile.in (CC_FOR_TARGET, CXX_FOR_TARGET): Don't use
3166 $r/../gcc/xgcc unless it is present.
3170 * scripttempl/m68kcoff.sc: Only put .ctors and .dtors in .text
3172 * scripttempl/m68klynx.sc: Likewise.
3173 * scripttempl/nw.sc: Likewise.
3174 * scripttempl/sa29200.sc: Likewise.
3175 * scripttempl/sparclynx.sc: Likewise.
3179 * emulparams/{z8001.sh, z8002.sh}: Fix typo.
3183 * configure.in (i[345]86-*-linuxoldld): Treat like linuxaout*.
3187 * scripttempl/i386pe.sc: Cope with constructors.
3188 * scripttempl/z8ksim.sc: Deleted.
3189 * scripttempl/z8000.sc: Resurrected as this, but
3190 can handle z8001 and z8002 formats.
3191 * emulparams/z8ksim.sh: Deleted.
3192 * emulparams/{z8001.sh, z8002.sh}: New files.
3193 * config/z8ksim.mt: Deleted
3194 * config/z8k-coff.mt: New, generates both emulations.
3198 * ldmisc.c (vfinfo): In %C and %D case, always print the BFD using
3199 %B, in case it is in an archive.
3203 * ldlang.c (lang_process): Call reset_memory_regions for each
3208 * scripttempl/elfppc.sc: Add support for .sdata, .sbss, and
3213 * ldmain.c (constructor_callback): Allocate set_name in stack
3214 frame, rather than always calling alloca with a fixed size.
3218 * emulparams/armpe.sh (OUTPUT_FORMAT): Change to pei-arm-little.
3219 (LITTLE_OUTPUT_FORMAT, BIG_OUTPUT_FORMAT): Define.
3223 * ldwrite.c (clone_section): Set the alignment of the clone
3224 section to that of the section being cloned.
3226 * ldwrite.c (split_sections): Don't split the first input section
3227 into a new output section.
3231 * emulparams/elf32ppc.sh (TEMPLATE_NAME): Define as elf32.
3232 (GENERATE_SHLIB_SCRIPT): Define as yes.
3236 * emultempl/mipsecoff.em (check_sections): Use %P, not %F.
3238 * ldver.c (help): Update list of options to match currently
3243 * emultempl/lnk960.em (ld_lnk960_emulation): Initialize
3246 * ldexp.c (exp_intop): Don't cast stat_alloc arg to bfd_size_type;
3247 it takes a size_t anyhow.
3248 (exp_binop): Likewise.
3249 (exp_trinop): Likewise.
3250 (exp_unop): Likewise.
3251 (exp_nameop): Likewise.
3252 (exp_assop): Likewise.
3253 * ldlang.c (lang_memory_region_lookup): Likewise.
3254 (init_os): Likewise.
3255 (ldlang_add_undef): Likewise.
3256 (insert_pad): Likewise.
3257 * ldfile.c (ldfile_add_arch): Don't cast xmalloc arg to
3260 * Makefile.in (ALL_EMULATIONS): It's earmaoutb.o, not earmoutb.o.
3264 * ldemul.h (ldemul_open_dynamic_archive): Add search parameter to
3266 (ld_emulation_xfer_type): Add search parameter to
3267 open_dynamic_archive entry point.
3268 * ldemul.c (ldemul_open_dynamic_archive): Add search parameter.
3269 * ldfile.c (ldfile_try_open_bfd): Rename from try_open_bfd, and
3270 make non-static. Change all callers to use new name.
3271 (ldfile_open_file_search): Make static. If entry is dynamic, call
3272 ldemul_open_dynamic_archive.
3273 (ldfile_open_file): Don't call ldemul_open_dynamic_archive.
3274 * ldfile.h (ldfile_open_file_search): Don't declare.
3275 (ldfile_try_open_bfd): Declare.
3276 * emultempl/elf32.em (gld${EMULATION_NAME}_open_dynamic_archive):
3277 Accept search parameter. Don't search for a library, just look in
3279 * emultempl/linux.em (gld${EMULATION_NAME}_open_dynamic_archive):
3284 * ldmain.c (set_scripts_dir): Don't base script directory on
3289 * ldmisc.c (vfinfo): Don't print the line number if it isn't
3294 * ld.h (ld_config_type): Add field warn_constructors.
3295 * ldmain.c (add_to_set): Warn if config.warn_constructors.
3296 (constructor_callback): Likewise.
3297 * lexsup.c (parse_args): Handle -warn-constructors.
3298 * ld.texinfo, ld.1: Document -warn-constructors.
3300 * emultempl/elf32.em (gld${EMULATION_NAME}_check_needed): Don't
3301 get confused by directory names if we searched for the file.
3304 * ldlang.h (lang_input_statement_type): Add new field dynamic.
3305 * ldlang.c (new_afile): Set dynamic from config.dynamic_link.
3306 * ldfile.c: Include bfdlink.h.
3307 (ldfile_open_file): Check dynamic field of entry, not global
3308 dynamic_link field. Don't do a dynamic search when doing a
3310 * ldmain.c (main): Don't warn about dynamic_link for a
3312 * emultempl/sunos.em (gld${EMULATION_NAME}_find_so): Skip file if
3314 (gld${EMULATION_NAME}_create_output_section_statements): Always
3315 loop over input files.
3316 * Makefile.in: Rebuild dependencies.
3318 * ld.texinfo, ld.1: Document -Bstatic, -Bdynamic, -Bshared, and
3323 * ldmain.c (main): Set link_info.symbolic to false.
3324 * lexsup.c (parse_args): Handle -Bsymbolic.
3328 * ldmain.c (HAVE_SBRK): Define for everything except
3329 specific systems that are known to not support sbrk.
3330 (main): Use HAVE_SBRK to decide whether or not to use sbrk.
3334 * emultempl/elf32.em (gld${EMULATION_NAME}_find_exp_assignment):
3335 Handle etree_provide.
3337 * emultempl/elf32.em (global_needed): New static variable.
3338 (global_found): Likewise.
3339 (gld${EMULATION_NAME}_after_open): New static function.
3340 (gld${EMULATION_NAME}_search_needed): Likewise.
3341 (gld${EMULATION_NAME}_try_needed): Likewise.
3342 (gld${EMULATION_NAME}_check_needed): Likewise.
3343 (ld_${EMULATION_NAME}_emulation): Replace after_open_default with
3344 gld${EMULATION_NAME}_after_open.
3348 * configure.in (i386-*-win32): New target.
3352 * lexsup.c (parse_args): Let -G either set the small data size or
3353 be equivalent to --shared, depending on the next argument. Accept
3354 and ignore -z for Solaris compatibility.
3358 * lexsup.c (parse_args): Cast fopen result to PTR before storing
3359 it in link_info.base_file. Fix indentation.
3363 * ldmain.c (main): Always initialize PE info in link_info.
3364 * lexsup.c (OPTION_BASE_FILE): New option.
3365 (parse_args): Handle new option.
3366 * emulparams/armpe.sh: Output pei.
3367 * emultempl/i386pe.em: Add newline to end.
3368 * scripttempl/armpe.sc: Change output and quote the $s.
3369 * scripttempl/i386pe.sc: Change output and quote the $s.
3375 * configure.in (i386-*-msdos*, i386-*-moss*): New targets.
3376 * Makefile.in (ALL_EMULATIONS): Added i386msdos.o.
3377 (i386msdos.o): New target.
3378 * config/i386-msdos.mt: Created.
3379 * emulparams/i386msdos.sh: Created.
3380 * scripttempl/i386msdos.sc: Created.
3384 * scripttempl/elfppc.sc (.fixup): Add support for a .fixup section
3385 that contains pointers to be relocated.
3389 * mpw-esh.c: New file, modified for MPW from esh.c.
3390 * scripttempl/sh.sc: Reformatted to simplify MPWification,
3391 use *() to concat stab sections instead of [].
3395 * scripttempl/armpe.sc: Add constructor support.
3399 * ldlang.c (lang_size_sections): Any section with a DATA
3400 statement has contents.
3404 * emulparams/m68kelf.sh (NOP): Define.
3405 (DYNAMIC_LINK): Don't define.
3406 (TEXT_START_ADDR): Set to 0x80000000; the extra 0x100 for headers
3407 will come from the linker script.
3411 * emulparams/armpe.sh, scripttempl/armpe.sc: Add end and stack.
3415 * configure.in (i[345]86-*-gnu*): Use GNU elf config.
3420 * Makefile.in: Fixup more gotchas from renaming elf32ppcle to
3425 Add support for ARM-PE.
3426 * Makefile.in (ALL_EMULATIONS): Add armpe.o
3427 * configure.in: Recognize armpe.
3428 * config/arm-pe.mt: New file.
3429 * emulparams/armpe.sh: New file.
3430 * scripttempl/armpe.sc: New file.
3435 * configure.in (h8300h-*-hms): Deleted
3436 * config/cf-h8300h.mt: Deleted.
3443 * Makefile.in (ALL_EMULATIONS): Add earmout[lb].o
3444 * configure.in: Recognize arm{,e[lb]-*-aout.
3445 * config/arm[lb]-aout.mt: New files.
3446 * emulparams/armaout[lb].sh: New files.
3447 * scripttempl/armaout.sc: New file.
3451 * config/ppcle-elf32.mt (EMUL): Use elf32lppc, not elf32ppcle, to
3452 be unique in 8 characters for DOS.
3454 * emulparams/elf32lppc.sh: New file, renamed from elf32ppcle.sh.
3455 * emulparams/elf32ppcle.sh: Deleted.
3460 Initial support for PE executables (eg NT, win32)
3462 * Makefile.in (configure.in, ei386pe): Add support.
3463 * ldmain.c (main): Initialize PE argument info.
3464 * ldwrite.c (print_file_stuff): Don't print out .drectve
3465 and .debug section info.
3466 * lexsup.c (set_subsystem, set_stack_heap, OPTION_HEAP,
3467 OPTION_SUBSYSTEM, parse_argsm set_subsystem, set_stack_heap):
3468 Handle new arguments.
3469 * config/i386-pe.mt, emultempl/i386pe.em, scripttempl/i386pe.sc:
3474 * scripttempl/hppaelf.sc: Remove .PARISC.unwind section from text
3475 segment. This allows ld -r to preserve unwind sections.
3479 * configure.in: Add little endian PowerPC support.
3481 * Makefile.in (ALL_EMULATIONS): Add eelf32ppcle.o.
3482 (eelf32ppcle.c): Support for little endian PowerPC.
3484 * config/ppcle-elf32.mt: New file for little endian PowerPC.
3485 * emulparams/elf32ppcle.sh: Ditto.
3489 * ldlang.c (print_output_section_statement): Check
3490 subsection_alignment, instead of checking section_alignment twice.
3495 * configure.in (hppa*-*-lites*): Handle like hppa*-*-*elf*.
3499 * ldwrite.c (ldwrite): Before doing anything, reset the error
3500 code. If bfd_final_link returns an error, but the error code is
3501 unset, don't issue an extra message. Assume a correct error
3502 message was already set.
3506 * Makefile.in (ALL_EMULATIONS): Added em68kelf.o.
3507 (em68kelf.o): New target.
3508 * config/m68k-elf.mt, emulparams/m68kelf.sh: New files.
3509 * configure.in: Use them for m68*-*-elf.
3513 Merge in support for Mac MPW as a host.
3514 (Old change descriptions retained for informational value.)
3516 * mpw-config.in (i386-unknown-aout): Change to i386-unknown-go32.
3517 (i386-unknown-coff): Remove.
3518 (sh-hitachi-hms): New target.
3519 (emulation_ofiles): Set correctly for each target.
3520 (version, TDEFINES): Add to makefile fragment.
3521 * mpw-make.in (BISON): Use byacc instead of bison.
3522 (em_*.c): Replace with e*.c everywhere.
3523 (ldgram.h): Separate action from ldgram.c generation.
3524 (LD_PROG): Depend on Version.r.
3525 (Version.r): generate from version info.
3526 * mpw-emipsidt.c: New file, modified for MPW from emipsidt.c.
3528 * mpw-config.in (m68k-apple-macos, ppc-apple-macos,
3529 i386-unknown-aout, i386-unknown-coff): New targets.
3530 (m68k-aout, m68k-coff): Remove targets.
3531 (mk.tmp): Add definition of EMUL.
3533 * mpw-config.in (emulname): Set based on target.
3534 (ldemul-list.h): Construct.
3535 * mpw-make.in (install-only): New target.
3536 (install): Depend on install-only.
3538 * mpw-make.in (bindir): Fix pathname.
3539 (install): Move here from mpw-build.in.
3541 * mpw-config.in: New file, MPW configuration fragment.
3542 * mpw-make.in: New file, MPW makefile fragment.
3543 (This file is semi-automatically generated from Makefile.in.)
3544 * ldfile.c (slash): If MPW, set to `:'.
3545 * ldlex.l (TRUE_FALSE_ALREADY_DEFINED): If MPW, set this to
3546 prevent redefinition errors.
3550 * ldwrite.c (clone_section): Align clone sections on even
3555 * configure.in: Change linux to default to elf. Using
3556 i[345]86-*-linuxaout will build a linker which defaults to a.out.
3557 * config/i386-laout.mt: Rename from old config/i386-linux.mt.
3558 * config/i386-linux.mt: Rename from old config/i386-lelf.mt.
3559 * config/i386-lelf.mt: Remove.
3563 * ldmain.c (main): If opening the map file fails, call
3564 bfd_set_error before calling einfo.
3566 * ld.texinfo, ld.1: Document the -no-keep-memory option.
3570 * ldmain.c (main): Revert patch of March 10, since the SVR4 linker
3571 does mark shared libraries as executable.
3575 * ldlang.c (lang_common): Change power to int. Pass larger values
3576 before smaller values.
3577 (lang_one_common): Treat info as int *. Don't bother to check for
3578 last value, since it is now zero.
3582 * ldlang.c (load_symbols): An empty archive is OK.
3586 * ldmain.c (progress.h): Include.
3587 (main): Call START_PROGRESS and END_PROGRESS.
3591 * scripttempl/elfppc.sc: Move _GOT2_END_ after the .ctors and
3592 .dtors sections, so that these pointers get relocated also.
3593 Define the symbols __{C,D}TOR_{LIST,END}__ to mark the beginning
3594 and end of the constructors/destructors.
3598 * ldlang.c (load_symbols): If whole_archive is true and ENTRY
3599 describes an archive, call bfd_link_add_symbols on each member.
3600 * ldmain.c (whole_archive): New variable.
3601 (main): Initialize it to false.
3602 * ldmain.h: Declare whole_archive.
3603 * lexsup.c (parse_args): Grok --whole-archive switch.
3604 * ld.texinfo, ld.1: Document --whole-archive.
3608 * genscripts.sh (EMULATION_NAME): Set LIB_PATH to empty when not
3609 using the default emulation.
3611 * config/dgux.mh (HOSTING_EMU): Use -m rather than trying to set
3613 * config/hppaelf.mh (HOSTING_EMU): Likewise.
3617 * emultempl/sunos.em (gld${EMULATION_NAME}_find_so): Set force_maj
3622 * ldmain.c (main): Don't set EXEC_P if link_info.shared is set.
3624 * ldlex.l: Return -lFILENAME as the token LNAME.
3625 * ldgram.y: Add token LNAME.
3626 (input_list): Treat LNAME like NAME, but pass it to
3627 lang_add_input_file as lang_input_file_is_l_enum.
3628 * ld.texinfo: Document using -lFILENAME in INPUT.
3632 * ldlang.c (lang_check): If the architectures are compatible call
3633 bfd_merge_private_bfd_data to let the backend do additional
3638 * ldemul.c (ldemul_choose_mode): If emulation not recognized, list
3639 all supported emulations.
3643 * ldemul.c (ldemul_list_emulations): New function.
3644 * ldemul.h (ldemul_list_emulations): Declare.
3645 * ldver.c (help): List supported targets and emulations.
3649 * scripttempl/elf.sc (.debug): Relocate to address 0.
3650 (.debug_srcinfo, .debug_aranges, .debug_pubnames,
3651 .debug_sfnames, .line): Likewise.
3655 * emultempl/elf32.em (hold_rel): New static variable.
3656 (gld${EMULATION_NAME}_place_orphan): Place readonly sections with
3657 contents whose names begin with ".rel" after hold_rel. Remove the
3658 assertion which checked for unplaced .rel sections. Don't try to
3659 sort the section into place if place->bfd_section is NULL.
3660 (gld${EMULATION_NAME}_place_section): Set hold_rel to the first
3661 section beginning with ".rel".
3666 * ld.texinfo: -X and -x work even if -s or -S are not specified.
3667 * ld.1: Similar change.
3671 * emulparams/gld960coff.sh (COFF_CTORS): Define.
3672 * scripttempl/i960.sc: Use COFF_CTORS if CONSTRUCTING.
3676 * configure.in (i[345]86-*-linuxelf*): New target. Use i386-lelf.
3677 (i[345]86-*-gnuelf*): New target. Use i386-gelf.
3678 * config/i386-lelf.mt: New file.
3679 * config/i386-gelf.mt: New file.
3683 * configure.in: Match on mips-ecoff, and default to the IDT
3688 * scripttempl/elfppc.sc: Add support for .got1 and .got2 sections.
3689 Offset _GLOBAL_OFFSET_TABLE_ 32768 from the start of the GOT area
3690 to double the size of the table.
3694 * Makefile.in (distclean): Do recursive deletion, since ldscripts
3699 * ldmain.c (main): If trace_file_tries is true, and we are using
3700 an internal linker script, print out the script.
3701 * ldfile.c (try_open): Reindent function. Make the messages about
3702 opening script files more informative.
3704 * lexsup.c (parse_args): For -V, call ldversion with 1, not 0.
3705 * ld.texinfo, ld.1: Update accordingly.
3709 * ldlang.c (lang_one_common): Adjust references to common symbol
3710 information for new structure.
3714 * ldmain.c (undefined_symbol): Handle section being NULL.
3716 * ldctor.c (ldctor_build_sets): Handle bfd_link_hash_defweak.
3717 * ldexp.c (fold_name): Likewise.
3718 * ldlang.c (print_one_symbol): Likewise.
3719 (lang_finish): Likewise.
3720 * ldmain.c (multiple_common): Likewise.
3721 * ldwrite.c (print_symbol): Likewise. Also, bfd_link_hash_weak
3722 renamed to bfd_link_hash_undefweak.
3724 * scripttempl/alpha.sc: Set address of .data section correctly
3725 when -n or -N is used. Patch from Chris G Demetriou
3727 * scripttempl/mips.sc: Similar change.
3731 * ldlang.c (lang_size_sections): Clarify error message when user
3732 specified start addr conflicts with region. Fix resetting of
3737 * ldexp.c (fold_name): In case NAME, permit an absolute symbol
3738 in lang_allocating_phase_enum.
3742 * Makefile.in (distclean): Depend upon clean. Don't bother to
3743 remove files which will be removed by clean. From patch by
3748 * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): For
3749 a MIPS target, clobber the size of all but the first input
3750 .reginfo section to be 0, so that lang_size_sections sets the
3751 correct size for the output .reginfo section.
3755 * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
3756 Remove unused variable is.
3760 * configure.in: Add support for powerpc-*-eabi.
3762 * scripttempl/elfppc.sc: New file for PowerPC embedded ABI
3765 * emulparams/elf32ppc.sh (SCRIPT_NAME): Use elfppc.sc instead of
3766 elf.sc, which defines some new symbols PowerPC elf needs.
3770 * ldctor.c (ldctor_add_set_entry): Don't dump core if a
3771 constructor entry is in the absolute section.
3775 * configure.in (i[345]86-*-gnu*): Set ld_target to i386-gnu.
3776 * config/i386-gnu.mt: New file. Include ELF support.
3780 * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): If
3781 there are any input sections named .gnu.warning, treat them as
3782 containing a warning message to be printed by the linker, and
3783 clobber the size so that the message is not copied into the output
3785 * scripttempl/elf.sc: Put .gnu.warning sections into the .text
3788 Sun Jan 15 16:45:00 1995 Steve Chamberlain <sac@splat>
3790 * configure.in (w65-*-*): New target.
3791 * Makefile.in: Update.
3792 * scripttempl/w65.sc: New.
3793 * config/coff-w65.mt: New.
3797 * ldlang.c (lang_place_orphans): Don't ignore files with
3798 just_syms_flag set. Instead, put all their sections in
3799 bfd_abs_section_ptr, using the section VMA as the output_offset.
3803 * ldctor.c (ldctor_build_sets): Don't use `const' with typedef
3804 name `reloc_howto_type', since it's now defined to be const.
3805 * ldlang.c (lang_add_reloc): Ditto.
3806 * ldlang.h (lang_reloc_statement_type, lang_add_reloc): Ditto.
3810 * ldexp.c (fold_binary): Adding or subtracting an absolute value
3811 to a relative value does not require forcing the relative value to
3812 be absolute. Also, reindent function.
3816 * ldwrite.c (clone_section): Create a symbol with the
3817 same name as the section.
3821 * ld.h (split_by_reloc, split_by_file): New flags.
3822 * ldwrite.c (clone_section, split_sections): New functions.
3823 * lexsup.c (parse_args): Understand new split options.
3827 * scripttempl/elf.sc: Move .ctors and .dtors from .text segment to
3828 .data segment. They must be writable when creating a shared
3833 * emultempl/miposecoff.em: New file.
3834 * emulparams/mipsidt.sh (TEMPLATE_NAME): Set to mipsecoff.
3835 * emulparams/mipsidtl.sh (TEMPLATE_NAME): Likewise.
3836 * scripttempl/mips.sc: Put .rel.sdata sections in .text, and
3837 provide __runtime_reloc_start and __runtime_reloc_stop if they are
3838 used. Align _fdata to a 16 byte boundary.
3839 * Makefile.in (emipsidt.c): Depend upon mipsecoff.em rather than
3841 (emipsidtl.c): Likewise.
3842 (check): Pass CC_FOR_HOST and CFLAGS_FOR_HOST to runtest.
3844 * ld.h (args_type): Add new field embedded_relocs.
3845 * ldemul.h (ldemul_after_open, after_open_default): Declare.
3846 (ld_emulation_xfer_struct): Add new field after_open.
3847 * ldemul.c (ldemul_after_open): New function.
3848 (after_open_default): New function.
3849 * ldlang.c (lang_process): Call ldemul_after_open.
3850 * lexsup.c (parse_args): Handle --embedded-relocs.
3851 * emultempl/elf32.em (ld_${EMULATION_NAME}_emulation): Initialize
3852 new after_open field to after_open_default.
3853 * emultempl/generic.em, emultempl/gld960.em: Likewise.
3854 * emultempl/gld960c.em, emultempl/hppaelf.em: Likewise.
3855 * emultempl/linux.em, emultempl/m88kbcs.em: Likewise.
3856 * emultempl/sunos.em, emultempl/vanilla.em: Likewise.
3857 * ld.texinfo, ld.1: Mention -embedded-relocs.
3861 * Makefile.in: Add eshl.o.
3862 * config/coff-sh.mt: Add shl emulation.
3866 * scripttempl/elf.sc: Fill .text section with NOPS. From Eric
3872 * config/i386linux.mh: New file; set HOSTING_CRT0.
3873 * genscripts.sh: Don't put ${libdir} in LIB_PATH if it is
3874 /usr/lib, since that is already in LIB_PATH.
3878 * scripttempl/hppaelf.sc (.text): Handle a use rdefined text start
3880 (.data, .bss): If "-N", then place the data/bss just after the end
3881 of the .text section rather than at the default 0x40000000.
3883 * scripttempl/hppaelf.sc (.text): Place unwind descriptors in the
3889 * ldlang.c (lang_finish): Don't warn if entry symbol not found
3890 when generating a shared library.
3891 * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Warn if
3892 attempting to place an orphaned relocation section when generating
3893 a dynamically linked object.
3895 * scripttempl/elf.sc: Add ENTRY(${ENTRY}), and default ${ENTRY} to
3900 * ld.h (args_type): Add field export_dynamic.
3901 * lexsup.c (parse_args): Recognize --export-dynamic.
3902 * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
3903 Pass export_dynamic argument to bfd_elf32_size_dynamic_sections.
3907 * ldlang.c (lang_one_common): Set SEC_ALLOC in any section where
3908 we allocate common symbols.
3912 * scripttempl/elf.sc: Add .rel.init, .rela.init, .rel.fini, and
3913 .rela.fini to the list of .rel* sections.
3917 * ldlang.c (load_symbols): Add new argument place. Only accept
3918 linker scripts if place is not NULL. Put commands found in an
3919 assumed linker script into place.
3920 (lookup_name): Pass NULL as place argument to load_symbols.
3921 (open_input_bfds): In lang_input_statement_enum case, pass a place
3922 argument to load_symbols, and store any new statements after the
3927 * ldver.c (ldversion): Bump to 2.5.3.
3931 * Makefile.in (e*nbsd.c): Fix typo in dependencies.
3935 * Makefile.in (check): Add missing "else true" clause.
3937 * emulparams/vax.sh (OUTPUT_FORMAT): Use "a.out".
3939 * scripttempl/go32coff.sc: Changes from DJ Delorie: Change default
3940 entry point to "start". Align at end of each section to 0x200.
3941 Start .text section 0x1000 later. Add _etext, _edata, _end
3946 * ldctor.c (ldctor_add_set_entry): Don't permit a set to be
3947 composed of different object file formats.
3948 (ldctor_build_sets): If the output format does not support the
3949 reloc, and we are not generating a relocateable link, try getting
3950 the reloc from the input format.
3954 * Makefile.in (ALL_EMULATIONS): Added em68knbsd.o.
3955 (em68knbsd.c): New target.
3957 * config/m68k-nbsd.mt: New file.
3958 * emulparams/m68knbsd.sh: New file.
3959 * configure.in (m68*-*-netbsd*): Use above configs.
3963 * emultempl/sunos.em (gld${EMULATION_NAME}_find_so): If we find an
3964 appropriately named static library, stop the search at that
3969 * Makefile.in (ALL_EMULATIONS): Added ei386nbsd.o, ens32knbsd.o
3970 and esparcnbsd.o; sorted entries.
3971 (ei386nbsd.c,ens32knbsd.c,esparcnbsd.c): New targets.
3973 * config/netbsd532.mt: Removed.
3974 * emulparams/netbsd532.sh: Removed.
3976 * config/{i386-nbsd.mt,ns32k-nbsd.mt,sparc-nbsd.mt}: New files.
3977 * emulparams/{i386nbsd.sh,ns32knbsd.sh,sparcnbsd.sh}: New files.
3978 * configure.in (i[345]86-*-netbsd*, ns32k-pc532-netbsd*,
3979 sparc*-*-netbsd*): Use above configs.
3983 * ldmain.c (multiple_common): One of the types may now be
3984 bfd_link_hash_indirect. The old BFD argument may be NULL.
3988 * configure.in: Add * at the end of m68k-hp-hpux.
3992 * ldlex.l: Cast assignment to yy_ch_buf field to char *, not to
3997 * scripttempl/nw.sc: Gather constructors and destructors and
3998 define __CTOR__LIST__ and __DTOR_LIST__ appropriately.
4002 * Makefile.in (ALL_EMULATIONS): Add ei386nw.o and eppcnw.o.
4003 (ei386nw.c, eppcnw.c): New targets.
4005 * config/{i386,ppc}-nw.mt, emulparams/{i386,ppc}nw.sh,
4006 scripttempl/nw.sc: New files, for i386 and powerpc netware.
4008 * configure.in: Changed netware ld_target name to be {i386,ppc}-nw
4009 instead of {i386,ppc}-elf.
4011 * configure.in (sparc*-*-netware): Removed. There is no such
4014 * ldint.texinfo: Move misplaced `@end iftex'.
4018 * scripttempl/elf.sc: Add .rel.ctors, .rela.ctors, .rel.dtors, and
4019 .rela.dtors to the list of .rel* sections.
4023 * ldver.c (ldversion): Update to version 2.5.
4024 * Version 2.5 released.
4026 * configure.in (all_targets): Handle i386-linux*.
4030 * scripttempl/aout.sc: Set _etext and __etext to ., not
4031 ${DATA_ALIGNMENT}. This is compatible with SunOS, and, with luck,
4032 will not break any other system. From Eric Valette
4037 * lexsup.c (parse_args): Change -V to be a synonym for -v. Add
4038 --verbose to get the old -V behaviour.
4039 * ld.1, ld.texinfo: Document this change.
4043 * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Remove
4044 assertion, since it could fail with a user defined linker script.
4046 * ldexp.c (fold_name): For DEFINED case, don't try to look up the
4047 name in the hash table during the first phase--the hash table does
4048 not even exist at that point, much less have the right value.
4050 * Makefile.in (CC): Define.
4051 (CXX): Move definition, change from g++ to gcc.
4052 (EXPECT, RUNTEST): Copy definitions from top level Makefile.in.
4053 (RUNTEST_CC, RUNTEST_CFLAGS): Remove.
4054 (RUNTEST_CXX, RUNTEST_CXXFLAGS): Remove.
4055 (CC_FOR_TARGET, CXX_FOR_TARGET): Copy from top level Makefile.in.
4056 (.cc.o): Comment out.
4058 (site.exp): Don't create testdir or set tmpdir.
4059 (check): Run checks even if not running native. Use CC_FOR_TARGET
4060 instead of RUNTEST_CC, and likewise for CXX.
4061 (cdtest targets): Comment out.
4062 * config/solaris2.mh (HOSTING_LIBS): Only mention crtend.o once.
4063 * testsuite/ld-cdtest/cdtest-bar.cc,
4064 testsuite/ld-cdtest/cdtest-foo.cc,
4065 testsuite/ld-cdtest/cdtest-foo.h,
4066 testsuite/ld-cdtest/cdtest-main.cc,
4067 testsuite/ld-cdtest/cdtest.exp: Remove.
4071 * emulparams/elf32bmip.sh: Rename from elf32mipb.sh to avoid DOS
4072 file naming problems.
4073 * emulparams/elf32lmip.sh: Rename from elf32mipl.sh.
4074 * Makefile.in (ALL_EMULATIONS): Rename eelf32mipb.o to
4075 eelf32bmip.o and eelf32mipl.o to eelf32lmip.o.
4076 (eelf32bmip.c): Rename from eelf32mipb.c. Use elf32bmip.sh.
4077 (eelf32lmip.c): Rename from eelf32mipl.c. Use elf32lmip.sh.
4078 * config/mipsb-elf32.mt (EMUL): Use elf32bmip, not elf32mipb.
4079 * config/mipsl-elf32.mt (EMUL): Use elf32lmip, not elf32mipl.
4081 * genscripts.sh: Always search /usr/local/TARGET/lib.
4083 * scripttempl/elf.sc: If -N is set, force DATA_ADDR to be ".".
4087 * configure.in: Handle i386-bsdi* targets like i386-bsd.
4091 * lexsup.c (parse_args): Add support for -a for HP/UX
4094 * lexsup.c (parse_args): -c takes an argument.
4098 * ld.h (args_type): Add new field endian.
4099 * lexsup.c (parse_args): Handle -EB and -EL by setting
4100 command_line.endian.
4101 * ldgram.y (ifile_p1): Accept OUTPUT_FORMAT with three arguments.
4102 * ldlang.c (lang_add_output_format): Add arguments big and little.
4103 If command_line.endian is set, use it to select big or little
4104 rather than the default. Changed all callers.
4105 * ldlang.h (lang_add_output_format): Update declaration.
4106 * emulparams/elf32mipb.sh: Define BIG_OUTPUT_FORMAT and
4107 LITTLE_OUTPUT_FORMAT.
4108 * emulparams/elf32mipl.sh: Likewise.
4109 * emulparams/mipsbig.sh: Likewise.
4110 * emulparams/mipsbsd.sh: Likewise.
4111 * emulparams/mipsidt.sh: Likewise.
4112 * emulparams/mipsidtl.sh: Likewise.
4113 * emulparams/mipslit.sh: Likewise.
4114 * scripttempl/elf.sc: Define BIG_OUTPUT_FORMAT and
4115 LITTLE_OUTPUT_FORMAT if not already defined. Pass them to
4117 * scripttempl/mips.sc: Pass BIG_OUTPUT_FORMAT and
4118 LITTLE_OUTPUT_FORMAT to OUTPUT_FORMAT.
4119 * scripttempl/mipsbsd.sc: Likewise.
4121 * Makefile.in (ldgram.h): Make separate target from ldgram.c,
4122 depending upon ldgram.c, so that a parallel make does not try to
4125 * configure.in (mips*el-elf*): New target.
4126 * Makefile.in (ALL_EMULATIONS): Add eelf32mipb.o and eelf32mipl.o.
4127 (eelf32mipl.c): New target.
4129 * config/mipsl-elf32.mt: New file.
4130 * emulparams/elf32mipl.sh: New file.
4134 * ldmain.c (main): Rather than prohibiting ld -r -s, treat it as
4139 * ldmisc.c (vfinfo): Print BFD file name as well as file name
4140 returned by find_nearest_line, in case the file name is something
4141 unhelpful such as a .h file. Handle %u.
4145 * ldlang.c (lang_do_assignments): Make sure output statement
4146 has an attached bfd_section before trying to dereference it.
4150 * ld.h (ld_config_type): Add new field warn_once.
4151 * ldmain.c (undefined_symbol): Handle -warn-once.
4152 * lexsup.c (parse_args): Recognize -warn-once.
4153 * ld.texinfo (Options): Document -warn-once.
4156 * ldmisc.c (vfinfo): Handle %D as %C, but never print the function
4157 name. For %C, print the function name on a separate line, to keep
4158 the length of error messages under control.
4159 * ldmain.c (multiple_definition): Use %D for ``first defined
4161 (undefined_symbol): Use %D for ``more undefined references
4164 * ldmisc.c (multiple_warn): Remove; no longer used.
4165 * ldmisc.h (multiple_warn): Don't declare.
4169 * ldlang.c (print_output_section_statement): Print all lines
4174 * ldlang.c (load_symbols): Check for archive before object. Use
4175 bfd_check_format_matches, and, if ambiguous, print a list of
4176 matching formats. If file format is not recognized, treat file as
4178 * ldgram.y (yyerror): If assuming an object file is a script,
4179 mention that. Tweak the format of the error messages.
4180 * ldlex.l (lex_warn_invalid): If assuming an object is a script,
4181 guess that this is not actually a script, and just report that the
4182 file format was not recognized.
4183 * ld.texinfo (Options): Admit that -( may be used more than once.
4184 Add note that unrecognized object files are now treated as linker
4187 * ldfile.c (ldfile_input_filename): Make const.
4188 (ldfile_assumed_script): New variable.
4189 (try_open): Change arguments types to const.
4190 (ldfile_find_command_file): Likewise.
4191 (ldfile_open_command_file): Likewise. Also, set lineno to 1.
4192 * ldfile.h: Update declarations for ldfile.c changes.
4193 * ldlex.l: Include <ctype.h>.
4194 (file_name_stack): Change to be const char *.
4195 (lineno_stack): New static variable.
4196 (<<EOF>>): Set lineno as well as ldfile_input_filename.
4197 (lex_push_file): Make name argument const. Initialize
4199 (lex_redirect): Initialize lineno_stack entry.
4200 (lex_warn_invalid): Handle non printable characters nicely.
4201 * ldlex.h (lex_push_file): Declare second argument as const.
4203 * ldgram.y (ifile_p1): Recognize GROUP.
4204 * ldlex.l: Recognize GROUP.
4205 * ld.texinfo (Option Commands): Document GROUP.
4209 * config/m68klynx.mh: New file.
4213 * emultempl/hppaelf.em: Add newlines to the error messages.
4217 * config/i386lynx.mh: New file.
4218 * scripttempl/i386lynx.sc: Don't put .ctors and .dtors in .text
4219 unless CONSTRUCTING.
4223 * emulparams/elf32mipb.sh (TEMPLATE_NAME): Define as elf32.
4224 (GENERATE_SHLIB_SCRIPT): Define as yes.
4225 (DYNAMIC_LINK): Define as false.
4226 * emultempl/elf32.em (gld${EMULATION_NAME}_before_parse):
4227 Initialize config.dynamic_link to DYNAMIC_LINK if it is defined.
4228 (gld${EMULATION_NAME}_place_orphan): Reset stat_ptr at end.
4229 * Makefile.in (eelf32mipb.c): Depend upon elf32.em rather than
4234 * scripttempl/h8500b.sc: Put rdata stuff into own segment.
4238 * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Don't define;
4239 .got section is now explicitly handled in elf.sc.
4243 * scripttempl/alpha.sc: Redo script to set . outside of sections
4244 and not bother to explicitly specify section addresses.
4245 Explicitly place .sdata section.
4249 * scripttempl/m68kcoff.sc: Put .bss in data segment.
4251 * scripttempl/h8300.sc: Change .stab and .stabstr to use a VMA of
4252 0, and to only be marked as NOLOAD if relocating.
4253 * scripttempl/h8500.sc, scripttempl/h8500b.sc: Likewise.
4254 * scripttempl/h8500c.sc, scripttempl/h8500m.sc: Likewise.
4255 * scripttempl/h8500s.sc, scripttempl/i386coff.sc: Likewise.
4256 * scripttempl/i386go32.sc, scripttempl/i386lynx.sc: Likewise.
4257 * scripttempl/m68kcoff.sc, scripttempl/m68klynx.sc: Likewise.
4258 * scripttempl/sh.sc, scripttempl/sparccoff.sc: Likewise.
4259 * scripttempl/sparclynx.sc: Likewise.
4263 * Makefile.in, configure.in: Add support (disabled) the ARM/RISCiX.
4264 * config/riscix.mt, emulparams/riscix.sh, scripttempl/riscix.sc:
4269 * ld.h (args_type): Add field soname.
4270 * lexsup.c (parse_args): Handle -soname argument.
4271 * emultempl/elf32.em: In call to bfd_elf32_size_dynamic_sections,
4273 * ld.texinfo: Document -soname.
4277 * ldlang.c (lang_check): Don't try to set the architecture if the
4278 input and output files are incompatible. Just warn.
4282 * configure.in: Change i[34]86 to i[345]86.
4286 * emulparams/hp3hpux.sh: Define __DYNAMIC to be 0.
4290 Make the ELF linker handle orphaned sections reasonably. Also,
4291 define __start_SECNAME and __stop_SECNAME around sections whose
4292 names can be represented in C, for the benefit of symbol sets in
4294 * ldemul.h (ldemul_place_orphan): Declare.
4295 (ld_emulation_xfer_type): Add place_orphan field.
4296 * ldemul.c (ldemul_place_orphan): New function.
4297 * ldlang.h (wild_doit): Declare.
4298 * ldlang.c (wild_doit): Make nonstatic.
4299 (lang_place_orphans): Call ldemul_place_orphan.
4300 * emultempl/elf32.em: Include <ctype.h> and "ldgram.h".
4301 (hold_section, hold_use, hold_text, hold_data, hold_bss): New
4303 (gld${EMULATION_NAME}_place_orphan): New static function.
4304 (gld${EMULATION_NAME}_place_section): New static function.
4305 (ld_${EMULATION_NAME}_emulation): Initialize place_orphan field.
4309 * scripttempl/aout.sc: Add .linux-dynamic after .data.
4313 * lexsup.c (parse_args) Treat --dll-verbose as --version, for
4318 * ldexp.h (exp_get_abs_int): Declare.
4322 * ldlang.c (lang_do_assignments): Handle complex AT's better.
4323 * ldexp.c (exp_get_abs_int): New function.
4327 * configure.in: add i960-nindy-coff support.
4331 * ldlex.l (yy_create_string_buffer): Handle change to internal
4332 interface in flex 2.4.7.
4336 * emultempl/linux.em (gld${EMULATION_NAME}_find_address_statement):
4337 New function; add 0x20 to any use of -Ttext.
4338 (gld${EMULATION_NAME}_create_output_section_statements): New
4340 (ld_${EMULATION_NAME}_emulation): Use the new function
4341 gld${EMULATION_NAME}_create_output_section_statements.
4345 * scripttempl/mips.sc: Redo script to set . outside of sections
4346 and not bother to explicitly specify section addresses.
4350 * scripttempl/elf.sc: Copy several more relocation sections into
4351 the output. Put .got.plt sections into .got.
4355 * scripttempl/elf.sc: Use PROVIDE to define etext, edata, and end.
4357 Add a new script operator, PROVIDE, to define a symbol only if it
4359 * ldgram.y (PROVIDE): New token.
4360 (assignment): Accept PROVIDE.
4361 * ldlex.l (PROVIDE): New token.
4362 * ldexp.h (node_type): Add etree_provide to node_class enum.
4363 (exp_provide): Declare.
4364 * ldexp.c (exp_fold_tree): Handle etree_provide.
4365 (exp_provide): New function.
4366 (exp_print_tree): Handle etree_provide.
4367 * ld.texinfo: Document PROVIDE.
4369 * ldlang.c (lang_common): Pass desired alignment to
4370 lang_one_common as power of two.
4371 (lang_one_common): Get common symbol alignment from linker hash
4372 table entry. Treat desired alignment as a power of two.
4374 * ldlang.c (wild_section): Attach all section with the given name,
4375 not just the first one. If there is no name, attach all sections
4376 even if the SEC_IS_COMMON flag is set.
4380 * ld.h (args_type): Add field rpath.
4381 * lexsup.c (S_ISDIR): Define if not already defined.
4382 (parse_args): Add support for -rpath. If -R is used to name a
4383 directory, treat it as -rpath for Solaris compatibility.
4384 * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
4385 Pass command_line.rpath to bfd_elf32_size_dynamic_sections.
4386 * ldmain.c (main): Initialize command_line.rpath to NULL.
4387 * ld.texinfo: Document -rpath option.
4391 * emulparams/pc532machaout.sh: New file. Pc532 mach script
4394 * emulparams/netbsd532.sh: New file. Netbsd 532 script parameters.
4396 * config/pc532mach.mt: New file. Pc532 mach target support.
4398 * config/pc532mach.mh: New file. Pc532 mach host support.
4400 * config/netbsd532.mt: New file. Netbsd 532 target support.
4402 * configure.in: Add ns32k-pc532-mach and ns32k-pc532-netbsd support.
4404 * Makefile.in: Add epcmachaout.c dependency and enetbsd532.c
4409 * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): Use
4410 bfd_abs_section_ptr, not &bfd_abs_section.
4412 * lexsup.c (parse_args): Changed "retain-symbols-file" from
4413 no_argument to required_argument. From djm.
4417 * scripttempl/elf.sc: Explicitly mention .stab and .stabstr
4418 sections to force a VMA of 0; needed for ELF backends which have
4419 not been converted to the new linker style.
4423 * scripttempl/hppaelf.sc (__stack_zero): Don't define this name,
4424 it was for the HPUX dynamic loader's use and it creates problems
4429 * ldlang.c (lang_do_assignments): No longer static. Delete decl.
4430 * ldlang.h (lang_do_assignments): Put external decl here.
4431 * emultempl/hppaelf.em: Minor cleanups throughout file.
4432 (hppa_elf_create_output_section_statements): Rewrite.
4433 (hppaelf_finish): Rewrite.
4437 * config/solaris2.mh (NATIVE_LIB_DIRS): Define as /usr/ccs/lib.
4439 * lexsup.c (parse_args): Accept -Bstatic and -Bdynamic. Do not
4441 * ld.texinfo: -Bstatic is not ignored.
4445 * ldlex.l: Recognize \r the same as \n.
4449 Preliminary support for generating shared libraries, from Eric
4451 * genscripts.sh: If the emulation parameter file sets
4452 GENERATE_SHLIB_SCRIPT, generate a .xs script file with
4453 CREATE_SHLIB defined.
4454 * emultempl/elf32.em (gld${EMULATION_NAME}_get_script): If
4455 link_info.shared is set, use the .xs script file.
4456 * scripttempl/elf.sc: If CREATE_SHLIB is set, don't create a
4457 .interp section, and don't include TEXT_START_ADDR in the starting
4458 address of the first section.
4459 * emulparams/elf_i386.sh (GENERATE_SHLIB_SCRIPT): Likewise.
4460 * emulparams/elf32_sparc.sh (GENERATE_SHLIB_SCRIPT): Define.
4464 * configure.in: Change --with-targets to --enable-targets.
4468 * lexsup.c (parse_args): Add support for new options -( -) with
4469 synonyms --start-group --end-group.
4470 * ldlang.h (enum statement_enum): Add lang_group_statement_enum.
4471 (lang_group_statement_type): Define new struct.
4472 (lang_statement_union_type): Add group_statement field.
4473 (lang_enter_group, lang_leave_group): Declare.
4474 * ldlang.c (lang_for_each_statement_worker): Handle
4475 lang_group_statement_enum.
4476 (map_input_to_output_sections, print_statement): Likewise.
4477 (lang_size_sections, lang_do_assignments): Likewise.
4478 (open_input_bfds): Completely rewrite. Now does its own looping,
4479 rather than using lang_for_each_statement. Handle groups.
4480 (lang_process): Update call to open_input_bfds.
4481 (print_group): New static function.
4482 (lang_enter_group, lang_leave_group): New static functions.
4483 * ldfile.c (ldfile_open_file): If the file has already been
4484 opened, just return rather than taking an assertion failure.
4485 * ldver.c (help): Mention new options.
4486 * ld.texinfo: Document new options.
4488 * ldlang.c (end_of_data_section_statement_list): Don't define.
4489 (lang_leave_output_section_statement): Don't set obsolete variable
4490 end_of_data_section_statement_list.
4492 * scripttempl/go32coff.sc: Don't put ${DATA_ALIGNMENT} inside an
4495 * ldlang.c (lang_size_sections): Adjust current region address
4496 even for sections with an explicit address. From
4499 * emulparams/i386linux.sh (NONPAGED_TEXT_START_ADDR): Set to 0.
4502 * scripttempl/mipsbsd.sc: Let sections align to their natural
4507 * ldlang.c (lang_init): Use new bfd_abs_section_ptr, not
4509 (lang_abs_symbol_at_beginning_of): Likewise.
4510 (lang_abs_symbol_at_end_of): Likewise.
4511 (lang_size_sections): Use bfd_is_abs_section to check for the
4512 absolute section. Don't try to set the VMA or output_offset or
4513 size of the absolute section.
4514 * ldmain.c (notice_ysym): Use bfd_is_und_section to check for the
4519 * scripttempl/hppaelf.sc: Place .data and .bss at 0x40000000
4520 when generating relocatable objects.
4524 * emultempl/linux.em: New file providing support for linking
4525 against Linux shared libraries.
4526 * config/i386-linux.mt (ei386linux.c): Depend upon linux.em.
4527 * emulparams/i386linux.sh (TEMPLATE_NAME): Define as linux.
4531 * lexsup.c (parse_args): Add -shared to longopts, and handle it.
4532 * ldmain.c (main): Initialize link_info.shared to false. Give
4533 error if link_info.relocateable and link_info.shared are both set.
4535 * configure.in: If EMUL_EXTRA* is defined in a config file, treat
4536 it as naming an emulation to be added to EMULATION_OFILES.
4537 * config/i386-linux.mt (EMUL_EXTRA1): Define as elf_i386.
4539 * Makefile.in: Rebuilt dependencies.
4540 (ALL_EMULATIONS): Add ei386linux.o, eelf32_sparc.o,
4541 eelf64_sparc.o. Remove $(OTHER_EMULATIONS).
4542 (ei386linux.c, eelf32_sparc.c, eelf64_sparc.c): New targets.
4543 * config/i386-linux.mt (OTHER_EMULATIONS): Don't define.
4544 (ei386linux.c): Remove; now in Makefile.in.
4545 * config/i386-lynx.mt (OTHER_EMULATIONS): Don't define.
4546 * config/m68k-lynx.mt (OTHER_EMULATIONS): Don't define.
4547 * config/sparc-lynx.mt (OTHER_EMULATIONS): Don't define.
4548 * config/sparc64-elf.mt (OTHER_EMULATIONS): Don't define.
4549 (eelf64_sparc.c): Remove; now in Makefile.in.
4550 * config/sun4sol2.mt (OTHER_EMULATIONS): Don't define.
4551 (eelf32_sparc.c): Remove; now in Makefile.in.
4553 * ldexp.c (exp_print_tree): Don't crash if etree_rel section has
4554 no owner--it might be bfd_abs_section. From Eric Youngdale
4557 * scripttempl/aout.sc: Let sections align to their natural
4562 * ldemul.h (ldemul_open_dynamic_archive): Declare.
4563 (ld_emulation_xfer_type): Add new field open_dynamic_archive.
4564 * ldemul.c: Include ldexp.h and ldlang.h.
4565 (ldemul_open_dynamic_archive): New function.
4566 * ldfile.h (ldfile_open_file_search): Declare.
4567 * ldfile.c: Include ldemul.h.
4568 (try_open_bfd): Rename from cache_bfd_openr. Return boolean
4569 argument, not bfd *. Change all callers.
4570 (ldfile_open_file_search): Rename from open_a. Return boolean
4571 argument, not bfd *. Clean up. Change all callers.
4572 (ldfile_open_file): If doing a dynamic link, call
4573 ldemul_open_dynamic_archive rather than assuming the extension of
4574 a dynamic object is ".so".
4575 * emultempl/elf32.em (gld${EMULATION_NAME}_open_dynamic_archive):
4577 (ld_${EMULATION_NAME}_emulation): Initialize open_dynamic_archive
4579 * emultempl/sunos.em (ld_${EMULATION_NAME}_emulation): Likewise.
4581 * ldmain.c (get_emulation): Ignore -m486 for Linux compatibility.
4582 * lexsup.c (parse_args): Ignore -qmagic for Linux compatibility.
4583 Accept -static as a synonym for -non_shared.
4585 Let the user change the dynamic linker used by ELF code.
4586 * ld.h (args_type): Add new field interpreter.
4587 * lexsup.c (parse_args): Add dynamic-linker to longopts, and
4589 * ldmain.c (main): Initialize command_line.interpreter to NULL.
4590 * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Get
4591 the ELF backend to return the .interp section. If
4592 command_line.interpreter is not NULL, set the contents of .interp
4594 * ld.texinfo: Mention -dynamic-linker.
4596 * config/sun4sol2.mt (eelf32_sparc.c): Depend upon elf32.em, not
4599 * lexsup.c (parse_args): Sort out the option macros and change the
4600 definitions to make it easier to add a new option.
4602 * scripttempl/aout.sc: Define __etext and __edata to go along with
4605 * ld.h (ld_config_type): Add new field traditional_format.
4606 * lexsup.c (parse_args): Add traditional-format to longopts, and
4608 * ldmain.c (main): Initialize config.traditional_format to false.
4609 * ldlang.c (ldlang_open_output): Set BFD_TRADITIONAL_FORMAT in BFD
4610 flags of output_bfd according to config.traditional_format.
4611 * ldver.c (help): Mention -traditional-format.
4612 * ld.texinfo: Document -traditional-format.
4616 * ldctor.c (ldctor_add_entry): Add entries to a set in the order
4617 they are encountered.
4621 * emulparams/i386linux.sh (TEXT_START_ADDR): Define as 0x1000.
4622 (NONPAGED_TEXT_START_ADDR): Define as 0x20.
4626 * scripttempl/alpha.sc: Define _ftext, _etext and _fdata insted of
4627 _FTEXT, _ETEXT and _FDATA. Dont define _END.
4629 * ldfile.c (open_a): If this is not an archive, try to open it in
4630 the current directory before searching for it.
4632 * lexsup.c (parse_args): Treat -i as a synonym for -r.
4634 * ldgram.y (exp): Treat BLOCK as a synonym for ALIGN, so that
4635 BLOCK works in a section address as documented.
4637 * ldgram.y (YYDEBUG): Don't define.
4641 * emultempl/gld960.em: Pass false for new argument to
4642 ldfile_add_library_path.
4643 * emultempl/gld960c.em, emultempl/lnk960.em: Likewise.
4645 * emultempl/sunos.em: Only look for .so files if doing a dynamic
4650 * scripttempl/i960.sc: Add CONSTRUCTORS to .data.
4654 * Makefile.in (check): Delete ld.new dependency so that a regression
4655 test doesn't trigger a rebuild of the linker.
4659 * ldlang.c (map_input_to_output_sections): For lang_address, call
4660 init_os if it hasn't already been called.
4664 Add support for SunOS shared libraries.
4665 * scripttempl/aout.sc: Don't define __DYNAMIC here. Add new
4666 sections used by shared library support code.
4667 * emultempl/sunos.em: New file.
4668 * emulparams/sun4.sh (TEMPLATE_NAME): Define as sunos.
4669 * emulparams/sun3.sh (TEMPLATE_NAME): Likewise.
4670 * Makefile.in (esun4.c): Depend upon sunos.em, not generic.em.
4671 (esun3.c): Likewise.
4673 * ldlang.c: Minor formatting cleanups.
4674 (lang_for_each_input_file): New function.
4675 * ldlang.h (lang_for_each_input_file): Declare.
4677 * ldfile.h (search_dirs_type): Move from ldfile.c, and add cmdline
4679 (search_head): Declare.
4680 (ldfile_add_library_path): Add new cmdline argument in prototype.
4681 * ldfile.c (search_head): Make non-static.
4682 (search_dirs_type): Move to ldfile.h.
4683 (ldfile_add_library_path): Accept cmdline argument, and save it.
4684 * lexsup.c (parse_args): Pass true for new cmdline argument of
4685 ldfile_add_library_path.
4686 (set_default_dirlist): Likewise.
4687 * ldmain.c (check_for_scripts_dir): Pass false for new cmdline
4688 argument of ldfile_add_library_path.
4689 * ldgram.y (ifile_p1): Likewise.
4693 * ldlang.h (lang_input_statement_type): Remove fields subfiles,
4694 total_size, superfile and chain.
4695 * ldfile.c (open_a): Don't clear search_dirs_flag.
4696 (ldfile_open_file): Don't try to open superfile. Assert that file
4697 has not already been opened.
4698 * ldlang.c (new_afile): Don't initialize superfile.
4699 * ldmain.c (add_archive_element): Don't initialize subfiles or
4700 chain or superfile. Initialize search_dirs_flag to false.
4704 * ldver.c (ldversion): Changed version to "cygnus-2.4.1".
4706 Changes from binutils-2.4 release:
4708 * genscripts.sh (RELOCATING, CONSTRUCTING): When setting
4709 variables, use whitespace, so scripts don't break.
4711 * config/alphaosf.mh (HDEFINES, CFLAGS): Deleted.
4713 * emultempl/generic.em: Find emultempl/stringify.sed in ${srcdir}.
4715 * testsuite/ld-cdtest/cdtest-bar.cc: Renamed from cdtest-func.cc.
4716 * Makefile.in: Noted change.
4718 * scripttempl/a29k.sc: Don't include /lab3/u3/..../segments.o; I
4719 don't know where that's supposed to come from, or why it's
4724 * configure.bat: update to latest Makefile.in
4725 * emulparams/go32.sh: set to coff-go32 not aout
4726 * emultempl/generic.em: strength-reduce the structure of
4727 this shell script, since the only available shell for
4728 DOS can't handle complex syntax.
4729 * emultempl/stringify.sed: for "sed -f" instead of inline.
4730 * Makefile.in: depend on stringify.sed as well as genscripts.sh
4731 * scripttempl/go32coff.sc: correct for djgpp 1.11's COFF format
4732 * genscripts.sh: empty variables aren't always considered "set",
4733 so set them to "y" instead.
4737 * ldlang.c (entry_symbol): Make static.
4738 (lang_add_entry): Add cmdline argument.
4739 * ldlang.h (lang_add_entry): Change prototype.
4740 * ldgram.y (statement_anywhere): Change lang_add_entry call.
4741 * lexsup.c (parse_args): Likewise.
4745 * emulparams/elf32mipb.sh (OTHER_READONLY_SECTIONS): Don't give
4746 .reginfo an address.
4747 (OTHER_READWRITE_SECTIONS): Don't give .lit4 or .lit8 an address.
4748 (OTHER_SECTIONS): Define for .gptab.sdata and .gptab.sbss.
4749 * scripttempl/elf.sc: Use OTHER_SECTIONS at end of script.
4753 Add support for ELF shared libraries.
4754 * ld.h (ld_config_type): Add field dynamic_link.
4755 * ldmain.c (main): Initialize config.dynamic_link to false. Warn
4756 on attempts to use -r with -relax, -call_shared or -s.
4757 * lexsup.c (longopts): Separate OPTION_CALL_SHARED from
4758 OPTION_NON_SHARED. Add OPTION_IGNORE. Adjust macro values
4759 accordingly. Add "dy" and "non_shared" options. Change "Qy" to
4760 OPTION_IGNORE for now. Handle OPTION_CALL_SHARED and
4761 OPTION_NON_SHARED by setting dynamic_link field accordingly.
4762 Handle OPTION_IGNORE by ignoring it. Clear dynamic_link field for
4764 * ldfile.c (ldfile_open_file): If config.dynamic_link is true, try
4765 opening a file with a .so extension first.
4766 * emultempl/elf32.em: New file.
4767 * emulparams/elf32_sparc.sh (TEXT_START_ADDR): Change to 0x10000.
4768 (NONPAGED_TEXT_START_ADDR): Likewise.
4769 (TEMPLATE_NAME): Define as elf32.
4771 * emulparams/elf_i386.sh (TEMPLATE_NAME): Define as elf32.
4772 * scripttempl/elf.sc: Add placement for new dynamic sections.
4773 Don't use CREATE_OBJECT_SYMBOLS. Define _etext, _edata and _end
4774 outside of any section. Don't use ALIGN(8); just let one section
4775 VMA follow another. Put .dynbss in .bss. Don't mention debugging
4776 sections; they'll be handled correctly anyhow.
4777 * Makefile.in (eelf_i386.c): Depend upon elf32.em, not generic.em.
4781 * Makefile.in (install): Redirect output of ln to /dev/null.
4785 * emultempl/hppaelf.em: Change all references of
4786 .hppa_linker_stubs to .PARISC.stubs.
4787 * scripttempl/hppaelf.sc: Likewise.
4791 * ldlang.c (print_output_section_statement): Change ``no attached
4792 output section'' message slightly.
4793 (lang_do_assignments): Don't recurse down if there is no real
4796 * config/i386-linux.mt (OTHER_EMULATIONS): Change em_ to e to
4797 match corresponding change in emulation templates.
4798 * config/i386-lynx.mt, config/m68k-lynx.mt: Likewise.
4799 * config/sparc-lynx.mt, config/sun4sol2.mt: Likewise.
4803 * ldver.c (ldversion): Updated version number.
4805 * testsuite/ld-cdtest/cdtest-foo.cc: Use explicit "#pragma
4807 * testsuite/ld-cdtest/cdtest-bar.cc: Renamed from cdtest-func.cc.
4808 * Makefile.in: References to cdtest-func.o changed to
4813 Don't create unnecessary output sections.
4814 * ldlang.c (out_bfd_get_section_by_name): Remove.
4815 (wild_section): Call bfd_get_section_by_name rather than
4816 our_bfd_get_section_by_name. Don't call wild_doit if there is no
4818 (lang_create_output_section_statements): Remove.
4819 (map_input_to_output_sections): For several cases, call init_os if
4820 it has not already been called.
4821 (lang_size_sections): If output section was not created, skip it.
4822 (lang_process): Don't call lan_create_output_section_statements.
4823 (lang_place_orphans): Skip files with just_syms_flags set to true.
4824 * ld.texinfo: Document change.
4828 * ldlang.c (wild_doit): Don't bother initializing the vma and
4829 section size. Don't special case SEC_SHARED_LIBRARY.
4830 (lang_size_sections): Handle SEC_COFF_SHARED_LIBRARY sections
4835 * config/go32.mh : New file for Xgo32X.
4839 * ldfile.c (ldfile_open_command_file): Set bfd_error_system_call
4840 before calling einfo, since we are reporting an fopen failure.
4843 * configure.in: Use "e" rather than "em_" as prefix for
4848 * emultempl/generic.em: Use "e" rather than "em_" as prefix for
4850 * emultempl/gld960.em, emultempl/gld960c.em, emultempl/lnk960.em,
4851 emultempl/hppaelf.em, emultempl/m88kbcs.em, emultempl/vanilla.em:
4853 * Makefile.in: Changed all generated file names.
4854 (ldemul-list.h): Depend on Makefile, not config.status. Changed
4855 sed patterns to handle new filenames.
4857 * config/mipsl-idt.mt: Renamed from mips-idtl.mt.
4858 * configure.in: Adjusted.
4862 * Makefile.in (install-info): Don't use "$<*", it doesn't always
4863 work. Instead, check build dir and $srcdir explicitly, and use
4864 `echo' to get all the filenames.
4866 * configure.in (h8300h-*-hms): Changed ld_target name to
4868 * config/cf-h8300h.mt: Renamed from coff-h8300h.mt, to make it
4871 * config/i960coff.mt: New file.
4872 * emulparams/gld960coff.sh: New file.
4873 * emultempl/gld960c.em: New file.
4874 * configure.in (i960-*-vxworks5* except -vxworks5.0*): Use
4875 i960coff configuration.
4876 * Makefile.in (em_gld960coff.c): Added dependencies, build rule.
4878 * Makefile.in (ALL_EMULATIONS): Remove em_delta68.o, since the
4879 code isn't included in FSF releases, and it can still be
4880 explicitly selected.
4881 (distclean): Remove site.bak and tmpdir.
4882 (STAGESTUFF): Removed $(GENERATED_CFILES) $(GENERATED_HFILES).
4883 (mostlyclean): Delete them explicitly here. Also remove tmpdir.
4885 Patches from Ralph Campbell:
4886 * config/mipsbsd.mh: New file.
4887 * Makefile.in (em_mipsbsd.c): Use mipsbsd.sc, not aout.sc.
4888 * scripttempl/mipsbsd.sc: Don't define __DYNAMIC.
4889 * emulparams/mipsbsd.sh (OUTPUT_FORMAT): Fix name to have `a.out'
4892 * configure.in (i386-*-gnu*): Treat like i386-*-mach*.
4896 * config/m68k.mt (EMUL): Set to m68kaout.
4897 * emulparams/m68kaout.sh: New file.
4898 * Makefile.in (ALL_EMULATIONS): Add em_m68kaout.o.
4899 (em_m68kaout.c): New target.
4901 * ldlang.c (lang_size_sections): If dot moves because of an
4902 assignment, don't try to insert a pad into the absolute output
4903 section, just change the address of the default memory region
4906 * Makefile.in (mostlyclean): Remove cdtest.tmp, cdtest-ur,
4907 cdtest-ur.out, and cdtest-ur.tmp.
4911 * scripttempl/sa29200.sc: Align all sections to four byte
4916 * Makefile.in, configure.in: Support for go32 coff.
4917 * config/i386-go32.mt: New file
4918 * emulparams/i386go32.sh: New file
4919 * scripttempl/i386go32.sc: New file
4923 * Makefile.in (em_m68klynx.c, em_i386lynx.c, em_sparclynx.c): Use
4924 Lynx-specific script templates.
4925 * configure.in (sparclite*-*-coff): Use coff-sparc.
4926 * emulparams/i386lynx.sh (SCRIPT_NAME): Set to i386lynx.
4927 * emulparams/sparclynx.sh (SCRIPT_NAME): Set to sparclynx.
4928 (ENTRY): Set to __main.
4929 * scripttempl/i386lynx.sc: New file, script for I386 Lynx.
4930 * scripttempl/m68klynx.sc: Add insertion of ctor/dtor sections.
4931 * scripttempl/sparclynx.sc: New file, script for uSparc Lynx.
4935 * scripttempl/mips.sc: Force _gp and .lit8 to be aligned to a 16
4936 byte boundary, in case the global constructors do not take up an
4939 * config/i386v4.mh (HOSTING_CRT0): If ../gcc/crtbegin.o does not
4940 exist, get crtbegin based on gcc -print-libgcc-file-name.
4941 (HOSTING_LIBS): Similar change for ../gcc/crtend.o.
4945 * ldlang.c (lang_size_sections): When no address is given for a
4946 section, align it according to its requirements.
4950 * Makefile.in (clean, distclean): Remove configdoc.texi.
4954 * configure.in: Add i[34]86-*-bsd386 to the patterns recognized.
4958 * ldlang.c (lang_size_sections): When relaxing, adjust the
4959 position of a padding statement, and adjust dot accordingly.
4963 * Makefile.in (EXPECT, RUNTEST): Set these for the check goal.
4967 * scripttempl/i386coff.sc: If relocating, don't put .init and
4968 .fini sections into .text; keep them separate.
4969 * config/i386sco.mh (HOSTING_CRT0): If ../gcc/crtbegin.o does not
4970 exist, get crtbegin based on gcc -print-libgcc-file-name.
4971 (HOSTING_LIBS): Similar change for ../gcc/crtend.o.
4975 * Makefile.in (check): Set TCL_LIBRARY for runtest.
4979 * configure.in (hppa*-*-*elf*): Don't require "-hp-" for the
4982 * emultempl/hppaelf.em (hppaelf_finish): Only resize sections
4983 if building a final executable.
4987 * ldmain.c (main): Check the return value of bfd_close.
4991 * scripttempl/alpha.sc: Clean up section alignment to ensure that
4992 sections never overlap when using -r.
4996 * ldmisc.c (vfinfo): Change symbol reading slightly for recent BFD
4997 changes: get_symtab_upper_bound renamed and returns long,
4998 bfd_canonicalize_symtab returns long, check for error indications.
5002 * ldlang.c (print_input_section): For section size, use
5003 _cooked_size if it is non-zero, size otherwise.
5004 (size_input_section): Likewise.
5005 (lang_do_assignments): Likewise (case lang_input_section_enum).
5009 * ldlang.c (new_afile): Add new argument add_to_list. Don't set
5010 real to true for lang_input_file_is_marker_enum. Clear the_bfd.
5011 (lang_add_input_file): Pass true to new_afile for add_to_list.
5012 (lookup_name): Remove force_load argument. Changed all callers.
5013 Pass false to new_afile for add_to_list. Split loading of symbols
5014 out into separate function.
5015 (load_symbols): New function split out of lookup_name. Don't load
5016 the symbols if they are already loaded.
5017 (open_input_bfds): For lang_input_statement_enum call load_symbols
5018 rather than lookup_name.
5019 (lang_process): Pass abs_output_section rather than NULL to
5021 (lang_startup): Set real field of first_file to true.
5025 * ldlang.c (had_relax): Removed.
5026 (relax_again): New static variable.
5027 (lang_size_sections): Change call to bfd_relax_section to
5028 correspond to BFD changes. Set relax_again appropriately.
5029 (lang_process): Remove #if 0 code. When relaxing, keep calling
5030 lang_do_assignments and lang_size_sections until relax_again
5033 * emultempl/gld960.em: Include libiberty.h
5034 (gld960_before_parse): Pass NULL as final argument to concat.
5038 * scripttempl/aout.sc: Force _end and __end to be aligned to a
5041 * ldwrite.c (build_link_order): Handle lang_data_statement_enum by
5042 building a bfd_data_link_order, rather than by setting the section
5043 contents immediately.
5047 Changes to make -Ur work again.
5048 * ldmain.c (add_to_set): Now takes reloc argument rather than
5049 bitsize. Check config.build_constructors here. If an new hash
5050 table entry is created, mark it as undefined.
5051 (constructor_callback): No longer takes bitsize argument. Pass
5052 BFD_RELOC_CTOR to ldctor_add_set_entry, but first make sure the
5053 BFD backend supports it.
5054 (reloc_overflow): Handle a NULL abfd argument.
5055 (reloc_dangerous, unattached_reloc): Likewise.
5056 * ldctor.c: Include ldmain.h.
5057 (struct set_info): Change bitsize field to reloc.
5058 (ldctor_add_set_entry): Now takes reloc argument rather than
5059 bitsize. Don't bother to check config.build_constructors here.
5060 (ldctor_build_sets): Get the size from the reloc howto. If
5061 generating relocateable output, call lang_add_reloc rather than
5063 * ldctor.h (ldctor_add_set_entry): Change declaration to use reloc
5065 * ldlang.h (statement_enum): Add lang_reloc_statement_enum.
5066 (lang_reloc_statement_type): New structure.
5067 (lang_statement_union_type): Add reloc_statement field.
5068 (lang_add_reloc): Declare new function.
5069 * ldlang.c (lang_for_each_statement_worker): Handle
5070 lang_reloc_statement_enum.
5071 (map_input_to_output_sections, print_statement): Likewise.
5072 (lang_size_sections, lang_do_assignments): Likewise.
5073 (print_reloc_statement): New function.
5074 (lang_add_reloc): New function.
5075 * ldwrite.c (build_link_order): Handle lang_reloc_statement_enum.
5077 * Makefile.in (cdtest.out, cdtest-ur.o): New targets.
5078 (cdtest-ur, cdtest-ur.out): New targets.
5079 (check-cdtest): Now also check that -Ur works correctly.
5081 * scripttempl/alpha.sc: Align all sections to 16 byte boundaries.
5085 * ldlang.c (lang_process): Move lang_common call before
5086 map_input_to_output_sections, to ensure that any alignment
5087 constraints set by common symbols are copied over to the output
5092 * emulparams/elf32ppc.sh (TEMPLATE_NAME): Don't define.
5093 (OTHER_READWRITE_SECTIONS): Rename .toc to .got.
5094 * Makefile.in (em_elf32ppc.c): Depend upon generic.em, not ppc.em.
5095 * emultempl/ppc.em: Remove ugly stub code; turns out not to be
5100 * config/i386bsd.mh: New file.
5104 * scripttempl/elf.sc: Permit TEXT_START_SYMBOLS and
5105 DATA_START_SYMBOLS to be defined.
5106 * emulparams/elf32mipb.s (TEXT_START_SYMBOLS): Define _ftext.
5107 (DATA_START_SYMBOLS): Define _fdata.
5111 * ldlang.c (cat): Define using ANSI style if ALMOST_STDC defined.
5115 * emultempl/hppaelf.em (hppaelf_finish): Update comments. This
5116 works again. Attach some output symbols to the stub file bfd.
5118 * emultempl/hppaelf.em: Include elf32-hppa.h.
5119 (file_chain): Add decl.
5120 (hppa_look_for_stubs_in_section): Delete decl.
5121 (hppaelf_finish): Reenable code. Do not pass symbols
5122 down to hppa_look_for_stubs_in_section.
5126 * ldmain.c (write_map): Don't define. Removed all references.
5127 Just use map_file or map_filename instead.
5128 (add_archive_element): Use minfo to write map information, not
5130 (constructor_callback): Use fprintf to write map information, not
5132 * ldmain.h (write_map): Don't declare.
5133 * ldgram.y (mri_script_command): Removed reference to write_map.
5134 * ldlang.c (lang_one_common): Likewise.
5135 * lexsup.c (parse_args): Likewise.
5139 * scripttempl/elf.sc: Force all sections to be aligned.
5141 * ldgram.y (section): Reverse the order of memspec_opt and
5142 fill_opt to avoid an ambiguity when both are used.
5143 * ld.texinfo: Changed accordingly.
5145 * ldgram.y: Move include of ldlex.h back with other includes.
5146 * ldlex.h (input_type): Don't initialize enum constants to
5148 * ldlex.l: Use a switch to return the right token based on
5149 input_type, rather than knowing that input_type has a value based
5152 * ldgram.y (dirlist_ptr): Removed; not used.
5153 * lexsup.c: Include ldver.h.
5154 * Makefile.in: Rebuilt dependencies.
5158 * ldlang.c (lookup_name): don't call bfd_set_gp_size.
5159 (ldlang_add_file): call it here instead.
5163 * ldgram.y: Include ldlex.h after %token decls, for byacc.
5167 * emultempl/hppaelf.em: First attempt to clean this file up.
5168 Add comments in several functions as to their purpose and
5169 how they function (or my current best guess). Clean up horrible
5170 spacing and indention that never should have been accepted in the
5171 first place. Add FIXMEs for issues which need to be resolved.
5172 Disable linker-stub generation until it gets fixed. This allows
5173 the linker to at least work on simple code for testing purposes.
5175 * ldlang.c (lang_size_sections): No longer static (PA ELF calls
5176 it via hppaelf_finish). Prototype moved into ldlang.h.
5177 (lang_process): Move problematic extra call to lang_size_sections
5178 into the PA ELF specific code.
5179 * emultempl/hppaelf.em (hppaelf_finish): Extra call to
5180 lang_size_sections moved here.
5184 * configure.in (powerpc-*-elf*): New target; use ppc-elf32.
5185 * config/ppc-elf32.mt: New file.
5186 * emulparams/elf32ppc.sh: New file.
5187 * emultempl/ppc.em: New file.
5188 * Makefile.in (ALL_EMULATIONS): Added em_elf32ppc.o.
5189 (em_elf32ppc.c): New target; uses elf32ppc.sh, ppc.em and elf.sc.
5190 (EMULATION_OFILES): Added dependencies on ldexp.h and ldlang.h.
5194 * lexsup.c (parse_args): Use symbolic numbers for long options.
5195 Fix misunderstanding in -Y and -call_shared et al.
5197 Use getopt instead of lex and yacc to parse the command line.
5199 * ld.texinfo (Options): Document changes to option syntax.
5200 * Makefile.in: Update dependencies.
5201 * ldver.c (help): Tweak dashes in usage message.
5202 * ldgram.y (%union): Remove unused members.
5203 Remove %tokens for command line options; add ones for input types.
5204 (command_line): Rules removed.
5205 (file): Instead of command line, recognize an
5206 input type indicator, then use the nonterminal for that type.
5207 (defsym_expr): New nonterminal from code formerly in command_line.
5208 * ldlex.h: Declare parser input type enum and variable.
5209 Don't declare parse_line.
5210 * ldlex.l: Remove unused variables. Make some used ones static
5212 (COMMAND): Start state and its rules removed.
5213 At start of yylex, return input state token if at start of input.
5214 (lex_redirect): Don't need to set yyout.
5215 (ldlex_command): Function removed.
5216 * ldmain.c (main): Instead of calling parse_line, set up the
5217 redirections and call yyparse directly.
5218 * ldmisc.c (vfinfo): If there's no input filename, print nothing, not
5220 * lexsup.c: Remove #if 0'd code.
5221 (parse_line): Function removed.
5222 (parse_args): Rewrite to use getopt_long_only.
5223 (set_default_dirlist): New function from code formerly in
5224 ldgram.y:command_line.
5225 (set_section_start): New function.
5226 * emultempl/generic.em, emultempl/gld960.em, emultempl/hppaelf.em,
5227 emultempl/lnk960.em, emultempl/m88kbcs.em: Don't enclose
5228 compiled-in link scripts in "{" and "}", as the grammar no longer
5233 * Makefile.in (ld.dvi): Depend on configdoc.texi, but don't
5234 require that it be in $(srcdir).
5238 * ldlang.c (lang_size_sections): Only align section to alignment
5239 required by linker script, not to maximum alignment of input
5242 * ldlang.h (largest_section): Don't declare.
5243 * ldlang.c (largest_section): Don't define.
5244 (size_input_section): Don't set largest_section; not used.
5248 * ldlang.c (new_afile): Pass NULL as last argument to concat.
5252 * ldlang.c, ldmain.c: Include libiberty.h.
5254 * ldmisc.h (concat): Don't declare.
5255 * ldmisc.c (concat): Don't define; just use the one in libiberty.
5257 * ld.h (as_output_section_statement): Removed; not used.
5261 * ldlang.c, ldmain.c, ldmisc.c: Use bfd_get_error and
5262 bfd_set_error and new error names.
5266 * ldwrite.c (build_link_order): If the cooked size of the section
5267 has been set, use it, for determining link_order size.
5268 (ldwrite): In the error message displayed if bfd_final_link fails,
5269 indicate that it was in fact the final link step that failed.
5271 * ldlang.c (lang_size_sections): Clear bfd_error before calling
5272 bfd_relax_section, in case it returns false but doesn't flag an
5273 error. If an error is returned, indicate which one it is in the
5276 * Makefile.in (install-info): Depend on ld.info, and use "$<*" so
5277 it'll get picked up from $(srcdir) if appropriate.
5281 * scripttempl/aout.sc: Only pad .text if PAD_TEXT is set.
5282 * emulparams/i386mach.sh (PAD_TEXT): Set PAD_TEXT.
5286 * ldlex.l (comment): Increment line number when newline is read.
5290 * ldlang.c (lookup_name): Take new argument, force_load. If true,
5291 reload the file even if it is already loaded.
5292 (wild): Call lookup_name with force_load argument of 0.
5293 (open_input_bfds): Call lookup_name with force_load argument of 1.
5294 (print_symbol): Remove declaration of non-existent function.
5295 (print_one_symbol): Return true rather than falling off end.
5299 * ldmain.c (main): Use %ld when printing long values.
5301 * scripttempl/elf.sc: Move _edata after the .sdata section.
5302 Permit OTHER_BSS_SYMBOLS to be defined.
5303 * emulparams/elf32mipb.s (OTHER_BSS_SYMBOLS): Define _fbss.
5307 * Rename all "hppaosf" files to "hppaelf".
5308 * Change all "osf" references to "elf" in hppaelf files.
5309 * Makefile.in: Likewise.
5310 * configure.in: Likewise.
5314 * ldmain.c (main): Call xatexit, not atexit.
5315 Call xmalloc_set_program_name.
5317 * ldlang.c (lang_size_sections): Check if bfd_relax_section set
5322 * emultempl/lnk960.em (append), emultempl/hppaosf.em
5323 (hppaosf_finish): Call xmalloc, not ldmalloc.
5324 * ldmain.c (preserve_output): Function removed.
5325 (main): Do it here instead.
5329 * ldlang.h (LANG_FOR_EACH_{INPUT,OUTPUT}_SECTION): Delete (unused)
5330 GNU C specific macros.
5332 * emultempl/hppaosf.em (hppaosf_finish): Expand the only remaining
5333 call to LANG_FOR_EACH_INPUT_SECTION.
5337 * ldmisc.c (ldmalloc, xmalloc, ldrealloc, xrealloc): Functions
5338 deleted; will use libiberty versions instead.
5339 * ldctor.c ldfile.c ldlang.c ldmain.c ldmisc.c ldmisc.h lexsup.c
5340 mri.c Makefile.in: Change callers.
5342 * ldmisc.c (vfinfo): Remove cleanup code.
5343 * ldmain.c (remove_output): Put it here (new function).
5344 (preserve_output): New function.
5345 (main): Register remove_output and preserve_output with atexit.
5346 * ldmain.c ldgram.y: Call xexit instead of exit.
5347 * ldmisc.h: Declare xexit.
5351 * Makefile.in: Lots of new H8/500 memory models.
5355 * ldlex.l: Removed duplicate rules.
5356 (yywrap): Provide default definition, needed with some versions of
5361 * ldmisc.c (vfinfo): For `%I', if the file is in an archive, print
5362 the archive filename too.
5364 * ldlex.l: Add rule to catch invalid input characters instead of
5365 printing them. Include "ldmain.h" for program_name decl.
5366 (lex_warn_invalid): New function.
5367 * Makefile.in: Add dependency.
5371 * Makefile.in (check): Don't bother running any tests of
5372 cross-linker until the test suite no longer assumes native mode.
5376 * ldlang.c (print_one_symbol, print_input_section): Print
5377 global symbols in symbol table again.
5381 * ldmain.c ldmain.h ldgram.y: If -v -V or --version was given,
5382 exit successfully instead of complaining if no input files are
5387 * Makefile.in: Format variable definitions consistently.
5388 (LD_PROG): Remove unnecessary variables from link command,
5389 change variable LOADLIBES to EXTRALIBS.
5391 * ldmain.c (main): Compute and display total execution time.
5392 * ld.texinfo (-stats): Document the option.
5396 * ldmain.c (reloc_overflow): Added name, reloc_name and addend
5399 * ldlang.c (lookup_name): Set BFD GP size to -G argument value
5402 * ldlang.c (relaxing): Removed global variable.
5403 (lang_size_sections): If the canonical symbols have not already
5404 been read in, read them in before relaxing.
5405 * ldlang.h (relaxing): Removed declaration.
5409 * ldlang.c (new_afile): Initialize loaded field to false.
5410 (lookup_name): If file was already loaded, don't call the
5411 add_symbols entry point again.
5415 * ld.texinfo: Clarify what -T option does.
5419 * scripttempl/m88kbcs.sc: Don't use CREATE_OBJECT_SYMBOLS, that's
5424 * ldmain.c (add_archive_element): If trace_files or
5425 trace_file_tries, print file name.
5426 * ldlang.c (lookup_name): Likewise.
5427 (ldlang_add_file): Don't put files on input_bfds list in reverse
5430 * scripttempl/elf.sc: Correct typo.
5434 * ldgram.y, ldlex.l: Make the space between -e, -u, and -y and
5435 their arguments optional, for compatibility with the old GNU ld.
5439 * scripttempl/elf.sc: Define __bss_start before the .sbss section.
5443 * ldmain.c (add_to_set): Add bitsize argument.
5444 (constructor_callback): New function.
5445 (link_callbacks): Add constructor_callback.
5446 * ldctor.c (struct set_info): Add bitsize field.
5447 (ldctor_add_set_entry): Add bitsize argument.
5448 (ldctor_build_sets): Base the size of the elements of the set on
5449 the bitsize, rather than always using LONG.
5450 * ldctor.h (ldctor_add_set_entry): Add bitsize to declaration.
5452 * ld.h (QUAD_SIZE): Define.
5453 * ldgram.y (QUAD): New token.
5454 (length): Handle it.
5455 * ldlex.l: Return QUAD.
5456 * lexsup.c (keywords): Add QUAD.
5457 * ldwrite.c (build_link_order): Handle QUAD.
5458 * ldlang.c (print_data_statement): Handle QUAD.
5459 (lang_size_sections): Likewise.
5460 (lang_do_assignments): Likewise.
5461 * ldexp.c (exp_print_token): Add QUAD to table.
5462 * ld.texinfo: Describe QUAD.
5464 * scripttempl/alpha.sc: Don't create .lit4 or .sdata sections,
5465 since the Alpha doesn't use them.
5469 * ldemul.h (ld_emulation_xfer_struct): Comment the members.
5473 * Makefile.in, configure.in: Add support for VSTa micro-kernel.
5474 * config/vsta.mt, emulparams/vsta.sh: New files for VSTa.
5478 * scripttempl/aout.sc: Pad .text to DATA_ALIGNMENT if relocating;
5479 needed for i386mach. (Should be a no-op on other systems.)
5481 * emulparams/i386mach.sh (SEGMENT_SIZE): Fix again.
5482 (PAGE_SIZE): Don't define; not used.
5486 * ldgram.y (yyerror): Make argument const char *, and actually
5487 print it out rather than assuming it is a syntax error.
5488 * ldmisc.h: Change declaration of yyerror.
5489 * ldemul.c, ldwrite.c: Add /*ARGSUSED*/ as appropriate.
5493 * emulparams/i386mach.sh (NONPAGED_TEXT_START_ADDR): Don't include
5494 exec header offset, since the exec header isn't loaded.
5495 (PAGE_SIZE, SEGMENT_SIZE): Agree with bfd/i386mach3.c.
5499 A major rewrite to move the bulk of the linker into BFD so that
5500 more efficient backend code can be written for specific object
5502 * lderror.c, lderror.h, ldindr.c, ldindr.h, ldsym.c, ldsym.h,
5503 ldwarn.c, ldwarn.h, relax.c, relax.h: Removed.
5504 * ldctor.c, ldctor.h: Complete rewrite.
5505 * ldwrite.c, ldwrite.h: Complete rewrite.
5506 * ld.h (strip_symbols_type, strip_symbols): Removed. Use
5507 link_info.strip instead. Changed all uses.
5508 (discard_locals_type, discard_locals): Removed. Use
5509 link_info.discard instead. Changed all uses.
5510 (ld_config_type): Removed relocateable_output field; use
5511 link_info.relocateable instead; changed all uses. Added stats
5513 (set_asymbol_chain, get_asymbol_chain, get_loader_symbol,
5514 set_loader_symbol): Removed.
5515 * ldexp.h (node_class): Added etree_rel.
5516 (etree_type): Added rel field.
5517 * ldexp.c (exp_print_token): Bracketed table initialization.
5518 (exp_relop): New function.
5519 (fold_name): Use linker hash table rather than ldsym functions.
5520 (exp_fold_tree): Likewise. Also, handle etree_rel case.
5521 (exp_print_tree): Handle etree_rel.
5522 * ldgram.y (strip_symbols, discard_locals): Removed.
5523 (OPTION_stats, OPTION_no_keep_memory): New tokens. Handle them.
5524 (REL): New token. Does not appear in grammar, but needed for
5526 (file): Don't call lang_final; it's called by main anyhow.
5527 * ldlex.l: Accept -stats and -no-keep-memory options.
5528 * ldlang.h (fill_type): Make unsigned int, not unsigned short.
5529 * ldlang.c: Consistently use fill_type for fill argument.
5530 (lang_init_script_file, script_file): Removed.
5531 (create_object_symbols): Removed. Use
5532 link_info.create_object_symbols_section instead. Changed all
5534 (lang_add_keepsyms_file): Removed.
5535 (lookup_name): Call bfd_link_add_symbols instead of
5536 ldmain_open_file_read_symbol.
5537 (wild): Don't iterate over script_file.
5538 (open_output): Create link hash table.
5539 (lang_place_undefineds): Rewrote.
5540 (lang_size_sections): Handle relaxing (doesn't work yet).
5541 (lang_relocate_globals): Removed.
5542 (lang_finish): Use link hash table rather than ldsym functions.
5543 (lang_common): Rewrote.
5544 (lang_one_common): New function.
5545 (ldlang_add_file): Add file to link_info.input_bfds list. Set
5547 (create_symbol): Removed.
5548 (lang_process): Don't call lang_init_script_file. Call
5549 ldctor_build_sets rather than find_constructors. Don't call
5550 lang_relocate_globals.
5551 (lang_abs_symbol_at_beginning_of): Rewrote.
5552 (lang_abs_symbol_at_end_of): Rewrote.
5553 * ldmain.c (had_y): Removed.
5554 (lprefix, lprefix_len): Removed; use link_info fields instead.
5556 (multiple_def_count, commons_pending, undefined_global_sym_count,
5557 total_symbols_seen, total_files_seen): Removed.
5558 (link_callbacks, link_info): New variables.
5559 (main): Initialize link_info. Don't call init_bfd_error_vector or
5560 ldsym_init. Don't set now unused variables. Handle -stats.
5561 (get_emulation): Removed obsolete and nonfunctional GNU960 code.
5562 (add_ysym): Rewrote.
5563 (read_entry_symbols, refize, enter_global_ref, enter_file_symbols,
5564 search_library, gnu960_check_format, decode_library_subfile,
5565 linear_library, symdef_library, clear_syms, subfile_wanted_p):
5567 (add_keepsyms_file, add_archive_element, multiple_definition,
5568 multiple_common, add_to_set, warning_callback, undefined_symbol,
5569 reloc_overflow, reloc_dangerous, unattached_reloc, notice_ysym):
5571 * ldmisc.c (vfinfo): Accept a string for %T, not a symbol. Don't
5572 require symbols for %C; look them up instead.
5573 * emultempl/hppaosf.em: Pass link_info to
5574 hppa_look_for_stubs_in_section.
5575 * Makefile.in: Rebuilt dependencies.
5576 (CFILES): Removed lderror.c, ldindr.c, ldsym.c, ldwarn.c, and
5578 (HFILES): Removed lderror.h, ldindr.h, ldsym.h, ldwarn.h, and
5580 (EMULATION_OFILES): Depend on bfdlink.h, ldmain.h, ldexp.h,
5581 ldlang.h and ldctor.h.
5583 * Makefile.in (ldlex.c): Don't depend on ldgram.h. Remove
5584 declarations of free and malloc from flex output. Change malloc
5585 to ldmalloc in flex output.
5589 * ldmain.c (lprefix): Change default from a char to a string
5590 with only one character.
5591 (lprefix_len): Set default to one.
5593 * ldmain.h (lprefix_len): Declare.
5595 * ldsym.c (write_file_locals): Use strncmp rather than a character
5596 comparison for lprefix.
5598 * emultempl/m88kbcs.em (before_parse): Set lprefix and lprefix_len
5601 * emultempl/hppaosf.em: Include ldexp.h.
5602 (before_parse): Set lprefix and lprefix_len correctly.
5606 * ldlex.h: Don't declare yywrap if it is a macro.
5607 * ldlex.l: Include sysdep.h.
5608 * ldlang.c (lang_for_each_statement_worker,
5609 lang_for_each_statement): Forgot to use PARAMS.
5613 * Makefile.in: Added .PHONY targets where appropriate. Added some
5615 (gcclibdir, version): Removed unused variables.
5616 (DEP): New variable, set to mkdep.
5617 (ALL_CFLAGS): New variable. Used in .c.o target.
5618 (CFILES, HFILES, GENERATED_CFILES, GENERATED_HFILES): New
5620 (HEADERS, MANSOURCES, LDCSOURCES, GENERATED_SOURCES,
5621 GENERATED_HEADERS, LDSOURCES, BFD_SOURCES, SOURCES): Removed
5622 mostly obsolete variables. Adjusted remaining uses.
5623 (DEF_EMUL): Removed variable.
5624 (ldmain.o): Handle undefined EMUL error correctly.
5625 (ldemul-list.h): Depend on config.status rather than Makefile.
5626 Create via temporary file.
5627 (ver960.c, roll, make): Removed obsolete targets.
5628 (.dep, .dep1, dep.sed, dep, dep-in): New targets. Used to rebuild
5630 * dep-in.sed: New file, used when rebuilding dependencies.
5634 Made many changes to eliminate gcc warnings. Made various
5635 cosmetic changes, declared various things in header files, removed
5636 various extern declarations from .c files. No substantive
5639 * ldlang.c (lang_process): Ifdef out final call to
5640 lang_size_sections again (reverting change of Nove 2), since it
5641 breaks the Sun4 linker.
5645 * configure.in (alpha-*-netware*): New target; use alpha.
5649 * configure.in: Group targets by CPU. Merge some m68k target
5650 entries with different CPU specs that use the same ld_target
5653 * configure.in: Add sparc*-*-coff.
5654 * config/coff-sparc.mt, emulparams/coff_sparc.sh: New files.
5655 * Makefile.in (ALL_EMULATIONS): Add em_coff_sparc.o.
5656 (em_coff_sparc.c): Add dependencies and build rules.
5658 * ldmisc.c (errno, sys_nerr, sys_errlist): Don't declare.
5662 * ldgram.y (OPTION_call_shared, OPTION_non_shared, OPTION_Oval):
5664 (command_line_option): Accept and ignore them (for now).
5665 * ldlex.l (<COMMAND>): Handle -non_shared, -call_shared, and -On
5666 where n is a number.
5670 * ldmain.c (subfile_wanted_p): If merging a common symbol which is
5671 not in bfd_com_section, create the section in the BFD so that it
5672 can be placed in the right output section.
5676 * configure.in (mips*-sgi-irix5*): New target. Use mipsb-elf32.
5677 * emulparams/elf32mipsb.sh (DATA_ADDR): Define.
5678 (OTHER_READONLY_SECTIONS): Define for .reginfo.
5679 (EXECUTABLE_SYMBOLS): Define for _DYNAMIC_LINK.
5680 * scripttempl/elf.sc: Use EXECUTABLE_SYMBOLS when not relocating.
5681 Move OTHER_READONLY_SECTIONS after all the other readonly
5682 sections. Don't use DATA_ADDR twice.
5684 * ldmain.c (enter_file_symbols): Removed duplicate tests of p. If
5685 p is in a common section, make sure the BFD has a section of that
5688 * ldlang.c (lang_common): Add newline to error message.
5692 * emulparams/m68klynx.sh (SCRIPT_NAME): Define to use a
5693 Lynx-specific script instead of m68kcoff.
5694 (OUTPUT_FORMAT): Define as "coff-m68k-lynx".
5695 (ENTRY): Define as __main.
5696 (TEXT_START_ADDR): Define as 0.
5697 (PAGE_SIZE): Define as 0x1000.
5698 * emulparams/i386lynx.sh, emulparams/sparclynx.sh: Fix comment.
5699 * scripttempl/m68klynx.sc: New file.
5703 * ldmain.c (get_emulation): Ignore -mips1, -mips2 and -mips3
5704 arguments rather than treating them as emulation names.
5708 * configure.in: Support x86 unixware and netware plus generic netware.
5712 * emulparams/i386mach.sh (TEXT_START_ADDR, NONPAGED_TEXT_START_ADDR):
5717 * Makefile.in (distclean): Don't delete dvi or info files.
5718 (ld.info): Update dependency list.
5719 (ld.dvi): Ditto. Extend TEXINPUTS to get bfdsumm.texi.
5723 * ldlang.c (lang_add_output): Take new arg, FROM_SCRIPT.
5724 Set output_filename instead of creating a new node.
5725 (open_output): Don't set output_filename.
5726 (lang_final): Create the new node here.
5727 * ldlang.c, ldlang.h, ldgram.y, mri.c: pass FROM_SCRIPT.
5733 * scripttempl/hppaosf.sc: (___stack_zero, etext, _etext,
5734 edata, _edata, end): Add definitions of these symbols.
5735 (__end): Remove definition of this symbol.
5736 (__data_start): Move definition of this symbol.
5738 * emultempl/hppaosf.em: Various fixes and support for linker stub
5740 (hppaosf_finish, hppaosf_search_for_padding_statements,
5741 hppaosf_create_output_section_statements): New functions in
5742 support of linker stub generation.
5743 (ld_hppaosf_emulation): Redefine to include new
5744 emulation-specific routines.
5746 * ldlang.c (lang_process): Re-enable last call lang_size_sections.
5747 Pass abs_output_section rather than NULL to avoid invalidating
5752 * Makefile.in (ALL_EMULATIONS): Add em_i386mach.o.
5753 (em_i386mach.c): New rule.
5754 * configure.in (i[34]86-*-mach*): New case.
5755 * config/i386-mach.mt: New file.
5756 * emulparams/i386mach.sh: New file.
5760 * ld.h (flag_is_*): Removed macros.
5761 * ldmain.c (enter_global_ref), ldsym.c (write_file_locals):
5762 Consistently check the BFD symbol flags directly, rather than
5763 using file_is_* macros.
5767 * configure.in (sparc*-*-lynxos*): New target.
5768 * Makefile.in: Add rule for em_sparclynx.c.
5769 (ALL_EMULATIONS): Add Lynx emulations.
5770 * config/sparc-lynx.mt: New file.
5771 * emulparams/sparclynx.sh: New file.
5772 * scripttempl/sparccoff.sc: New file.
5776 * Makefile.in: Add dependency for $(EMULATION_OFILES).
5780 * relax.c (write_relax): Check return value of bfd_seclet_link.
5784 * ldlang.c (delete_output_file_on_failure): New variable.
5785 (open_output): Set it after bfd open succeeds.
5786 * ldmisc.c (vfinfo): Test it.
5790 * ldsym.c (write_file_locals): Set the BSF_FILE flag for object
5793 * ldemul.c: Support was added to allow emulation-specific
5794 processing to occur. This support was added primarily for linker
5795 stub generation in the elf32-hppa gld.
5796 (ldemul_finish, ldemul_create_output_section_statements): New
5798 * ldemul.h: Support was added to allow emulation-specific
5799 processing to occur. (As described above.) Added finish and
5800 create_output_section_statements fields to
5801 ld_emulation_xfer_struct structure.
5802 * ldlang.c: Add calls to emulation-specific routines.
5803 (lang_process): Add call to
5804 ldemul_create_output_section_statements function.
5805 (lang_process): Add call to a emulation-specific routine (and
5806 some processing after the call).
5810 * configure.in: mips*- instead of mips-, mips*el changes
5814 * configure.in (alpha-*-osf*): New target; use alpha.mt.
5815 * Makefile.in (ALL_EMULATIONS): Added em_alpha.o.
5816 (em_alpha.c): New target; use alpha.sh and alpha.sc.
5817 * config/alphaosf.mh (NATIVE_LIB_DIRS, HOSTING_CRT0): Define.
5818 * config/alpha.mt: New file.
5819 * emulparams/alpha.sh: New file.
5820 * scripttempl/alpha.sc: New file.
5824 * ldlang.c (lang_size_sections, lang_common): ALIGN_N can't handle
5825 types of different sizes (eg: 64 and 32 bits), so coerce.
5826 * ld.h (ALIGN_N): Add warning about usage.
5830 * ldmain.c (enter_global_ref): Just ignore any weak symbol for
5831 which we already have a definition, rather than checking in
5832 several different places whether the symbol is weak.
5836 * configure.in (mips-*-elf*): New target; use mipsb-elf32.
5837 * scripttempl/elf.sc: Only use OTHER_READONLY_SECTIONS and
5838 OTHER_READWRITE_SECTIONS if relocating. Shell variables are not
5839 expanded within them.
5840 * config/mipsb-elf32.mt: New file.
5841 * emulparams/elf32mipb.sh: New file.
5842 * Makefile.in (em_elf32mipb.c): New target.
5846 * ldgram.y: In input_list, change lang_input_file_is_file_enum to
5847 lang_input_file_is_search_file_enum so objects brought in using
5848 INPUT() do a path lookup.
5852 * configure.in: Change Lynx ld_target to be {i386,m68k}-lynx
5853 instead of {i386,m68k}-coff.
5854 * Makefile.in (em_i386lynx.c, em_m68klynx.c): New targets.
5855 * config/i386-lynx.mt: New file.
5856 * config/m68k-lynx.mt: New file.
5857 * emulparams/i386lynx.sh: New file.
5858 * emulparams/m68klynx.sh: New file.
5860 * scripttempl/i386coff.sc: Make ENTRY get its value from ${ENTRY},
5861 but defaulting to _start.
5863 * ldemul.c, ldfile.c, ldlang.c, ldmain.c, ldmisc.c, ldmisc.h,
5864 ldsym.c, ldwarn.c: Rename info to info_msg, to avoid conflict with
5869 * config/solaris2.mh: New file. Define HOSTING_CRT0 and
5870 HOSTING_LIBS for testing.
5874 Finish up support for i386-sysv4 (without shared libraries):
5875 * ld.h (flag_is_weak): Define.
5876 * ldlang.c (print_symbol): Mention whether symbol is weak.
5877 (print_input_section): Print weak symbols as globals.
5878 * ldmain.c (refize): Do not zero out BSF_WEAK flag.
5879 (enter_global_ref): Do not warn if a weak symbol redefines a
5880 global symbol. Do not let a weak symbol redefine a common symbol.
5881 (enter_file_symbols): Treat weak symbols as global symbols.
5882 (subfile_wanted_p): Do not pull in an object file from a archive
5883 just to resolve an undefined weak symbol.
5884 * ldmisc.c (vfinfo): Don't needlessly malloc space after a fatal
5885 error; the error might be that malloc has run out of space.
5886 * ldsym.c (write_file_locals): Treat weak symbols as global.
5887 * configure.in (i[34]86-*-sysv4*, i[34]86-*-elf*): New targets;
5889 * config/i386v4.mh: New file; set NATIVE_LIB_DIRS to /usr/ccs/lib.
5890 * config/i386-elf.mt: New file; set EMUL to elf_i386.
5891 * emulparams/elf_i386.sh: New file.
5892 * scripttempl/elf.sc: Use ${NOP} as filler (defaults to 0).
5893 * Makefile.in (NATIVE_LIB_DIRS): Define to be empty.
5894 (ALL_EMULATIONS): Add em_elf_i386.o.
5895 (GENSCRIPTS): Pass NATIVE_LIB_DIRS as sixth argument.
5896 (em_elf_i386.c): New target, like other em_*.c targets.
5897 ($(LD_PROG)): Pass $(CFLAGS) to $(CC).
5898 * genscripts.sh: Accept NATIVE_LIB_DIRS as sixth argument. If
5899 nonempty, and configured for native, add it to LIB_PATH.
5903 * scripttempl/{h8300.sc,h8500.sc,i386coff.sc,m68kcoff.sc,sh.sc}:
5904 Added statements to pass stab and stabstr sections through and
5905 mark them as NOLOAD, which makes GDB happier.
5909 * configure.in: Accept m68k-lynx-lynxos config.
5911 * Makefile.in: Use $(SHELL) to run genscripts.sh.
5915 * config/coff-h8300.mt: Add EMUL=h8300h.
5917 * ldmain.c (main): Call set_scripts_dir after argv has been processed.
5921 * Makefile.in: Changed CXX back to g++.
5925 * Makefile.in: Fixed RUNTEST* CXX CXXFLAGS macros and check rule.
5929 * Makefile.in (TAGS): Use shell wildcards.
5933 * Makefile.in: add TEXINPUTS variable and use it in ld.dvi target
5937 * ld.texinfo: re-enable included config file; conditionalize doc
5938 for -oformat to interact properly with SingleFormat doc config
5939 var; rename @up/@down to @raisesections/@lowersections.
5943 * configure.in: recognize m88110.
5948 * emultempl/hppaosf.em (ld_hppaosf_emulation): Correct name for PA
5949 ELF emulation is "elf32-hppa" not "elf-big".
5950 (hppaosf_before_parse): Remove unneeded processing of environment
5952 * scripttempl/hppaosf.sc: Include .hppa_linker_stubs sections in
5953 .text segment of output file.
5954 * emulparams/hppaosf.sh (OUTPUT_FORMAT): Use elf32-hppa.
5958 * ld.h: define BYTE_SIZE, SHORT_SIZE, and LONG_SIZE which are no
5961 * ldlang.c, ld.h: updated copyright.
5965 * ldlang.c (open_output, lang_check): Check return value of
5970 * scripttempl/h8500.sc: Start all sections in a different segment.
5971 * scripttempl/z8ksim.sc: Handle constructors
5975 * Makefile.in: revert earlier changes back to execute runtest
5976 with make check. cdtest and bootstrap now function as they
5977 did within the Makefile.
5981 * Makefile.in: Update dependencies.
5983 * configure.in: Set EMULATION_OFILES in Makefile based on
5984 --with-targets option.
5988 * Makefile.in: check targets reimplemented to old way.
5992 * config/i386v.mh, config/irix4.mh: Use gcc
5993 -print-libgcc-file-name rather than $(libdir)/libgcc.a.
5994 * config/i386sco.mh: New file; copy of i386v.mh to correspond to
5995 bfd/configure.host change.
5999 * scripttempl/elf.sc: Handle .line and .debug* sections.
6001 * ldlex.l: Use bfd_scan_vma, not strtoul.
6005 * ldexp.c, ldfile.c, ldlang.c, lexsup.c, ldmain.c, ldemul.c:
6006 Remove inital caps in some error messages, change "can't" to
6007 "cannot", add missing colons.
6008 * ldmisc.c (vfinfo): Print "%%" as a single %.
6009 For '%' followed by unrecognized character, print them both
6010 verbatim instead of expecting a char * arg.
6011 For '%C', don't put the function name in parens.
6013 * ldexp.c (invalid): Pass "%%", not "% ".
6017 * scripttempl/mips.sc: Always define _ftext, _fdata, _fbss.
6018 (BSS_VAR): Removed; now always define _fbss.
6019 * emulparams/mipsidt.sh, emulparams/mipsidtl.sh (BSS_VAR):
6024 * configure.in: z8k-coff is the same as z8k-sim
6028 * testsuite/lib/ld.exp: new file
6029 * testsuite/config/unix-ld.exp: new file
6030 * testsuite/ld.bootstrap/bootstrap.exp: new file
6031 * Makefile.in: add dejagnu support for make check
6035 * ldlex.l (comment): Add missing newline in message.
6036 * ldindr.c (add_indirect): Ditto.
6037 * ldexp.c (exp_fold_tree): Ditto.
6041 * ldgram.y, ldlex.l, mri.c, ldwrite.c: Change multiple commons
6044 * ldmisc.c (multiple_warn): New function.
6045 * ldmisc.h: Declare it.
6046 * ldmain.c (enter_global_ref): Call it.
6047 * ld.h (ld_config_type): Add warn_common.
6048 * ldlex.l, ldgram.y: Set it with -warn-common option.
6049 * ldver.c (help): Document it.
6053 * scripttempl/elf.sc: Add hooks for .sdata, .sbss, and
6054 target-specific sections, and for changing data section vma.
6058 * ldgram.y (OPTION_Qy, OPTION_Y, OPTION_dn, OPTION_YP): New
6059 terminals, for Solaris.
6060 (dirlist_ptr): New static variable.
6061 (command_line_option): Accept new options.
6063 * ldlex.l: Accept command-line options "-Qy", "-dn", "-Y", and
6066 * config/sun4sol2.mt: Pass emulation name without ".sh".
6068 * emulparams/elf32_sparc.c: Renamed from elf32-sparc.c.
6069 * config/sun4sol2.mt (em_elf32_sparc.c): Adjusted accordingly.
6073 * scripttempl/elf.sc: Add support for .init, .fini, .ctors,
6074 .dtors, .data1, .rodata1 sections, instead of combining them into
6075 other sections. For `-r', set all section start addresses to
6078 * emulparams/elf32-sparc.sh (TEXT_START_ADDR,
6079 NONPAGED_TEXT_START_ADDR): Value should be 0x10100.
6080 (MAXPAGESIZE): Renamed from PAGE_SIZE.
6084 * genscripts.sh: If this is the default emulation, set
6086 * emultempl/*.em: Use it to determine whether to compile in the
6089 * Makefile.in (GENSCRIPTS): Pass the default emulation name to
6090 genscripts.sh. Pass the current emulation name without ".sh" on
6092 * genscripts.sh: Take an default emulation arg.
6093 Use the current emulation name as EMULATION_NAME.
6094 Make default lib path for cross-compiling ':', not null.
6095 * emulparams/*.sh: Don't set EMULATION_NAME.
6096 * ldemul.c (ldemul_get_script): Take isfile arg.
6097 Pass it to emulation's get_script function.
6098 * ldemul.h: Adjust get_script prototypes.
6099 * ldfile.c (ldfile_find_command_file): Renamed from find_a_name.
6101 * ldfile.h: Declare it.
6102 * ldgram.y: Accept a script on the command line again,
6103 for parsing compiled-in scripts.
6104 * ldmain.c (main): If ld script is a file, parse it as a -T
6105 option, otherwise parse it directly.
6106 * emultempl/*.em (*get_script): Return the scripts themselves if
6107 this is the default emulation; otherwise return their file names.
6108 * emultempl/m88kbcs.em: New file, to take m88kbcs #ifdef out of
6110 * emulparams/m88kbcs.sh: Use it.
6112 * ld.h (ld_config_type::unix_relocate): Remove unused element.
6116 * Makefile.in (ALL_EMULATIONS): Delete em_i386linux.o (for which
6117 there's no change log entry yet, tsk tsk) from the list of
6118 emulations compiled in until Mark gets around to checking in
6119 emulparams/i386linux.sh.
6120 (ldemul-list.h): Depend on Makefile, so if EMULATION_OFILES is
6121 changed, this file gets updated.
6125 * ldgram.y (OPTION_Lfile): New token.
6126 (command_line_option): Accept OPTION_L NAME (whitespace after -L).
6127 * ldlex.l (<COMMAND>): Accept -L without FILENAME.
6131 * configure.in: h8/300h support needs own .mt file.
6132 config/coff-h8300h.mt: New file.
6136 * ldmain.c: Don't include sys/stat.h; it already got included
6137 somewhere along the way.
6141 * Makefile.in: Add h8300h support.
6142 emulparams/h8300h.sh: New file.
6143 scripttempl/h8300h.sc: New file.
6147 * ldfile.c (ldfile_open_file): In error message, use the name the
6148 user gave (e.g., "-lc"), rather than the base file name.
6150 * ldexp.c (exp_fold_tree): Don't assign an int to an enum.
6152 * ldmain.[ch]: Remove initial Q_ from function names.
6153 * ldexp.c, ldindr.c, ldlang.c: Change callers.
6155 * ldfile.c, ldmain.c, ldgram.y: Rename option_v to trace_file_tries.
6157 * ldlang.c (lang_process): Move loading of default script from
6158 here to main. Add a "/" to start of script name to prevent
6159 finding it in "." first.
6161 * ldmain.c (set_scripts_dir): Don't look in "." first.
6163 * ldgram.y, ldlang.c, ldsym.c: Remove traces of unused var
6168 * Makefile.in (em_m88kbcs.c): Correct dependency.
6169 * scripttempl/m88kbcs.sc: It's ARCH, not arch. Removed TARGET
6170 statement. Changed OUTPUT_FORMAT to use ${OUTPUT_FORMAT}.
6171 * emulparams/m88kbcs.sh: It's coff-m88kbcs, not m88kbcs.
6175 * ldfile.c (ldlang_open_file, ldfile_open_command_file),
6176 main.c (main): Print the errno string in the error message.
6180 * configure.in: Accept h8300h for target cpu.
6182 * ldmisc.c (vfinfo): Have demangle remove leading underscore if
6183 present (demangle is smart enough to know whether to do it or not).
6187 * ldmain.c (set_scripts_dir): Check . and <ld bin dir>/../lib for
6188 ldscripts, as well as <ld bin dir> and SCRIPTDIR.
6190 * ldlang.c (lang_process): Use sizeof instead of magic constant.
6192 * ldmain.c (get_emulation, check_for_scripts_dir,
6193 set_scripts_dir): New functions.
6198 * scripttempl/elf.sc: Include .init, .fini, .rodata sections.
6199 Create symbol "end" instead of "__end". Comment out some parts
6200 that may not be needed (yet) for elf.
6202 * configure.in: Accept sparc-elf and sparc-solaris2 configs.
6206 * Makefile.in (ALL_EMULATIONS): Include $(OTHER_EMULATIONS).
6208 * ldmisc.h (einfo, minfo, info): Don't bother with PARAMS macro
6209 when no prototype is being supplied.
6210 (ldmalloc, ldrealloc): Size argument is now size_t.
6212 * ldmisc.c (finfo): New function, accepts FILE* argument.
6213 (vfinfo, case 'v'): New format character; displays bfd_vma in hex
6214 without leading zeros.
6215 (vfinfo, cases 'R' and 'C'): Use finfo(%v) when displaying a
6216 bfd_vma value, instead of fprintf(%x) which won't hold a long long
6218 (concat, buystring): String lengths are size_t.
6219 (ldmalloc, ldrealloc, xrealloc): Size argument is now size_t.
6221 * ldlang.c (new_statement): Size argument is now size_t. Added
6222 forward declaration with prototype.
6226 * ldgram.y (OPTION_v): Don't turn on verbose output.
6230 * ldlex.l: Get rid of local typedef for bfd_vma! Get it from
6235 * Makefile.in (install): Don't install as $(tooldir)/bin/gld;
6236 collect2 doesn't look for gld any more anyhow.
6240 * ldlang.c (lang_relocate_globals): Skip indirect symbols, which
6241 now have a non NULL srefs_chain.
6243 * config/hp300hpux.mt: Use emulation hp3hpux rather than
6244 hp300hpux, since the latter does not exist.
6248 * genscripts.sh: Put the scripts in the ldscripts directory, not
6250 * configure.in (ldscripts): Make, instead of emulations.
6251 * Makefile.in (scriptdir): Take off the "ld" part.
6252 (install, clean, distclean): Use ldscripts, not emulations.
6253 In tests, don't pass -Lemulations.
6254 Don't pass tooldir/lib to genscripts.sh.
6255 * genscripts.sh: Don't take tooldir/lib arg.
6256 * ldlang.c (lang_process): Add "ldscripts/" to the name of the
6257 default script file.
6261 * scripttempl/h8300.sc: Add .tors section for constructor/destructors.
6265 * config/coff-h8300.mt: EMUL=h8300hms -> h8300.
6269 * Makefile.in (.y.c): skip default .y.c rules. gnu make can now
6270 run in parallel without colliding on yacc's static file names.
6271 Without the stub rule, make will try to start two yacc's
6272 concurrently which fails because of yacc's static file names.
6276 * ldmain.c (subfile_wanted_p): Don't dump core if there are no
6281 * genscripts.sh (LIB_PATH): Only add /usr/local/lib if it's
6282 different from libdir.
6284 * Makefile.in (scriptdir): Base on tooldir, not datadir.
6288 * ldver.c (help): New function.
6289 * ldver.h: Declare it.
6290 * ldlex.l, ldgram.y: Recognize new options --help and --version.
6294 * Makefile.in (INCLUDES): Don't need ../include any more.
6298 * ldlex.l, ldgram.y: Support new -oformat option.
6299 Remove attempt at supporting script fragments on the command line.
6300 * ldlang.c (lang_add_output_format): Take new arg, FROM_SCRIPT.
6301 * mri.c (mri_format), ldgram.y: Change callers.
6302 * ldlang.h: Change prototype.
6306 * Makefile.in: canonicalize install.sh; for use within
6307 this directory (and subdirs)
6311 * ldgram.y: Tweak grammar to make reporting of invalid options work.
6313 * Makefile.in (.cc.o): Restore .SUFFIXES entry for .cc
6318 * ldfile.c (ldfile_open_command): Don't try .ld extension.
6319 It wasn't documented (or likely used) and wastes time.
6320 (try_open): If EXTEN is empty, don't try it.
6322 * ldctor.c, lderror.c, ldexp.c, ldfile.c, ldindr.c, ldlang.c,
6323 ldlex.l, ldmain.c, ldmisc.c, ldsym.c, ldver.c, ldwarn.c,
6324 ldwrite.c, lexsup.c, mri.c, relax.c: Replace DEFUN macro calls
6325 with normal function declarations.
6327 * Move *.em to emultempl/*.em. Move *.sh to emulparams/*.sh.
6328 Move *.sc-sh to scripttempl/*.sc.
6329 * {emultempl,emulparams,scripttempl}/README: New files.
6330 * emultempl/sh.em, emultempl/st2000.em, emultempl/z8ksim.em,
6331 emultempl/h8300hms.em, emultempl/h8500hms.em: Files removed,
6332 replaced with generic.em.
6333 * emulparams/h8300.sh, emulparams/h8500.sh, scripttempl/h8300.sc,
6334 scripttempl/h8500.sc: Renamed from h8[35]00hms.s[ch]. Change
6335 their contents to omit the "hms".
6337 * *.em (*_get_script): Return script name instead of script contents.
6338 * ldlang.c (lang_process): Change caller.
6340 * ldlex.l, ldgram.y: Recognize -m option.
6341 Check for input files after *all* options in grammar.
6342 * ldmain.c (main): Check for -m options. Add default directory
6345 * mkscript.c: File removed.
6346 * genscripts.sh: Take two more parameters, tooldirlib and libdir,
6347 to add to the default LIB_PATH.
6348 Look for input files in the new subdirectories.
6349 Create the scripts in emulations subdirectory and don't filter
6350 them through mkscript.
6351 * configure.in: Make the emulations subdirectory.
6353 * Makefile.in: Account for all of the above changes.
6354 Remove unused .SUFFIXES. Get libgcc.a path with gcc
6355 -print-libgcc-file-name instead of $(libdir)/libgcc.a.
6356 Put CFLAGS last in the compilation rules.
6357 Add -I../bfd to INCLUDES so sysdep.h is found.
6361 * Makefile.in (INCLUDES): Look in ../include, not ../bfd.
6363 * scripttempl/aout.sc, emulparams/aout.sh: Add SHLIB_PATH like
6364 STACKZERO. Make STACKZERO dependent on RELOCATING, not
6366 * emulparams/hp3hpux.sh (SHLIB_PATH): Define it.
6370 * ldfile.c (try_open): If opening without the extension fails,
6371 try with the extension even if -v or -V was given.
6372 had_script is imported (from ldgram.y), not exported.
6374 Mon Jun 14 16:26:10 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com)
6376 * Makefile.in: remove parentdir support, use INSTALL_XFORM
6380 * ldexp.c (exp_fold_tree): Don't lose the old flag bits.
6381 * ldgram.y (statement_list_opt): New nonterminal, either empty or
6383 (section): Use statement_list_opt, not statement_list.
6384 * scripttempl/m68kcoff.sc, emulparams/m68kcoff.sh: Gather
6385 constructors and destructors and define __CTOR_LIST__ and
6386 __DTOR_LIST__ appropriately.
6387 * scripttempl/sa29200.sc, emulparams/sa29200.sh: Gather
6388 constructors and destructors and define ___CTOR_LIST__ and
6389 ___DTOR_LIST__ appropriately.
6393 * Makefile.in (INCLUDES): Add -I../bfd for sysdep.h and bfd.h.
6394 * configure.in: No longer need to configure to get sysdep.h.
6396 Fri Jun 4 16:18:24 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
6398 * Makefile.in: remove install:all and install-info:info
6399 dependencies (these cause some spurious rebuilds at 'make install'
6404 * configure.in (mips-idt-ecoffl*): New target; use mips-idtl.
6405 (mips-idt-ecoff*): Added trailing '*'.
6406 * config/mips-idtl.mt: New file; use EMUL of mipsidtl.
6407 * emulparams/mipsidtl.sh: New file; like mipsidt.sh, but little
6409 * Makefile.in (ALL_EMULATIONS): Added em_mipsidtl.o.
6411 * config/sun3.mh (HOSTING_LIBS, HOSTING_EMU): Removed obsolete and
6412 incorrect definitions.
6416 * ldsym.c (write_file_locals): Write BSF_CONSTRUCTOR
6417 symbols, unless stripping.
6421 * Makefile.in: configure looks for ####, so remove lines with many
6423 * config/irix4.mh, config/i386v.mh: New files; set HOSTING_CRT0
6424 and HOSTING_LIBS correctly so that ``make check'' will work.
6428 * scripttempl/mips.sc, emulparams/mips.sh: Define _etext, _edata,
6429 and _end, in addition to etext, edata, and end. Needed for IRIX
6432 * Version 2.2.1 released.
6436 * scripttempl/mipsbsd.sc, emulparams/mipsbsd.sh: Renamed from
6438 * emulparams/mipsbsd.sh (EMULATION_NAME): Use new file name.
6442 * Makefile.in (LDDISTSTUFF): Remove ld.mm since we can't build it
6445 * Version 2.2 released.
6449 * ldver.c (ldversion): Bump version number to 2.2.
6457 * scripttempl/mips.sc, emulparams/mips.sh: Don't define BSS_VAR
6462 * Makefile.in (mkscript.o, mkscript): Build mkscript via
6463 mkscript.o, rather than directly from mkscript.c.
6467 * configure.in: Look for ${target_makefile_frag} relative to
6468 ${srcdir}, not relative to build directory.
6470 * emultempl/hppaosf.em, scripttempl/hppaosf.sc,
6471 emulparams/hppaosf.sh: New files.
6472 * configure.in: Recognize hppa*-hp-osf.
6473 * Makefile.in (ALL_EMULATIONS): Include hppaosf emulation.
6474 (em_hppaosf.c): Build it.
6475 * config/hppaosf.mh, config/hppaosf.mt: New files.
6477 * ld.h (ALIGN_N): Renamed from ALIGN, because that conflicted with
6478 some system header files. All uses changed.
6480 * configure.in: Recognize i386-aix configurations as i386-coff
6483 * configure.in: Recognize m68*-*-hpux.
6484 * scripttempl/aout.sc: If STACKZERO and RELOCATING are both defined, output
6485 the value of STACKZERO.
6486 * Makefile.in (ALL_EMULATIONS): Include hp300-hpux emulation.
6487 (em_hp3hpux.c): Build it.
6488 * emulparams/hp3hpux.sh, config/hp300hpux.mt: New files.
6492 * scripttempl/mips.sc: Put constructors in the .data section.
6493 * Makefile.in (cdtest): Added dependency on ld.new.
6497 * Makefile.in: Change definition of $(tooldir) to match FSF.
6498 * emulparams/vax.sh, config/vax.mt, configure.in, Makefile.in:
6499 Support VAX Ultrix and BSD.
6503 * emultempl/sh.em, emulparams/sh.sh, scripttempl/sh.sc: New
6504 files supporting Hitachi SH.
6508 * ldlang.h (struct memory_region): Change `length' and
6509 `old_length' fields to bfd_size_type. Eliminate use of bfd_offset.
6510 * ldlang.c, mri.c: Corresponding changes, plus lint.
6514 * configure.in: For all i386 targets, accept i486 as well.
6518 * ldlang.c (wild_doit): Preserve all flags for a
6519 SEC_SHARED_LIBRARY section.
6520 (size_input_section): Consider any SEC_HAS_CONTENTS section when
6521 computing largest_section.
6525 * ldlang.c (lang_output_section_statement_lookup): Initialize all
6526 fields of newly created structure.
6530 * ldmain.c (g_switch_value): New variable.
6531 * ldgram.y (OPTION_G, OPTION_Gval): New tokens.
6532 (command_line_option): Accept -G and set g_switch_value.
6533 * ldlex.l (COMMAND): Accept -G.
6534 * ldlang.c (open_output): Call bfd_set_gp_size on new BFD.
6538 Support for linking and loading at different places:
6540 * ldlex.l: Add "AT" keyword.
6541 * ldgram.y: Cleanup, and parse AT.
6542 * ldlang.c (print_output_section_statement): Print output address
6543 of section in map. (lang_size_sections): Fill sections' lma with
6545 * ldlang.h (lang_output_section_statement_type): Add load_base
6548 * ldindr.c (add_indirect): Keep more information in the alias
6550 * ldlang.c (wild_doit): Don't inherit NEVER_LOAD section
6551 attribute from an input section.
6552 * ldmain.c (Q_enter_file_symbols): Common section is NEVER_LOAD by
6553 default. (Q_enter_file_symbos): Indirect symbols now are known by
6554 their section, not a special symbol flag.
6555 * ldsym.c (write_file_locals): Indirect symbols aren't local.
6556 (write_file_globals): Write the mapping for an indirect symbol.
6557 * relax.c (build_it): When forced to write a NEVER_LOAD section,
6562 * ld.texinfo: changes for q1
6564 Tue Mar 23 00:13:29 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
6566 * Makefile.in: add dvi target, define & use TEXI2DVI, add installcheck
6568 Mon Mar 8 20:30:35 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
6570 * Makefile.in: rename HOST_CC to CC_FOR_BUILD
6574 * mips.sc-sh: Added variables which may be overridden by a
6576 * emulparams/mipsidt.sh: New file; emulation for IDT MIPS board.
6577 * Makefile.in (ALL_EMULATIONS): Added em_mipsidt.o.
6578 (em_mipsidt.c): New target. Uses mipsidt.sh and mips.sc-sh.
6579 * config/mips-idt.mt: New file; sets EMUL to mipsidt.
6580 * configure.in (mips-idt-ecoff): New target; uses mips-idt.
6584 * aout-mipsbsd.sc-sh, emulparams/mipsbsd.sh: New files from Ralph
6586 * emulparams/i386bsd.sh, config/i386bsd.mt: New files.
6587 * configure.in, Makefile.in: Added support for mipsbsd and 386bsd.
6591 * mri.c: Add extern declaration of strdup.
6592 * ldsym.c (KEEP macro): Add spaces around '=' for the
6593 sake of old (e.g. PCC) compilers.
6597 * ldver.c: Bump to version 2.1.
6601 * ldgram.y: allow section types without address expressions.
6602 * ldlang.c (lang_relocate_globals): avoid possible hang with
6603 undefined but unreferenced symbols.
6604 * relax.c (relax_section): don't complain if the script file isn't
6605 relaxable but -relax is set
6607 Thu Feb 18 17:58:45 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
6609 * configure.in: go32 is the 3rd part of the triple, not the 2nd
6613 * emulparams/mipsbig.sh: New file. Big endian MIPS emulation.
6614 * config/mips-big.mt: New file. Use mipsbig emulation.
6615 * configure.in (mips-sgi-irix*): Use target mips-big.
6616 * Makefile.in (ALL_EMULATIONS): Added em_mipsbig.o.
6617 (em_mipsbig.c): New target. Uses mipsbig.sh.
6621 * mips.sc-sh: Put .scommon sections into .sbss section.
6623 * ldmain.c (subfile_wanted_p): Preserve section of common symbols,
6624 rather than always putting them in bfd_com_section.
6625 * ldlang.c (lang_common): If a common symbol is not in
6626 bfd_com_section, put in a section of the same name, rather than
6627 always putting it in section COMMON.
6631 * ldmain.c (subfile_wanted_p): If we already have a common
6632 definition of a symbol, don't necessarily pull in an object file
6633 that provides a non-common definition.
6635 * ldlex.l (COMMAND): Accept -EB and -EL command line arguments,
6636 returning OPTION_EB and OPTION_EL. gcc passes these to a MIPS
6638 * ldgram.y (OPTION_EB, OPTION_EL): New tokens.
6639 (command_line_option): Accept and ignore OPTION_EB and OPTION_EL.
6643 * Makefile.in (install): Remove $(tooldir)/bin/gld before creating
6648 * ldmain.c, ldsym.c: Use new bfd_is_com_section macro rather than
6649 checking for equality to bfd_com_section.
6653 * mips.sc-sh: New file. Ultrix, and hopefully other MIPS ECOFF
6654 targets, linker script.
6655 * emulparams/mipslit.sh: New file. Little endian MIPS emulation.
6656 * config/mips-lit.mt: New file. Use mipslit emulation.
6657 * configure.in (mips-dec-ultrix*): Use target mips-lit.
6658 * Makefile.in (ALL_EMULATIONS): Added em_mipslit.o.
6659 (em_mipslit.c): New target. Uses mipslit.sh.
6663 * Makefile.in (install): Install ld as both $(tooldir)/bin/ld and
6664 $(tooldir)/bin/gld, so that gcc can find it with or without
6669 * ldwrite.c: Removed perform_relocation, copy_and_relocate, and
6670 write_norel. All linking is now done via write_relax. Call
6671 ldsym_write before calling write_relax.
6672 * relax.c: Added copyright.
6673 (write_relax): Renamed from write_relaxnorel. Added relocateable
6674 argument. seclet_dump renamed to bfd_seclet_link.
6675 * relax.h: Added copyright.
6679 * ldmain.c (decode_library_subfile): Patch from
6682 Fri Jan 8 18:04:33 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
6684 * config/vxworks960.mt renamed to config/i960.mt
6686 * configure.in: sparc-aout emulates a sun4, as does
6687 sparc*-vxworks, i960-nindy uses gld960 emulation
6691 Fix support for NOLOAD, add INCLUDE
6692 * ldfile.c (ldfile_open_command_file): pass file name to
6694 * ldlex.l, ldgram.y: tidy up, parse INCLUDE and NOLOAD
6695 * ldlang.c (wild_doit): make output sections inherit NEVER_LOAD
6698 Thu Jan 7 10:22:19 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
6700 * Makefile.in, config.h: no more default emulation. Make the lack
6701 of emulation a compile time error
6703 Wed Jan 6 01:08:37 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
6705 * configure.in: recognise all sparclite variants, not just 'sparclite'
6709 * scripttempl/m68kcoff.sc, emulparams/m68kcoff.sh: define _end as
6710 well as end, for consistency with aout.sc-sh.
6712 * configure.in: accept *-ericsson-ose for any m68k CPU.
6714 * ldwrite.c (write_rel): don't always set SEC_HAS_CONTENTS flag
6715 for each output section.
6719 * ldexp.c, ldlang.c, ldmain.c, ldsym.c, ldwarn.c: Use new
6720 macro bfd_asymbol_bfd as appropriate.
6721 * Makefile.in: Un-duplicate ldlex.c dependency.
6722 * configure.in: Replace my_host case table by sourcing
6723 ../bfd/configure.host. Allow std-host as the default.
6724 * ldmisc.c: Change logic for C++ name demangling: There is
6725 no initial '_' to remove from stab-derived function names.
6729 * ldlang.c (lang_init_script_file): don't attach the output file
6730 sections to the script file.
6733 * ldlang.c (wild): run expansion loop over command line bfd too.
6734 (lang_ini_script_file): initialize more parts of the command line
6736 * ldlex.l: fix DEFINED start states.
6740 * ld.texinfo: new doc.
6741 * ldgram.y, ldlex.l: understand -y<symbol>
6742 * ldmain.c (Q_enter_file_symbols): if had -y, lookup symbol and
6743 print info. (add_ysym): new function.
6744 * ldsym.h: (ldsym_type): new define SYM_Y.
6748 * ldctor.h, lderror.h, ldexp.h, ldfile.h, ldindr.h, ldlang.c,
6749 ldlang.h, ldlex.h, ldmain.h, ldmisc.h, ldsym.h, ldver.h, ldwarn.h,
6750 ldwrite.h, relax.h: Replace all uses of EXFUN and PROTO ansi-glue
6751 macros with PARAMS. Recreational cleanup. Update copyrights.
6753 Tue Nov 10 00:23:37 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
6755 * Makefile.in: pass down the bfd source directory for includes
6759 * ldlang.c (lang_size_sections): don't change size and address for
6760 SEC_SHARED_LIBRARY sections rather than for SEC_NEVER_LOAD
6765 * relax.c (build_it): re-enable the processing of data_statements
6766 in scripts, makes counted contructor lists work again.
6770 * ldemul.h: Remove uses of SDEF and PROTO macros (use PARAMS).
6774 * scripttempl/m68kcoff.sc, emulparams/m68kcoff.sh: don't use
6775 initial underscores for etext, edata and end.
6779 * Support for i386-sysv.
6780 configure.in: check for i386-*-sysv* and i386-*-sco*.
6781 i386coff.sc-sh: rewrote to support SVR3 by default.
6782 ldctor.c (find_constructors): preserve stat_ptr.
6783 ldlang.c (wild_doit): initialize vma and size of new output
6784 section to corresponding input section. This is required for
6785 shared library support.
6786 (lang_size_sections): don't modify vma and size of sections which
6787 are never loaded (for shared libraries).
6788 ldwrite.c (copy_and_relocate): copy the contents of any section
6789 which has contents, not just sections which are loaded (for shared
6794 * ldlang.c (size_input_section): count the sizes of all sections
6799 * ldmisc.c (demangle,vfinfo): use the new underscore in bfd to
6800 to demangle symbols better
6804 * ldlang.c (lang_finish): don't warn if -e start symbol does not
6805 exist when linking with -r.
6809 * scripttempl/aout.sc, emulparams/aout.sh,
6810 scripttempl/m68kcoff.sc, emulparams/m68kcoff.sh: set __bss_start
6811 to the start of the .bss segment.
6815 * ldmain.c (linear_library): don't even think about processing
6816 an object file if it's already been done
6818 Thu Oct 1 23:14:59 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
6820 * configure.in: the hp9000/300 config file is now hp300
6824 * config/z8ksim.mt: new file
6828 * Makefile.in (ldexp.o, ldctor.o, ldlang.o, ldmain.o, ldwrite.o,
6829 lexsup.o, mri.o, relax.o): Indicate dependence on ldgram.h.
6831 * ld.h (strip_symbols_type): Add value STRIP_SOME.
6832 * ldgram.y (OPTION_RETAIN_SYMBOLS_FILE): New terminal token.
6833 * ldlang.c (lang_add_keepsyms_file): New function.
6834 * ldlex.l: Handle "-retain-symbols-file".
6835 * ldsym.c (keepsyms_file, kept_syms): New vars.
6836 (process_keepsyms): New functihon; reads file, marks symbols for
6838 (write_file_locals): File symbols should always be kept.
6839 (ldsym_write): Warn about "-retain-symbols-file" overriding "-S"
6840 and "-s". Process retain-symbols file before setting symtab.
6841 * ldsym.h (SYM_KEEP): New flag for ldsym_type flags.
6842 (keepsyms_file, kept_syms): Declare them.
6844 * ldmain.c (main): Non-fatal errors should still cause non-zero
6845 exit status even with -r.
6849 Added initial support for the z8k
6850 * emultempl/z8ksim.em, z8ksim.sc-sh, emulparams/z8ksim.sh: new
6852 * configure.in, Makefile.in: modified to reflect above
6854 * ldlang.c (lang_check): when linking conflicting architectures,
6855 make the output file reflect at least one of the bad inputs.
6859 * Makefile.in (install): if $(tooldir) exists, install ld in
6864 * Makefile.in, configure.in: modified to support i386-coff
6865 * i386coff.sh: new file
6869 * Makefile.in, emulparams/m68kcoff.sh, scripttempl/m68kcoff.sc,
6870 emulparmas/m68kcoff.sh, config/m68k-coff.mt: added m68k-coff
6871 emulation mode, stolen from a29k emulation. Almost certainly
6872 wrong, but perhaps better than sun3.
6876 * Makefile.in, Makefile.dos, emultempl/generic.em, genscripts.sh,
6877 emultempl/gld960.em, emultempl/h8300hms.em,
6878 emultempl/h8300xray.em, emultempl/lnk960.em, emultempl/st2000.em,
6879 emultempl/vanilla.em: Rename all (generated) ld__*.c files to
6880 em_.c. This is one character shorter, and lets people build on
6881 SVR3 system. (ld__h8300xray.[co] was the killer there;
6882 h8300xray.sc-sh is also overlong, but seems harmless.)
6883 Based on a patch from Jonathan Ryshpan <hitachi!amito!jon>.
6884 * Makefile.in (clean): Fix typo mostclean -> mostlyclean.
6885 * configure.in: Add host isc.
6887 * ldver.c: Call it version 2.0.
6891 * ldver.c: Bump to version 0.98.
6894 * Makefile.in: Added mostlyclean, distclean, realclean rules.
6898 * ldmisc.c (xrealloc): New (needed by ../libiberty/cplus.dem.c).
6899 * ldlex.l: Moved comment() to end, since some compilers
6900 otherwise have problems with input() used before it is defined.
6902 Tue Sep 1 17:45:51 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
6904 * configure.in: added Solaris 2 and Irix 4 host support.
6906 Mon Aug 31 19:27:11 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
6908 * Makefile.in: remove -S flag from the FLEX definition
6910 * configure.in: rewrote, using new style case statement. use
6911 m68k.mt for m68k-aout systems
6915 * Makefile.in: map "ld" through program_transform_name when
6920 * cplus-dem.c: Removed. Use the version in libiberty now.
6921 * ldmisc.c: Use new libiberty version of cplus_demangle().
6925 * emultempl/gld960.em (gld960_choose_target): default to little
6926 endian, not big endian.
6930 * ldlang.c (lang_process): don't pass null pointers when
6931 abs_output_section is what is required.
6932 * ldwrite.c (ldwrite): use malloc to allocate the largest space
6933 used, and pass that down.
6934 * relax.c, relax.h (write_relaxnorel): use the passed malloc area rather
6939 * configure.in, config/ose68.mt: renamed OSE to ose.
6943 * ldsym.c (write_file_locals): Reorder check for common or
6944 undefined symbols so that it works.
6948 * configure.in: accept all m68K family members.
6950 * Makefile.in: always create installation directories.
6954 * ldlex.l: now parses comment correctly, added ~ to acceptable
6957 * ldexp.c (exp_unop): pass down abs_output_section - now can have
6958 unary -ve constants.
6960 * ldlang.c (lang_finish): warn when an entry symbol supplied on
6961 the command line can't be found.
6965 * ldlang.h: add new field "loadable" to output_section_statement.
6966 * ldlang.c (lang_output_section_statement_lookup): initilize new
6967 field. (wild_doit): if new field is not set, then stop output
6968 section from being loadable.
6969 (lang_enter_output_section_statement): set the field from the
6971 * ldgram.y: new synax for NOLOAD. Removes a shift/reduce too.
6972 * scripttempl/h8300hms.sc, emulparams/h8300.sh,
6973 emultempl/h8300hms.em: get -r right.
6977 * ldint.texinfo: New internals manual (beginnings thereof).
6978 * PORTING: Removed, merged into ldint.texinfo.
6982 * testsuite/ld-cdtest/cdtest-main.cc,
6983 testsuite/ld-cdtest/cdtest-func.cc,
6984 testsuite/ld-cdtest/cdtest-foo.h,
6985 testsuite/ld-cdtest/cdtest-foo.cc,
6986 testsuite/ld-cdtest/cdtest.exp: A test program (copied from
6987 libg++/test-install) that tests that constructor and destructors
6988 are handled corrrectly.
6990 Mon Aug 3 14:58:19 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
6992 * Makefile.in (install): install from ld.new, renaming during the
6993 copy, or else the next 'make install' needs to re-link ld.
6997 * configure.in: generalise hp recognition (from sef).
6999 Sat Jul 18 14:46:04 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
7001 * configure.in: recognize bsd and hpux hppa configurations.
7002 error messages echo to stderr, not stdout
7006 * Makefile.dos, gld.1, ld.texinfo, ldemul.c, ldfile.c, ldlang.c,
7007 ldmisc.c: removed rcsid's.
7011 * ldlang.c (lang_map): print changes in sizes due to relaxing
7012 (size_input_section): maintain the delta information.
7013 * ldlang.h: add new field to struct to contain delta info.
7014 * relax.c (relax_section): complain if input not relaxable.
7015 * ldlex.l : add '_', ',' and '$' to chars which can appear at the
7020 * ldmain.c(main): prevent -r and -relax from being on at the same
7025 * ldmain.c (Q_enter_global_ref), ldindr.c (add_indirect): fix for
7031 * emultempl/h8300hms.em, scripttempl/h8300hms.sc,
7032 emulparams/h83000.sh: do the right thing for -r
7034 * ldlang.c(open_output): set the target arch and machine as soon
7035 as we can. (lang_size_sections): use new macros for setting vma
7040 * configure.in (my_target): Accept m680?0 for wrs as vxworks68.
7041 Also deleted an unreachable path to wrs.
7045 * Makefile.in (install): use -d test for $tooldir before
7046 installing ld there so that $tooldir can be inherited from
7051 * ldlang.c: Two non-substantial changes for the sake of
7052 the old Portable C Compiler.
7056 * ldgram.y, ldlex.l: parse ABSOLUTE
7057 * ldexp.c: add support for ABSOLUTE
7061 * Makefile.in: Added default definitions for HOSTING_CRT0,
7062 HOSTING_LIBS, and HOSTING_EMU, based on those in config/*.mh.
7063 * config/*.mh: Miscellaneous clean-up: Removed definitions
7064 of YACC (since it is not longer used in the Makefile).
7065 Remove HOSTING_* definitions that are subsumed by the
7066 ones added to Makefile.in. Removed most definitions of CC.
7067 * config/{sparc,news,hp300bsd,decstation}.mh: Removed;
7068 These are no longer needed.
7072 * Makefile.in: Use srcdir instead of VPATH in ldgram/ldlex
7073 rules, since these are used when building a distribution.
7074 * Makefile.in (ldlex.c): Don't re-direct output, since that
7075 leaves a bogus output files if it fails.
7077 * config/sparc.mh: Fix HOSTING_LIBS so it has a chance of working.
7078 * ldlex.c: Fix some unnecessary flex-specific-isms.
7082 * ldgram.y: move spurious semicolon
7083 * ldexp.h: fix prototype
7087 * ld.texinfo: references to linker now say "ld" not "gld".
7091 changed calling convention for Q_enter_global_ref
7092 * ldexp.c, ldlang.c, ldmain.c: reflect this
7093 * ldver.c: bump version to 1.97.1
7094 * ldindr.c (add_indirect): when an edict declaring an indirect
7095 symbol is found, make sure that any ideas about the symbol being
7096 common are changed if it now known to be defined.
7097 * ldmain.c (linear_library): complain once if archive isn't
7099 * ldlang.h, ldlang.c: make room for and initialize the complain
7104 * Makefile.in: use flex & bison from ../ if they exist.
7108 * relax.c (build_it): don't allocate space in the output file for
7109 stuff if -R flag applys to it.
7110 * ldfile.c: merge in VMS filename support
7111 * ldmain.c (main): take out ./ from library path, and close file
7112 before unlinking. Make multiple defs of a symbol create an
7114 * ldmisc.c: fatal errosrs delete output file
7118 * ldver.c: Increase version number to 1.97, for consistency
7123 * Makefile.in: FLEX -> LEX.
7125 * ld.texinfo: {} -> @{@}.
7129 * ld.texinfo: describe alternate, MRI-compatible linker scripts
7130 (and associated change in -c option, now used for these scripts)
7134 * ldver.c: Bumped version to 1.96 - new release, resync with the
7136 * ldexp.c, ldlang.c: now build memory shape tree in obstacks
7137 rather than with raw malloc, makes it easier to track where memory
7139 * ldsym.h, ldsym.c: create obstack for all global symbols too.
7140 * ldwrite.c (ldwrite): moved malloc so only used when needed.
7141 * sa29200-sc.sh: added support for .lit, data1 and data2 sections.
7146 * config/sparc.mh: use ../gcc/libgcc.a on check if it exists.
7148 * Makefile.in: use bootstrap for check.
7152 * ldgram.y, ldlex.c, mri.c: added more compatible words; BASE, ALIAS and
7154 * Makefile.in: now use flex, not lex
7155 * ldlex.l, ldlang.c, ldctor.c: lint
7159 * ldlex.l: added CMDFILENAMECHAR state so that you can lex
7160 different sorts of filenames on the command line than in a script.
7164 * Makefile.in: rework CFLAGS so that they can be passed on the
7165 make command line. Remove MINUS_G. Default CFLAGS to -g.
7169 * relax.c: added handling for new "padding" seclet type, used to
7170 fill out gaps between section.
7171 * ldgram.y, ldlex.l: now -defsym on the command line is done
7176 * Makefile.in: the tooldir copy of ld goes directly in tooldir.
7180 * mri.c, ldgram.y, ldlex.l: added support for minimal strange link
7185 * Makefile.in (install): Install second copy in $(tooldir)/bin
7186 without $(program_prefix), since that's what gcc expects.
7190 * ldlex.l, ldgram.y, ldlex.h: Rewrote lexer. Now it's much nicer.
7191 * h8300*: fix bit rot and add support for h8300xray target
7192 * emulparams/go32.sh: target emulation for go32.
7196 * emultempl/gld960.em, scripttempl/i960.sc,
7197 emulparamns/i960.sh. Fix i960 bit rot
7201 * Makefile.in: install man page.
7205 * config/mt-<foo> renamed to <foo>.mt
7206 * config/mh-<foo> renamed to <foo>.mt
7207 * configure.in changed to reflect this
7208 * genscripts.sh now make .xbn files rather than .xN files
7212 * ldver.h: fix decl of ldversion.
7216 * Makefile.in: added check target.
7220 * ldmain.c (Q_enter_file_symbols): now aliases work again
7224 * Makefile.in: added clean-info target.
7228 * ldexp.c (exp_print_tree): don't try and follow null pointers
7230 * ldgram.y: remove 11 shift reduce errors
7234 * Makefile.in: added tooldir and program_prefix.
7236 Fri Feb 28 08:17:45 1992 Steve Chamberlain (sac at thepub.cygnus.com)
7238 * ldlang.c (size_input_section): don't move absolute sections
7242 Thu Feb 27 09:20:41 1992 Steve Chamberlain (sac at thepub.cygnus.com)
7244 * cplus-dem.c: yet another copy of this - maybe it should go into
7246 * ldgram.y: now -V and -v have different actions
7247 * ldver.c: if -V, prints list of emulations compiled in
7248 * ldmisc.c: support for cplus demangling
7253 * Makefile.in, configure.in: removed traces of namesubdir,
7254 -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
7255 copyrights to '92, changed some from Cygnus to FSF.
7257 Thu Feb 20 17:43:46 1992 Per Bothner (bothner at cygnus.com)
7259 * Makefile.in: Change mkscript rule into one for ./mkscript
7260 (for the sake of makes that don't realize they're the same).
7261 * PORTING: Add more details.
7262 * genscripts.sh: Add more tailorability of DATA_ALIGNMENT.
7264 Mon Feb 17 12:04:36 1992 Per Bothner (bothner at cygnus.com)
7266 * Makefile.in, and new files hp300bsd.sh, config/mh-hp300bsd,
7267 config/mt-hp300bsd: New port to hp300 running BSD.
7269 Sat Feb 15 13:59:54 1992 Per Bothner (bothner at cygnus.com)
7271 Major rewrite of how ld is configured. The major idea
7272 is to use shell scripts to generate everything.
7273 * generic.em replaces ldtemplate.
7274 * Other *.em files replace various *.c files.
7275 A *.em file is a shell script that generates the corresponding
7276 ld__*.c file that implements an emulation. This is usually
7277 a straight 'cat' of a here-document, possibly with substitutions.
7278 * Script files (*.sc) are places by *.sc-sh scripts.
7279 Again, these are simple shell scripts that 'cat'
7280 here-documents, usually with some substitutions.
7281 The output a *.sc-sh is a script file.
7282 * Each emulation is defined by a short shell script with
7283 extension *.sh that specifies the emulation-specific
7284 parameters (such as the name of the *.sh-sc and *.em
7286 * genscript.sh is the master shell script used to generate
7287 an emulation. It is passed various argument, including
7288 the name a the emulation-speciic *.sh file that it
7289 "sources" to set variables to emulation-specifc parameters.
7290 * config/mt-foo: Changed EMUL=GLDFOO_EMULATION_NAME
7291 to EMUL=foo. (The GLDFOO_EMULATION_NAMEs have bee removed.)
7292 * config/mh-foo: Rename LDEMULATION names as appropriate
7293 (usually 'gldfoo' -> plain 'foo').
7294 * ldwrite.c: Fixed a typo in a comment.
7295 * Makefile.in: Major changes. Removed some the sed
7296 magic to converts scripts, since that is now handled
7297 by genscripts.sh and the *.sc-sh scipt generators.
7298 * config.h: Remove a bunch of macros defining emulations
7299 and targets. This becomes one less file to edit when
7300 adding emulations or targets.
7301 * ldemul.h (struct ld_emulation_xfer_struct): Add
7302 emulation_name and target_name fields.
7303 * ldemul.c, ldemul.h: Define some default functions used
7304 by most emulations (and remove from the *.em scripts).
7305 * ldemul.c (ldemul_choose_target): Search the new
7306 ld_emulations array using a loop (instead of a hardwired
7307 nested if statement).
7308 Define the ld_emulation from the automatically-geenrated
7309 ldemul-list.h. This means you no longer have to edit ldemul.c
7310 to add a new emulation.
7311 * ldmain.c: Replace {GLD,LNK}960_EMULATION_NAME by
7312 their expansions, since the former no longer exist.
7313 * PORTING: A very rough first draft of a porting guide.
7315 * ldgram.y, ldlex.l, lexsup.c: Changes to allow an assignment
7316 to be terminated by a new-line (instead of requiring a semicolon).
7318 Mon Feb 10 16:21:02 1992 Steve Chamberlain (sac at rtl.cygnus.com)
7320 * ldexp.c, ldlang.c: added new idea "abs_output_section", removes
7321 tests for NULL pointers all over the place.
7322 * ldlang.c (lang_process): remember to relocate global symbols
7323 *after* relaxing has done it stuff.
7325 Thu Feb 6 11:40:15 1992 Steve Chamberlain (sac at rtl.cygnus.com)
7327 * config/mt-coff-h8300: use EMUL like everything else
7328 * ldlang.c: (print_padding_statement): print the right address.
7329 * Makefile.in, config.h, ldemul.c: renamed h8300hds to h8300hms
7332 Tue Feb 4 15:28:01 1992 Steve Chamberlain (sac at rtl.cygnus.com)
7334 * ldlex.l: Put pack -noinhibit-exec and -sort-common
7335 * ldlang.c (print_data_statement): print the right address.
7337 Thu Jan 30 17:51:53 1992 Per Bothner (bothner at cygnus.com)
7339 * Makefile.in: The rule for testing ld by re-linking itself
7340 via an intermediate -r link was moved to the ld1 rule
7341 instead of the ld2 rule. This allows ld2 and ld3 to be identical,
7342 which allows the bootstrap rule to work.
7343 * ldctor.c (find_constructors): Don't create a constructor
7344 list if it is already defined (as would happen if ld is
7345 invoked by collect).
7347 Wed Jan 29 08:35:39 1992 Steve Chamberlain (sac at rtl.cygnus.com)
7349 * config/mh-sparc.h: now uses libgcc.a
7350 * ldmain.c: quit using exit
7351 * *sc: use *(COMMON) rather than [COMMON]
7352 * ldlex.l, lexsup.c: much thinking moved from .l and put into .c,
7353 to allow preprocessing of .l file.
7354 * Makefile.in: New ldlex.l mangling
7355 * ldexp.c (fold_binary): perform expressions with % and / in
7357 * ldfile.c (open_a): open archives on VMS in a special way
7360 Tue Jan 28 10:18:16 1992 Steve Chamberlain (sac at rtl.cygnus.com)
7362 * ldgram.y: map -M behave in the same way as -Map (sets file name
7364 * ldsym.c, ldlang.c: remember that size of a section is dependent on
7365 whether or not relaxing has been done.
7366 * ldmain.c: don't open a map file if it doesn't have a name
7367 * relax.c: all the brains have moved into bfd.
7368 * ldwrite.c: ammend comment
7370 Fri Jan 24 14:23:46 1992 Steve Chamberlain (sac at rtl.cygnus.com)
7372 * Makefile.in: added relax, also made three stage go through a
7375 * config.h: if GNU960 defined, then default emulation mode is
7377 * ldexp.h, ldexp.c: map to file hooks
7378 * ldlang.c: map to file hooks
7379 * ldgram.y: added -Map -relax
7380 * ldlex.l: added -relax, -Map
7381 * ldmain.c: open map file
7382 * ldmisc.c: support for map file
7383 * ldwrite.c: new relax magic
7385 Thu Dec 19 18:49:51 1991 John Gilmore (gnu at cygnus.com)
7387 * Makefile.in, config/tm-*.h: Clean up make output, only
7388 pass DEFAULT_EMULATION to ldmain.c.
7390 Wed Dec 18 15:02:47 1991 Per Bothner (bothner at cygnus.com)
7392 * ldver.c: Bump to version 1.94.
7394 Tue Dec 10 04:07:23 1991 K. Richard Pixley (rich at rtl.cygnus.com)
7396 * Makefile.in: infodir belongs in datadir.
7398 Mon Dec 9 16:26:43 1991 Per Bothner (bothner at cygnus.com)
7400 * Makefile.in: Pass -y to bison. (Again;
7401 accidentally deleted by Rich.)
7402 * scripttempl/news.sc, scripttempl/ldgld68k.sc: Define __end as
7405 Sat Dec 7 17:19:26 1991 Steve Chamberlain (sac at rtl.cygnus.com)
7407 * ldindr.h: added to contain prototypes of ldindr.c
7408 * ldfile.c: include ctype.h
7409 * ldmain.c: include the requried prototype headers
7410 * ldwrite.c: get_reloc_upper_bound has been renamed
7411 bfd_get_reloc_upper_bound
7413 Fri Dec 6 23:29:26 1991 K. Richard Pixley (rich at rtl.cygnus.com)
7415 * Makefile.in: punt "fundamental" mode because it breaks my emacs
7416 macros. install using INSTALL_PROGRAM and INSTALL_DATA. remove
7417 spaces following hyphens, bsd make can't cope. added
7418 standards.text support and made it look like all the other
7421 * configure.in: configure now runs entirely in objdir so make file
7422 existence checks against ${srcdir}. Mark this directory as
7425 Thu Dec 5 22:46:16 1991 K. Richard Pixley (rich at rtl.cygnus.com)
7427 * Makefile.in: idestdir and ddestdir go away. Added copyrights
7428 and shift gpl to v2. Added ChangeLog if it didn't exist. docdir
7429 and mandir now keyed off datadir by default.
7431 Wed Dec 4 23:36:55 1991 Per Bothner (bothner at cygnus.com)
7433 * ldver.c: Bumped version to 1.93.
7434 * Makefile.in: Pass -y to bison.
7436 Mon Nov 25 18:28:40 1991 Steve Chamberlain (sac at cygnus.com)
7438 * config.h: h8 is now coff, not ieee
7439 * h8300hds.sc: reflect the same
7441 Thu Nov 14 19:55:09 1991 Per Bothner (bothner at cygnus.com)
7443 * ldver.c (ldversion()): Update to 1.92.
7444 * ldctor.c: There are two places constructor sets
7445 can be defined. One of them checked for an existing
7446 duplicate, the other didn't. Unfortunately, the latter
7447 was called after the former ...
7448 So, factor out code for inserting a new element into
7449 constructor_name_list (after checking for a duplicate)
7450 into a new function add_constructor_name, and call
7451 it from both aforementioned places (ldlang_add_constructor
7452 and ldlang_check_for_constructors).
7454 Wed Nov 13 15:17:43 1991 Per Bothner (bothner at cygnus.com)
7456 * Makefile.in: Rename .c files generated from ldtemplate
7457 to have names starting with ld__. This helps 'make clean'.
7459 Tue Nov 12 18:36:50 1991 Steve Chamberlain (sac at cygnus.com)
7461 * Makefile.in: Take out the version number for install
7462 * scripttempl/m88kbcs.sc: put in contructor blocks.
7464 Mon Nov 11 18:47:33 1991 Per Bothner (bothner at cygnus.com)
7466 * ldmisc.c, ldmisc.h: Re-write info() to take a filename
7467 parameter, a format, and an arg pointer, and rename it to
7468 vfinfo(). Write info() in terms of new vfinfo().
7469 New einfo() is the same as info(), except it writes to stderr.
7470 * ldemul.c, ldexp.c, ldlang.c, ldlnk960.c, ldmain.c, ldwrite.c,
7471 ldmisc.c: Replace "error" calls to info() by new einfo().
7473 Mon Nov 11 09:57:32 1991 Steve Chamberlain (steve at cygnus.com)
7475 * ldlex.l ldgram.y: made -V option do same as -v
7476 * Makefile.in: Added $(MINUS_G) flag so debugging can be
7479 Sun Nov 3 16:37:37 1991 Steve Chamberlain (steve at cygnus.com)
7480 i386 aout changes from Bob Kukura
7481 * Makefile.in, config.h: added i386aout support
7482 * configure.in: fixed /h-{myhost} typo
7483 * ldgram.y: -MM now gives more boring map.
7484 * ldlang.c: now does D_PAGED flag the right way.
7485 * ldsym.c: -MM flags does the right thing.
7487 Sun Nov 3 15:00:03 1991 Per Bothner (bothner at cygnus.com)
7489 * configure.in: Fixed typo. Also, a fix for hp300bsd.
7490 * ldlang.c (init_os): Compensate for BFD change,
7491 where bfd_make_section now returns NULL for a duplicate
7492 section request, instead of the old section.
7494 Thu Oct 17 15:27:13 1991 Per Bothner (bothner at cygnus.com)
7496 * ldver.c: Bump to version 1.91 (consistent with binutils).
7498 Wed Oct 16 12:27:08 1991 Per Bothner (bothner at cygnus.com)
7500 * Makefile.in, config.h, ld.h, ldemul.c, ldexp.c, ldexp.h,
7501 ldgram.y, ldlex.l, ldlnk960.c, ldmain.c, ldmisc.c, ldmisc.h,
7502 ldsym.c, ldsym.h, ldtemplate, ldvanilla.c, ldver.c, ldver.h,
7503 ldwarn.c, ldwarn.h, ldwrite.c, ldwrite.h, mkscript.c:
7504 Add or update copyright notices.
7506 Mon Oct 14 23:55:27 1991 Per Bothner (bothner at cygnus.com)
7509 * Makefile.in: Changed installation directory name scheme
7510 to be consistent with gcc. Also changed 'install'.
7512 Mon Oct 14 17:30:02 1991 Roland H. Pesch (pesch at cygnus.com)
7514 * Makefile.in: new targets ld.mm, ld.me
7516 Mon Oct 14 17:27:24 1991 Per Bothner (bothner at cygnus.com)
7518 * Makefile.in, ldtemplate: Need to use separate scripts
7519 for -n and -N options. Yet more complication.
7521 Fri Oct 11 22:40:46 1991 John Gilmore (gnu at cygnus.com)
7523 * Makefile.in: Avoid using $< in explicit Make rules (it doesn't
7524 work). Add some lines to avoid Sun Make VPATH bugs.
7526 Fri Oct 11 16:42:22 1991 Per Bothner (bothner at cygnus.com)
7528 * scripttempl/news.sc: Add alignment for data segment.
7529 * ldtemplate: Add (yet another) script to get for -n or -N
7530 options. (These need different alignment than ZMAGIC files.)
7531 * Makefile.in: Add stuff for new foo.xn scripts.
7532 These are generated by replacing "ALIGN(0x...00)" by ".".
7534 Fri Oct 11 15:43:04 1991 Roland H. Pesch (pesch at cygnus.com)
7536 * Makefile.in: new targets ld.ms, ld-index.ms
7537 ld.texinfo: remove tabs, other cleanups for texi2roff
7539 Fri Oct 11 13:51:54 1991 Per Bothner (bothner at cygnus.com)
7541 * ldmain.c (main): Make config.magic_demand_paged be true
7542 by default. Don't set the WP_TEXT and D_PAGED flags of
7543 output_bfd here; it's too late, so set it when output_bfd
7544 is created (in ldlang.c). Also fix setting of EXEC_P flag
7545 * ldlang.c (ldlang_open_output): Set output_bfd->flags here.
7546 * ldlang.c: Remove some duplicate extern declarations.
7547 * ldgram.y: Fixes to -N and -n options.
7548 * Makefile.in: Recognize upper case letters in sed script
7549 to remove assignments from script files.
7550 * ldtemplate: Don't assukme that -N or -n options
7551 imply use of -r script.
7552 * mkscript.c: Tweaking to correctly handle \n and \\ in input.
7554 Fri Oct 11 10:29:27 1991 Steve Chamberlain (steve at cygnus.com)
7556 * ldtemplate: include bfd.h before sysdep.h.
7558 Fri Oct 11 04:24:45 1991 John Gilmore (gnu at cygnus.com)
7560 Restructure configuration scheme for bfd, binutils, ld.
7562 * configure.in: Revise to symlink sysdep.h to ../bfd/hosts/h-xxx.h.
7563 Change some config names to match other dirs.
7564 * *.c: Include bfd.h before sysdep.h, so ansidecl and PROTO()
7566 * config/: Rename some config files to match up h-*.h names.
7567 Remove all the HOST_SYS definitions from the config files.
7569 Tue Oct 8 16:00:57 1991 Per Bothner (bothner at cygnus.com)
7571 * ldexp.h, ldlang.h: Change enum boolean -> enum bfd_boolean.
7572 * ldtemplate: Remove ldfile_add_library_path calls;
7573 just use the SEARCH_DIR commands in the script files.
7574 * Makefile.in: Add LIB_PATH macro, which if set is used to replace
7575 the SEARCH_DIR commands in the scripts (using ugly sed magic).
7576 This is primarily intended for cross-linking, where you would
7577 place libaries in a different place than native libraries.
7578 Also, emulations made from ldtemplate now use $(srcdir).
7579 * scripttempl/ldglda29k.sc: Change SEARCH_DIR commands to a
7580 conventional form; people can use the Makefile's LIB_PATH to
7583 Tue Oct 8 14:51:21 1991 Roland H. Pesch (pesch at cygnus.com)
7585 * Makefile.in: fix target ld.dvi, add target ld.info
7586 ld.texinfo: make info filename ld.info
7588 Fri Oct 4 21:51:58 1991 John Gilmore (gnu at cygnus.com)
7590 * Makefile.in: Avoid using $< in non-suffix rules (breaks on Sun
7592 * ldfile.c, ldlang.c, ldmain.c, ldwrite.c: Cope with renames of a
7593 few BFD types & enums.
7600 version-control: never