Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: nacl/dyn-link/ldscripts/elf_nacl.x

Issue 13638011: Align and pad code segments to 64k (Closed) Base URL: http://git.chromium.org/native_client/nacl-glibc.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « nacl/dyn-link/ldscripts/elf64_nacl.xs ('k') | nacl/dyn-link/ldscripts/elf_nacl.xs » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Default linker script, for normal executables */ 1 /* Default linker script, for normal executables */
2 OUTPUT_FORMAT("elf32-nacl", "elf32-nacl", 2 OUTPUT_FORMAT("elf32-nacl", "elf32-nacl",
3 "elf32-nacl") 3 "elf32-nacl")
4 OUTPUT_ARCH(i386) 4 OUTPUT_ARCH(i386)
5 ENTRY(_start) 5 ENTRY(_start)
6 SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32" ); 6 SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32" );
7 SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); 7 SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
8 PHDRS 8 PHDRS
9 { 9 {
10 seg_interp PT_INTERP FLAGS(4) ; /* read */ 10 seg_interp PT_INTERP FLAGS(4) ; /* read */
11 seg_code PT_LOAD FLAGS(5) ; /* read + execute */ 11 seg_code PT_LOAD FLAGS(5) ; /* read + execute */
12 seg_rodata PT_LOAD FLAGS(4) ; /* read */ 12 seg_rodata PT_LOAD FLAGS(4) ; /* read */
13 seg_rwdata PT_LOAD FLAGS(6) ; /* read + write */ 13 seg_rwdata PT_LOAD FLAGS(6) ; /* read + write */
14 seg_bss PT_LOAD FLAGS(6) ; /* read + write */ 14 seg_bss PT_LOAD FLAGS(6) ; /* read + write */
15 seg_dynamic PT_DYNAMIC FLAGS(6) ; 15 seg_dynamic PT_DYNAMIC FLAGS(6) ;
16 seg_stack PT_GNU_STACK FLAGS(6) ; 16 seg_stack PT_GNU_STACK FLAGS(6) ;
17 seg_tls PT_TLS FLAGS(4) ; 17 seg_tls PT_TLS FLAGS(4) ;
18 } 18 }
19 SECTIONS 19 SECTIONS
20 { 20 {
21 PROVIDE (__executable_start = 0x1000000); . = 0x1000000 + SIZEOF_HEADERS; 21 . = 0x1000000;
22 . = ALIGN(32); 22 PROVIDE (__executable_start = .);
23
23 /* The ALIGN(32) instructions below are workarounds. 24 /* The ALIGN(32) instructions below are workarounds.
24 TODO(mseaborn): Get the object files to include the correct 25 TODO(mseaborn): Get the object files to include the correct
25 alignments and padding themselves. 26 alignments and padding themselves.
26 See http://code.google.com/p/nativeclient/issues/detail?id=499. */ 27 See http://code.google.com/p/nativeclient/issues/detail?id=499. */
27 .init : 28 .init :
28 { 29 {
29 KEEP (*(.init)) 30 KEEP (*(.init))
30 . = ALIGN(32); /* ensures NOP fill */ 31 . = ALIGN(32); /* ensures NOP fill */
31 } :seg_code =0x90909090 32 } :seg_code =0x90909090
32 .plt : { *(.plt) } 33 .plt : { *(.plt) }
33 .text : 34 .text :
34 { 35 {
35 *(.text .stub .text.* .gnu.linkonce.t.*) 36 *(.text .stub .text.* .gnu.linkonce.t.*)
36 KEEP (*(.text.*personality*)) 37 KEEP (*(.text.*personality*))
37 /* .gnu.warning sections are handled specially by elf32.em. */ 38 /* .gnu.warning sections are handled specially by elf32.em. */
38 *(.gnu.warning) 39 *(.gnu.warning)
39 . = ALIGN(32); /* ensures NOP fill */ 40 . = ALIGN(32); /* ensures NOP fill */
40 } =0x90909090 41 } =0x90909090
41 .fini : 42 .fini :
42 { 43 {
43 KEEP (*(.fini)) 44 KEEP (*(.fini))
44 . = ALIGN(32); /* ensures NOP fill */ 45 . = ALIGN(CONSTANT (MAXPAGESIZE)); /* ensures NOP fill */
45 } =0x90909090 46 } =0x90909090
46 PROVIDE (__etext = .); 47 PROVIDE (__etext = .);
47 PROVIDE (_etext = .); 48 PROVIDE (_etext = .);
48 PROVIDE (etext = .); 49 PROVIDE (etext = .);
49 50
50 . = 0x11000000 + (. & (CONSTANT (MAXPAGESIZE) - 1)); 51 . = 0x11000000;
51 .interp : { *(.interp) } :seg_rodata :seg_interp 52 .interp : { *(.interp) } :seg_rodata :seg_interp
52 .note.gnu.build-id : { *(.note.gnu.build-id) } :seg_rodata 53 .note.gnu.build-id : { *(.note.gnu.build-id) } :seg_rodata
53 .hash : { *(.hash) } 54 .hash : { *(.hash) }
54 .gnu.hash : { *(.gnu.hash) } 55 .gnu.hash : { *(.gnu.hash) }
55 .dynsym : { *(.dynsym) } 56 .dynsym : { *(.dynsym) }
56 .dynstr : { *(.dynstr) } 57 .dynstr : { *(.dynstr) }
57 .gnu.version : { *(.gnu.version) } 58 .gnu.version : { *(.gnu.version) }
58 .gnu.version_d : { *(.gnu.version_d) } 59 .gnu.version_d : { *(.gnu.version_d) }
59 .gnu.version_r : { *(.gnu.version_r) } 60 .gnu.version_r : { *(.gnu.version_r) }
60 .rel.init : { *(.rel.init) } 61 .rel.init : { *(.rel.init) }
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 .debug_typenames 0 : { *(.debug_typenames) } 234 .debug_typenames 0 : { *(.debug_typenames) }
234 .debug_varnames 0 : { *(.debug_varnames) } 235 .debug_varnames 0 : { *(.debug_varnames) }
235 /* DWARF 3 */ 236 /* DWARF 3 */
236 .debug_pubtypes 0 : { *(.debug_pubtypes) } 237 .debug_pubtypes 0 : { *(.debug_pubtypes) }
237 .debug_ranges 0 : { *(.debug_ranges) } 238 .debug_ranges 0 : { *(.debug_ranges) }
238 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } 239 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
239 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) } 240 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
240 /DISCARD/ : { *(.note.ABI-tag) } 241 /DISCARD/ : { *(.note.ABI-tag) }
241 /DISCARD/ : { *(.interp) } 242 /DISCARD/ : { *(.interp) }
242 } 243 }
OLDNEW
« no previous file with comments | « nacl/dyn-link/ldscripts/elf64_nacl.xs ('k') | nacl/dyn-link/ldscripts/elf_nacl.xs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698