]> granicus.if.org Git - llvm/commit
[RISCV] Implement getExprForFDESymbol to ensure RISCV_32_PCREL is used for the FDE...
authorAlex Bradbury <asb@lowrisc.org>
Tue, 20 Aug 2019 12:32:31 +0000 (12:32 +0000)
committerAlex Bradbury <asb@lowrisc.org>
Tue, 20 Aug 2019 12:32:31 +0000 (12:32 +0000)
commitefea2847860eedae9dd6fabdc44193f6795eb4d6
treef63e50983e9746e13782523d3f3a83be63a35e52
parent01410fc2a6ea9d5bef7db124ef24fec15eae8a25
[RISCV] Implement getExprForFDESymbol to ensure RISCV_32_PCREL is used for the FDE location

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 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).

Differential Revision: https://reviews.llvm.org/D66419

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369375 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp
lib/Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.cpp
lib/Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.h
lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h
test/MC/RISCV/fde-reloc.s