Improve Solaris compatability

This commit is contained in:
Nick Clifton 2001-05-22 14:00:18 +00:00
parent 2d0441d962
commit 506eee2253
9 changed files with 784 additions and 974 deletions

View File

@ -1,3 +1,23 @@
2001-05-22 Alexandre Oliva <aoliva@redhat.com>
* emulparams/elf_i386_ldso.sh: New, copied from elf_i386.sh.
(ELF_INTERPRETER_NAME): Define it.
* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Use
it.
* configure.tgt (targ_emul, targ_extra_emuls)
[i[3456]86-*-solaris2*, i[3456]86-*-solaris*]: Use elf_i386_ldso
as primary, elf_i386 as extra.
* Makefile.am (ALL_EMULATIONS): Added eelf_i386_ldso.o.
(eelf_i386_ldso.c): New rule.
* Makefile.in: Rebuilt.
2001-05-22 Nick Clifton <nickc@redhat.com>
* lexsup.c (ld_options): Allow -I to be an alias for
--dynamic-linker. This is for Solaris compatability.
* ld.texinfo: Document that -I can be used.
* ld.1: Regenerate.
2001-05-16 Alan Modra <amodra@one.net.au>
* ldlang.c (wild_doit): Use linker_has_input to reliably determine

View File

@ -162,6 +162,7 @@ ALL_EMULATIONS = \
eelf_i386.o \
eelf_i386_be.o \
eelf_i386_chaos.o \
eelf_i386_ldso.o \
eelf_s390.o \
egld960.o \
egld960coff.o \
@ -537,6 +538,9 @@ eelf_i386_be.c: $(srcdir)/emulparams/elf_i386_be.sh \
eelf_i386_chaos.c: $(srcdir)/emulparams/elf_i386_chaos.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_chaos "$(tdir_elf_i386_chaos)"
eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)"
eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)"

View File

@ -270,6 +270,7 @@ ALL_EMULATIONS = \
eelf_i386.o \
eelf_i386_be.o \
eelf_i386_chaos.o \
eelf_i386_ldso.o \
eelf_s390.o \
egld960.o \
egld960coff.o \
@ -1251,6 +1252,9 @@ eelf_i386_be.c: $(srcdir)/emulparams/elf_i386_be.sh \
eelf_i386_chaos.c: $(srcdir)/emulparams/elf_i386_chaos.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_chaos "$(tdir_elf_i386_chaos)"
eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)"
eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)"

View File

@ -144,9 +144,13 @@ x86_64-*-linux-gnu*) targ_emul=elf_x86_64
tdir_i386linux=${targ_alias}aout
;;
i[3456]86-*-sysv[45]*) targ_emul=elf_i386 ;;
i[3456]86-*-solaris2*) targ_emul=elf_i386 ;;
i[3456]86-*-solaris2*) targ_emul=elf_i386_ldso
targ_extra_emuls="elf_i386"
;;
i[3456]86-*-unixware) targ_emul=elf_i386 ;;
i[3456]86-*-solaris*) targ_emul=elf_i386 ;;
i[3456]86-*-solaris*) targ_emul=elf_i386_ldso
targ_extra_emuls="elf_i386"
;;
i[3456]86-*-netbsd*) targ_emul=i386nbsd ;;
i[3456]86-*-netware) targ_emul=i386nw ;;
i[3456]86-*-elf*) targ_emul=elf_i386 ;;

View File

@ -0,0 +1,11 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-i386"
TEXT_START_ADDR=0x08048000
MAXPAGESIZE=0x1000
NONPAGED_TEXT_START_ADDR=0x08048000
ARCH=i386
MACHINE=
NOP=0x9090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
ELF_INTERPRETER_NAME=\"/usr/lib/ld.so.1\"

View File

@ -817,6 +817,14 @@ gld${EMULATION_NAME}_before_allocation ()
&link_info, &sinterp, lang_elf_version_info)))
einfo ("%P%F: failed to set dynamic section sizes: %E\n");
${ELF_INTERPRETER_NAME+"
if (sinterp != NULL)
{
sinterp->contents = ${ELF_INTERPRETER_NAME};
sinterp->_raw_size = strlen (sinterp->contents) + 1;
}
"}
/* Let the user override the dynamic linker we are using. */
if (command_line.interpreter != NULL
&& sinterp != NULL)

1697
ld/ld.1

File diff suppressed because it is too large Load Diff

View File

@ -966,6 +966,7 @@ demangle by default unless the environment variable @samp{COLLECT_NO_DEMANGLE}
is set. These options may be used to override the default.
@cindex dynamic linker, from command line
@kindex -I@var{file}
@kindex --dynamic-linker @var{file}
@item --dynamic-linker @var{file}
Set the name of the dynamic linker. This is only meaningful when

View File

@ -201,6 +201,8 @@ static const struct ld_option ld_options[] =
TWO_DASHES },
{ {"soname", required_argument, NULL, OPTION_SONAME},
'h', N_("FILENAME"), N_("Set internal name of shared library"), ONE_DASH },
{ {"dynamic-linker", required_argument, NULL, OPTION_DYNAMIC_LINKER},
'I', N_("PROGRAM"), N_("Set the dynamic linker to use"), TWO_DASHES },
{ {"library", required_argument, NULL, 'l'},
'l', N_("LIBNAME"), N_("Search for library LIBNAME"), TWO_DASHES },
{ {"library-path", required_argument, NULL, 'L'},
@ -290,8 +292,6 @@ static const struct ld_option ld_options[] =
'\0', N_("SYMBOL=EXPRESSION"), N_("Define a symbol"), TWO_DASHES },
{ {"demangle", optional_argument, NULL, OPTION_DEMANGLE},
'\0', N_("[=STYLE]"), N_("Demangle symbol names [using STYLE]"), TWO_DASHES },
{ {"dynamic-linker", required_argument, NULL, OPTION_DYNAMIC_LINKER},
'\0', N_("PROGRAM"), N_("Set the dynamic linker to use"), TWO_DASHES },
{ {"embedded-relocs", no_argument, NULL, OPTION_EMBEDDED_RELOCS},
'\0', NULL, N_("Generate embedded relocs"), TWO_DASHES},
{ {"fini", required_argument, NULL, OPTION_FINI},
@ -651,6 +651,7 @@ parse_args (argc, argv)
cplus_demangle_set_style (style);
}
break;
case 'I': /* Used on Solaris. */
case OPTION_DYNAMIC_LINKER:
command_line.interpreter = optarg;
break;