Skip to content

Commit e7c425b

Browse files
committed
Merge tag 'objtool-urgent-2021-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull objtool fixes from Ingo Molnar: "Fix a couple of endianness bugs that crept in" * tag 'objtool-urgent-2021-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool/x86: Fix elf_add_alternative() endianness objtool: Fix elf_create_undef_symbol() endianness
2 parents 077fc64 + f66c05d commit e7c425b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tools/objtool/arch/x86/decode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <objtool/elf.h>
2020
#include <objtool/arch.h>
2121
#include <objtool/warn.h>
22+
#include <objtool/endianness.h>
2223
#include <arch/elf.h>
2324

2425
static int is_x86_64(const struct elf *elf)
@@ -725,7 +726,7 @@ static int elf_add_alternative(struct elf *elf,
725726
return -1;
726727
}
727728

728-
alt->cpuid = cpuid;
729+
alt->cpuid = bswap_if_needed(cpuid);
729730
alt->instrlen = orig_len;
730731
alt->replacementlen = repl_len;
731732

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)