This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[GOLD] final_layout test on ppc32
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Thu, 28 Feb 2013 10:41:01 +1030
- Subject: [GOLD] final_layout test on ppc32
This test is failing on 32-bit powerpc with
00000c1c S global_vara
00000c20 S global_varb
00000c24 S global_varc
not matching the requested section layout
*_Z3barv*
.text._Z3bazv
*_Z3foov*
*global_varb*
*global_vara*
*global_varc*
Apparently this is because these vars are in .sbss rather than .bss
sections
[ 4] .sbss.global_vara NOBITS 00000000 000034 000004 00 WA 0 0 4
[ 5] .sbss.global_varb NOBITS 00000000 000034 000004 00 WA 0 0 4
[ 6] .sbss.global_varc NOBITS 00000000 000034 000004 00 WA 0 0 4
and there is no mention of .sbss in the linker script.
That results in these sections being placed in separate output
sections
.sbss.global_vara
0x00000bf0 0x4
.sbss.global_vara
0x00000bf0 0x4 final_layout.o
0x00000bf0 global_vara
.sbss.global_varb
0x00000bf4 0x4
.sbss.global_varb
0x00000bf4 0x4 final_layout.o
0x00000bf4 global_varb
.sbss.global_varc
0x00000bf8 0x4
.sbss.global_varc
0x00000bf8 0x4 final_layout.o
0x00000bf8 global_varc
So... Is this a bug in gold's --section-ordering-file, or do we want
the following?
* testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
* testsuite/Makefile.in: Regenerate.
Index: gold/testsuite/Makefile.am
===================================================================
RCS file: /cvs/src/src/gold/testsuite/Makefile.am,v
retrieving revision 1.207
diff -u -p -r1.207 Makefile.am
--- gold/testsuite/Makefile.am 24 Jan 2013 18:49:54 -0000 1.207
+++ gold/testsuite/Makefile.am 28 Feb 2013 00:07:43 -0000
@@ -252,7 +252,7 @@ final_layout.o: final_layout.cc
final_layout_sequence.txt:
(echo "*_Z3barv*" && echo ".text._Z3bazv" && echo "*_Z3foov*" && echo "*global_varb*" && echo "*global_vara*" && echo "*global_varc*") > final_layout_sequence.txt
final_layout_script.lds:
- (echo "SECTIONS { .text : { *(.text*) } .got : { *(.got .toc) } .bss : { *(.bss*) } }") > final_layout_script.lds
+ (echo "SECTIONS { .text : { *(.text*) } .got : { *(.got .toc) } .sbss : { *(.sbss*) } .bss : { *(.bss*) } }") > final_layout_script.lds
final_layout: final_layout.o final_layout_sequence.txt final_layout_script.lds gcctestdir/ld
$(CXXLINK) -Bgcctestdir/ -Wl,--section-ordering-file,final_layout_sequence.txt -Wl,-T,final_layout_script.lds final_layout.o
final_layout.stdout: final_layout
--
Alan Modra
Australia Development Lab, IBM