aboutsummaryrefslogtreecommitdiff
path: root/defs/x86_64-linker.ld
blob: b48436600cd43e9d17842296a265c2cdfe8b8fa9 (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
SECTIONS
{
   . = 0x100000;     /* system's start address */

   .text :
   {
      *(".text")
      *(".text.*")
      *(".text$")
      *(".init")
      *(".fini")
      *(".gnu.linkonce.*")
   }

   .init_array :
   {
      PROVIDE_HIDDEN (__init_array_start = .);
      KEEP (*(SORT(.init_array.*)))
      KEEP (*(.init_array))
      KEEP (*(".ctors"))
      KEEP (*(".ctor"))
      PROVIDE_HIDDEN (__init_array_end = .);
   }

   .fini_array :
   {
      PROVIDE_HIDDEN (__fini_array_start = .);
      KEEP (*(SORT(.fini_array.*)))
      KEEP (*(.fini_array))
      KEEP (*(".dtors"))
      KEEP (*(".dtor"))
      PROVIDE_HIDDEN (__fini_array_end = .);
   }

   .data :
   {
      *(".data")
      *(".data$")
      *(".rodata")
      *(".rodata.*")
      *(".got")
      *(".got.plt")
      *(".eh_frame")
      *(".eh_fram")
      *(".jcr")
      *(".note.*")
   }

   .bss :
   {
      ___BSS_START__ = .;
      *(".bss")
      *(".bss.*")
      ___BSS_END__ = .;
   }

   /* global page table for 64-bit long mode */
   .global_pagetable ALIGN(4096) (NOLOAD) :
   {
      *(".global_pagetable")
   }

/*
   /DISCARD/ :
   {
      *(".note")
      *(".comment")
      *(".debug_line")
      *(".debug_info")
      *(".debug_abbrev")
      *(".debug_aranges")
   }
*/
	. = ALIGN(4096);
	PROVIDE (___KERNEL_END__ = .);
}