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

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 5 22:35:44 PST 2020


grimar added a comment.

After revisiting this patch I have some more questions :]



================
Comment at: llvm/lib/InterfaceStub/ELFObjHandler.cpp:150
+    Entries[Index] = Entry;
+  }
+
----------------
Can't this be the following?

```
  void modifyAddr(size_t Index, uint64_t Addr) {
    Entries[Index].d_un.d_ptr = Addr;
  }
```

(the same below)


================
Comment at: llvm/lib/InterfaceStub/ELFObjHandler.cpp:233
+      uint16_t Shndx = Sym.Undefined ? SHN_UNDEF : 1;
+      DynSym.Content.add(StrTab.Content.getOffset(Sym.Name), Sym.Size, Bind,
+                         (uint8_t)Sym.Type, 0, Shndx);
----------------
I am not sure what is happening here. Could you explain?
Why a symbol is attached to `.text` and why it is assumed that `.text` has index 1?
Also, where it is tested?


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