diff options
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-gc/gc.exp | 15 | ||||
-rw-r--r-- | ld/testsuite/ld-gc/pr20306.c | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-gc/pr20306.d | 3 |
4 files changed, 26 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 631fec5..b7a5fd7 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2016-06-28 H.J. Lu <hongjiu.lu@intel.com> + + * testsuite/ld-gc/gc.exp: Run pr20306 test. + * ld-gc/pr20306.c: New file. + * ld-gc/pr20306.d: Likewise. + 2016-06-28 Nick Clifton <nickc@redhat.com> * testsuite/ld-elf/comm-data.exp: Expect comm-data2 test to fail diff --git a/ld/testsuite/ld-gc/gc.exp b/ld/testsuite/ld-gc/gc.exp index ffc619c..a6f3e13 100644 --- a/ld/testsuite/ld-gc/gc.exp +++ b/ld/testsuite/ld-gc/gc.exp @@ -146,3 +146,18 @@ if { [is_remote host] || [which $CC] != 0 } { ld_compile "$CC $CFLAGS $cflags -O0" $srcdir/$subdir/pr19161-2.c tmpdir/pr19161-2.o run_dump_test "pr19161" } + +if { [is_elf_format] && [check_shared_lib_support] \ + && ([is_remote host] || [which $CC] != 0) } { + run_cc_link_tests [list \ + [list \ + "Build libpr20306.so" \ + "-shared" \ + "-fPIC" \ + {pr20306.c} \ + {} \ + "libpr20306.so" \ + ] \ + ] + run_dump_test "pr20306" +} diff --git a/ld/testsuite/ld-gc/pr20306.c b/ld/testsuite/ld-gc/pr20306.c new file mode 100644 index 0000000..0968c73 --- /dev/null +++ b/ld/testsuite/ld-gc/pr20306.c @@ -0,0 +1,2 @@ +extern void foo(); +void bar() {foo();} diff --git a/ld/testsuite/ld-gc/pr20306.d b/ld/testsuite/ld-gc/pr20306.d new file mode 100644 index 0000000..07cc8e8 --- /dev/null +++ b/ld/testsuite/ld-gc/pr20306.d @@ -0,0 +1,3 @@ +#source: dummy.s +#ld: -u foo --gc-sections tmpdir/libpr20306.so +#error: .* generated: undefined reference to `foo' |