[PATCH] D95262: [LLD][PowerPC] Fix bug in PC-Relative initial exec

Stefan Pintilie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 16 12:03:21 PDT 2021


stefanp added a comment.

I think I may have misunderstood your initial comment.
I don't think that the ABI has an issue with the code pattern:

  pld 3, <Immediate Value>(0), 1
  add 4, 3, 13

The ABI does not explicitly state that those registers must be equal. It also does not say explicitly that they can differ so I don't think there is a clear direction from that perspective. Logically it would make sense for those registers to be able to differ if they are used in multiple places or if they must be used across function calls (as in the example I added).
Linking the object files generated by LLVM with ld produces the correct result with the `mr` and not the `nop`. Therefore it seems that ld expects to have to handle this kind of code. While this situation will not arise very often I believe that this is something LLD should be able to handle.

I hope that this answers your questions @MaskRay .


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95262



More information about the llvm-commits mailing list