[PATCH] D72027: [XCOFF][AIX] Support basic relocation type on AIX

Digger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 07:24:21 PST 2020


DiggerLin added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp:86
+  case PPC::fixup_ppc_br24:
+    Result |= 25;
+    break;
----------------
DiggerLin wrote:
> // The relocation encodes the bit length being relocated minus 1. Add back the 1 to // get the actual length being relocated.
> this one should be 23 ?
And my suggestion is to use a constexpr instead of using number directly here.


================
Comment at: llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp:86
+  case PPC::fixup_ppc_br24:
+    Result |= 25;
+    break;
----------------
jasonliu wrote:
> DiggerLin wrote:
> > DiggerLin wrote:
> > > // The relocation encodes the bit length being relocated minus 1. Add back the 1 to // get the actual length being relocated.
> > > this one should be 23 ?
> > And my suggestion is to use a constexpr instead of using number directly here.
> No, we have 25 in the actual object file. 
the  bit length of the relocatable reference of PPC::fixup_ppc_br24 is 24 bits ?
if it is , according to xcoff document .
r_rsize : 0x3F(6 bits)
Specifies the bit length of the relocatable reference minus one. The current architecture allows for fields of up to 32 bits (XCOFF32) or 64 bits (XCOFF64) to be relocated.

it should be 24bits -1 = 23.


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

https://reviews.llvm.org/D72027





More information about the llvm-commits mailing list