[lld] r248736 - [lld][MachO] Fix a think-o to get the twolevel/dynamic_lookup test passing.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 13:52:23 PDT 2015


Author: lhames
Date: Mon Sep 28 15:52:21 2015
New Revision: 248736

URL: http://llvm.org/viewvc/llvm-project?rev=248736&view=rev
Log:
[lld][MachO] Fix a think-o to get the twolevel/dynamic_lookup test passing.

Modified:
    lld/trunk/lib/ReaderWriter/MachO/FlatNamespaceFile.h
    lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
    lld/trunk/test/mach-o/twolevel_namespace_undef_dynamic_lookup.yaml

Modified: lld/trunk/lib/ReaderWriter/MachO/FlatNamespaceFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/FlatNamespaceFile.h?rev=248736&r1=248735&r2=248736&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/FlatNamespaceFile.h (original)
+++ lld/trunk/lib/ReaderWriter/MachO/FlatNamespaceFile.h Mon Sep 28 15:52:21 2015
@@ -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,

Modified: lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp?rev=248736&r1=248735&r2=248736&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp Mon Sep 28 15:52:21 2015
@@ -720,12 +720,10 @@ void MachOLinkingContext::createImplicit
   // 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();
   }
 }

Modified: lld/trunk/test/mach-o/twolevel_namespace_undef_dynamic_lookup.yaml
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/mach-o/twolevel_namespace_undef_dynamic_lookup.yaml?rev=248736&r1=248735&r2=248736&view=diff
==============================================================================
--- lld/trunk/test/mach-o/twolevel_namespace_undef_dynamic_lookup.yaml (original)
+++ lld/trunk/test/mach-o/twolevel_namespace_undef_dynamic_lookup.yaml Mon Sep 28 15:52:21 2015
@@ -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.




More information about the llvm-commits mailing list