Skip to contentSkip to conversation

Typo in get_reloc_expr (dyngen.c)

Qemu-devel Stuart Brady 1 participant 1 message Jun 5, 2006

lore
Share & tools
lore
#0 lore raw

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.

Signature · 3 lines
Stuart Brady

[0] http://homepage.ntlworld.com/wholehog/stuart/qemu/guest.html
dyngen.c +1 -1
diff -ur qemu-head/dyngen.c qemu-new/dyngen.c
@@ -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