summaryrefslogtreecommitdiff
path: root/kernel.ld
diff options
context:
space:
mode:
Diffstat (limited to 'kernel.ld')
-rw-r--r--kernel.ld41
1 files changed, 11 insertions, 30 deletions
diff --git a/kernel.ld b/kernel.ld
index e24c860..e78fd38 100644
--- a/kernel.ld
+++ b/kernel.ld
@@ -1,22 +1,13 @@
-/* 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)
+OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
+OUTPUT_ARCH(i386:x86-64)
SECTIONS
{
- /* Link the kernel at this address: "." means the current address */
- /* Must be equal to KERNLINK */
- . = 0x80100000;
-
+ . = 0xFFFFFF0000100000;
+ PROVIDE(text = .);
.text : AT(0x100000) {
*(.text .stub .text.* .gnu.linkonce.t.*)
}
-
- PROVIDE(etext = .); /* Define the 'etext' symbol to this value */
-
.rodata : {
*(.rodata .rodata.* .gnu.linkonce.r.*)
}
@@ -38,31 +29,21 @@ SECTIONS
for this section */
}
- /* Adjust the address for the data segment to the next page */
. = ALIGN(0x1000);
- /* Conventionally, Unix linkers provide pseudo-symbols
- * etext, edata, and end, at the end of the text, data, and bss.
- * For the kernel mapping, we need the address at the beginning
- * of the data section, but that's not one of the conventional
- * symbols, because the convention started before there was a
- * read-only rodata section between text and data. */
- PROVIDE(data = .);
-
- /* The data segment */
+ /* Conventionally, Unix linkers provide pseudo-symbols
+ * etext, edata, and end, at the end of the text, data, and bss.
+ * For the kernel mapping, we need the address at the beginning
+ * of the data section, but that's not one of the conventional
+ * symbols, because the convention started before there was a
+ * read-only rodata section between text and data. */
+ PROVIDE(data = .);
.data : {
*(.data)
}
-
PROVIDE(edata = .);
-
.bss : {
*(.bss)
}
-
PROVIDE(end = .);
-
- /DISCARD/ : {
- *(.eh_frame .note.GNU-stack)
- }
}