mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-03 04:12:10 +08:00
1b1fe8feb3
2003-04-27 H.J. Lu <hjl@gnu.org> * elf-bfd.h (ELF_LINK_DYNAMIC_DEF): New. (ELF_LINK_DYNAMIC_WEAK): New. * elflink.h (elf_merge_symbol): Add one argument to indicate if a symbol should be skipped. Ignore definitions in dynamic objects for symbols with non-default visibility. (elf_add_default_symbol): Adjusted. (elf_link_add_object_symbols): Check if a symbol should be skipped. Don't merge the visibility field with the one from a dynamic object. (elf_link_check_versioned_symbol): Use undef_bfd. (elf_link_output_extsym): Warn if a forced local symbol is referenced from dynamic objects. Make non-weak undefined symbol with non-default visibility a fatal error. ld/testsuite/ 2003-04-27 H.J. Lu <hjl@gnu.org> * ld-elfvsb/elfvsb.dat: Updated. * ld-elfvsb/elfvsb.exp: Likewise. * ld-elfvsb/main.c: Likewise. * ld-elfvsb/sh1.c: Likewise. * ld-elfvsb/sh2.c: Likewise.
47 lines
754 B
C
47 lines
754 B
C
/* This is part of the shared library ld test. This file becomes part
|
|
of a shared library. */
|
|
|
|
/* This variable is defined here, and referenced by another file in
|
|
the shared library. */
|
|
int shlibvar2 = 4;
|
|
|
|
/* This variable is defined here, and shouldn't be used to resolve a
|
|
reference with non-default visibility in another shared library. */
|
|
int visibility_com = 2;
|
|
|
|
/* This function is called by another file in the shared library. */
|
|
|
|
int
|
|
shlib_shlibcalled ()
|
|
{
|
|
return 5;
|
|
}
|
|
|
|
#ifdef DSO_DEFINE_TEST
|
|
int
|
|
visibility ()
|
|
{
|
|
return 2;
|
|
}
|
|
|
|
int visibility_var = 2;
|
|
|
|
int visibility_def = 2;
|
|
|
|
int
|
|
visibility_func ()
|
|
{
|
|
return 2;
|
|
}
|
|
#endif
|
|
|
|
#ifdef HIDDEN_WEAK_TEST
|
|
int visibility_var_weak = 2;
|
|
|
|
int
|
|
visibility_func_weak ()
|
|
{
|
|
return 2;
|
|
}
|
|
#endif
|