xref: /linux/arch/um/kernel/uml.lds.S (revision 5d7f3375cd574fc83f0cd30839b21455c0e79ae2)
1/* SPDX-License-Identifier: GPL-2.0 */
2#include <asm/vmlinux.lds.h>
3#include <asm/page.h>
4
5OUTPUT_FORMAT(ELF_FORMAT)
6OUTPUT_ARCH(ELF_ARCH)
7ENTRY(_start)
8jiffies = jiffies_64;
9
10VERSION {
11  {
12    local: *;
13  };
14}
15
16SECTIONS
17{
18  /* This must contain the right address - not quite the default ELF one.*/
19  PROVIDE (__executable_start = START);
20  /* Static binaries stick stuff here, like the sigreturn trampoline,
21   * invisibly to objdump.  So, just make __binary_start equal to the very
22   * beginning of the executable, and if there are unmapped pages after this,
23   * they are forever unusable.
24   */
25  __binary_start = START;
26
27  . = START + SIZEOF_HEADERS;
28  . = ALIGN(PAGE_SIZE);
29
30  _text = .;
31  __init_begin = .;
32  INIT_TEXT_SECTION(0)
33
34  init.data : { INIT_DATA }
35  . = ALIGN(PAGE_SIZE);
36  __init_end = .;
37
38  .text      :
39  {
40    _stext = .;
41    TEXT_TEXT
42    SCHED_TEXT
43    LOCK_TEXT
44    IRQENTRY_TEXT
45    SOFTIRQENTRY_TEXT
46    *(.fixup)
47    /* .gnu.warning sections are handled specially by elf32.em.  */
48    *(.gnu.warning)
49    *(.gnu.linkonce.t*)
50  }
51
52  . = ALIGN(PAGE_SIZE);
53  .syscall_stub : {
54	__syscall_stub_start = .;
55	*(.__syscall_stub*)
56	__syscall_stub_end = .;
57  }
58
59  /*
60   * These are needed even in a static link, even if they wind up being empty.
61   * Newer glibc needs these __rel{,a}_iplt_{start,end} symbols.
62   */
63  .rel.plt : {
64	*(.rel.plt)
65	PROVIDE_HIDDEN(__rel_iplt_start = .);
66	*(.rel.iplt)
67	PROVIDE_HIDDEN(__rel_iplt_end = .);
68  }
69  .rela.plt : {
70	*(.rela.plt)
71	PROVIDE_HIDDEN(__rela_iplt_start = .);
72	*(.rela.iplt)
73	PROVIDE_HIDDEN(__rela_iplt_end = .);
74  }
75
76  #include <asm/common.lds.S>
77
78  .data    :
79  {
80    INIT_TASK_DATA(KERNEL_STACK_SIZE)
81    DATA_DATA
82    *(.ldata .ldata.[0-9a-zA-Z_]* .ldata..L*)
83    *(.gnu.linkonce.d*)
84    CONSTRUCTORS
85  }
86  .data1   : { *(.data1) }
87  .ctors         :
88  {
89    *(.ctors)
90  }
91  .dtors         :
92  {
93    *(.dtors)
94  }
95
96  .got           : { *(.got.plt) *(.got) }
97  .eh_frame       : { KEEP (*(.eh_frame)) }
98  .dynamic       : { *(.dynamic) }
99  .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
100  .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
101  /* We want the small data sections together, so single-instruction offsets
102     can access them all, and initialized data all before uninitialized, so
103     we can shorten the on-disk segment size.  */
104  .sdata     : { *(.sdata) }
105  _edata  =  .;
106  PROVIDE (edata = .);
107  . = ALIGN(PAGE_SIZE);
108  __bss_start = .;
109  PROVIDE(_bss_start = .);
110  SBSS(0)
111  BSS(0)
112  .lbss : { *(.lbss .lbss.[0-9a-zA-Z_]* .lbss..L*) }
113   __bss_stop = .;
114  _end = .;
115  PROVIDE (end = .);
116
117  STABS_DEBUG
118  DWARF_DEBUG
119  MODINFO
120  ELF_DETAILS
121
122  DISCARDS
123}
124