x86: Fix car_uninit weak symbol definition
PATCH 1/1 x86: Fix car_uninit weak symbol definition
Since commit 80df194f0165 ("x86: detect unsupported relocation types"), an error message is seen on QEMU x86 target during boot:
do_elf_reloc_fixups32: unsupported relocation type 0x1 at fff841f0, offset = 0xfff00087do_elf_reloc_fixups32: unsupported relocation type 0x2 at fff841f8, offset = 0xfff00091
Check offset 0xfff00087 and 0xfff00091 in the u-boot ELF image,
fff00087 000df401 R_386_32 00000000 car_uninit fff00091 000df402 R_386_PC32 00000000 car_uninit
we see R_386_32 and R_386_PC32 relocation type is generated for symbol car_uninit, which is declared as a weak symbol in start.S.
However the actual weak symbol implementation ends up nowhere. As we can see below, it's *UND*.
$ objdump -t u-boot | grep car_uninit 00000000 w *UND* 00000000 car_uninit
With this fix, it is normal now.
$ objdump -t u-boot | grep car_uninit fff00094 w F .text.start 00000001 car_uninit
---
arch/x86/cpu/start.S | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/x86/cpu/start.S +6 -6
@@ -16,6 +16,7 @@ #include <asm/processor-flags.h> #include <generated/generic-asm-offsets.h> #include <generated/asm-offsets.h> +#include <linux/linkage.h> .section .text.start .code32
@@ -184,13 +185,8 @@ board_init_f_r_trampoline: movl %eax, %esp /* See if we need to disable CAR */ -.weak car_uninit - movl $car_uninit, %eax - cmpl $0, %eax - jz 1f - call car_uninit -1: + /* Re-enter U-Boot by calling board_init_f_r() */ call board_init_f_r
@@ -199,6 +195,10 @@ die: jmp die hlt +WEAK(car_uninit) + ret +ENDPROC(car_uninit) + blank_idt_ptr: .word 0 /* limit */ .long 0 /* base */
Signature · 1 line
2.7.4
PATCH 1/1 x86: Fix car_uninit weak symbol definition
Quoted 20 lines · Bin Meng
Since commit
80df194f0165("x86: detect unsupported relocation types"), an error message is seen on QEMU x86 target during boot:
do_elf_reloc_fixups32: unsupported relocation type0x1atfff841f0, offset =0xfff00087do_elf_reloc_fixups32: unsupported relocation type0x2atfff841f8, offset =0xfff00091Check offset
0xfff00087and0xfff00091in the u-boot ELF image,fff00087 000df401 R_386_32 00000000 car_uninit fff00091 000df402 R_386_PC32 00000000 car_uninitwe see
R_386_32andR_386_PC32relocation type is generated for symbolcar_uninit, which is declared as a weak symbol instart.S.However the actual weak symbol implementation ends up nowhere. As we can see below, it's *UND*.
$ objdump -t u-boot | grep car_uninit 00000000 w *UND* 00000000 car_uninit
Quoted 8 lines
With this fix, it is normal now.
$ objdump -t u-boot | grep car_uninit fff00094 w F .text.start 00000001 car_uninitReported-by Hannes Schmelzer <[email protected]>Signed-off-by Bin Meng <[email protected]>---
qemu-x86_defconfig works fine now.
PATCH 1/1 x86: Fix car_uninit weak symbol definition
Quoted 27 lines · Heinrich Schuchardt
Quoted 25 lines · Bin Meng
Since commit
80df194f0165("x86: detect unsupported relocation types"), an error message is seen on QEMU x86 target during boot:
do_elf_reloc_fixups32: unsupported relocation type0x1atfff841f0, offset =0xfff00087do_elf_reloc_fixups32: unsupported relocation type0x2atfff841f8, offset =0xfff00091Check offset
0xfff00087and0xfff00091in the u-boot ELF image,fff00087 000df401 R_386_32 00000000 car_uninit fff00091 000df402 R_386_PC32 00000000 car_uninitwe see
R_386_32andR_386_PC32relocation type is generated for symbolcar_uninit, which is declared as a weak symbol instart.S.However the actual weak symbol implementation ends up nowhere. As we can see below, it's *UND*.
$ objdump -t u-boot | grep car_uninit 00000000 w *UND* 00000000 car_uninitWith this fix, it is normal now.
$ objdump -t u-boot | grep car_uninit fff00094 w F .text.start 00000001 car_uninit
Quoted 8 lines
Quoted 3 lines
Reported-by Hannes Schmelzer <[email protected]>Signed-off-by Bin Meng <[email protected]>---
qemu-x86_defconfig works fine now.
Tested-by Heinrich Schuchardt <[email protected]>Reviewed-by Heinrich Schuchardt <[email protected]>
applied to u-boot-x86, thanks!
PATCH 1/1 x86: Fix car_uninit weak symbol definition
In reply to Bin MengQuoted 14 lines · Bin Meng
Since commit
80df194f0165("x86: detect unsupported relocation types"), an error message is seen on QEMU x86 target during boot:
do_elf_reloc_fixups32: unsupported relocation type0x1atfff841f0, offset =0xfff00087do_elf_reloc_fixups32: unsupported relocation type0x2atfff841f8, offset =0xfff00091Check offset
0xfff00087and0xfff00091in the u-boot ELF image,fff00087 000df401 R_386_32 00000000 car_uninit fff00091 000df402 R_386_PC32 00000000 car_uninitwe see
R_386_32andR_386_PC32relocation type is generated for symbolcar_uninit, which is declared as a weak symbol instart.S.
Quoted 8 lines
However the actual weak symbol implementation ends up nowhere. As we can see below, it's *UND*.
$ objdump -t u-boot | grep car_uninit 00000000 w *UND* 00000000 car_uninitWith this fix, it is normal now.
My pp065 board is also working fine with this.