[PATCH] s390: Implement 'type_align' gdbarch method

Ulrich Weigand uweigand@de.ibm.com
Fri Aug 30 15:16:00 GMT 2019


Tom de Vries wrote:

> in the "zSeries ELF Application Binary Interface Supplement" document I
> find long double listed with 16-byte size and alignment.
> 
> Likewise in the "IBM XL C/C++ for Linux on z Systems Optimization and
> Programming Guide".
> 
> So I wonder, is this patch hardcoding the assumptions of a single
> compiler implementation (gcc) in gdb, thereby possibly breaking
> functionality in gdb when debugging executables generated by other
> compilers?

This was an error in the original ABI document, unfortunately.
We are currently working on an updated ABI document that will
fix this (and several other errors).  Andreas should know the
current status of this update.

To my knowledge, every Linux on Z compiler in existance has
implemented the 8-byte alignment for long double.  (This is
certainly true for GCC and LLVM; I cannot check XL C since
this is no longer supported on Linux.)

There is in fact a good reason for having (at most) 8-byte
alignment for all standard types: the ABI only guarantees that
the incoming stack pointer is 8-byte aligned.  Having any larger
alignment requirement on a standard type would basically force
compilers to implement dynamic stack realignment.

(If I were to re-design the ABI from scratch today, that
would certainly be one of the things I'd do differently
-- but we are where we are.)

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com



More information about the Gdb-patches mailing list