aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-11-21 21:31:18 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-11-21 21:31:18 +0000
commitf1d85785136b9335f837775031f4dba0124462db (patch)
treea06b890a356e440d206c0d3631ecb3af27bc51d2 /ld
parenta3f548ed8589b815eb5141825c73d3871d0d1786 (diff)
downloadgdb-f1d85785136b9335f837775031f4dba0124462db.zip
gdb-f1d85785136b9335f837775031f4dba0124462db.tar.gz
gdb-f1d85785136b9335f837775031f4dba0124462db.tar.bz2
Set output maxpagesize when rewriting program header
bfd/ PR binutils/14493 * elf.c (copy_elf_program_header): When rewriting program header, set the output maxpagesize to the maximum alignment of input PT_LOAD segments. 2012-11-21 H.J. Lu <hongjiu.lu@intel.com> PR binutils/14493 * ld-elf/maxpage5.d: New file. * ld-elf/maxpage5.s: Likewise. * ld-elf/maxpage5.t: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-elf/maxpage5.d18
-rw-r--r--ld/testsuite/ld-elf/maxpage5.s8
-rw-r--r--ld/testsuite/ld-elf/maxpage5.t15
4 files changed, 48 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index bebb04e..72d8445 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2012-11-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/14493
+ * ld-elf/maxpage5.d: New file.
+ * ld-elf/maxpage5.s: Likewise.
+ * ld-elf/maxpage5.t: Likewise.
+
2012-11-21 Roland McGrath <mcgrathr@google.com>
* ld-elf/comm-data.exp: Add XFAIL for arm*-*-* targets, referring
diff --git a/ld/testsuite/ld-elf/maxpage5.d b/ld/testsuite/ld-elf/maxpage5.d
new file mode 100644
index 0000000..bcbd39c
--- /dev/null
+++ b/ld/testsuite/ld-elf/maxpage5.d
@@ -0,0 +1,18 @@
+#source: maxpage5.s
+#as: --32
+#ld: -z max-page-size=0x200000 -T maxpage5.t
+#objcopy_linked_file: -R .foo
+#readelf: -l --wide
+#target: x86_64-*-linux* i?86-*-linux-gnu
+
+#...
+Program Headers:
+ Type.*
+ LOAD +0x[0-9a-f]+ .*0x200000
+ NOTE +0x[0-9a-f]+ .*
+
+#...
+ Segment Sections...
+ 00[ \t]+.text *
+ 01[ \t]+.note *
+#pass
diff --git a/ld/testsuite/ld-elf/maxpage5.s b/ld/testsuite/ld-elf/maxpage5.s
new file mode 100644
index 0000000..93d6b36
--- /dev/null
+++ b/ld/testsuite/ld-elf/maxpage5.s
@@ -0,0 +1,8 @@
+ .globl _entry
+ .text
+_entry:
+ .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+ .section .foo,"awx",%progbits
+ .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+ .section .note,"",%note
+ .byte 0
diff --git a/ld/testsuite/ld-elf/maxpage5.t b/ld/testsuite/ld-elf/maxpage5.t
new file mode 100644
index 0000000..7f19343
--- /dev/null
+++ b/ld/testsuite/ld-elf/maxpage5.t
@@ -0,0 +1,15 @@
+OUTPUT_FORMAT("elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_entry)
+PHDRS
+{
+ data PT_LOAD;
+ note PT_NOTE;
+}
+SECTIONS
+{
+ .text : { *(.text) } :data
+ .foo : { *(.foo) } :data
+ .note : { *(.note) } :note
+ /DISCARD/ : { *(*) }
+}