[PATCH] D80390: [WIP][mips] Support 64-bit relative relocations

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 21 12:27:23 PDT 2020


MaskRay added a comment.

Honestly it is not that I care much about MIPS, but the lack of PC64 support from MIPS makes me feel uncomfortable. It imposes much burden on many toolchain components.
So I register some complaint on those ISA/ABI makers.
That said, I very much appreciate your toolchain work here. Disclamer: I know really little about MIPS.

A bit archaeology:

https://sourceware.org/git/?p=binutils-gdb.git;a=blobdiff;f=include/elf/mips.h;h=9aba63e420c06b55f8b2fb589fefacb4104ee2a1;hp=ce43158123fdc21bd3359cc014a41287f8e11c38;hb=4030e8f62467c29b782aa2480e1e452b8e458699;hpb=38cc9c28f4c40dee2dad46cc1669f97dc17a2638 removed `RELOC_NUMBER (R_MIPS_PC64, 249)`. 249 is now occupied by `R_MIPS_EH`.

On https://sourceware.org/pipermail/binutils/2020-February/109879.html I asked whether we can get R_MIPS_PC64 back,
before I was told that a relocation chain can probably replace R_MIPS_PC64. Is it a perfect replacement?
Is there any downside using a relocation chain (disclaimer: I haven't even looked up what the term means)?

- `.quad foo - .` is representable
- ld.so supports such relocation chain.
- D78590 <https://reviews.llvm.org/D78590> can be fixed for MIPS
- D72228 <https://reviews.llvm.org/D72228> can get rid of the `FDECFIEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;` hack
- For various relocation processing tool, it supporting a relocation chain as easy as supporting an addition relocation type (R_MIPS_PC64), by, adding `case R_MIPS_PC64:`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80390/new/

https://reviews.llvm.org/D80390





More information about the llvm-commits mailing list