This is an archive of the discontinued LLVM Phabricator instance.

[PPC64] Replace several endianess checks with abi checks.
AbandonedPublic

Authored by sfertile on Apr 25 2018, 12:16 PM.

Details

Summary

There is no limitation that restricts the V2 abi to little endian machines. Rather then checking based on endianess we should be gating behavior based on abi flags.

This cleans up most of the existing checks, but unfortunately the PPC64 target constructor has one such endianess check that comes before we have processed the e_flags and don't know the abi version yet. Since we are working on a patch to remove the remaining V1 abi specific code I've left that check as is for now.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

sfertile created this revision.Apr 25 2018, 12:16 PM

This LGTM FWIW. (Acking to have it pop back up in people's queues).

ELF/Target.h
157–161

IMO this is going to get unwieldy after a while (making it part of the base class), but it looks like you're also just following existing practice.

sfertile abandoned this revision.May 4 2018, 8:05 AM

This LGTM FWIW. (Acking to have it pop back up in people's queues).

Thanks for review.

I was using this to help cleanup some of the checks in the Plt stub and glink patches as well as run some of the lit tests for both BE and LE. D46316 (remove support for V1 abi) is approved, so I think I can abandon this and cleanup the dependent patches to not need this check.

ELF/Target.h
157–161

I agree, I would have liked to sink this into the PPC64 target directly. If the targets were setup with the LLVM style RTTI then I would have done it this way.