aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/ldlang.c3
-rw-r--r--ld/testsuite/ChangeLog10
-rw-r--r--ld/testsuite/ld-elf/pr16322.d7
-rw-r--r--ld/testsuite/ld-elf/pr16322.s6
-rw-r--r--ld/testsuite/ld-x86-64/pr14207.d23
6 files changed, 51 insertions, 5 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 15725d4..c41e244 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,12 @@
2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
+ PR ld/14207
+ PR ld/16322
+ PR binutils/16323
+ * ldlang.c (lang_size_sections): Properly align RELRO base.
+
+2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
+
* ldver.c (ldversion): Update copyright year to 2014.
For older changes see ChangeLog-2013
diff --git a/ld/ldlang.c b/ld/ldlang.c
index ba7f493..7851615 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -5407,7 +5407,8 @@ lang_size_sections (bfd_boolean *relax, bfd_boolean check_regions)
{
if (expld.dataseg.base - (1 << max_alignment_power) < old_base)
expld.dataseg.base += expld.dataseg.pagesize;
- expld.dataseg.base -= (1 << max_alignment_power);
+ /* Properly align base to max_alignment_power. */
+ expld.dataseg.base &= ~((1 << max_alignment_power) - 1);
lang_reset_memory_regions ();
one_lang_size_sections_pass (relax, check_regions);
}
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index dfe7d09..8d32d28 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/14207
+ PR ld/16322
+ PR binutils/16323
+ * ld-elf/pr16322.d: New file.
+ * ld-elf/pr16322.s: Likewise.
+
+ * ld-x86-64/pr14207.d: Expect PT_GNU_RELRO segment.
+
For older changes see ChangeLog-2013
Copyright (C) 2014 Free Software Foundation, Inc.
diff --git a/ld/testsuite/ld-elf/pr16322.d b/ld/testsuite/ld-elf/pr16322.d
new file mode 100644
index 0000000..40a7975
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr16322.d
@@ -0,0 +1,7 @@
+#ld: -shared -z relro
+#readelf: -l --wide
+#target: *-*-linux-gnu *-*-gnu* *-*-nacl*
+
+#...
+ GNU_RELRO .*
+#pass
diff --git a/ld/testsuite/ld-elf/pr16322.s b/ld/testsuite/ld-elf/pr16322.s
new file mode 100644
index 0000000..c95817a
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr16322.s
@@ -0,0 +1,6 @@
+ .globl p1
+ .section .data.rel.ro,"aw",%progbits
+ .p2align 5
+ .type p1, %object
+p1:
+ .dc.a f1
diff --git a/ld/testsuite/ld-x86-64/pr14207.d b/ld/testsuite/ld-x86-64/pr14207.d
index 2362e88..b1e2d5a 100644
--- a/ld/testsuite/ld-x86-64/pr14207.d
+++ b/ld/testsuite/ld-x86-64/pr14207.d
@@ -2,8 +2,23 @@
#as: --64
#ld: -melf_x86_64 -shared -z relro -z now
#readelf: -l --wide
+#target: x86_64-*-linux*
-#failif
-#...
- NULL +.*
-#...
+Elf file type is DYN \(Shared object file\)
+Entry point 0x1d9
+There are 4 program headers, starting at offset 64
+
+Program Headers:
+ Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
+ LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x0001e0 0x0001e0 R 0x200000
+ LOAD 0x000b48 0x0000000000200b48 0x0000000000200b48 0x0004b8 0x000cf8 RW 0x200000
+ DYNAMIC 0x000b90 0x0000000000200b90 0x0000000000200b90 0x0001c0 0x0001c0 RW 0x8
+ GNU_RELRO 0x000b48 0x0000000000200b48 0x0000000000200b48 0x0004b8 0x0004b8 R 0x1
+
+ Section to Segment mapping:
+ Segment Sections...
+ 00 .hash .dynsym .dynstr
+ 01 .init_array .fini_array .jcr .data.rel.ro .dynamic .got .bss
+ 02 .dynamic
+ 03 .init_array .fini_array .jcr .data.rel.ro .dynamic .got
+#pass