Skip to contentSkip to conversation

kbuild: Fix names of .tmp_vmlinux kallsyms files

PATCH Superseded Sedat Dilek 2 participants 4 messages Nov 23, 2024 – Nov 26, 2024 Kbuild

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: Fix names of .tmp_vmlinux kallsyms files

For details, see thread "kbuild-next: .tmp vmlinux syms files"

INFO: This patch is against Linux v6.12.

---
 scripts/link-vmlinux.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
scripts/link-vmlinux.sh +6 -6
index a9b3f34a78d2..c9088436baff 100755
@@ -203,8 +203,8 @@ kallsymso=
 strip_debug=
 
 if is_enabled CONFIG_KALLSYMS; then
-	true > .tmp_vmlinux.kallsyms0.syms
-	kallsyms .tmp_vmlinux.kallsyms0.syms .tmp_vmlinux0.kallsyms
+	true > .tmp_vmlinux0.kallsyms.syms
+	kallsyms .tmp_vmlinux0.kallsyms.syms .tmp_vmlinux0.kallsyms
 fi
 
 if is_enabled CONFIG_KALLSYMS || is_enabled CONFIG_DEBUG_INFO_BTF; then
@@ -231,14 +231,14 @@ if is_enabled CONFIG_KALLSYMS; then
 	# Generate section listing all symbols and add it into vmlinux
 	# It's a four step process:
 	# 0)  Generate a dummy __kallsyms with empty symbol list.
-	# 1)  Link .tmp_vmlinux.kallsyms1 so it has all symbols and sections,
+	# 1)  Link .tmp_vmlinux1.kallsyms so it has all symbols and sections,
 	#     with a dummy __kallsyms.
-	#     Running kallsyms on that gives us .tmp_kallsyms1.o with
+	#     Running kallsyms on that gives us .tmp_vmlinux1.kallsyms.o with
 	#     the right size
-	# 2)  Link .tmp_vmlinux.kallsyms2 so it now has a __kallsyms section of
+	# 2)  Link .tmp_vmlinux2.kallsyms so it now has a __kallsyms section of
 	#     the right size, but due to the added section, some
 	#     addresses have shifted.
-	#     From here, we generate a correct .tmp_vmlinux.kallsyms2.o
+	#     From here, we generate a correct .tmp_vmlinux2.kallsyms.o
 	# 3)  That link may have expanded the kernel image enough that
 	#     more linker branch stubs / trampolines had to be added, which
 	#     introduces new names, which further expands kallsyms. Do another
Signature · 1 line
2.45.2
#1 lore raw
Quoted 6 lines · Sedat Dilek

For details, see thread "kbuild-next: .tmp vmlinux syms files"

INFO: This patch is against Linux v6.12.

This is not the right way to input a commit description.

Quoted 11 lines
---
 scripts/link-vmlinux.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
scripts/link-vmlinux.sh +0 -0
index a9b3f34a78d2..c9088436baff 100755

scripts/link-vmlinux.sh kallsymso= · line 207

Quoted 7 lines
scripts/link-vmlinux.sh +2 -2
@@ -203,8 +203,8 @@ kallsymso=
 strip_debug=
 
 if is_enabled CONFIG_KALLSYMS; then
-       true > .tmp_vmlinux.kallsyms0.syms
-       kallsyms .tmp_vmlinux.kallsyms0.syms .tmp_vmlinux0.kallsyms
+       true > .tmp_vmlinux0.kallsyms.syms
+       kallsyms .tmp_vmlinux0.kallsyms.syms .tmp_vmlinux0.kallsyms

If you aim for naming consistency, this should be

.tmp_vmlinux0.syms

Quoted 25 lines
scripts/link-vmlinux.sh +4 -5
 fi
 
 if is_enabled CONFIG_KALLSYMS || is_enabled CONFIG_DEBUG_INFO_BTF; then
@@ -231,14 +231,14 @@ if is_enabled CONFIG_KALLSYMS; then
        # Generate section listing all symbols and add it into vmlinux
        # It's a four step process:
        # 0)  Generate a dummy __kallsyms with empty symbol list.
-       # 1)  Link .tmp_vmlinux.kallsyms1 so it has all symbols and sections,
+       # 1)  Link .tmp_vmlinux1.kallsyms so it has all symbols and sections,
        #     with a dummy __kallsyms.
-       #     Running kallsyms on that gives us .tmp_kallsyms1.o with
+       #     Running kallsyms on that gives us .tmp_vmlinux1.kallsyms.o with
        #     the right size
-       # 2)  Link .tmp_vmlinux.kallsyms2 so it now has a __kallsyms section of
+       # 2)  Link .tmp_vmlinux2.kallsyms so it now has a __kallsyms section of
        #     the right size, but due to the added section, some
        #     addresses have shifted.
-       #     From here, we generate a correct .tmp_vmlinux.kallsyms2.o
+       #     From here, we generate a correct .tmp_vmlinux2.kallsyms.o
        # 3)  That link may have expanded the kernel image enough that
        #     more linker branch stubs / trampolines had to be added, which
        #     introduces new names, which further expands kallsyms. Do another
--

2.45.2

Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw
Quoted 11 lines · Masahiro Yamada
Quoted 6 lines · Sedat Dilek

For details, see thread "kbuild-next: .tmp vmlinux syms files"

INFO: This patch is against Linux v6.12.

This is not the right way to input a commit description.

Hi Masahiro,

I can add a proper commit description in v2.

Quoted 22 lines
Quoted 12 lines
---
 scripts/link-vmlinux.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
scripts/link-vmlinux.sh +0 -0
index a9b3f34a78d2..c9088436baff 100755

scripts/link-vmlinux.sh kallsymso= · line 207

Quoted 7 lines
scripts/link-vmlinux.sh +2 -2
@@ -203,8 +203,8 @@ kallsymso=
 strip_debug=
 
 if is_enabled CONFIG_KALLSYMS; then
-       true > .tmp_vmlinux.kallsyms0.syms
-       kallsyms .tmp_vmlinux.kallsyms0.syms .tmp_vmlinux0.kallsyms
+       true > .tmp_vmlinux0.kallsyms.syms
+       kallsyms .tmp_vmlinux0.kallsyms.syms .tmp_vmlinux0.kallsyms

If you aim for naming consistency, this should be

Quoted 2 lines

.tmp_vmlinux0.syms

OK.
I was thinking of this, too.
I can change this as well.

The rest below is OK?

Thanks for your comments.

Best regards,
-Sedat-

Quoted 32 lines
Quoted 25 lines
scripts/link-vmlinux.sh +4 -5
 fi
 
 if is_enabled CONFIG_KALLSYMS || is_enabled CONFIG_DEBUG_INFO_BTF; then
@@ -231,14 +231,14 @@ if is_enabled CONFIG_KALLSYMS; then
        # Generate section listing all symbols and add it into vmlinux
        # It's a four step process:
        # 0)  Generate a dummy __kallsyms with empty symbol list.
-       # 1)  Link .tmp_vmlinux.kallsyms1 so it has all symbols and sections,
+       # 1)  Link .tmp_vmlinux1.kallsyms so it has all symbols and sections,
        #     with a dummy __kallsyms.
-       #     Running kallsyms on that gives us .tmp_kallsyms1.o with
+       #     Running kallsyms on that gives us .tmp_vmlinux1.kallsyms.o with
        #     the right size
-       # 2)  Link .tmp_vmlinux.kallsyms2 so it now has a __kallsyms section of
+       # 2)  Link .tmp_vmlinux2.kallsyms so it now has a __kallsyms section of
        #     the right size, but due to the added section, some
        #     addresses have shifted.
-       #     From here, we generate a correct .tmp_vmlinux.kallsyms2.o
+       #     From here, we generate a correct .tmp_vmlinux2.kallsyms.o
        # 3)  That link may have expanded the kernel image enough that
        #     more linker branch stubs / trampolines had to be added, which
        #     introduces new names, which further expands kallsyms. Do another
--
Quoted 2 lines

2.45.2

--
Best Regards
Masahiro Yamada

#3 lore raw
Quoted 43 lines · Sedat Dilek
Quoted 11 lines · Masahiro Yamada
Quoted 6 lines · Sedat Dilek

For details, see thread "kbuild-next: .tmp vmlinux syms files"

INFO: This patch is against Linux v6.12.

This is not the right way to input a commit description.

Hi Masahiro,

I can add a proper commit description in v2.

Quoted 22 lines
Quoted 12 lines
---
 scripts/link-vmlinux.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
scripts/link-vmlinux.sh +0 -0
index a9b3f34a78d2..c9088436baff 100755

scripts/link-vmlinux.sh kallsymso= · line 207

Quoted 7 lines
scripts/link-vmlinux.sh +2 -2
@@ -203,8 +203,8 @@ kallsymso=
 strip_debug=
 
 if is_enabled CONFIG_KALLSYMS; then
-       true > .tmp_vmlinux.kallsyms0.syms
-       kallsyms .tmp_vmlinux.kallsyms0.syms .tmp_vmlinux0.kallsyms
+       true > .tmp_vmlinux0.kallsyms.syms
+       kallsyms .tmp_vmlinux0.kallsyms.syms .tmp_vmlinux0.kallsyms

If you aim for naming consistency, this should be

Quoted 2 lines

.tmp_vmlinux0.syms

Quoted 8 lines

OK.
I was thinking of this, too.
I can change this as well.

The rest below is OK?

Thanks for your comments.

Info: Sent v2

Quoted 35 lines

Best regards,
-Sedat-

Quoted 32 lines
Quoted 25 lines
scripts/link-vmlinux.sh +4 -5
 fi
 
 if is_enabled CONFIG_KALLSYMS || is_enabled CONFIG_DEBUG_INFO_BTF; then
@@ -231,14 +231,14 @@ if is_enabled CONFIG_KALLSYMS; then
        # Generate section listing all symbols and add it into vmlinux
        # It's a four step process:
        # 0)  Generate a dummy __kallsyms with empty symbol list.
-       # 1)  Link .tmp_vmlinux.kallsyms1 so it has all symbols and sections,
+       # 1)  Link .tmp_vmlinux1.kallsyms so it has all symbols and sections,
        #     with a dummy __kallsyms.
-       #     Running kallsyms on that gives us .tmp_kallsyms1.o with
+       #     Running kallsyms on that gives us .tmp_vmlinux1.kallsyms.o with
        #     the right size
-       # 2)  Link .tmp_vmlinux.kallsyms2 so it now has a __kallsyms section of
+       # 2)  Link .tmp_vmlinux2.kallsyms so it now has a __kallsyms section of
        #     the right size, but due to the added section, some
        #     addresses have shifted.
-       #     From here, we generate a correct .tmp_vmlinux.kallsyms2.o
+       #     From here, we generate a correct .tmp_vmlinux2.kallsyms.o
        # 3)  That link may have expanded the kernel image enough that
        #     more linker branch stubs / trampolines had to be added, which
        #     introduces new names, which further expands kallsyms. Do another
--
Quoted 2 lines

2.45.2

--
Best Regards
Masahiro Yamada