Commit graph

960 commits

Author SHA1 Message Date
Steve Chamberlain
467a038026 Wed Sep 14 12:49:12 1994 Steve Chamberlain (sac@jonny.cygnus.com)
* ldlang.c (lang_do_assignments): Make sure output statement
	has an attached bfd_section before trying to dereference it.
1994-09-14 20:45:43 +00:00
Ian Lance Taylor
31c271643b Tweak the new handling of function names. 1994-09-14 18:29:06 +00:00
Ian Lance Taylor
cc23cc69c5 * ldmisc.c (vfinfo): Handle %D as %C, but never print the function
name.  For %C, print the function name on a separate line, to keep
	the length of error messages under control.
	* ldmain.c (multiple_definition): Use %D for ``first defined
	here.''
	(undefined_symbol): Use %D for ``more undefined references
	follow''.
PR 3770.
1994-09-14 17:08:37 +00:00
Ian Lance Taylor
8bff41c1b7 * ldmisc.c (multiple_warn): Remove; no longer used.
* ldmisc.h (multiple_warn): Don't declare.
1994-09-14 16:50:19 +00:00
Steve Chamberlain
3deb20fbc1 * ldlang.c (print_output_section_statement): Print all lines
to the map file.
1994-09-14 04:55:00 +00:00
Ian Lance Taylor
0b3499f672 * ldlang.c (load_symbols): Check for archive before object. Use
bfd_check_format_matches, and, if ambiguous, print a list of
	matching formats.  If file format is not recognized, treat file as
	a linker script.
	* ldgram.y (yyerror): If assuming an object file is a script,
	mention that.  Tweak the format of the error messages.
	* ldlex.l (lex_warn_invalid): If assuming an object is a script,
	guess that this is not actually a script, and just report that the
	file format was not recognized.
	* ld.texinfo (Options): Admit that -( may be used more than once.
	Add note that unrecognized object files are now treated as linker
	scripts.

	* ldfile.c (ldfile_input_filename): Make const.
	(ldfile_assumed_script): New variable.
	(try_open): Change arguments types to const.
	(ldfile_find_command_file): Likewise.
	(ldfile_open_command_file): Likewise.  Also, set lineno to 1.
	* ldfile.h: Update declarations for ldfile.c changes.
	* ldlex.l: Include <ctype.h>.
	(file_name_stack): Change to be const char *.
	(lineno_stack): New static variable.
	(<<EOF>>): Set lineno as well as ldfile_input_filename.
	(lex_push_file): Make name argument const.  Initialize
	lineno_stack entry.
	(lex_redirect): Initialize lineno_stack entry.
	(lex_warn_invalid): Handle non printable characters nicely.
	* ldlex.h (lex_push_file): Declare second argument as const.

	* ldgram.y (ifile_p1): Recognize GROUP.
	* ldlex.l: Recognize GROUP.
	* ld.texinfo (Option Commands): Document GROUP.
1994-09-13 20:42:47 +00:00
Stan Shebs
177941a1c9 Merge in former supposed GM-specific bits 1994-09-13 00:20:31 +00:00
Stan Shebs
2b51073813 Remove supposedly (but not really) GM-specific bits 1994-09-13 00:18:55 +00:00
Ian Lance Taylor
2fd87dbc90 * config/m68klynx.mh: New file. 1994-09-12 21:06:35 +00:00
Jeff Law
cb2af5cfec * emultempl/hppaelf.em: Add newlines to the error messages. 1994-09-12 07:51:14 +00:00
Ian Lance Taylor
7b63ff7683 * config/i386lynx.mh: New file.
* scripttempl/i386lynx.sc: Don't put .ctors and .dtors in .text
	unless CONSTRUCTING.
1994-09-12 02:42:49 +00:00
Ian Lance Taylor
dd37f21531 * emulparams/elf32mipb.sh (TEMPLATE_NAME): Define as elf32.
(GENERATE_SHLIB_SCRIPT): Define as yes.
	(DYNAMIC_LINK): Define as false.
	* emultempl/elf32.em (gld${EMULATION_NAME}_before_parse):
	Initialize config.dynamic_link to DYNAMIC_LINK if it is defined.
	(gld${EMULATION_NAME}_place_orphan): Reset stat_ptr at end.
	* Makefile.in (eelf32mipb.c): Depend upon elf32.em rather than
	generic.em.
1994-09-10 20:04:17 +00:00
Steve Chamberlain
fa3539fe77 * scripttempl/h8500b.sc: Put rdata stuff into own segment. 1994-09-08 23:36:17 +00:00
Ian Lance Taylor
a864a26ecc * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Don't define;
.got section is now explicitly handled in elf.sc.
1994-09-08 17:26:27 +00:00
Ian Lance Taylor
82950a806a x 1994-09-07 03:57:59 +00:00
Ian Lance Taylor
1822664fe4 * scripttempl/m68kcoff.sc: Put .bss in data segment.
* scripttempl/h8300.sc: Change .stab and .stabstr to use a VMA of
	0, and to only be marked as NOLOAD if relocating.
	* scripttempl/h8500.sc, scripttempl/h8500b.sc: Likewise.
	* scripttempl/h8500c.sc, scripttempl/h8500m.sc: Likewise.
	* scripttempl/h8500s.sc, scripttempl/i386coff.sc: Likewise.
	* scripttempl/i386go32.sc, scripttempl/i386lynx.sc: Likewise.
	* scripttempl/m68kcoff.sc, scripttempl/m68klynx.sc: Likewise.
	* scripttempl/sh.sc, scripttempl/sparccoff.sc: Likewise.
	* scripttempl/sparclynx.sc: Likewise.
1994-09-07 03:57:09 +00:00
Ken Raeburn
318b02b6b9 ARM Acorn/RISCiX target and host patches from Richard Earnshaw 1994-09-05 10:53:00 +00:00
Ian Lance Taylor
3b21918aa6 * ld.h (args_type): Add field soname.
* lexsup.c (parse_args): Handle -soname argument.
	* emultempl/elf32.em: In call to bfd_elf32_size_dynamic_sections,
	pass soname.
	* ld.texinfo: Document -soname.
1994-08-30 16:04:19 +00:00
Ian Lance Taylor
69927008de * ldlang.c (lang_check): Don't try to set the architecture if the
input and output files are incompatible.  Just warn.
For Synoptics.
1994-08-29 19:24:48 +00:00
Ian Lance Taylor
6d4454364b * configure.in: Change i[34]86 to i[345]86. 1994-08-24 16:53:39 +00:00
Ian Lance Taylor
b400f56dbb Make the ELF linker handle orphaned sections reasonably. Also,
define __start_SECNAME and __stop_SECNAME around sections whose
	names can be represented in C, for the benefit of symbol sets in
	glibc.
	* ldemul.h (ldemul_place_orphan): Declare.
	(ld_emulation_xfer_type): Add place_orphan field.
	* ldemul.c (ldemul_place_orphan): New function.
	* ldlang.h (wild_doit): Declare.
	* ldlang.c (wild_doit): Make nonstatic.
	(lang_place_orphans): Call ldemul_place_orphan.
	* emultempl/elf32.em: Include <ctype.h> and "ldgram.h".
	(hold_section, hold_use, hold_text, hold_data, hold_bss): New
	static variables.
	(gld${EMULATION_NAME}_place_orphan): New static function.
	(gld${EMULATION_NAME}_place_section): New static function.
	(ld_${EMULATION_NAME}_emulation): Initialize place_orphan field.
1994-08-18 20:10:54 +00:00
Ian Lance Taylor
9e5a036f28 * scripttempl/aout.sc: Add .linux-dynamic after .data. 1994-08-16 04:19:32 +00:00
Ian Lance Taylor
c1a9aaa316 * Treat --dll-verbose as --version, for Linux compatibility. From
hjl@nynexst.com (H.J. Lu).
1994-08-16 04:10:03 +00:00
Ian Lance Taylor
1fee94ece0 * ldexp.h (exp_get_abs_int): Declare. 1994-08-15 21:18:48 +00:00
Jason Molenda
28d1c6ec8c Fri Aug 5 20:55:55 1994 Jason Molenda (crash@phydeaux.cygnus.com)
* configure.in: add i960-nindy-coff support.
1994-08-06 03:57:19 +00:00
Jean Marie Diaz
63936abc32 * ldlex.l (yy_create_string_buffer): Handle change to internal
interface in flex 2.4.7.
1994-08-04 18:56:04 +00:00
Jean Marie Diaz
bb329c2009 Tue Aug 2 11:52:06 1994 Eric Youngdale (ericy@cais.cais.com)
* emultempl/linux.em (gld${EMULATION_NAME}_find_address_statement):
	New function; add 0x20 to any use of -Ttext.
	(gld${EMULATION_NAME}_create_output_section_statements): New
	function.
	(ld_${EMULATION_NAME}_emulation): Use the new function
	gld${EMULATION_NAME}_create_output_section_statements.
1994-08-02 16:01:56 +00:00
Ian Lance Taylor
a1ed243577 * scripttempl/mips.sc: Redo script to set . outside of sections
and not bother to explicitly specify section addresses.
1994-08-01 19:55:21 +00:00
Ian Lance Taylor
b019d460d1 * scripttempl/elf.sc: Copy several more relocation sections into
the output.  Put .got.plt sections into .got.
1994-07-26 15:04:40 +00:00
Ian Lance Taylor
31ddb15694 * scripttempl/elf.sc: Use PROVIDE to define etext, edata, and end.
Add a new script operator, PROVIDE, to define a symbol only if it
	is needed.
	* ldgram.y (PROVIDE): New token.
	(assignment): Accept PROVIDE.
	* ldlex.l (PROVIDE): New token.
	* ldexp.h (node_type): Add etree_provide to node_class enum.
	(exp_provide): Declare.
	* ldexp.c (exp_fold_tree): Handle etree_provide.
	(exp_provide): New function.
	(exp_print_tree): Handle etree_provide.
	* ld.texinfo: Document PROVIDE.
1994-07-22 20:55:45 +00:00
Ian Lance Taylor
36c6e8c37f * ldlang.c (lang_common): Pass desired alignment to
lang_one_common as power of two.
	(lang_one_common): Get common symbol alignment from linker hash
	table entry.  Treat desired alignment as a power of two.
1994-07-22 18:46:28 +00:00
Ian Lance Taylor
309c8153fa * ldlang.c (wild_section): Attach all section with the given name,
not just the first one.  If there is no name, attach all sections
	even if the SEC_IS_COMMON flag is set.
1994-07-22 16:23:35 +00:00
Ian Lance Taylor
a1ad915dc4 * ld.h (args_type): Add field rpath.
* lexsup.c (S_ISDIR): Define if not already defined.
	(parse_args): Add support for -rpath.  If -R is used to name a
	directory, treat it as -rpath for Solaris compatibility.
	* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
	Pass command_line.rpath to bfd_elf32_size_dynamic_sections.
	* ldmain.c (main): Initialize command_line.rpath to NULL.
	* ld.texinfo: Document -rpath option.
1994-07-20 19:55:36 +00:00
Ken Raeburn
cdf7137776 ns32k port from Ian Dall 1994-07-14 19:20:53 +00:00
Ian Lance Taylor
db770dfa72 * lexsup.c (parse_args): Changed "retain-symbols-file" from
no_argument to required_argument.  From djm.
1994-07-08 15:06:29 +00:00
Jeff Law
aee611f53c * scripttempl/hppaelf.sc (__stack_zero): Don't define this name,
it was for the HPUX dynamic loader's use and it creates problems
	with ELF GDB.
1994-07-05 01:38:32 +00:00
Stan Shebs
10f1b5978b Elim dup of file names 1994-06-30 23:19:26 +00:00
Stan Shebs
8b50a709e9 Fix typo 1994-06-30 00:08:11 +00:00
Jean Marie Diaz
0373062441 * config/solaris2.mh (NATIVE_LIB_DIRS): Define as /usr/ccs/lib. 1994-06-29 21:18:47 +00:00
Jean Marie Diaz
111b24d572 * lexsup.c (parse_args): Accept -Bstatic and -Bdynamic. Do not
accept plain -B.
	* ld.texinfo: -Bstatic is not ignored.
1994-06-29 20:59:53 +00:00
Stan Shebs
22691fe7be * mpw-config.in (emulname): Set based on target.
(ldemul-list.h): Construct.
	* mpw-make.in (install-only): New target.
	(install): Depend on install-only.
1994-06-28 20:20:35 +00:00
Stan Shebs
83896c8b2b * mpw-xconfig.in: Remove ldemul-list.h construction, now in
generic config.
1994-06-28 20:16:32 +00:00
Stan Shebs
1c883f34fc * ldlex.l: Recognize \r the same as \n. 1994-06-28 19:16:24 +00:00
David MacKenzie
1f8b3b5746 Change --with-targets to --enable-targets, per GNU coding standards. 1994-06-23 20:08:57 +00:00
Ian Lance Taylor
cf4245afad * lexsup.c (parse_args): Add support for new options -( -) with
synonyms --start-group --end-group.
	* ldlang.h (enum statement_enum): Add lang_group_statement_enum.
	(lang_group_statement_type): Define new struct.
	(lang_statement_union_type): Add group_statement field.
	(lang_enter_group, lang_leave_group): Declare.
	* ldlang.c (lang_for_each_statement_worker): Handle
	lang_group_statement_enum.
	(map_input_to_output_sections, print_statement): Likewise.
	(lang_size_sections, lang_do_assignments): Likewise.
	(open_input_bfds): Completely rewrite.  Now does its own looping,
	rather than using lang_for_each_statement.  Handle groups.
	(lang_process): Update call to open_input_bfds.
	(print_group): New static function.
	(lang_enter_group, lang_leave_group): New static functions.
	* ldfile.c (ldfile_open_file): If the file has already been
	opened, just return rather than taking an assertion failure.
	* ldver.c (help): Mention new options.
	* ld.texinfo: Document new options.
1994-06-23 00:36:00 +00:00
Ian Lance Taylor
02b5798089 * ldlang.c (end_of_data_section_statement_list): Don't define.
(lang_leave_output_section_statement): Don't set obsolete variable
	end_of_data_section_statement_list.
1994-06-22 23:07:14 +00:00
Ian Lance Taylor
62a4b36c6b * scripttempl/go32coff.sc: Don't put ${DATA_ALIGNMENT} inside an
ALIGN.
1994-06-22 20:11:07 +00:00
Ian Lance Taylor
686739e2c6 * ldlang.c (lang_size_sections): Adjust current region address
even for sections with an explicit address.  From
	ralphc@pyramid.com (Ralph Campbell).
1994-06-22 20:04:29 +00:00
Ian Lance Taylor
7d56d4f1c6 * emulparams/i386linux.sh (NONPAGED_TEXT_START_ADDR): Set to 0.
From jrs@world.std.com (Rick Sladkey).
1994-06-22 18:07:32 +00:00
Ian Lance Taylor
3b7553e793 * scripttempl/mipsbsd.sc: Let sections align to their natural
boundaries.
1994-06-22 17:47:11 +00:00
Jeff Law
c4aa82c196 * scripttempl/hppaelf.sc: Place .data and .bss at 0x40000000
when generating relocatable objects.
1994-06-17 04:50:29 +00:00
Ken Raeburn
8e3b100c24 deleted code for keep-v9 that does nothing useful 1994-06-17 00:52:10 +00:00
Ian Lance Taylor
64887de2ee * lexsup.c (parse_args): Add -shared to longopts, and handle it.
* ldmain.c (main): Initialize link_info.shared to false.  Give
	error if link_info.relocateable and link_info.shared are both set.
1994-06-16 19:32:07 +00:00
Ian Lance Taylor
5d1ffb2fe3 * configure.in: If EMUL_EXTRA* is defined in a config file, treat
it as naming an emulation to be added to EMULATION_OFILES.
	* config/i386-linux.mt (EMUL_EXTRA1): Define as elf_i386.
1994-06-16 19:11:03 +00:00
Ian Lance Taylor
bf82ab6830 * Makefile.in: Rebuilt dependencies.
(ALL_EMULATIONS): Add ei386linux.o, eelf32_sparc.o,
	eelf64_sparc.o.  Remove $(OTHER_EMULATIONS).
	(ei386linux.c, eelf32_sparc.c, eelf64_sparc.c): New targets.
	* config/i386-linux.mt (OTHER_EMULATIONS): Don't define.
	(ei386linux.c): Remove; now in Makefile.in.
	* config/i386-lynx.mt (OTHER_EMULATIONS): Don't define.
	* config/m68k-lynx.mt (OTHER_EMULATIONS): Don't define.
	* config/sparc-lynx.mt (OTHER_EMULATIONS): Don't define.
	* config/sparc64-elf.mt (OTHER_EMULATIONS): Don't define.
	(eelf64_sparc.c): Remove; now in Makefile.in.
	* config/sun4sol2.mt (OTHER_EMULATIONS): Don't define.
	(eelf32_sparc.c): Remove; now in Makefile.in.
1994-06-16 19:01:48 +00:00
Ian Lance Taylor
08f20f66c4 Thu Jun 16 14:25:22 1994 Eric Youngdale (ericy@cais.cais.com)
* emultempl/linux.em: New file providing support for linking
	against Linux shared libraries.
	* config/i386-linux.mt (ei386linux.c): Depend upon linux.em.
	* emulparams/i386linux.sh (TEMPLATE_NAME): Define as linux.
1994-06-16 18:36:40 +00:00
Ian Lance Taylor
641fe79b46 * ldexp.c (exp_print_tree): Don't crash if etree_rel section has
no owner--it might be bfd_abs_section.  From Eric Youngdale
	<ericy@cais.cais.com>.
1994-06-16 16:32:03 +00:00
Ian Lance Taylor
952b6c2c8d * scripttempl/aout.sc: Let sections align to their natural
boundaries.
1994-06-16 16:23:19 +00:00
Ian Lance Taylor
33b90e5265 * ldemul.h (ldemul_open_dynamic_archive): Declare.
(ld_emulation_xfer_type): Add new field open_dynamic_archive.
	* ldemul.c: Include ldexp.h and ldlang.h.
	(ldemul_open_dynamic_archive): New function.
	* ldfile.h (ldfile_open_file_search): Declare.
	* ldfile.c: Include ldemul.h.
	(try_open_bfd): Rename from cache_bfd_openr.  Return boolean
	argument, not bfd *.  Change all callers.
	(ldfile_open_file_search): Rename from open_a.  Return boolean
	argument, not bfd *.  Clean up.  Change all callers.
	(ldfile_open_file): If doing a dynamic link, call
	ldemul_open_dynamic_archive rather than assuming the extension of
	a dynamic object is ".so".
	* emultempl/elf32.em (gld${EMULATION_NAME}_open_dynamic_archive):
	New function.
	(ld_${EMULATION_NAME}_emulation): Initialize open_dynamic_archive
	field.
	* emultempl/sunos.em (ld_${EMULATION_NAME}_emulation): Likewise.
1994-06-15 23:49:01 +00:00
Ian Lance Taylor
ece5b08d17 Comment fix. 1994-06-15 21:23:28 +00:00
Ian Lance Taylor
4279241152 * lexsup.c (parse_args): Accept -static as a synonym for
-non_shared.
1994-06-15 21:22:43 +00:00
Ian Lance Taylor
cbbf960822 * ldmain.c (get_emulation): Ignore -m486 for Linux compatibility.
* lexsup.c (parse_args): Ignore -qmagic for Linux compatibility.
1994-06-15 21:04:21 +00:00
Ian Lance Taylor
7fb9ca5fc2 Let the user change the dynamic linker used by ELF code.
* ld.h (args_type): Add new field interpreter.
	* lexsup.c (parse_args): Add dynamic-linker to longopts, and
	handle it.
	* ldmain.c (main): Initialize command_line.interpreter to NULL.
	* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Get
	the ELF backend to return the .interp section.  If
	command_line.interpreter is not NULL, set the contents of .interp
	to it.
	* ld.texinfo: Mention -dynamic-linker.
1994-06-15 20:46:43 +00:00
Ian Lance Taylor
57569ce8d1 * config/sun4sol2.mt (eelf32_sparc.c): Depend upon elf32.em, not
generic.em.
1994-06-15 20:44:54 +00:00
Ian Lance Taylor
bec7a138ab * lexsup.c (parse_args): Sort out the option macros and change the
definitions to make it easier to add a new option.
1994-06-15 17:55:46 +00:00
Ian Lance Taylor
66da6c8470 * scripttempl/aout.sc: Define __etext and __edata to go along with
_etext and _edata.
1994-06-15 16:17:48 +00:00
Ian Lance Taylor
605da7e26f * ldver.c (help): Mention -traditional-format. 1994-06-15 16:01:17 +00:00
Ian Lance Taylor
c96386c4d8 * ld.h (ld_config_type): Add new field traditional_format.
* lexsup.c (parse_args): Add traditional_format to longopts, and
	handle it.
	* ldmain.c (main): Initialize config.traditional_format to false.
	* ldlang.c (ldlang_open_output): Set BFD_TRADITIONAL_FORMAT in BFD
	flags of output_bfd according to config.traditional_format.
	* ld.texinfo: Document -traditional-format.
1994-06-15 06:01:45 +00:00
Ian Lance Taylor
7fe331f17b * ldctor.c (ldctor_add_entry): Add entries to a set in the order
they are encountered.
1994-06-15 03:12:42 +00:00
Ian Lance Taylor
39a00f7d5a Tue Jun 14 18:05:09 1994 Eric Youngdale (ericy@cais.cais.com)
* emulparams/i386linux.sh (TEXT_START_ADDR): Define as 0x1000.
	(NONPAGED_TEXT_START_ADDR): Define as 0x20.
1994-06-14 22:07:40 +00:00
Ian Lance Taylor
236772170b * scripttempl/alpha.sc: Define _ftext, _etext and _fdata insted of
_FTEXT, _ETEXT and _FDATA.  Dont define _END.
1994-06-13 22:34:46 +00:00
Ian Lance Taylor
e845d28994 * ldfile.c (open_a): If this is not an archive, try to open it in
the current directory before searching for it.
1994-06-13 21:35:27 +00:00
Ian Lance Taylor
3e1fd33d8a * lexsup.c (parse_args): Treat -i as a synonym for -r. 1994-06-13 21:00:20 +00:00
Ian Lance Taylor
f24078fd07 * ldgram.y (exp): Treat BLOCK as a synonym for ALIGN, so that
BLOCK works in a section address as documented.
1994-06-13 20:25:28 +00:00
Ian Lance Taylor
eb7edfa156 * ldgram.y (YYDEBUG): Don't define. 1994-06-13 19:47:50 +00:00
Stan Shebs
9d5baff61b Conditionalize on mips-idt-ecoff. 1994-06-12 23:59:15 +00:00
Ian Lance Taylor
6beb80b22f Don't sanitize out SPARC v9 stuff. 1994-06-10 21:22:31 +00:00
Ian Lance Taylor
5cad5873e0 Restore sparc64 targets clobbered in 1994/04/07 checkin. 1994-06-10 21:19:49 +00:00
Ian Lance Taylor
f8015b8526 * emultempl/gld960.em: Pass false for new argument to
ldfile_add_library_path.
	* emultempl/gld960c.em, emultempl/lnk960.em: Likewise.
1994-06-10 20:48:41 +00:00
Ian Lance Taylor
b6ef97506c * emultempl/sunos.em: Only look for .so files if doing a dynamic
link.
1994-06-10 20:46:42 +00:00
Ian Lance Taylor
9beeb5d9e5 * scripttempl/i960.sc: Add CONSTRUCTORS to .data. 1994-06-09 15:39:33 +00:00
Bill Cox
64bb143c6b * Makefile.in (check): Delete ld.new dependency so that a regression
test doesn't trigger a rebuild of the linker.
1994-06-09 13:54:28 +00:00
Ian Lance Taylor
ef01a8a873 * ldlang.c (map_input_to_output_sections): For lang_address, call
init_os if it hasn't already been called.
1994-06-09 04:18:39 +00:00
Ian Lance Taylor
fb5b11ee01 Rebuilt dependencies. 1994-06-03 00:09:21 +00:00
Ian Lance Taylor
f7e66391df Use SunOS shared libraries on a Sun 3. 1994-06-02 23:55:50 +00:00
Ian Lance Taylor
2f4b5b5302 Correct handling of .sa file. 1994-06-02 23:54:37 +00:00
Ian Lance Taylor
ed601bea1c Add support for SunOS shared libraries.
* aout.sc: Don't define __DYNAMIC here.  Add new sections used by
	shared library support code.
	* emultempl/sunos.em: New file.
	* emulparams/sun4.sh (TEMPLATE_NAME): Define as sunos.
	* Makefile.in (esun4.c): Depend upon sunos.em, not generic.em.
1994-06-02 22:01:53 +00:00
Ian Lance Taylor
a4d2a48e42 * ldlang.c: Minor formatting cleanups.
(lang_for_each_input_file): New function.
	* ldlang.h (lang_for_each_input_file): Declare.
1994-06-02 21:31:40 +00:00
Ian Lance Taylor
0cd82d00da * ldfile.h (search_dirs_type): Move from ldfile.c, and add cmdline
field.
	(search_head): Declare.
	(ldfile_add_library_path): Add new cmdline argument in prototype.
	* ldfile.c (search_head): Make non-static.
	(search_dirs_type): Move to ldfile.h.
	(ldfile_add_library_path): Accept cmdline argument, and save it.
	* lexsup.c (parse_args): Pass true for new cmdline argument of
	ldfile_add_library_path.
	(set_default_dirlist): Likewise.
	* ldmain.c (check_for_scripts_dir): Pass false for new cmdline
	argument of ldfile_add_library_path.
	* ldgram.y (ifile_p1): Likewise.
1994-06-02 21:30:57 +00:00
Ian Lance Taylor
210c52ac91 * ldlang.h (lang_input_statement_type): Remove fields subfiles,
total_size, superfile and chain.
	* ldfile.c (open_a): Don't clear search_dirs_flag.
	(ldfile_open_file): Don't try to open superfile.  Assert that file
	has not already been opened.
	* ldlang.c (new_afile): Don't initialize superfile.
	* ldmain.c (add_archive_element): Don't initialize subfiles or
	chain or superfile.  Initialize search_dirs_flag to false.
1994-06-01 18:28:26 +00:00
Ken Raeburn
c06e55d99a changes from gas-2.3/binutils-2.4 dist (details in branch log msgs, changelogs) 1994-05-27 16:58:05 +00:00
Ian Lance Taylor
60e8a53407 * ldlang.c (entry_symbol): Make static.
(lang_add_entry): Add cmdline argument.
	* ldlang.h (lang_add_entry): Change prototype.
	* ldgram.y (statement_anywhere): Change lang_add_entry call.
	* lexsup.c (parse_args): Likewise.
1994-05-27 15:39:11 +00:00
Ian Lance Taylor
29371b1feb * ldlang.c (lang_add_entry): Only set the entry symbol if it has
not been set already.
1994-05-27 05:09:31 +00:00
Ian Lance Taylor
f49f58c6a8 * emulparams/elf32mipb.sh (OTHER_READONLY_SECTIONS): Don't give
.reginfo an address.
	(OTHER_READWRITE_SECTIONS): Don't give .lit4 or .lit8 an address.
	(OTHER_SECTIONS): Define for .gptab.sdata and .gptab.sbss.
	* scripttempl/elf.sc: Use OTHER_SECTIONS at end of script.
1994-05-24 20:21:27 +00:00
Ian Lance Taylor
eb8f714f21 Remove sanitization of PowerPC NetWare 1994-05-20 18:25:30 +00:00
Ian Lance Taylor
2a9fa50cd8 Add support for ELF shared libraries.
* ld.h (ld_config_type): Add field dynamic_link.
	* ldmain.c (main): Initialize config.dynamic_link to false.  Warn
	on attempts to use -r with -relax, -call_shared or -s.
	* lexsup.c (longopts): Separate OPTION_CALL_SHARED from
	OPTION_NON_SHARED.  Add OPTION_IGNORE.  Adjust macro values
	accordingly.  Add "dy" and "non_shared" options.  Change "Qy" to
	OPTION_IGNORE for now.  Handle OPTION_CALL_SHARED and
	OPTION_NON_SHARED by setting dynamic_link field accordingly.
	Handle OPTION_IGNORE by ignoring it.  Clear dynamic_link field for
	-r and -Ur.
	* ldfile.c (ldfile_open_file): If config.dynamic_link is true, try
	opening a file with a .so extension first.
	* emultempl/elf32.em: New file.
	* emulparams/elf32_sparc.sh (TEXT_START_ADDR): Change to 0x10000.
	(NONPAGED_TEXT_START_ADDR): Likewise.
	(TEMPLATE_NAME): Define as elf32.
	(DATA_PLT): Define.
	* emulparams/elf_i386.sh (TEMPLATE_NAME): Define as elf32.
	* scripttempl/elf.sc: Add placement for new dynamic sections.
	Don't use CREATE_OBJECT_SYMBOLS.  Define _etext, _edata and _end
	outside of any section.  Don't use ALIGN(8); just let one section
	VMA follow another.  Put .dynbss in .bss.  Don't mention debugging
	sections; they'll be handled correctly anyhow.
	* Makefile.in (eelf_i386.c): Depend upon elf32.em, not generic.em.
1994-05-19 18:25:10 +00:00
Ian Lance Taylor
188ce70585 * Makefile.in (install): Redirect output of ln to /dev/null. 1994-05-18 17:18:23 +00:00
Bill Cox
2a12627b21 * ld.bootstrap/bootstrap.exp, lib/ld.exp: Replace error proc
calls with perror calls.
1994-05-17 22:40:29 +00:00
Jeff Law
4bd5c39f5c * emultempl/hppaelf.em: Change all references of
.hppa_linker_stubs to .PARISC.stubs.
	* scripttempl/hppaelf.sc: Likewise.
1994-05-16 19:38:39 +00:00
Ian Lance Taylor
269773c1a9 * ldlang.c (print_output_section_statement): Change ``no attached
output section'' message slightly.
	(lang_do_assignments): Don't recurse down if there is no real
	section.
1994-05-13 18:01:59 +00:00
Ian Lance Taylor
439a3604ae * config/i386-linux.mt (OTHER_EMULATIONS): Change em_ to e to
match corresponding change in emulation templates.
	* config/i386-lynx.mt, config/m68k-lynx.mt: Likewise.
	* config/sparc-lynx.mt, config/sun4sol2.mt: Likewise.
1994-05-13 17:06:49 +00:00
Ken Raeburn
7e16be786a note name change of cdtest-bar.cc 1994-05-11 23:49:35 +00:00
Ken Raeburn
76a1b604a6 8.3 name fixes: ld.cdtest/cdtest-func.cc -> cdtest-bar.cc 1994-05-11 23:49:21 +00:00
Ken Raeburn
82ebe9a274 * ldver.c (ldversion): Updated version number.
* cdtest-foo.cc: Use explicit "#pragma implementation".
* cdtest-bar.cc: Renamed from cdtest-func.cc.
* Makefile.in: References to cdtest-func.o changed to cdtest-bar.o.
1994-05-11 23:10:34 +00:00
Ian Lance Taylor
f9d3d71ae8 Don't create unnecessary output sections.
* ldlang.c (out_bfd_get_section_by_name): Remove.
	(wild_section): Call bfd_get_section_by_name rather than
	our_bfd_get_section_by_name.  Don't call wild_doit if there is no
	section.
	(lang_create_output_section_statements): Remove.
	(map_input_to_output_sections): For several cases, call init_os if
	it has not already been called.
	(lang_size_sections): If output section was not created, skip it.
	(lang_process): Don't call lan_create_output_section_statements.
	(lang_place_orphans): Skip files with just_syms_flags set to true.
	* ld.texinfo: Document change.
1994-05-11 20:29:21 +00:00
Ian Lance Taylor
27f7237eca * ldlang.c (wild_doit): Don't bother initializing the vma and
section size.  Don't special case SEC_SHARED_LIBRARY.
	(lang_size_sections): Handle SEC_COFF_SHARED_LIBRARY sections
	specially.
1994-05-10 18:33:44 +00:00
Ian Lance Taylor
c1124600ad Remove Delta68 support. Could not get copyright assignment for it.
From now on, I'll get that first.
1994-05-09 16:36:38 +00:00
Ken Raeburn
7009748cab keep gld960c.em 1994-05-08 05:38:24 +00:00
Ken Raeburn
c610b46c54 keep gld960coff.sh 1994-05-08 05:37:58 +00:00
Ken Raeburn
e5793ca025 deal with file renaming, new files 1994-05-08 05:37:17 +00:00
Steve Chamberlain
6149af094e support for Xgo32X. 1994-05-06 19:27:57 +00:00
Steve Chamberlain
90f2ba0625 * config/go32.mh : New file for Xgo32X. 1994-05-06 19:25:31 +00:00
Ian Lance Taylor
5acce559f4 * ldfile.c (ldfile_open_command_file): Set bfd_error_system_call
before calling einfo, since we are reporting an fopen failure.
	From jrs@world.std.com (Rick Sladkey).
1994-05-06 19:21:00 +00:00
Ian Lance Taylor
f6671f28a4 * configure.in: Use "e" rather than "em_" as prefix for
emulations.
1994-05-06 19:16:30 +00:00
Ken Raeburn
6e1e82a0be em_->e, mips-idtl->mipsl-idt name changes 1994-05-06 06:55:54 +00:00
Ken Raeburn
38cae0cd30 * emultempl/generic.em: Use "e" rather than "em_" as prefix for filename.
* emultempl/gld960.em, emultempl/gld960c.em, emultempl/lnk960.em,
emultempl/hppaelf.em, emultempl/m88kbcs.em, emultempl/vanilla.em: Ditto.
* Makefile.in: Changed all generated file names.
(ldemul-list.h): Depend on Makefile, not config.status.  Changed sed patterns
to handle new filenames.
1994-05-06 06:55:35 +00:00
Ken Raeburn
97dc4cf850 * config/mipsl-idt.mt: Renamed from mips-idtl.mt.
* configure.in: Adjusted.
1994-05-06 06:54:15 +00:00
Ken Raeburn
db4a85f981 * emulparams/gld960coff.sh: New file.
Patches from Ralph Campbell:
* emulparams/mipsbsd.sh (OUTPUT_FORMAT): Fix name to have `a.out'
instead of `aout'.
1994-05-06 00:40:18 +00:00
Ken Raeburn
7182a4df5d * config/cf-h8300h.mt: Renamed from coff-h8300h.mt, to make it unique in 8.3.
* config/i960coff.mt: New file.

Patches from Ralph Campbell:
* config/mipsbsd.mh: New file.
1994-05-06 00:39:32 +00:00
Ian Lance Taylor
0573a3b135 * config/m68k.mt (EMUL): Set to m68kaout.
* emulparams/m68kaout.sh: New file.
	* Makefile.in (ALL_EMULATIONS): Add em_m68kaout.o.
	(em_m68kaout.c): New target.
1994-05-04 20:22:15 +00:00
Ian Lance Taylor
269ec825af For PR 4906.
* ldlang.c (lang_size_sections): If dot moves because of an
	assignment, don't try to insert a pad into the absolute output
	section, just change the address of the default memory region
	instead.
1994-05-04 16:14:00 +00:00
Ian Lance Taylor
083038a72a * Makefile.in (mostlyclean): Remove cdtest.tmp, cdtest-ur,
cdtest-ur.out, and cdtest-ur.tmp.
1994-05-04 16:00:30 +00:00
Stan Shebs
89464c7a1d Keep Lynx linker scripts. 1994-05-02 22:51:34 +00:00
Bill Cox
ea68d58d4e Back-migrate minor changes in these files from 94Q1 progressive into devo:
dejagnu/ChangeLog, dejagnu/Makefile.in,
	dejagnu/example/calc/Makefile.in, dejagnu/lib/remote.exp,
	dejagnu/testsuite/Makefile.in,
	dejagnu/testsuite/runtest.all/options.exp,
	gcc/testsuite/config/unix.exp, gdb/testsuite/Makefile.in,
	ld/ChangeLog, newlib/testsuite/ChangeLog, texinfo/testsuite/ChangeLog
1994-04-28 21:49:40 +00:00
Ian Lance Taylor
e6d84626b4 * scripttempl/sa29200.sc: Align all sections to four byte
boundaries.
1994-04-27 20:04:55 +00:00
Steve Chamberlain
6c86b9ff98 * Makefile.in, configure.in: Support for go32 coff.
* config/i386-go32.mt: New file
	* emulparams/i386go32.sh: New file
	* scripttempl/i386go32.sc: New file
1994-04-27 17:52:13 +00:00
Stan Shebs
028f887219 Tue Apr 26 17:20:03 1994 Stan Shebs (shebs@andros.cygnus.com)
* Makefile.in (em_m68klynx.c, em_i386lynx.c, em_sparclynx.c): Use
	Lynx-specific script templates.
	* configure.in (sparclite*-*-coff): Use coff-sparc.
	* emulparams/i386lynx.sh (SCRIPT_NAME): Set to i386lynx.
	* emulparams/sparclynx.sh (SCRIPT_NAME): Set to sparclynx.
	(ENTRY): Set to __main.
	* scripttempl/i386lynx.sc: New file, script for I386 Lynx.
	* scripttempl/m68klynx.sc: Add insertion of ctor/dtor sections.
	* scripttempl/sparclynx.sc: New file, script for uSparc Lynx.
1994-04-27 00:31:11 +00:00
Ian Lance Taylor
c435aba810 * scripttempl/mips.sc: Force _gp and .lit8 to be aligned to a 16
byte boundary, in case the global constructors do not take up an
	even 16 bytes.
1994-04-26 21:49:45 +00:00
Ian Lance Taylor
cde7350107 * config/i386v4.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-26 16:42:52 +00:00
Ian Lance Taylor
feaa9c4bda * ldlang.c (lang_size_sections): When no address is given for a
section, align it according to its requirements.
1994-04-25 19:28:58 +00:00
Ian Lance Taylor
1e45c4c38e * Makefile.in (clean, distclean): Remove configdoc.texi. 1994-04-21 21:25:17 +00:00
Bill Cox
9ad75873fa * configure.in: Add recognition of i[34]86-*-bsd386. 1994-04-19 19:14:15 +00:00
Ian Lance Taylor
9d87af5697 * ldlang.c (lang_size_sections): When relaxing, adjust the
position of a padding statement, and adjust dot accordingly.
1994-04-15 18:37:05 +00:00
Ian Lance Taylor
b22034745a There is no interesting Irix 5, or PowerPC, or RS/6000 support in the
linker, so don't mention them.
1994-04-14 04:02:34 +00:00
Bill Cox
099c286e74 * Makefile.in (check): Set TCL_LIBRARY for runtest. 1994-04-11 23:17:18 +00:00
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