qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCHv2 2/9] tcg: __jit_debug_descriptor must *not* be static
@ 2012-05-22 10:26 Jim Meyering
  0 siblings, 0 replies; only message in thread
From: Jim Meyering @ 2012-05-22 10:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jim Meyering, Peter Maydell

From: Jim Meyering <meyering@redhat.com>

Add comments so no one else will be tempted to reduce the scope
of this global variable.

Signed-off-by: Jim Meyering <meyering@redhat.com>
---

 tcg/tcg.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index ab589c7..2793fa6 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -2264,7 +2264,9 @@ void tcg_dump_info(FILE *f, fprintf_function cpu_fprintf)
    (3) Call tcg_register_jit_int, with the constructed .debug_frame.
 */

-/* Begin GDB interface.  THE FOLLOWING MUST MATCH GDB DOCS.  */
+/* Begin GDB interface.  THE FOLLOWING MUST MATCH GDB DOCS:
+   http://sourceware.org/gdb/onlinedocs/gdb/Declarations.html
+*/
 typedef enum {
     JIT_NOACTION = 0,
     JIT_REGISTER_FN,
@@ -2291,8 +2293,10 @@ void __jit_debug_register_code(void)
     asm("");
 }

-/* Must statically initialize the version, because GDB may check
-   the version before we can set it.  */
+/* We must initialize the version this way, because GDB may check
+   the version before we can set it.  This declaration must have
+   external scope.  If it were "static", an aggressive compiler might
+   notice that we never read this symbol and remove it altogether. */
 struct jit_descriptor __jit_debug_descriptor = { 1, 0, 0, 0 };

 /* End GDB interface.  */
--
1.7.10.2.552.gaa3bb87

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-05-22 10:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-22 10:26 [Qemu-devel] [PATCHv2 2/9] tcg: __jit_debug_descriptor must *not* be static Jim Meyering

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).