diff options
author | Frans Kaashoek <[email protected]> | 2011-08-07 12:30:34 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2011-08-07 12:30:34 -0400 |
commit | 67d4254d15313ce24ef37c6e92b4630211c2229b (patch) | |
tree | f78ae74db6e9190b68911f149d413696b51205f2 /kernel.ld | |
parent | 547c28fc1e0cd834b2f1ab56a5c74e6b7839c582 (diff) | |
download | xv6-labs-67d4254d15313ce24ef37c6e92b4630211c2229b.tar.gz xv6-labs-67d4254d15313ce24ef37c6e92b4630211c2229b.tar.bz2 xv6-labs-67d4254d15313ce24ef37c6e92b4630211c2229b.zip |
oops
Diffstat (limited to 'kernel.ld')
-rw-r--r-- | kernel.ld | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/kernel.ld b/kernel.ld new file mode 100644 index 0000000..3726f4e --- /dev/null +++ b/kernel.ld @@ -0,0 +1,59 @@ +/* Simple linker script for the JOS kernel. + See the GNU ld 'info' manual ("info ld") to learn the syntax. */ + +OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") +OUTPUT_ARCH(i386) +ENTRY(_start) + +SECTIONS +{ + /* Load the kernel at this address: "." means the current address */ + . = 0xF0100000; + + .text : AT(0x100000) { + *(.text .stub .text.* .gnu.linkonce.t.*) + } + + PROVIDE(etext = .); /* Define the 'etext' symbol to this value */ + + .rodata : { + *(.rodata .rodata.* .gnu.linkonce.r.*) + } + + /* Include debugging information in kernel memory */ + .stab : { + PROVIDE(__STAB_BEGIN__ = .); + *(.stab); + PROVIDE(__STAB_END__ = .); + BYTE(0) /* Force the linker to allocate space + for this section */ + } + + .stabstr : { + PROVIDE(__STABSTR_BEGIN__ = .); + *(.stabstr); + PROVIDE(__STABSTR_END__ = .); + BYTE(0) /* Force the linker to allocate space + for this section */ + } + + /* Adjust the address for the data segment to the next page */ + . = ALIGN(0x1000); + + /* The data segment */ + .data : { + *(.data) + } + + PROVIDE(edata = .); + + .bss : { + *(.bss) + } + + PROVIDE(end = .); + + /DISCARD/ : { + *(.eh_frame .note.GNU-stack) + } +} |