diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2019-04-11 06:52:03 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2019-04-11 06:52:03 -0700 |
commit | b3d7a86748247a68c69939cdf9925d4a78448f2d (patch) | |
tree | 4f53fc7857d2c79e5417bf0d6005c4cb1a8a7a11 /ld/testsuite/ld-elf | |
parent | a0ea3a14dc6a6062c0c1f2bfbb7ad0373ec20843 (diff) | |
download | gdb-b3d7a86748247a68c69939cdf9925d4a78448f2d.zip gdb-b3d7a86748247a68c69939cdf9925d4a78448f2d.tar.gz gdb-b3d7a86748247a68c69939cdf9925d4a78448f2d.tar.bz2 |
ld: Add -static-pie tests
Add -static-pie tests for DT_INIT_ARRAY, DT_FINI_ARRAY, DT_PREINIT_ARRAY
and IFUNC.
* testsuite/config/default.exp (STATIC_PIE_LDFLAGS): New. Set
to "-static-pie" if target compiler supports it.
* testsuite/ld-elf/elf.exp: Run -static-pie tests if
$STATIC_PIE_LDFLAGS isn't empty.
* testsuite/ld-ifunc/ifunc.exp: Likewise.
Diffstat (limited to 'ld/testsuite/ld-elf')
-rw-r--r-- | ld/testsuite/ld-elf/elf.exp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp index 4a5ef8a..4686870 100644 --- a/ld/testsuite/ld-elf/elf.exp +++ b/ld/testsuite/ld-elf/elf.exp @@ -235,6 +235,56 @@ if { [istarget *-*-linux*] || [istarget *-*-gnu*] } { run_ld_link_exec_tests $array_tests_pie $xfails + if { $STATIC_PIE_LDFLAGS != "" } then { + run_ld_link_exec_tests [list \ + [list \ + "Static PIE preinit array" \ + "$STATIC_PIE_LDFLAGS" \ + "" \ + {preinit.c} \ + "preinit-static-pie" \ + "preinit.out" \ + "-fPIE" \ + ] \ + [list \ + "Static PIE init array" \ + "$STATIC_PIE_LDFLAGS" \ + "" \ + {init.c} \ + "init-static-pie" \ + "init.out" \ + "-fPIE" \ + ] \ + [list \ + "Static PIE fini array" \ + "$STATIC_PIE_LDFLAGS" \ + "" \ + {fini.c} \ + "fini-static-pie" \ + "fini.out" \ + "-fPIE" \ + ] \ + [list \ + "Static PIE init array mixed" \ + "$STATIC_PIE_LDFLAGS" \ + "" \ + {init-mixed.c} \ + "init-mixed-static-pie" \ + "init-mixed.out" \ + "-I. -fPIE" \ + ] \ + [list \ + "Static PIE PR ld/14525" \ + "$STATIC_PIE_LDFLAGS" \ + "" \ + {pr14525.c} \ + "pr14525-static-pie" \ + "pr14525.out" \ + "-fPIE" \ + ] \ + ] + } + run_ld_link_exec_tests [list \ [list \ "Run mbind2a" \ |