Add a test for --as-needed with symbol versioning
* ld-elf/shared.exp (build_tests): Add libneeded2a.so, libneeded2b.so, libneeded2c.o and needed2. * ld-elf/needed2.ver: New file. * ld-elf/needed2a.c: Likewise. * ld-elf/needed2b.c: Likewise. * ld-elf/needed2c.c: Likewise.
This commit is contained in:
parent
08a6411c71
commit
5e319dd3e1
6 changed files with 39 additions and 0 deletions
|
@ -1,3 +1,13 @@
|
|||
2013-12-11 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* ld-elf/shared.exp (build_tests): Add libneeded2a.so,
|
||||
libneeded2b.so, libneeded2c.o and needed2.
|
||||
|
||||
* ld-elf/needed2.ver: New file.
|
||||
* ld-elf/needed2a.c: Likewise.
|
||||
* ld-elf/needed2b.c: Likewise.
|
||||
* ld-elf/needed2c.c: Likewise.
|
||||
|
||||
2013-12-07 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* ld-pe/aligncomm-1.c: Remove +x file mode.
|
||||
|
|
4
ld/testsuite/ld-elf/needed2.ver
Normal file
4
ld/testsuite/ld-elf/needed2.ver
Normal file
|
@ -0,0 +1,4 @@
|
|||
BLAFOO {
|
||||
global: pam_end;
|
||||
local: *;
|
||||
};
|
5
ld/testsuite/ld-elf/needed2a.c
Normal file
5
ld/testsuite/ld-elf/needed2a.c
Normal file
|
@ -0,0 +1,5 @@
|
|||
extern void pam_end (void);
|
||||
void dumpme (void)
|
||||
{
|
||||
pam_end ();
|
||||
}
|
2
ld/testsuite/ld-elf/needed2b.c
Normal file
2
ld/testsuite/ld-elf/needed2b.c
Normal file
|
@ -0,0 +1,2 @@
|
|||
extern void pam_end (void);
|
||||
void pam_end (void) {}
|
6
ld/testsuite/ld-elf/needed2c.c
Normal file
6
ld/testsuite/ld-elf/needed2c.c
Normal file
|
@ -0,0 +1,6 @@
|
|||
extern void dumpme (void);
|
||||
int main (void)
|
||||
{
|
||||
dumpme();
|
||||
return 0;
|
||||
}
|
|
@ -206,6 +206,18 @@ set build_tests {
|
|||
{"Build librel.so"
|
||||
"-shared" "-fPIC"
|
||||
{rel.c} {} "librel.so"}
|
||||
{"Build libneeded2a.so"
|
||||
"-shared" "-fPIC"
|
||||
{needed2a.c} {} "libneeded2a.so"}
|
||||
{"Build libneeded2b.so"
|
||||
"-shared -Wl,--version-script,needed2.ver" "-fPIC"
|
||||
{needed2b.c} {} "libneeded2b.so"}
|
||||
{"Build libneeded2c.o"
|
||||
"-r -nostdlib" ""
|
||||
{needed2c.c} {} "libneeded2c.o"}
|
||||
{"Build needed2"
|
||||
"tmpdir/libneeded2c.o -Wl,--as-needed tmpdir/libneeded2a.so tmpdir/libneeded2b.so" ""
|
||||
{dummy.c} {} "needed2"}
|
||||
}
|
||||
|
||||
run_cc_link_tests $build_tests
|
||||
|
|
Loading…
Reference in a new issue