[PATCH] D26564: Use PIC relocation mode by default for PowerPC64 ELF

Bill Schmidt via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 11 15:20:37 PST 2016


wschmidt added a comment.

In https://reviews.llvm.org/D26564#593352, @hfinkel wrote:

> @wschmidt and other IBM folks, w.r.t. this and https://reviews.llvm.org/D26566, can you please comment on what GCC does here? Does GCC use -fPIC by default for PPC64 (literally or in effect)?


This is an area that I always find a bit confusing.  There is a lot of cruft in GCC regarding -fpic / -fPIC because of the many subtargets.

I can say with confidence that -fPIC behavior is the default for powerpc64le (more correctly, for ELFv2 ABI), and I'm pretty sure that's true for powerpc64 (ELFv1) as well.  Certainly -fpic and -fPIE are not defaults for either ABI.  The weird crufty stuff arises with 32-bit PPC, where R30 is reserved to point to a PIC offset table that doesn't exist for the 64-bit ABIs, so far as I can tell.

So, longwinded, caveat-filled response is, I think this is just fine. :)


https://reviews.llvm.org/D26564





More information about the cfe-commits mailing list