Message ID | 1539489134-9847-8-git-send-email-bmeng.cn@gmail.com |
---|---|
State | Accepted |
Delegated to: | Bin Meng |
Headers | show |
Series | x86: Bring qemu-x86_64 target in travis-ci build/testing | expand |
diff --git a/arch/x86/cpu/x86_64/cpu.c b/arch/x86/cpu/x86_64/cpu.c index 18b3e94..ef5e812 100644 --- a/arch/x86/cpu/x86_64/cpu.c +++ b/arch/x86/cpu/x86_64/cpu.c @@ -7,8 +7,14 @@ #include <common.h> #include <debug_uart.h> -/* Global declaration of gd */ -struct global_data *global_data_ptr; +/* + * Global declaration of gd. + * + * As we write to it before relocation we have to make sure it is not put into + * a .bss section which may overlap a .rela section. Initialization forces it + * into a .data section which cannot overlap any .rela section. + */ +struct global_data *global_data_ptr = (struct global_data *)~0; void arch_setup_gd(gd_t *new_gd) {