Skip to content

Commit e0fc0d1

Browse files
committed
patches: Apply .ARM.attributes patch to fix orphan section errors
See the commit message for a full description of the error resolved by this patch. Signed-off-by: Nathan Chancellor <[email protected]>
1 parent f8e0b36 commit e0fc0d1

18 files changed

+603
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
From git@z Thu Jan 1 00:00:00 1970
2+
Subject: [PATCH] arm64: Handle .ARM.attributes section in linker scripts
3+
From: Nathan Chancellor <[email protected]>
4+
Date: Fri, 24 Jan 2025 06:31:57 -0700
5+
Message-Id: <20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org>
6+
MIME-Version: 1.0
7+
Content-Type: text/plain; charset="utf-8"
8+
Content-Transfer-Encoding: 7bit
9+
10+
A recent LLVM commit [1] started generating an .ARM.attributes section
11+
similar to the one that exists for 32-bit, which results in orphan
12+
section warnings (or errors if CONFIG_WERROR is enabled) from the linker
13+
because it is not handled in the arm64 linker scripts.
14+
15+
ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes'
16+
ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes'
17+
18+
ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes'
19+
ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes'
20+
ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes'
21+
22+
Add this new section to the necessary linker scripts to resolve the warnings.
23+
24+
25+
Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement")
26+
Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1]
27+
Link: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org
28+
Signed-off-by: Nathan Chancellor <[email protected]>
29+
---
30+
arch/arm64/kernel/vdso/vdso.lds.S | 1 +
31+
arch/arm64/kernel/vmlinux.lds.S | 1 +
32+
2 files changed, 2 insertions(+)
33+
34+
diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S
35+
index 4ec32e86a8da..f8418a3a2758 100644
36+
--- a/arch/arm64/kernel/vdso/vdso.lds.S
37+
+++ b/arch/arm64/kernel/vdso/vdso.lds.S
38+
@@ -75,6 +75,7 @@ SECTIONS
39+
40+
DWARF_DEBUG
41+
ELF_DETAILS
42+
+ .ARM.attributes 0 : { *(.ARM.attributes) }
43+
44+
/DISCARD/ : {
45+
*(.data .data.* .gnu.linkonce.d.* .sdata*)
46+
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
47+
index f84c71f04d9e..c94942e9eb46 100644
48+
--- a/arch/arm64/kernel/vmlinux.lds.S
49+
+++ b/arch/arm64/kernel/vmlinux.lds.S
50+
@@ -335,6 +335,7 @@ SECTIONS
51+
STABS_DEBUG
52+
DWARF_DEBUG
53+
ELF_DETAILS
54+
+ .ARM.attributes 0 : { *(.ARM.attributes) }
55+
56+
HEAD_SYMBOLS
57+
58+
59+
---
60+
base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3
61+
change-id: 20250123-arm64-handle-arm-attributes-in-linker-script-82aee25313ac
62+
63+
Best regards,
64+
--
65+
Nathan Chancellor <[email protected]>
66+

patches/6.12/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
From git@z Thu Jan 1 00:00:00 1970
2+
Subject: [PATCH] arm64: Handle .ARM.attributes section in linker scripts
3+
From: Nathan Chancellor <[email protected]>
4+
Date: Fri, 24 Jan 2025 06:31:57 -0700
5+
Message-Id: <20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org>
6+
MIME-Version: 1.0
7+
Content-Type: text/plain; charset="utf-8"
8+
Content-Transfer-Encoding: 7bit
9+
10+
A recent LLVM commit [1] started generating an .ARM.attributes section
11+
similar to the one that exists for 32-bit, which results in orphan
12+
section warnings (or errors if CONFIG_WERROR is enabled) from the linker
13+
because it is not handled in the arm64 linker scripts.
14+
15+
ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes'
16+
ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes'
17+
18+
ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes'
19+
ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes'
20+
ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes'
21+
22+
Add this new section to the necessary linker scripts to resolve the warnings.
23+
24+
25+
Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement")
26+
Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1]
27+
Link: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org
28+
Signed-off-by: Nathan Chancellor <[email protected]>
29+
---
30+
arch/arm64/kernel/vdso/vdso.lds.S | 1 +
31+
arch/arm64/kernel/vmlinux.lds.S | 1 +
32+
2 files changed, 2 insertions(+)
33+
34+
diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S
35+
index 4ec32e86a8da..f8418a3a2758 100644
36+
--- a/arch/arm64/kernel/vdso/vdso.lds.S
37+
+++ b/arch/arm64/kernel/vdso/vdso.lds.S
38+
@@ -75,6 +75,7 @@ SECTIONS
39+
40+
DWARF_DEBUG
41+
ELF_DETAILS
42+
+ .ARM.attributes 0 : { *(.ARM.attributes) }
43+
44+
/DISCARD/ : {
45+
*(.data .data.* .gnu.linkonce.d.* .sdata*)
46+
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
47+
index f84c71f04d9e..c94942e9eb46 100644
48+
--- a/arch/arm64/kernel/vmlinux.lds.S
49+
+++ b/arch/arm64/kernel/vmlinux.lds.S
50+
@@ -335,6 +335,7 @@ SECTIONS
51+
STABS_DEBUG
52+
DWARF_DEBUG
53+
ELF_DETAILS
54+
+ .ARM.attributes 0 : { *(.ARM.attributes) }
55+
56+
HEAD_SYMBOLS
57+
58+
59+
---
60+
base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3
61+
change-id: 20250123-arm64-handle-arm-attributes-in-linker-script-82aee25313ac
62+
63+
Best regards,
64+
--
65+
Nathan Chancellor <[email protected]>
66+

patches/6.6/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
8b55f8818900c99dd4f55a59a103f5b29e41eb2c.patch
2+
20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
From git@z Thu Jan 1 00:00:00 1970
2+
Subject: [PATCH] arm64: Handle .ARM.attributes section in linker scripts
3+
From: Nathan Chancellor <[email protected]>
4+
Date: Fri, 24 Jan 2025 06:31:57 -0700
5+
Message-Id: <20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org>
6+
MIME-Version: 1.0
7+
Content-Type: text/plain; charset="utf-8"
8+
Content-Transfer-Encoding: 7bit
9+
10+
A recent LLVM commit [1] started generating an .ARM.attributes section
11+
similar to the one that exists for 32-bit, which results in orphan
12+
section warnings (or errors if CONFIG_WERROR is enabled) from the linker
13+
because it is not handled in the arm64 linker scripts.
14+
15+
ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes'
16+
ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes'
17+
18+
ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes'
19+
ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes'
20+
ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes'
21+
22+
Add this new section to the necessary linker scripts to resolve the warnings.
23+
24+
25+
Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement")
26+
Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1]
27+
Link: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org
28+
Signed-off-by: Nathan Chancellor <[email protected]>
29+
---
30+
arch/arm64/kernel/vdso/vdso.lds.S | 1 +
31+
arch/arm64/kernel/vmlinux.lds.S | 1 +
32+
2 files changed, 2 insertions(+)
33+
34+
diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S
35+
index 4ec32e86a8da..f8418a3a2758 100644
36+
--- a/arch/arm64/kernel/vdso/vdso.lds.S
37+
+++ b/arch/arm64/kernel/vdso/vdso.lds.S
38+
@@ -75,6 +75,7 @@ SECTIONS
39+
40+
DWARF_DEBUG
41+
ELF_DETAILS
42+
+ .ARM.attributes 0 : { *(.ARM.attributes) }
43+
44+
/DISCARD/ : {
45+
*(.data .data.* .gnu.linkonce.d.* .sdata*)
46+
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
47+
index f84c71f04d9e..c94942e9eb46 100644
48+
--- a/arch/arm64/kernel/vmlinux.lds.S
49+
+++ b/arch/arm64/kernel/vmlinux.lds.S
50+
@@ -335,6 +335,7 @@ SECTIONS
51+
STABS_DEBUG
52+
DWARF_DEBUG
53+
ELF_DETAILS
54+
+ .ARM.attributes 0 : { *(.ARM.attributes) }
55+
56+
HEAD_SYMBOLS
57+
58+
59+
---
60+
base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3
61+
change-id: 20250123-arm64-handle-arm-attributes-in-linker-script-82aee25313ac
62+
63+
Best regards,
64+
--
65+
Nathan Chancellor <[email protected]>
66+

patches/android-mainline/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
From git@z Thu Jan 1 00:00:00 1970
2+
Subject: [PATCH] arm64: Handle .ARM.attributes section in linker scripts
3+
From: Nathan Chancellor <[email protected]>
4+
Date: Fri, 24 Jan 2025 06:31:57 -0700
5+
Message-Id: <20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org>
6+
MIME-Version: 1.0
7+
Content-Type: text/plain; charset="utf-8"
8+
Content-Transfer-Encoding: 7bit
9+
10+
A recent LLVM commit [1] started generating an .ARM.attributes section
11+
similar to the one that exists for 32-bit, which results in orphan
12+
section warnings (or errors if CONFIG_WERROR is enabled) from the linker
13+
because it is not handled in the arm64 linker scripts.
14+
15+
ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes'
16+
ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes'
17+
18+
ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes'
19+
ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes'
20+
ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes'
21+
22+
Add this new section to the necessary linker scripts to resolve the warnings.
23+
24+
25+
Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement")
26+
Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1]
27+
Link: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org
28+
Signed-off-by: Nathan Chancellor <[email protected]>
29+
---
30+
arch/arm64/kernel/vdso/vdso.lds.S | 1 +
31+
arch/arm64/kernel/vmlinux.lds.S | 1 +
32+
2 files changed, 2 insertions(+)
33+
34+
diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S
35+
index 4ec32e86a8da..f8418a3a2758 100644
36+
--- a/arch/arm64/kernel/vdso/vdso.lds.S
37+
+++ b/arch/arm64/kernel/vdso/vdso.lds.S
38+
@@ -75,6 +75,7 @@ SECTIONS
39+
40+
DWARF_DEBUG
41+
ELF_DETAILS
42+
+ .ARM.attributes 0 : { *(.ARM.attributes) }
43+
44+
/DISCARD/ : {
45+
*(.data .data.* .gnu.linkonce.d.* .sdata*)
46+
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
47+
index f84c71f04d9e..c94942e9eb46 100644
48+
--- a/arch/arm64/kernel/vmlinux.lds.S
49+
+++ b/arch/arm64/kernel/vmlinux.lds.S
50+
@@ -335,6 +335,7 @@ SECTIONS
51+
STABS_DEBUG
52+
DWARF_DEBUG
53+
ELF_DETAILS
54+
+ .ARM.attributes 0 : { *(.ARM.attributes) }
55+
56+
HEAD_SYMBOLS
57+
58+
59+
---
60+
base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3
61+
change-id: 20250123-arm64-handle-arm-attributes-in-linker-script-82aee25313ac
62+
63+
Best regards,
64+
--
65+
Nathan Chancellor <[email protected]>
66+

patches/android15-6.6/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
From git@z Thu Jan 1 00:00:00 1970
2+
Subject: [PATCH] arm64: Handle .ARM.attributes section in linker scripts
3+
From: Nathan Chancellor <[email protected]>
4+
Date: Fri, 24 Jan 2025 06:31:57 -0700
5+
Message-Id: <20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org>
6+
MIME-Version: 1.0
7+
Content-Type: text/plain; charset="utf-8"
8+
Content-Transfer-Encoding: 7bit
9+
10+
A recent LLVM commit [1] started generating an .ARM.attributes section
11+
similar to the one that exists for 32-bit, which results in orphan
12+
section warnings (or errors if CONFIG_WERROR is enabled) from the linker
13+
because it is not handled in the arm64 linker scripts.
14+
15+
ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes'
16+
ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes'
17+
18+
ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes'
19+
ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes'
20+
ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes'
21+
22+
Add this new section to the necessary linker scripts to resolve the warnings.
23+
24+
25+
Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement")
26+
Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1]
27+
Link: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org
28+
Signed-off-by: Nathan Chancellor <[email protected]>
29+
---
30+
arch/arm64/kernel/vdso/vdso.lds.S | 1 +
31+
arch/arm64/kernel/vmlinux.lds.S | 1 +
32+
2 files changed, 2 insertions(+)
33+
34+
diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S
35+
index 4ec32e86a8da..f8418a3a2758 100644
36+
--- a/arch/arm64/kernel/vdso/vdso.lds.S
37+
+++ b/arch/arm64/kernel/vdso/vdso.lds.S
38+
@@ -75,6 +75,7 @@ SECTIONS
39+
40+
DWARF_DEBUG
41+
ELF_DETAILS
42+
+ .ARM.attributes 0 : { *(.ARM.attributes) }
43+
44+
/DISCARD/ : {
45+
*(.data .data.* .gnu.linkonce.d.* .sdata*)
46+
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
47+
index f84c71f04d9e..c94942e9eb46 100644
48+
--- a/arch/arm64/kernel/vmlinux.lds.S
49+
+++ b/arch/arm64/kernel/vmlinux.lds.S
50+
@@ -335,6 +335,7 @@ SECTIONS
51+
STABS_DEBUG
52+
DWARF_DEBUG
53+
ELF_DETAILS
54+
+ .ARM.attributes 0 : { *(.ARM.attributes) }
55+
56+
HEAD_SYMBOLS
57+
58+
59+
---
60+
base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3
61+
change-id: 20250123-arm64-handle-arm-attributes-in-linker-script-82aee25313ac
62+
63+
Best regards,
64+
--
65+
Nathan Chancellor <[email protected]>
66+

patches/arm64-fixes/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
8b55f8818900c99dd4f55a59a103f5b29e41eb2c.patch
2+
20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch

0 commit comments

Comments
 (0)