LinuxPPC-Dev Archive on lore.kernel.org
 help / Atom feed
* [PATCH] powerpc: Use ALIGN instead of BLOCK
@ 2019-01-11 23:50 Joel Stanley
  2019-01-14 21:02 ` Nick Desaulniers
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Stanley @ 2019-01-11 23:50 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Nick Desaulniers

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc: Use ALIGN instead of BLOCK
  2019-01-11 23:50 [PATCH] powerpc: Use ALIGN instead of BLOCK Joel Stanley
@ 2019-01-14 21:02 ` Nick Desaulniers
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Desaulniers @ 2019-01-14 21:02 UTC (permalink / raw)
  To: Joel Stanley; +Cc: George Rimar, linuxppc-dev

On Fri, Jan 11, 2019 at 3:51 PM Joel Stanley <joel@jms.id.au> 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 <grimar@accesssoftek.com>
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>

> ---
>  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-11 23:50 [PATCH] powerpc: Use ALIGN instead of BLOCK Joel Stanley
2019-01-14 21:02 ` Nick Desaulniers

LinuxPPC-Dev Archive on lore.kernel.org

Archives are clonable: git clone --mirror https://lore.kernel.org/linuxppc-dev/0 linuxppc-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linuxppc-dev linuxppc-dev/ https://lore.kernel.org/linuxppc-dev \
		linuxppc-dev@lists.ozlabs.org linuxppc-dev@ozlabs.org linuxppc-dev@archiver.kernel.org
	public-inbox-index linuxppc-dev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.ozlabs.lists.linuxppc-dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox