summaryrefslogtreecommitdiffstats
path: root/qemu/roms/openbios/arch/x86/ldscript
blob: 8976c7af03be208289fedbef7c93e20c381c4d84 (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
OUTPUT_FORMAT(elf32-i386)
OUTPUT_ARCH(i386)

ENTRY(entry)

/* Initial load address
 * To be loaded by GRUB, this must be >= 1MB
 */
BASE_ADDR = 0x100000;

/* 16KB heap and stack */
HEAP_SIZE = 16384;
STACK_SIZE = 16384;

SECTIONS
{
    . = BASE_ADDR;

    /* Put Multiboot header near beginning of file, if any. */
    .hdr : { *(.hdr) *(.hdr.*) }

    /* Start of the program. 
     * Now the version string is in the note, we must include it
     * in the program. Otherwise we lose the string after relocation. */
    . = ALIGN(16);
    _start = .;

    /* Putting ELF notes near beginning of file might help bootloaders.
     * We discard .note sections other than .note.ELFBoot,
     * because some versions of GCC generates useless ones. */
    .note : { *(.note.ELFBoot) }

    /* Normal sections */
    .text : { *(.text) *(.text.*) }
    .rodata : {
	. = ALIGN(4);
	sound_drivers_start = .;
	*(.rodata.sound_drivers)
	sound_drivers_end = .;
	*(.rodata)
	*(.rodata.*)
    }
    .data : { *(.data) *(.data.*) }

    .bss : {
	*(.bss)
	*(.bss.*)
	*(COMMON)

	/* Put heap and stack here, so they are included in PT_LOAD segment
	 * and the bootloader is aware of it. */

	. = ALIGN(16);
	_heap = .;
	. += HEAP_SIZE;
	. = ALIGN(16);
	_eheap = .;

	_stack = .;
	. += STACK_SIZE;
	. = ALIGN(16);
	_estack = .;
    }

    .initctx : {
	/* Initial contents of stack. This MUST BE just after the stack. */
	*(.initctx)
    }

    _end = .;

    /DISCARD/ : { *(.comment) *(.note) }
}