[PATCH] D55629: [elfabi] Add support for reading DT_SONAME from binaries

Armando Montanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 7 17:02:23 PST 2019


amontanez marked an inline comment as done.
amontanez added inline comments.


================
Comment at: llvm/test/tools/llvm-elfabi/binary-read-arch.test:16-19
+    Content:         "0a0000000000000001000000000000000500000000000000b80200000000000000000000000000000000000000000000"
+      # DT_STRSZ      1 (0x1)
+      # DT_STRTAB     0x02b8
+      # DT_NULL       0x0
----------------
jhenderson wrote:
> I would whole-heartedly support extending yaml2obj to allow for dynamic tags to be specified in a more readable format, possibly similar to how relocations or symbols are written?
I agree, after working on theses tests for a while I think something to assist populating .dynamic is in order. Keeping the content and comments consistent becomes rather tedious. I'll get to that asap so it can precede this patch.


================
Comment at: llvm/tools/llvm-elfabi/ELFObjHandler.cpp:135
+
+    if (Addr >= Entry.p_vaddr &&
+        Addr < Entry.p_vaddr + Entry.p_filesz) {
----------------
jakehehrlich wrote:
> You can just do `Addr >= Entry.p_vaddr && Addr + Size < Entry.p_vaddr + Entry.file_sz`
I've split it this way so there's a distinction between
 - an address not covered by any PT_LOAD
 - an address range partially covered by a PT_LOAD

While it's not super useful for the typical binary, it's helpful for correctly designing tests.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D55629





More information about the llvm-commits mailing list