HACK: move up stage2
[asbestos.git] / stage2 / stage2_native.ld
blob471c887e23126b41634ee740e5b68bf22e431134
1 /*  stage2.ld - AsbestOS stage2 linker script
3 Copyright (C) 2010-2011  Hector Martin "marcan" <hector@marcansoft.com>
5 This code is licensed to you under the terms of the GNU GPL, version 2;
6 see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
7 */
9 OUTPUT_FORMAT("elf64-powerpc")
10 OUTPUT_ARCH(powerpc:common64)
12 /* stage2 runs in realmode */
13 __base = 0x1c00000;
15 /* address of the devicetree buffer */
16 __devtree = 0x1ff0000;
18 ENTRY(_entry)
20 PHDRS {
21         all             PT_LOAD FLAGS(7);
24 SECTIONS {
25         . = __base;
26         __self_start = .;
28         .vectors : {
29                 *(.vectors)
30         } :all = 0
32         .start : {
33                 *(.start)
34         }
36         .text : {
37                 *(.text)
38                 *(.text.*)
39         }
41         . = ALIGN(64);
42         .opd : {
43                 *(.opd)
44         }
45         .toc : {
46                 __toc_start = .;
47                 *(.got)
48                 *(.toc)
49         }
51         .rodata : {
52                 *(.rodata)
53                 *(.rodata.*)
54         }
56         .data : {
57                 *(.data)
58                 *(.data.*)
59                 *(.sdata)
60                 *(.sdata.*)
61         }
62         . = ALIGN(64);
63         __self_end = .;
65         __bss_start = .;
66         .bss : {
67                 *(.sbss)
68                 *(.sbss.*)
69                 *(COMMON)
70                 *(.bss)
71                 *(.bss.*)
72         }
73         __bss_end = .;
75         . = ALIGN(64);
77         .stack : {
78                 _stack_top = .;
79                 . += 32768;
80                 _stack_bot = .;
81         } :NONE
83         .excstack : {
84                 _excstack_top = .;
85                 . += 32768;
86                 _excstack_bot = .;
87         } :NONE
89         __freemem = .;