PRU: Add alignment for resource table, and allow sizes of memory regions to be set...
authorDimitar Dimitrov <dimitar@dinux.eu>
Mon, 10 May 2021 12:58:17 +0000 (13:58 +0100)
committerNick Clifton <nickc@redhat.com>
Mon, 10 May 2021 12:58:17 +0000 (13:58 +0100)
ld * scripttempl/pru.sc (.resource_table): Add ALIGN directive.
Use symbols for memory sizes.

ld/ChangeLog
ld/scripttempl/pru.sc

index b7a6adc372a0a8db7ebcd8110272341fd81ea55f..b66e72281eab49d5a0faf2e7ef4b7534f3bf44b1 100644 (file)
@@ -1,3 +1,8 @@
+2021-05-10  Dimitar Dimitrov  <dimitar@dinux.eu>
+
+       * scripttempl/pru.sc (.resource_table): Add ALIGN directive.
+       Use symbols for memory sizes.
+
 2021-05-08  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.am (html-local, doc/ld/index.html): New targets.
index 08aceaa3b2cf2269ee4fbe9fbda41e50a3790da3..b2c941b791116a018ea30b52577e7c504af4b9f0 100644 (file)
@@ -5,10 +5,14 @@ OUTPUT_ARCH(${ARCH})
 EOF
 
 test -n "${RELOCATING}" && cat <<EOF
+/* Allow memory sizes to be overridden from command line.  */
+__IMEM_SIZE = DEFINED(__IMEM_SIZE) ? __IMEM_SIZE : $TEXT_LENGTH;
+__DMEM_SIZE = DEFINED(__DMEM_SIZE) ? __DMEM_SIZE : $DATA_LENGTH;
+
 MEMORY
 {
-  imem   (x)   : ORIGIN = $TEXT_ORIGIN, LENGTH = $TEXT_LENGTH
-  dmem   (rw!x) : ORIGIN = $DATA_ORIGIN, LENGTH = $DATA_LENGTH
+  imem   (x)   : ORIGIN = $TEXT_ORIGIN, LENGTH = __IMEM_SIZE
+  dmem   (rw!x) : ORIGIN = $DATA_ORIGIN, LENGTH = __DMEM_SIZE
 }
 
 __HEAP_SIZE = DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : 32;
@@ -149,6 +153,9 @@ SECTIONS
 
   .resource_table ${RELOCATING-0} :
   {
+    /* Linux remoteproc loader requires the resource table address
+       to be aligned to 8 bytes.  */
+    ${RELOCATING+. = ALIGN(8);}
     KEEP (*(.resource_table))
   } ${RELOCATING+ > dmem}
 
This page took 0.027205 seconds and 4 git commands to generate.