This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Linker scripts and Section Reordering.


On Wed, Jan 09, 2013 at 03:40:08PM -0800, Sriraman Tallam wrote:
> 	* Makefile.am (final_layout.sh): Use a simple linker script to
> 	check if section ordering still works.

When using a script, powerpc64 gold needs to be told where to place
.toc sections, otherwise they will get their own output section which
happens to be placed before .got.  Since the toc base reg is set to
.got + 32768, this results in offsets less than -32768 and reloc
overflows.  OK to apply?

	* Makefile.am (final_layout_script.lds): Handle .got section.
	* Makefile.in: Regenerate.

Index: gold/testsuite/Makefile.am
===================================================================
RCS file: /cvs/src/src/gold/testsuite/Makefile.am,v
retrieving revision 1.204
diff -u -p -r1.204 Makefile.am
--- gold/testsuite/Makefile.am	10 Jan 2013 00:18:15 -0000	1.204
+++ gold/testsuite/Makefile.am	14 Jan 2013 06:22:10 -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*) } .bss : { *(.bss*) } }") > final_layout_script.lds
+	(echo "SECTIONS { .text : { *(.text*) } .got : { *(.got .toc) } .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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]