[MC] Support constant offset for symbol PendingFixup
This patch add support relocation offset of sym+constant(like `foo+4`) form for pending fixup. In the past, llvm-mc ignored the constant in sym+constant form, for `foo+4`, `4` would be ignored. And test case ``` .text ret nop nop .reloc foo+4, R_RISCV_32, 6 .data .globl foo foo: .word 0 .word 0 .word 0 ``` when run `llvm-mc -filetype=obj -triple=riscv64 %s | llvm-readobj -r` The output is ``` Relocations [ Section (3) .rela.text { 0x0 R_RISCV_32 - 0x6 } ] ``` After applying this patch, the output is ``` Relocations [ Section (3) .rela.text { 0x4 R_RISCV_32 - 0x6 } ] ``` Differential Revision: https://reviews.llvm.org/D117316
Loading
Please sign in to comment