History

objtool: Reorganize cmdline options

Split the existing options into two groups: actions, which actually do something; and options, which modify the actions in some way. Also there's no need to have short flags for all the non-action options. Reserve short flags for the more important actions. While at it: - change a few of the short flags to be more intuitive - make option descriptions more consistently descriptive - sort options in the source like they are when printed - move options to a global struct

Josh Poimboeuf committed 4 years ago

Commit 2daf7fa1 parent aa3d60e9 files · +108 −78Browse files

Showing the changes to scripts (2 of 9 files). Show all

Unified · Split

2 files
  1. scripts/Makefile.build +5 −5
  2. scripts/link-vmlinux.sh +19 −11
scripts/Makefile.build+5−5
@@ -228,14 +228,14 @@ objtool := $(objtree)/tools/objtool/objtool · 227 unmodified lines
228228
229229 objtool_args = \
230230 $(if $(CONFIG_UNWINDER_ORC),orc generate,check) \
231− $(if $(part-of-module), --module) \
232231 $(if $(CONFIG_X86_KERNEL_IBT), --lto --ibt) \
233− $(if $(CONFIG_FRAME_POINTER),, --no-fp) \
234− $(if $(CONFIG_GCOV_KERNEL), --no-unreachable) \
232+ $(if $(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL), --mcount) \
235233 $(if $(CONFIG_RETPOLINE), --retpoline) \
234+ $(if $(CONFIG_SLS), --sls) \
236235 $(if $(CONFIG_X86_SMAP), --uaccess) \
237− $(if $(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL), --mcount) \
238− $(if $(CONFIG_SLS), --sls)
236+ $(if $(part-of-module), --module) \
237+ $(if $(CONFIG_FRAME_POINTER),, --no-fp) \
238+ $(if $(CONFIG_GCOV_KERNEL), --no-unreachable)
239239
240240 cmd_objtool = $(if $(objtool-enabled), ; $(objtool) $(objtool_args) $@)
241241 cmd_gen_objtooldep = $(if $(objtool-enabled), { echo ; echo '$@: $$(wildcard $(objtool))' ; } >> $(dot-target).cmd)
scripts/link-vmlinux.sh+19−11
@@ -117,8 +117,6 @@ objtool_link() · 116 unmodified lines
117117 objtoolcmd="orc generate"
118118 fi
119119
120− objtoolopt="${objtoolopt} --lto"
121−
122120 if is_enabled CONFIG_X86_KERNEL_IBT; then
123121 objtoolopt="${objtoolopt} --ibt"
124122 fi
@@ -126,6 +124,8 @@ objtool_link() · 1 unmodified line
126124 if is_enabled CONFIG_FTRACE_MCOUNT_USE_OBJTOOL; then
127125 objtoolopt="${objtoolopt} --mcount"
128126 fi
127+
128+ objtoolopt="${objtoolopt} --lto"
129129 fi
130130
131131 if is_enabled CONFIG_VMLINUX_VALIDATION; then
@@ -133,25 +133,33 @@ objtool_link() · 1 unmodified line
133133 fi
134134
135135 if [ -n "${objtoolopt}" ]; then
136+
136137 if [ -z "${objtoolcmd}" ]; then
137138 objtoolcmd="check"
138139 fi
139− objtoolopt="${objtoolopt} --vmlinux"
140− if ! is_enabled CONFIG_FRAME_POINTER; then
141− objtoolopt="${objtoolopt} --no-fp"
142− fi
143− if is_enabled CONFIG_GCOV_KERNEL; then
144− objtoolopt="${objtoolopt} --no-unreachable"
145− fi
140+
146141 if is_enabled CONFIG_RETPOLINE; then
147142 objtoolopt="${objtoolopt} --retpoline"
148143 fi
144+
145+ if is_enabled CONFIG_SLS; then
146+ objtoolopt="${objtoolopt} --sls"
147+ fi
148+
149149 if is_enabled CONFIG_X86_SMAP; then
150150 objtoolopt="${objtoolopt} --uaccess"
151151 fi
152− if is_enabled CONFIG_SLS; then
153− objtoolopt="${objtoolopt} --sls"
152+
153+ if ! is_enabled CONFIG_FRAME_POINTER; then
154+ objtoolopt="${objtoolopt} --no-fp"
154155 fi
156+
157+ if is_enabled CONFIG_GCOV_KERNEL; then
158+ objtoolopt="${objtoolopt} --no-unreachable"
159+ fi
160+
161+ objtoolopt="${objtoolopt} --vmlinux"
162+
155163 info OBJTOOL ${1}
156164 tools/objtool/objtool ${objtoolcmd} ${objtoolopt} ${1}
157165 fi