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

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 20:06:05 PDT 2023


lkail added a comment.

> 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`?


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