[Ltrace-devel] Support for ppc64el patch

Petr Machata pmachata at redhat.com
Sun Apr 13 22:03:02 UTC 2014


"Thierry Fauck at linux.vnet.ibm.com" <thierry at linux.vnet.ibm.com> writes:

>   * I badly said hetereogenous instead of not homogeneous (it is not
>     really clear if hetereogeneous means mixed float struct and/or big
>     homogeneous struct >64 bytes ...) . Will change that.

OK.  I think saying non-HFA is clear and unambiguous.

>      #ifdef __powerpc64__ // Says 'ltrace' is 64 bits, says nothing
>     about target.
>      #define LT_ELFCLASS2   ELFCLASS64
>      #define LT_ELF_MACHINE2        EM_PPC64
>     -#define ARCH_SUPPORTS_OPD
>     -#endif
>     +
>     +#ifdef __LITTLE_ENDIAN__
>     +# define BREAKPOINT_VALUE { 0x08, 0x00, 0xe0, 0x7f }
>     +# define ARCH_ENDIAN_LITTLE
>     +#else
>     +# define BREAKPOINT_VALUE { 0x7f, 0xe0, 0x00, 0x08 }
>     +# define ARCH_SUPPORTS_OPD
>     +# define ARCH_ENDIAN_BIG
>     +#endif
>     +
>     +#if _CALL_ELF != 2
>     +# define ARCH_SUPPORTS_OPD
>     +# define STACK_FRAME_OVERHEAD 112
>     +#else /* _CALL_ELF == 2 ABIv2 */
>     +# define STACK_FRAME_OVERHEAD 32
>     +#endif /* CALL_ELF */
>     +
>     +#else
>     +# define BREAKPOINT_VALUE { 0x7f, 0xe0, 0x00, 0x08 }
>     +# define ARCH_ENDIAN_BIG
>     +#endif         /* __powerpc64__ */
>   *
>
>      is this better ?

I formatted the above fragment to show what I had in mind.

>
>>  *
>>     +	lte->arch.elfv2_abi=((lte->ehdr.e_flags & 3) & 2);
>>
>> Uhh, do these things have symbolic names by any chance?
>> Also, why & 3 & 2?  That's the same as & 2...
> I finaly found it :
> /* e_flags bits specifying ABI.
>    1 for original function descriptor using ABI,
>    2 for revised ABI without function descriptors,
>    0 for unspecified or not using any features affected by the
> differences.  */
> #define EF_PPC64_ABI    3
>
>     would :                 lte->arch.elfv2_abi=((lte->ehdr.e_flags &
> EF_PPC64_ABI ) == 2 )
>
> be more appropriate

Yeah, if EF_PPC64_ABI is commonly available in header files, I'd prefer
to have it spelled like that.

Thank you,
PM



More information about the Ltrace-devel mailing list