llvm-project/llvm/lib/Target/RISCV/MCTargetDesc
Fangrui Song 2f5fe16e6d [RISCV][MC] Adjust conditions to emit R_RISCV_ADD*/R_RISCV_SUB* pairs
D132262 tried to simplify `IsMetadataOrEHFrameSection` originally introduced in
D127549 but caused a regression as `.quad` directives in

```
.section .note,"a",@note; note:
.quad extern-note    # extern is undefined

.section .rodata,"a",@progbits; rodata:
.quad extern-rodata  # extern is undefined

.section .nonalloc,"",@progbits; nw:
.quad extern-nw
```

are incorrectly rejected: these differences may be link-time constants and
are allowed in GNU assembler and LLVM MC's non-RISC-V ports.

Relax the conditions to allow these cases. For A-B, A may be defined later, but
this requiresFixups call has to eagerly make a decision. For now, emit ADD/SUB
unless A is `.L*`. This euristic handles many temporary label differences for
.debug_* and .apple_types sections. Ideally we should delay the decision of
PC-relative vs ADD/SUB until A is defined.

Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D145474
2023-03-14 15:17:38 -07:00
..
CMakeLists.txt [Support] Move TargetParsers to new component 2022-12-20 11:05:50 +00:00
RISCVAsmBackend.cpp [RISCV] Use MCSubtargetInfo::hasFeature where possible. NFC 2023-02-17 14:36:48 -08:00
RISCVAsmBackend.h [MC] llvm::Optional => std::optional 2022-12-04 21:36:08 +00:00
RISCVBaseInfo.cpp [RISCV] Merge getLoadFP*Imm into a single function. 2023-03-14 13:11:11 -07:00
RISCVBaseInfo.h [RISCV] Merge getLoadFP*Imm into a single function. 2023-03-14 13:11:11 -07:00
RISCVELFObjectWriter.cpp RISCVELFObjectWriter: de-capitalize some error messages 2023-03-06 21:50:19 -08:00
RISCVELFStreamer.cpp [RISCV][MC] Adjust conditions to emit R_RISCV_ADD*/R_RISCV_SUB* pairs 2023-03-14 15:17:38 -07:00
RISCVELFStreamer.h [RISCV][NFCI] Use common MCELFStreamer code for attribute emission 2023-03-12 16:11:12 +00:00
RISCVFixupKinds.h [RISCV] Move RISCVELFStreamer::getRelocPairForSize to RISCVFixUpKinds.h and reuse it. NFC 2023-01-31 13:10:13 -08:00
RISCVInstPrinter.cpp [RISCV] Print Zfa fli instruction FP values in a more adaptive way. 2023-03-10 07:57:44 -08:00
RISCVInstPrinter.h [RISCV][MC] Add FLI instruction support for the experimental zfa extension 2023-03-07 14:06:01 +08:00
RISCVMatInt.cpp [RISCV] Use llvm::rotl (NFC) 2023-02-13 20:16:48 -08:00
RISCVMatInt.h [RISCV] Add accessors to RISCVMatInt::Inst. 2022-12-07 19:02:01 -08:00
RISCVMCAsmInfo.cpp [NFC][TargetParser] Remove llvm/ADT/Triple.h 2023-02-07 12:39:46 +00:00
RISCVMCAsmInfo.h
RISCVMCCodeEmitter.cpp [RISCV] Use MCSubtargetInfo::hasFeature where possible. NFC 2023-02-17 14:36:48 -08:00
RISCVMCExpr.cpp
RISCVMCExpr.h
RISCVMCObjectFileInfo.cpp
RISCVMCObjectFileInfo.h
RISCVMCTargetDesc.cpp
RISCVMCTargetDesc.h
RISCVTargetStreamer.cpp [RISCV] Emit .variant_cc directives for vector function calls. 2022-12-16 13:51:39 +08:00
RISCVTargetStreamer.h [RISCV] Emit .variant_cc directives for vector function calls. 2022-12-16 13:51:39 +08:00