summaryrefslogtreecommitdiff
path: root/sys/arch/evbarm/conf/ldscript.evbarm
blob: 6d66d942abf51884a95d8e072da73b5cbb3e41ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*	$NetBSD: ldscript.evbarm,v 1.15 2023/02/11 19:09:57 mlelstv Exp $	*/

ENTRY(KERNEL_BASE_phys)
SECTIONS
{
  KERNEL_BASE_phys = @KERNEL_BASE_PHYS@;
  KERNEL_BASE_virt = @KERNEL_BASE_VIRT@;

  /* Kernel start: */
  .start (KERNEL_BASE_phys) :
  {
    *(.start)
  }

  /* Read-only sections, merged into text segment: */
  .text (KERNEL_BASE_virt + ALIGN(SIZEOF(.start), ALIGNOF(.text))) :
  AT (LOADADDR(.start) + ALIGN(SIZEOF(.start), ALIGNOF(.text)))
  {
    *(.text)
    *(.text.*)
    *(.stub)
    *(.glue_7t) *(.glue_7)
  }

  PROVIDE(__rodata_start = .);
  .rodata :
  {
    *(.rodata)
    *(.rodata.*)
    . = ALIGN(64);
    __CTOR_LIST__ = .;
    *(.ctors)
    *(.init_array)
    __CTOR_END__ = .;
  }

  PROVIDE (__etext = .);
  PROVIDE (_etext = .);
  PROVIDE (etext = .);

  /* Adjust the address for the data segment to start on the next large page
     boundary.  */
  . = ALIGN(0x10000);
  .data    :
  {
    __data_start = . ;
    *(.data)
    *(.data.*)
  }
  .sdata     :
  {
    *(.sdata)
    *(.sdata.*)
  }
  . = ALIGN(8);
  _edata = .;
  PROVIDE (edata = .);
  __bss_start = .;
  __bss_start__ = .;
  .sbss      :
  {
    PROVIDE (__sbss_start = .);
    PROVIDE (___sbss_start = .);
    *(.dynsbss)
    *(.sbss)
    *(.sbss.*)
    *(.scommon)
    PROVIDE (__sbss_end = .);
    PROVIDE (___sbss_end = .);
  }
  .bss       :
  {
    *(.dynbss)
    *(.bss)
    *(.bss.*)
    *(COMMON)
    /* Align here to ensure that the .bss section occupies space up to
       _end.  Align after .bss to ensure correct alignment even if the
       .bss section disappears because there are no input sections.  */
    . = ALIGN(32 / 8);
  }
  . = ALIGN(32 / 8);
  _end = .;
  _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
  PROVIDE (end = .);
}