summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-06-26 22:09:44 +0200
committerRichard Braun <rbraun@sceen.net>2018-06-26 22:09:44 +0200
commitc518968ee15d845a6d8c2015aed643495045e551 (patch)
treeede7fb06c6d649424efa70e4fba85d1455d054ec /arch
parent838d2f6f9bb85b849a382262e58f421268ad80ea (diff)
x86: update linker script to include the embedded symbol table
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/x15.lds.S17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/x86/x15.lds.S b/arch/x86/x15.lds.S
index b896a5d6..260d230c 100644
--- a/arch/x86/x15.lds.S
+++ b/arch/x86/x15.lds.S
@@ -23,6 +23,10 @@ PHDRS
text PT_LOAD FLAGS(5);
rodata PT_LOAD FLAGS(4);
data PT_LOAD FLAGS(6);
+
+#ifdef CONFIG_SYMTAB
+ symbol PT_LOAD FLAGS(6);
+#endif
}
SECTIONS
@@ -91,6 +95,19 @@ SECTIONS
*(.bss*)
} : data
+#ifdef CONFIG_SYMTAB
+ /*
+ * Including the embedded symbol table last should reliably prevent
+ * the second link from changing the addresses of the kernel symbols.
+ *
+ * In addition, use a program header different from data to make
+ * sure the linker doesn't include the .bss section in the output file.
+ */
+ .symbol ALIGN(PAGE_SIZE) : AT(BOOT_VTOP(ADDR(.symbol))) {
+ *(.symbol*)
+ } : symbol
+#endif /* CONFIG_SYMTAB */
+
. = ALIGN(PAGE_SIZE);
_end = .;