diff mbox series

arm64/kernel: vmlinux.lds: drop redundant discard/keep macros

Message ID 20200416132730.25290-1-ardb@kernel.org (mailing list archive)
State Mainlined
Commit 1eae811da6f44a7a614ce5d33537e279ca7984fc
Headers show
Series arm64/kernel: vmlinux.lds: drop redundant discard/keep macros | expand

Commit Message

Ard Biesheuvel April 16, 2020, 1:27 p.m. UTC
ARM_EXIT_KEEP and ARM_EXIT_DISCARD are always defined in the same way,
so we don't really need them in the first place.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 arch/arm64/kernel/vmlinux.lds.S | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Comments

Mark Rutland April 16, 2020, 1:36 p.m. UTC | #1
On Thu, Apr 16, 2020 at 03:27:30PM +0200, Ard Biesheuvel wrote:
> ARM_EXIT_KEEP and ARM_EXIT_DISCARD are always defined in the same way,
> so we don't really need them in the first place.
> 
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Looks like they've always been redundant for arm64, as they've been this
way from the commit that introduced this file.

Acked-by: Mark Rutland <mark.rutland@arm.com>

Mark.

> ---
>  arch/arm64/kernel/vmlinux.lds.S | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
> index 1d399db0644f..04ea6160d444 100644
> --- a/arch/arm64/kernel/vmlinux.lds.S
> +++ b/arch/arm64/kernel/vmlinux.lds.S
> @@ -17,10 +17,6 @@
>  
>  #include "image.h"
>  
> -/* .exit.text needed in case of alternative patching */
> -#define ARM_EXIT_KEEP(x)	x
> -#define ARM_EXIT_DISCARD(x)
> -
>  OUTPUT_ARCH(aarch64)
>  ENTRY(_text)
>  
> @@ -95,8 +91,6 @@ SECTIONS
>  	 * order of matching.
>  	 */
>  	/DISCARD/ : {
> -		ARM_EXIT_DISCARD(EXIT_TEXT)
> -		ARM_EXIT_DISCARD(EXIT_DATA)
>  		EXIT_CALL
>  		*(.discard)
>  		*(.discard.*)
> @@ -161,7 +155,7 @@ SECTIONS
>  
>  	__exittext_begin = .;
>  	.exit.text : {
> -		ARM_EXIT_KEEP(EXIT_TEXT)
> +		EXIT_TEXT
>  	}
>  	__exittext_end = .;
>  
> @@ -188,7 +182,7 @@ SECTIONS
>  		*(.init.rodata.* .init.bss)	/* from the EFI stub */
>  	}
>  	.exit.data : {
> -		ARM_EXIT_KEEP(EXIT_DATA)
> +		EXIT_DATA
>  	}
>  
>  	PERCPU_SECTION(L1_CACHE_BYTES)
> -- 
> 2.17.1
>
Will Deacon April 28, 2020, 2:49 p.m. UTC | #2
On Thu, 16 Apr 2020 15:27:30 +0200, Ard Biesheuvel wrote:
> ARM_EXIT_KEEP and ARM_EXIT_DISCARD are always defined in the same way,
> so we don't really need them in the first place.

Applied to arm64 (for-next/misc), thanks!

[1/1] arm64/kernel: vmlinux.lds: drop redundant discard/keep macros
      https://git.kernel.org/arm64/c/1eae811da6f4

Cheers,
diff mbox series

Patch

diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
index 1d399db0644f..04ea6160d444 100644
--- a/arch/arm64/kernel/vmlinux.lds.S
+++ b/arch/arm64/kernel/vmlinux.lds.S
@@ -17,10 +17,6 @@ 
 
 #include "image.h"
 
-/* .exit.text needed in case of alternative patching */
-#define ARM_EXIT_KEEP(x)	x
-#define ARM_EXIT_DISCARD(x)
-
 OUTPUT_ARCH(aarch64)
 ENTRY(_text)
 
@@ -95,8 +91,6 @@  SECTIONS
 	 * order of matching.
 	 */
 	/DISCARD/ : {
-		ARM_EXIT_DISCARD(EXIT_TEXT)
-		ARM_EXIT_DISCARD(EXIT_DATA)
 		EXIT_CALL
 		*(.discard)
 		*(.discard.*)
@@ -161,7 +155,7 @@  SECTIONS
 
 	__exittext_begin = .;
 	.exit.text : {
-		ARM_EXIT_KEEP(EXIT_TEXT)
+		EXIT_TEXT
 	}
 	__exittext_end = .;
 
@@ -188,7 +182,7 @@  SECTIONS
 		*(.init.rodata.* .init.bss)	/* from the EFI stub */
 	}
 	.exit.data : {
-		ARM_EXIT_KEEP(EXIT_DATA)
+		EXIT_DATA
 	}
 
 	PERCPU_SECTION(L1_CACHE_BYTES)