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