This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] s390: Implement 'type_align' gdbarch method


On 30-08-19 17:16, Ulrich Weigand wrote:
> 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.)

I understand it now, thanks for the detailed explanation.

- Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]