* [Qemu-devel] Many syntax errors in op.h
@ 2005-11-15 14:50 Dave Feustel
2005-11-15 15:43 ` Paul Brook
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Dave Feustel @ 2005-11-15 14:50 UTC (permalink / raw)
To: qemu-devel
I am making progress as I modify the Qemu source code to work
around a number of OpenBSD deficiencies. I don't yet know how
to fix the following problem which occurs about 25 times in op.h:
C statements of the form
*(uint32_t *)(gen_code_ptr + 210) = (long)(&) + 14;
generate syntax errors (apparently because of the use of "(&)")
with the c compiler used in OpenBSD 3.7 (gcc (GCC) 3.3.5 (propolice)).
Similar statements with a symbol following the "&" (eg "(&xyz)") do not generate
syntax errors. Has this been seen before? Is there a fix?
Thanks,
Dave Feustel
--
Switch to Secure OpenBSD with a KDE desktop!!!
NOW with Virtual PC OS support via QEMU and
Beowulf clustering using PETSc and MPICH2!
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Qemu-devel] Many syntax errors in op.h
2005-11-15 14:50 [Qemu-devel] Many syntax errors in op.h Dave Feustel
@ 2005-11-15 15:43 ` Paul Brook
2005-11-15 17:17 ` Johannes Schindelin
2005-11-15 17:23 ` Jamie Lokier
2 siblings, 0 replies; 6+ messages in thread
From: Paul Brook @ 2005-11-15 15:43 UTC (permalink / raw)
To: qemu-devel, dfeustel
On Tuesday 15 November 2005 14:50, Dave Feustel wrote:
> I am making progress as I modify the Qemu source code to work
> around a number of OpenBSD deficiencies. I don't yet know how
> to fix the following problem which occurs about 25 times in op.h:
>
> C statements of the form
>
> *(uint32_t *)(gen_code_ptr + 210) = (long)(&) + 14;
>
> generate syntax errors (apparently because of the use of "(&)")
> with the c compiler used in OpenBSD 3.7 (gcc (GCC) 3.3.5 (propolice)).
>
> Similar statements with a symbol following the "&" (eg "(&xyz)") do not
> generate syntax errors. Has this been seen before? Is there a fix?
Make sure you disable any stack protection systems (ProPolice, SSP, etc) when
compiling op.c.
Paul
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Many syntax errors in op.h
2005-11-15 14:50 [Qemu-devel] Many syntax errors in op.h Dave Feustel
2005-11-15 15:43 ` Paul Brook
@ 2005-11-15 17:17 ` Johannes Schindelin
2005-11-15 17:23 ` Jamie Lokier
2 siblings, 0 replies; 6+ messages in thread
From: Johannes Schindelin @ 2005-11-15 17:17 UTC (permalink / raw)
To: dfeustel, qemu-devel
Hi,
On Tue, 15 Nov 2005, Dave Feustel wrote:
> *(uint32_t *)(gen_code_ptr + 210) = (long)(&) + 14;
This is usually a problem with dyngen extracting meaningless relocations
from the object file.
It happened to me when I was working on the MIPS (host) support, and a lot
of these relocations were relative to some global offset table (GOT). The
names were missing, and I got lines like these.
Hth,
Dscho
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Many syntax errors in op.h
2005-11-15 14:50 [Qemu-devel] Many syntax errors in op.h Dave Feustel
2005-11-15 15:43 ` Paul Brook
2005-11-15 17:17 ` Johannes Schindelin
@ 2005-11-15 17:23 ` Jamie Lokier
2005-11-15 18:05 ` Dave Feustel
2 siblings, 1 reply; 6+ messages in thread
From: Jamie Lokier @ 2005-11-15 17:23 UTC (permalink / raw)
To: dfeustel, qemu-devel
Dave Feustel wrote:
> I am making progress as I modify the Qemu source code to work
> around a number of OpenBSD deficiencies. I don't yet know how
> to fix the following problem which occurs about 25 times in op.h:
>
> C statements of the form
>
> *(uint32_t *)(gen_code_ptr + 210) = (long)(&) + 14;
>
> generate syntax errors (apparently because of the use of "(&)")
> with the c compiler used in OpenBSD 3.7 (gcc (GCC) 3.3.5 (propolice)).
"(&)" is not valid C.
> Similar statements with a symbol following the "&" (eg "(&xyz)") do
> not generate syntax errors.
Because that is valid C.
-- Jamie
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Many syntax errors in op.h
2005-11-15 17:23 ` Jamie Lokier
@ 2005-11-15 18:05 ` Dave Feustel
2005-11-15 18:30 ` Johannes Schindelin
0 siblings, 1 reply; 6+ messages in thread
From: Dave Feustel @ 2005-11-15 18:05 UTC (permalink / raw)
To: Jamie Lokier; +Cc: qemu-devel
On Tuesday 15 November 2005 12:23, Jamie Lokier wrote:
> Dave Feustel wrote:
> > I am making progress as I modify the Qemu source code to work
> > around a number of OpenBSD deficiencies. I don't yet know how
> > to fix the following problem which occurs about 25 times in op.h:
> >
> > C statements of the form
> >
> > *(uint32_t *)(gen_code_ptr + 210) = (long)(&) + 14;
> >
> > generate syntax errors (apparently because of the use of "(&)")
> > with the c compiler used in OpenBSD 3.7 (gcc (GCC) 3.3.5 (propolice)).
>
> "(&)" is not valid C.
That's what I thought too. "&" requires an operand. So why are these lines of code
in op.h? Should they be commented out? Should a dummy operand be inserted?
What is the fix?
Thanks.
> > Similar statements with a symbol following the "&" (eg "(&xyz)") do
> > not generate syntax errors.
>
> Because that is valid C.
>
> -- Jamie
>
--
Switch to Secure OpenBSD with a KDE desktop!!!
NOW with Virtual PC OS support via QEMU and
Beowulf clustering using PETSc and MPICH2!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Many syntax errors in op.h
2005-11-15 18:05 ` Dave Feustel
@ 2005-11-15 18:30 ` Johannes Schindelin
0 siblings, 0 replies; 6+ messages in thread
From: Johannes Schindelin @ 2005-11-15 18:30 UTC (permalink / raw)
To: dfeustel, qemu-devel
Hi,
On Tue, 15 Nov 2005, Dave Feustel wrote:
> On Tuesday 15 November 2005 12:23, Jamie Lokier wrote:
> >
> > "(&)" is not valid C.
>
> That's what I thought too. "&" requires an operand. So why are these
> lines of code in op.h? Should they be commented out? Should a dummy
> operand be inserted?
Noooo! The code inserts the actual arguments to the op directly into the
machine code.
Example:
Say op_add123 implements the addition of a number to register A0. When
translating the guest machine code, you not only copy the host machine
code for op_add123, but you have to put the number to be added
*somewhere*.
Enter relocations. The file op.h contains the code to put the number at
the correct point in the machine code.
> What is the fix?
You need to know the problem first. Why does dyngen produce that code.
Which relocation is responsible for that invalid statement. Why was no
name provided for it?
If you just comment it out, chances are that QEmu produces invalid code.
Hth,
Dscho
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-11-15 18:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-15 14:50 [Qemu-devel] Many syntax errors in op.h Dave Feustel
2005-11-15 15:43 ` Paul Brook
2005-11-15 17:17 ` Johannes Schindelin
2005-11-15 17:23 ` Jamie Lokier
2005-11-15 18:05 ` Dave Feustel
2005-11-15 18:30 ` Johannes Schindelin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.