diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2018-08-02 05:00:45 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2018-08-02 05:00:59 -0700 |
commit | 36a900f483789dc2ec4bfd31386e29b52fd2e019 (patch) | |
tree | bf4c769ed210a01fc53eb6bac5d794d43f49e25e | |
parent | 09a8cc152be1b6ad2e309ac2d61caa5a4a1c3a54 (diff) | |
download | gdb-36a900f483789dc2ec4bfd31386e29b52fd2e019.zip gdb-36a900f483789dc2ec4bfd31386e29b52fd2e019.tar.gz gdb-36a900f483789dc2ec4bfd31386e29b52fd2e019.tar.bz2 |
Add a testcase for PR binutils/23460
Add a testcase to limit open files to 16 for AR with plugin. Before
commit 103da91bc083f94769e3758175a96d06cef1f8fe
Author: Nick Clifton <nickc@redhat.com>
Date: Wed Aug 1 14:34:41 2018 +0100
Close resource leaks in the BFD library's plugin handler.
it failed with:
../binutils/ar: tmpdir/pr23460f.o: plugin needed to handle lto object
PR binutils/23460
* testsuite/ld-plugin/lto.exp: Run the PR binutils/23460 test.
* testsuite/ld-plugin/pr23460a.c: New file.
* testsuite/ld-plugin/pr23460b.c: Likewise.
* testsuite/ld-plugin/pr23460c.c: Likewise.
* testsuite/ld-plugin/pr23460d.c: Likewise.
* testsuite/ld-plugin/pr23460e.c: Likewise.
* testsuite/ld-plugin/pr23460f.c: Likewise.
-rw-r--r-- | ld/ChangeLog | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/lto.exp | 26 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr23460a.c | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr23460b.c | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr23460c.c | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr23460d.c | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr23460e.c | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr23460f.c | 4 |
8 files changed, 61 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index b1ccec8..c5838d2 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,14 @@ +2018-08-02 H.J. Lu <hongjiu.lu@intel.com> + + PR binutils/23460 + * testsuite/ld-plugin/lto.exp: Run the PR binutils/23460 test. + * testsuite/ld-plugin/pr23460a.c: New file. + * testsuite/ld-plugin/pr23460b.c: Likewise. + * testsuite/ld-plugin/pr23460c.c: Likewise. + * testsuite/ld-plugin/pr23460d.c: Likewise. + * testsuite/ld-plugin/pr23460e.c: Likewise. + * testsuite/ld-plugin/pr23460f.c: Likewise. + 2018-08-01 Roland McGrath <mcgrathr@google.com> * testsuite/ld-aarch64/ifunc-1-local.d: Adjust regexps to match diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index 7c50b0f..5d354bf 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -556,6 +556,32 @@ if { [at_least_gcc_version 4 7] } { } { fail $testname } + + run_cc_link_tests [list \ + [list \ + "Build pr23460*.o" \ + "$plug_opt" \ + "-O2 -fPIC -flto $lto_no_fat" \ + {pr23460a.c pr23460b.c pr23460c.c \ + pr23460d.c pr23460e.c pr23460f.c} \ + ] \ + ] + set exec_output [run_host_cmd "sh" \ + "-c \"ulimit -n 16; \ + $ar -rc $plug_opt \ + tmpdir/libpr23460.a \ + tmpdir/pr23460a.o \ + tmpdir/pr23460b.o \ + tmpdir/pr23460c.o \ + tmpdir/pr23460d.o \ + tmpdir/pr23460e.o \ + tmpdir/pr23460f.o\""] + set exec_output [prune_warnings $exec_output] + if [string match "" $exec_output] then { + pass "PR binutils/23460" + } else { + fail "PR binutils/23460" + } } # Run "ld -r" to generate inputs for complex LTO tests. diff --git a/ld/testsuite/ld-plugin/pr23460a.c b/ld/testsuite/ld-plugin/pr23460a.c new file mode 100644 index 0000000..4a8cd14 --- /dev/null +++ b/ld/testsuite/ld-plugin/pr23460a.c @@ -0,0 +1,4 @@ +void +x1 (void) +{ +} diff --git a/ld/testsuite/ld-plugin/pr23460b.c b/ld/testsuite/ld-plugin/pr23460b.c new file mode 100644 index 0000000..6c178fb --- /dev/null +++ b/ld/testsuite/ld-plugin/pr23460b.c @@ -0,0 +1,4 @@ +void +x2 (void) +{ +} diff --git a/ld/testsuite/ld-plugin/pr23460c.c b/ld/testsuite/ld-plugin/pr23460c.c new file mode 100644 index 0000000..99b23c5 --- /dev/null +++ b/ld/testsuite/ld-plugin/pr23460c.c @@ -0,0 +1,4 @@ +void +x3 (void) +{ +} diff --git a/ld/testsuite/ld-plugin/pr23460d.c b/ld/testsuite/ld-plugin/pr23460d.c new file mode 100644 index 0000000..432d39b --- /dev/null +++ b/ld/testsuite/ld-plugin/pr23460d.c @@ -0,0 +1,4 @@ +void +x4 (void) +{ +} diff --git a/ld/testsuite/ld-plugin/pr23460e.c b/ld/testsuite/ld-plugin/pr23460e.c new file mode 100644 index 0000000..2809011 --- /dev/null +++ b/ld/testsuite/ld-plugin/pr23460e.c @@ -0,0 +1,4 @@ +void +x5 (void) +{ +} diff --git a/ld/testsuite/ld-plugin/pr23460f.c b/ld/testsuite/ld-plugin/pr23460f.c new file mode 100644 index 0000000..e500bf5 --- /dev/null +++ b/ld/testsuite/ld-plugin/pr23460f.c @@ -0,0 +1,4 @@ +void +x6 (void) +{ +} |