[PATCH] enable stackmap generation for ELF

Kaylor, Andrew andrew.kaylor at intel.com
Tue Dec 17 11:43:03 PST 2013


RuntimeDyldELF uses ObjectFile::isSectionRequiredForExecution to determine whether or not it needs to allocate memory for a section.  In the case of an ELF object, this method looks for the SHF_ALLOC flag.  If the section needs to be loaded, that bit needs to be set.  This logic is used to avoid loading debug sections into memory and such.

Looking forward, it seems like MCJIT should be capable of discarding the emitted image after everything has been loaded.  At the very least some clients are moving generated code to another location and deleting MCJIT, which results in the emitted object being discarded. This is something to keep in mind when deciding what to do with the section.

-Andy

From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Lang Hames
Sent: Tuesday, December 17, 2013 11:11 AM
To: Andrew Trick
Cc: llvm commits
Subject: Re: [PATCH] enable stackmap generation for ELF

Hi Kevin, Andy,

> ... I had originally not added the SHF_ALLOC flag to the section which meant that it didn't get allocated through the MemoryManager at all, but regardless it still ends up in the emitted object file.

The StackMap section not getting allocated through the MemoryManager might be considered a bug, regardless of the SHF_ALLOC setting. I'm going to discuss that with some people who are more familiar with MemoryManager.

Ideally, the stack map section should not need to be loaded. i.e. it would be nice to avoid making a copy of it. But the MCJIT client does not necessarily know how to parse the object format, so I don't know if WebKit could use an event listener. Maybe Lang can answer this better.

For now I'd say "whatever works". I'm doing some investigation now to try to figure out the right way to deal with this going forward - the deprecation of the old JIT may mean that some of this infrastructure changes or goes away.

- Lang.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131217/bca1e004/attachment.html>


More information about the llvm-commits mailing list