-
Notifications
You must be signed in to change notification settings - Fork 34
[Bug] Disambiguate symbol names by module address #303
Comments
The problem is that rbpf has a maximum symbol name length of 64 bytes (SYMBOL_NAME_LENGTH_MAXIMUM) and my patch happens to put some symbols over that number. Rust generates some huge symbols though, so I wonder if there is some post-processing step solana does to rust binaries to change symbol names. |
Solana strips symbols from loadable binaries. |
I mentioned in #345 that running I'm a little stumped again. The dynsym table in the mvector03 test looks in part like this:
These names are getting too long for rbpf to accept. I wonder if we need to LTO everything and make a bunch of these symbols internal. Maybe then they wouldn't need relocations. (Or rather, I wonder if that is how cargo-build-sbf is avoiding huge symbols in rust's relocations). |
That was an issue before I changed default visibility of symbols generated by rust compiler to hidden. Now all of the symbols that come from rust std library should not need dynamic relocation. I think by now only the unresolved symbols of Solana syscalls should need dynamic relocations. Are you using the new platform-tools version 1.38?.. |
I am not sure how to tell what version of platform tools I am using. The issue is not in rustc-generated code though. The symbols coming out of our move llvm backend are too large. |
Yes, move-native symbols can exceed 64 characters length. We probably have to keep them short or somehow use fixed length hashes in-place of actual function names in the generated code (not sure how this could be implemented though). |
In #289 I mentioned that we have problems with symbol name collisions when two functions in different modules have the same names.
The obvious solution to this is to include the unique module address in symbol names.
I have attempted to do this in https://github.com/brson/move/tree/symbol-names, but so far not completely succeeded. That branch has two rbpf-tests cases that fail to load because of "InvalidAccountData".
The text was updated successfully, but these errors were encountered: