-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Issue 4014 - CodeView debug type info not linked in from library #4051
Conversation
I am not understanding exactly what this is doing.
|
It is written with the struct declaration https://github.com/D-Programming-Language/dmd/blob/master/src/toobj.c#L853
s.init happens to be generated into the same object file as the debug info. https://github.com/D-Programming-Language/dmd/blob/master/src/toobj.c#L875
What do you mean by "normal reference"? Where would that be? I just need a few bytes of data inside the debug info that are mostly ignored. These bytes are the target of a relocation to S.init that causes the debug info to be dragged in by the linker. (A cleaner approach is probably to add a PUBDEF symbol to the debug info and add the relocation to this). S_LABEL32 is a record that seems unused by the debugger. As I mentioned in the description, defining our own ID that is unlikely to collide with exisitng records might be ignored even better. Unfortunately, the OEM records are only for types, not for symbols. |
Quoting from #398: I changed my mind over this, it will cause a lot of link errors when building against a library witthout debug symbols. The init symbol still exists in the release library, so no harm done apart from being unable to debug that part of the application. |
Concept makes sense, Istill have to look a bit closer at the implementation. |
Fixed and rebased. |
Rebased. I have now replaced S_LABEL32 with S_SKIP, this should remove possible side effects. |
Closing in favor of #6908 |
https://issues.dlang.org/show_bug.cgi?id=4014
This PR adds a relocation to S.init if S is referred to by the debug info. It assumes the debug info is found there and will be linked in if S.init is linked in.
Currently only implemented for Win32/Win64.
This is an alternative to #398
Advantages:
Disadvantages:
abuses S_LABEL32 debug record, maybe some other unrecognized record is better