* RFA: correct size of long double on PPC Linux
@ 2004-03-24 18:10 Jim Blandy
2004-03-26 14:12 ` Kevin Buettner
0 siblings, 1 reply; 6+ messages in thread
From: Jim Blandy @ 2004-03-24 18:10 UTC (permalink / raw)
To: gdb-patches
2004-03-24 Jim Blandy <jimb@redhat.com>
* ppc-linux-tdep.c (ppc_linux_init_abi): Long doubles are eight
bytes long on PPC Linux.
Index: gdb/ppc-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-linux-tdep.c,v
retrieving revision 1.49
diff -c -r1.49 ppc-linux-tdep.c
*** gdb/ppc-linux-tdep.c 14 Nov 2003 14:16:29 -0000 1.49
--- gdb/ppc-linux-tdep.c 11 Feb 2004 18:59:31 -0000
***************
*** 1042,1047 ****
--- 1042,1049 ----
if (tdep->wordsize == 4)
{
+ set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+
/* Until November 2001, gcc did not comply with the 32 bit SysV
R4 ABI requirement that structures less than or equal to 8
bytes should be returned in registers. Instead GCC was using
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: RFA: correct size of long double on PPC Linux 2004-03-24 18:10 RFA: correct size of long double on PPC Linux Jim Blandy @ 2004-03-26 14:12 ` Kevin Buettner 2004-03-26 15:19 ` Daniel Jacobowitz 0 siblings, 1 reply; 6+ messages in thread From: Kevin Buettner @ 2004-03-26 14:12 UTC (permalink / raw) To: Jim Blandy; +Cc: gdb-patches On 24 Mar 2004 13:10:33 -0500 Jim Blandy <jimb@redhat.com> wrote: > 2004-03-24 Jim Blandy <jimb@redhat.com> > > * ppc-linux-tdep.c (ppc_linux_init_abi): Long doubles are eight > bytes long on PPC Linux. Can you provide the ABI reference for this? According to the documentation that I have (which is the System V ABI PowerPC Processor Supplement), the size of a long double is 16 bytes. Kevin ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFA: correct size of long double on PPC Linux 2004-03-26 14:12 ` Kevin Buettner @ 2004-03-26 15:19 ` Daniel Jacobowitz 2004-03-26 15:45 ` Jim Blandy 0 siblings, 1 reply; 6+ messages in thread From: Daniel Jacobowitz @ 2004-03-26 15:19 UTC (permalink / raw) To: Kevin Buettner; +Cc: Jim Blandy, gdb-patches On Thu, Mar 25, 2004 at 10:23:58PM -0700, Kevin Buettner wrote: > On 24 Mar 2004 13:10:33 -0500 > Jim Blandy <jimb@redhat.com> wrote: > > > 2004-03-24 Jim Blandy <jimb@redhat.com> > > > > * ppc-linux-tdep.c (ppc_linux_init_abi): Long doubles are eight > > bytes long on PPC Linux. > > Can you provide the ABI reference for this? > > According to the documentation that I have (which is the System V ABI > PowerPC Processor Supplement), the size of a long double is 16 bytes. Yes - this is one of the known warts in the PPC GNU/Linux ABI. People have been talking for years about fixing it to match the SysV ABI. GCC only recently got 128-bit long double support on PPC, so it may be changing soon; but for all existing PPC GNU/Linux systems I know of, eight bytes is correct. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFA: correct size of long double on PPC Linux 2004-03-26 15:19 ` Daniel Jacobowitz @ 2004-03-26 15:45 ` Jim Blandy 2004-03-26 16:23 ` Kevin Buettner 0 siblings, 1 reply; 6+ messages in thread From: Jim Blandy @ 2004-03-26 15:45 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: Kevin Buettner, gdb-patches Daniel Jacobowitz <drow@false.org> writes: > On Thu, Mar 25, 2004 at 10:23:58PM -0700, Kevin Buettner wrote: > > On 24 Mar 2004 13:10:33 -0500 > > Jim Blandy <jimb@redhat.com> wrote: > > > > > 2004-03-24 Jim Blandy <jimb@redhat.com> > > > > > > * ppc-linux-tdep.c (ppc_linux_init_abi): Long doubles are eight > > > bytes long on PPC Linux. > > > > Can you provide the ABI reference for this? > > > > According to the documentation that I have (which is the System V ABI > > PowerPC Processor Supplement), the size of a long double is 16 bytes. > > Yes - this is one of the known warts in the PPC GNU/Linux ABI. People > have been talking for years about fixing it to match the SysV ABI. GCC > only recently got 128-bit long double support on PPC, so it may be > changing soon; but for all existing PPC GNU/Linux systems I know of, > eight bytes is correct. I went to the Linux Standards Base, and it said that programs that use 'long double' on PPC Linux are non-conformant. So I figured the best I could do was to make GDB match GCC. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFA: correct size of long double on PPC Linux 2004-03-26 15:45 ` Jim Blandy @ 2004-03-26 16:23 ` Kevin Buettner 2004-03-26 21:05 ` Jim Blandy 0 siblings, 1 reply; 6+ messages in thread From: Kevin Buettner @ 2004-03-26 16:23 UTC (permalink / raw) To: Jim Blandy; +Cc: gdb-patches, Daniel Jacobowitz On 26 Mar 2004 10:45:13 -0500 Jim Blandy <jimb@redhat.com> wrote: > Daniel Jacobowitz <drow@false.org> writes: > > > On Thu, Mar 25, 2004 at 10:23:58PM -0700, Kevin Buettner wrote: > > > On 24 Mar 2004 13:10:33 -0500 > > > Jim Blandy <jimb@redhat.com> wrote: > > > > > > > 2004-03-24 Jim Blandy <jimb@redhat.com> > > > > > > > > * ppc-linux-tdep.c (ppc_linux_init_abi): Long doubles are eight > > > > bytes long on PPC Linux. > > > > > > Can you provide the ABI reference for this? > > > > > > According to the documentation that I have (which is the System V ABI > > > PowerPC Processor Supplement), the size of a long double is 16 bytes. > > > > Yes - this is one of the known warts in the PPC GNU/Linux ABI. People > > have been talking for years about fixing it to match the SysV ABI. GCC > > only recently got 128-bit long double support on PPC, so it may be > > changing soon; but for all existing PPC GNU/Linux systems I know of, > > eight bytes is correct. > > I went to the Linux Standards Base, and it said that programs that use > 'long double' on PPC Linux are non-conformant. So I figured the best > I could do was to make GDB match GCC. Okay, this patch is approved then, so long as you add a suitable comment about PPC Linux deviating from the System V ABI on this matter. Thanks! Kevin ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFA: correct size of long double on PPC Linux 2004-03-26 16:23 ` Kevin Buettner @ 2004-03-26 21:05 ` Jim Blandy 0 siblings, 0 replies; 6+ messages in thread From: Jim Blandy @ 2004-03-26 21:05 UTC (permalink / raw) To: Kevin Buettner; +Cc: gdb-patches, Daniel Jacobowitz Kevin Buettner <kevinb@redhat.com> writes: > On 26 Mar 2004 10:45:13 -0500 > Jim Blandy <jimb@redhat.com> wrote: > > > Daniel Jacobowitz <drow@false.org> writes: > > > > > On Thu, Mar 25, 2004 at 10:23:58PM -0700, Kevin Buettner wrote: > > > > On 24 Mar 2004 13:10:33 -0500 > > > > Jim Blandy <jimb@redhat.com> wrote: > > > > > > > > > 2004-03-24 Jim Blandy <jimb@redhat.com> > > > > > > > > > > * ppc-linux-tdep.c (ppc_linux_init_abi): Long doubles are eight > > > > > bytes long on PPC Linux. > > > > > > > > Can you provide the ABI reference for this? > > > > > > > > According to the documentation that I have (which is the System V ABI > > > > PowerPC Processor Supplement), the size of a long double is 16 bytes. > > > > > > Yes - this is one of the known warts in the PPC GNU/Linux ABI. People > > > have been talking for years about fixing it to match the SysV ABI. GCC > > > only recently got 128-bit long double support on PPC, so it may be > > > changing soon; but for all existing PPC GNU/Linux systems I know of, > > > eight bytes is correct. > > > > I went to the Linux Standards Base, and it said that programs that use > > 'long double' on PPC Linux are non-conformant. So I figured the best > > I could do was to make GDB match GCC. > > Okay, this patch is approved then, so long as you add a suitable comment > about PPC Linux deviating from the System V ABI on this matter. Okay, thanks. I've committed the following: 2004-03-24 Jim Blandy <jimb@redhat.com> * ppc-linux-tdep.c (ppc_linux_init_abi): Long doubles are eight bytes long on PPC Linux. Index: ppc-linux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/ppc-linux-tdep.c,v retrieving revision 1.54 retrieving revision 1.55 diff -c -c -F'^(' -r1.54 -r1.55 *** ppc-linux-tdep.c 23 Mar 2004 14:47:56 -0000 1.54 --- ppc-linux-tdep.c 26 Mar 2004 20:59:38 -0000 1.55 *************** *** 1076,1081 **** --- 1076,1090 ---- if (tdep->wordsize == 4) { + /* NOTE: jimb/2004-03-26: The System V ABI PowerPC Processor + Supplement says that long doubles are sixteen bytes long. + However, as one of the known warts of its ABI, PPC GNU/Linux + uses eight-byte long doubles. GCC only recently got 128-bit + long double support on PPC, so it may be changing soon. The + Linux Standards Base says that programs that use 'long + double' on PPC GNU/Linux are non-conformant. */ + set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); + /* Until November 2001, gcc did not comply with the 32 bit SysV R4 ABI requirement that structures less than or equal to 8 bytes should be returned in registers. Instead GCC was using ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-03-26 21:05 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2004-03-24 18:10 RFA: correct size of long double on PPC Linux Jim Blandy 2004-03-26 14:12 ` Kevin Buettner 2004-03-26 15:19 ` Daniel Jacobowitz 2004-03-26 15:45 ` Jim Blandy 2004-03-26 16:23 ` Kevin Buettner 2004-03-26 21:05 ` Jim Blandy
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox