forked from OSchip/llvm-project
[Object] Also treat STB_GNU_UNIQUE symbols as exported to other DSO
All of STB_GLOBAL/STB_WEAK/STB_GNU_UNIQUE are treated as export symbols, see: glibc/elf/dl-lookup.c:do_lookup_x musl/ldso/dynlink.c OK_BINDS Though ld.so does not read binding, the currently used STV_DEFAULT or STV_PROTECTED is a good emulation of linker behavior. llvm-svn: 347481
This commit is contained in:
parent
46acc72cf4
commit
32ebd73127
|
@ -333,9 +333,10 @@ protected:
|
|||
// A symbol is exported if its binding is either GLOBAL or WEAK, and its
|
||||
// visibility is either DEFAULT or PROTECTED. All other symbols are not
|
||||
// exported.
|
||||
return ((Binding == ELF::STB_GLOBAL || Binding == ELF::STB_WEAK) &&
|
||||
(Visibility == ELF::STV_DEFAULT ||
|
||||
Visibility == ELF::STV_PROTECTED));
|
||||
return (
|
||||
(Binding == ELF::STB_GLOBAL || Binding == ELF::STB_WEAK ||
|
||||
Binding == ELF::STB_GNU_UNIQUE) &&
|
||||
(Visibility == ELF::STV_DEFAULT || Visibility == ELF::STV_PROTECTED));
|
||||
}
|
||||
|
||||
// This flag is used for classof, to distinguish ELFObjectFile from
|
||||
|
|
Loading…
Reference in New Issue