linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [tip: objtool/urgent] objtool: Fix elf_create_undef_symbol() endianness
@ 2021-05-12 18:32 tip-bot2 for Vasily Gorbik
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Vasily Gorbik @ 2021-05-12 18:32 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Vasily Gorbik, Ingo Molnar, x86, linux-kernel

The following commit has been merged into the objtool/urgent branch of tip:

Commit-ID:     7176af27a8bf4ab5b5c7a1850459b194a21cf876
Gitweb:        https://git.kernel.org/tip/7176af27a8bf4ab5b5c7a1850459b194a21cf876
Author:        Vasily Gorbik <gor@linux.ibm.com>
AuthorDate:    Wed, 12 May 2021 19:42:10 +02:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Wed, 12 May 2021 20:25:48 +02:00

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@linux.ibm.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index d08f5f3..743c2e9 100644
--- 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);
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip: objtool/urgent] objtool: Fix elf_create_undef_symbol() endianness
@ 2021-05-12 19:20 tip-bot2 for Vasily Gorbik
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Vasily Gorbik @ 2021-05-12 19:20 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Vasily Gorbik, Ingo Molnar, Peter Zijlstra, x86, linux-kernel

The following commit has been merged into the objtool/urgent branch of tip:

Commit-ID:     46c7405df7de8deb97229eacebcee96d61415f3f
Gitweb:        https://git.kernel.org/tip/46c7405df7de8deb97229eacebcee96d61415f3f
Author:        Vasily Gorbik <gor@linux.ibm.com>
AuthorDate:    Wed, 12 May 2021 19:42:10 +02:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Wed, 12 May 2021 21:16:53 +02:00

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@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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index d08f5f3..743c2e9 100644
--- 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);
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-12 20:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12 18:32 [tip: objtool/urgent] objtool: Fix elf_create_undef_symbol() endianness tip-bot2 for Vasily Gorbik
2021-05-12 19:20 tip-bot2 for Vasily Gorbik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).