[LLVMdev] [MCJIT] Multiple GOT handling in RuntimeDyldELF

Keno Fischer kfischer at college.harvard.edu
Sun Jan 18 05:38:11 PST 2015


Hello everyone,

As part of my quest to add TLS relocation support to MCJIT, I've been
taking a closer look at the GOT implementation in RuntimeDyldELF and I
believe that is not valid as currently implemented. In particular, I am
wondering about the multiple GOT handling support introduced in r192020. If
I understand correctly this can make code reuse the GOT table entry in a
different object file. This doesn't seem correct to me as there is no
guarantee that the loaded object files are allocated within 2GB of each
other in memory. What was the intended use case of this feature?
Additionally, it seems that currently every access through the GOT get it's
own entry, when identical relocations could be combined into one entry. The
GOTEntries array is also never cleared, causing memory and performance
problems when loading multiple object files (this is a bug and easily
fixed, but makes me think this feature isn't particularly well tested). I'm
planning to redesign the GOT mechanism, but I would like to understand the
use case intended in r192020 first, to make sure I don't design myself into
a corner.

Thanks,
Keno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150118/0a973cbb/attachment.html>


More information about the llvm-dev mailing list