Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions llvm/lib/IR/Mangler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ void llvm::emitLinkerFlagsForGlobalCOFF(raw_ostream &OS, const GlobalValue *GV,
const Triple &TT, Mangler &Mangler) {
if (GV->hasDLLExportStorageClass() && !GV->isDeclaration()) {

if (TT.isWindowsMSVCEnvironment())
if (TT.isWindowsMSVCEnvironment() || TT.isUEFI())
OS << " /EXPORT:";
else
OS << " -export:";

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

if (!GV->getValueType()->isFunctionTy()) {
if (TT.isWindowsMSVCEnvironment())
if (TT.isWindowsMSVCEnvironment() || TT.isUEFI())
OS << ",DATA";
else
OS << ",data";
Expand Down
Loading