[PATCH] D107688: [JITLink][RISCV] Support GOT/PLT relocations

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 11 23:21:11 PDT 2021


lhames added inline comments.


================
Comment at: llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp:83
+    if (!GOTSection)
+      GOTSection = &G.createSection("$__GOT", sys::Memory::MF_READ);
+    return *GOTSection;
----------------
jrtc27 wrote:
> These look like Mach-O-isms, where sections are generally called `__FOO`. The ELF names for sections is normally `.foo`; e.g. the GOT is normally in a `.got` section. This does not make sense as an ELF section name. Assuming "stubs" here means PLT, it should be in a `.plt` section.
For now we're sticking to consistent names for synthetic sections, unless there's a concrete need to stick to format specifics -- this helps keep utility passes as simple as possible.

if ELF .got/.plt sections are referred to by name from other parts of the object that would be a good reason to change the names here, but I don't think that's supported?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107688



More information about the llvm-commits mailing list