On Thu, Aug 19, 2021 at 4:22 PM Niels Möller nisse@lysator.liu.se wrote:
David Edelsohn dje.gcc@gmail.com writes:
AIX continues to use its ABI, which essentially is closely related to ELFv1 and uses the XCOFF file format and syntax.
When you say "closely related" is it close enough that the same assembly can be used as for ELFv1? I don't remember if Maamoun or someone else tested Nettle's powerpc64 assembly on AIX?
Is there some established common name for this calling convention, for both ELFv1 and XCOFF? Otherwise, I'd refer to it as ELFv1, even though it works on non-ELF AIX too.
The AIX ABI and the ELFv1 ABI are not identical. AIX uses XCOFF file format and syntax. PPC64 BE Linux uses ELF file format and syntax.
The ELFv1 ABI was derived from the AIX ABI and both use function descriptors (ELFv1 calls OPD or Official Procedure Descriptors). Function pointers are pointers to the descriptors, not to code. ELFv1 uses ELF section names and decorations.
AIX uses the TOC for global data managed by the compiler. ELFv1 can use a TOC or a more standard GOT managed by the linker.
The assembly language for the instructions is the same (AIX prefers registers as only numbers, while ELF allows letters to distinguish the different register sets (GPRs, FPRs, VSRs).
One can translate between AIX and ELFv1 fairly easily, and possibly use a single assembly file with some m4 macros to hide the differences, but one cannot use identical assembly language files for both.
Thanks David