aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/ldlang.c2
-rw-r--r--ld/testsuite/ld-elf/size-2.d2
3 files changed, 9 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 92fa8a4..688a442 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2021-01-18 Alan Modra <amodra@gmail.com>
+
+ PR 26378
+ * ldlang.c (map_input_to_output_sections): Start with a read-only
+ section for data statements.
+ * testsuite/ld-elf/size-2.d: Adjust to suit.
+
2021-01-17 H.J. Lu <hongjiu.lu@intel.com>
PR ld/27193
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 4ae9cec..8014e7a 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -4225,7 +4225,7 @@ map_input_to_output_sections
break;
}
if (os->bfd_section == NULL)
- init_os (os, flags);
+ init_os (os, flags | SEC_READONLY);
else
os->bfd_section->flags |= flags;
break;
diff --git a/ld/testsuite/ld-elf/size-2.d b/ld/testsuite/ld-elf/size-2.d
index 1420224..9f1a9cf 100644
--- a/ld/testsuite/ld-elf/size-2.d
+++ b/ld/testsuite/ld-elf/size-2.d
@@ -11,7 +11,7 @@
.* \.text +PROGBITS +0+100 [0-9a-f]+ 0+10 00 AX .*
.* \.tdata +PROGBITS +0+110 [0-9a-f]+ 0+20 00 WAT .*
.* \.tbss +NOBITS +0+130 [0-9a-f]+ 0+30 00 WAT .*
-.* \.map +PROGBITS +0+130 [0-9a-f]+ 0+c 00 +WA .*
+.* \.map +PROGBITS +0+130 [0-9a-f]+ 0+c 00 +A .*
#...
+PHDR +(0x0+40 0x0+40 0x0+40 0x0+a8 0x0+a8|0x0+34 0x0+34 0x0+34 0x0+60 0x0+60|0x0+34 0x0+a0 0x0+a0 0x0+60 0x0+60) R .*
+LOAD +(0x0+40 0x0+40 0x0+40 0x0+fc 0x0+fc|0x0+34 0x0+34 0x0+34 0x0+1(08|10) 0x0+1(08|10)|0x0+34 0x0+a0 0x0+a0 0x0+9c 0x0+9c) R E .*