From 2445b4766153d2aab8afd598f529c4f10b418a73 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 14 Jul 2016 18:06:52 +0200 Subject: [PATCH 1/2] Add aligned .got and .got.plt sections to linker script --- src/arch/x86_64/linker.ld | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/arch/x86_64/linker.ld b/src/arch/x86_64/linker.ld index ff773527..bbf83adf 100644 --- a/src/arch/x86_64/linker.ld +++ b/src/arch/x86_64/linker.ld @@ -40,6 +40,18 @@ SECTIONS { . = ALIGN(4K); } + .got : + { + *(.got) + . = ALIGN(4K); + } + + .got.plt : + { + *(.got.plt) + . = ALIGN(4K); + } + .data.rel.ro : ALIGN(4K) { *(.data.rel.ro.local*) *(.data.rel.ro .data.rel.ro.*) . = ALIGN(4K); From 68c1e42356573b6189667e4b0898f85f1a1f642f Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 14 Jul 2016 18:11:58 +0200 Subject: [PATCH 2/2] Update linker script in post (add .got and .got.plt) --- blog/post/2016-01-01-remap-the-kernel.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/blog/post/2016-01-01-remap-the-kernel.md b/blog/post/2016-01-01-remap-the-kernel.md index 4bca80cf..76601bc9 100644 --- a/blog/post/2016-01-01-remap-the-kernel.md +++ b/blog/post/2016-01-01-remap-the-kernel.md @@ -650,6 +650,8 @@ To put all sections on their own page, we add the `ALIGN` statement to all of th ``` /* src/arch/x86_64/linker.ld */ +ENTRY(start) + SECTIONS { . = 1M; @@ -679,6 +681,18 @@ SECTIONS { . = ALIGN(4K); } + .got : + { + *(.got) + . = ALIGN(4K); + } + + .got.plt : + { + *(.got.plt) + . = ALIGN(4K); + } + .data.rel.ro : ALIGN(4K) { *(.data.rel.ro.local*) *(.data.rel.ro .data.rel.ro.*) . = ALIGN(4K);