[PATCH] D61973: [AArch64] Support .reloc *, R_AARCH64_NONE, *

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 06:15:32 PDT 2019


peter.smith added a comment.

I have similar comments to D61992 <https://reviews.llvm.org/D61992>

In D61973#1504196 <https://reviews.llvm.org/D61973#1504196>, @MaskRay wrote:

> In D61973#1504185 <https://reviews.llvm.org/D61973#1504185>, @rprichard wrote:
>
> > The commit message only mentions AArch64, but the commit appears to also add support for R_ARM_NONE. I tried using R_ARM_NONE, though, and was unsuccessful:
> >
> >   $ clang -target arm-linux-gnu test.s -c -mfloat-abi=soft
> >   test.s:1:3: error: unsupported relocation on symbol
> >     .reloc 0, R_ARM_NONE, .text
> >     ^
> >   
> >
> > I was able to use R_ARM_NONE with -fno-integrated-as, but then lld couldn't link the object file into a relobj with -Wl,-r:
> >
> >   $ clang -target armv7a-linux-gnueabi test.o -mfloat-abi=soft -o foo -Wl,-r -fuse-ld=lld -nostdlib
> >   ld.lld: warning: lld uses blx instruction, no object with architecture supporting feature detected
> >   ld.lld: error: test.o:(.rel.text+0x0): unrecognized reloc 0
>
>
> Sorry, lib/Target/ARM changed were unintended. I am indeed studying how to support R_ARM_NONE :)


I think Ryan has found a different problem here. My first thought was that R_ARM_NONE and R_AARCH64_NONE are supported in LLD as they map to R_NONE. In general LLD filters these out so they never get to relocateOne. It seems like there is a possibility of this happening with ld -r if the R_ARM_NONE is from a SHF_ALLOC section. In short the unrecognized reloc 0 is coming from relocateOne. The same error would happen for all of the targets.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61973





More information about the llvm-commits mailing list