[PATCH] D71100: [lld][RISCV] Fixup PC-relative relocations to undefined weak symbols.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 31 18:29:15 PST 2019


MaskRay added a comment.

Created D72046 <https://reviews.llvm.org/D72046>. As per my interpretation at https://github.com/riscv/riscv-elf-psabi-doc/issues/126#issuecomment-568160758 , we have to assume

> Compilers should not emit PC-relative relocations in -fpic/-fpie mode.

GCC/clang emit either absolute or GOT relocations, so the assumption is true. (If not in edge cases, we have to fix the compilers.) I don't think errors on branch relocations are useful.  So, D72046 <https://reviews.llvm.org/D72046> just does what I did to PPC32 (the patch changes `p` to `p+a` for PPC32 as well. It is a minor issue anyway).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71100





More information about the llvm-commits mailing list