Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 commit 07919126ecfc ("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

+44 -11
+4 -4
Makefile
··· 1497 $(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(resolve_btfids_O) clean 1498 endif 1499 1500 - PHONY += objtool_clean 1501 1502 objtool_O = $(abspath $(objtree))/tools/objtool 1503 1504 - objtool_clean: 1505 ifneq ($(wildcard $(objtool_O)),) 1506 - $(Q)$(MAKE) -sC $(abs_srctree)/tools/objtool O=$(objtool_O) srctree=$(abs_srctree) clean 1507 endif 1508 1509 tools/: FORCE ··· 1686 $(mrproper-dirs): 1687 $(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@) 1688 1689 - mrproper: clean $(mrproper-dirs) 1690 $(call cmd,rmfiles) 1691 @find . $(RCS_FIND_IGNORE) \ 1692 \( -name '*.rmeta' \) \
··· 1497 $(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(resolve_btfids_O) clean 1498 endif 1499 1500 + PHONY += objtool_clean objtool_mrproper 1501 1502 objtool_O = $(abspath $(objtree))/tools/objtool 1503 1504 + objtool_clean objtool_mrproper: 1505 ifneq ($(wildcard $(objtool_O)),) 1506 + $(Q)$(MAKE) -sC $(abs_srctree)/tools/objtool O=$(objtool_O) srctree=$(abs_srctree) $(patsubst objtool_%,%,$@) 1507 endif 1508 1509 tools/: FORCE ··· 1686 $(mrproper-dirs): 1687 $(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@) 1688 1689 + mrproper: clean objtool_mrproper $(mrproper-dirs) 1690 $(call cmd,rmfiles) 1691 @find . $(RCS_FIND_IGNORE) \ 1692 \( -name '*.rmeta' \) \
+1
arch/alpha/kernel/vmlinux.lds.S
··· 71 72 STABS_DEBUG 73 DWARF_DEBUG 74 ELF_DETAILS 75 76 DISCARDS
··· 71 72 STABS_DEBUG 73 DWARF_DEBUG 74 + MODINFO 75 ELF_DETAILS 76 77 DISCARDS
+1
arch/arc/kernel/vmlinux.lds.S
··· 123 _end = . ; 124 125 STABS_DEBUG 126 ELF_DETAILS 127 DISCARDS 128
··· 123 _end = . ; 124 125 STABS_DEBUG 126 + MODINFO 127 ELF_DETAILS 128 DISCARDS 129
+1
arch/arm/boot/compressed/vmlinux.lds.S
··· 21 COMMON_DISCARDS 22 *(.ARM.exidx*) 23 *(.ARM.extab*) 24 *(.note.*) 25 *(.rel.*) 26 *(.printk_index)
··· 21 COMMON_DISCARDS 22 *(.ARM.exidx*) 23 *(.ARM.extab*) 24 + *(.modinfo) 25 *(.note.*) 26 *(.rel.*) 27 *(.printk_index)
+1
arch/arm/kernel/vmlinux-xip.lds.S
··· 154 155 STABS_DEBUG 156 DWARF_DEBUG 157 ARM_DETAILS 158 159 ARM_ASSERTS
··· 154 155 STABS_DEBUG 156 DWARF_DEBUG 157 + MODINFO 158 ARM_DETAILS 159 160 ARM_ASSERTS
+1
arch/arm/kernel/vmlinux.lds.S
··· 153 154 STABS_DEBUG 155 DWARF_DEBUG 156 ARM_DETAILS 157 158 ARM_ASSERTS
··· 153 154 STABS_DEBUG 155 DWARF_DEBUG 156 + MODINFO 157 ARM_DETAILS 158 159 ARM_ASSERTS
+1
arch/arm64/kernel/vmlinux.lds.S
··· 349 350 STABS_DEBUG 351 DWARF_DEBUG 352 ELF_DETAILS 353 354 HEAD_SYMBOLS
··· 349 350 STABS_DEBUG 351 DWARF_DEBUG 352 + MODINFO 353 ELF_DETAILS 354 355 HEAD_SYMBOLS
+1
arch/csky/kernel/vmlinux.lds.S
··· 109 110 STABS_DEBUG 111 DWARF_DEBUG 112 ELF_DETAILS 113 114 DISCARDS
··· 109 110 STABS_DEBUG 111 DWARF_DEBUG 112 + MODINFO 113 ELF_DETAILS 114 115 DISCARDS
+1
arch/hexagon/kernel/vmlinux.lds.S
··· 62 63 STABS_DEBUG 64 DWARF_DEBUG 65 ELF_DETAILS 66 .hexagon.attributes 0 : { *(.hexagon.attributes) } 67
··· 62 63 STABS_DEBUG 64 DWARF_DEBUG 65 + MODINFO 66 ELF_DETAILS 67 .hexagon.attributes 0 : { *(.hexagon.attributes) } 68
+1
arch/loongarch/kernel/vmlinux.lds.S
··· 147 148 STABS_DEBUG 149 DWARF_DEBUG 150 ELF_DETAILS 151 152 #ifdef CONFIG_EFI_STUB
··· 147 148 STABS_DEBUG 149 DWARF_DEBUG 150 + MODINFO 151 ELF_DETAILS 152 153 #ifdef CONFIG_EFI_STUB
+1
arch/m68k/kernel/vmlinux-nommu.lds
··· 85 _end = .; 86 87 STABS_DEBUG 88 ELF_DETAILS 89 90 /* Sections to be discarded */
··· 85 _end = .; 86 87 STABS_DEBUG 88 + MODINFO 89 ELF_DETAILS 90 91 /* Sections to be discarded */
+1
arch/m68k/kernel/vmlinux-std.lds
··· 58 _end = . ; 59 60 STABS_DEBUG 61 ELF_DETAILS 62 63 /* Sections to be discarded */
··· 58 _end = . ; 59 60 STABS_DEBUG 61 + MODINFO 62 ELF_DETAILS 63 64 /* Sections to be discarded */
+1
arch/m68k/kernel/vmlinux-sun3.lds
··· 51 _end = . ; 52 53 STABS_DEBUG 54 ELF_DETAILS 55 56 /* Sections to be discarded */
··· 51 _end = . ; 52 53 STABS_DEBUG 54 + MODINFO 55 ELF_DETAILS 56 57 /* Sections to be discarded */
+1
arch/mips/kernel/vmlinux.lds.S
··· 217 218 STABS_DEBUG 219 DWARF_DEBUG 220 ELF_DETAILS 221 222 /* These must appear regardless of . */
··· 217 218 STABS_DEBUG 219 DWARF_DEBUG 220 + MODINFO 221 ELF_DETAILS 222 223 /* These must appear regardless of . */
+1
arch/nios2/kernel/vmlinux.lds.S
··· 57 58 STABS_DEBUG 59 DWARF_DEBUG 60 ELF_DETAILS 61 62 DISCARDS
··· 57 58 STABS_DEBUG 59 DWARF_DEBUG 60 + MODINFO 61 ELF_DETAILS 62 63 DISCARDS
+1
arch/openrisc/kernel/vmlinux.lds.S
··· 101 /* Throw in the debugging sections */ 102 STABS_DEBUG 103 DWARF_DEBUG 104 ELF_DETAILS 105 106 /* Sections to be discarded -- must be last */
··· 101 /* Throw in the debugging sections */ 102 STABS_DEBUG 103 DWARF_DEBUG 104 + MODINFO 105 ELF_DETAILS 106 107 /* Sections to be discarded -- must be last */
+1
arch/parisc/boot/compressed/vmlinux.lds.S
··· 90 /* Sections to be discarded */ 91 DISCARDS 92 /DISCARD/ : { 93 #ifdef CONFIG_64BIT 94 /* temporary hack until binutils is fixed to not emit these 95 * for static binaries
··· 90 /* Sections to be discarded */ 91 DISCARDS 92 /DISCARD/ : { 93 + *(.modinfo) 94 #ifdef CONFIG_64BIT 95 /* temporary hack until binutils is fixed to not emit these 96 * for static binaries
+1
arch/parisc/kernel/vmlinux.lds.S
··· 165 _end = . ; 166 167 STABS_DEBUG 168 ELF_DETAILS 169 .note 0 : { *(.note) } 170
··· 165 _end = . ; 166 167 STABS_DEBUG 168 + MODINFO 169 ELF_DETAILS 170 .note 0 : { *(.note) } 171
+1
arch/powerpc/kernel/vmlinux.lds.S
··· 397 _end = . ; 398 399 DWARF_DEBUG 400 ELF_DETAILS 401 402 DISCARDS
··· 397 _end = . ; 398 399 DWARF_DEBUG 400 + MODINFO 401 ELF_DETAILS 402 403 DISCARDS
+1
arch/riscv/kernel/vmlinux.lds.S
··· 170 171 STABS_DEBUG 172 DWARF_DEBUG 173 ELF_DETAILS 174 .riscv.attributes 0 : { *(.riscv.attributes) } 175
··· 170 171 STABS_DEBUG 172 DWARF_DEBUG 173 + MODINFO 174 ELF_DETAILS 175 .riscv.attributes 0 : { *(.riscv.attributes) } 176
+1
arch/s390/kernel/vmlinux.lds.S
··· 221 /* Debugging sections. */ 222 STABS_DEBUG 223 DWARF_DEBUG 224 ELF_DETAILS 225 226 /*
··· 221 /* Debugging sections. */ 222 STABS_DEBUG 223 DWARF_DEBUG 224 + MODINFO 225 ELF_DETAILS 226 227 /*
+1
arch/sh/kernel/vmlinux.lds.S
··· 89 90 STABS_DEBUG 91 DWARF_DEBUG 92 ELF_DETAILS 93 94 DISCARDS
··· 89 90 STABS_DEBUG 91 DWARF_DEBUG 92 + MODINFO 93 ELF_DETAILS 94 95 DISCARDS
+1
arch/sparc/kernel/vmlinux.lds.S
··· 191 192 STABS_DEBUG 193 DWARF_DEBUG 194 ELF_DETAILS 195 196 DISCARDS
··· 191 192 STABS_DEBUG 193 DWARF_DEBUG 194 + MODINFO 195 ELF_DETAILS 196 197 DISCARDS
+1
arch/um/kernel/dyn.lds.S
··· 172 173 STABS_DEBUG 174 DWARF_DEBUG 175 ELF_DETAILS 176 177 DISCARDS
··· 172 173 STABS_DEBUG 174 DWARF_DEBUG 175 + MODINFO 176 ELF_DETAILS 177 178 DISCARDS
+1
arch/um/kernel/uml.lds.S
··· 113 114 STABS_DEBUG 115 DWARF_DEBUG 116 ELF_DETAILS 117 118 DISCARDS
··· 113 114 STABS_DEBUG 115 DWARF_DEBUG 116 + MODINFO 117 ELF_DETAILS 118 119 DISCARDS
+1 -1
arch/x86/boot/compressed/vmlinux.lds.S
··· 88 /DISCARD/ : { 89 *(.dynamic) *(.dynsym) *(.dynstr) *(.dynbss) 90 *(.hash) *(.gnu.hash) 91 - *(.note.*) 92 } 93 94 .got.plt (INFO) : {
··· 88 /DISCARD/ : { 89 *(.dynamic) *(.dynsym) *(.dynstr) *(.dynbss) 90 *(.hash) *(.gnu.hash) 91 + *(.note.*) *(.modinfo) 92 } 93 94 .got.plt (INFO) : {
+1
arch/x86/kernel/vmlinux.lds.S
··· 427 .llvm_bb_addr_map : { *(.llvm_bb_addr_map) } 428 #endif 429 430 ELF_DETAILS 431 432 DISCARDS
··· 427 .llvm_bb_addr_map : { *(.llvm_bb_addr_map) } 428 #endif 429 430 + MODINFO 431 ELF_DETAILS 432 433 DISCARDS
+3 -1
include/asm-generic/vmlinux.lds.h
··· 848 849 /* Required sections not related to debugging. */ 850 #define ELF_DETAILS \ 851 - .modinfo : { *(.modinfo) . = ALIGN(8); } \ 852 .comment 0 : { *(.comment) } \ 853 .symtab 0 : { *(.symtab) } \ 854 .strtab 0 : { *(.strtab) } \ 855 .shstrtab 0 : { *(.shstrtab) } 856 857 #ifdef CONFIG_GENERIC_BUG 858 #define BUG_TABLE \
··· 848 849 /* Required sections not related to debugging. */ 850 #define ELF_DETAILS \ 851 .comment 0 : { *(.comment) } \ 852 .symtab 0 : { *(.symtab) } \ 853 .strtab 0 : { *(.strtab) } \ 854 .shstrtab 0 : { *(.shstrtab) } 855 + 856 + #define MODINFO \ 857 + .modinfo : { *(.modinfo) . = ALIGN(8); } 858 859 #ifdef CONFIG_GENERIC_BUG 860 #define BUG_TABLE \
+2 -2
scripts/genksyms/parse.y
··· 325 { $$ = $4; } 326 | direct_declarator BRACKET_PHRASE 327 { $$ = $2; } 328 - | '(' declarator ')' 329 - { $$ = $3; } 330 ; 331 332 /* Nested declarators differ from regular declarators in that they do
··· 325 { $$ = $4; } 326 | direct_declarator BRACKET_PHRASE 327 { $$ = $2; } 328 + | '(' attribute_opt declarator ')' 329 + { $$ = $4; } 330 ; 331 332 /* Nested declarators differ from regular declarators in that they do
+4
scripts/package/install-extmod-build
··· 32 echo tools/objtool/objtool 33 fi 34 35 echo Module.symvers 36 echo "arch/${SRCARCH}/include/generated" 37 echo include/config/auto.conf
··· 32 echo tools/objtool/objtool 33 fi 34 35 + if is_enabled CONFIG_DEBUG_INFO_BTF_MODULES; then 36 + echo tools/bpf/resolve_btfids/resolve_btfids 37 + fi 38 + 39 echo Module.symvers 40 echo "arch/${SRCARCH}/include/generated" 41 echo include/config/auto.conf
+5 -3
tools/objtool/Makefile
··· 142 $(Q)$(RM) -r -- $(LIBSUBCMD_OUTPUT) 143 144 clean: $(LIBSUBCMD)-clean 145 - $(call QUIET_CLEAN, objtool) $(RM) $(OBJTOOL) 146 - $(Q)find $(OUTPUT) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete 147 $(Q)$(RM) $(OUTPUT)arch/x86/lib/cpu-feature-names.c $(OUTPUT)fixdep 148 $(Q)$(RM) $(OUTPUT)arch/x86/lib/inat-tables.c $(OUTPUT)fixdep 149 $(Q)$(RM) -- $(OUTPUT)FEATURE-DUMP.objtool 150 $(Q)$(RM) -r -- $(OUTPUT)feature 151 152 FORCE: 153 154 - .PHONY: clean FORCE
··· 142 $(Q)$(RM) -r -- $(LIBSUBCMD_OUTPUT) 143 144 clean: $(LIBSUBCMD)-clean 145 + $(Q)find $(OUTPUT) \( -name '*.o' -o -name '\.*.cmd' -o -name '\.*.d' \) -type f -print | xargs $(RM) 146 $(Q)$(RM) $(OUTPUT)arch/x86/lib/cpu-feature-names.c $(OUTPUT)fixdep 147 $(Q)$(RM) $(OUTPUT)arch/x86/lib/inat-tables.c $(OUTPUT)fixdep 148 $(Q)$(RM) -- $(OUTPUT)FEATURE-DUMP.objtool 149 $(Q)$(RM) -r -- $(OUTPUT)feature 150 151 + mrproper: clean 152 + $(call QUIET_CLEAN, objtool) $(RM) $(OBJTOOL) 153 + 154 FORCE: 155 156 + .PHONY: clean mrproper FORCE