[PATCH] D157365: [lld][PPC64] Fix location of the least significant byte when fixing up R_PPC64_ADDR14 for little-endian target

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 08:52:03 PDT 2023


MaskRay added a comment.

In D157365#4571720 <https://reviews.llvm.org/D157365#4571720>, @lkail wrote:

>> This subtle change needs a test case to prevent future regression. If the assembler doesn't generate the problematic bit pattern, you can use .reloc directive.
>
> I find lld doesn't handle `R_PPC64_ADDR14` relocation in `PPC64::getRelExpr` at all.
>
>   t_le.o:	file format elf64-powerpcle
>   
>   RELOCATION RECORDS FOR [.text]:
>   OFFSET           TYPE                     VALUE
>   0000000000000004 R_PPC64_ADDR14           .text
>   
>   
>   ld.lld: error: t_le.o:(.text+0x4): unknown relocation (7) against symbol 
>
> Shall we proceed to add support for it or remove handling `R_PPC64_ADDR14` from `PPC64::relocate`? In fact, what we are using mostly is `R_PPC64_REL14` which is well handled.

We can probably remove linker support for  `R_PPC64_ADDR14`. It seems that MC assembler doesn't produce `R_PPC64_ADDR14`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157365



More information about the llvm-commits mailing list