[PATCH] D66419: [RISCV] Implement getExprForFDESymbol to ensure RISCV_32_PCREL is used for the FDE location

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 08:04:30 PDT 2019


asb created this revision.
asb added reviewers: luismarques, lenary, edward-jones.
Herald added subscribers: pzheng, s.egerton, Jim, benna, psnobl, jocewei, PkmX, rkruppe, the_o, brucehoult, MartinMosbeck, rogfer01, zzheng, MaskRay, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, apazos, simoncook, johnrusso, rbar, hiraditya.
Herald added a project: LLVM.

Follow binutils in using RISCV_32_PCREL for the FDE initial location. As explained in the relevant binutils commit <https://github.com/riscv/riscv-binutils-gdb/commit/a6cbf936e3dce68114d28cdf60d510a3f78a6d40> , the ADD/SUB pair of relocations is problematic in the presence of linker relaxation.

This patch has the same end goal as D64715 <https://reviews.llvm.org/D64715> but includes test changes and avoids adding a new global VariantKind to MCExpr.h (preferring RISCVMCExpr VKs like the rest of the RISC-V backend).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66419

Files:
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.h
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h
  llvm/test/MC/RISCV/fde-reloc.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66419.215902.patch
Type: text/x-patch
Size: 4766 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190819/c0781dbd/attachment.bin>


More information about the llvm-commits mailing list