[lld][MachO] Fix a think-o to get the twolevel/dynamic_lookup test passing.
llvm-svn: 248736
This commit is contained in:
parent
16c4da03d5
commit
9a4c94ec5a
|
@ -22,7 +22,7 @@ namespace mach_o {
|
|||
//
|
||||
class FlatNamespaceFile : public SharedLibraryFile {
|
||||
public:
|
||||
FlatNamespaceFile(const MachOLinkingContext &context, bool warnOnUndef)
|
||||
FlatNamespaceFile(const MachOLinkingContext &context)
|
||||
: SharedLibraryFile("flat namespace") { }
|
||||
|
||||
const SharedLibraryAtom *exports(StringRef name,
|
||||
|
|
|
@ -720,12 +720,10 @@ void MachOLinkingContext::createImplicitFiles(
|
|||
// Let writer add output type specific extras.
|
||||
writer().createImplicitFiles(result);
|
||||
|
||||
// If we're using flat namespace or undefinedMode is != error, add a
|
||||
// FlatNamespaceFile instance. This will provide a SharedLibraryAtom for
|
||||
// symbols that aren't defined elsewhere.
|
||||
if (useFlatNamespace() && undefinedMode() != UndefinedMode::error) {
|
||||
bool warnOnUndef = undefinedMode() == UndefinedMode::warning;
|
||||
result.emplace_back(new mach_o::FlatNamespaceFile(*this, warnOnUndef));
|
||||
// If undefinedMode is != error, add a FlatNamespaceFile instance. This will
|
||||
// provide a SharedLibraryAtom for symbols that aren't defined elsewhere.
|
||||
if (undefinedMode() != UndefinedMode::error) {
|
||||
result.emplace_back(new mach_o::FlatNamespaceFile(*this));
|
||||
_flatNamespaceFile = result.back().get();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 19.9 -twolevel_namespace -undefined dynamic_lookup %s -o %t %p/Inputs/libSystem.yaml
|
||||
# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 -twolevel_namespace -undefined dynamic_lookup %s -o %t %p/Inputs/libSystem.yaml
|
||||
#
|
||||
# Sanity check '-twolevel_namespace -undefined dynamic_lookup'.
|
||||
# This should pass without error, even though '_bar' is undefined.
|
||||
|
|
Loading…
Reference in New Issue