-
Notifications
You must be signed in to change notification settings - Fork 31
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
contrib - visual studio 2015 integrated example #70
Comments
That's great! What about hosting the full example as new a project on e.g. GitHub? I will then add a link to it from flexdll documentation. |
Maybe... I don't know... I have more research to do first. I can't get my project to work right now. Some relocations are editing the PE header, seemingly due to not being offset by the position of the section (so the very small addresses within the section are used as absolute within the module image instead, making them on top of the PE header). My enthusiasm will rapidly deflate if I can't finally use this for what I need You're not in any chat room where we can collaborate, are you? I've been unable to decipher how these pointers are offset from the raw values taken from the object relocation entries so I can't figure out why, but something's causing sections with a certain structure to malfunction. I think the busted sections are all for certain comdats which are inline functions from the exe module, or certain types declared in the exe module (i have one type with three basically identical methods in it that is causing three of these strange relocations) I've tried /OPT:NOREF, disabling comdat folding, disabling incremental linking.. you name it. anything that could do something wacky to confuse flexdll. no luck. to me it looks like a hash collision kind of thing. On the function body? I just check two of those three functions mentioned in the prior paragraph and they have the same "RAW DATA" from dumpbin. Couldnt find a hash like that in flexlink. Still I'm suspicious MS's LINK is merging them somehow. I just checked several obj files "RAW DATA" for an offending section and it was all identical. |
Are you being to produce a standalone example, preferably using a simple build script? |
Unfortunately not so far. I'm going to have to transplant huge chunks of code. This could take a couple of days, and may never work :/ Unfortunately this project is a nice-to-have for me and I've spent nearly about all the time I can justify on it for now. But I would totally let you teamview to my PC and debug it with me. All I have is this cool screen shot. |
Oh, but I do have one question. Why are functions beginning with ?? eliminated? It means all the operators and constructors don't make it...... I had to disable that elimination logic. I don't know what the consequences are, but I expected them to be more numerous than the problem I'm having here (which is affecting about 8 out of 1000s of functions) |
This was introduced very early (commit f63184b) when porting to x64, but unfortunately I don't remember the details. (If you remove this logic, however, make sure to do something with the synthesized |
I guess I should have mentioned I have the same problems (unsure if identical data) on x64 and x86 both. Could still be due to my having ignored |
Had a wild idea. If I can contact you privately, I can supply a test case consisting of the obj files and scripts to produce a .dll which has the offending weird address circled above in it. Then you can debug flexlink to find out why it's getting there, without needing the sources or to run the built product. |
dlltest10.zip
Here I've made a visual studio 2015 integrated example of using flexdll.
Open the sln, set startup project to exe, and set debug working directory to
$(ProjectDir).run
You will now get working builds for debug/release & x86/x64. A working example prints this:
The project includes the latest master flexlink.exe build as of now (needed for x64 debugging reloc fixes); as well, I've had to rebuild the
flexdll_*.obj
using vs2015 toolchain (scripts for doing this are provided)The project also contains my program
linkwrap
which I think was required to get the nice VS/msbuild building semantics I wanted. Chiefly, it rips apart the response file provided to msvc'slink.exe
from VS and analyzes it to determine wordsize and lib/obj dependencies for passing to flexdll'sflexlink.exe
The vcxprojs have been modified simply to incorporate flexdll as an improved linker, by setting these things in the project:
Note: you cannot use link-time code generation with flexdll. It's on by default in vcxprojs; I have turned it off. This should come as no great surprise as it probably incorporates a great deal of inscrutable proprietary junk (the problem will manifest as some kind of a premature EOF error while reading a .obj input)
The test confirms the main functionality I was interested in:
TODO - I haven't tested this with additional library directories. I will probably need to update it for that. I just need to get a WIP committed, so that's what you're seeing here.
The text was updated successfully, but these errors were encountered: