loongson / la-abi-specs

22 stars 6 forks source link

R_LARCH_DELETE probably shouldn't be exposed #2

Closed xen0n closed 9 months ago

xen0n commented 1 year ago

We currently expose R_LARCH_DELETE in our specs but it could be hard to properly use: for producers of object code, why emit the code at all, if you plan to stick this reloc to it right away to have the code removed by another program later?

For reference, the similar R_RISCV_DELETE is exclusively an internal concept only for BFD's relaxation pass:

// bfd/elfnn-riscv.c

/* Internal relocations used exclusively by the relaxation pass.  */
#define R_RISCV_DELETE (R_RISCV_max + 1)

And LLVM doesn't define it at all.

So I suggest removing this reloc in a future revision of the ELF psABI document, making it reserved in the meantime. No program would consciously write this reloc kind to object files so compatibility would be preserved.

SixWeining commented 9 months ago

Addressed by #4.