xref: /netbsd-src/sys/arch/evbarm/conf/ldscript.evbarm (revision 70f4129b0c23afed3d1381ecfdd06526d9b203ea)
1/*	$NetBSD: ldscript.evbarm,v 1.15 2023/02/11 19:09:57 mlelstv Exp $	*/
2
3ENTRY(KERNEL_BASE_phys)
4SECTIONS
5{
6  KERNEL_BASE_phys = @KERNEL_BASE_PHYS@;
7  KERNEL_BASE_virt = @KERNEL_BASE_VIRT@;
8
9  /* Kernel start: */
10  .start (KERNEL_BASE_phys) :
11  {
12    *(.start)
13  }
14
15  /* Read-only sections, merged into text segment: */
16  .text (KERNEL_BASE_virt + ALIGN(SIZEOF(.start), ALIGNOF(.text))) :
17  AT (LOADADDR(.start) + ALIGN(SIZEOF(.start), ALIGNOF(.text)))
18  {
19    *(.text)
20    *(.text.*)
21    *(.stub)
22    *(.glue_7t) *(.glue_7)
23  }
24
25  PROVIDE(__rodata_start = .);
26  .rodata :
27  {
28    *(.rodata)
29    *(.rodata.*)
30    . = ALIGN(64);
31    __CTOR_LIST__ = .;
32    *(.ctors)
33    *(.init_array)
34    __CTOR_END__ = .;
35  }
36
37  PROVIDE (__etext = .);
38  PROVIDE (_etext = .);
39  PROVIDE (etext = .);
40
41  /* Adjust the address for the data segment to start on the next large page
42     boundary.  */
43  . = ALIGN(0x10000);
44  .data    :
45  {
46    __data_start = . ;
47    *(.data)
48    *(.data.*)
49  }
50  .sdata     :
51  {
52    *(.sdata)
53    *(.sdata.*)
54  }
55  . = ALIGN(8);
56  _edata = .;
57  PROVIDE (edata = .);
58  __bss_start = .;
59  __bss_start__ = .;
60  .sbss      :
61  {
62    PROVIDE (__sbss_start = .);
63    PROVIDE (___sbss_start = .);
64    *(.dynsbss)
65    *(.sbss)
66    *(.sbss.*)
67    *(.scommon)
68    PROVIDE (__sbss_end = .);
69    PROVIDE (___sbss_end = .);
70  }
71  .bss       :
72  {
73    *(.dynbss)
74    *(.bss)
75    *(.bss.*)
76    *(COMMON)
77    /* Align here to ensure that the .bss section occupies space up to
78       _end.  Align after .bss to ensure correct alignment even if the
79       .bss section disappears because there are no input sections.  */
80    . = ALIGN(32 / 8);
81  }
82  . = ALIGN(32 / 8);
83  _end = .;
84  _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
85  PROVIDE (end = .);
86}
87