[PATCH] D107280: [RISCV] Lower extern_weak symbols using the GOT for the medany model

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 22:25:40 PDT 2023


MaskRay accepted this revision.
MaskRay added a comment.

Looks great!



================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:2736
+      // Extern weak symbols must be addressed indirectly as 0 may not be
+      // within 2GiB of PC. This generates the pattern (PseudoLA sym), which
+      // expands to (ld (addi (auipc %got_pcrel_hi(sym)) %pcrel_lo(auipc))).
----------------
jrtc27 wrote:
> MaskRay wrote:
> > PseudoLGA
> Already spotted and fixed :)
`Extern weak symbols, if unresolved, must be addressed indirectly ...`

`extern_weak` is the IR representation related to the current module. Another TU may provide a definition. The original sentence is imprecise.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107280



More information about the llvm-commits mailing list