-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
dynamic linking: Weakly defined functions are not handled correctly #13773
Comments
sbc100
added a commit
that referenced
this issue
Mar 26, 2021
Currently we don't support weakly defined functions that exist in both the main and the side module. See #13773
It looks like function addresses and data addresses are already correctly handled, its only direct calls that seem to be a problem. |
WIP fix on the llvm side: https://reviews.llvm.org/D108060 |
sbc100
added a commit
that referenced
this issue
Aug 20, 2021
This test was inadvertently relying on an bug in llvm which was recently fixed: #13773 In this test the class `Class` is defined in both the main and the side module. If you run this code as is on the desktop the version of `Class` defined in `main.cpp` will always win the `side init` will never get printed. The fix is to give the class in the side module a different name (and alternative would be to make it visitibility hidden or static). This change should allow the llvm fix to roll in: https://reviews.llvm.org/D108413
sbc100
added a commit
that referenced
this issue
Aug 20, 2021
This test was inadvertently relying on an bug in llvm which was recently fixed: #13773 In this test the class `Class` is defined in both the main and the side module. If you run this code as is on the desktop the version of `Class` defined in `main.cpp` will always win the `side init` will never get printed. The fix is to give the class in the side module a different name (and alternative would be to put it in an anonymous namespace). This change should allow the llvm fix to roll in: https://reviews.llvm.org/D108413
sbc100
added a commit
that referenced
this issue
Aug 20, 2021
This test was inadvertently relying on an bug in llvm which was recently fixed: #13773 In this test the class `Class` is defined in both the main and the side module. If you run this code as is on the desktop the version of `Class` defined in `main.cpp` will always win the `side init` will never get printed. The fix is to give the class in the side module a different name (and alternative would be to put it in an anonymous namespace). This change should allow the llvm fix to roll in: https://reviews.llvm.org/D108413
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If that same symbol is weakly defined in two different dynamic modules we could expect the runtime dynamic linker to pick just one.
Sadly, this doesn't seem to work today and the each module will end up calling its own local function.
Somewhat similar to #12819.
The text was updated successfully, but these errors were encountered: