public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* .noinit and .persistent for msp430
@ 2023-07-12  1:39 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-07-12  1:39 UTC (permalink / raw)
  To: binutils

Similar to the previous patch, but also tidy a few more sections.

	* scripttempl/elf32msp430.sc (.text, .rodata, .data, .bss, .noinit),
	(.persistent): Align the section rather than aligning inside.

diff --git a/ld/scripttempl/elf32msp430.sc b/ld/scripttempl/elf32msp430.sc
index 6edc908a2a0..7d5391d9f8c 100644
--- a/ld/scripttempl/elf32msp430.sc
+++ b/ld/scripttempl/elf32msp430.sc
@@ -137,9 +137,9 @@ SECTIONS
   .rela.plt    ${RELOCATING-0} : { *(.rela.plt)         }
 
   /* Internal text space.  */
-  .text ${RELOCATING-0} :
+  .text ${RELOCATING-0} : ${RELOCATING+ALIGN(2)}
   {
-    ${RELOCATING+. = ALIGN(2);
+    ${RELOCATING+
     *(SORT_NONE(.init))
     *(SORT_NONE(.init0))  /* Start here after reset.  */
     *(SORT_NONE(.init1))
@@ -189,9 +189,9 @@ SECTIONS
     _etext = .;}
   } ${RELOCATING+ > text}
 
-  .rodata ${RELOCATING-0} :
+  .rodata ${RELOCATING-0} : ${RELOCATING+ALIGN(2)}
   {
-    ${RELOCATING+. = ALIGN(2);
+    ${RELOCATING+
     *(.lower.rodata.* .lower.rodata)
 
     . = ALIGN(2);
@@ -254,11 +254,11 @@ SECTIONS
     ${RELOCATING+ _vectors_end = . ; }
   } ${RELOCATING+ > vectors}
 
-  .data ${RELOCATING-0} :
+  .data ${RELOCATING-0} : ${RELOCATING+ALIGN(2)}
   {
-    ${RELOCATING+ PROVIDE (__data_start = .) ; }
-    ${RELOCATING+ PROVIDE (__datastart = .) ; }
-    ${RELOCATING+. = ALIGN(2);
+    ${RELOCATING+
+    PROVIDE (__data_start = .) ;
+    PROVIDE (__datastart = .) ;
 
     KEEP (*(.jcr))
     *(.data.rel.ro.local) *(.data.rel.ro*)
@@ -287,9 +287,8 @@ SECTIONS
   ${RELOCATING+__romdatastart = LOADADDR(.data);
   __romdatacopysize = SIZEOF(.data);}
 
-  .bss ${RELOCATING-0}${RELOCATING+SIZEOF(.data) + ADDR(.data)} :
+  .bss ${RELOCATING-0}${RELOCATING+ALIGN(SIZEOF(.data) + ADDR(.data), 2)} :
   {
-    ${RELOCATING+. = ALIGN(2);}
     ${RELOCATING+ PROVIDE (__bss_start = .); }
     ${RELOCATING+ PROVIDE (__bssstart = .);
     *(.lower.bss.* .lower.bss)
@@ -304,9 +303,8 @@ SECTIONS
 
   /* This section contains data that is not initialized during load,
      or during the application's initialization sequence.  */
-  .noinit ${RELOCATING-0}${RELOCATING+SIZEOF(.bss) + ADDR(.bss)} :
+  .noinit ${RELOCATING-0}${RELOCATING+ALIGN(SIZEOF(.bss) + ADDR(.bss), 2)} :
   {
-    ${RELOCATING+. = ALIGN(2);}
     ${RELOCATING+ PROVIDE (__noinit_start = .) ; }
     *(.noinit${RELOCATING+ .noinit.* .gnu.linkonce.n.*})
     ${RELOCATING+. = ALIGN(2);}
@@ -315,9 +313,8 @@ SECTIONS
 
   /* This section contains data that is initialized during load,
      but not during the application's initialization sequence.  */
-  .persistent ${RELOCATING-0}${RELOCATING+SIZEOF(.noinit) + ADDR(.noinit)} :
+  .persistent ${RELOCATING-0}${RELOCATING+ALIGN(SIZEOF(.noinit) + ADDR(.noinit), 2)} :
   {
-    ${RELOCATING+. = ALIGN(2);}
     ${RELOCATING+ PROVIDE (__persistent_start = .) ; }
     *(.persistent${RELOCATING+ .persistent.* .gnu.linkonce.p.*})
     ${RELOCATING+. = ALIGN(2);}

-- 
Alan Modra
Australia Development Lab, IBM

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

only message in thread, other threads:[~2023-07-12  1:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-12  1:39 .noinit and .persistent for msp430 Alan Modra

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