[Request for help] issue when add relative extable support to riscv64
Andreas Schwab
schwab at linux-m68k.org
Sun Oct 10 09:59:14 PDT 2021
On Okt 10 2021, Jisheng Zhang wrote:
> a simple code:
>
> nop
> 1:
> .section __ex_table,"a"
> .align 3
> .long (1b - .)
>
> assemble it, then we can see that there are two entries for the above
> label substraction, R_RISCV_ADD32 and R_RISCV_SUB32
>
> Relocation section '.rela__ex_table' at offset 0x108 contains 2 entries:
> Offset Info Type Sym. Value Sym. Name + Addend
> 000000000000 000600000023 R_RISCV_ADD32 0000000000000002 .L1^B1 + 0
> 000000000000 000500000027 R_RISCV_SUB32 0000000000000000 .L0 + 0
>
> The 2nd R_RISCV_SUB32 rela entry causes the problem.
>
> Can we prevent assembler from emitting the R_RISCV_SUB32 rela entry?
There is R_RISCV_32_PCREL, but I guess it isn't used here because it was
a late addition. The assembler uses it only in a very special situation
(FDE initial location).
Andreas.
--
Andreas Schwab, schwab at linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
More information about the linux-riscv
mailing list