[GIT PULL] objtool fixes
From: Ingo Molnar
Date: Sat Apr 25 2020 - 05:04:51 EST
Linus,
Please pull the latest objtool/urgent git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git objtool-urgent-2020-04-25
# HEAD: 7f9b34f36cf6b2099f19e679a9e8315c955ef2ee objtool: Fix off-by-one in symbol_by_offset()
Two fixes: fix an off-by-one bug, and fix 32-bit builds on 64-bit systems.
Thanks,
Ingo
------------------>
Julien Thierry (1):
objtool: Fix off-by-one in symbol_by_offset()
Peter Zijlstra (1):
objtool: Fix 32bit cross builds
tools/objtool/elf.c | 2 +-
tools/objtool/elf.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index 09ddc8f1def3..c4857fa3f1d1 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -105,7 +105,7 @@ static int symbol_by_offset(const void *key, const struct rb_node *node)
if (*o < s->offset)
return -1;
- if (*o > s->offset + s->len)
+ if (*o >= s->offset + s->len)
return 1;
return 0;
diff --git a/tools/objtool/elf.h b/tools/objtool/elf.h
index ebbb10c61e24..0b79c2353a21 100644
--- a/tools/objtool/elf.h
+++ b/tools/objtool/elf.h
@@ -99,7 +99,7 @@ static inline u32 sec_offset_hash(struct section *sec, unsigned long offset)
offset &= OFFSET_STRIDE_MASK;
ol = offset;
- oh = offset >> 32;
+ oh = (offset >> 16) >> 16;
__jhash_mix(ol, oh, idx);