forked from rust-lang/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the
-yk-alloc-llvmbc-section
flag.
Enabling this flag does three things: - Adds the `SHF_ALLOC` flag to the `.llvmbc` section so that it gets loaded by the loader. - Makes the `llvm.embedded.module` symbol inside externally visible by giving it external linkage. - Prepends the embedded IR with a pointer-sized length field so that we can load the IR directly from memory at runtime. I was having issues finding a place to define the flag where it could be consistently accessed across the necessary module linkage boundaries. I've ended up defining it in `llvm/lib/Support`, which is an "always linked" component.
- Loading branch information
Showing
4 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include "llvm/Support/CommandLine.h" | ||
|
||
using namespace llvm; | ||
|
||
bool YkAllocLLVMBCSection; | ||
static cl::opt<bool, true> YkAllocLLVMBCSectionParser( | ||
"yk-alloc-llvmbc-section", cl::desc("Make the `.llvmbc` section loadable"), | ||
cl::NotHidden, cl::location(YkAllocLLVMBCSection)); |