This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] s390: Implement 'type_align' gdbarch method
- From: Tom de Vries <tdevries at suse dot de>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: Andreas Arnez <arnez at linux dot ibm dot com>, gdb-patches at sourceware dot org, Tom Tromey <tom at tromey dot com>
- Date: Fri, 30 Aug 2019 17:42:21 +0200
- Subject: Re: [PATCH] s390: Implement 'type_align' gdbarch method
- References: <20190830151633.1AB17D802F0@oc3748833570.ibm.com>
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