@@ -154,35 +154,30 @@ $(obj)/%.ll: $(src)/%.c FORCE
154
154
# (See cmd_cc_o_c + relevant part of rule_cc_o_c)
155
155
156
156
quiet_cmd_cc_o_c = CC $(quiet_modtag) $@
157
+ cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
157
158
158
- ifndef CONFIG_MODVERSIONS
159
- cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
160
-
161
- else
159
+ ifdef CONFIG_MODVERSIONS
162
160
# When module versioning is enabled the following steps are executed:
163
- # o compile a .tmp_<file>.o from <file>.c
164
- # o if .tmp_<file>.o doesn't contain a __ksymtab version, i.e. does
165
- # not export symbols, we just rename .tmp_<file>.o to <file>.o and
166
- # are done.
161
+ # o compile a <file>.o from <file>.c
162
+ # o if <file>.o doesn't contain a __ksymtab version, i.e. does
163
+ # not export symbols, it's done.
167
164
# o otherwise, we calculate symbol versions using the good old
168
165
# genksyms on the preprocessed source and postprocess them in a way
169
166
# that they are usable as a linker script
170
- # o generate <file>.o from .tmp_ <file>.o using the linker to
167
+ # o generate .tmp_ <file>.o from <file>.o using the linker to
171
168
# replace the unresolved symbols __crc_exported_symbol with
172
169
# the actual value of the checksum generated by genksyms
173
-
174
- cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
170
+ # o remove .tmp_<file>.o to <file>.o
175
171
176
172
cmd_modversions_c = \
177
- if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
173
+ if $(OBJDUMP) -h $@ | grep -q __ksymtab; then \
178
174
$(call cmd_gensymtypes_c,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \
179
175
> $(@D)/.tmp_$(@F:.o=.ver); \
180
176
\
181
- $(LD) $(KBUILD_LDFLAGS) -r -o $@ $ (@D)/.tmp_$(@F) \
177
+ $(LD) $(KBUILD_LDFLAGS) -r -o $(@D)/.tmp_$(@F) $@ \
182
178
-T $(@D)/.tmp_$(@F:.o=.ver); \
183
- rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
184
- else \
185
179
mv -f $(@D)/.tmp_$(@F) $@; \
180
+ rm -f $(@D)/.tmp_$(@F:.o=.ver); \
186
181
fi;
187
182
endif
188
183
@@ -241,19 +236,12 @@ ifneq ($(RETPOLINE_CFLAGS),)
241
236
endif
242
237
endif
243
238
244
-
245
- ifdef CONFIG_MODVERSIONS
246
- objtool_o = $(@D)/.tmp_$(@F)
247
- else
248
- objtool_o = $(@)
249
- endif
250
-
251
239
# 'OBJECT_FILES_NON_STANDARD := y': skip objtool checking for a directory
252
240
# 'OBJECT_FILES_NON_STANDARD_foo.o := 'y': skip objtool checking for a file
253
241
# 'OBJECT_FILES_NON_STANDARD_foo.o := 'n': override directory skip for a file
254
242
cmd_objtool = $(if $(patsubst y%,, \
255
243
$(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n), \
256
- $(__objtool_obj) $(objtool_args) "$(objtool_o)" ;)
244
+ $(__objtool_obj) $(objtool_args) $@ ;)
257
245
objtool_obj = $(if $(patsubst y%,, \
258
246
$(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n), \
259
247
$(__objtool_obj))
@@ -357,34 +345,26 @@ $(obj)/%.s: $(src)/%.S FORCE
357
345
$(call if_changed_dep,cpp_s_S)
358
346
359
347
quiet_cmd_as_o_S = AS $(quiet_modtag) $@
348
+ cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
360
349
361
- ifndef CONFIG_MODVERSIONS
362
- cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
363
-
364
- else
350
+ ifdef CONFIG_MODVERSIONS
365
351
366
352
ASM_PROTOTYPES := $(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/asm-prototypes.h)
367
353
368
- ifeq ($(ASM_PROTOTYPES),)
369
- cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
370
-
371
- else
354
+ ifneq ($(ASM_PROTOTYPES),)
372
355
373
356
# versioning matches the C process described above, with difference that
374
357
# we parse asm-prototypes.h C header to get function definitions.
375
358
376
- cmd_as_o_S = $(CC) $(a_flags) -c -o $(@D)/.tmp_$(@F) $<
377
-
378
359
cmd_modversions_S = \
379
- if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
360
+ if $(OBJDUMP) -h $@ | grep -q __ksymtab; then \
380
361
$(call cmd_gensymtypes_S,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \
381
362
> $(@D)/.tmp_$(@F:.o=.ver); \
382
363
\
383
- $(LD) $(KBUILD_LDFLAGS) -r -o $@ $ (@D)/.tmp_$(@F) \
364
+ $(LD) $(KBUILD_LDFLAGS) -r -o $(@D)/.tmp_$(@F) $@ \
384
365
-T $(@D)/.tmp_$(@F:.o=.ver); \
385
- rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
386
- else \
387
366
mv -f $(@D)/.tmp_$(@F) $@; \
367
+ rm -f $(@D)/.tmp_$(@F:.o=.ver); \
388
368
fi;
389
369
endif
390
370
endif
0 commit comments