Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #include <asm-generic/vmlinux.lds.h> |
Cyrill Gorcunov | a7dfa94 | 2008-05-12 14:01:56 -0700 | [diff] [blame] | 2 | #include <asm/page.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | |
| 4 | OUTPUT_FORMAT(ELF_FORMAT) |
| 5 | OUTPUT_ARCH(ELF_ARCH) |
| 6 | ENTRY(_start) |
| 7 | jiffies = jiffies_64; |
| 8 | |
| 9 | SECTIONS |
| 10 | { |
Jeff Dike | 23bbd586 | 2006-07-10 04:45:06 -0700 | [diff] [blame] | 11 | /* This must contain the right address - not quite the default ELF one.*/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | PROVIDE (__executable_start = START); |
Jeff Dike | 23bbd586 | 2006-07-10 04:45:06 -0700 | [diff] [blame] | 13 | /* Static binaries stick stuff here, like the sigreturn trampoline, |
| 14 | * invisibly to objdump. So, just make __binary_start equal to the very |
| 15 | * beginning of the executable, and if there are unmapped pages after this, |
| 16 | * they are forever unusable. |
| 17 | */ |
| 18 | __binary_start = START; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | |
Jeff Dike | 23bbd586 | 2006-07-10 04:45:06 -0700 | [diff] [blame] | 20 | . = START + SIZEOF_HEADERS; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | |
Jeff Dike | d1480c5 | 2006-10-30 22:07:13 -0800 | [diff] [blame] | 22 | _text = .; |
Richard Weinberger | 6915e04 | 2010-10-26 14:21:16 -0700 | [diff] [blame] | 23 | INIT_TEXT_SECTION(0) |
Cyrill Gorcunov | a7dfa94 | 2008-05-12 14:01:56 -0700 | [diff] [blame] | 24 | . = ALIGN(PAGE_SIZE); |
Jeff Dike | d67b569 | 2005-07-07 17:56:49 -0700 | [diff] [blame] | 25 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | .text : |
| 27 | { |
Jiang Liu | a214a8c | 2013-07-03 15:03:40 -0700 | [diff] [blame] | 28 | _stext = .; |
Sam Ravnborg | 7664709 | 2007-05-13 00:31:33 +0200 | [diff] [blame] | 29 | TEXT_TEXT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | SCHED_TEXT |
| 31 | LOCK_TEXT |
| 32 | *(.fixup) |
| 33 | /* .gnu.warning sections are handled specially by elf32.em. */ |
| 34 | *(.gnu.warning) |
| 35 | *(.gnu.linkonce.t*) |
Jeff Dike | c7ec16d | 2007-08-30 23:56:17 -0700 | [diff] [blame] | 36 | } |
Jeff Dike | d67b569 | 2005-07-07 17:56:49 -0700 | [diff] [blame] | 37 | |
Cyrill Gorcunov | a7dfa94 | 2008-05-12 14:01:56 -0700 | [diff] [blame] | 38 | . = ALIGN(PAGE_SIZE); |
Jeff Dike | c7ec16d | 2007-08-30 23:56:17 -0700 | [diff] [blame] | 39 | .syscall_stub : { |
| 40 | __syscall_stub_start = .; |
| 41 | *(.__syscall_stub*) |
| 42 | __syscall_stub_end = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | } |
| 44 | |
Roland McGrath | aa5fb4d | 2010-10-26 14:22:19 -0700 | [diff] [blame] | 45 | /* |
| 46 | * These are needed even in a static link, even if they wind up being empty. |
| 47 | * Newer glibc needs these __rel{,a}_iplt_{start,end} symbols. |
| 48 | */ |
| 49 | .rel.plt : { |
| 50 | *(.rel.plt) |
| 51 | PROVIDE_HIDDEN(__rel_iplt_start = .); |
| 52 | *(.rel.iplt) |
| 53 | PROVIDE_HIDDEN(__rel_iplt_end = .); |
| 54 | } |
| 55 | .rela.plt : { |
| 56 | *(.rela.plt) |
| 57 | PROVIDE_HIDDEN(__rela_iplt_start = .); |
| 58 | *(.rela.iplt) |
| 59 | PROVIDE_HIDDEN(__rela_iplt_end = .); |
| 60 | } |
| 61 | |
Al Viro | 37185b3 | 2012-10-08 03:27:32 +0100 | [diff] [blame] | 62 | #include <asm/common.lds.S> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | |
Jiang Liu | a214a8c | 2013-07-03 15:03:40 -0700 | [diff] [blame] | 64 | __init_begin = .; |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 65 | init.data : { INIT_DATA } |
Jiang Liu | a214a8c | 2013-07-03 15:03:40 -0700 | [diff] [blame] | 66 | __init_end = .; |
| 67 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | .data : |
| 69 | { |
Tim Abbott | 5d150a97 | 2009-09-24 10:36:20 -0400 | [diff] [blame] | 70 | INIT_TASK_DATA(KERNEL_STACK_SIZE) |
Jeff Dike | c14b849 | 2007-05-10 22:22:34 -0700 | [diff] [blame] | 71 | . = ALIGN(KERNEL_STACK_SIZE); |
Denys Vlasenko | 9d1578a | 2010-02-20 01:03:41 +0100 | [diff] [blame] | 72 | *(.data..init_irqstack) |
Sam Ravnborg | ca96725 | 2007-05-17 13:38:44 +0200 | [diff] [blame] | 73 | DATA_DATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | *(.gnu.linkonce.d*) |
| 75 | CONSTRUCTORS |
| 76 | } |
| 77 | .data1 : { *(.data1) } |
| 78 | .ctors : |
| 79 | { |
| 80 | *(.ctors) |
| 81 | } |
| 82 | .dtors : |
| 83 | { |
| 84 | *(.dtors) |
| 85 | } |
| 86 | |
| 87 | .got : { *(.got.plt) *(.got) } |
| 88 | .dynamic : { *(.dynamic) } |
Jeff Dike | ba9950c | 2005-05-20 13:59:07 -0700 | [diff] [blame] | 89 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } |
| 90 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | /* We want the small data sections together, so single-instruction offsets |
| 92 | can access them all, and initialized data all before uninitialized, so |
| 93 | we can shorten the on-disk segment size. */ |
| 94 | .sdata : { *(.sdata) } |
| 95 | _edata = .; |
| 96 | PROVIDE (edata = .); |
Cyrill Gorcunov | a7dfa94 | 2008-05-12 14:01:56 -0700 | [diff] [blame] | 97 | . = ALIGN(PAGE_SIZE); |
Tim Abbott | 5d150a97 | 2009-09-24 10:36:20 -0400 | [diff] [blame] | 98 | __bss_start = .; |
| 99 | PROVIDE(_bss_start = .); |
| 100 | SBSS(0) |
| 101 | BSS(0) |
Jiang Liu | a214a8c | 2013-07-03 15:03:40 -0700 | [diff] [blame] | 102 | __bss_stop = .; |
Paolo 'Blaisorblade' Giarrusso | a7d0c21 | 2005-09-10 19:44:54 +0200 | [diff] [blame] | 103 | _end = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | PROVIDE (end = .); |
Paolo 'Blaisorblade' Giarrusso | a7d0c21 | 2005-09-10 19:44:54 +0200 | [diff] [blame] | 105 | |
| 106 | STABS_DEBUG |
| 107 | |
| 108 | DWARF_DEBUG |
Tejun Heo | 405d967 | 2009-06-24 15:13:38 +0900 | [diff] [blame] | 109 | |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 110 | DISCARDS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | } |