diff --git a/patches/6.12/series b/patches/6.12/series index f02aaeed..1ed792e8 100644 --- a/patches/6.12/series +++ b/patches/6.12/series @@ -1,2 +1,2 @@ 8b55f8818900c99dd4f55a59a103f5b29e41eb2c.patch -20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch diff --git a/patches/6.12/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch b/patches/6.12/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch similarity index 62% rename from patches/6.12/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch rename to patches/6.12/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch index 9ac5e155..497ff807 100644 --- a/patches/6.12/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +++ b/patches/6.12/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch @@ -1,8 +1,8 @@ From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] arm64: Handle .ARM.attributes section in linker scripts +Subject: [PATCH v2] arm64: Handle .ARM.attributes section in linker scripts From: Nathan Chancellor -Date: Fri, 24 Jan 2025 06:31:57 -0700 -Message-Id: <20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org> +Date: Tue, 04 Feb 2025 10:48:55 -0700 +Message-Id: <20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit @@ -19,42 +19,49 @@ because it is not handled in the arm64 linker scripts. ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes' ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes' -Add this new section to the necessary linker scripts to resolve the warnings. +Discard the new sections in the necessary linker scripts to resolve the +warnings, as the kernel and vDSO do not need to retain it, similar to +the .note.gnu.property section. Cc: stable@vger.kernel.org Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement") Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1] -Link: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org +Link: https://lore.kernel.org/r/20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org Signed-off-by: Nathan Chancellor +--- +Changes in v2: +- Discard the section instead of adding it to the final artifacts to + mirror the .note.gnu.property section handling (Will). +- Link to v1: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org --- arch/arm64/kernel/vdso/vdso.lds.S | 1 + arch/arm64/kernel/vmlinux.lds.S | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S -index 4ec32e86a8da..f8418a3a2758 100644 +index 4ec32e86a8da..8095fef66209 100644 --- a/arch/arm64/kernel/vdso/vdso.lds.S +++ b/arch/arm64/kernel/vdso/vdso.lds.S -@@ -75,6 +75,7 @@ SECTIONS - - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - /DISCARD/ : { +@@ -80,6 +80,7 @@ SECTIONS *(.data .data.* .gnu.linkonce.d.* .sdata*) + *(.bss .sbss .dynbss .dynsbss) + *(.eh_frame .eh_frame_hdr) ++ *(.ARM.attributes) + } + } + diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S -index f84c71f04d9e..c94942e9eb46 100644 +index f84c71f04d9e..e73326bd3ff7 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S -@@ -335,6 +335,7 @@ SECTIONS - STABS_DEBUG - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - HEAD_SYMBOLS +@@ -162,6 +162,7 @@ SECTIONS + /DISCARD/ : { + *(.interp .dynamic) + *(.dynsym .dynstr .hash .gnu.hash) ++ *(.ARM.attributes) + } + . = KIMAGE_VADDR; --- base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3 diff --git a/patches/6.6/series b/patches/6.6/series index f02aaeed..1ed792e8 100644 --- a/patches/6.6/series +++ b/patches/6.6/series @@ -1,2 +1,2 @@ 8b55f8818900c99dd4f55a59a103f5b29e41eb2c.patch -20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch diff --git a/patches/6.6/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch b/patches/6.6/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch similarity index 62% rename from patches/6.6/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch rename to patches/6.6/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch index 9ac5e155..497ff807 100644 --- a/patches/6.6/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +++ b/patches/6.6/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch @@ -1,8 +1,8 @@ From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] arm64: Handle .ARM.attributes section in linker scripts +Subject: [PATCH v2] arm64: Handle .ARM.attributes section in linker scripts From: Nathan Chancellor -Date: Fri, 24 Jan 2025 06:31:57 -0700 -Message-Id: <20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org> +Date: Tue, 04 Feb 2025 10:48:55 -0700 +Message-Id: <20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit @@ -19,42 +19,49 @@ because it is not handled in the arm64 linker scripts. ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes' ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes' -Add this new section to the necessary linker scripts to resolve the warnings. +Discard the new sections in the necessary linker scripts to resolve the +warnings, as the kernel and vDSO do not need to retain it, similar to +the .note.gnu.property section. Cc: stable@vger.kernel.org Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement") Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1] -Link: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org +Link: https://lore.kernel.org/r/20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org Signed-off-by: Nathan Chancellor +--- +Changes in v2: +- Discard the section instead of adding it to the final artifacts to + mirror the .note.gnu.property section handling (Will). +- Link to v1: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org --- arch/arm64/kernel/vdso/vdso.lds.S | 1 + arch/arm64/kernel/vmlinux.lds.S | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S -index 4ec32e86a8da..f8418a3a2758 100644 +index 4ec32e86a8da..8095fef66209 100644 --- a/arch/arm64/kernel/vdso/vdso.lds.S +++ b/arch/arm64/kernel/vdso/vdso.lds.S -@@ -75,6 +75,7 @@ SECTIONS - - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - /DISCARD/ : { +@@ -80,6 +80,7 @@ SECTIONS *(.data .data.* .gnu.linkonce.d.* .sdata*) + *(.bss .sbss .dynbss .dynsbss) + *(.eh_frame .eh_frame_hdr) ++ *(.ARM.attributes) + } + } + diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S -index f84c71f04d9e..c94942e9eb46 100644 +index f84c71f04d9e..e73326bd3ff7 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S -@@ -335,6 +335,7 @@ SECTIONS - STABS_DEBUG - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - HEAD_SYMBOLS +@@ -162,6 +162,7 @@ SECTIONS + /DISCARD/ : { + *(.interp .dynamic) + *(.dynsym .dynstr .hash .gnu.hash) ++ *(.ARM.attributes) + } + . = KIMAGE_VADDR; --- base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3 diff --git a/patches/android-mainline/series b/patches/android-mainline/series index b015fbc2..65bdd9df 100644 --- a/patches/android-mainline/series +++ b/patches/android-mainline/series @@ -1 +1 @@ -20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch diff --git a/patches/android-mainline/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch b/patches/android-mainline/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch similarity index 62% rename from patches/android-mainline/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch rename to patches/android-mainline/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch index 9ac5e155..497ff807 100644 --- a/patches/android-mainline/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +++ b/patches/android-mainline/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch @@ -1,8 +1,8 @@ From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] arm64: Handle .ARM.attributes section in linker scripts +Subject: [PATCH v2] arm64: Handle .ARM.attributes section in linker scripts From: Nathan Chancellor -Date: Fri, 24 Jan 2025 06:31:57 -0700 -Message-Id: <20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org> +Date: Tue, 04 Feb 2025 10:48:55 -0700 +Message-Id: <20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit @@ -19,42 +19,49 @@ because it is not handled in the arm64 linker scripts. ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes' ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes' -Add this new section to the necessary linker scripts to resolve the warnings. +Discard the new sections in the necessary linker scripts to resolve the +warnings, as the kernel and vDSO do not need to retain it, similar to +the .note.gnu.property section. Cc: stable@vger.kernel.org Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement") Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1] -Link: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org +Link: https://lore.kernel.org/r/20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org Signed-off-by: Nathan Chancellor +--- +Changes in v2: +- Discard the section instead of adding it to the final artifacts to + mirror the .note.gnu.property section handling (Will). +- Link to v1: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org --- arch/arm64/kernel/vdso/vdso.lds.S | 1 + arch/arm64/kernel/vmlinux.lds.S | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S -index 4ec32e86a8da..f8418a3a2758 100644 +index 4ec32e86a8da..8095fef66209 100644 --- a/arch/arm64/kernel/vdso/vdso.lds.S +++ b/arch/arm64/kernel/vdso/vdso.lds.S -@@ -75,6 +75,7 @@ SECTIONS - - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - /DISCARD/ : { +@@ -80,6 +80,7 @@ SECTIONS *(.data .data.* .gnu.linkonce.d.* .sdata*) + *(.bss .sbss .dynbss .dynsbss) + *(.eh_frame .eh_frame_hdr) ++ *(.ARM.attributes) + } + } + diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S -index f84c71f04d9e..c94942e9eb46 100644 +index f84c71f04d9e..e73326bd3ff7 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S -@@ -335,6 +335,7 @@ SECTIONS - STABS_DEBUG - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - HEAD_SYMBOLS +@@ -162,6 +162,7 @@ SECTIONS + /DISCARD/ : { + *(.interp .dynamic) + *(.dynsym .dynstr .hash .gnu.hash) ++ *(.ARM.attributes) + } + . = KIMAGE_VADDR; --- base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3 diff --git a/patches/android15-6.6/series b/patches/android15-6.6/series index b015fbc2..65bdd9df 100644 --- a/patches/android15-6.6/series +++ b/patches/android15-6.6/series @@ -1 +1 @@ -20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch diff --git a/patches/android15-6.6/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch b/patches/android15-6.6/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch similarity index 62% rename from patches/android15-6.6/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch rename to patches/android15-6.6/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch index 9ac5e155..497ff807 100644 --- a/patches/android15-6.6/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +++ b/patches/android15-6.6/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch @@ -1,8 +1,8 @@ From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] arm64: Handle .ARM.attributes section in linker scripts +Subject: [PATCH v2] arm64: Handle .ARM.attributes section in linker scripts From: Nathan Chancellor -Date: Fri, 24 Jan 2025 06:31:57 -0700 -Message-Id: <20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org> +Date: Tue, 04 Feb 2025 10:48:55 -0700 +Message-Id: <20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit @@ -19,42 +19,49 @@ because it is not handled in the arm64 linker scripts. ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes' ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes' -Add this new section to the necessary linker scripts to resolve the warnings. +Discard the new sections in the necessary linker scripts to resolve the +warnings, as the kernel and vDSO do not need to retain it, similar to +the .note.gnu.property section. Cc: stable@vger.kernel.org Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement") Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1] -Link: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org +Link: https://lore.kernel.org/r/20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org Signed-off-by: Nathan Chancellor +--- +Changes in v2: +- Discard the section instead of adding it to the final artifacts to + mirror the .note.gnu.property section handling (Will). +- Link to v1: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org --- arch/arm64/kernel/vdso/vdso.lds.S | 1 + arch/arm64/kernel/vmlinux.lds.S | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S -index 4ec32e86a8da..f8418a3a2758 100644 +index 4ec32e86a8da..8095fef66209 100644 --- a/arch/arm64/kernel/vdso/vdso.lds.S +++ b/arch/arm64/kernel/vdso/vdso.lds.S -@@ -75,6 +75,7 @@ SECTIONS - - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - /DISCARD/ : { +@@ -80,6 +80,7 @@ SECTIONS *(.data .data.* .gnu.linkonce.d.* .sdata*) + *(.bss .sbss .dynbss .dynsbss) + *(.eh_frame .eh_frame_hdr) ++ *(.ARM.attributes) + } + } + diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S -index f84c71f04d9e..c94942e9eb46 100644 +index f84c71f04d9e..e73326bd3ff7 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S -@@ -335,6 +335,7 @@ SECTIONS - STABS_DEBUG - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - HEAD_SYMBOLS +@@ -162,6 +162,7 @@ SECTIONS + /DISCARD/ : { + *(.interp .dynamic) + *(.dynsym .dynstr .hash .gnu.hash) ++ *(.ARM.attributes) + } + . = KIMAGE_VADDR; --- base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3 diff --git a/patches/arm64-fixes/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch b/patches/arm64-fixes/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch deleted file mode 100644 index 9ac5e155..00000000 --- a/patches/arm64-fixes/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +++ /dev/null @@ -1,66 +0,0 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] arm64: Handle .ARM.attributes section in linker scripts -From: Nathan Chancellor -Date: Fri, 24 Jan 2025 06:31:57 -0700 -Message-Id: <20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit - -A recent LLVM commit [1] started generating an .ARM.attributes section -similar to the one that exists for 32-bit, which results in orphan -section warnings (or errors if CONFIG_WERROR is enabled) from the linker -because it is not handled in the arm64 linker scripts. - - ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes' - ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes' - - ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes' - ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes' - ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes' - -Add this new section to the necessary linker scripts to resolve the warnings. - -Cc: stable@vger.kernel.org -Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement") -Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1] -Link: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org -Signed-off-by: Nathan Chancellor ---- - arch/arm64/kernel/vdso/vdso.lds.S | 1 + - arch/arm64/kernel/vmlinux.lds.S | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S -index 4ec32e86a8da..f8418a3a2758 100644 ---- a/arch/arm64/kernel/vdso/vdso.lds.S -+++ b/arch/arm64/kernel/vdso/vdso.lds.S -@@ -75,6 +75,7 @@ SECTIONS - - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - /DISCARD/ : { - *(.data .data.* .gnu.linkonce.d.* .sdata*) -diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S -index f84c71f04d9e..c94942e9eb46 100644 ---- a/arch/arm64/kernel/vmlinux.lds.S -+++ b/arch/arm64/kernel/vmlinux.lds.S -@@ -335,6 +335,7 @@ SECTIONS - STABS_DEBUG - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - HEAD_SYMBOLS - - ---- -base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3 -change-id: 20250123-arm64-handle-arm-attributes-in-linker-script-82aee25313ac - -Best regards, --- -Nathan Chancellor - diff --git a/patches/arm64-fixes/8b55f8818900c99dd4f55a59a103f5b29e41eb2c.patch b/patches/arm64-fixes/8b55f8818900c99dd4f55a59a103f5b29e41eb2c.patch deleted file mode 100644 index 918a35ea..00000000 --- a/patches/arm64-fixes/8b55f8818900c99dd4f55a59a103f5b29e41eb2c.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 8b55f8818900c99dd4f55a59a103f5b29e41eb2c Mon Sep 17 00:00:00 2001 -From: Arnd Bergmann -Date: Fri, 18 Oct 2024 15:14:42 +0000 -Subject: media: mediatek: vcodec: mark vdec_vp9_slice_map_counts_eob_coef - noinline - -With KASAN enabled, clang fails to optimize the inline version of -vdec_vp9_slice_map_counts_eob_coef() properly, leading to kilobytes -of temporary values spilled to the stack: - -drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c:1526:12: error: stack frame size (2160) exceeds limit (2048) in 'vdec_vp9_slice_update_prob' [-Werror,-Wframe-larger-than] - -This seems to affect all versions of clang including the latest (clang-20), -but the degree of stack overhead is different per release. - -Marking the function as noinline_for_stack is harmless here and avoids -the problem completely. - -Signed-off-by: Arnd Bergmann -Reviewed-by: Nathan Chancellor -Signed-off-by: Sebastian Fricke -Signed-off-by: Mauro Carvalho Chehab ---- -Link: https://git.linuxtv.org/media.git/commit/?id=8b55f8818900c99dd4f55a59a103f5b29e41eb2c ---- - .../media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c -index eea709d93820..47c302745c1d 100644 ---- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c -+++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c -@@ -1188,7 +1188,8 @@ err: - return ret; - } - --static -+/* clang stack usage explodes if this is inlined */ -+static noinline_for_stack - void vdec_vp9_slice_map_counts_eob_coef(unsigned int i, unsigned int j, unsigned int k, - struct vdec_vp9_slice_frame_counts *counts, - struct v4l2_vp9_frame_symbol_counts *counts_helper) --- -cgit v1.2.3 - diff --git a/patches/arm64-fixes/series b/patches/arm64-fixes/series index f02aaeed..65bdd9df 100644 --- a/patches/arm64-fixes/series +++ b/patches/arm64-fixes/series @@ -1,2 +1 @@ -8b55f8818900c99dd4f55a59a103f5b29e41eb2c.patch -20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch diff --git a/patches/arm64-fixes/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch b/patches/arm64-fixes/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch new file mode 100644 index 00000000..497ff807 --- /dev/null +++ b/patches/arm64-fixes/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch @@ -0,0 +1,73 @@ +From git@z Thu Jan 1 00:00:00 1970 +Subject: [PATCH v2] arm64: Handle .ARM.attributes section in linker scripts +From: Nathan Chancellor +Date: Tue, 04 Feb 2025 10:48:55 -0700 +Message-Id: <20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 7bit + +A recent LLVM commit [1] started generating an .ARM.attributes section +similar to the one that exists for 32-bit, which results in orphan +section warnings (or errors if CONFIG_WERROR is enabled) from the linker +because it is not handled in the arm64 linker scripts. + + ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes' + ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes' + + ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes' + ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes' + ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes' + +Discard the new sections in the necessary linker scripts to resolve the +warnings, as the kernel and vDSO do not need to retain it, similar to +the .note.gnu.property section. + +Cc: stable@vger.kernel.org +Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement") +Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1] +Link: https://lore.kernel.org/r/20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org +Signed-off-by: Nathan Chancellor +--- +Changes in v2: +- Discard the section instead of adding it to the final artifacts to + mirror the .note.gnu.property section handling (Will). +- Link to v1: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org +--- + arch/arm64/kernel/vdso/vdso.lds.S | 1 + + arch/arm64/kernel/vmlinux.lds.S | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S +index 4ec32e86a8da..8095fef66209 100644 +--- a/arch/arm64/kernel/vdso/vdso.lds.S ++++ b/arch/arm64/kernel/vdso/vdso.lds.S +@@ -80,6 +80,7 @@ SECTIONS + *(.data .data.* .gnu.linkonce.d.* .sdata*) + *(.bss .sbss .dynbss .dynsbss) + *(.eh_frame .eh_frame_hdr) ++ *(.ARM.attributes) + } + } + +diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S +index f84c71f04d9e..e73326bd3ff7 100644 +--- a/arch/arm64/kernel/vmlinux.lds.S ++++ b/arch/arm64/kernel/vmlinux.lds.S +@@ -162,6 +162,7 @@ SECTIONS + /DISCARD/ : { + *(.interp .dynamic) + *(.dynsym .dynstr .hash .gnu.hash) ++ *(.ARM.attributes) + } + + . = KIMAGE_VADDR; + +--- +base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3 +change-id: 20250123-arm64-handle-arm-attributes-in-linker-script-82aee25313ac + +Best regards, +-- +Nathan Chancellor + diff --git a/patches/arm64/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch b/patches/arm64/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch deleted file mode 100644 index 9ac5e155..00000000 --- a/patches/arm64/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +++ /dev/null @@ -1,66 +0,0 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] arm64: Handle .ARM.attributes section in linker scripts -From: Nathan Chancellor -Date: Fri, 24 Jan 2025 06:31:57 -0700 -Message-Id: <20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit - -A recent LLVM commit [1] started generating an .ARM.attributes section -similar to the one that exists for 32-bit, which results in orphan -section warnings (or errors if CONFIG_WERROR is enabled) from the linker -because it is not handled in the arm64 linker scripts. - - ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes' - ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes' - - ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes' - ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes' - ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes' - -Add this new section to the necessary linker scripts to resolve the warnings. - -Cc: stable@vger.kernel.org -Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement") -Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1] -Link: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org -Signed-off-by: Nathan Chancellor ---- - arch/arm64/kernel/vdso/vdso.lds.S | 1 + - arch/arm64/kernel/vmlinux.lds.S | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S -index 4ec32e86a8da..f8418a3a2758 100644 ---- a/arch/arm64/kernel/vdso/vdso.lds.S -+++ b/arch/arm64/kernel/vdso/vdso.lds.S -@@ -75,6 +75,7 @@ SECTIONS - - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - /DISCARD/ : { - *(.data .data.* .gnu.linkonce.d.* .sdata*) -diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S -index f84c71f04d9e..c94942e9eb46 100644 ---- a/arch/arm64/kernel/vmlinux.lds.S -+++ b/arch/arm64/kernel/vmlinux.lds.S -@@ -335,6 +335,7 @@ SECTIONS - STABS_DEBUG - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - HEAD_SYMBOLS - - ---- -base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3 -change-id: 20250123-arm64-handle-arm-attributes-in-linker-script-82aee25313ac - -Best regards, --- -Nathan Chancellor - diff --git a/patches/arm64/series b/patches/arm64/series index f02aaeed..1ed792e8 100644 --- a/patches/arm64/series +++ b/patches/arm64/series @@ -1,2 +1,2 @@ 8b55f8818900c99dd4f55a59a103f5b29e41eb2c.patch -20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch diff --git a/patches/arm64/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch b/patches/arm64/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch new file mode 100644 index 00000000..497ff807 --- /dev/null +++ b/patches/arm64/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch @@ -0,0 +1,73 @@ +From git@z Thu Jan 1 00:00:00 1970 +Subject: [PATCH v2] arm64: Handle .ARM.attributes section in linker scripts +From: Nathan Chancellor +Date: Tue, 04 Feb 2025 10:48:55 -0700 +Message-Id: <20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 7bit + +A recent LLVM commit [1] started generating an .ARM.attributes section +similar to the one that exists for 32-bit, which results in orphan +section warnings (or errors if CONFIG_WERROR is enabled) from the linker +because it is not handled in the arm64 linker scripts. + + ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes' + ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes' + + ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes' + ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes' + ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes' + +Discard the new sections in the necessary linker scripts to resolve the +warnings, as the kernel and vDSO do not need to retain it, similar to +the .note.gnu.property section. + +Cc: stable@vger.kernel.org +Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement") +Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1] +Link: https://lore.kernel.org/r/20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org +Signed-off-by: Nathan Chancellor +--- +Changes in v2: +- Discard the section instead of adding it to the final artifacts to + mirror the .note.gnu.property section handling (Will). +- Link to v1: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org +--- + arch/arm64/kernel/vdso/vdso.lds.S | 1 + + arch/arm64/kernel/vmlinux.lds.S | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S +index 4ec32e86a8da..8095fef66209 100644 +--- a/arch/arm64/kernel/vdso/vdso.lds.S ++++ b/arch/arm64/kernel/vdso/vdso.lds.S +@@ -80,6 +80,7 @@ SECTIONS + *(.data .data.* .gnu.linkonce.d.* .sdata*) + *(.bss .sbss .dynbss .dynsbss) + *(.eh_frame .eh_frame_hdr) ++ *(.ARM.attributes) + } + } + +diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S +index f84c71f04d9e..e73326bd3ff7 100644 +--- a/arch/arm64/kernel/vmlinux.lds.S ++++ b/arch/arm64/kernel/vmlinux.lds.S +@@ -162,6 +162,7 @@ SECTIONS + /DISCARD/ : { + *(.interp .dynamic) + *(.dynsym .dynstr .hash .gnu.hash) ++ *(.ARM.attributes) + } + + . = KIMAGE_VADDR; + +--- +base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3 +change-id: 20250123-arm64-handle-arm-attributes-in-linker-script-82aee25313ac + +Best regards, +-- +Nathan Chancellor + diff --git a/patches/chromeos-6.6/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch b/patches/chromeos-6.6/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch deleted file mode 100644 index 9ac5e155..00000000 --- a/patches/chromeos-6.6/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +++ /dev/null @@ -1,66 +0,0 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] arm64: Handle .ARM.attributes section in linker scripts -From: Nathan Chancellor -Date: Fri, 24 Jan 2025 06:31:57 -0700 -Message-Id: <20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit - -A recent LLVM commit [1] started generating an .ARM.attributes section -similar to the one that exists for 32-bit, which results in orphan -section warnings (or errors if CONFIG_WERROR is enabled) from the linker -because it is not handled in the arm64 linker scripts. - - ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes' - ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes' - - ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes' - ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes' - ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes' - -Add this new section to the necessary linker scripts to resolve the warnings. - -Cc: stable@vger.kernel.org -Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement") -Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1] -Link: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org -Signed-off-by: Nathan Chancellor ---- - arch/arm64/kernel/vdso/vdso.lds.S | 1 + - arch/arm64/kernel/vmlinux.lds.S | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S -index 4ec32e86a8da..f8418a3a2758 100644 ---- a/arch/arm64/kernel/vdso/vdso.lds.S -+++ b/arch/arm64/kernel/vdso/vdso.lds.S -@@ -75,6 +75,7 @@ SECTIONS - - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - /DISCARD/ : { - *(.data .data.* .gnu.linkonce.d.* .sdata*) -diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S -index f84c71f04d9e..c94942e9eb46 100644 ---- a/arch/arm64/kernel/vmlinux.lds.S -+++ b/arch/arm64/kernel/vmlinux.lds.S -@@ -335,6 +335,7 @@ SECTIONS - STABS_DEBUG - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - HEAD_SYMBOLS - - ---- -base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3 -change-id: 20250123-arm64-handle-arm-attributes-in-linker-script-82aee25313ac - -Best regards, --- -Nathan Chancellor - diff --git a/patches/chromeos-6.6/series b/patches/chromeos-6.6/series index b015fbc2..65bdd9df 100644 --- a/patches/chromeos-6.6/series +++ b/patches/chromeos-6.6/series @@ -1 +1 @@ -20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch diff --git a/patches/chromeos-6.6/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch b/patches/chromeos-6.6/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch new file mode 100644 index 00000000..497ff807 --- /dev/null +++ b/patches/chromeos-6.6/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch @@ -0,0 +1,73 @@ +From git@z Thu Jan 1 00:00:00 1970 +Subject: [PATCH v2] arm64: Handle .ARM.attributes section in linker scripts +From: Nathan Chancellor +Date: Tue, 04 Feb 2025 10:48:55 -0700 +Message-Id: <20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 7bit + +A recent LLVM commit [1] started generating an .ARM.attributes section +similar to the one that exists for 32-bit, which results in orphan +section warnings (or errors if CONFIG_WERROR is enabled) from the linker +because it is not handled in the arm64 linker scripts. + + ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes' + ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes' + + ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes' + ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes' + ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes' + +Discard the new sections in the necessary linker scripts to resolve the +warnings, as the kernel and vDSO do not need to retain it, similar to +the .note.gnu.property section. + +Cc: stable@vger.kernel.org +Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement") +Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1] +Link: https://lore.kernel.org/r/20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org +Signed-off-by: Nathan Chancellor +--- +Changes in v2: +- Discard the section instead of adding it to the final artifacts to + mirror the .note.gnu.property section handling (Will). +- Link to v1: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org +--- + arch/arm64/kernel/vdso/vdso.lds.S | 1 + + arch/arm64/kernel/vmlinux.lds.S | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S +index 4ec32e86a8da..8095fef66209 100644 +--- a/arch/arm64/kernel/vdso/vdso.lds.S ++++ b/arch/arm64/kernel/vdso/vdso.lds.S +@@ -80,6 +80,7 @@ SECTIONS + *(.data .data.* .gnu.linkonce.d.* .sdata*) + *(.bss .sbss .dynbss .dynsbss) + *(.eh_frame .eh_frame_hdr) ++ *(.ARM.attributes) + } + } + +diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S +index f84c71f04d9e..e73326bd3ff7 100644 +--- a/arch/arm64/kernel/vmlinux.lds.S ++++ b/arch/arm64/kernel/vmlinux.lds.S +@@ -162,6 +162,7 @@ SECTIONS + /DISCARD/ : { + *(.interp .dynamic) + *(.dynsym .dynstr .hash .gnu.hash) ++ *(.ARM.attributes) + } + + . = KIMAGE_VADDR; + +--- +base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3 +change-id: 20250123-arm64-handle-arm-attributes-in-linker-script-82aee25313ac + +Best regards, +-- +Nathan Chancellor + diff --git a/patches/mainline/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch b/patches/mainline/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch deleted file mode 100644 index 9ac5e155..00000000 --- a/patches/mainline/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +++ /dev/null @@ -1,66 +0,0 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] arm64: Handle .ARM.attributes section in linker scripts -From: Nathan Chancellor -Date: Fri, 24 Jan 2025 06:31:57 -0700 -Message-Id: <20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit - -A recent LLVM commit [1] started generating an .ARM.attributes section -similar to the one that exists for 32-bit, which results in orphan -section warnings (or errors if CONFIG_WERROR is enabled) from the linker -because it is not handled in the arm64 linker scripts. - - ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes' - ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes' - - ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes' - ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes' - ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes' - -Add this new section to the necessary linker scripts to resolve the warnings. - -Cc: stable@vger.kernel.org -Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement") -Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1] -Link: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org -Signed-off-by: Nathan Chancellor ---- - arch/arm64/kernel/vdso/vdso.lds.S | 1 + - arch/arm64/kernel/vmlinux.lds.S | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S -index 4ec32e86a8da..f8418a3a2758 100644 ---- a/arch/arm64/kernel/vdso/vdso.lds.S -+++ b/arch/arm64/kernel/vdso/vdso.lds.S -@@ -75,6 +75,7 @@ SECTIONS - - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - /DISCARD/ : { - *(.data .data.* .gnu.linkonce.d.* .sdata*) -diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S -index f84c71f04d9e..c94942e9eb46 100644 ---- a/arch/arm64/kernel/vmlinux.lds.S -+++ b/arch/arm64/kernel/vmlinux.lds.S -@@ -335,6 +335,7 @@ SECTIONS - STABS_DEBUG - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - HEAD_SYMBOLS - - ---- -base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3 -change-id: 20250123-arm64-handle-arm-attributes-in-linker-script-82aee25313ac - -Best regards, --- -Nathan Chancellor - diff --git a/patches/mainline/series b/patches/mainline/series index b015fbc2..65bdd9df 100644 --- a/patches/mainline/series +++ b/patches/mainline/series @@ -1 +1 @@ -20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch diff --git a/patches/mainline/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch b/patches/mainline/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch new file mode 100644 index 00000000..497ff807 --- /dev/null +++ b/patches/mainline/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch @@ -0,0 +1,73 @@ +From git@z Thu Jan 1 00:00:00 1970 +Subject: [PATCH v2] arm64: Handle .ARM.attributes section in linker scripts +From: Nathan Chancellor +Date: Tue, 04 Feb 2025 10:48:55 -0700 +Message-Id: <20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 7bit + +A recent LLVM commit [1] started generating an .ARM.attributes section +similar to the one that exists for 32-bit, which results in orphan +section warnings (or errors if CONFIG_WERROR is enabled) from the linker +because it is not handled in the arm64 linker scripts. + + ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes' + ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes' + + ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes' + ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes' + ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes' + +Discard the new sections in the necessary linker scripts to resolve the +warnings, as the kernel and vDSO do not need to retain it, similar to +the .note.gnu.property section. + +Cc: stable@vger.kernel.org +Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement") +Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1] +Link: https://lore.kernel.org/r/20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org +Signed-off-by: Nathan Chancellor +--- +Changes in v2: +- Discard the section instead of adding it to the final artifacts to + mirror the .note.gnu.property section handling (Will). +- Link to v1: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org +--- + arch/arm64/kernel/vdso/vdso.lds.S | 1 + + arch/arm64/kernel/vmlinux.lds.S | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S +index 4ec32e86a8da..8095fef66209 100644 +--- a/arch/arm64/kernel/vdso/vdso.lds.S ++++ b/arch/arm64/kernel/vdso/vdso.lds.S +@@ -80,6 +80,7 @@ SECTIONS + *(.data .data.* .gnu.linkonce.d.* .sdata*) + *(.bss .sbss .dynbss .dynsbss) + *(.eh_frame .eh_frame_hdr) ++ *(.ARM.attributes) + } + } + +diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S +index f84c71f04d9e..e73326bd3ff7 100644 +--- a/arch/arm64/kernel/vmlinux.lds.S ++++ b/arch/arm64/kernel/vmlinux.lds.S +@@ -162,6 +162,7 @@ SECTIONS + /DISCARD/ : { + *(.interp .dynamic) + *(.dynsym .dynstr .hash .gnu.hash) ++ *(.ARM.attributes) + } + + . = KIMAGE_VADDR; + +--- +base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3 +change-id: 20250123-arm64-handle-arm-attributes-in-linker-script-82aee25313ac + +Best regards, +-- +Nathan Chancellor + diff --git a/patches/stable/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch b/patches/stable/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch deleted file mode 100644 index 9ac5e155..00000000 --- a/patches/stable/20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +++ /dev/null @@ -1,66 +0,0 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] arm64: Handle .ARM.attributes section in linker scripts -From: Nathan Chancellor -Date: Fri, 24 Jan 2025 06:31:57 -0700 -Message-Id: <20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit - -A recent LLVM commit [1] started generating an .ARM.attributes section -similar to the one that exists for 32-bit, which results in orphan -section warnings (or errors if CONFIG_WERROR is enabled) from the linker -because it is not handled in the arm64 linker scripts. - - ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes' - ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes' - - ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes' - ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes' - ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes' - -Add this new section to the necessary linker scripts to resolve the warnings. - -Cc: stable@vger.kernel.org -Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement") -Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1] -Link: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org -Signed-off-by: Nathan Chancellor ---- - arch/arm64/kernel/vdso/vdso.lds.S | 1 + - arch/arm64/kernel/vmlinux.lds.S | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S -index 4ec32e86a8da..f8418a3a2758 100644 ---- a/arch/arm64/kernel/vdso/vdso.lds.S -+++ b/arch/arm64/kernel/vdso/vdso.lds.S -@@ -75,6 +75,7 @@ SECTIONS - - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - /DISCARD/ : { - *(.data .data.* .gnu.linkonce.d.* .sdata*) -diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S -index f84c71f04d9e..c94942e9eb46 100644 ---- a/arch/arm64/kernel/vmlinux.lds.S -+++ b/arch/arm64/kernel/vmlinux.lds.S -@@ -335,6 +335,7 @@ SECTIONS - STABS_DEBUG - DWARF_DEBUG - ELF_DETAILS -+ .ARM.attributes 0 : { *(.ARM.attributes) } - - HEAD_SYMBOLS - - ---- -base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3 -change-id: 20250123-arm64-handle-arm-attributes-in-linker-script-82aee25313ac - -Best regards, --- -Nathan Chancellor - diff --git a/patches/stable/series b/patches/stable/series index b015fbc2..65bdd9df 100644 --- a/patches/stable/series +++ b/patches/stable/series @@ -1 +1 @@ -20250124_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch +v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch diff --git a/patches/stable/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch b/patches/stable/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch new file mode 100644 index 00000000..497ff807 --- /dev/null +++ b/patches/stable/v2_20250204_nathan_arm64_handle_arm_attributes_section_in_linker_scripts.patch @@ -0,0 +1,73 @@ +From git@z Thu Jan 1 00:00:00 1970 +Subject: [PATCH v2] arm64: Handle .ARM.attributes section in linker scripts +From: Nathan Chancellor +Date: Tue, 04 Feb 2025 10:48:55 -0700 +Message-Id: <20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 7bit + +A recent LLVM commit [1] started generating an .ARM.attributes section +similar to the one that exists for 32-bit, which results in orphan +section warnings (or errors if CONFIG_WERROR is enabled) from the linker +because it is not handled in the arm64 linker scripts. + + ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes' + ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes' + + ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes' + ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes' + ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes' + +Discard the new sections in the necessary linker scripts to resolve the +warnings, as the kernel and vDSO do not need to retain it, similar to +the .note.gnu.property section. + +Cc: stable@vger.kernel.org +Fixes: b3e5d80d0c48 ("arm64/build: Warn on orphan section placement") +Link: https://github.com/llvm/llvm-project/commit/ee99c4d4845db66c4daa2373352133f4b237c942 [1] +Link: https://lore.kernel.org/r/20250204-arm64-handle-arm-attributes-in-linker-script-v2-1-d684097f5554@kernel.org +Signed-off-by: Nathan Chancellor +--- +Changes in v2: +- Discard the section instead of adding it to the final artifacts to + mirror the .note.gnu.property section handling (Will). +- Link to v1: https://lore.kernel.org/r/20250124-arm64-handle-arm-attributes-in-linker-script-v1-1-74135b6cf349@kernel.org +--- + arch/arm64/kernel/vdso/vdso.lds.S | 1 + + arch/arm64/kernel/vmlinux.lds.S | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S +index 4ec32e86a8da..8095fef66209 100644 +--- a/arch/arm64/kernel/vdso/vdso.lds.S ++++ b/arch/arm64/kernel/vdso/vdso.lds.S +@@ -80,6 +80,7 @@ SECTIONS + *(.data .data.* .gnu.linkonce.d.* .sdata*) + *(.bss .sbss .dynbss .dynsbss) + *(.eh_frame .eh_frame_hdr) ++ *(.ARM.attributes) + } + } + +diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S +index f84c71f04d9e..e73326bd3ff7 100644 +--- a/arch/arm64/kernel/vmlinux.lds.S ++++ b/arch/arm64/kernel/vmlinux.lds.S +@@ -162,6 +162,7 @@ SECTIONS + /DISCARD/ : { + *(.interp .dynamic) + *(.dynsym .dynstr .hash .gnu.hash) ++ *(.ARM.attributes) + } + + . = KIMAGE_VADDR; + +--- +base-commit: 1dd3393696efba1598aa7692939bba99d0cffae3 +change-id: 20250123-arm64-handle-arm-attributes-in-linker-script-82aee25313ac + +Best regards, +-- +Nathan Chancellor +