* [RFA] Fix compilation error on FreeBSD/i386
@ 2002-01-19 4:47 Mark Kettenis
2002-01-25 8:43 ` Nick Clifton
0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2002-01-19 4:47 UTC (permalink / raw)
To: binutils; +Cc: ac131313
As already noticed by Andrew Cagney BFD doesn't compile on
FreeBSD/i386 anymore. I agree with his guess at a fix for the
problem. Here's a bit more detail:
The pr_reg member of prstatus_t is on many systems an array.
Consequently, the expression prstat.pr_reg is the address of storage.
However, on FreeBSD the pr_reg member is a struct, which leads to a
"incompatible type for argument 1" compiler error. Since
&prstat.pr_reg still evaluates to the address for the storage for
arrays, the fix below should be OK.
Ok to check this in?
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* elf.c (elfcore_write_prstatus): Make sure we pass the address of
prstat.pr_reg even if it is a struct.
Index: elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.123
diff -u -p -r1.123 elf.c
--- elf.c 2002/01/17 13:02:40 1.123
+++ elf.c 2002/01/19 12:05:26
@@ -6585,7 +6585,7 @@ elfcore_write_prstatus (abfd, buf, bufsi
memset (&prstat, 0, sizeof (prstat));
prstat.pr_pid = pid;
prstat.pr_cursig = cursig;
- memcpy (prstat.pr_reg, gregs, sizeof (prstat.pr_reg));
+ memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg));
return elfcore_write_note (abfd, buf, bufsiz,
note_name, NT_PRSTATUS, &prstat, sizeof (prstat));
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] Fix compilation error on FreeBSD/i386
2002-01-19 4:47 [RFA] Fix compilation error on FreeBSD/i386 Mark Kettenis
@ 2002-01-25 8:43 ` Nick Clifton
2002-01-25 12:33 ` Mark Kettenis
0 siblings, 1 reply; 3+ messages in thread
From: Nick Clifton @ 2002-01-25 8:43 UTC (permalink / raw)
To: kettenis; +Cc: binutils, ac131313
Hi Mark,
> from Mark Kettenis <kettenis@gnu.org>
>
> * elf.c (elfcore_write_prstatus): Make sure we pass the address of
> prstat.pr_reg even if it is a struct.
Approved - please apply.
Cheers
Nick
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] Fix compilation error on FreeBSD/i386
2002-01-25 8:43 ` Nick Clifton
@ 2002-01-25 12:33 ` Mark Kettenis
0 siblings, 0 replies; 3+ messages in thread
From: Mark Kettenis @ 2002-01-25 12:33 UTC (permalink / raw)
To: nickc; +Cc: binutils, ac131313
From: Nick Clifton <nickc@cambridge.redhat.com>
Date: 25 Jan 2002 15:44:41 +0000
Hi Mark,
> from Mark Kettenis <kettenis@gnu.org>
>
> * elf.c (elfcore_write_prstatus): Make sure we pass the address of
> prstat.pr_reg even if it is a struct.
Approved - please apply.
Thanks, Done.
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-01-25 20:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-19 4:47 [RFA] Fix compilation error on FreeBSD/i386 Mark Kettenis
2002-01-25 8:43 ` Nick Clifton
2002-01-25 12:33 ` Mark Kettenis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).