[PATCH] RISC-V: Remove R_RISCV_GNU_VTINHERIT/R_RISCV_GNU_VTENTRY

Fangrui Song maskray@google.com
Wed Aug 10 06:33:17 GMT 2022


On Mon, Aug 8, 2022 at 10:27 AM Fangrui Song <maskray@google.com> wrote:
>
> On 2022-08-08, Kito Cheng wrote:
> >Hi Andreas:
> >
> >> FWIW, they are still generically handled by the .vtable_inherit and
> >> .vtable_entry pseudo-ops, but support for -fvtable-gc has been removed
> >> from gcc in 2003.  The RISC-V assembler never picked them up.
> >
> >Thanks for the historical data! RISC-V GNU toolchain is upstreamed
> >after that time, so sounds like we could remove that safely for
> >RISC-V.
>
> Second this.
>
> >> $ riscv64-suse-linux-as vtable.s
> >> vtable.s: Assembler messages:
> >> vtable.s:1: Error: cannot represent BFD_RELOC_VTABLE_ENTRY relocation in object file
> >> vtable.s:2: Error: cannot represent BFD_RELOC_VTABLE_INHERIT relocation in object file
> >
> >Maybe we can improve the error message into something like:
> >.vtable_inherit / .vtable_entry is unsupported for RISC-V.
>
> I think the diagnostic is from gas/config/tc-riscv.c:4135 .
> Since gcc -fvtable-gc was gone in 2003 and we essentially cannot find
> .vtable_entry uses, I think sticking with the existing generic diagnostic isn't bad.

If this patch has no objection, I will push this.


More information about the Binutils mailing list