linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Bill Wendling <morbo@google.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Fangrui Song <maskray@google.com>, Alan Modra <amodra@gmail.com>,
	Paul Mackerras <paulus@samba.org>,
	Bill Wendling <morbo@google.com>
Subject: [PATCH] powerpc/boot: move the .got section to after the .dynamic section
Date: Fri, 16 Oct 2020 17:01:51 -0700	[thread overview]
Message-ID: <20201017000151.150788-1-morbo@google.com> (raw)

Both .dynamic and .got are RELRO sections and should be placed together,
and LLD emits an error:

  ld.lld: error: section: .got is not contiguous with other relro sections

Place them together to avoid this.

Cc: Fangrui Song <maskray@google.com>
Cc: Alan Modra <amodra@gmail.com>
Signed-off-by: Bill Wendling <morbo@google.com>
---
 arch/powerpc/boot/zImage.lds.S | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/boot/zImage.lds.S b/arch/powerpc/boot/zImage.lds.S
index a21f3a76e06f..d6f072865627 100644
--- a/arch/powerpc/boot/zImage.lds.S
+++ b/arch/powerpc/boot/zImage.lds.S
@@ -34,6 +34,17 @@ SECTIONS
     __dynamic_start = .;
     *(.dynamic)
   }
+
+#ifdef CONFIG_PPC64_BOOT_WRAPPER
+  . = ALIGN(256);
+  .got :
+  {
+    __toc_start = .;
+    *(.got)
+    *(.toc)
+  }
+#endif
+
   .hash : { *(.hash) }
   .interp : { *(.interp) }
   .rela.dyn :
@@ -76,16 +87,6 @@ SECTIONS
     _esm_blob_end =  .;
   }
 
-#ifdef CONFIG_PPC64_BOOT_WRAPPER
-  . = ALIGN(256);
-  .got :
-  {
-    __toc_start = .;
-    *(.got)
-    *(.toc)
-  }
-#endif
-
   . = ALIGN(4096);
   .bss       :
   {
-- 
2.29.0.rc1.297.gfa9743e501-goog


             reply	other threads:[~2020-10-17  0:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-17  0:01 Bill Wendling [this message]
2020-10-19 23:56 ` [PATCH] powerpc/boot: move the .got section to after the .dynamic section Fāng-ruì Sòng
2020-11-18 22:39 ` [PATCH] powerpc/wrapper: add "-z rodynamic" when using LLD Bill Wendling
2020-11-18 22:55   ` Fangrui Song
2020-12-10 11:30   ` Michael Ellerman
2020-12-10 11:30 ` [PATCH] powerpc/boot: move the .got section to after the .dynamic section Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201017000151.150788-1-morbo@google.com \
    --to=morbo@google.com \
    --cc=amodra@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maskray@google.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).