Skip to content

Commit d1c6b77

Browse files
committed
[llvm] Linker flags for UEFI
Use appropriate linker flag format to match PE spec for UEFI.
1 parent 1a6b041 commit d1c6b77

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/IR/Mangler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,15 @@ void llvm::emitLinkerFlagsForGlobalCOFF(raw_ostream &OS, const GlobalValue *GV,
215215
const Triple &TT, Mangler &Mangler) {
216216
if (GV->hasDLLExportStorageClass() && !GV->isDeclaration()) {
217217

218-
if (TT.isWindowsMSVCEnvironment())
218+
if (TT.isWindowsMSVCEnvironment() || TT.isUEFI())
219219
OS << " /EXPORT:";
220220
else
221221
OS << " -export:";
222222

223223
bool NeedQuotes = GV->hasName() && !canBeUnquotedInDirective(GV->getName());
224224
if (NeedQuotes)
225225
OS << "\"";
226-
if (TT.isWindowsGNUEnvironment() || TT.isWindowsCygwinEnvironment()) {
226+
if (TT.isWindowsGNUEnvironment() || TT.isWindowsCygwinEnvironment() || TT.isUEFI()) {
227227
std::string Flag;
228228
raw_string_ostream FlagOS(Flag);
229229
Mangler.getNameWithPrefix(FlagOS, GV, false);
@@ -249,7 +249,7 @@ void llvm::emitLinkerFlagsForGlobalCOFF(raw_ostream &OS, const GlobalValue *GV,
249249
OS << "\"";
250250

251251
if (!GV->getValueType()->isFunctionTy()) {
252-
if (TT.isWindowsMSVCEnvironment())
252+
if (TT.isWindowsMSVCEnvironment() || TT.isUEFI())
253253
OS << ",DATA";
254254
else
255255
OS << ",data";

0 commit comments

Comments
 (0)