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
Showing the changes to scripts (2 of 9 files). Show all
Unified · Split
| @@ -228,14 +228,14 @@ objtool := $(objtree)/tools/objtool/objtool · 227 unmodified lines | ||
| 228 | 228 | |
| 229 | 229 | objtool_args = \ |
| 230 | 230 | $(if $(CONFIG_UNWINDER_ORC),orc generate,check) \ |
| 231 | − $(if $(part-of-module), --module) \ | |
| 232 | 231 | $(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) \ | |
| 235 | 233 | $(if $(CONFIG_RETPOLINE), --retpoline) \ |
| 234 | + $(if $(CONFIG_SLS), --sls) \ | |
| 236 | 235 | $(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) | |
| 239 | 239 | |
| 240 | 240 | cmd_objtool = $(if $(objtool-enabled), ; $(objtool) $(objtool_args) $@) |
| 241 | 241 | cmd_gen_objtooldep = $(if $(objtool-enabled), { echo ; echo '$@: $$(wildcard $(objtool))' ; } >> $(dot-target).cmd) |
| @@ -117,8 +117,6 @@ objtool_link() · 116 unmodified lines | ||
| 117 | 117 | objtoolcmd="orc generate" |
| 118 | 118 | fi |
| 119 | 119 | |
| 120 | − objtoolopt="${objtoolopt} --lto" | |
| 121 | − | |
| 122 | 120 | if is_enabled CONFIG_X86_KERNEL_IBT; then |
| 123 | 121 | objtoolopt="${objtoolopt} --ibt" |
| 124 | 122 | fi |
| @@ -126,6 +124,8 @@ objtool_link() · 1 unmodified line | ||
| 126 | 124 | if is_enabled CONFIG_FTRACE_MCOUNT_USE_OBJTOOL; then |
| 127 | 125 | objtoolopt="${objtoolopt} --mcount" |
| 128 | 126 | fi |
| 127 | + | |
| 128 | + objtoolopt="${objtoolopt} --lto" | |
| 129 | 129 | fi |
| 130 | 130 | |
| 131 | 131 | if is_enabled CONFIG_VMLINUX_VALIDATION; then |
| @@ -133,25 +133,33 @@ objtool_link() · 1 unmodified line | ||
| 133 | 133 | fi |
| 134 | 134 | |
| 135 | 135 | if [ -n "${objtoolopt}" ]; then |
| 136 | + | |
| 136 | 137 | if [ -z "${objtoolcmd}" ]; then |
| 137 | 138 | objtoolcmd="check" |
| 138 | 139 | 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 | + | |
| 146 | 141 | if is_enabled CONFIG_RETPOLINE; then |
| 147 | 142 | objtoolopt="${objtoolopt} --retpoline" |
| 148 | 143 | fi |
| 144 | + | |
| 145 | + if is_enabled CONFIG_SLS; then | |
| 146 | + objtoolopt="${objtoolopt} --sls" | |
| 147 | + fi | |
| 148 | + | |
| 149 | 149 | if is_enabled CONFIG_X86_SMAP; then |
| 150 | 150 | objtoolopt="${objtoolopt} --uaccess" |
| 151 | 151 | 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" | |
| 154 | 155 | fi |
| 156 | + | |
| 157 | + if is_enabled CONFIG_GCOV_KERNEL; then | |
| 158 | + objtoolopt="${objtoolopt} --no-unreachable" | |
| 159 | + fi | |
| 160 | + | |
| 161 | + objtoolopt="${objtoolopt} --vmlinux" | |
| 162 | + | |
| 155 | 163 | info OBJTOOL ${1} |
| 156 | 164 | tools/objtool/objtool ${objtoolcmd} ${objtoolopt} ${1} |
| 157 | 165 | fi |