]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld: pru: Place exception-handling sections correctly
authorDimitar Dimitrov <dimitar@dinux.eu>
Thu, 4 May 2023 11:41:55 +0000 (12:41 +0100)
committerNick Clifton <nickc@redhat.com>
Thu, 4 May 2023 11:41:55 +0000 (12:41 +0100)
  * 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.

ld/ChangeLog
ld/scripttempl/pru.sc

index f941b138c174784780422a6eaa866dad37819cdf..dcdf27cf4237e275726ab31f3e8828b79752adf9 100644 (file)
@@ -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.
index 8531cb8d5beb224bba8f3a44b9583017b7b5c945..3ff86bc61c75137d94aa4f4b401cd80c5d4a789a 100644 (file)
@@ -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.  */