[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <patch-1.thread-6c9df9.git-d39264656387.your-ad-here.call-01620841104-ext-2554@work.hours>
Date: Wed, 12 May 2021 19:42:10 +0200
From: Vasily Gorbik <gor@...ux.ibm.com>
To: Peter Zijlstra <peterz@...radead.org>,
Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...e.de>,
Miroslav Benes <mbenes@...e.cz>, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] 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: 2f2f7e47f052 ("objtool: Add elf_create_undef_symbol()")
Signed-off-by: Vasily Gorbik <gor@...ux.ibm.com>
---
tools/objtool/elf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index a8a0ee21f71a..4d0d4d7a9aba 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -791,6 +791,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);
--
2.25.4
Powered by blists - more mailing lists