aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-go32.c
diff options
context:
space:
mode:
authorJan W. Jagersma <jwjagersma@gmail.com>2021-11-24 14:17:21 +0100
committerAlan Modra <amodra@gmail.com>2021-11-25 23:19:58 +1030
commit423e91d347cf6050ac17c7098cad6cbc15e5e50f (patch)
treebc93239ecbd8f43a52edb4cf419f1f301aa4dc4d /bfd/coff-go32.c
parent32384aa396e7e87fe02cc838722b8e80ec88ec10 (diff)
downloadfsf-binutils-gdb-423e91d347cf6050ac17c7098cad6cbc15e5e50f.zip
fsf-binutils-gdb-423e91d347cf6050ac17c7098cad6cbc15e5e50f.tar.gz
fsf-binutils-gdb-423e91d347cf6050ac17c7098cad6cbc15e5e50f.tar.bz2
coff-go32: consistent 16-byte section alignment
Section alignment for coff-go32 is inconsistent - The '.text' and '.data' sections are 16-byte aligned, but named sections '.text.*' and '.data.*' are only 4-byte aligned. '.gnu.linkonce.r.*' is aligned to 16 bytes, yet '.rodata' and '.rodata.*' are aligned to 4 bytes. For '.bss' all input sections are only aligned to 4 bytes. This primarily can cause trouble when using SSE instructions, which require their memory operands to be aligned to 16-byte boundaries. This patch solves the issue simply by setting the section alignment to 16 bytes, for all code and data sections referenced in the default linker script. * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Use partial name match for .text, .data. Add entries for .const, .rodata, .bss, .gnu.linkonce.b.
Diffstat (limited to 'bfd/coff-go32.c')
-rw-r--r--bfd/coff-go32.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/bfd/coff-go32.c b/bfd/coff-go32.c
index d73c32b..3139ce0 100644
--- a/bfd/coff-go32.c
+++ b/bfd/coff-go32.c
@@ -28,9 +28,15 @@
#define COFF_LONG_FILENAMES
#define COFF_SECTION_ALIGNMENT_ENTRIES \
-{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".data"), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
-{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".text"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".const"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".rodata"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".bss"), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.d"), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
@@ -38,6 +44,8 @@
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.r"), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.b"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \
{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi"), \