diff mbox series

[v2,1/2] arm64: vdso: put ELF related sections in the linker script

Message ID 20220407101304.539-2-joey.gouly@arm.com (mailing list archive)
State New, archived
Headers show
Series Enable orphan-handling=warn for VDSO | expand

Commit Message

Joey Gouly April 7, 2022, 10:13 a.m. UTC
Use macros from vmlinux.lds.h to explicitly name sections that are included
in the VDSO output.

Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Kees Cook <keescook@chromium.org>
---
 arch/arm64/kernel/vdso/vdso.lds.S | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Kees Cook April 7, 2022, 4:49 p.m. UTC | #1
On Thu, Apr 07, 2022 at 11:13:03AM +0100, Joey Gouly wrote:
> Use macros from vmlinux.lds.h to explicitly name sections that are included
> in the VDSO output.
> 
> Signed-off-by: Joey Gouly <joey.gouly@arm.com>

Looks good! Thanks for updating it. :)

Reviewed-by: Kees Cook <keescook@chromium.org>
Vincenzo Frascino April 8, 2022, 7:18 a.m. UTC | #2
On 4/7/22 11:13 AM, Joey Gouly wrote:
> Use macros from vmlinux.lds.h to explicitly name sections that are included
> in the VDSO output.
> 
> Signed-off-by: Joey Gouly <joey.gouly@arm.com>

Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>

> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
> Cc: Kees Cook <keescook@chromium.org>
> ---
>  arch/arm64/kernel/vdso/vdso.lds.S | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S
> index a5e61e09ea92..8a8780c6d093 100644
> --- a/arch/arm64/kernel/vdso/vdso.lds.S
> +++ b/arch/arm64/kernel/vdso/vdso.lds.S
> @@ -11,6 +11,7 @@
>  #include <linux/const.h>
>  #include <asm/page.h>
>  #include <asm/vdso.h>
> +#include <asm-generic/vmlinux.lds.h>
>  
>  OUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", "elf64-littleaarch64")
>  OUTPUT_ARCH(aarch64)
> @@ -54,6 +55,9 @@ SECTIONS
>  	_end = .;
>  	PROVIDE(end = .);
>  
> +	DWARF_DEBUG
> +	ELF_DETAILS
> +
>  	/DISCARD/	: {
>  		*(.data .data.* .gnu.linkonce.d.* .sdata*)
>  		*(.bss .sbss .dynbss .dynsbss)
diff mbox series

Patch

diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S
index a5e61e09ea92..8a8780c6d093 100644
--- a/arch/arm64/kernel/vdso/vdso.lds.S
+++ b/arch/arm64/kernel/vdso/vdso.lds.S
@@ -11,6 +11,7 @@ 
 #include <linux/const.h>
 #include <asm/page.h>
 #include <asm/vdso.h>
+#include <asm-generic/vmlinux.lds.h>
 
 OUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", "elf64-littleaarch64")
 OUTPUT_ARCH(aarch64)
@@ -54,6 +55,9 @@  SECTIONS
 	_end = .;
 	PROVIDE(end = .);
 
+	DWARF_DEBUG
+	ELF_DETAILS
+
 	/DISCARD/	: {
 		*(.data .data.* .gnu.linkonce.d.* .sdata*)
 		*(.bss .sbss .dynbss .dynsbss)