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

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 08:49:40 PST 2020


hubert.reinterpretcast requested changes to this revision.
hubert.reinterpretcast added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:414
+  if (Type == XCOFF::RelocationType::R_POS)
+    FixedValue = SectionMap[SymASec]->Address +
+                 (SymA.isDefined() ? Layout.getSymbolOffset(SymA) : 0);
----------------
Consider:
```
int x = 2, arr[100] = { 1 };
extern int *p = arr + 42;
```

The raw data with this patch does not reflect the offset from `arr` that `p` points to (and neither does the relocation itself):
```
00000004 arr:
       4: 00 00 00 01                   <unknown>
                ...

00000194 p:
     194: 00 00 00 04                   <unknown>
```

The raw data without this patch was correct.



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

https://reviews.llvm.org/D72027





More information about the llvm-commits mailing list