Skip to content

Commit 46c7405

Browse files
Vasily GorbikIngo Molnar
authored andcommitted
objtool: Fix elf_create_undef_symbol() endianness
Currently x86 cross-compilation fails on big endian system with: x86_64-cross-ld: init/main.o: invalid string offset 488112128 >= 6229 for section `.strtab' Mark new ELF data in elf_create_undef_symbol() as symbol, so that libelf does endianness handling correctly. Fixes: 2f2f7e4 ("objtool: Add elf_create_undef_symbol()") Signed-off-by: Vasily Gorbik <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/patch-1.thread-6c9df9.git-d39264656387.your-ad-here.call-01620841104-ext-2554@work.hours
1 parent 88b0639 commit 46c7405

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/objtool/elf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@ struct symbol *elf_create_undef_symbol(struct elf *elf, const char *name)
762762
data->d_buf = &sym->sym;
763763
data->d_size = sizeof(sym->sym);
764764
data->d_align = 1;
765+
data->d_type = ELF_T_SYM;
765766

766767
sym->idx = symtab->len / sizeof(sym->sym);
767768

0 commit comments

Comments
 (0)