[Patch] i386pe align .rdata for sse[2]
Brian Ford
ford@vss.fsi.com
Wed Sep 22 22:18:00 GMT 2004
As those of us from Cygwin recently found out, gcc >= 3.4 puts constants
in .rdata now. If those constants are used by sse[2] instructions (ie.
via -mfpmath=sse), then they may be misaligned when sections are
concatonated since the default .rdata section alignment is currently
2**2=4 (sse[2] instructions need 16 byte aligned data).
This patch is exactly parallel to:
2002-06-14 Sergey Grigoriev <serge@leopold.Physik.Uni-Augsburg.DE>
* pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte
alignment for .bss, .data and .text sections so that sse and sse2
code will work.
* pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
So...
2004-09-22 Brian Ford <ford@vss.fsi.com>
* pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte
alignment for .rdata sections so sse[2] code work with gcc >= 3.4
constatnts.
* pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
Ok to apply?
--
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained pilot...
-------------- next part --------------
Index: pe-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/pe-i386.c,v
retrieving revision 1.7
diff -u -p -r1.7 pe-i386.c
--- pe-i386.c 29 Apr 2004 16:40:20 -0000 1.7
+++ pe-i386.c 22 Sep 2004 22:02:14 -0000
@@ -34,6 +34,8 @@
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \
Index: pei-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/pei-i386.c,v
retrieving revision 1.6
diff -u -p -r1.6 pei-i386.c
--- pei-i386.c 29 Apr 2004 16:40:20 -0000 1.6
+++ pei-i386.c 22 Sep 2004 22:02:14 -0000
@@ -35,6 +35,8 @@
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \
More information about the Binutils
mailing list