[PATCH] D12226: [LLD] Support for --unresolved-symbols option in llvm lld for ELF file format

Soumitra Chatterjee via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 03:56:43 PDT 2015


soumitra added inline comments.

================
Comment at: include/lld/Core/LinkingContext.h:167
@@ +166,3 @@
+  /// and executable to be an error.
+  uint8_t unresolvedSymbols() { return _unresolvedSymbols; }
+
----------------
Return type should be the enumeration type, and not the size specifier.

================
Comment at: include/lld/Core/LinkingContext.h:217
@@ -199,2 +216,3 @@
   void setAllowShlibUndefines(bool allow) { _allowShlibUndefines = allow; }
+  void setUnresolvedSymbols(uint8_t value) { _unresolvedSymbols = value; }
   void setLogInputFiles(bool log) { _logInputFiles = log; }
----------------
Parameter type should be the enumeration type and not the size specifier.

================
Comment at: include/lld/Core/LinkingContext.h:361
@@ -342,2 +360,3 @@
   bool _allowShlibUndefines;
+  uint8_t _unresolvedSymbols;
   OutputFileType _outputFileType;
----------------
Member should have the enumeration type, not the size specifier.

================
Comment at: lib/Core/LinkingContext.cpp:28
@@ -27,2 +27,3 @@
       _logInputFiles(false), _allowShlibUndefines(true),
-      _outputFileType(OutputFileType::Default), _nextOrdinal(0) {}
+      _unresolvedSymbols(0), _outputFileType(OutputFileType::Default),
+      _nextOrdinal(0) {}
----------------
I would recommend using elf::DEFAULT for the initialization.

================
Comment at: lib/Core/Resolver.cpp:469
@@ +468,3 @@
+
+    case elf::UnresolvedSymbols::IGNORE_IN_OBJECT_FILES:
+      // if the unresolved symbol is from shared library report it
----------------
This should ideally be a fall-through case along with the case for 'IGNORE_ALL'.


http://reviews.llvm.org/D12226





More information about the llvm-commits mailing list