[XCOFF] set fragment for XMC_PR csects.
authoresmeyi <esme.yi@ibm.com>
Tue, 22 Nov 2022 12:17:44 +0000 (07:17 -0500)
committeresmeyi <esme.yi@ibm.com>
Tue, 22 Nov 2022 12:17:44 +0000 (07:17 -0500)
commitc7c7ef8bda1fb7a81f8f769c6b1cc8583629a309
tree12e1ebcfa291a1301c4dd88f8064926a57ba3802
parent3f65c8fcbe4ed4886500a0b9b939a363b70a43c3
[XCOFF] set fragment for XMC_PR csects.

Summary: -xcoff-traceback-table is a default option on AIX regardless of optimization and debug levels. An error of relocation for paired relocatable term is not yet supported in XCOFFObjectWriter::recordRelocation occurred when both of the -xcoff-traceback-table and -function-sections are enabled.
The root cause is that we missed to calculate the symbols difference as absolute value before adding fixups when symbol_A without the fragment set is the csect itself and symbol_B is in it.
This patch only sets the fragment for XMC_PR csects because we don't have other cases that hit this problem yet.

Reviewed By: DiggerLin, hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D137230
llvm/lib/MC/MCContext.cpp
llvm/test/CodeGen/PowerPC/aix-xcoff-funcsect.ll