[PATCH v2] powerpc/64: BE option to use ELFv2 ABI for big endian kernels

Segher Boessenkool segher at kernel.crashing.org
Wed May 5 22:31:11 AEST 2021


On Tue, May 04, 2021 at 10:15:34PM +1000, Michael Ellerman wrote:
> Segher Boessenkool <segher at kernel.crashing.org> writes:
> > On Mon, May 03, 2021 at 10:51:41AM +1000, Nicholas Piggin wrote:
> >> then ELF ABIv2 is more explanatory about it being an abi change
> >> rather than base elf change, even if it's not the "correct" name.
> >
> > I very much disagree.  "ELF ABIv2" is completely meaningless.
> 
> Except:
> 
> $ readelf -h /bin/true
> ELF Header:
>   Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
>   Class:                             ELF64
>   Data:                              2's complement, little endian
>   Version:                           1 (current)
>   OS/ABI:                            UNIX - System V
>   ABI Version:                       0
>   Type:                              DYN (Shared object file)
>   Machine:                           PowerPC64
>   Version:                           0x1
>   Entry point address:               0x1990
>   Start of program headers:          64 (bytes into file)
>   Start of section headers:          66176 (bytes into file)
>   Flags:                             0x2, abiv2
>                                           ^^^^^

Ha :-)

This can also print "abiv1" or even "abiv0", btw:

        case EM_PPC64:
          if (e_flags & EF_PPC64_ABI)
            {
              char abi[] = ", abiv0";

              abi[6] += e_flags & EF_PPC64_ABI;
              strcat (buf, abi);
            }
          break;

This is only in readelf, and the main audience for readelf is the people
who know all details about what means what already.  But, do you have a
suggestion for better output here?


Segher


More information about the Linuxppc-dev mailing list