summaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed/head_64.S
diff options
context:
space:
mode:
authorH. Peter Anvin2010-08-03 00:34:44 +0200
committerH. Peter Anvin2010-08-03 00:34:44 +0200
commit22a57f5896df218356bae6203dfaf04bcfd6c88c (patch)
treee956ddcf7edf8457978d324a2e9c954b31be2206 /arch/x86/boot/compressed/head_64.S
parentx86, setup: Only set early_serial_base after port is initialized (diff)
downloadkernel-qcow2-linux-22a57f5896df218356bae6203dfaf04bcfd6c88c.tar.gz
kernel-qcow2-linux-22a57f5896df218356bae6203dfaf04bcfd6c88c.tar.xz
kernel-qcow2-linux-22a57f5896df218356bae6203dfaf04bcfd6c88c.zip
x86, setup: Allow global variables and functions in the decompressor
In order for global variables and functions to work in the decompressor, we need to fix up the GOT in assembly code. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> LKML-Reference: <4C57382E.8050501@zytor.com>
Diffstat (limited to 'arch/x86/boot/compressed/head_64.S')
-rw-r--r--arch/x86/boot/compressed/head_64.S13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index faff0dc9c06a..52f85a196fa0 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -280,6 +280,19 @@ relocated:
rep stosq
/*
+ * Adjust our own GOT
+ */
+ leaq _got(%rip), %rdx
+ leaq _egot(%rip), %rcx
+1:
+ cmpq %rcx, %rdx
+ jae 2f
+ addq %rbx, (%rdx)
+ addq $8, %rdx
+ jmp 1b
+2:
+
+/*
* Do the decompression, and jump to the new kernel..
*/
pushq %rsi /* Save the real mode argument */