aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2013-12-12 07:41:27 -0800
committerH.J. Lu <hjl.tools@gmail.com>2013-12-12 07:41:27 -0800
commit58e7ebacdd97c858834c07c7dce098aeacd500fb (patch)
treeeacf8465894e3930ae8fcd558de24e58cd22e166 /ld
parentb15e5c540f4b90dbec13bcd5cbac90f9224aef4b (diff)
downloadgdb-58e7ebacdd97c858834c07c7dce098aeacd500fb.zip
gdb-58e7ebacdd97c858834c07c7dce098aeacd500fb.tar.gz
gdb-58e7ebacdd97c858834c07c7dce098aeacd500fb.tar.bz2
Set ET_EXEC for -pie -Ttext-segment=
bfd/ * elf.c (assign_file_positions_except_relocs): Set e_type in ELF header to ET_EXEC for -pie -Ttext-segment=. 2013-12-10 H.J. Lu <hongjiu.lu@intel.com> * ld-pie/vaddr-0.d: New file. * ld-pie/vaddr-1.d: Likewise. * ld-pie/vaddr.s: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog6
-rw-r--r--ld/testsuite/ld-pie/vaddr-0.d9
-rw-r--r--ld/testsuite/ld-pie/vaddr-1.d9
-rw-r--r--ld/testsuite/ld-pie/vaddr.s10
4 files changed, 34 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 2f64fce..6100dfe 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2013-12-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ld-pie/vaddr-0.d: New file.
+ * ld-pie/vaddr-1.d: Likewise.
+ * ld-pie/vaddr.s: Likewise.
+
2013-12-11 Will Newton <will.newton@linaro.org>
* ld-aarch64/ifunc-21.d: Make test more generic to support
diff --git a/ld/testsuite/ld-pie/vaddr-0.d b/ld/testsuite/ld-pie/vaddr-0.d
new file mode 100644
index 0000000..e072222
--- /dev/null
+++ b/ld/testsuite/ld-pie/vaddr-0.d
@@ -0,0 +1,9 @@
+#source: vaddr.s
+#name: zero p_vaddr
+#ld: -pie
+#readelf: -h
+
+ELF Header:
+#...
+ Type: DYN \(Shared object file\)
+#pass
diff --git a/ld/testsuite/ld-pie/vaddr-1.d b/ld/testsuite/ld-pie/vaddr-1.d
new file mode 100644
index 0000000..7b5f992
--- /dev/null
+++ b/ld/testsuite/ld-pie/vaddr-1.d
@@ -0,0 +1,9 @@
+#source: vaddr.s
+#name: non-zero p_vaddr
+#ld: -pie -Ttext-segment 0x7000000 -z max-page-size=0x200000
+#readelf: -h
+
+ELF Header:
+#...
+ Type: EXEC \(Executable file\)
+#pass
diff --git a/ld/testsuite/ld-pie/vaddr.s b/ld/testsuite/ld-pie/vaddr.s
new file mode 100644
index 0000000..5fc0ee7
--- /dev/null
+++ b/ld/testsuite/ld-pie/vaddr.s
@@ -0,0 +1,10 @@
+ .globl main
+ .globl start
+ .globl _start
+ .globl __start
+ .text
+main:
+start:
+_start:
+__start:
+ .byte 0