blob: 6899195602b77fd3ed259f41977a2984faa902f4 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#include <asm-generic/vmlinux.lds.h>
Cyrill Gorcunova7dfa942008-05-12 14:01:56 -07002#include <asm/page.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07003
4OUTPUT_FORMAT(ELF_FORMAT)
5OUTPUT_ARCH(ELF_ARCH)
6ENTRY(_start)
7jiffies = jiffies_64;
8
9SECTIONS
10{
Jeff Dike23bbd5862006-07-10 04:45:06 -070011 /* This must contain the right address - not quite the default ELF one.*/
Linus Torvalds1da177e2005-04-16 15:20:36 -070012 PROVIDE (__executable_start = START);
Jeff Dike23bbd5862006-07-10 04:45:06 -070013 /* 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 Torvalds1da177e2005-04-16 15:20:36 -070019
Jeff Dike23bbd5862006-07-10 04:45:06 -070020 . = START + SIZEOF_HEADERS;
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
Jeff Diked1480c52006-10-30 22:07:13 -080022 _text = .;
Richard Weinberger6915e042010-10-26 14:21:16 -070023 INIT_TEXT_SECTION(0)
Cyrill Gorcunova7dfa942008-05-12 14:01:56 -070024 . = ALIGN(PAGE_SIZE);
Jeff Diked67b5692005-07-07 17:56:49 -070025
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 .text :
27 {
Jiang Liua214a8c2013-07-03 15:03:40 -070028 _stext = .;
Sam Ravnborg76647092007-05-13 00:31:33 +020029 TEXT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070030 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 Dikec7ec16d2007-08-30 23:56:17 -070036 }
Jeff Diked67b5692005-07-07 17:56:49 -070037
Cyrill Gorcunova7dfa942008-05-12 14:01:56 -070038 . = ALIGN(PAGE_SIZE);
Jeff Dikec7ec16d2007-08-30 23:56:17 -070039 .syscall_stub : {
40 __syscall_stub_start = .;
41 *(.__syscall_stub*)
42 __syscall_stub_end = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 }
44
Roland McGrathaa5fb4d2010-10-26 14:22:19 -070045 /*
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 Viro37185b32012-10-08 03:27:32 +010062 #include <asm/common.lds.S>
Linus Torvalds1da177e2005-04-16 15:20:36 -070063
Jiang Liua214a8c2013-07-03 15:03:40 -070064 __init_begin = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010065 init.data : { INIT_DATA }
Jiang Liua214a8c2013-07-03 15:03:40 -070066 __init_end = .;
67
Linus Torvalds1da177e2005-04-16 15:20:36 -070068 .data :
69 {
Tim Abbott5d150a972009-09-24 10:36:20 -040070 INIT_TASK_DATA(KERNEL_STACK_SIZE)
Jeff Dikec14b8492007-05-10 22:22:34 -070071 . = ALIGN(KERNEL_STACK_SIZE);
Denys Vlasenko9d1578a2010-02-20 01:03:41 +010072 *(.data..init_irqstack)
Sam Ravnborgca967252007-05-17 13:38:44 +020073 DATA_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070074 *(.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 Dikeba9950c2005-05-20 13:59:07 -070089 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
90 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
Linus Torvalds1da177e2005-04-16 15:20:36 -070091 /* 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 Gorcunova7dfa942008-05-12 14:01:56 -070097 . = ALIGN(PAGE_SIZE);
Tim Abbott5d150a972009-09-24 10:36:20 -040098 __bss_start = .;
99 PROVIDE(_bss_start = .);
100 SBSS(0)
101 BSS(0)
Jiang Liua214a8c2013-07-03 15:03:40 -0700102 __bss_stop = .;
Paolo 'Blaisorblade' Giarrussoa7d0c212005-09-10 19:44:54 +0200103 _end = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104 PROVIDE (end = .);
Paolo 'Blaisorblade' Giarrussoa7d0c212005-09-10 19:44:54 +0200105
106 STABS_DEBUG
107
108 DWARF_DEBUG
Tejun Heo405d9672009-06-24 15:13:38 +0900109
Tejun Heo023bf6f2009-07-09 11:27:40 +0900110 DISCARDS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111}