From 11cba4accf7f9a82fdb7902f0e36521038eda205 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 31 Aug 2012 02:52:14 +0000 Subject: Provide __executable_start for PIE ld/ PR ld/14525 * scripttempl/elf.sc: Also provide __executable_start for PIE. ld/testsuite/ PR ld/14525 * ld-elf/elf.exp: Run pr14525. * ld-elf/pr14525.c: New. * ld-elf/pr14525.out: Likewise. --- ld/testsuite/ChangeLog | 26 +++++++++++++++++--------- ld/testsuite/ld-elf/elf.exp | 1 + ld/testsuite/ld-elf/pr14525.c | 11 +++++++++++ ld/testsuite/ld-elf/pr14525.out | 1 + 4 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 ld/testsuite/ld-elf/pr14525.c create mode 100644 ld/testsuite/ld-elf/pr14525.out (limited to 'ld/testsuite') diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index eca418182d6..5537d0a15b5 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2012-08-30 H.J. Lu + + PR ld/14525 + * ld-elf/elf.exp: Run pr14525. + + * ld-elf/pr14525.c: New. + * ld-elf/pr14525.out: Likewise. + 2012-08-28 Maciej W. Rozycki * ld-elf/export-class.sd: New test. @@ -81,15 +89,15 @@ * ld-mips-elf/mips-elf.exp: Run the new tests. 2012-08-13 Ian Bolton - Laurent Desnogues - Jim MacArthur - Marcus Shawcroft - Nigel Stephens - Ramana Radhakrishnan - Richard Earnshaw - Sofiane Naci - Tejas Belagod - Yufeng Zhang + Laurent Desnogues + Jim MacArthur + Marcus Shawcroft + Nigel Stephens + Ramana Radhakrishnan + Richard Earnshaw + Sofiane Naci + Tejas Belagod + Yufeng Zhang * ld-aarch64/aarch64-elf.exp: New file. * ld-aarch64/aarch64.ld: New file. diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp index 1780b50e16e..a97e3df8e67 100644 --- a/ld/testsuite/ld-elf/elf.exp +++ b/ld/testsuite/ld-elf/elf.exp @@ -151,6 +151,7 @@ set array_tests_pie { {"PIE init array" "-pie" "" {init.c} "init" "init.out" "-fPIE"} {"PIE fini array" "-pie" "" {fini.c} "fini" "fini.out" "-fPIE"} {"PIE init array mixed" "-pie" "" {init-mixed.c} "init-mixed" "init-mixed.out" "-I. -fPIE"} + {"PIE PR ld/14525" "-pie" "" {pr14525.c} "pr14525" "pr14525.out" "-fPIE"} } set array_tests_static { {"static preinit array" "-static" "" {preinit.c} "preinit" "preinit.out"} diff --git a/ld/testsuite/ld-elf/pr14525.c b/ld/testsuite/ld-elf/pr14525.c new file mode 100644 index 00000000000..082eb87bef2 --- /dev/null +++ b/ld/testsuite/ld-elf/pr14525.c @@ -0,0 +1,11 @@ +#include + +extern void *__executable_start; + +int +main() +{ + if ((void **) &main >= &__executable_start) + printf ("OK\n"); + return 0; +} diff --git a/ld/testsuite/ld-elf/pr14525.out b/ld/testsuite/ld-elf/pr14525.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/ld/testsuite/ld-elf/pr14525.out @@ -0,0 +1 @@ +OK -- cgit v1.2.1