[llvm-commits] [patch] Identifying code sections in MCJIT

Tim Northover t.p.northover at gmail.com
Tue Dec 11 05:23:28 PST 2012


Hi,

After investigating why adding mapping symbols on ARM (r169609) caused
segfaults in the MCJIT, I discovered that the .text section wasn't
being allocated as code in the MemoryManager, and hence wasn't being
marked executable before jumping there.

This was because RuntimeDyldImpl::loadObject was choosing the type
based on whether the first symbol it encountered in that section was
ST_Function or not. Previously it was, but now the mapping symbols
(required to have STT_NOTYPE) are seen first and .text is
misclassified.

This patch instead uses the SectionRef method "isText" to make that
decision. It parallels what RuntimeDyldELF does while processing
DWARF, and would seem to be a more sensible API anyway.

Is this correct for MachO too, and is the patch OK to commit?

Cheers.

Tim.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: identify-code-section.diff
Type: application/octet-stream
Size: 1513 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121211/756cd4ee/attachment.obj>


More information about the llvm-commits mailing list