[MIPS] Can we have R_MIPS_PC64?

Fangrui Song i@maskray.me
Thu Jul 9 05:23:17 GMT 2020


On 2020-02-18, Fangrui Song wrote:
>On 2020-02-17, Maciej W. Rozycki wrote:
>>On Sat, 8 Feb 2020, Fangrui Song wrote:
>>
>>>I hope someone can add back R_MIPS_PC64.
>>
>>You don't need R_MIPS_PC64.  You can yield the same effect the usual
>>MIPS64 way, that is by composing R_MIPS_PC32 with R_MIPS_64 (similarly to
>>e.g. how R_MIPS_REL32 composes with R_MIPS_64).
>>
>>Of course the toolchain may not as it stands support this composition.
>>Feel free to post patches to take care of your use case.
>>
>>HTH,
>>
>> Maciej
>
>Thank you for your comments. Sorry that I cannot create a patch, as I know very little about MIPS.
>
>I raised these MIPS issues (including the recent DT_MIPS_XHASH
>https://sourceware.org/ml/binutils/2020-01/msg00451.html) not because I
>have anything to do with MIPS. I started the threads from the viewpoint
>of a toolchain maintainer.
>
>I noticed MIPS introduced complexity in a number of areas,
>where other architectures can share a simple common implementation.
>(It is weird that .quad foo - . is not representable on MIPS64.)
>
>For my own selfish purposes, I will be sad if someone wants to add some
>peculiar MIPS features (e.g. DT_MIPS_XHASH) to LLVM binary utilities or
>lld. I hope we can get rid of things like
>https://reviews.llvm.org/D72228 at some point.
>
>I hope someone can implement PC64, or something similar for MIPS.

Simon Atanasyan has implemented .quad foo-. via a chain of relocation
R_MIPS_PC32/R_MIPS_64/R_MIPS_NONE in LLVM's integrated assembler
(https://reviews.llvm.org/D80390 ). This will be available in LLVM/Clang 11.0.0

I created a feature request for GNU as:
https://sourceware.org/bugzilla/show_bug.cgi?id=26222


More information about the Binutils mailing list