public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] ld: pru: Place exception-handling sections correctly
@ 2023-05-04 11:42 Nick Clifton
  0 siblings, 0 replies; only message in thread
From: Nick Clifton @ 2023-05-04 11:42 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=35130e73da95371af99734cda3ef8915a6eb5e7a

commit 35130e73da95371af99734cda3ef8915a6eb5e7a
Author: Dimitar Dimitrov <dimitar@dinux.eu>
Date:   Thu May 4 12:41:55 2023 +0100

    ld: pru: Place exception-handling sections correctly
    
      * scripttempl/pru.sc (OUTPUT_SECTION_ALIGN): New helper variable to place at end of DMEM output sections.
      (.data): Use the helper variable.
      (.eh_frame): New output section.
      (.gnu_extab): Ditto.
      (.gcc_except_table): Ditto.
      (.resource_table): Use the helper variable.

Diff:
---
 ld/ChangeLog          | 10 ++++++++++
 ld/scripttempl/pru.sc | 34 ++++++++++++++++++++++++++--------
 2 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index f941b138c17..dcdf27cf423 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,13 @@
+2023-05-04  Dimitar Dimitrov  <dimitar@dinux.eu>
+
+	* scripttempl/pru.sc (OUTPUT_SECTION_ALIGN): New helper variable
+	to place at end of DMEM output sections.
+	(.data): Use the helper variable.
+	(.eh_frame): New output section.
+	(.gnu_extab): Ditto.
+	(.gcc_except_table): Ditto.
+	(.resource_table): Use the helper variable.
+
 2023-04-27  Nick Clifton  <nickc@redhat.com>
 
 	* ldmisc.c (vfinfo): Add support for %x and %lx.
diff --git a/ld/scripttempl/pru.sc b/ld/scripttempl/pru.sc
index 8531cb8d5be..3ff86bc61c7 100644
--- a/ld/scripttempl/pru.sc
+++ b/ld/scripttempl/pru.sc
@@ -24,6 +24,12 @@ ENTRY (_start)
 
 EOF
 
+OUTPUT_SECTION_ALIGN="
+    ${RELOCATING+/* In case this is the last input section,
+      align to keep the loadable segment size a multiple of the common page size.
+      Some SoCs have stricter memory size requirements than others.  */
+    . = ALIGN (CONSTANT (COMMONPAGESIZE));}"
+
 cat <<EOF
 SECTIONS
 {
@@ -163,10 +169,25 @@ SECTIONS
     ${RELOCATING+*(COMMON)}
     ${RELOCATING+ PROVIDE (_bss_end = .) ; }
 
-    ${RELOCATING+/* In case this is the last input section, align to
-      keep the loadable segment size a multiple of the common page size.
-      Some SoCs have stricter memory size requirements than others.  */
-    . = ALIGN (CONSTANT (COMMONPAGESIZE));}
+    ${OUTPUT_SECTION_ALIGN}
+  } ${RELOCATING+ > dmem}
+
+  .eh_frame ${RELOCATING-0} :
+  {
+    KEEP (*(.eh_frame))${RELOCATING+ *(.eh_frame.*)}
+    ${OUTPUT_SECTION_ALIGN}
+  } ${RELOCATING+ > dmem}
+
+  .gnu_extab ${RELOCATING-0} :
+  {
+    *(.gnu_extab)
+    ${OUTPUT_SECTION_ALIGN}
+  } ${RELOCATING+ > dmem}
+
+  .gcc_except_table ${RELOCATING-0} :
+  {
+    *(.gcc_except_table${RELOCATING+ .gcc_except_table.*})
+    ${OUTPUT_SECTION_ALIGN}
   } ${RELOCATING+ > dmem}
 
   /* Linux remoteproc loader requires the resource_table section
@@ -175,10 +196,7 @@ SECTIONS
   .resource_table ${RELOCATING-0} ${RELOCATING+ ALIGN (CONSTANT (MAXPAGESIZE))} :
   {
     KEEP (*(.resource_table))
-    ${RELOCATING+/* In case this is the last input section, align to
-      keep the loadable segment size a multiple of the common page size.
-      Some SoCs have stricter memory size requirements than others.  */
-    . = ALIGN (CONSTANT (COMMONPAGESIZE));}
+    ${OUTPUT_SECTION_ALIGN}
   } ${RELOCATING+ > dmem}
 
   /* Global data not cleared after reset.  */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-04 11:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-04 11:42 [binutils-gdb] ld: pru: Place exception-handling sections correctly Nick Clifton

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 read-only IMAP folder(s) and NNTP newsgroup(s).