diff --git a/lld/lib/Driver/WinLinkDriver.cpp b/lld/lib/Driver/WinLinkDriver.cpp index f4e32b399434..71f9cfd17ea5 100644 --- a/lld/lib/Driver/WinLinkDriver.cpp +++ b/lld/lib/Driver/WinLinkDriver.cpp @@ -361,10 +361,10 @@ static bool parseManifestUAC(StringRef option, } } -// Parse /export:entryname[=internalname][,@ordinal[,NONAME]][,DATA]. +// Parse /export:entryname[=internalname][,@ordinal[,NONAME]][,DATA][,PRIVATE]. // -// MSDN doesn't say anything about /export:foo=bar style option, -// but link.exe actually accepts it. +// MSDN doesn't say anything about /export:foo=bar style option or PRIVATE +// attribtute, but link.exe actually accepts them. static bool parseExport(StringRef option, PECOFFLinkingContext::ExportDesc &ret) { StringRef name; @@ -396,6 +396,10 @@ static bool parseExport(StringRef option, ret.isData = true; continue; } + if (arg.equals_lower("private")) { + ret.isPrivate = true; + continue; + } if (arg.startswith("@")) { int ordinal; if (arg.substr(1).getAsInteger(0, ordinal)) diff --git a/lld/test/pecoff/export.test b/lld/test/pecoff/export.test index f8e75bf605d8..007698198ec0 100644 --- a/lld/test/pecoff/export.test +++ b/lld/test/pecoff/export.test @@ -73,7 +73,7 @@ DUP-NOT: 1 0x2010 exportfn8 # RUN: yaml2obj %p/Inputs/export.obj.yaml > %t.obj # # RUN: lld -flavor link /out:%t1.dll /dll /entry:init \ -# RUN: /export:f1=exportfn1 /export:f2=exportfn2 -- %t.obj +# RUN: /export:f1=exportfn1 /export:f2=exportfn2,private -- %t.obj # RUN: llvm-objdump -p %t1.dll | FileCheck -check-prefix=EQUAL %s EQUAL: Export Table: