Skip to content

Commit 6ff0b50

Browse files
committed
Add the NonLazyBind attribute to rustllvm
This attribute informs LLVM to skip PLT calls in codegen.
1 parent c3a1a0d commit 6ff0b50

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/librustc_codegen_llvm/llvm/ffi.rs

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ pub enum Attribute {
122122
SanitizeThread = 20,
123123
SanitizeAddress = 21,
124124
SanitizeMemory = 22,
125+
NonLazyBind = 23,
125126
}
126127

127128
/// LLVMIntPredicate

src/rustllvm/RustWrapper.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ static Attribute::AttrKind fromRust(LLVMRustAttribute Kind) {
178178
return Attribute::SanitizeAddress;
179179
case SanitizeMemory:
180180
return Attribute::SanitizeMemory;
181+
case NonLazyBind:
182+
return Attribute::NonLazyBind;
181183
}
182184
report_fatal_error("bad AttributeKind");
183185
}

src/rustllvm/rustllvm.h

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ enum LLVMRustAttribute {
9797
SanitizeThread = 20,
9898
SanitizeAddress = 21,
9999
SanitizeMemory = 22,
100+
NonLazyBind = 23,
100101
};
101102

102103
typedef struct OpaqueRustString *RustStringRef;

0 commit comments

Comments
 (0)