diff options
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 9 | ||||
-rw-r--r-- | ld/testsuite/ld-i386/i386.exp | 9 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr23997a.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr23997b.c | 25 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr23997c.c | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/x86-64.exp | 8 |
6 files changed, 64 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 17a2e45..c7d4a0c 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,14 @@ 2018-12-19 H.J. Lu <hongjiu.lu@intel.com> + PR gas/23997 + * testsuite/ld-i386/i386.exp: Run PR gas/23997 test. + * testsuite/ld-x86-64/x86-64.exp: Likewise. + * testsuite/ld-x86-64/pr23997a.s: New file. + * testsuite/ld-x86-64/pr23997b.c: Likewise. + * testsuite/ld-x86-64/pr23997c.c: Likewise. + +2018-12-19 H.J. Lu <hongjiu.lu@intel.com> + * testsuite/ld-x86-64/x86-64.exp: Rename PR ld/22842 run-time test to "Run pr22842". diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp index f86a54d..b3c489a 100644 --- a/ld/testsuite/ld-i386/i386.exp +++ b/ld/testsuite/ld-i386/i386.exp @@ -1420,6 +1420,15 @@ if { [isnative] "pr22842" \ "pass.out" \ ] \ + [list \ + "Run pr23997" \ + "" \ + "" \ + { ../ld-x86-64/pr23997a.s ../ld-x86-64/pr23997b.c \ + ../ld-x86-64/pr23997c.c } \ + "pr23997" \ + "pass.out" \ + ] \ ] if { [at_least_gcc_version 5 0] } { diff --git a/ld/testsuite/ld-x86-64/pr23997a.s b/ld/testsuite/ld-x86-64/pr23997a.s new file mode 100644 index 0000000..8d72c62 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr23997a.s @@ -0,0 +1,6 @@ + .text + .p2align 3 + .globl foo_p +foo_p: + .long foo@plt + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/pr23997b.c b/ld/testsuite/ld-x86-64/pr23997b.c new file mode 100644 index 0000000..02cb8f8 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr23997b.c @@ -0,0 +1,25 @@ +#include <stdio.h> + +typedef void (*func_t) (void); + +extern func_t get_foo (void); + +void +foo (void) +{ +} + +int +main () +{ + func_t p; + + foo (); + p = get_foo (); + p (); + + if (foo == p) + printf ("PASS\n"); + + return 0; +} diff --git a/ld/testsuite/ld-x86-64/pr23997c.c b/ld/testsuite/ld-x86-64/pr23997c.c new file mode 100644 index 0000000..3573157 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr23997c.c @@ -0,0 +1,7 @@ +extern int foo_p; + +void * +get_foo (void) +{ + return (void *) ((long) &foo_p + foo_p); +} diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index 75e2546..c9e8ecb 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -1594,6 +1594,14 @@ if { [isnative] && [which $CC] != 0 } { "pr22842" \ "pass.out" \ ] \ + [list \ + "Run pr23997" \ + "" \ + "" \ + { pr23997a.s pr23997b.c pr23997c.c } \ + "pr23997" \ + "pass.out" \ + ] \ ] # Run-time tests which require working ifunc attribute support. |