OLD | NEW |
(Empty) | |
| 1 /* Script for -z combreloc: combine and sort reloc sections */ |
| 2 OUTPUT_FORMAT("elf32-littlearm-nacl", "elf32-bigarm-nacl", |
| 3 "elf32-littlearm-nacl") |
| 4 OUTPUT_ARCH(arm) |
| 5 ENTRY(_start) |
| 6 SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); |
| 7 |
| 8 /* @LOCALMOD-BEGIN */ |
| 9 PHDRS |
| 10 { |
| 11 headers PT_PHDR FILEHDR PHDRS FLAGS(4); /* put the headers in a non-loadable |
| 12 seg */ |
| 13 text PT_LOAD FLAGS(5) ; /* read + execute */ |
| 14 rodata PT_LOAD FLAGS(4) ; /* read */ |
| 15 data PT_LOAD FLAGS(6) ; /* read + write */ |
| 16 tls PT_TLS FLAGS(4) ; /* read */ |
| 17 /* TODO(sehr): do we need a stack? */ |
| 18 } |
| 19 /* @LOCALMOD-END */ |
| 20 |
| 21 SECTIONS |
| 22 { |
| 23 /* Read-only sections, merged into text segment: */ |
| 24 /* @LOCALMOD-BEGIN */ |
| 25 PROVIDE (__executable_start = 0x0001000F); |
| 26 /* @LOCALMOD-END */ |
| 27 .interp : { *(.interp) } |
| 28 .note.gnu.build-id : { *(.note.gnu.build-id) } |
| 29 .hash : { *(.hash) } |
| 30 .gnu.hash : { *(.gnu.hash) } |
| 31 .dynsym : { *(.dynsym) } |
| 32 .dynstr : { *(.dynstr) } |
| 33 .gnu.version : { *(.gnu.version) } |
| 34 .gnu.version_d : { *(.gnu.version_d) } |
| 35 .gnu.version_r : { *(.gnu.version_r) } |
| 36 .rel.dyn : |
| 37 { |
| 38 *(.rel.init) |
| 39 *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) |
| 40 *(.rel.fini) |
| 41 *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) |
| 42 *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) |
| 43 *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) |
| 44 *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) |
| 45 *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) |
| 46 *(.rel.ctors) |
| 47 *(.rel.dtors) |
| 48 *(.rel.got) |
| 49 *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) |
| 50 } |
| 51 .rela.dyn : |
| 52 { |
| 53 *(.rela.init) |
| 54 *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) |
| 55 *(.rela.fini) |
| 56 *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) |
| 57 *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) |
| 58 *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) |
| 59 *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) |
| 60 *(.rela.ctors) |
| 61 *(.rela.dtors) |
| 62 *(.rela.got) |
| 63 *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) |
| 64 } |
| 65 .rel.plt : { *(.rel.plt) } |
| 66 .rela.plt : { *(.rela.plt) } |
| 67 .init : |
| 68 { |
| 69 KEEP (*(.init)) |
| 70 /* @LOCALMOD-BEGIN */ |
| 71 } :text =0 |
| 72 /* @LOCALMOD-END */ |
| 73 .plt : { *(.plt) } |
| 74 . = 0x10000; |
| 75 .text : |
| 76 { |
| 77 . += 0xE; |
| 78 *(.text .stub .text.* .gnu.linkonce.t.*) |
| 79 KEEP (*(.text.*personality*)) |
| 80 /* .gnu.warning sections are handled specially by elf32.em. */ |
| 81 *(.gnu.warning) |
| 82 *(.glue_7t) *(.glue_7) *(.vfp11_veneer) |
| 83 } =0 |
| 84 .fini : |
| 85 { |
| 86 KEEP (*(.fini)) |
| 87 } =0 |
| 88 PROVIDE (__etext = .); |
| 89 PROVIDE (_etext = .); |
| 90 PROVIDE (etext = .); |
| 91 /* @LOCALMOD-BEGIN */ |
| 92 . = . + 32; /* reserve space for HLTs */ |
| 93 /* nacl wants 64k alignment */ |
| 94 .rodata ALIGN(0x10000) : { *(.rodata .rodata.* .gnu.linkonce.r.*) } :rodata |
| 95 /* @LOCALMOD-END */ |
| 96 .rodata1 : { *(.rodata1) } |
| 97 /* @LOCALMOD-BEGIN */ |
| 98 .nacl_rpc_methods : { *(.nacl_rpc_methods) } |
| 99 /* @LOCALMOD-END */ |
| 100 .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } |
| 101 __exidx_start = .; |
| 102 .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } |
| 103 __exidx_end = .; |
| 104 .eh_frame_hdr : { *(.eh_frame_hdr) } |
| 105 /* @LOCALMOD-BEGIN */ |
| 106 /* .eh_frame begin/end is marked by two new sections in nacl_startup.c */ |
| 107 .eh_frame : ONLY_IF_RO |
| 108 { |
| 109 KEEP (*(.eh_frame_prolog)) |
| 110 KEEP (*(.eh_frame)) |
| 111 KEEP (*(.eh_frame_epilog)) |
| 112 } |
| 113 /* @LOCALMOD-END */ |
| 114 .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } |
| 115 /* Adjust the address for the data segment. We want to adjust up to |
| 116 the same address within the page on the next page up. */ |
| 117 . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT
(MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (
COMMONPAGESIZE)); |
| 118 /* Exception handling */ |
| 119 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } |
| 120 .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } |
| 121 /* Thread Local Storage sections */ |
| 122 /* @LOCALMOD-BEGIN */ |
| 123 /* nacl wants 64k alignment */ |
| 124 .tdata ALIGN(0x10000) : { |
| 125 PROVIDE (__tls_template_start = .); |
| 126 *(.tdata .tdata.* .gnu.linkonce.td.*) |
| 127 PROVIDE (__tls_template_tdata_end = .); |
| 128 } : rodata :tls |
| 129 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } |
| 130 /* The total size of the TLS template area must be a multiple of 32 */ |
| 131 /* . does not advance for tbss because it is not loaded. */ |
| 132 PROVIDE (__tls_template_end = |
| 133 __tls_template_start + |
| 134 (((. + SIZEOF(.tbss)) - __tls_template_start + 31) & |
| 135 ~(31)) |
| 136 ); |
| 137 /* @LOCALMOD-END */ |
| 138 .preinit_array : |
| 139 { |
| 140 PROVIDE_HIDDEN (__preinit_array_start = .); |
| 141 KEEP (*(.preinit_array)) |
| 142 PROVIDE_HIDDEN (__preinit_array_end = .); |
| 143 /* @LOCALMOD-BEGIN */ |
| 144 } : rodata |
| 145 /* @LOCALMOD-END */ |
| 146 .init_array : |
| 147 { |
| 148 PROVIDE_HIDDEN (__init_array_start = .); |
| 149 KEEP (*(SORT(.init_array.*))) |
| 150 KEEP (*(.init_array)) |
| 151 PROVIDE_HIDDEN (__init_array_end = .); |
| 152 } |
| 153 .fini_array : |
| 154 { |
| 155 PROVIDE_HIDDEN (__fini_array_start = .); |
| 156 KEEP (*(.fini_array)) |
| 157 KEEP (*(SORT(.fini_array.*))) |
| 158 PROVIDE_HIDDEN (__fini_array_end = .); |
| 159 } |
| 160 .ctors : |
| 161 { |
| 162 /* gcc uses crtbegin.o to find the start of |
| 163 the constructors, so we make sure it is |
| 164 first. Because this is a wildcard, it |
| 165 doesn't matter if the user does not |
| 166 actually link against crtbegin.o; the |
| 167 linker won't look for a file to match a |
| 168 wildcard. The wildcard also means that it |
| 169 doesn't matter which directory crtbegin.o |
| 170 is in. */ |
| 171 KEEP (*crtbegin.o(.ctors)) |
| 172 KEEP (*crtbegin?.o(.ctors)) |
| 173 /* We don't want to include the .ctor section from |
| 174 the crtend.o file until after the sorted ctors. |
| 175 The .ctor section from the crtend file contains the |
| 176 end of ctors marker and it must be last */ |
| 177 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) |
| 178 KEEP (*(SORT(.ctors.*))) |
| 179 KEEP (*(.ctors)) |
| 180 } |
| 181 .dtors : |
| 182 { |
| 183 KEEP (*crtbegin.o(.dtors)) |
| 184 KEEP (*crtbegin?.o(.dtors)) |
| 185 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) |
| 186 KEEP (*(SORT(.dtors.*))) |
| 187 KEEP (*(.dtors)) |
| 188 } |
| 189 .jcr : { KEEP (*(.jcr)) } |
| 190 .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data
.rel.ro* .gnu.linkonce.d.rel.ro.*) } |
| 191 .dynamic : { *(.dynamic) } |
| 192 . = DATA_SEGMENT_RELRO_END (0, .); |
| 193 .got : { *(.got.plt) *(.got) } |
| 194 |
| 195 /* @LOCALMOD-BEGIN */ |
| 196 /* nacl wants 64k alignment */ |
| 197 .data ALIGN(0x10000) : |
| 198 /* @LOCALMOD-END */ |
| 199 { |
| 200 __data_start = . ; |
| 201 *(.data .data.* .gnu.linkonce.d.*) |
| 202 KEEP (*(.gnu.linkonce.d.*personality*)) |
| 203 SORT(CONSTRUCTORS) |
| 204 /* @LOCALMOD-BEGIN */ |
| 205 } :data |
| 206 /* @LOCALMOD-END */ |
| 207 .data1 : { *(.data1) } |
| 208 _edata = .; PROVIDE (edata = .); |
| 209 __bss_start = .; |
| 210 __bss_start__ = .; |
| 211 .bss : |
| 212 { |
| 213 *(.dynbss) |
| 214 *(.bss .bss.* .gnu.linkonce.b.*) |
| 215 *(COMMON) |
| 216 /* Align here to ensure that the .bss section occupies space up to |
| 217 _end. Align after .bss to ensure correct alignment even if the |
| 218 .bss section disappears because there are no input sections. |
| 219 deadscript: Why do we need it? When there is no .bss section, we don't |
| 220 pad the .data section. */ |
| 221 . = ALIGN(. != 0 ? 32 / 8 : 1); |
| 222 } |
| 223 _bss_end__ = . ; __bss_end__ = . ; |
| 224 . = ALIGN(32 / 8); |
| 225 . = ALIGN(32 / 8); |
| 226 __end__ = . ; |
| 227 _end = .; PROVIDE (end = .); |
| 228 . = DATA_SEGMENT_END (.); |
| 229 /* Stabs debugging sections. */ |
| 230 .stab 0 : { *(.stab) } |
| 231 .stabstr 0 : { *(.stabstr) } |
| 232 .stab.excl 0 : { *(.stab.excl) } |
| 233 .stab.exclstr 0 : { *(.stab.exclstr) } |
| 234 .stab.index 0 : { *(.stab.index) } |
| 235 .stab.indexstr 0 : { *(.stab.indexstr) } |
| 236 .comment 0 : { *(.comment) } |
| 237 /* DWARF debug sections. |
| 238 Symbols in the DWARF debugging sections are relative to the beginning |
| 239 of the section so we begin them at 0. */ |
| 240 /* DWARF 1 */ |
| 241 .debug 0 : { *(.debug) } |
| 242 .line 0 : { *(.line) } |
| 243 /* GNU DWARF 1 extensions */ |
| 244 .debug_srcinfo 0 : { *(.debug_srcinfo) } |
| 245 .debug_sfnames 0 : { *(.debug_sfnames) } |
| 246 /* DWARF 1.1 and DWARF 2 */ |
| 247 .debug_aranges 0 : { *(.debug_aranges) } |
| 248 .debug_pubnames 0 : { *(.debug_pubnames) } |
| 249 /* DWARF 2 */ |
| 250 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
| 251 .debug_abbrev 0 : { *(.debug_abbrev) } |
| 252 .debug_line 0 : { *(.debug_line) } |
| 253 .debug_frame 0 : { *(.debug_frame) } |
| 254 .debug_str 0 : { *(.debug_str) } |
| 255 .debug_loc 0 : { *(.debug_loc) } |
| 256 .debug_macinfo 0 : { *(.debug_macinfo) } |
| 257 /* SGI/MIPS DWARF 2 extensions */ |
| 258 .debug_weaknames 0 : { *(.debug_weaknames) } |
| 259 .debug_funcnames 0 : { *(.debug_funcnames) } |
| 260 .debug_typenames 0 : { *(.debug_typenames) } |
| 261 .debug_varnames 0 : { *(.debug_varnames) } |
| 262 /* DWARF 3 */ |
| 263 .debug_pubtypes 0 : { *(.debug_pubtypes) } |
| 264 .debug_ranges 0 : { *(.debug_ranges) } |
| 265 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } |
| 266 .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) } |
| 267 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) } |
| 268 } |
| 269 |
| 270 |
OLD | NEW |