* [Qemu-devel] Typo in get_reloc_expr (dyngen.c)
@ 2006-06-05 14:04 Stuart Brady
0 siblings, 0 replies; 2+ messages in thread
From: Stuart Brady @ 2006-06-05 14:04 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 388 bytes --]
Hi,
There's a small bug in get_reloc_expr in dyngen.c.
It should only affect SPARC hosts, but it can't be causing any real
problems, or someone would have noticed it by now.
I'm trying to port QEMU to PA-RISC[0], and needed this code, so it did
actually affect me. I've attached the (one-line) patch.
--
Stuart Brady
[0] http://homepage.ntlworld.com/wholehog/stuart/qemu/guest.html
[-- Attachment #2: dyngen-fix.diff --]
[-- Type: text/plain, Size: 426 bytes --]
diff -ur qemu-head/dyngen.c qemu-new/dyngen.c
--- qemu-head/dyngen.c 2006-06-05 14:37:00.000000000 +0100
+++ qemu-new/dyngen.c 2006-06-05 14:36:49.000000000 +0100
@@ -1196,7 +1196,7 @@
} else {
#ifdef HOST_SPARC
if (sym_name[0] == '.')
- snprintf(name, sizeof(name),
+ snprintf(name, name_size,
"(long)(&__dot_%s)",
sym_name + 1);
else
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] Typo in get_reloc_expr (dyngen.c)
@ 2006-06-06 11:52 Ben Taylor
0 siblings, 0 replies; 2+ messages in thread
From: Ben Taylor @ 2006-06-06 11:52 UTC (permalink / raw)
To: qemu-devel
Fabrice or Paul:
Can we get this added? This patch has been posted to the list 4 or 5 times
in various incarnations in the last year or soj. I posted a long message with
the logs from the compile on why the current code is wrong, and why this patch fixes
it. The basic problem is that code uses a sizeof construct, instead of the size of
the string. What happens is all the labels end up being truncated, and the op.c
won't compile on sparc.
see analysis of this problem in http://lists.gnu.org/archive/html/qemu-devel/2006-04/msg00494.html
Ben
---- Stuart Brady <sdbrady@ntlworld.com> wrote:
> Hi,
>
> There's a small bug in get_reloc_expr in dyngen.c.
>
> It should only affect SPARC hosts, but it can't be causing any real
> problems, or someone would have noticed it by now.
>
> I'm trying to port QEMU to PA-RISC[0], and needed this code, so it did
> actually affect me. I've attached the (one-line) patch.
> --
> Stuart Brady
>
> [0] http://homepage.ntlworld.com/wholehog/stuart/qemu/guest.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-06 11:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-06 11:52 [Qemu-devel] Typo in get_reloc_expr (dyngen.c) Ben Taylor
-- strict thread matches above, loose matches on Subject: below --
2006-06-05 14:04 Stuart Brady
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 NNTP newsgroup(s).