Received: from eggs.gnu.org ([208.118.235.92]:58364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWmIV-00082q-DE for qemu-devel@nongnu.org; Tue, 22 May 2012 06:26:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWmIO-0008Qg-77 for qemu-devel@nongnu.org; Tue, 22 May 2012 06:26:34 -0400 Received: from mx.meyering.net ([88.168.87.75]:39573 helo=hx.meyering.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWmIN-0008QG-Ri for qemu-devel@nongnu.org; Tue, 22 May 2012 06:26:28 -0400 From: Jim Meyering Date: Tue, 22 May 2012 12:26:11 +0200 Message-Id: <1337682371-23924-1-git-send-email-jim@meyering.net> Subject: [Qemu-devel] [PATCHv2 2/9] tcg: __jit_debug_descriptor must *not* be static List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jim Meyering , Peter Maydell From: Jim Meyering Add comments so no one else will be tempted to reduce the scope of this global variable. Signed-off-by: Jim Meyering --- 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