After discussing the entry point issue w/ rth@redhat.com, add an

elf64alpha_nbsd linker emulation that sets the entry point correctly
for NetBSD.
This commit is contained in:
thorpej 2001-12-16 04:06:51 +00:00
parent e3e5021be2
commit 7a362db4f3
5 changed files with 76 additions and 2 deletions

View File

@ -255,6 +255,7 @@ ALL_64_EMULATIONS = \
eelf_x86_64.o \
eelf64_sparc.o \
eelf64alpha.o \
eelf64alpha_nbsd.o \
eelf64bmip.o \
eelf64btsmip.o \
eelf64ltsmip.o \
@ -499,6 +500,9 @@ eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \
eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
eelf64alpha_nbsd.c: $(srcdir)/emulparams/elf64alpha_nbsd.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha_nbsd "$(tdir_elf64alpha_nbsd)"
eelf64hppa.c: $(srcdir)/emulparams/elf64hppa.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64hppa "$(tdir_elf64hppa)"

View File

@ -364,6 +364,7 @@ ALL_64_EMULATIONS = \
eelf_x86_64.o \
eelf64_sparc.o \
eelf64alpha.o \
eelf64alpha_nbsd.o \
eelf64bmip.o \
eelf64btsmip.o \
eelf64ltsmip.o \
@ -1213,6 +1214,9 @@ eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \
eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
eelf64alpha_nbsd.c: $(srcdir)/emulparams/elf64alpha_nbsd.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha_nbsd "$(tdir_elf64alpha_nbsd)"
eelf64hppa.c: $(srcdir)/emulparams/elf64hppa.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64hppa "$(tdir_elf64hppa)"

View File

@ -337,7 +337,7 @@ alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
alpha*-*-osf*) targ_emul=alpha ;;
alpha*-*-gnu*) targ_emul=elf64alpha ;;
alpha*-*-netware*) targ_emul=alpha ;;
alpha*-*-netbsd*) targ_emul=elf64alpha ;;
alpha*-*-netbsd*) targ_emul=elf64alpha_nbsd ;;
z8k-*-coff) targ_emul=z8002; targ_extra_emuls=z8001 ;;
ns32k-pc532-mach* | ns32k-pc532-ux*) targ_emul=pc532macha ;;
ns32k-*-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd ;;

View File

@ -1,4 +1,4 @@
ENTRY=__start
ENTRY=_start
SCRIPT_NAME=elf
ELFSIZE=64
TEMPLATE_NAME=elf32

View File

@ -0,0 +1,66 @@
ENTRY=__start
SCRIPT_NAME=elf
ELFSIZE=64
TEMPLATE_NAME=elf32
OUTPUT_FORMAT="elf64-alpha"
TEXT_START_ADDR="0x120000000"
MAXPAGESIZE=0x10000
NONPAGED_TEXT_START_ADDR="0x120000000"
ARCH=alpha
MACHINE=
GENERATE_SHLIB_SCRIPT=yes
DATA_PLT=
NOP=0x47ff041f
OTHER_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
# This code gets inserted into the generic elf32.sc linker script
# and allows us to define our own command line switches.
PARSE_AND_LIST_PROLOGUE='
#define OPTION_TASO 300
/* Set the start address as in the Tru64 ld */
#define ALPHA_TEXT_START_32BIT 0x12000000
static int elf64alpha_32bit = 0;
struct ld_emulation_xfer_struct ld_elf64alpha_emulation;
static void gld_elf64alpha_finish ();
'
PARSE_AND_LIST_LONGOPTS='
{"taso", no_argument, NULL, OPTION_TASO},
'
PARSE_AND_LIST_OPTIONS='
fprintf (file, _(" -taso\t\t\tLoad executable in the lower 31-bit addressable\n"));
fprintf (file, _("\t\t\t virtual address range\n"));
'
PARSE_AND_LIST_ARGS_CASES='
case EOF:
if (elf64alpha_32bit && !link_info.shared && !link_info.relocateable)
{
lang_section_start (".interp",
exp_binop ('\''+'\'',
exp_intop (ALPHA_TEXT_START_32BIT),
exp_nameop (SIZEOF_HEADERS, NULL)));
ld_elf64alpha_emulation.finish = gld_elf64alpha_finish;
}
return 0;
case OPTION_TASO:
elf64alpha_32bit = 1;
break;
'
PARSE_AND_LIST_EPILOGUE='
#include "elf/internal.h"
#include "elf/alpha.h"
#include "elf-bfd.h"
static void
gld_elf64alpha_finish()
{
elf_elfheader (output_bfd)->e_flags |= EF_ALPHA_32BIT;
}
'