[PATCH] D89432: [llvm-elfabi] Emit ELF .dynsym and .dynamic sections

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 25 23:36:58 PDT 2020


grimar added inline comments.


================
Comment at: llvm/lib/InterfaceStub/ELFObjHandler.cpp:113
+
+public:
+  ELFSymbolTableBuilder() {
----------------
You can avoid having 2 `public:` areas by merging them.


================
Comment at: llvm/lib/InterfaceStub/ELFObjHandler.cpp:195
+           sizeof(Elf_Dyn));
+  }
+};
----------------
If you add `DT_NULL` explicitly in the code, then you can simplify these 2 methods to:


```
size_t getSize() const { return Entries.size() * sizeof(Elf_Dyn); }
 
void write(uint8_t *Buf) const { memcpy(Buf, Entries.data(), getSize()); }
```





Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89432



More information about the llvm-commits mailing list