mirror of
https://github.com/torvalds/linux.git
synced 2026-03-07 23:04:33 +01:00
Second round of Kbuild fixes for 7.0
- Split out .modinfo section from ELF_DETAILS macro, as that macro may be used in other areas that expect to discard .modinfo, breaking certain image layouts - Adjust genksyms parser to handle optional attributes in certain declarations, necessary after commit07919126ec("netfilter: annotate NAT helper hook pointers with __rcu") - Include resolve_btfids in external module build created by scripts/package/install-extmod-build when it may be run on external modules - Avoid removing objtool binary with 'make clean', as it is required for external module builds -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQR74yXHMTGczQHYypIdayaRccAalgUCaat33gAKCRAdayaRccAa lizMAQCxm0P5WsJf3ydYR+5ZzzM7wreNtpMVMXsCbwOKBGY3VwEAyvB7om1a00Ex Z6WFa9P4VKW+L4PWMnWoyxcnvl/CdgM= =mvIb -----END PGP SIGNATURE----- Merge tag 'kbuild-fixes-7.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux Pull Kbuild fixes from Nathan Chancellor: - Split out .modinfo section from ELF_DETAILS macro, as that macro may be used in other areas that expect to discard .modinfo, breaking certain image layouts - Adjust genksyms parser to handle optional attributes in certain declarations, necessary after commit07919126ec("netfilter: annotate NAT helper hook pointers with __rcu") - Include resolve_btfids in external module build created by scripts/package/install-extmod-build when it may be run on external modules - Avoid removing objtool binary with 'make clean', as it is required for external module builds * tag 'kbuild-fixes-7.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux: kbuild: Leave objtool binary around with 'make clean' kbuild: install-extmod-build: Package resolve_btfids if necessary genksyms: Fix parsing a declarator with a preceding attribute kbuild: Split .modinfo out from ELF_DETAILS
This commit is contained in:
commit
4ae12d8bd9
31 changed files with 44 additions and 11 deletions
8
Makefile
8
Makefile
|
|
@ -1497,13 +1497,13 @@ ifneq ($(wildcard $(resolve_btfids_O)),)
|
||||||
$(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(resolve_btfids_O) clean
|
$(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(resolve_btfids_O) clean
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PHONY += objtool_clean
|
PHONY += objtool_clean objtool_mrproper
|
||||||
|
|
||||||
objtool_O = $(abspath $(objtree))/tools/objtool
|
objtool_O = $(abspath $(objtree))/tools/objtool
|
||||||
|
|
||||||
objtool_clean:
|
objtool_clean objtool_mrproper:
|
||||||
ifneq ($(wildcard $(objtool_O)),)
|
ifneq ($(wildcard $(objtool_O)),)
|
||||||
$(Q)$(MAKE) -sC $(abs_srctree)/tools/objtool O=$(objtool_O) srctree=$(abs_srctree) clean
|
$(Q)$(MAKE) -sC $(abs_srctree)/tools/objtool O=$(objtool_O) srctree=$(abs_srctree) $(patsubst objtool_%,%,$@)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
tools/: FORCE
|
tools/: FORCE
|
||||||
|
|
@ -1686,7 +1686,7 @@ PHONY += $(mrproper-dirs) mrproper
|
||||||
$(mrproper-dirs):
|
$(mrproper-dirs):
|
||||||
$(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
|
$(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
|
||||||
|
|
||||||
mrproper: clean $(mrproper-dirs)
|
mrproper: clean objtool_mrproper $(mrproper-dirs)
|
||||||
$(call cmd,rmfiles)
|
$(call cmd,rmfiles)
|
||||||
@find . $(RCS_FIND_IGNORE) \
|
@find . $(RCS_FIND_IGNORE) \
|
||||||
\( -name '*.rmeta' \) \
|
\( -name '*.rmeta' \) \
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ SECTIONS
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
DISCARDS
|
DISCARDS
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,7 @@ SECTIONS
|
||||||
_end = . ;
|
_end = . ;
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
DISCARDS
|
DISCARDS
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ SECTIONS
|
||||||
COMMON_DISCARDS
|
COMMON_DISCARDS
|
||||||
*(.ARM.exidx*)
|
*(.ARM.exidx*)
|
||||||
*(.ARM.extab*)
|
*(.ARM.extab*)
|
||||||
|
*(.modinfo)
|
||||||
*(.note.*)
|
*(.note.*)
|
||||||
*(.rel.*)
|
*(.rel.*)
|
||||||
*(.printk_index)
|
*(.printk_index)
|
||||||
|
|
|
||||||
|
|
@ -154,6 +154,7 @@ SECTIONS
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ARM_DETAILS
|
ARM_DETAILS
|
||||||
|
|
||||||
ARM_ASSERTS
|
ARM_ASSERTS
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,7 @@ SECTIONS
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ARM_DETAILS
|
ARM_DETAILS
|
||||||
|
|
||||||
ARM_ASSERTS
|
ARM_ASSERTS
|
||||||
|
|
|
||||||
|
|
@ -349,6 +349,7 @@ SECTIONS
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
HEAD_SYMBOLS
|
HEAD_SYMBOLS
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ SECTIONS
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
DISCARDS
|
DISCARDS
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@ SECTIONS
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
.hexagon.attributes 0 : { *(.hexagon.attributes) }
|
.hexagon.attributes 0 : { *(.hexagon.attributes) }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,7 @@ SECTIONS
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
#ifdef CONFIG_EFI_STUB
|
#ifdef CONFIG_EFI_STUB
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,7 @@ SECTIONS {
|
||||||
_end = .;
|
_end = .;
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
/* Sections to be discarded */
|
/* Sections to be discarded */
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ SECTIONS
|
||||||
_end = . ;
|
_end = . ;
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
/* Sections to be discarded */
|
/* Sections to be discarded */
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ __init_begin = .;
|
||||||
_end = . ;
|
_end = . ;
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
/* Sections to be discarded */
|
/* Sections to be discarded */
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,7 @@ SECTIONS
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
/* These must appear regardless of . */
|
/* These must appear regardless of . */
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ SECTIONS
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
DISCARDS
|
DISCARDS
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@ SECTIONS
|
||||||
/* Throw in the debugging sections */
|
/* Throw in the debugging sections */
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
/* Sections to be discarded -- must be last */
|
/* Sections to be discarded -- must be last */
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ SECTIONS
|
||||||
/* Sections to be discarded */
|
/* Sections to be discarded */
|
||||||
DISCARDS
|
DISCARDS
|
||||||
/DISCARD/ : {
|
/DISCARD/ : {
|
||||||
|
*(.modinfo)
|
||||||
#ifdef CONFIG_64BIT
|
#ifdef CONFIG_64BIT
|
||||||
/* temporary hack until binutils is fixed to not emit these
|
/* temporary hack until binutils is fixed to not emit these
|
||||||
* for static binaries
|
* for static binaries
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,7 @@ SECTIONS
|
||||||
_end = . ;
|
_end = . ;
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
.note 0 : { *(.note) }
|
.note 0 : { *(.note) }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -397,6 +397,7 @@ SECTIONS
|
||||||
_end = . ;
|
_end = . ;
|
||||||
|
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
DISCARDS
|
DISCARDS
|
||||||
|
|
|
||||||
|
|
@ -170,6 +170,7 @@ SECTIONS
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
.riscv.attributes 0 : { *(.riscv.attributes) }
|
.riscv.attributes 0 : { *(.riscv.attributes) }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -221,6 +221,7 @@ SECTIONS
|
||||||
/* Debugging sections. */
|
/* Debugging sections. */
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ SECTIONS
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
DISCARDS
|
DISCARDS
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,7 @@ SECTIONS
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
DISCARDS
|
DISCARDS
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,7 @@ SECTIONS
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
DISCARDS
|
DISCARDS
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,7 @@ SECTIONS
|
||||||
|
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
DISCARDS
|
DISCARDS
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ SECTIONS
|
||||||
/DISCARD/ : {
|
/DISCARD/ : {
|
||||||
*(.dynamic) *(.dynsym) *(.dynstr) *(.dynbss)
|
*(.dynamic) *(.dynsym) *(.dynstr) *(.dynbss)
|
||||||
*(.hash) *(.gnu.hash)
|
*(.hash) *(.gnu.hash)
|
||||||
*(.note.*)
|
*(.note.*) *(.modinfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
.got.plt (INFO) : {
|
.got.plt (INFO) : {
|
||||||
|
|
|
||||||
|
|
@ -427,6 +427,7 @@ SECTIONS
|
||||||
.llvm_bb_addr_map : { *(.llvm_bb_addr_map) }
|
.llvm_bb_addr_map : { *(.llvm_bb_addr_map) }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
MODINFO
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
|
||||||
DISCARDS
|
DISCARDS
|
||||||
|
|
|
||||||
|
|
@ -848,12 +848,14 @@
|
||||||
|
|
||||||
/* Required sections not related to debugging. */
|
/* Required sections not related to debugging. */
|
||||||
#define ELF_DETAILS \
|
#define ELF_DETAILS \
|
||||||
.modinfo : { *(.modinfo) . = ALIGN(8); } \
|
|
||||||
.comment 0 : { *(.comment) } \
|
.comment 0 : { *(.comment) } \
|
||||||
.symtab 0 : { *(.symtab) } \
|
.symtab 0 : { *(.symtab) } \
|
||||||
.strtab 0 : { *(.strtab) } \
|
.strtab 0 : { *(.strtab) } \
|
||||||
.shstrtab 0 : { *(.shstrtab) }
|
.shstrtab 0 : { *(.shstrtab) }
|
||||||
|
|
||||||
|
#define MODINFO \
|
||||||
|
.modinfo : { *(.modinfo) . = ALIGN(8); }
|
||||||
|
|
||||||
#ifdef CONFIG_GENERIC_BUG
|
#ifdef CONFIG_GENERIC_BUG
|
||||||
#define BUG_TABLE \
|
#define BUG_TABLE \
|
||||||
. = ALIGN(8); \
|
. = ALIGN(8); \
|
||||||
|
|
|
||||||
|
|
@ -325,8 +325,8 @@ direct_declarator:
|
||||||
{ $$ = $4; }
|
{ $$ = $4; }
|
||||||
| direct_declarator BRACKET_PHRASE
|
| direct_declarator BRACKET_PHRASE
|
||||||
{ $$ = $2; }
|
{ $$ = $2; }
|
||||||
| '(' declarator ')'
|
| '(' attribute_opt declarator ')'
|
||||||
{ $$ = $3; }
|
{ $$ = $4; }
|
||||||
;
|
;
|
||||||
|
|
||||||
/* Nested declarators differ from regular declarators in that they do
|
/* Nested declarators differ from regular declarators in that they do
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,10 @@ mkdir -p "${destdir}"
|
||||||
echo tools/objtool/objtool
|
echo tools/objtool/objtool
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if is_enabled CONFIG_DEBUG_INFO_BTF_MODULES; then
|
||||||
|
echo tools/bpf/resolve_btfids/resolve_btfids
|
||||||
|
fi
|
||||||
|
|
||||||
echo Module.symvers
|
echo Module.symvers
|
||||||
echo "arch/${SRCARCH}/include/generated"
|
echo "arch/${SRCARCH}/include/generated"
|
||||||
echo include/config/auto.conf
|
echo include/config/auto.conf
|
||||||
|
|
|
||||||
|
|
@ -142,13 +142,15 @@ $(LIBSUBCMD)-clean:
|
||||||
$(Q)$(RM) -r -- $(LIBSUBCMD_OUTPUT)
|
$(Q)$(RM) -r -- $(LIBSUBCMD_OUTPUT)
|
||||||
|
|
||||||
clean: $(LIBSUBCMD)-clean
|
clean: $(LIBSUBCMD)-clean
|
||||||
$(call QUIET_CLEAN, objtool) $(RM) $(OBJTOOL)
|
$(Q)find $(OUTPUT) \( -name '*.o' -o -name '\.*.cmd' -o -name '\.*.d' \) -type f -print | xargs $(RM)
|
||||||
$(Q)find $(OUTPUT) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
|
|
||||||
$(Q)$(RM) $(OUTPUT)arch/x86/lib/cpu-feature-names.c $(OUTPUT)fixdep
|
$(Q)$(RM) $(OUTPUT)arch/x86/lib/cpu-feature-names.c $(OUTPUT)fixdep
|
||||||
$(Q)$(RM) $(OUTPUT)arch/x86/lib/inat-tables.c $(OUTPUT)fixdep
|
$(Q)$(RM) $(OUTPUT)arch/x86/lib/inat-tables.c $(OUTPUT)fixdep
|
||||||
$(Q)$(RM) -- $(OUTPUT)FEATURE-DUMP.objtool
|
$(Q)$(RM) -- $(OUTPUT)FEATURE-DUMP.objtool
|
||||||
$(Q)$(RM) -r -- $(OUTPUT)feature
|
$(Q)$(RM) -r -- $(OUTPUT)feature
|
||||||
|
|
||||||
|
mrproper: clean
|
||||||
|
$(call QUIET_CLEAN, objtool) $(RM) $(OBJTOOL)
|
||||||
|
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
||||||
.PHONY: clean FORCE
|
.PHONY: clean mrproper FORCE
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue