This is an archive of the discontinued LLVM Phabricator instance.

[Object] Update ObjectFile::makeTriple for XCOFF
ClosedPublic

Authored by hubert.reinterpretcast on Mar 29 2020, 4:24 PM.

Details

Summary

When we encounter an XCOFF file, reflect that in the triple information. In addition to knowing the object file format, we know that the associated OS is AIX.

This means that we can expect that there is no output difference in the processing of an XCOFF32 input file between cases where the triple is left unspecified by the user and cases where the user specifies --triple powerpc-ibm-aix explicitly.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2020, 4:24 PM

Did you see that there are a bunch of test failures according to the pre-merge build? Don't know if they're related, but I guess that they are somehow.

Did you see that there are a bunch of test failures according to the pre-merge build? Don't know if they're related, but I guess that they are somehow.

Yes, I did. I am not sure that the pre-merge testing has proven to be reliably noise free. The functional behaviour change is limited to cases where the library returns "true" for isXCOFF; there is no reason to expect that to be the case for the environment that the failure logs report.

This revision is now accepted and ready to land.Mar 30 2020, 12:29 PM
This revision was automatically updated to reflect the committed changes.

D76907 will change bdnzfl 9, $+8696 to print the target address instead. objdump -d output is not guaranteed to be able to re-assemble.

If you want to restore the $+offset behavior, you can customize IP->setPrintBranchImmAsAddress(true); in tools/llvm-objdump/llvm-objdump.cpp

(I'd prefer not, because powerpc*-linux-gnu-objdump -d prints the target address as well.)