Jörg Blank
2013-Dec-27 22:26 UTC
[LLVMdev] Patchpoint and Stackmap Instrinsics on Linux/ELF
Hello, I'm currently looking into integrating the patchpoint and stackmap intrinsics into my pet project. In their current implementation (3.4 and trunk) the code to emit the additional section is only executed on Darwin. This is however quickly fixed: Add a ".llvm_stackmaps"-Section for ELF in MCObjectFileInfo and execute StackMaps::serializeToStackMapSection in X86AsmPrinter in the ELF-Branch. serializeToStackMapSection writes the information using MCStreamer, which seems to work properly. I'm using MCJIT with a custom memory manager to intercept the stackmap datasection, but no memory is allocated for this purpose. I'd be grateful, if someone more knowledgeable could help me out. Regards, Jörg Blank -------------- next part -------------- A non-text attachment was scrubbed... Name: elf_stackmaps.patch Type: text/x-patch Size: 1804 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131227/e69833b0/attachment.bin>
Tim Northover
2013-Dec-28 10:45 UTC
[LLVMdev] Patchpoint and Stackmap Instrinsics on Linux/ELF
Hi Jörg,> serializeToStackMapSection writes the information using MCStreamer, > which seems to work properly. > I'm using MCJIT with a custom memory manager to intercept the stackmap > datasection, but no memory is allocated for this purpose.I think the ELF MCJIT decides whether to load a section for runtime based on whether it has the SHF_ALLOC flag set, which your patch doesn't seem to set. If you're lucky that'll make everything spring to life. Cheers. Tim.
Jörg Blank
2013-Dec-28 11:44 UTC
[LLVMdev] Patchpoint and Stackmap Instrinsics on Linux/ELF
Hi Tim, That was, in fact, the solution. Thanks. Joerg Am 28.12.2013 11:45, schrieb Tim Northover:> Hi Jörg, > >> serializeToStackMapSection writes the information using MCStreamer, >> which seems to work properly. >> I'm using MCJIT with a custom memory manager to intercept the stackmap >> datasection, but no memory is allocated for this purpose. > > I think the ELF MCJIT decides whether to load a section for runtime > based on whether it has the SHF_ALLOC flag set, which your patch > doesn't seem to set. If you're lucky that'll make everything spring to > life. > > Cheers. > > Tim. >