apolukhin / Boost.DLL

Library for comfortable work with DLL and DSO
https://boost.org/libs/dll
109 stars 69 forks source link

PROTECTED visibility should be listed on symbols since they are exported #56

Closed slnj closed 3 years ago

slnj commented 3 years ago

Dear developers,

We are using dll boost project to access shared libraries symbols on Linux EL7 (ELF) We notice that we symbols with PROTECTED visibility attribute are not listed on library_info symbols. Protected symbols are exported and can be accessed when loading shared libraries using dlopen/dlsym, so I understand they should be included on symbols list retrieved using library_info.

We try changing is_visible method on dll/detail/elf_info.hpp, and changing the condition to: return ((sym.st_other & 0x03) == STV_DEFAULT_ || (sym.st_other & 0x03) == STV_PROTECTED_ ) && (sym.st_info >> 4) != STB_LOCAL_ && !!sym.st_size; and it seems to work.

Can you please review this? Regards

apolukhin commented 3 years ago

Fixed in b053729bfba895808f7ce1c0722fee0cda813a93

Many thanks for the bug report and for the proposed fix!