Re: [PATCH v4 11/16] objtool: Add --mnop as an option to --mcount

From
Naveen N. Rao <hidden>
Date
2022-10-12 13:48:10
Also in
lkml
Reply to
Josh Poimboeuf, 2022-10-11
Josh Poimboeuf wrote:
quoted hunk ↗ jump to hunk
On Mon, Oct 10, 2022 at 05:07:46PM +0530, Naveen N. Rao wrote:
quoted
quoted
+++ b/scripts/Makefile.lib
@@ -234,6 +234,7 @@ objtool_args =								\
 	$(if $(CONFIG_HAVE_NOINSTR_HACK), --hacks=noinstr)		\
 	$(if $(CONFIG_X86_KERNEL_IBT), --ibt)				\
 	$(if $(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL), --mcount)		\
+	$(if $(CONFIG_HAVE_OBJTOOL_NOP_MCOUNT), --mnop)                 \
This still won't help: for instance, if CONFIG_FTRACE itself is disabled. I
think we should make this depend on CONFIG_FTRACE_MCOUNT_USE_OBJTOOL. The
below change works for me:
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 54d2d6451bdacc..fd3f55a1fdb7bb 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -245,8 +245,8 @@ objtool_args =                                                              \
       $(if $(CONFIG_HAVE_JUMP_LABEL_HACK), --hacks=jump_label)        \
       $(if $(CONFIG_HAVE_NOINSTR_HACK), --hacks=noinstr)              \
       $(if $(CONFIG_X86_KERNEL_IBT), --ibt)                           \
-       $(if $(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL), --mcount)             \
-       $(if $(CONFIG_HAVE_OBJTOOL_NOP_MCOUNT), --mnop)                 \
+        $(if $(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL),                       \
+             $(if $(CONFIG_HAVE_OBJTOOL_NOP_MCOUNT), --mcount --mnop, --mcount)) \
       $(if $(CONFIG_UNWINDER_ORC), --orc)                             \
       $(if $(CONFIG_RETPOLINE), --retpoline)                          \
       $(if $(CONFIG_RETHUNK), --rethunk)                              \
This has a new conflict, may need something like:
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -256,6 +256,9 @@ objtool-args-$(CONFIG_HAVE_JUMP_LABEL_HACK)		+= --hacks=jump_label
 objtool-args-$(CONFIG_HAVE_NOINSTR_HACK)		+= --hacks=noinstr
 objtool-args-$(CONFIG_X86_KERNEL_IBT)			+= --ibt
 objtool-args-$(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL)	+= --mcount
+ifdef CONFIG_FTRACE_MCOUNT_USE_OBJTOOL
+objtool-args-$(CONFIG_HAVE_OBJTOOL_NOP_MCOUNT)		+= --mnop
+endif
 objtool-args-$(CONFIG_UNWINDER_ORC)			+= --orc
 objtool-args-$(CONFIG_RETPOLINE)			+= --retpoline
 objtool-args-$(CONFIG_RETHUNK)				+= --rethunk
Thanks. That's definitely simpler.

I haven't checked if there are any other conflicts with tip/objtool/core though. Not sure how to proceed here.


- Naveen
Thread (26 messages) 26 messages, 4 authors, last reply 2022-10-12
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help