[PATCH] [lld][ELF] add undefined atoms from dynamic library

Shankar Kalpathi Easwaran shankarke at gmail.com
Wed Apr 10 13:34:57 PDT 2013



================
Comment at: include/lld/Core/TargetInfo.h:317
@@ -330,2 +316,3 @@
+  std::vector<const char *> _llvmOptions;
 };
 } // end namespace lld
----------------
kledzik at apple.com wrote:
> Isn't there some way to run clang-format so as to only format the new code and not gratuitously changing the rest of the file?
Not sure about that, I will manually change the lines back.

================
Comment at: include/lld/Core/TargetInfo.h:177-182
@@ -186,1 +176,8 @@
+
+  /// This controls if undefined atoms need to be created for undefines that are
+  /// present in a SharedLibrary. If this option is set, undefined atoms are
+  /// created for every undefined symbol that are present in the dynamic table
+  /// in the shared library
+  bool useShlibUndefines() const { return _useShlibUndefines; }
   /// @}
+
----------------
kledzik at apple.com wrote:
> Why is useShlibUndefines() in the base TargetInfo? mach-o does not need it. I don't think it is needed for Windows DLLs. So it should be in ELFTargetInfo.
Ok, I thought all targets might need this. Will add to ELF only.

================
Comment at: test/elf/dynamic-undef.test:7
@@ +6,3 @@
+RUN:   %p/Inputs/shared.so-x86-64 -o %t -e main --noinhibit-exec 2> %t1
+RUN: FileCheck -check-prefix=EXEC %s < %t1
+# Test creation of shared library, this should pass because we are using 
----------------
kledzik at apple.com wrote:
> It would be better to not use --noinhibit-exec and verify that the link fails.  Then try again with --allow-shlib-undefined and verify the link succeeds.
Yes, thats better.


http://llvm-reviews.chandlerc.com/D642



More information about the llvm-commits mailing list