Statistics
| Branch: | Revision:

root / ia64.ld @ a74cdab4

History | View | Annotate | Download (8.2 kB)

1 b8076a74 bellard
/* Default linker script, for normal executables */
2 b8076a74 bellard
OUTPUT_FORMAT("elf64-ia64-little", "elf64-ia64-little",
3 b8076a74 bellard
	      "elf64-ia64-little")
4 b8076a74 bellard
OUTPUT_ARCH(ia64)
5 b8076a74 bellard
ENTRY(_start)
6 4bf6b55b Juan Quintela
/* __DYNAMIC = 0;    */
7 b8076a74 bellard
SECTIONS
8 b8076a74 bellard
{
9 b8076a74 bellard
  /* Read-only sections, merged into text segment: */
10 b8076a74 bellard
  PROVIDE (__executable_start = 0x60000000); . = 0x60000000 + SIZEOF_HEADERS;
11 b8076a74 bellard
  .interp         : { *(.interp) }
12 b8076a74 bellard
  .hash           : { *(.hash) }
13 b8076a74 bellard
  .dynsym         : { *(.dynsym) }
14 b8076a74 bellard
  .dynstr         : { *(.dynstr) }
15 b8076a74 bellard
  .gnu.version    : { *(.gnu.version) }
16 b8076a74 bellard
  .gnu.version_d  : { *(.gnu.version_d) }
17 b8076a74 bellard
  .gnu.version_r  : { *(.gnu.version_r) }
18 b8076a74 bellard
  .rel.init       : { *(.rel.init) }
19 b8076a74 bellard
  .rela.init      : { *(.rela.init) }
20 b8076a74 bellard
  .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
21 b8076a74 bellard
  .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
22 b8076a74 bellard
  .rel.fini       : { *(.rel.fini) }
23 b8076a74 bellard
  .rela.fini      : { *(.rela.fini) }
24 b8076a74 bellard
  .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
25 b8076a74 bellard
  .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
26 b8076a74 bellard
  .rel.data       : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
27 b8076a74 bellard
  .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
28 b8076a74 bellard
  .rel.tdata	  : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
29 b8076a74 bellard
  .rela.tdata	  : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
30 b8076a74 bellard
  .rel.tbss	  : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
31 b8076a74 bellard
  .rela.tbss	  : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
32 b8076a74 bellard
  .rel.ctors      : { *(.rel.ctors) }
33 b8076a74 bellard
  .rela.ctors     : { *(.rela.ctors) }
34 b8076a74 bellard
  .rel.dtors      : { *(.rel.dtors) }
35 b8076a74 bellard
  .rela.dtors     : { *(.rela.dtors) }
36 b8076a74 bellard
  .rel.got        : { *(.rel.got) }
37 b8076a74 bellard
  .rela.got       : { *(.rela.got) }
38 b8076a74 bellard
  .rel.sdata      : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
39 b8076a74 bellard
  .rela.sdata     : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
40 b8076a74 bellard
  .rel.sbss       : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
41 b8076a74 bellard
  .rela.sbss      : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
42 b8076a74 bellard
  .rel.sdata2     : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
43 b8076a74 bellard
  .rela.sdata2    : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
44 b8076a74 bellard
  .rel.sbss2      : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
45 b8076a74 bellard
  .rela.sbss2     : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
46 b8076a74 bellard
  .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
47 b8076a74 bellard
  .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
48 b8076a74 bellard
  .rel.plt        : { *(.rel.plt) }
49 b8076a74 bellard
  .rela.plt       : { *(.rela.plt) }
50 b8076a74 bellard
  .rela.IA_64.pltoff   : { *(.rela.IA_64.pltoff) }
51 b8076a74 bellard
  .init           :
52 b8076a74 bellard
  {
53 b8076a74 bellard
    KEEP (*(.init))
54 b8076a74 bellard
  } =0x00300000010070000002000001000400
55 b8076a74 bellard
  .plt            : { *(.plt) }
56 b8076a74 bellard
  .text           :
57 b8076a74 bellard
  {
58 b8076a74 bellard
    *(.text .stub .text.* .gnu.linkonce.t.*)
59 b8076a74 bellard
    /* .gnu.warning sections are handled specially by elf32.em.  */
60 b8076a74 bellard
    *(.gnu.warning)
61 b8076a74 bellard
  } =0x00300000010070000002000001000400
62 b8076a74 bellard
  .fini           :
63 b8076a74 bellard
  {
64 b8076a74 bellard
    KEEP (*(.fini))
65 b8076a74 bellard
  } =0x00300000010070000002000001000400
66 b8076a74 bellard
  PROVIDE (__etext = .);
67 b8076a74 bellard
  PROVIDE (_etext = .);
68 b8076a74 bellard
  PROVIDE (etext = .);
69 b8076a74 bellard
  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
70 b8076a74 bellard
  .rodata1        : { *(.rodata1) }
71 b8076a74 bellard
  .sdata2         : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) }
72 b8076a74 bellard
  .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
73 b8076a74 bellard
  .opd            : { *(.opd) }
74 b8076a74 bellard
  .IA_64.unwind_info   : { *(.IA_64.unwind_info* .gnu.linkonce.ia64unwi.*) }
75 b8076a74 bellard
  .IA_64.unwind   : { *(.IA_64.unwind* .gnu.linkonce.ia64unw.*) }
76 b8076a74 bellard
  .eh_frame_hdr : { *(.eh_frame_hdr) }
77 b8076a74 bellard
  /* Adjust the address for the data segment.  We want to adjust up to
78 b8076a74 bellard
     the same address within the page on the next page up.  */
79 b8076a74 bellard
  . = ALIGN(0x10000) + (. & (0x10000 - 1));
80 b8076a74 bellard
  /* Ensure the __preinit_array_start label is properly aligned.  We
81 b8076a74 bellard
     could instead move the label definition inside the section, but
82 b8076a74 bellard
     the linker would then create the section even if it turns out to
83 b8076a74 bellard
     be empty, which isn't pretty.  */
84 b8076a74 bellard
  . = ALIGN(64 / 8);
85 b8076a74 bellard
  PROVIDE (__preinit_array_start = .);
86 b8076a74 bellard
  .preinit_array     : { *(.preinit_array) }
87 b8076a74 bellard
  PROVIDE (__preinit_array_end = .);
88 b8076a74 bellard
  PROVIDE (__init_array_start = .);
89 b8076a74 bellard
  .init_array     : { *(.init_array) }
90 b8076a74 bellard
  PROVIDE (__init_array_end = .);
91 b8076a74 bellard
  PROVIDE (__fini_array_start = .);
92 b8076a74 bellard
  .fini_array     : { *(.fini_array) }
93 b8076a74 bellard
  PROVIDE (__fini_array_end = .);
94 b8076a74 bellard
  .data           :
95 b8076a74 bellard
  {
96 b8076a74 bellard
    *(.data .data.* .gnu.linkonce.d.*)
97 b8076a74 bellard
    SORT(CONSTRUCTORS)
98 b8076a74 bellard
  }
99 b8076a74 bellard
  .data1          : { *(.data1) }
100 b8076a74 bellard
  .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
101 b8076a74 bellard
  .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
102 b8076a74 bellard
  .eh_frame       : { KEEP (*(.eh_frame)) }
103 b8076a74 bellard
  .gcc_except_table   : { *(.gcc_except_table) }
104 b8076a74 bellard
  .dynamic        : { *(.dynamic) }
105 b8076a74 bellard
  .ctors          :
106 b8076a74 bellard
  {
107 b8076a74 bellard
    /* gcc uses crtbegin.o to find the start of
108 b8076a74 bellard
       the constructors, so we make sure it is
109 b8076a74 bellard
       first.  Because this is a wildcard, it
110 b8076a74 bellard
       doesn't matter if the user does not
111 b8076a74 bellard
       actually link against crtbegin.o; the
112 b8076a74 bellard
       linker won't look for a file to match a
113 b8076a74 bellard
       wildcard.  The wildcard also means that it
114 b8076a74 bellard
       doesn't matter which directory crtbegin.o
115 b8076a74 bellard
       is in.  */
116 b8076a74 bellard
    KEEP (*crtbegin*.o(.ctors))
117 b8076a74 bellard
    /* We don't want to include the .ctor section from
118 b8076a74 bellard
       from the crtend.o file until after the sorted ctors.
119 b8076a74 bellard
       The .ctor section from the crtend file contains the
120 b8076a74 bellard
       end of ctors marker and it must be last */
121 b8076a74 bellard
    KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
122 b8076a74 bellard
    KEEP (*(SORT(.ctors.*)))
123 b8076a74 bellard
    KEEP (*(.ctors))
124 b8076a74 bellard
  }
125 b8076a74 bellard
  .dtors          :
126 b8076a74 bellard
  {
127 b8076a74 bellard
    KEEP (*crtbegin*.o(.dtors))
128 b8076a74 bellard
    KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
129 b8076a74 bellard
    KEEP (*(SORT(.dtors.*)))
130 b8076a74 bellard
    KEEP (*(.dtors))
131 b8076a74 bellard
  }
132 b8076a74 bellard
  .jcr            : { KEEP (*(.jcr)) }
133 b8076a74 bellard
  /* Ensure __gp is outside the range of any normal data.  We need to
134 b8076a74 bellard
     do this to avoid the linker optimizing the code in op.o and getting
135 b8076a74 bellard
     it out of sync with the relocs that we read when processing that
136 b8076a74 bellard
     file.  A better solution might be to ensure that the dynamically
137 b8076a74 bellard
     generated code and static qemu code share a single gp-value.  */
138 b8076a74 bellard
  __gp = . + 0x200000;
139 b8076a74 bellard
  .got            : { *(.got.plt) *(.got) }
140 b8076a74 bellard
  .IA_64.pltoff   : { *(.IA_64.pltoff) }
141 b8076a74 bellard
  /* We want the small data sections together, so single-instruction offsets
142 b8076a74 bellard
     can access them all, and initialized data all before uninitialized, so
143 b8076a74 bellard
     we can shorten the on-disk segment size.  */
144 b8076a74 bellard
  .sdata          :
145 b8076a74 bellard
  {
146 b8076a74 bellard
    *(.sdata .sdata.* .gnu.linkonce.s.*)
147 b8076a74 bellard
  }
148 b8076a74 bellard
  _edata = .;
149 b8076a74 bellard
  PROVIDE (edata = .);
150 b8076a74 bellard
  __bss_start = .;
151 b8076a74 bellard
  .sbss           :
152 b8076a74 bellard
  {
153 b8076a74 bellard
    PROVIDE (__sbss_start = .);
154 b8076a74 bellard
    PROVIDE (___sbss_start = .);
155 b8076a74 bellard
    *(.dynsbss)
156 b8076a74 bellard
    *(.sbss .sbss.* .gnu.linkonce.sb.*)
157 b8076a74 bellard
    *(.scommon)
158 b8076a74 bellard
    PROVIDE (__sbss_end = .);
159 b8076a74 bellard
    PROVIDE (___sbss_end = .);
160 b8076a74 bellard
  }
161 b8076a74 bellard
  .bss            :
162 b8076a74 bellard
  {
163 b8076a74 bellard
   . += 0x400000;	/* ensure .bss stuff is out of reach of gp */
164 b8076a74 bellard
   *(.dynbss)
165 b8076a74 bellard
   *(.bss .bss.* .gnu.linkonce.b.*)
166 b8076a74 bellard
   *(COMMON)
167 b8076a74 bellard
   /* Align here to ensure that the .bss section occupies space up to
168 b8076a74 bellard
      _end.  Align after .bss to ensure correct alignment even if the
169 b8076a74 bellard
      .bss section disappears because there are no input sections.  */
170 b8076a74 bellard
   . = ALIGN(64 / 8);
171 b8076a74 bellard
  }
172 b8076a74 bellard
  . = ALIGN(64 / 8);
173 b8076a74 bellard
  _end = .;
174 b8076a74 bellard
  PROVIDE (end = .);
175 b8076a74 bellard
  /* Stabs debugging sections.  */
176 b8076a74 bellard
  .stab          0 : { *(.stab) }
177 b8076a74 bellard
  .stabstr       0 : { *(.stabstr) }
178 b8076a74 bellard
  .stab.excl     0 : { *(.stab.excl) }
179 b8076a74 bellard
  .stab.exclstr  0 : { *(.stab.exclstr) }
180 b8076a74 bellard
  .stab.index    0 : { *(.stab.index) }
181 b8076a74 bellard
  .stab.indexstr 0 : { *(.stab.indexstr) }
182 b8076a74 bellard
  .comment       0 : { *(.comment) }
183 b8076a74 bellard
  /* DWARF debug sections.
184 b8076a74 bellard
     Symbols in the DWARF debugging sections are relative to the beginning
185 b8076a74 bellard
     of the section so we begin them at 0.  */
186 b8076a74 bellard
  /* DWARF 1 */
187 b8076a74 bellard
  .debug          0 : { *(.debug) }
188 b8076a74 bellard
  .line           0 : { *(.line) }
189 b8076a74 bellard
  /* GNU DWARF 1 extensions */
190 b8076a74 bellard
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
191 b8076a74 bellard
  .debug_sfnames  0 : { *(.debug_sfnames) }
192 b8076a74 bellard
  /* DWARF 1.1 and DWARF 2 */
193 b8076a74 bellard
  .debug_aranges  0 : { *(.debug_aranges) }
194 b8076a74 bellard
  .debug_pubnames 0 : { *(.debug_pubnames) }
195 b8076a74 bellard
  /* DWARF 2 */
196 b8076a74 bellard
  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
197 b8076a74 bellard
  .debug_abbrev   0 : { *(.debug_abbrev) }
198 b8076a74 bellard
  .debug_line     0 : { *(.debug_line) }
199 b8076a74 bellard
  .debug_frame    0 : { *(.debug_frame) }
200 b8076a74 bellard
  .debug_str      0 : { *(.debug_str) }
201 b8076a74 bellard
  .debug_loc      0 : { *(.debug_loc) }
202 b8076a74 bellard
  .debug_macinfo  0 : { *(.debug_macinfo) }
203 b8076a74 bellard
  /* SGI/MIPS DWARF 2 extensions */
204 b8076a74 bellard
  .debug_weaknames 0 : { *(.debug_weaknames) }
205 b8076a74 bellard
  .debug_funcnames 0 : { *(.debug_funcnames) }
206 b8076a74 bellard
  .debug_typenames 0 : { *(.debug_typenames) }
207 b8076a74 bellard
  .debug_varnames  0 : { *(.debug_varnames) }
208 b8076a74 bellard
  /DISCARD/ : { *(.note.GNU-stack) }
209 b8076a74 bellard
}