Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symbols.map: ODR violations #3652

Open
jengelh opened this issue Oct 31, 2024 · 0 comments
Open

symbols.map: ODR violations #3652

jengelh opened this issue Oct 31, 2024 · 0 comments

Comments

@jengelh
Copy link

jengelh commented Oct 31, 2024

$ nm libmirserver.so.61
0000000000338568 b _ZZNSt19_Sp_make_shared_tag5_S_tiEvE5__tag

Hiding symbols is a problem, as this precludes the linker from collapsing multiple definitions of the same symbol, and breaking the One Definition Rule. In practice, this affects e.g. glibc's std::string::_M_dispose, which references a static variable:

if (this == &_S_empty_rep())

Because address comparisons no longer return expected results, that particular spot ends up calling the wrong deallocator and corrupts the program state.

The following symbols must be unhidden:

std::*::_S_*;
guard?variable?for?std::*;
typeinfo?for?std::*;
VTT?for?std::*;
construction?vtable?for?std::*;
vtable?for?std::*;
non-virtual?thunk?to?std::*;
virtual?thunk?to?std::*;

This needs to happen for a bunch of libraries, so:

  • std::
  • boost::
  • YAML:: (used by libmiral)

Furthermore, tools/symbols_map_generator/main.py also needs to insert construction vtable for ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant