[PATCH] powerpc: Use ALIGN instead of BLOCK

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE2826d

3 messages, 3 authors, 2019-01-24 · open the first message on its own page

[PATCH] powerpc: Use ALIGN instead of BLOCK

From: Joel Stanley <joel@jms.id.au>
Date: 2019-01-11 23:52:39

In the ld documentation under Builtin Functions:

  BLOCK(exp)

    This is a synonym for ALIGN, for compatibility with older linker scripts.

Clang's linker (lld) doesn't know about BLOCK so remove this use of it.

Link: https://github.com/ClangBuiltLinux/linux/issues/253
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 arch/powerpc/kernel/vmlinux.lds.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index ad1c77f71f54..3ae4c959f95b 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -86,11 +86,11 @@ SECTIONS
 
 #ifdef CONFIG_PPC64
 	/*
-	 * BLOCK(0) overrides the default output section alignment because
+	 * ALIGN(0) overrides the default output section alignment because
 	 * this needs to start right after .head.text in order for fixed
 	 * section placement to work.
 	 */
-	.text BLOCK(0) : AT(ADDR(.text) - LOAD_OFFSET) {
+	.text ALIGN(0) : AT(ADDR(.text) - LOAD_OFFSET) {
 #ifdef CONFIG_LD_HEAD_STUB_CATCH
 		KEEP(*(.linker_stub_catch));
 		. = . ;
-- 
2.19.1

Re: [PATCH] powerpc: Use ALIGN instead of BLOCK

From: Nick Desaulniers <ndesaulniers@google.com>
Date: 2019-01-14 21:04:49

On Fri, Jan 11, 2019 at 3:51 PM Joel Stanley [off-list ref] wrote:
In the ld documentation under Builtin Functions:

  BLOCK(exp)

    This is a synonym for ALIGN, for compatibility with older linker scripts.

Clang's linker (lld) doesn't know about BLOCK so remove this use of it.

Link: https://github.com/ClangBuiltLinux/linux/issues/253
Signed-off-by: Joel Stanley <joel@jms.id.au>
Should get a suggested-by tag:
Suggested-by: George Rimar <redacted>
via:
https://github.com/ClangBuiltLinux/linux/issues/253#issuecomment-449715453
https://reviews.llvm.org/D56060#1340554

ftp://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_chapter/ld_3.html#SEC14
documents ALIGN while for BLOCK:
ftp://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_chapter/ld_3.html#SEC21

Looks like they do the same thing.
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
quoted hunk
---
 arch/powerpc/kernel/vmlinux.lds.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index ad1c77f71f54..3ae4c959f95b 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -86,11 +86,11 @@ SECTIONS

 #ifdef CONFIG_PPC64
        /*
-        * BLOCK(0) overrides the default output section alignment because
+        * ALIGN(0) overrides the default output section alignment because
         * this needs to start right after .head.text in order for fixed
         * section placement to work.
         */
-       .text BLOCK(0) : AT(ADDR(.text) - LOAD_OFFSET) {
+       .text ALIGN(0) : AT(ADDR(.text) - LOAD_OFFSET) {
 #ifdef CONFIG_LD_HEAD_STUB_CATCH
                KEEP(*(.linker_stub_catch));
                . = . ;
--
2.19.1

-- 
Thanks,
~Nick Desaulniers

Re: powerpc: Use ALIGN instead of BLOCK

From: Michael Ellerman <hidden>
Date: 2019-01-24 04:00:54

On Fri, 2019-01-11 at 23:50:56 UTC, Joel Stanley wrote:
In the ld documentation under Builtin Functions:

  BLOCK(exp)

    This is a synonym for ALIGN, for compatibility with older linker scripts.

Clang's linker (lld) doesn't know about BLOCK so remove this use of it.

Link: https://github.com/ClangBuiltLinux/linux/issues/253
Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/a652758ac1475f69d28d11b3528c4f48

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help