Commit graph

76 commits

Author SHA1 Message Date
Ian Lance Taylor
9ae9e58254 * emultempl/m88kbcs.em: Remove.
* emulparams/m88kbcs.sh (TEMPLATE_NAME): Don't set.
	* Makefile.in (em88kbcs.c): Depend upon generic.em rather than
	m88kbcs.em.
1997-02-28 04:17:50 +00:00
Ian Lance Taylor
e87b950c8e * emultempl/sunos.em: Include <ctype.h>.
(gld${EMULATION_NAME}_find_so): Skip the directory name when
	searching for ".so.".
	(gld${EMULATION_NAME}_search_dir): Make sure that the library name
	has a version number, and that only version numbers follow .so.
1997-01-30 16:33:36 +00:00
Ian Lance Taylor
d0d5edba84 * emultempl/gld960c.em: Include <ctype.h>.
(gld960_set_output_arch): Get the machine type from the -A option
	if there is one, rather than always using core.
PR 11255.
1996-12-12 22:06:51 +00:00
Ian Lance Taylor
12436407d1 * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
use hold_rel unless SEC_ALLOC is set for the reloc section.
	(gld${EMULATION_NAME}_place_section): Only set hold_rel if
	SEC_ALLOC is set.
PR 11174.
1996-12-05 18:47:22 +00:00
Ian Lance Taylor
d0d63887aa * emultempl/pe.em (set_pe_subsystem): When setting the subsystem
to windows, set the entry point.
1996-10-09 03:27:41 +00:00
Geoffrey Noer
417fe276e3 Wed Oct 2 23:45:25 1996 Geoffrey Noer <noer@cygnus.com>
* emultmpl/pe.em: increase size of stack reserve to 0x2000000
        (necessary in order to compile parse.c in gcc sources under NT)
1996-10-03 06:55:39 +00:00
Ian Lance Taylor
888b0b2fa0 Mon Jul 15 11:49:49 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Round
 	the value of __start_SECNAME to the alignment required by the
 	section to be placed.
1996-07-15 15:58:00 +00:00
David Edelsohn
fe6e29571a * ldlang.c (wild_doit): Don't copy over SEC_LINK_{ONCE,DUPLICATES}
if final link.
	* emultempl/pe.em (sfunc): Renamed to sort_by_file_name.
	(sort_by_section_name, sort_sections_1): New functions.
	(sort_sections): Only sort by file name sections in .idata.
	Add "Grouped Sections" support.
	(gld${EMULATION_NAME}_place_orphan): Rewrite to support Grouped
	Sections.
	(gld${EMULATION_NAME}_place_section): Delete.
	* scripttempl/pe.sc (.text,.data,.rdata): Add *(.foo\$).
	(.CRT,.rsrc): Rewrite to use Grouped Section support.
1996-05-22 19:09:32 +00:00
David Edelsohn
a1613b5f35 * scripttempl/pe.em (gld${EMULATION_NAME}_place_orphan): New function.
(gld${EMULATION_NAME}_place_section): New function.
	(hold_{section,use,text,rdata,data}): New static locals.
	(ld_${EMULATION_NAME}_emulation): Update orphan field.
1996-05-07 17:58:43 +00:00
Ian Lance Taylor
6cc7365e2b * emultempl/elf32.em (gld${EMULATION_NAME}_check_ld_so_conf): New
static function, if ${host} = ${target}.
	(gld${EMULATION_NAME}_after_open): Call check_ld_so_conf to find a
	needed shared library if ${host} = $[target}.
1996-04-05 21:22:31 +00:00
Ian Lance Taylor
169df8d594 * emultempl/elf32.em (gld${EMULATION_NAME}_check_needed): Check
the SONAME if it is available.
	(gld${EMULATION_NAME}_stat_needed): Use the SONAME, not the
	filename, when checking for conflicting library versions.  Don't
	assume that the suffix is only numbers and dots.
1996-02-19 17:40:42 +00:00
Ian Lance Taylor
db3bfcd64c * emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Strip
`:foo' from ${ARCH}.
1996-02-14 16:10:18 +00:00
Ian Lance Taylor
625489271d * emultempl/elf32.em (gld${EMULATION_NAME}_stat_needed): Warn if
it looks like we might be linking in two different versions of the
	same shared library.  Based on a patch from H J Lu <hjl@zoom.com>.
1996-02-13 19:05:38 +00:00
Ian Lance Taylor
0bc9a7d2fb * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation):
Don't make a shared library because of an undefined reference to
	__GLOBAL_OFFSET_TABLE_.
1996-01-15 22:38:22 +00:00
Steve Chamberlain
d42799374f * emultempl/pe.em (gld_${EMULATION_NAME}_before_allocation):
sort using right pointer.
1996-01-05 22:09:43 +00:00
Ian Lance Taylor
67cf67787d * emultempl/aix.em (gld${EMULATION_NAME}_after_open): Only set
relocateable before calling ldctor_build_sets if the output file
	is in an XCOFF format.
1995-12-19 22:36:03 +00:00
Ian Lance Taylor
97121c41e9 * emultempl/aix.em (gld${EMULATION_NAME}_before_allocation): Add
new local variable special_sections, and pass it to
	size_dynamic_sections.  Look through the results, and move the
	sections around in the mapping so that they are defined correctly.
1995-11-09 18:11:03 +00:00
Ian Lance Taylor
2a80ec10a8 * emultempl/aix.em: Include ldgram.h.
(gld${EMULATION_NAME}_parse_args): Handle -pD and -pT, as used on
	AIX 4.1.
	* Makefile.in ($(EMULATION_OFILES)): Depend upon ldgram.h.
1995-11-01 16:46:19 +00:00
Ian Lance Taylor
d29120d2ff really make import_file static 1995-10-31 20:28:25 +00:00
Ian Lance Taylor
5666490bee * emultempl/aix.em (export_files): Remove.
(import_files): Make static.
	(struct export_symbol_list): Define.
	(export_symbols): New static variable.
	(gld${EMULATION_NAME}_parse_args): Handle an initial -b option
	correctly.  Call read_file for an export file.
	(gld${EMULATION_NAME}_before_allocation): Call
	bfd_xcoff_export_symbol for each export symbol, rather than
	calling read_file for each export file.
	(gld${EMULATION_NAME}_read_file): For an export file, make the
	exported symbols undefined, and store them on the export_symbols
	list.
1995-10-31 17:39:55 +00:00
Steve Chamberlain
2543860d19 Sat Oct 28 00:10:03 1995 steve chamberlain <sac@slash.cygnus.com>
* emultempl/pe.em (gld_${EMULATION_NAME}_parse_args):
	Don't hang if last option is unrecognised.
	(gld_${EMULATION_NAME}_set_symbols): Insert created
	symbols into ABS output section.
1995-10-28 07:26:10 +00:00
Ian Lance Taylor
cf79773cb1 * emultempl/aix.em: Include ldctor.h.
(gld${EMULATION_NAME}_after_open): New static function.
	(gld${EMULATION_NAME}_before_allocation): Call find_relocs.
	(gld${EMULATION_NAME}_find_relocs): New static function.
	(gld${EMULATION_NAME}_find_exp_assignment): New static function.
	(ld_${EMULATION_NAME}_emulation): Use new after_open function.
	* scripttempl/aix.sc: Use CONSTRUCTORS in .data.
	* ldctor.c (struct set_info): Move definition into ldctor.h.
	(struct set_element): Likewise.
	(sets): Make non-static.
	(ldctor_add_set_entry): Add name parameter.  Save it in the new
	set element.
	(ldctor_build_sets): Avoid being called twice.  Pass set element
	name to lang_add_reloc.
	* ldctor.h (struct set_info): Move definition here from ldctor.c.
	(struct set_element): Likewise.  Add new field name.
	(sets): Declare.
	(ldctor_add_set_entry): Declare new name parameter.
	* ldwrite.c (build_link_order): Don't insist that either name or
	section be NULL in a lang_reloc_statement.
	* ldmain.c (add_to_set): Pass NULL to ldctor_add_new_set_entry for
	new name parameter.
	(constructor_callback): Pass name to ldctor_add_new_set_entry for
	new name parameter.
1995-10-27 22:21:43 +00:00
Ian Lance Taylor
c7c8b500b9 * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Treat
-static as a synonym for -bnso.
1995-10-27 01:59:30 +00:00
Ian Lance Taylor
1764521ffe tweak option handling 1995-10-25 17:37:35 +00:00
Ian Lance Taylor
57fc1e90b7 * emultempl/aix.em: Add support for various AIX linker options,
for AIX import and export files, and for AIX shared objects.
	* scripttempl/aix.sc: Add .pad.  Put .ds just before the TOC.
1995-10-25 15:49:27 +00:00
Ian Lance Taylor
235c6a672f * emultempl/sunos.em (gld${EMULATION_NAME}_find_so): Move
directory searching code into gld${EMULATION_NAME}_search_dir.
	(gld${EMULATION_NAME}_search_dir): New static function, extracted
	from gld${EMULATION_NAME}_find_so.
	(global_needed, global_found): New static variables.
	(gld${EMULATION_NAME}_after_open): New static function.
	(gld${EMULATION_NAME}_search_needed): New static function.
	(gld${EMULATION_NAME}_try_needed): New static function.
	(gld${EMULATION_NAME}_check_needed): New static function.
	(ld_${EMULATION_NAME}_emulation): Use new after_open function.
	* ld.texinfo, ld.1: Mention -rpath-link on SunOS.
1995-10-17 22:36:25 +00:00
Ian Lance Taylor
b5f076d4aa * configure.tgt (powerpc-*-aix*): New target; use aixppc.
(rs6000-*-aix*): New target; use aixrs6.
	* emulparams/aixppc.sh, emulparams/aixrs6.sh: New files.
	* emultempl/aix.em: New file.
	* scripttempl/aix.sc: New file.
	* Makefile.in (ALL_EMULATIONS): Add eaixppc.o and eaixrs6.o.
	(eaixppc.c, eaixrs6.c): New targets.
1995-10-16 23:19:04 +00:00
Ian Lance Taylor
776f259038 * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Don't
bother searching for needed libraries unless doing a final link.
1995-10-07 21:09:57 +00:00
Ian Lance Taylor
8055e7a883 * emultempl/elf32.em (global_stat): New file static variable.
(gld${EMULATION_NAME}_try_needed): Call stat_needed to make sure
	that the file has not already been included under another name.
	(gld${EMULATION_NAME}_stat_needed): New static function.
1995-10-02 17:59:14 +00:00
Ian Lance Taylor
5753006bf0 * lexsup.c (parse_args): Handle -assert.
* emulparams/sun4.sh (GENERATE_SHLIB_SCRIPT): Define.
	* emultempl/sunos.em (gld${EMULATION_NAME}_get_script): Use the
	shared library script when appropriate.
	* scripttempl/aout.sc: If CREATE_SHLIB is set, start the .text
	section at SIZEOF_HEADERS.
1995-09-28 16:36:34 +00:00
Ian Lance Taylor
57aa2887e8 Revert Linux directory searching: it turns out that Linux no longer
uses it.
1995-09-11 15:04:49 +00:00
Ian Lance Taylor
ed753c2049 Add Linux style directory searching.
* configure.tgt: Add i386lelf to targ_extra_emuls for
	i[345]86-*-linuxaout* and i[345]86-*-linuxoldld.  For
	i[345]86-*-linux*, set targ_emul to i386lelf, and add elf_i386 to
	targ_extra_emuls.
	* emulparams/i386lelf.sh: New file, a copy of elf_i386.sh.
	* emultempl/elf32.em: If TARGET_IS_i386lelf, use autoconf
	recommended mechanism to define DIR and struct dirent.
	(libcmp): New static function use only when TARGET_IS_i386lelf.
	(gld${EMULATION_NAME}_open_dynamic_archive): Likewise.
	* Makefile.in (ALL_EMULATIONS): Add ei386lelf.o
	(ei386lelf.c): New target.
1995-09-08 23:37:45 +00:00
Ian Lance Taylor
b8345a37ac * configure.in: Call AC_HEADER_DIRENT.
* configure, config.in: Rebuild.
	* emultempl/sunos.em: Use autoconf recommend mechanism to define
	DIR and struct dirent.
1995-09-08 21:11:40 +00:00
Ian Lance Taylor
d66c832b59 * configure.in: Rewrite to use autoconf.
* configure.host: New file.
	* configure.tgt: New file.
	* aclocal.m4: New file.
	* configure: New file, built by autoconf.
	* acconfig.h: New file.
	* config.h.in: New file, built by autoheader.
	* sysdep.h: New file.
	* ld.h: Incorporate old contents of config.h.
	* config.h: Remove.
	* Makefile.in: Various changes for new configure script.  Also:
	(CC_FOR_BUILD): Remove.
	(ldmain.o): Don't bother to ensure that EMUL is non-empty.
	(dep.sed): Use @SRCDIR@, not @srcdir@.
	* dep-in.sed: Use @SRCDIR@, not @srcdir@.
	* genscripts.sh: Create ldscripts if it does not exist.
	* ldemul.c, lexsup.c, mpw-emipsidt.c: Don't include "config.h".
	* mpw-esh.c, emultemp/*.em: Likewise.
	* ldmain.c: Likewise.  Include <ctype.h>.  Don't try to set
	HAVE_SBRK here.
	* config/*.mt, config/*.mh: Remove.
1995-09-06 18:58:05 +00:00
Steve Chamberlain
5f8ac7e7f6 Thu Aug 31 16:37:07 1995 steve chamberlain <sac@slash.cygnus.com>
* ldemul.c (ldemul_parse_args): New.
	* ldemul.h (ld_emulation_xfer_struct): Add parse_args.
	* lexsup.c (all pe stuff): Moved into pe.em
	(parse_args): Call emulation arg parser.
	* emultempl/pe.em (parse_args): handle PE specfic args.
1995-08-31 23:42:53 +00:00
Steve Chamberlain
eb7f87c5c8 Thu Aug 17 13:35:49 1995 steve chamberlain <sac@slash.cygnus.com>
* emultempl/{armpe.sc, i386pe.sc}: Deleted.
	* emultempl/pe.sc: New file performs generic PE support and sorts
	archive members.
	* emulparams/{armpe.sh,i386pe.sh}: Use new file.
	* scripttempl/{armpe.sc, i386pe.sc}: Deleted
	* scripttempl/pe.sc: New.
	* Makefile.in: Use new files.
b
1995-08-17 22:53:56 +00:00
Ken Raeburn
943fbd5bd5 fsf address update, but not in COPYING files 1995-07-07 22:49:42 +00:00
Ian Lance Taylor
7158d2b1a3 * emultempl/elf32.em (gld${EMULATION_NAME}_find_exp_assignment):
Handle etree_provide.
PR 7164.
1995-07-04 17:44:38 +00:00
Ian Lance Taylor
7523be3552 * emultempl/elf32.em (global_needed): New static variable.
(global_found): Likewise.
	(gld${EMULATION_NAME}_after_open): New static function.
	(gld${EMULATION_NAME}_search_needed): Likewise.
	(gld${EMULATION_NAME}_try_needed): Likewise.
	(gld${EMULATION_NAME}_check_needed): Likewise.
	(ld_${EMULATION_NAME}_emulation): Replace after_open_default with
	gld${EMULATION_NAME}_after_open.
PR 7083.
1995-07-04 16:57:34 +00:00
Steve Chamberlain
de71eb7786 Wed Jun 28 17:11:25 1995 Steve Chamberlain <sac@slash.cygnus.com>
* ldmain.c (main): Always initialize PE info in link_info.
	* lexsup.c (OPTION_BASE_FILE): New option.
	(parse_args): Handle new option.
	* emulparams/armpe.sh: Output pei.
	* emultempl/i386pe.em: Add newline to end.
	* scripttempl/armpe.sc: Change output and quote the $s.
	* scripttempl/i386pe.sc: Change output and quote the $s.
1995-06-29 00:21:00 +00:00
Steve Chamberlain
3f38a017be Fri May 12 11:03:55 1995 Steve Chamberlain <sac@slash.cygnus.com>
Tom Griest <griest@cs.yale.edu>

	Initial support for PE executables (eg NT, win32)

	* Makefile.in (configure.in, ei386pe): Add support.
	* ldmain.c (main): Initialize PE argument info.
	* ldwrite.c (print_file_stuff): Don't print out .drectve
	and .debug section info.
	* lexsup.c (set_subsystem, set_stack_heap, OPTION_HEAP,
	 OPTION_SUBSYSTEM, parse_argsm set_subsystem, set_stack_heap):
	 Handle new arguments.
	* config/i386-pe.mt, emultempl/i386pe.em, scripttempl/i386pe.sc:
	New files
1995-05-12 18:55:06 +00:00
Ian Lance Taylor
ae02b41c50 * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
Remove unused variable is.
1995-01-27 00:54:51 +00:00
Ian Lance Taylor
5f3548d6c7 update copyrights 1995-01-24 16:01:04 +00:00
Ian Lance Taylor
dc5df17b8a * emultempl/miposecoff.em: New file.
* emulparams/mipsidt.sh (TEMPLATE_NAME): Set to mipsecoff.
	* emulparams/mipsidtl.sh (TEMPLATE_NAME): Likewise.
	* scripttempl/mips.sc: Put .rel.sdata sections in .text, and
	provide __runtime_reloc_start and __runtime_reloc_stop if they are
	used.   Align _fdata to a 16 byte boundary.
	* Makefile.in (emipsidt.c): Depend upon mipsecoff.em rather than
	generic.em.
	(emipsidtl.c): Likewise.
	(check): Pass CC_FOR_HOST and CFLAGS_FOR_HOST to runtest.
1994-12-02 22:28:09 +00:00
Ian Lance Taylor
39a6e282d1 * ld.h (args_type): Add new field embedded_relocs.
* ldemul.h (ldemul_after_open, after_open_default): Declare.
	(ld_emulation_xfer_struct): Add new field after_open.
	* ldemul.c (ldemul_after_open): New function.
	(after_open_default): New function.
	* ldlang.c (lang_process): Call ldemul_after_open.
	* lexsup.c (parse_args): Handle --embedded-relocs.
	* emultempl/elf32.em (ld_${EMULATION_NAME}_emulation): Initialize
	new after_open field to after_open_default.
	* emultempl/generic.em, emultempl/gld960.em: Likewise.
	* emultempl/gld960c.em, emultempl/hppaelf.em: Likewise.
	* emultempl/linux.em, emultempl/m88kbcs.em: Likewise.
	* emultempl/sunos.em, emultempl/vanilla.em: Likewise.
	* ld.texinfo, ld.1: Mention -embedded-relocs.
1994-12-02 22:25:50 +00:00
Ian Lance Taylor
5efddb2e7c * ld.h (args_type): Add field export_dynamic.
* lexsup.c (parse_args): Recognize --export-dynamic.
	* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
	Pass export_dynamic argument to bfd_elf32_size_dynamic_sections.
1994-11-12 20:54:09 +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
ece5b08d17 Comment fix. 1994-06-15 21:23:28 +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
b6ef97506c * emultempl/sunos.em: Only look for .so files if doing a dynamic
link.
1994-06-10 20:46:42 +00:00