From: Jim Meyering <meyer...@redhat.com> Add comments so no one else will be tempted to reduce the scope of this global variable.
Signed-off-by: Jim Meyering <meyer...@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