elf64alpha.sh revision 91054
1168404Spjd# $FreeBSD: head/contrib/binutils/ld/emulparams/elf64alpha.sh 91054 2002-02-22 04:51:15Z obrien $
2168404Spjd
3168404Spjd
4168404SpjdENTRY=_start
5168404SpjdSCRIPT_NAME=elf
6168404SpjdELFSIZE=64
7168404SpjdTEMPLATE_NAME=elf32
8168404SpjdOUTPUT_FORMAT="elf64-alpha"
9168404SpjdTEXT_START_ADDR="0x120000000"
10168404SpjdMAXPAGESIZE=0x10000
11168404SpjdNONPAGED_TEXT_START_ADDR="0x120000000"
12168404SpjdARCH=alpha
13168404SpjdMACHINE=
14168404SpjdGENERATE_SHLIB_SCRIPT=yes
15168404SpjdDATA_PLT=
16168404Spjd# Note that the string of digits is little-endian.
17168404SpjdNOP=0x0000fe2f		# unop
18168404Spjd
19168404SpjdOTHER_READONLY_SECTIONS="
20168404Spjd  .reginfo      ${RELOCATING-0} : { *(.reginfo) }"
21168404Spjd
22219089Spjd# This code gets inserted into the generic elf32.sc linker script
23264669Sdelphij# and allows us to define our own command line switches.
24286575SmavPARSE_AND_LIST_PROLOGUE='
25296519Smav#define OPTION_TASO            300
26168404Spjd/* Set the start address as in the Tru64 ld */
27168404Spjd#define ALPHA_TEXT_START_32BIT 0x12000000
28219089Spjd
29168404Spjdstatic int elf64alpha_32bit = 0;
30168404Spjd
31168404Spjdstruct ld_emulation_xfer_struct ld_elf64alpha_emulation;
32168404Spjdstatic void gld_elf64alpha_finish PARAMS ((void));
33168404Spjd'
34168404Spjd
35168404SpjdPARSE_AND_LIST_LONGOPTS='
36168404Spjd  {"taso", no_argument, NULL, OPTION_TASO},
37219089Spjd'
38274337Sdelphij
39168404SpjdPARSE_AND_LIST_OPTIONS='
40185029Spjd  fprintf (file, _("  -taso\t\t\tLoad executable in the lower 31-bit addressable\n"));
41185029Spjd  fprintf (file, _("\t\t\t  virtual address range\n"));
42185029Spjd'
43168404Spjd
44275782SdelphijPARSE_AND_LIST_ARGS_CASES='
45275782Sdelphij    case EOF:
46219089Spjd      if (elf64alpha_32bit && !link_info.shared && !link_info.relocateable)
47168404Spjd	{
48219089Spjd	  lang_section_start (".interp",
49219089Spjd			      exp_binop ('\''+'\'',
50219089Spjd					 exp_intop (ALPHA_TEXT_START_32BIT),
51219089Spjd					 exp_nameop (SIZEOF_HEADERS, NULL)));
52219089Spjd	  ld_elf64alpha_emulation.finish = gld_elf64alpha_finish;
53275782Sdelphij	}
54219089Spjd      return 0;
55168404Spjd
56219089Spjd    case OPTION_TASO:
57219089Spjd      elf64alpha_32bit = 1;
58219089Spjd      break;
59219089Spjd'
60219089Spjd
61219089SpjdPARSE_AND_LIST_EPILOGUE='
62219089Spjd#include "elf/internal.h"
63219089Spjd#include "elf/alpha.h"
64219089Spjd#include "elf-bfd.h"
65219089Spjd
66219089Spjdstatic void
67219089Spjdgld_elf64alpha_finish()
68219089Spjd{
69219089Spjd  elf_elfheader (output_bfd)->e_flags |= EF_ALPHA_32BIT;
70219089Spjd}
71219089Spjd'
72219089Spjd