tweak ppc64 section alignment

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

tweak ppc64 section alignment

Alan Modra
We can align a section directly rather than specifying its address, so
do so.

        * emulparams/elf64ppc.sh (.tocbss): Use new section alignment scheme.
        (.got, .toc1, .opd): Likewise.

Index: ld/emulparams/elf64ppc.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/elf64ppc.sh,v
retrieving revision 1.16
diff -u -p -r1.16 elf64ppc.sh
--- ld/emulparams/elf64ppc.sh 28 Jul 2003 03:33:48 -0000 1.16
+++ ld/emulparams/elf64ppc.sh 18 Nov 2005 04:20:53 -0000
@@ -15,13 +15,13 @@ NOP=0x60000000
 OTHER_TEXT_SECTIONS="*(.sfpr .glink)"
 BSS_PLT=
 OTHER_BSS_SYMBOLS="
-  .tocbss ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.tocbss)}"
+  .tocbss ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.tocbss)}"
 OTHER_PLT_RELOC_SECTIONS="
   .rela.tocbss ${RELOCATING-0} : { *(.rela.tocbss) }"
 
 if test x${RELOCATING+set} = xset; then
   GOT="
-  .got ALIGN(8) : { *(.got .toc) }"
+  .got : ALIGN(8) { *(.got .toc) }"
 else
   GOT="
   .got 0 : { *(.got) }
@@ -30,8 +30,8 @@ fi
 OTHER_GOT_RELOC_SECTIONS="
   .rela.toc ${RELOCATING-0} : { *(.rela.toc) }"
 OTHER_READWRITE_SECTIONS="
-  .toc1 ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.toc1) }
-  .opd ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { KEEP (*(.opd)) }"
+  .toc1 ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.toc1) }
+  .opd ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { KEEP (*(.opd)) }"
 
 # Treat a host that matches the target with the possible exception of "64"
 # in the name as if it were native.

--
Alan Modra
IBM OzLabs - Linux Technology Centre
Reply | Threaded
Open this post in threaded view
|

Re: tweak ppc64 section alignment

Alan Modra
On Fri, Nov 18, 2005 at 02:55:53PM +1030, Alan Modra wrote:
> We can align a section directly rather than specifying its address, so
> do so.

Requires a testsuite tweak too.

        * ld-powerpc/symtocbase.d: Adjust for alignment change.

Index: ld/testsuite/ld-powerpc/symtocbase.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-powerpc/symtocbase.d,v
retrieving revision 1.1
diff -u -p -r1.1 symtocbase.d
--- ld/testsuite/ld-powerpc/symtocbase.d 28 Sep 2005 19:32:19 -0000 1.1
+++ ld/testsuite/ld-powerpc/symtocbase.d 18 Nov 2005 04:30:23 -0000
@@ -11,14 +11,14 @@ Disassembly of section \.data:
 
 .* <i>:
  \.\.\.
-.*: 00 02 00 00 \.long 0x20000
+.*: 00 02 80 00 \.long 0x28000
 .*: 00 00 00 00 \.long 0x0
-.*: 00 02 00 00 \.long 0x20000
+.*: 00 02 80 00 \.long 0x28000
 .*: 00 00 00 00 \.long 0x0
-.*: 00 03 00 00 \.long 0x30000
+.*: 00 03 80 00 \.long 0x38000
 .*: 00 00 00 00 \.long 0x0
-.*: 00 03 00 00 \.long 0x30000
+.*: 00 03 80 00 \.long 0x38000
 .*: 00 00 00 00 \.long 0x0
-.*: 00 02 00 00 \.long 0x20000
+.*: 00 02 80 00 \.long 0x28000
 .*: 00 00 00 00 \.long 0x0
-.*: 00 03 00 00 \.long 0x30000
+.*: 00 03 80 00 \.long 0x38000

--
Alan Modra
IBM OzLabs - Linux Technology Centre