Commit graph

825 commits

Author SHA1 Message Date
Ian Lance Taylor
4f2ee95801 * scripttempl/i386coff.sc: If relocating, don't put .init and
.fini sections into .text; keep them separate.
	* config/i386sco.mh (HOSTING_CRT0): If ../gcc/crtbegin.o does not
	exist, get crtbegin based on gcc -print-libgcc-file-name.
	(HOSTING_LIBS): Similar change for ../gcc/crtend.o.
1994-04-11 16:35:39 +00:00
Jeff Law
f39a73b1b6 * configure.in (hppa*-*-*elf*): Don't require "-hp-" for the
manufacturer.
1994-04-07 03:49:18 +00:00
Jeff Law
79f7de91c4 * emultempl/hppaelf.em (hppaelf_finish): Only resize sections
if building a final executable.
1994-04-06 07:10:09 +00:00
Ken Raeburn
632dcce87b note that pa support is elf only 1994-04-05 18:55:56 +00:00
Ian Lance Taylor
67d0e7ffa1 * ldmain.c (main): Check the return value of bfd_close. 1994-04-05 16:18:31 +00:00
Ian Lance Taylor
be9ffc1fd0 * scripttempl/alpha.sc: Clean up section alignment to ensure that
sections never overlap when using -r.
1994-03-31 23:08:37 +00:00
Ian Lance Taylor
6c00b04ff8 * ldmisc.c (vfinfo): Change symbol reading slightly for recent BFD
changes: get_symtab_upper_bound renamed and returns long,
	bfd_canonicalize_symtab returns long, check for error indications.
1994-03-30 22:05:05 +00:00
Ian Lance Taylor
f078dc7cf2 * ldlang.c (print_input_section): For section size, use
_cooked_size if it is non-zero, size otherwise.
	(size_input_section): Likewise.
	(lang_do_assignments): Likewise (case lang_input_section_enum).
1994-03-25 22:22:29 +00:00
Ian Lance Taylor
193c5f93a1 * ldlang.c (new_afile): Add new argument add_to_list. Don't set
real to true for lang_input_file_is_marker_enum.  Clear the_bfd.
	(lang_add_input_file): Pass true to new_afile for add_to_list.
	(lookup_name): Remove force_load argument.  Changed all callers.
	Pass false to new_afile for add_to_list.  Split loading of symbols
	out into separate function.
	(load_symbols): New function split out of lookup_name.  Don't load
	the symbols if they are already loaded.
	(open_input_bfds): For lang_input_statement_enum call load_symbols
	rather than lookup_name.
	(lang_process): Pass abs_output_section rather than NULL to
	lang_size_sections.
	(lang_startup): Set real field of first_file to true.
1994-03-24 20:25:12 +00:00
Ian Lance Taylor
a2670c2f8b * emultemp/gld960.em: Include libiberty.h
(gld960_before_parse): Pass NULL as final argument to concat.
1994-03-23 19:17:27 +00:00
Ian Lance Taylor
f7a26f1b78 * scripttempl/aout.sc: Force _end and __end to be aligned to a
four byte boundary.
1994-03-22 23:46:17 +00:00
Ian Lance Taylor
f3bc3ac3fa * ldwrite.c (build_link_order): Handle lang_data_statement_enum by
building a bfd_data_link_order, rather than by setting the section
	contents immediately.
1994-03-22 18:18:32 +00:00
Ian Lance Taylor
4fdbafb247 Changes to make -Ur work again.
* ldmain.c (add_to_set): Now takes reloc argument rather than
	bitsize.  Check config.build_constructors here.  If an new hash
	table entry is created, mark it as undefined.
	(constructor_callback): No longer takes bitsize argument.  Pass
	BFD_RELOC_CTOR to ldctor_add_set_entry, but first make sure the
	BFD backend supports it.
	(reloc_overflow): Handle a NULL abfd argument.
	(reloc_dangerous, unattached_reloc): Likewise.
	* ldctor.c: Include ldmain.h.
	(struct set_info): Change bitsize field to reloc.
	(ldctor_add_set_entry): Now takes reloc argument rather than
	bitsize.  Don't bother to check config.build_constructors here.
	(ldctor_build_sets): Get the size from the reloc howto.  If
	generating relocateable output, call lang_add_reloc rather than
	lang_add_data.
	* ldctor.h (ldctor_add_set_entry): Change declaration to use reloc
	instead of bitsize.
	* ldlang.h (statement_enum): Add lang_reloc_statement_enum.
	(lang_reloc_statement_type): New structure.
	(lang_statement_union_type): Add reloc_statement field.
	(lang_add_reloc): Declare new function.
	* ldlang.c (lang_for_each_statement_worker): Handle
	lang_reloc_statement_enum.
	(map_input_to_output_sections, print_statement): Likewise.
	(lang_size_sections, lang_do_assignments): Likewise.
	(print_reloc_statement): New function.
	(lang_add_reloc): New function.
	* ldwrite.c (build_link_order): Handle lang_reloc_statement_enum.
1994-03-22 00:24:13 +00:00
Ian Lance Taylor
0a6ffe9cfd Remove ppc.em; do it all in nlmconv instead. 1994-03-12 03:19:27 +00:00
Ian Lance Taylor
de0abbfc79 Set Emacs local variables to never use version control. 1994-03-08 18:55:57 +00:00
David MacKenzie
0071a731ef * config/i386bsd.mh: New file. 1994-03-08 12:25:06 +00:00
Ian Lance Taylor
7f0638d54b * elf.sc: Permit TEXT_START_SYMBOLS and DATA_START_SYMBOLS to be
defined.
	* emulparams/elf32mipb.s (TEXT_START_SYMBOLS): Define _ftext.
	(DATA_START_SYMBOLS): Define _fdata.
1994-03-07 20:26:24 +00:00
Stan Shebs
d9abc278a6 Fri Mar 4 11:43:47 1994 Stan Shebs (shebs@andros.cygnus.com)
* ldlang.c (lookup_name): Stomp on a pointer if in MPW.
	* mpw-em.c: Edit to reflect changed syntax of compiled-in linker
	scripts.
1994-03-04 19:53:16 +00:00
Stan Shebs
ddde2a14a7 Mon Feb 28 11:09:48 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-xconfig.in (emulname): Define.
1994-02-28 19:15:10 +00:00
Stan Shebs
764eb34944 Lose mpw-build.in 1994-02-28 19:14:06 +00:00
Stan Shebs
496977f2f6 Mon Feb 28 11:07:41 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-build.in: Remove, subsumed in mpw-make.in.
	* mpw-make.in (bindir): Fix pathname.
	(install): Move here from mpw-build.in.
1994-02-28 19:13:40 +00:00
Stan Shebs
b897ed67cb Mon Feb 28 10:59:14 1994 Stan Shebs (shebs@andros.cygnus.com)
* ldlang.c (cat): Define using ANSI style if ALMOST_STDC defined.
1994-02-28 19:05:34 +00:00
Jeff Law
ff68559e31 * emultempl/hppaelf.em (hppaelf_finish): Update comments. This
works again.  Attach some output symbols to the stub file bfd.
1994-02-28 04:23:40 +00:00
Jeff Law
2e39abdb96 * emultempl/hppaelf.em: Include elf32-hppa.h.
(file_chain): Add decl.
        (hppa_look_for_stubs_in_section): Delete decl.
        (hppaelf_finish): Reenable code.  Do not pass symbols
        down to hppa_look_for_stubs_in_section.
1994-02-28 00:30:36 +00:00
Ian Lance Taylor
b495c31442 * ldmain.c (write_map): Don't define. Removed all references.
Just use map_file or map_filename instead.
	(add_archive_element): Use minfo to write map information, not
	info_msg.
	(constructor_callback): Use fprintf to write map information, not
	info_msg.
	* ldmain.h (write_map): Don't declare.
	* ldgram.y (mri_script_command): Removed reference to write_map.
	* ldlang.c (lang_one_common): Likewise.
	* lexsup.c (parse_args): Likewise.
1994-02-26 19:01:50 +00:00
Ian Lance Taylor
bff600cfa4 * scripttempl/elf.sc: Force all sections to be aligned. 1994-02-26 05:34:52 +00:00
Ian Lance Taylor
27baca7182 * ldgram.y (section): Reverse the order of memspec_opt and
fill_opt to avoid an ambiguity when both are used.
	* ld.texinfo: Changed accordingly.
1994-02-26 05:32:29 +00:00
Ian Lance Taylor
6232b6c4c5 * ldgram.y: Move include of ldlex.h back with other includes.
* ldlex.h (input_type): Don't initialize enum constants to
	particular values.
	* ldlex.l: Use a switch to return the right token based on
	input_type, rather than knowing that input_type has a value based
	on a token type.
1994-02-26 03:22:26 +00:00
Ian Lance Taylor
4725fb48f5 * ldgram.y (dirlist_ptr): Removed; not used.
* lexsup.c: Include ldver.h.
	* Makefile.in: Rebuilt dependencies.
1994-02-26 03:17:02 +00:00
Ian Lance Taylor
fc1dfb7169 Fri Feb 25 18:55:54 1994 Ted Lemon (mellon@pepper.ncd.com)
* ldlang.c (lookup_name): don't call bfd_set_gp_size.
	(ldlang_add_file): call it here instead.
1994-02-26 03:11:21 +00:00
David MacKenzie
ff33a8c167 * ldgram.y: Include ldlex.h after %token decls, for byacc. 1994-02-26 02:14:30 +00:00
Jeff Law
531a5bd189 * emultempl/hppaelf.em: First attempt to clean this file up.
Add comments in several functions as to their purpose and
        how they function (or my current best guess).  Clean up horrible
        spacing and indention that never should have been accepted in the
        first place.  Add FIXMEs for issues which need to be resolved.
        Disable linker-stub generation until it gets fixed.  This allows
        the linker to at least work on simple code for testing purposes.
1994-02-26 00:33:30 +00:00
Jeff Law
a62494c41b * ldlang.c (lang_size_sections): No longer static (PA ELF calls
it via hppaelf_finish).  Prototype moved into ldlang.h.
        (lang_process): Move problematic extra call to lang_size_sections
        into the PA ELF specific code.
        * emultempl/hppaelf.em (hppaelf_finish): Extra call to
        lang_size_sections moved here.
1994-02-25 18:51:35 +00:00
David MacKenzie
9d3898b251 Add missing newline in einfo message. 1994-02-25 04:12:50 +00:00
David MacKenzie
d5b79a89b9 * lexsup.c (parse_args): Use symbolic numbers for long options.
Fix misunderstanding in -Y and -call_shared et al.
1994-02-25 04:08:55 +00:00
Ian Lance Taylor
b3cefbc393 For some reason this directory was missing a .Sanitize file. 1994-02-25 03:59:10 +00:00
Ian Lance Taylor
3de3daca78 Make correspond to djm's last change. 1994-02-25 03:39:17 +00:00
Ian Lance Taylor
c361ce46c5 * configure.in (powerpc-*-elf*): New target; use ppc-elf32.
* config/ppc-elf32.mt: New file.
	* emulparams/elf32ppc.sh: New file.
	* emultempl/ppc.em: New file.
	* Makefile.in (ALL_EMULATIONS): Added em_elf32ppc.o.
	(em_elf32ppc.c): New target; uses elf32ppc.sh, ppc.em and elf.sc.
	(EMULATION_OFILES): Added dependencies on ldexp.h and ldlang.h.
1994-02-25 03:32:08 +00:00
David MacKenzie
d4e5e3c330 Use getopt instead of lex and yacc to parse the command line.
* ld.texinfo (Options): Document changes to option syntax.
	* Makefile.in: Update dependencies.
	* ldver.c (help): Tweak dashes in usage message.
	* ldgram.y (%union): Remove unused members.
	Remove %tokens for command line options; add ones for input types.
	(command_line): Rules removed.
	(file): Instead of command line, recognize an
	input type indicator, then use the nonterminal for that type.
	(defsym_expr): New nonterminal from code formerly in command_line.
	* ldlex.h: Declare parser input type enum and variable.
	Don't declare parse_line.
	* ldlex.l: Remove unused variables.  Make some used ones static
	and comment them.
	(COMMAND): Start state and its rules removed.
	At start of yylex, return input state token if at start of input.
	(lex_redirect): Don't need to set yyout.
	(ldlex_command): Function removed.
	* ldmain.c (main): Instead of calling parse_line, set up the
	redirections and call yyparse directly.
	* ldmisc.c (vfinfo): If there's no input filename, print nothing, not
	"command line".
	* lexsup.c: Remove #if 0'd code.
	(parse_line): Function removed.
	(parse_args): Rewrite to use getopt_long_only.
	(set_default_dirlist): New function from code formerly in
	ldgram.y:command_line.
	(set_section_start): New function.
	* emultempl/generic.em, emultempl/gld960.em, emultempl/hppaelf.em,
	emultempl/lnk960.em, emultempl/m88kbcs.em: Don't enclose
	compiled-in link scripts in "{" and "}", as the grammar no longer
	wants them to be.
1994-02-25 03:26:25 +00:00
Steve Chamberlain
a25e99350b H8/500 bits. 1994-02-24 17:15:46 +00:00
Steve Chamberlain
5fe60d7321 Various H8/500 bits. 1994-02-24 17:14:06 +00:00
Ken Raeburn
78158b1cda keep coff_sparc.sh 1994-02-24 16:50:12 +00:00
Ken Raeburn
808510fa7a keep coff-sparc.mt 1994-02-24 16:49:21 +00:00
Ian Lance Taylor
a733e1d7a6 * ldlang.c (lang_size_sections): Only align section to alignment
required by linker script, not to maximum alignment of input
	sections.
1994-02-22 18:19:07 +00:00
Ian Lance Taylor
6b8929a172 * ldlang.h (largest_section): Don't declare.
* ldlang.c (largest_section): Don't define.
	(size_input_section): Don't set largest_section; not used.
1994-02-22 17:32:30 +00:00
Ian Lance Taylor
ef76742fc5 * ldlang.c (new_afile): Pass NULL as last argument to concat. 1994-02-21 23:19:43 +00:00
Ken Raeburn
1f4203cb20 keep ld.cdtest 1994-02-18 22:10:20 +00:00
Ian Lance Taylor
42f62ead47 Various entries. 1994-02-17 20:56:49 +00:00
Ian Lance Taylor
4c2123b670 * ldlang.c, ldmain.c: Include libiberty.h. 1994-02-17 20:54:37 +00:00
David MacKenzie
5bcb7f28e1 * ldlang.c, ldmain.c, ldmisc.c: Use bfd_get_error and
bfd_set_error and new error names.
1994-02-17 18:12:17 +00:00
Ken Raeburn
7ff6f2daf5 i960-bout linker fixes, install-info bugfix 1994-02-16 01:20:05 +00:00
Ken Raeburn
09a5aa5eee (lang_size_sections): Clear bfd_error before calling bfd_relax_section, in case
it returns false but doesn't flag an error.  If an error is returned, indicate
which one it is in the error message.
1994-02-16 01:18:32 +00:00
Ken Raeburn
db0a7149be (install-info): Depend on ld.info, and use "$<*" so
it'll get picked up from $(srcdir) if appropriate.
1994-02-16 01:17:43 +00:00
David MacKenzie
09aaf97a9f * ldlex.l (comment): Increment line number when newline is read. 1994-02-12 01:31:11 +00:00
Ian Lance Taylor
c4e48be344 * ldlang.c (lookup_name): Take new argument, force_load. If true,
reload the file even if it is already loaded.
	(wild): Call lookup_name with force_load argument of 0.
	(open_input_bfds): Call lookup_name with force_load argument of 1.
	(print_symbol): Remove declaration of non-existent function.
	(print_one_symbol): Return true rather than falling off end.
1994-02-11 22:40:20 +00:00
Ian Lance Taylor
410945f102 * ldmain.c (main): Use %ld when printing long values. 1994-02-10 17:02:24 +00:00
Ian Lance Taylor
473e361e30 * emulparams/elf32mipb.s (OTHER_BSS_SYMBOLS): Define _fbss. 1994-02-10 17:00:32 +00:00
Jeff Law
423dae05e4 Opps. 1994-02-08 00:40:55 +00:00
Jeff Law
6cc2ced133 Oops. 1994-02-08 00:40:22 +00:00
Jeff Law
b3ade95e81 * Rename all "hppaosf" files to "hppaelf".
* Change all "osf" references to "elf" in hppaelf files.
        * Makefile.in: Likewise.
        * configure.in: Likewise.
1994-02-08 00:37:19 +00:00
Jeff Law
f7d4f6f622 * Rename all "hppaosf" files to "hppaelf". 1994-02-08 00:32:33 +00:00
Jeff Law
90e30f5104 Renamed hppaosf.sc to hppaelf.sc 1994-02-08 00:28:48 +00:00
Jeff Law
a9cff99018 Renamed hppaosf.em to hppaelf.em 1994-02-08 00:28:05 +00:00
Jeff Law
fd0a9d9823 Renamed hppaosf.sh to hppaelf.sh 1994-02-08 00:27:10 +00:00
Jeff Law
78b6df412f Renamed hppaosf.mh to hppaelf.mh 1994-02-08 00:25:39 +00:00
Jeff Law
96bae9ceb0 Renamed hppaosf.mt to hppaelf.mt 1994-02-08 00:25:05 +00:00
David MacKenzie
6f6712661f * ldmain.c (main): Call xatexit, not atexit.
Call xmalloc_set_program_name.
1994-02-07 06:07:26 +00:00
David MacKenzie
f49721350b * ldlang.c (lang_size_sections): Check if bfd_relax_section set
bfd_errno.
1994-02-07 05:00:18 +00:00
David MacKenzie
744b2885b4 remove cvs lossage 1994-02-06 01:05:54 +00:00
David MacKenzie
52a8ebfe04 * emultempl/lnk960.em (append), emultempl/hppaosf.em
(hppaosf_finish): Call xmalloc, not ldmalloc.
	* ldmain.c (preserve_output): Function removed.
	(main): Do it here instead.
1994-02-05 12:00:15 +00:00
Jeff Law
9dd7d585d6 * ldlang.h (LANG_FOR_EACH_{INPUT,OUTPUT}_SECTION): Delete (unused)
GNU C specific macros.

        * emultempl/hppaosf.em (hppaosf_finish): Expand the only remaining
        call to LANG_FOR_EACH_INPUT_SECTION.
1994-02-05 07:03:48 +00:00
David MacKenzie
0b2f8d2edd * ldmisc.c (ldmalloc, xmalloc, ldrealloc, xrealloc): Functions
deleted; will use libiberty versions instead.
	* ldctor.c ldfile.c ldlang.c ldmain.c ldmisc.c ldmisc.h lexsup.c
	mri.c Makefile.in: Change callers.

	* ldmisc.c (vfinfo): Remove cleanup code.
	* ldmain.c (remove_output): Put it here (new function).
	(preserve_output): New function.
	(main): Register remove_output and preserve_output with atexit.
	* ldmain.c ldgram.y: Call xexit instead of exit.
	* ldmisc.h: Declare xexit.
1994-02-05 01:14:56 +00:00
Steve Chamberlain
9e0f78c8d7 * Makefile.in: Lots of new H8/500 memory models. 1994-02-04 23:19:33 +00:00
Steve Chamberlain
7cc3adc442 New memory model. 1994-02-04 23:18:19 +00:00
Steve Chamberlain
c48b8a8554 More sicko segmentation support. 1994-02-04 23:08:00 +00:00
Steve Chamberlain
367428b5a1 Support for various sicko segmented memory models. 1994-02-04 22:57:26 +00:00
Roland Pesch
139c8857be Formatting adjustments, for better smallbook formatting
and to agree better w/FSF (RMS) indentation conventions.
1994-02-03 04:38:58 +00:00
Roland Pesch
7c8fab26c8 Describe -retain-symbols-file. 1994-02-03 04:18:11 +00:00
Roland Pesch
1fb57a5d3e misc updates:
(1) show `-y SYMBOL' with space
(2) weaken multi-target stuff, to avoid false expectations now that
linker now often config'd with only one target
(3) describe -relax support on i960
(4) correct description of hyphen chars in symbols
(5) describe CONSTRUCTORS linker script cmd
1994-02-03 03:12:38 +00:00
Roland Pesch
67c4333b27 Describe AT option of SECTIONS command, at long last. 1994-02-02 02:27:55 +00:00
Ken Raeburn
836dcbcf2f * ldlex.l: Removed duplicate rules.
(yywrap): Provide default definition, needed with some versions of flex.
1994-01-30 21:22:38 +00:00
David MacKenzie
288897f490 * ldmisc.c (vfinfo): For `%I', if the file is in an archive, print
the archive filename too.
1994-01-28 21:20:11 +00:00
Ken Raeburn
9b928d3419 get rid of rcs crud 1994-01-28 20:17:18 +00:00
Ken Raeburn
6e0a904fd0 Fix test case to be valid ANSI C++.
Don't require use of fixed C++ header files, so "../gcc/xgcc -B../gcc/" ought
to work for CXX.

In cdtest.exp: Combine "rm" lines.  Added some commentary on things still
broken in this test case.
1994-01-28 20:09:26 +00:00
Ken Raeburn
57e5ec0783 * lib/ld.exp (simple_diff): Indicate failure if files have different numbers of
lines.  Don't muck with $differences to avoid indicating a pass, just return.

Also got rid of trailing whitespace on some lines.
1994-01-28 20:05:56 +00:00
David MacKenzie
fb55f9b8ae * ldlex.l: Add rule to catch invalid input characters instead of
printing them.  Include "ldmain.h" for program_name decl.
	(lex_warn_invalid): New function.
	* Makefile.in: Add dependency.
1994-01-28 19:36:53 +00:00
Ken Raeburn
f3c6455fda * Makefile.in (check): Don't bother running any tests of
cross-linker until the test suite no longer assumes native mode.
1994-01-28 18:02:43 +00:00
Ken Raeburn
e2f9f0f639 keep test suite 1994-01-28 17:19:22 +00:00
Steve Chamberlain
804c860185 Thu Jan 27 17:19:54 1994 Steve Chamberlain (sac@jonny.cygnus.com)
* ldlang.c (print_one_symbol, print_input_section):  Print
	global symbols in symbol table again.
1994-01-28 01:26:25 +00:00
David MacKenzie
7b40f2b169 * ldmain.c ldmain.h ldgram.y: If -v -V or --version was given,
exit successfully instead of complaining if no input files are
	given.
1994-01-27 20:49:21 +00:00
Rob Savoye
03372cf4ab Change all occurances of RUNTEST_FLAGS to RUNTESTFLAGS to be consistant with
everything else. (and now work recursively too)
1994-01-26 21:44:50 +00:00
Stan Shebs
74e6b793b8 * Makefile.in: Format variable definitions consistently.
(LD_PROG): Remove unnecessary variables from link command,
	change variable LOADLIBES to EXTRALIBS.
1994-01-26 04:24:30 +00:00
Stan Shebs
747a47f2be Add MPW/GM sanitizing 1994-01-26 04:19:32 +00:00
Stan Shebs
9218920aba Tue Jan 25 20:01:55 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-xconfig.in: New file, mpw x mips configuration fragment.
	* mpw-em.c: New file, compressed version of em_mipsidt.c.
1994-01-26 04:18:25 +00:00
Stan Shebs
b5b2c88649 Tue Jan 25 19:54:19 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-config.in: New file, MPW configuration fragment.
	* mpw-build.in: New file, MPW build script fragment.
	* mpw-make.in: New file, MPW makefile fragment.
	(This file is semi-automatically generated from Makefile.in.)
	* ldfile.c (slash): If MPW, set to `:'.
	* ldlex.l (TRUE_FALSE_ALREADY_DEFINED): If MPW, set this to
	prevent redefinition errors.
1994-01-26 04:17:05 +00:00
Stan Shebs
8594f56890 Tue Jan 25 13:19:41 1994 Stan Shebs (shebs@andros.cygnus.com)
* ldmain.c (main): Compute and display total execution time.
	* ld.texinfo (-stats): Document the option.
1994-01-25 21:30:00 +00:00
Ian Lance Taylor
5dad4c9728 * ldmain.c (reloc_overflow): Added name, reloc_name and addend
arguments.
1994-01-24 20:22:12 +00:00
Ian Lance Taylor
de08b0b153 * ldlang.c (lookup_name): Set BFD GP size to -G argument value
after opening BFD.
1994-01-24 19:55:02 +00:00
Ian Lance Taylor
755f42fe99 * ldlang.c (relaxing): Removed global variable.
(lang_size_sections): If the canonical symbols have not already
	been read in, read them in before relaxing.
	* ldlang.h (relaxing): Removed declaration.
1994-01-24 17:59:18 +00:00
Ian Lance Taylor
5e6cd559cf * ldlang.c (new_afile): Initialize loaded field to false.
(lookup_name): If file was already loaded, don't call the
	add_symbols entry point again.
1994-01-21 05:47:18 +00:00
David MacKenzie
8de26d624e * ld.texinfo: Clarify what -T option does. 1994-01-19 21:58:31 +00:00
Steve Chamberlain
a843c81763 * scripttempl/m88kbcs.sc: Don't use CREATE_OBJECT_SYMBOLS, that's
for a.out.
1994-01-19 00:21:59 +00:00
Ian Lance Taylor
8a432746ae Motorola Delta sysV68 support from phdm@info.ucl.ac.BE (Philippe
De Muyter).
	* configure.in (m68k-motorola-sysv*) New target.
	* config/delta68.mt: New file.
	* emulparams/delta68.sh: New file.
	* scripttempl/delta68.sc: New file.
	* Makefile.in (ALL_EMULATIONS): Added em_delta68.o.
	(em_delta68.c): New target.
1994-01-14 20:43:07 +00:00
Ian Lance Taylor
901f3538ee * scripttempl/elf.sc: Correct typo. 1994-01-11 18:22:51 +00:00
David MacKenzie
c344d88420 * ldgram.y, ldlex.l: Make the space between -e, -u, and -y and
their arguments optional, for compatibility with the old GNU ld.
1994-01-11 03:59:49 +00:00
Ian Lance Taylor
267a3ab363 * scripttempl/elf.c: Define __bss_start before the .sbss section. 1994-01-08 01:01:23 +00:00
Ian Lance Taylor
2f84ec0d97 Various entries. 1994-01-06 20:05:44 +00:00
Ian Lance Taylor
b9395be3af * ldmain.c (add_to_set): Add bitsize argument.
(constructor_callback): New function.
	(link_callbacks): Add constructor_callback.
	* ldctor.c (struct set_info): Add bitsize field.
	(ldctor_add_set_entry): Add bitsize argument.
	(ldctor_build_sets): Base the size of the elements of the set on
	the bitsize, rather than always using LONG.
	* ldctor.h (ldctor_add_set_entry): Add bitsize to declaration.
1994-01-06 20:04:26 +00:00
Ian Lance Taylor
c477527cbb * ld.h (QUAD_SIZE): Define.
* ldgram.y (QUAD): New token.
	(length): Handle it.
	* ldlex.l: Return QUAD.
	* lexsup.c (keywords): Add QUAD.
	* ldwrite.c (build_link_order): Handle QUAD.
	* ldlang.c (print_data_statement): Handle QUAD.
	(lang_size_sections): Likewise.
	(lang_do_assignments): Likewise.
	* ldexp.c (exp_print_token): Add QUAD to table.
	* ld.texinfo: Describe QUAD.
1994-01-06 19:38:36 +00:00
Ian Lance Taylor
3107eb5b38 * scripttempl/alpha.sc: Don't create .lit4 or .sdata sections,
since the Alpha doesn't use them.
1994-01-06 05:14:48 +00:00
David MacKenzie
080d8af095 * ldemul.h (ld_emulation_xfer_struct): Comment the members. 1994-01-06 01:57:11 +00:00
Rob Savoye
de9425a8db Add vsta.mt and vsta.sh. 1994-01-04 16:35:49 +00:00
Rob Savoye
8387f17d83 Support for VSTa micro-kernel. 1994-01-01 20:53:41 +00:00
David MacKenzie
23fdc6bebd clarify change 1994-01-01 19:20:16 +00:00
David MacKenzie
34f9bf4b3c * scripttempl/aout.sc: Pad .text to DATA_ALIGNMENT if relocating;
needed for i386mach.

	* emulparams/i386mach.sh (SEGMENT_SIZE): Fix again.
	(PAGE_SIZE): Don't define; not used.
1994-01-01 19:15:50 +00:00
Ian Lance Taylor
1d166443d4 * ldgram.y (yyerror): Make argument const char *, and actually
print it out rather than assuming it is a syntax error.
	* ldmisc.h: Change declaration of yyerror.
	* ldemul.c, ldwrite.c: Add /*ARGSUSED*/ as appropriate.
1993-12-31 21:17:33 +00:00
David MacKenzie
ae9c800701 * emulparams/i386mach.sh (NONPAGED_TEXT_START_ADDR): Don't include
exec header offset, since the exec header isn't loaded.
	(PAGE_SIZE, SEGMENT_SIZE): Agree with bfd/i386mach3.c.
1993-12-31 21:13:03 +00:00
David MacKenzie
4156620964 minor fixes 1993-12-31 21:08:12 +00:00
Ian Lance Taylor
93b135859d Removed files that are no longer used by the rewritten linker. 1993-12-30 19:57:49 +00:00
Ian Lance Taylor
4a6afc88bb A major rewrite to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
	files.
	* lderror.c, lderror.h, ldindr.c, ldindr.h, ldsym.c, ldsym.h,
	ldwarn.c, ldwarn.h, relax.c, relax.h: Removed.
	* ldctor.c, ldctor.h: Complete rewrite.
	* ldwrite.c, ldwrite.h: Complete rewrite.
	* ld.h (strip_symbols_type, strip_symbols): Removed.  Use
	link_info.strip instead.  Changed all uses.
	(discard_locals_type, discard_locals): Removed.  Use
	link_info.discard instead.  Changed all uses.
	(ld_config_type): Removed relocateable_output field; use
	link_info.relocateable instead; changed all uses.  Added stats
	field.
	(set_asymbol_chain, get_asymbol_chain, get_loader_symbol,
	set_loader_symbol): Removed.
	* ldexp.h (node_class): Added etree_rel.
	(etree_type): Added rel field.
	* ldexp.c (exp_print_token): Bracketed table initialization.
	(exp_relop): New function.
	(fold_name): Use linker hash table rather than ldsym functions.
	(exp_fold_tree): Likewise.  Also, handle etree_rel case.
	(exp_print_tree): Handle etree_rel.
	* ldgram.y (strip_symbols, discard_locals): Removed.
	(OPTION_stats, OPTION_no_keep_memory): New tokens.  Handle them.
	(REL): New token.  Does not appear in grammar, but needed for
	expression code.
	(file): Don't call lang_final; it's called by main anyhow.
	* ldlex.l: Accept -stats and -no-keep-memory options.
	* ldlang.h (fill_type): Make unsigned int, not unsigned short.
	* ldlang.c: Consistently use fill_type for fill argument.
	(lang_init_script_file, script_file): Removed.
	(create_object_symbols): Removed.  Use
	link_info.create_object_symbols_section instead.  Changed all
	uses.
	(lang_add_keepsyms_file): Removed.
	(lookup_name): Call bfd_link_add_symbols instead of
	ldmain_open_file_read_symbol.
	(wild): Don't iterate over script_file.
	(open_output): Create link hash table.
	(lang_place_undefineds): Rewrote.
	(lang_size_sections): Handle relaxing (doesn't work yet).
	(lang_relocate_globals): Removed.
	(lang_finish): Use link hash table rather than ldsym functions.
	(lang_common): Rewrote.
	(lang_one_common): New function.
	(ldlang_add_file): Add file to link_info.input_bfds list.  Set
	usrdata.
	(create_symbol): Removed.
	(lang_process): Don't call lang_init_script_file.  Call
	ldctor_build_sets rather than find_constructors.  Don't call
	lang_relocate_globals.
	(lang_abs_symbol_at_beginning_of): Rewrote.
	(lang_abs_symbol_at_end_of): Rewrote.
	* ldmain.c (had_y): Removed.
	(lprefix, lprefix_len): Removed; use link_info fields instead.
	Changed all uses.
	(multiple_def_count, commons_pending, undefined_global_sym_count,
	total_symbols_seen, total_files_seen): Removed.
	(link_callbacks, link_info): New variables.
	(main): Initialize link_info.  Don't call init_bfd_error_vector or
	ldsym_init.  Don't set now unused variables.  Handle -stats.
	(get_emulation): Removed obsolete and nonfunctional GNU960 code.
	(add_ysym): Rewrote.
	(read_entry_symbols, refize, enter_global_ref, enter_file_symbols,
	search_library, gnu960_check_format, decode_library_subfile,
	linear_library, symdef_library, clear_syms, subfile_wanted_p):
	Removed.
	(add_keepsyms_file, add_archive_element, multiple_definition,
	multiple_common, add_to_set, warning_callback, undefined_symbol,
	reloc_overflow, reloc_dangerous, unattached_reloc, notice_ysym):
	New functions.
	* ldmisc.c (vfinfo): Accept a string for %T, not a symbol.  Don't
	require symbols for %C; look them up instead.
	* emultempl/hppaosf.em: Pass link_info to
	hppa_look_for_stubs_in_section.
	* Makefile.in: Rebuilt dependencies.
	(CFILES): Removed lderror.c, ldindr.c, ldsym.c, ldwarn.c, and
	relax.c.
	(HFILES): Removed lderror.h, ldindr.h, ldsym.h, ldwarn.h, and
	relax.h.
	(EMULATION_OFILES): Depend on bfdlink.h, ldmain.h, ldexp.h,
	ldlang.h and ldctor.h.

	* Makefile.in (ldlex.c): Don't depend on ldgram.h.  Remove
	declarations of free and malloc from flex output.  Change malloc
	to ldmalloc in flex output.
1993-12-30 19:51:41 +00:00
Mark Eichin
f2f824ae57 * config/i386-linux.mt: delete ".sh" from genscripts argument
(change made to genscripts on July 21...)

This is all it took for linux-native ld to build. It isn't necessarily useful,
particularly as gcc is still configured to pass -m486 and -dll-verbose, which
this ld doesn't parse...
1993-12-27 19:39:55 +00:00
Jeff Law
93df4ec5fe * ldmain.c (lprefix): Change default from a char to a string
with only one character.
        (lprefix_len): Set default to one.

        * ldmain.h (lprefix_len): Declare.

        * ldsym.c (write_file_locals): Use strncmp rather than a character
        comparison for lprefix.

        * emultmpl/m88kbcs.em (before_parse): Set lprefix and lprefix_len
        correctly.

        * emultmpl/hppaosf.em: Include ldexp.h.
        (before_parse): Set lprefix and lprefix_len correctly.
1993-12-17 05:21:33 +00:00
Ian Lance Taylor
553b002162 * ldlex.h: Don't declare yywrap if it is a macro.
* ldlex.l: Include sysdep.h.
1993-12-14 22:34:41 +00:00
Ian Lance Taylor
498fbd3c56 * ldlang.c (lang_for_each_statement_worker,
lang_for_each_statement): Forgot to use PARAMS.
1993-12-14 22:20:35 +00:00
Ian Lance Taylor
1400cdc51d * Makefile.in: Added .PHONY targets where appropriate. Added some
comments.  Also:
	(gcclibdir, version): Removed unused variables.
	(DEP): New variable, set to mkdep.
	(ALL_CFLAGS): New variable.  Used in .c.o target.
	(CFILES, HFILES, GENERATED_CFILES, GENERATED_HFILES): New
	variables.
	(HEADERS, MANSOURCES, LDCSOURCES, GENERATED_SOURCES,
	GENERATED_HEADERS, LDSOURCES, BFD_SOURCES, SOURCES): Removed
	mostly obsolete variables.  Adjusted remaining uses.
	(DEF_EMUL): Removed variable.
	(ldmain.o): Handle undefined EMUL error correctly.
	(ldemul-list.h): Depend on config.status rather than Makefile.
	Create via temporary file.
	(ver960.c, roll, make): Removed obsolete targets.
	(.dep, .dep1, dep.sed, dep, dep-in): New targets.  Used to rebuild
	dependencies.
1993-12-13 19:46:45 +00:00
Ian Lance Taylor
f80837391e New file used for rebuilding dependencies. 1993-12-13 19:37:22 +00:00
Ian Lance Taylor
9f6294075e More gcc lint. 1993-12-12 00:54:14 +00:00
Ian Lance Taylor
fcf276c495 Made many changes to eliminate gcc warnings. Made various
cosmetic changes, declared various things in header files, removed
	various extern declarations from .c files.  No substantive
	changes.
1993-12-11 22:55:55 +00:00
Ian Lance Taylor
2c6635a46f * ldlang.c (lang_process): Ifdef out final call to
lang_size_sections again (reverting change of Nove 2), since it
	breaks the Sun4 linker.
1993-12-11 22:46:15 +00:00
Ian Lance Taylor
8e964b071d * ldgram.y (OPTION_Oval): New token.
(command_line_option): Accept and ignore it.
	* ldlex.l (<COMMAND>): Handle -On where n is a number.
1993-12-02 00:25:48 +00:00
Ken Raeburn
d05ac46bc6 * configure.in: Group targets by CPU. Merge some m68k target entries with
different CPU specs that use the same ld_target values.

* configure.in: Add sparc*-*-coff.
* config/coff-sparc.mt, emulparams/coff_sparc.sh: New files.
* Makefile.in (ALL_EMULATIONS): Add em_coff_sparc.o.
(em_coff_sparc.c): Add dependencies and build rules.
1993-12-01 22:14:05 +00:00
Ken Raeburn
9acba7e204 New file for bare sparc-coff support. 1993-12-01 22:12:20 +00:00
Ian Lance Taylor
f651733a12 * ldgram.y (OPTION_call_shared, OPTION_non_shared): New tokens.
(command_line_option): Accept and ignore them (for now).
	* ldlex.l (<COMMAND>): Handle -non_shared and -call_shared.
1993-12-01 17:22:03 +00:00
Ian Lance Taylor
2332114c71 * configure.in (mips*-sgi-irix5*): New target. Use mipsb-elf32.
* emulparams/elf32mipsb.sh (DATA_ADDR): Define.
	(OTHER_READONLY_SECTIONS): Define for .reginfo.
	(EXECUTABLE_SYMBOLS): Define for _DYNAMIC_LINK.
	* scripttempl/elf.sc: Use EXECUTABLE_SYMBOLS when not relocating.
	Move OTHER_READONLY_SECTIONS after all the other readonly
	sections.  Don't use DATA_ADDR twice.
1993-11-19 19:31:51 +00:00
Ian Lance Taylor
973e421e67 * ldmain.c (enter_file_symbols): Removed duplicate tests of p. If
p is in a common section, make sure the BFD has a section of that
	name.
1993-11-19 19:29:49 +00:00
Sean Eric Fagan
b4a79a1600 Use sun4sol2 for a target of sparc-netware. 1993-11-17 22:20:44 +00:00
Stan Shebs
dd3f0e5b7d More correct m68k LynxOS support 1993-11-12 00:37:00 +00:00
David Henkel-Wallace
b11b3aceb2 netware target support. 1993-11-08 14:28:46 +00:00
David MacKenzie
2ccb88c0d6 correct mach3 values 1993-11-06 05:51:14 +00:00
Ken Raeburn
1a9f0c717f adjusting repository after cvs mixup 1993-11-05 20:35:15 +00:00
Ken Raeburn
87ce76559c First cut at sanitization, doc files, &c for gas/binutils releases 1993-11-05 19:21:35 +00:00
Ken Raeburn
4ecfad7942 Fix up dependencies and rules for ld.dvi, ld.info. 1993-11-04 00:09:39 +00:00
Ken Raeburn
3c1af24dd5 * Makefile.in (distclean): Don't get rid of dvi or info files. 1993-11-03 23:09:24 +00:00
David MacKenzie
3c292c5a46 make -o override OUTPUT 1993-11-03 21:19:18 +00:00
Roland Pesch
8920addc82 Fixed minor typo ("host" sb "target" in discussion of GNUTARGET).
To my shame, this was reported 28 aug 92 by Jonathan Ryshpan, and lost
in my mail pile til now.
1993-11-03 00:09:34 +00:00
Jeff Law
f1f6b5e9cf * scripttempl/hppaosf.sc: (___stack_zero, etext, _etext,
edata, _edata, end): Add definitions of these symbols.
	(__end):  Remove definition of this symbol.
	(__data_start): Move definition of this symbol.
1993-11-02 23:59:24 +00:00
Jeff Law
5f62613e11 * emultempl/hppaosf.em: Various fixes and support for linker stub
generation.
        (hppaosf_finish, hppaosf_search_for_padding_statements,
        hppaosf_create_output_section_statements): New functions in
        support of linker stub generation.
        (ld_hppaosf_emulation):  Redefine to include new
        emulation-specific routines.
1993-11-02 23:55:58 +00:00
Jeff Law
9d9d72fcf5 * emultempl/hppaosf.em: Various fixes and support for linker stub
generation.
	(hppaosf_finish, hppaosf_search_for_padding_statements,
	hppaosf_create_output_section_statements): New functions in
	support of linker stub generation.
	(ld_hppaosf_emulation):  Redefine to include new
	emulation-specific routines.
1993-11-02 23:54:04 +00:00
Jeff Law
97fbbaca20 * ldlang.c (lang_process): Re-enable last call lang_size_sections.
Pass abs_output_section rather than NULL to avoid invalidating
        absolute symbols.
1993-11-02 23:47:41 +00:00
Stan Shebs
278d569a2a Keep Lynx file 1993-11-01 19:27:15 +00:00