[PATCH] D60324: [llvm-objcopy] Add switch to allow removing referenced sections

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 12:09:39 PDT 2019


grimar added inline comments.


================
Comment at: tools/llvm-objcopy/ELF/Object.cpp:440
+          "referenced by the symbol table %s",
+          SymbolNames->Name.data(), this->Name.data());
   return removeSymbols(
----------------
Perhaps also be consistent here?


```
if (ToRemove(SymbolNames)) {
    if (!AllowBrokenDependencies)
      return createStringError(
          llvm::errc::invalid_argument,
          "String table %s cannot be removed because it is "
          "referenced by the symbol table %s",
          SymbolNames->Name.data(), this->Name.data());

    SymbolNames = nullptr;
}
```


================
Comment at: tools/llvm-objcopy/ObjcopyOpts.td:13
+def allow_broken_dependencies
+    : Flag<["-", "--"], "allow-broken-dependencies">,
+      HelpText<"Allow llvm-objcopy to remove sections even if it would leave "
----------------
Not strong opinion here, but `allow-broken-dependencies` looks like a bit too long option name.
Will `allow-broken-deps`/`allow-broken-links` sound better?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60324/new/

https://reviews.llvm.org/D60324





More information about the llvm-commits mailing list