* [GIT PULL] objtool fix
@ 2016-12-07 18:40 Ingo Molnar
0 siblings, 0 replies; 12+ messages in thread
From: Ingo Molnar @ 2016-12-07 18:40 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-kernel, Thomas Gleixner, Peter Zijlstra, Andrew Morton
Linus,
Please pull the latest core-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-urgent-for-linus
# HEAD: 69042bf2001b44e81cd86ab11a4637b9d9a14c5a objtool: Fix bytes check of lea's rex_prefix
A single late breaking fix for objtool.
Thanks,
Ingo
------------------>
Jiri Slaby (1):
objtool: Fix bytes check of lea's rex_prefix
tools/objtool/arch/x86/decode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
index b63a31be1218..5e0dea2cdc01 100644
--- a/tools/objtool/arch/x86/decode.c
+++ b/tools/objtool/arch/x86/decode.c
@@ -99,7 +99,7 @@ int arch_decode_instruction(struct elf *elf, struct section *sec,
break;
case 0x8d:
- if (insn.rex_prefix.bytes &&
+ if (insn.rex_prefix.nbytes &&
insn.rex_prefix.bytes[0] == 0x48 &&
insn.modrm.nbytes && insn.modrm.bytes[0] == 0x2c &&
insn.sib.nbytes && insn.sib.bytes[0] == 0x24)
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [GIT PULL] objtool fix
@ 2023-09-17 17:34 Ingo Molnar
2023-09-17 18:24 ` pr-tracker-bot
0 siblings, 1 reply; 12+ messages in thread
From: Ingo Molnar @ 2023-09-17 17:34 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-kernel, Peter Zijlstra, Josh Poimboeuf, Thomas Gleixner,
Borislav Petkov, Andrew Morton
Linus,
Please pull the latest objtool/urgent git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git objtool-urgent-2023-09-17
# HEAD: 72178d5d1a38dd185d1db15f177f2d122ef10d9b objtool: Fix _THIS_IP_ detection for cold functions
Fix a cold functions related false-positive objtool warning
that triggers on Clang.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Thanks,
Ingo
------------------>
Josh Poimboeuf (1):
objtool: Fix _THIS_IP_ detection for cold functions
tools/objtool/check.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 1384090530db..e308d1ba664e 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -4333,7 +4333,8 @@ static int validate_ibt_insn(struct objtool_file *file, struct instruction *insn
continue;
}
- if (insn_func(dest) && insn_func(dest) == insn_func(insn)) {
+ if (insn_func(dest) && insn_func(insn) &&
+ insn_func(dest)->pfunc == insn_func(insn)->pfunc) {
/*
* Anything from->to self is either _THIS_IP_ or
* IRET-to-self.
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [GIT PULL] objtool fix
@ 2023-01-12 13:57 Ingo Molnar
2023-01-12 23:01 ` pr-tracker-bot
0 siblings, 1 reply; 12+ messages in thread
From: Ingo Molnar @ 2023-01-12 13:57 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-kernel, Peter Zijlstra, Josh Poimboeuf, Thomas Gleixner,
Borislav Petkov, Andrew Morton
Linus,
Please pull the latest core/urgent git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-urgent-2023-01-12
# HEAD: cad90e5381d840cf2296aaac9b3eff71a30b7c5b objtool: Tolerate STT_NOTYPE symbols at end of section
- Fix objtool to be more permissive with hand-written assembly
that uses non-function symbols in executable sections.
Thanks,
Ingo
------------------>
Nicholas Piggin (1):
objtool: Tolerate STT_NOTYPE symbols at end of section
tools/objtool/check.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 4350be739f4f..4b7c8b33069e 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -427,6 +427,15 @@ static int decode_instructions(struct objtool_file *file)
if (func->type != STT_NOTYPE && func->type != STT_FUNC)
continue;
+ if (func->offset == sec->sh.sh_size) {
+ /* Heuristic: likely an "end" symbol */
+ if (func->type == STT_NOTYPE)
+ continue;
+ WARN("%s(): STT_FUNC at end of section",
+ func->name);
+ return -1;
+ }
+
if (func->return_thunk || func->alias != func)
continue;
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [GIT PULL] objtool fix
@ 2020-12-27 9:31 Ingo Molnar
2020-12-27 17:27 ` pr-tracker-bot
0 siblings, 1 reply; 12+ messages in thread
From: Ingo Molnar @ 2020-12-27 9:31 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-kernel, Thomas Gleixner, Peter Zijlstra, Josh Poimboeuf,
Andrew Morton
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-12-27
# HEAD: 44f6a7c0755d8dd453c70557e11687bb080a6f21 objtool: Fix seg fault with Clang non-section symbols
Fix a segfault that occurs when built with Clang.
Thanks,
Ingo
------------------>
Josh Poimboeuf (1):
objtool: Fix seg fault with Clang non-section symbols
tools/objtool/check.c | 11 +++++++++--
tools/objtool/elf.c | 26 ++++++++++++++++++++++++++
tools/objtool/elf.h | 2 ++
tools/objtool/orc_gen.c | 29 +++++------------------------
4 files changed, 42 insertions(+), 26 deletions(-)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index c6ab44543c92..5f8d3eed78a1 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -467,13 +467,20 @@ static int create_static_call_sections(struct objtool_file *file)
/* populate reloc for 'addr' */
reloc = malloc(sizeof(*reloc));
+
if (!reloc) {
perror("malloc");
return -1;
}
memset(reloc, 0, sizeof(*reloc));
- reloc->sym = insn->sec->sym;
- reloc->addend = insn->offset;
+
+ insn_to_reloc_sym_addend(insn->sec, insn->offset, reloc);
+ if (!reloc->sym) {
+ WARN_FUNC("static call tramp: missing containing symbol",
+ insn->sec, insn->offset);
+ return -1;
+ }
+
reloc->type = R_X86_64_PC32;
reloc->offset = idx * sizeof(struct static_call_site);
reloc->sec = reloc_sec;
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index 4e1d7460574b..be89c741ba9a 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -262,6 +262,32 @@ struct reloc *find_reloc_by_dest(const struct elf *elf, struct section *sec, uns
return find_reloc_by_dest_range(elf, sec, offset, 1);
}
+void insn_to_reloc_sym_addend(struct section *sec, unsigned long offset,
+ struct reloc *reloc)
+{
+ if (sec->sym) {
+ reloc->sym = sec->sym;
+ reloc->addend = offset;
+ return;
+ }
+
+ /*
+ * The Clang assembler strips section symbols, so we have to reference
+ * the function symbol instead:
+ */
+ reloc->sym = find_symbol_containing(sec, offset);
+ if (!reloc->sym) {
+ /*
+ * Hack alert. This happens when we need to reference the NOP
+ * pad insn immediately after the function.
+ */
+ reloc->sym = find_symbol_containing(sec, offset - 1);
+ }
+
+ if (reloc->sym)
+ reloc->addend = offset - reloc->sym->offset;
+}
+
static int read_sections(struct elf *elf)
{
Elf_Scn *s = NULL;
diff --git a/tools/objtool/elf.h b/tools/objtool/elf.h
index 807f8c670097..e6890cc70a25 100644
--- a/tools/objtool/elf.h
+++ b/tools/objtool/elf.h
@@ -140,6 +140,8 @@ struct reloc *find_reloc_by_dest(const struct elf *elf, struct section *sec, uns
struct reloc *find_reloc_by_dest_range(const struct elf *elf, struct section *sec,
unsigned long offset, unsigned int len);
struct symbol *find_func_containing(struct section *sec, unsigned long offset);
+void insn_to_reloc_sym_addend(struct section *sec, unsigned long offset,
+ struct reloc *reloc);
int elf_rebuild_reloc_section(struct elf *elf, struct section *sec);
#define for_each_sec(file, sec) \
diff --git a/tools/objtool/orc_gen.c b/tools/objtool/orc_gen.c
index 235663b96adc..9ce68b385a1b 100644
--- a/tools/objtool/orc_gen.c
+++ b/tools/objtool/orc_gen.c
@@ -105,30 +105,11 @@ static int create_orc_entry(struct elf *elf, struct section *u_sec, struct secti
}
memset(reloc, 0, sizeof(*reloc));
- if (insn_sec->sym) {
- reloc->sym = insn_sec->sym;
- reloc->addend = insn_off;
- } else {
- /*
- * The Clang assembler doesn't produce section symbols, so we
- * have to reference the function symbol instead:
- */
- reloc->sym = find_symbol_containing(insn_sec, insn_off);
- if (!reloc->sym) {
- /*
- * Hack alert. This happens when we need to reference
- * the NOP pad insn immediately after the function.
- */
- reloc->sym = find_symbol_containing(insn_sec,
- insn_off - 1);
- }
- if (!reloc->sym) {
- WARN("missing symbol for insn at offset 0x%lx\n",
- insn_off);
- return -1;
- }
-
- reloc->addend = insn_off - reloc->sym->offset;
+ insn_to_reloc_sym_addend(insn_sec, insn_off, reloc);
+ if (!reloc->sym) {
+ WARN("missing symbol for insn at offset 0x%lx",
+ insn_off);
+ return -1;
}
reloc->type = R_X86_64_PC32;
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [GIT PULL] objtool fix
@ 2017-10-14 15:53 Ingo Molnar
0 siblings, 0 replies; 12+ messages in thread
From: Ingo Molnar @ 2017-10-14 15:53 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-kernel, Josh Poimboeuf, Thomas Gleixner, H. Peter Anvin,
Peter Zijlstra, Andrew Morton
Linus,
Please pull the latest core-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-urgent-for-linus
# HEAD: 3dd40cb320fee7c23b574ab821ce140ccd1281c9 objtool: Upgrade libelf-devel warning to error for CONFIG_ORC_UNWINDER
A single objtool fix: avoid silently broken ORC debuginfo builds and error out
instead.
Thanks,
Ingo
------------------>
Josh Poimboeuf (1):
objtool: Upgrade libelf-devel warning to error for CONFIG_ORC_UNWINDER
Makefile | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index cf007a31d575..bc5c79e8e3cf 100644
--- a/Makefile
+++ b/Makefile
@@ -933,7 +933,11 @@ ifdef CONFIG_STACK_VALIDATION
ifeq ($(has_libelf),1)
objtool_target := tools/objtool FORCE
else
- $(warning "Cannot use CONFIG_STACK_VALIDATION, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
+ ifdef CONFIG_ORC_UNWINDER
+ $(error "Cannot generate ORC metadata for CONFIG_ORC_UNWINDER=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
+ else
+ $(warning "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
+ endif
SKIP_STACK_VALIDATION := 1
export SKIP_STACK_VALIDATION
endif
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [GIT PULL] objtool fix
@ 2017-02-02 20:50 Ingo Molnar
0 siblings, 0 replies; 12+ messages in thread
From: Ingo Molnar @ 2017-02-02 20:50 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-kernel, Thomas Gleixner, H. Peter Anvin, Peter Zijlstra,
Andrew Morton, Josh Poimboeuf
Linus,
Please pull the latest core-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-urgent-for-linus
# HEAD: b5b46c4740aed1538544f0fa849c5b76c7823469 objtool: Fix IRET's opcode
A fix for a bad opcode in objtool's instruction decoder.
Thanks,
Ingo
------------------>
Jiri Slaby (1):
objtool: Fix IRET's opcode
tools/objtool/arch/x86/decode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
index 5e0dea2cdc01..039636ffb6c8 100644
--- a/tools/objtool/arch/x86/decode.c
+++ b/tools/objtool/arch/x86/decode.c
@@ -150,9 +150,9 @@ int arch_decode_instruction(struct elf *elf, struct section *sec,
*type = INSN_RETURN;
break;
- case 0xc5: /* iret */
case 0xca: /* retf */
case 0xcb: /* retf */
+ case 0xcf: /* iret */
*type = INSN_CONTEXT_SWITCH;
break;
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [GIT PULL] objtool fix
@ 2016-10-28 8:30 Ingo Molnar
0 siblings, 0 replies; 12+ messages in thread
From: Ingo Molnar @ 2016-10-28 8:30 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-kernel, Thomas Gleixner, Peter Zijlstra, Josh Poimboeuf
Linus,
Please pull the latest core-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-urgent-for-linus
# HEAD: 56fb2d6eb63acd48b50437b415b6f7d2fcffe75d objtool: Fix rare switch jump table pattern detection
One more objtool fixlet for GCC6 code generation patterns.
Thanks,
Ingo
------------------>
Josh Poimboeuf (1):
objtool: Fix rare switch jump table pattern detection
tools/objtool/builtin-check.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c
index 4490601a9235..e8a1f699058a 100644
--- a/tools/objtool/builtin-check.c
+++ b/tools/objtool/builtin-check.c
@@ -754,7 +754,7 @@ static struct rela *find_switch_table(struct objtool_file *file,
if (insn->type == INSN_JUMP_UNCONDITIONAL &&
insn->jump_dest &&
(insn->jump_dest->offset <= insn->offset ||
- insn->jump_dest->offset >= orig_insn->offset))
+ insn->jump_dest->offset > orig_insn->offset))
break;
text_rela = find_rela_by_dest_range(insn->sec, insn->offset,
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [GIT PULL] objtool fix
@ 2016-06-10 12:01 Ingo Molnar
0 siblings, 0 replies; 12+ messages in thread
From: Ingo Molnar @ 2016-06-10 12:01 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-kernel, Josh Poimboeuf, Thomas Gleixner, Peter Zijlstra,
Andrew Morton
Linus,
Please pull the latest core-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-urgent-for-linus
# HEAD: 0b0d81e3b7334897da9b2e3ffee860c2046f7bc0 objtool, drm/vmwgfx: Fix "duplicate frame pointer save" warning
Addresses a false positive warning in the GPU/DRM code.
Thanks,
Ingo
------------------>
Josh Poimboeuf (1):
objtool, drm/vmwgfx: Fix "duplicate frame pointer save" warning
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
index 6de283c8fa3e..f0374f9b56ca 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
@@ -28,6 +28,7 @@
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/kernel.h>
+#include <linux/frame.h>
#include <asm/hypervisor.h>
#include "drmP.h"
#include "vmwgfx_msg.h"
@@ -194,7 +195,7 @@ static int vmw_send_msg(struct rpc_channel *channel, const char *msg)
return -EINVAL;
}
-
+STACK_FRAME_NON_STANDARD(vmw_send_msg);
/**
@@ -304,6 +305,7 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
return 0;
}
+STACK_FRAME_NON_STANDARD(vmw_recv_msg);
/**
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [GIT PULL] objtool fix
@ 2016-05-25 20:10 Ingo Molnar
0 siblings, 0 replies; 12+ messages in thread
From: Ingo Molnar @ 2016-05-25 20:10 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-kernel, Josh Poimboeuf, Peter Zijlstra, Thomas Gleixner,
Andrew Morton
Linus,
Please pull the latest core-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-urgent-for-linus
# HEAD: 2e51f26245701cb28f154552836b7807159088a8 objtool: Allow building with older libelf
An libtool fix for older libelf versions.
Thanks,
Ingo
------------------>
Jan Beulich (1):
objtool: Allow building with older libelf
tools/objtool/Makefile | 4 ++++
tools/objtool/elf.h | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 6765c7e949f3..f094f3c4ed84 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -30,6 +30,10 @@ INCLUDES := -I$(srctree)/tools/include
CFLAGS += -Wall -Werror $(EXTRA_WARNINGS) -fomit-frame-pointer -O2 -g $(INCLUDES)
LDFLAGS += -lelf $(LIBSUBCMD)
+# Allow old libelf to be used:
+elfshdr := $(shell echo '\#include <libelf.h>' | $(CC) $(CFLAGS) -x c -E - | grep elf_getshdr)
+CFLAGS += $(if $(elfshdr),,-DLIBELF_USE_DEPRECATED)
+
AWK = awk
export srctree OUTPUT CFLAGS ARCH AWK
include $(srctree)/tools/build/Makefile.include
diff --git a/tools/objtool/elf.h b/tools/objtool/elf.h
index 7f3e00a2f907..aa1ff6596684 100644
--- a/tools/objtool/elf.h
+++ b/tools/objtool/elf.h
@@ -23,6 +23,11 @@
#include <linux/list.h>
#include <linux/hashtable.h>
+#ifdef LIBELF_USE_DEPRECATED
+# define elf_getshdrnum elf_getshnum
+# define elf_getshdrstrndx elf_getshstrndx
+#endif
+
struct section {
struct list_head list;
GElf_Shdr sh;
^ permalink raw reply related [flat|nested] 12+ messages in thread
end of thread, other threads:[~2023-09-17 18:25 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-07 18:40 [GIT PULL] objtool fix Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2023-09-17 17:34 Ingo Molnar
2023-09-17 18:24 ` pr-tracker-bot
2023-01-12 13:57 Ingo Molnar
2023-01-12 23:01 ` pr-tracker-bot
2020-12-27 9:31 Ingo Molnar
2020-12-27 17:27 ` pr-tracker-bot
2017-10-14 15:53 Ingo Molnar
2017-02-02 20:50 Ingo Molnar
2016-10-28 8:30 Ingo Molnar
2016-06-10 12:01 Ingo Molnar
2016-05-25 20:10 Ingo Molnar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.