x86: put global data pointer into the .data section
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 14 Oct 2018 03:52:07 +0000 (20:52 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Mon, 22 Oct 2018 09:51:45 +0000 (17:51 +0800)
commit2c78a79ec7fc0b3729e9f16214cf8e08e4664a0b
tree7945d654e9e4ee84aa4c582b341287a5a238336c
parent80df194f0165cb540a2a984f95dd2b37948f54d7
x86: put global data pointer into the .data section

On x86_64 the field global_data_ptr is assigned before relocation. As
sections for uninitialized global data (.bss) overlap with the relocation
sections (.rela) this destroys the relocation table and leads to spurious
errors.

Initialization forces the global_data_ptr into a section for initialized
global data (.data) which cannot overlap any .rela section.

Fixes: a160092a610f ("x86: Support global_data on x86_64")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/x86_64/cpu.c