Skip to content

Commit

Permalink
Merge tag 'objtool-urgent-2021-05-15' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
torvalds committed May 15, 2021
2 parents 077fc64 + f66c05d commit e7c425b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/objtool/arch/x86/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <objtool/elf.h>
#include <objtool/arch.h>
#include <objtool/warn.h>
#include <objtool/endianness.h>
#include <arch/elf.h>

static int is_x86_64(const struct elf *elf)
Expand Down Expand Up @@ -725,7 +726,7 @@ static int elf_add_alternative(struct elf *elf,
return -1;
}

alt->cpuid = cpuid;
alt->cpuid = bswap_if_needed(cpuid);
alt->instrlen = orig_len;
alt->replacementlen = repl_len;

Expand Down
1 change: 1 addition & 0 deletions tools/objtool/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e7c425b

Please sign in to comment.