diff options
author | Alex Bradbury <asb@lowrisc.org> | 2019-08-19 13:23:02 +0000 |
---|---|---|
committer | Alex Bradbury <asb@lowrisc.org> | 2019-08-19 13:23:02 +0000 |
commit | 1c1f8f215d89f1946ec4942c0d4ce8d4bd4f33f3 (patch) | |
tree | dca263db46939350a48e0bc31f8791352ad2f999 /llvm/lib | |
parent | 88df53e6eaf355271e90fa928df53ab6ea244a69 (diff) | |
download | bcm5719-llvm-1c1f8f215d89f1946ec4942c0d4ce8d4bd4f33f3.tar.gz bcm5719-llvm-1c1f8f215d89f1946ec4942c0d4ce8d4bd4f33f3.zip |
[RISCV] Don't force absolute FK_Data_X fixups to relocs
The current behavior of shouldForceRelocation forces relocations for the
majority of fixups when relaxation is enabled. This makes sense for
fixups which incorporate symbols but is unnecessary for simple data
fixups where the fixup target is already resolved to an absolute value.
Differential Revision: https://reviews.llvm.org/D63404
Patch by Edward Jones.
llvm-svn: 369257
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp index 9d94be12635..61c5845cc17 100644 --- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp +++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp @@ -33,6 +33,13 @@ bool RISCVAsmBackend::shouldForceRelocation(const MCAssembler &Asm, switch ((unsigned)Fixup.getKind()) { default: break; + case FK_Data_1: + case FK_Data_2: + case FK_Data_4: + case FK_Data_8: + if (Target.isAbsolute()) + return false; + break; case RISCV::fixup_riscv_got_hi20: case RISCV::fixup_riscv_tls_got_hi20: case RISCV::fixup_riscv_tls_gd_hi20: |