Skip to content

Commit ba3208e

Browse files
[LLVM/CodeGen] Use the correct address space when building structor tables. (#171247)
No in-tree target exercises this, but it's needed for CHERI, and I believe its correctness is verifiable by inspection. Co-authored-by: Alex Richardson <[email protected]>
1 parent a0b6638 commit ba3208e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3473,7 +3473,7 @@ void AsmPrinter::emitXXStructorList(const DataLayout &DL, const Constant *List,
34733473
if (!TM.Options.UseInitArray)
34743474
std::reverse(Structors.begin(), Structors.end());
34753475

3476-
const Align Align = DL.getPointerPrefAlignment();
3476+
const Align Align = DL.getPointerPrefAlignment(DL.getProgramAddressSpace());
34773477
for (Structor &S : Structors) {
34783478
const TargetLoweringObjectFile &Obj = getObjFileLowering();
34793479
const MCSymbol *KeySym = nullptr;

0 commit comments

Comments
 (0)