Commit graph

260 commits

Author SHA1 Message Date
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
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
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
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
Ian Lance Taylor
42f62ead47 Various entries. 1994-02-17 20:56:49 +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
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
Jeff Law
f7d4f6f622 * Rename all "hppaosf" files to "hppaelf". 1994-02-08 00:32:33 +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
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
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
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
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
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
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
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
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