2009-10-07 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 8 Oct 2009 02:38:26 +0000 (02:38 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 8 Oct 2009 02:38:26 +0000 (02:38 +0000)
PR ld/10744
* ld-scripts/phdrs3.exp: Run phdrs3a.

* ld-scripts/phdrs3a.d: New.
* ld-scripts/phdrs3a.t: Likewise.

ld/testsuite/ChangeLog
ld/testsuite/ld-scripts/phdrs3.exp
ld/testsuite/ld-scripts/phdrs3a.d [new file with mode: 0644]
ld/testsuite/ld-scripts/phdrs3a.t [new file with mode: 0644]

index 774301e..43f5d1b 100644 (file)
@@ -1,3 +1,11 @@
+2009-10-07  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/10744
+       * ld-scripts/phdrs3.exp: Run phdrs3a.
+
+       * ld-scripts/phdrs3a.d: New.
+       * ld-scripts/phdrs3a.t: Likewise.
+
 2009-10-08  Alan Modra  <amodra@bigpond.net.au>
 
        PR ld/10744
index 90651af..e7e0414 100644 (file)
@@ -34,5 +34,6 @@ if { [istarget spu*-*-*] } {
 }
 
 run_dump_test "phdrs3"
+run_dump_test "phdrs3a"
 
 set LDFLAGS $old_ldflags
diff --git a/ld/testsuite/ld-scripts/phdrs3a.d b/ld/testsuite/ld-scripts/phdrs3a.d
new file mode 100644 (file)
index 0000000..80bde71
--- /dev/null
@@ -0,0 +1,9 @@
+#name: PHDRS headers 3a
+#source: phdrs.s
+#ld: -T phdrs3a.t
+#readelf: -l --wide
+
+#...
+[ \t]+LOAD[ x0-9a-f]+ R [ x0-9a-f]+
+[ \t]+LOAD[ x0-9a-f]+ E [ x0-9a-f]+
+#pass
diff --git a/ld/testsuite/ld-scripts/phdrs3a.t b/ld/testsuite/ld-scripts/phdrs3a.t
new file mode 100644 (file)
index 0000000..c07ff34
--- /dev/null
@@ -0,0 +1,15 @@
+PHDRS
+{
+  data PT_LOAD FILEHDR PHDRS FLAGS(4);
+  text PT_LOAD FILEHDR PHDRS FLAGS(1);
+}
+
+SECTIONS
+{
+  /* This test will fail on architectures where the startaddress below
+     is less than the constant MAXPAGESIZE.  */
+  . = 0x800000 + SIZEOF_HEADERS;
+  .text : { *(.text) } :text
+  .data : { *(.data) } :data
+  /DISCARD/ : { *(.*) }
+}