[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 05:40:51 PDT 2019


grimar added inline comments.


================
Comment at: test/tools/llvm-objcopy/ELF/reloc-error-remove-symtab.test:41
+# SECTIONS:        Link
+# SECTIONS-SAME: : 0
----------------
Why not just `SECTIONS: Link: 0`?


================
Comment at: tools/llvm-objcopy/ELF/Object.cpp:566
+          "referenced by the relocation section %s.",
+          Symbols->Name.data(), this->Name.data());
 
----------------
It is a bit hard to follow `if`s it seems, I would suggest adding bracers,
like you did for `removeSectionReferences` or
or may be even doing something like next for better readability:

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

    Symbols = nullptr;
  }
```


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