mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-03 04:12:10 +08:00
Add plugin visibility test
* ld-plugin/func1p.c: New file. * ld-plugin/func2i.c: Likewise. * ld-plugin/func3h.c: Likewise. * ld-plugin/plugin.exp (plugin_extra_elf_tests): Add plugin visibility test.
This commit is contained in:
parent
3bd58fbe75
commit
c413941892
@ -1,3 +1,12 @@
|
||||
2012-12-07 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* ld-plugin/func1p.c: New file.
|
||||
* ld-plugin/func2i.c: Likewise.
|
||||
* ld-plugin/func3h.c: Likewise.
|
||||
|
||||
* ld-plugin/plugin.exp (plugin_extra_elf_tests): Add plugin
|
||||
visibility test.
|
||||
|
||||
2012-12-07 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* lib/ld-lib.exp (check_lto_available): New. Check if compiler
|
||||
|
8
ld/testsuite/ld-plugin/func1p.c
Normal file
8
ld/testsuite/ld-plugin/func1p.c
Normal file
@ -0,0 +1,8 @@
|
||||
extern int retval;
|
||||
|
||||
int
|
||||
__attribute__ ((visibility ("protected")))
|
||||
func1 (void)
|
||||
{
|
||||
return retval;
|
||||
}
|
8
ld/testsuite/ld-plugin/func2i.c
Normal file
8
ld/testsuite/ld-plugin/func2i.c
Normal file
@ -0,0 +1,8 @@
|
||||
extern int retval;
|
||||
|
||||
int
|
||||
__attribute__ ((visibility ("internal")))
|
||||
func2 (void)
|
||||
{
|
||||
return retval;
|
||||
}
|
8
ld/testsuite/ld-plugin/func3h.c
Normal file
8
ld/testsuite/ld-plugin/func3h.c
Normal file
@ -0,0 +1,8 @@
|
||||
extern int retval;
|
||||
|
||||
int
|
||||
__attribute__ ((visibility ("hidden")))
|
||||
func3 (void)
|
||||
{
|
||||
return retval;
|
||||
}
|
@ -157,7 +157,11 @@ set plugin_extra_elf_tests [list \
|
||||
-plugin-opt sym:${_}func3::0:3:0 \
|
||||
-plugin-opt dumpresolutions \
|
||||
-plugin-opt add:tmpdir/func.o \
|
||||
$testobjfiles $libs --verbose=2" "" "" {{ld plugin-12.d}} "main.x" ] \
|
||||
-plugin-opt add:tmpdir/func1p.o \
|
||||
-plugin-opt add:tmpdir/func2i.o \
|
||||
-plugin-opt add:tmpdir/func3h.o \
|
||||
$testobjfiles $libs --verbose=2" "" "" {{ld plugin-12.d} \
|
||||
{readelf -s plugin-vis-1.d}} "main.x" ] \
|
||||
]
|
||||
|
||||
if { !$can_compile || $failed_compile } {
|
||||
@ -174,7 +178,10 @@ if { !$can_compile || $failed_compile } {
|
||||
|
||||
run_ld_link_tests $plugin_tests
|
||||
|
||||
if { [is_elf_format] } {
|
||||
if { [is_elf_format] \
|
||||
&& [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func1p.c tmpdir/func1p.o] \
|
||||
&& [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func2i.c tmpdir/func2i.o] \
|
||||
&& [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func3h.c tmpdir/func3h.o] } {
|
||||
run_ld_link_tests $plugin_extra_elf_tests
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user