Statistics
| Branch: | Revision:

root / m68k.ld @ a63b5829

History | View | Annotate | Download (5.9 kB)

1 38e584a0 bellard
/* Script for -z combreloc: combine and sort reloc sections */
2 38e584a0 bellard
OUTPUT_FORMAT("elf32-m68k", "elf32-m68k",
3 38e584a0 bellard
	      "elf32-m68k")
4 38e584a0 bellard
OUTPUT_ARCH(m68k)
5 38e584a0 bellard
ENTRY(_start)
6 4bf6b55b Juan Quintela
/* __DYNAMIC = 0;    */
7 38e584a0 bellard
SECTIONS
8 38e584a0 bellard
{
9 38e584a0 bellard
  /* Read-only sections, merged into text segment: */
10 38e584a0 bellard
  . = 0x60000000 + SIZEOF_HEADERS;
11 38e584a0 bellard
  .interp         : { *(.interp) }
12 38e584a0 bellard
  .hash           : { *(.hash) }
13 38e584a0 bellard
  .dynsym         : { *(.dynsym) }
14 38e584a0 bellard
  .dynstr         : { *(.dynstr) }
15 38e584a0 bellard
  .gnu.version    : { *(.gnu.version) }
16 38e584a0 bellard
  .gnu.version_d  : { *(.gnu.version_d) }
17 38e584a0 bellard
  .gnu.version_r  : { *(.gnu.version_r) }
18 38e584a0 bellard
  .rel.dyn        :
19 38e584a0 bellard
    {
20 38e584a0 bellard
      *(.rel.init)
21 38e584a0 bellard
      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
22 38e584a0 bellard
      *(.rel.fini)
23 38e584a0 bellard
      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
24 38e584a0 bellard
      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
25 38e584a0 bellard
      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
26 38e584a0 bellard
      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
27 38e584a0 bellard
      *(.rel.ctors)
28 38e584a0 bellard
      *(.rel.dtors)
29 38e584a0 bellard
      *(.rel.got)
30 38e584a0 bellard
      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
31 38e584a0 bellard
    }
32 38e584a0 bellard
  .rela.dyn       :
33 38e584a0 bellard
    {
34 38e584a0 bellard
      *(.rela.init)
35 38e584a0 bellard
      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
36 38e584a0 bellard
      *(.rela.fini)
37 38e584a0 bellard
      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
38 38e584a0 bellard
      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
39 38e584a0 bellard
      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
40 38e584a0 bellard
      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
41 38e584a0 bellard
      *(.rela.ctors)
42 38e584a0 bellard
      *(.rela.dtors)
43 38e584a0 bellard
      *(.rela.got)
44 38e584a0 bellard
      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
45 38e584a0 bellard
    }
46 38e584a0 bellard
  .rel.plt        : { *(.rel.plt) }
47 38e584a0 bellard
  .rela.plt       : { *(.rela.plt) }
48 38e584a0 bellard
  .init           :
49 38e584a0 bellard
  {
50 38e584a0 bellard
    KEEP (*(.init))
51 38e584a0 bellard
  } =0x4e754e75
52 38e584a0 bellard
  .plt            : { *(.plt) }
53 38e584a0 bellard
  .text           :
54 38e584a0 bellard
  {
55 38e584a0 bellard
    *(.text .stub .text.* .gnu.linkonce.t.*)
56 38e584a0 bellard
    /* .gnu.warning sections are handled specially by elf32.em.  */
57 38e584a0 bellard
    *(.gnu.warning)
58 38e584a0 bellard
  } =0x4e754e75
59 38e584a0 bellard
  .fini           :
60 38e584a0 bellard
  {
61 38e584a0 bellard
    KEEP (*(.fini))
62 38e584a0 bellard
  } =0x4e754e75
63 38e584a0 bellard
  PROVIDE (__etext = .);
64 38e584a0 bellard
  PROVIDE (_etext = .);
65 38e584a0 bellard
  PROVIDE (etext = .);
66 38e584a0 bellard
  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
67 38e584a0 bellard
  .rodata1        : { *(.rodata1) }
68 38e584a0 bellard
  .eh_frame_hdr : { *(.eh_frame_hdr) }
69 38e584a0 bellard
  /* Adjust the address for the data segment.  We want to adjust up to
70 38e584a0 bellard
     the same address within the page on the next page up.  */
71 38e584a0 bellard
  . = ALIGN(0x2000) + (. & (0x2000 - 1));
72 38e584a0 bellard
  /* Ensure the __preinit_array_start label is properly aligned.  We
73 38e584a0 bellard
     could instead move the label definition inside the section, but
74 38e584a0 bellard
     the linker would then create the section even if it turns out to
75 38e584a0 bellard
     be empty, which isn't pretty.  */
76 38e584a0 bellard
  . = ALIGN(32 / 8);
77 38e584a0 bellard
  PROVIDE (__preinit_array_start = .);
78 38e584a0 bellard
  .preinit_array     : { *(.preinit_array) }
79 38e584a0 bellard
  PROVIDE (__preinit_array_end = .);
80 38e584a0 bellard
  PROVIDE (__init_array_start = .);
81 38e584a0 bellard
  .init_array     : { *(.init_array) }
82 38e584a0 bellard
  PROVIDE (__init_array_end = .);
83 38e584a0 bellard
  PROVIDE (__fini_array_start = .);
84 38e584a0 bellard
  .fini_array     : { *(.fini_array) }
85 38e584a0 bellard
  PROVIDE (__fini_array_end = .);
86 38e584a0 bellard
  .data           :
87 38e584a0 bellard
  {
88 38e584a0 bellard
    *(.data .data.* .gnu.linkonce.d.*)
89 38e584a0 bellard
    SORT(CONSTRUCTORS)
90 38e584a0 bellard
  }
91 38e584a0 bellard
  .data1          : { *(.data1) }
92 38e584a0 bellard
  .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
93 38e584a0 bellard
  .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
94 38e584a0 bellard
  .eh_frame       : { KEEP (*(.eh_frame)) }
95 38e584a0 bellard
  .gcc_except_table   : { *(.gcc_except_table) }
96 38e584a0 bellard
  .dynamic        : { *(.dynamic) }
97 38e584a0 bellard
  .ctors          :
98 38e584a0 bellard
  {
99 38e584a0 bellard
    /* gcc uses crtbegin.o to find the start of
100 38e584a0 bellard
       the constructors, so we make sure it is
101 38e584a0 bellard
       first.  Because this is a wildcard, it
102 38e584a0 bellard
       doesn't matter if the user does not
103 38e584a0 bellard
       actually link against crtbegin.o; the
104 38e584a0 bellard
       linker won't look for a file to match a
105 38e584a0 bellard
       wildcard.  The wildcard also means that it
106 38e584a0 bellard
       doesn't matter which directory crtbegin.o
107 38e584a0 bellard
       is in.  */
108 38e584a0 bellard
    KEEP (*crtbegin.o(.ctors))
109 38e584a0 bellard
    /* We don't want to include the .ctor section from
110 38e584a0 bellard
       from the crtend.o file until after the sorted ctors.
111 38e584a0 bellard
       The .ctor section from the crtend file contains the
112 38e584a0 bellard
       end of ctors marker and it must be last */
113 38e584a0 bellard
    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
114 38e584a0 bellard
    KEEP (*(SORT(.ctors.*)))
115 38e584a0 bellard
    KEEP (*(.ctors))
116 38e584a0 bellard
  }
117 38e584a0 bellard
  .dtors          :
118 38e584a0 bellard
  {
119 38e584a0 bellard
    KEEP (*crtbegin.o(.dtors))
120 38e584a0 bellard
    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
121 38e584a0 bellard
    KEEP (*(SORT(.dtors.*)))
122 38e584a0 bellard
    KEEP (*(.dtors))
123 38e584a0 bellard
  }
124 38e584a0 bellard
  .jcr            : { KEEP (*(.jcr)) }
125 38e584a0 bellard
  .got            : { *(.got.plt) *(.got) }
126 38e584a0 bellard
  _edata = .;
127 38e584a0 bellard
  PROVIDE (edata = .);
128 38e584a0 bellard
  __bss_start = .;
129 38e584a0 bellard
  .bss            :
130 38e584a0 bellard
  {
131 38e584a0 bellard
   *(.dynbss)
132 38e584a0 bellard
   *(.bss .bss.* .gnu.linkonce.b.*)
133 38e584a0 bellard
   *(COMMON)
134 38e584a0 bellard
   /* Align here to ensure that the .bss section occupies space up to
135 38e584a0 bellard
      _end.  Align after .bss to ensure correct alignment even if the
136 38e584a0 bellard
      .bss section disappears because there are no input sections.  */
137 38e584a0 bellard
   . = ALIGN(32 / 8);
138 38e584a0 bellard
  }
139 38e584a0 bellard
  . = ALIGN(32 / 8);
140 38e584a0 bellard
  _end = .;
141 38e584a0 bellard
  PROVIDE (end = .);
142 38e584a0 bellard
  /* Stabs debugging sections.  */
143 38e584a0 bellard
  .stab          0 : { *(.stab) }
144 38e584a0 bellard
  .stabstr       0 : { *(.stabstr) }
145 38e584a0 bellard
  .stab.excl     0 : { *(.stab.excl) }
146 38e584a0 bellard
  .stab.exclstr  0 : { *(.stab.exclstr) }
147 38e584a0 bellard
  .stab.index    0 : { *(.stab.index) }
148 38e584a0 bellard
  .stab.indexstr 0 : { *(.stab.indexstr) }
149 38e584a0 bellard
  .comment       0 : { *(.comment) }
150 38e584a0 bellard
  /* DWARF debug sections.
151 38e584a0 bellard
     Symbols in the DWARF debugging sections are relative to the beginning
152 38e584a0 bellard
     of the section so we begin them at 0.  */
153 38e584a0 bellard
  /* DWARF 1 */
154 38e584a0 bellard
  .debug          0 : { *(.debug) }
155 38e584a0 bellard
  .line           0 : { *(.line) }
156 38e584a0 bellard
  /* GNU DWARF 1 extensions */
157 38e584a0 bellard
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
158 38e584a0 bellard
  .debug_sfnames  0 : { *(.debug_sfnames) }
159 38e584a0 bellard
  /* DWARF 1.1 and DWARF 2 */
160 38e584a0 bellard
  .debug_aranges  0 : { *(.debug_aranges) }
161 38e584a0 bellard
  .debug_pubnames 0 : { *(.debug_pubnames) }
162 38e584a0 bellard
  /* DWARF 2 */
163 38e584a0 bellard
  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
164 38e584a0 bellard
  .debug_abbrev   0 : { *(.debug_abbrev) }
165 38e584a0 bellard
  .debug_line     0 : { *(.debug_line) }
166 38e584a0 bellard
  .debug_frame    0 : { *(.debug_frame) }
167 38e584a0 bellard
  .debug_str      0 : { *(.debug_str) }
168 38e584a0 bellard
  .debug_loc      0 : { *(.debug_loc) }
169 38e584a0 bellard
  .debug_macinfo  0 : { *(.debug_macinfo) }
170 38e584a0 bellard
  /* SGI/MIPS DWARF 2 extensions */
171 38e584a0 bellard
  .debug_weaknames 0 : { *(.debug_weaknames) }
172 38e584a0 bellard
  .debug_funcnames 0 : { *(.debug_funcnames) }
173 38e584a0 bellard
  .debug_typenames 0 : { *(.debug_typenames) }
174 38e584a0 bellard
  .debug_varnames  0 : { *(.debug_varnames) }
175 38e584a0 bellard
}