projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
88b0639
)
objtool: Fix elf_create_undef_symbol() endianness
author
Vasily Gorbik
<gor@linux.ibm.com>
Wed, 12 May 2021 17:42:10 +0000
(19:42 +0200)
committer
Ingo Molnar
<mingo@kernel.org>
Wed, 12 May 2021 19:16:53 +0000
(21:16 +0200)
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: 2f2f7e47f052 ("objtool: Add elf_create_undef_symbol()")
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link:
https://lore.kernel.org/r/patch-1.thread-6c9df9.git-d39264656387.your-ad-here.call-01620841104-ext-2554@work.hours
tools/objtool/elf.c
patch
|
blob
|
history
diff --git
a/tools/objtool/elf.c
b/tools/objtool/elf.c
index d08f5f3670f88c28c2580c3be870834a180f0ab5..743c2e9d0f564e93596a2fcf3b0ea6dbf348eb6a 100644
(file)
--- a/
tools/objtool/elf.c
+++ b/
tools/objtool/elf.c
@@
-762,6
+762,7
@@
struct symbol *elf_create_undef_symbol(struct elf *elf, const char *name)
data->d_buf = &sym->sym;
data->d_size = sizeof(sym->sym);
data->d_align = 1;
+ data->d_type = ELF_T_SYM;
sym->idx = symtab->len / sizeof(sym->sym);