[PATCH] Make it easier to use DwarfContext with MCJIT and add RelocVisitor support for Darwin
kfischer at college.harvard.edu
Tue Jan 13 16:15:12 PST 2015
Hi lhames, echristo,
This supersedes http://reviews.llvm.org/D4010, hopefully properly dealing with the JIT case and also adds an actual test case. DwarfContext was basically already usable for the JIT (and back when we were overwriting ELF files it actually worked out of the box by accident), but in order to resolve relocations correctly it needs to know the load address of the section. Rather than trying to get this out of the ObjectFile or requiring the user to create a new ObjectFile just to get some debug info, this adds the capability to pass in that info directly. As part of this I separated out part of the LoadedObjectInfo struct from RuntimeDyld, since it is now required add a higher layer. For now I put that in ObjectFile.h, but I would be happy to receive suggestions for more appropriate places.
I also adjusted the line info handling in the dwarf code slightly, based on a problem I saw with the test case. Since addr+size will give the first address past the end of the function, we need to back up one line table entry. However, if we are doing the comparison with `<` rather than `<=`, we actually end up with the second entry past the end of the current function, if the next function starts at exactly addr+size (the first entry for the next function is at addr+size, so the next entry greater than it is the second entry for the next function). This comes up on MachO much more than on ELF, since MachO doesn't store the symbol size separately, hence making said situation always occur.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 23868 bytes
Desc: not available
More information about the llvm-commits