* [Qemu-devel] [4706] R_PPC_REL24 safety net
@ 2008-06-09 6:06 malc
0 siblings, 0 replies; only message in thread
From: malc @ 2008-06-09 6:06 UTC (permalink / raw)
To: qemu-devel
Revision: 4706
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4706
Author: malc
Date: 2008-06-09 06:06:28 +0000 (Mon, 09 Jun 2008)
Log Message:
-----------
R_PPC_REL24 safety net
Modified Paths:
--------------
trunk/dyngen.c
Modified: trunk/dyngen.c
===================================================================
--- trunk/dyngen.c 2008-06-09 06:06:25 UTC (rev 4705)
+++ trunk/dyngen.c 2008-06-09 06:06:28 UTC (rev 4706)
@@ -1963,6 +1963,14 @@
break;
case R_PPC_REL24:
/* warning: must be at 32 MB distancy */
+ fprintf(outfile, "{\n"
+ " long disp = (%s - (long)(gen_code_ptr + %d) + %d);\n"
+ " if ((disp << 6) >> 6 != disp) {;\n"
+ " fprintf(stderr, \"Branch target is too far away\\n\");"
+ " abort();\n"
+ " }\n"
+ "}\n",
+ relname, reloc_offset, addend);
fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = (*(uint32_t *)(gen_code_ptr + %d) & ~0x03fffffc) | ((%s - (long)(gen_code_ptr + %d) + %d) & 0x03fffffc);\n",
reloc_offset, reloc_offset, relname, reloc_offset, addend);
break;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-06-09 6:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-09 6:06 [Qemu-devel] [4706] R_PPC_REL24 safety net malc
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).