From 079692016ded4eed1119eb9b8b7996629d2179f5 Mon Sep 17 00:00:00 2001 From: herman ten brugge Date: Sun, 11 Dec 2022 15:36:37 +0100 Subject: [PATCH] Fix stab debug problem with common section --- tccdbg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tccdbg.c b/tccdbg.c index 3f74d70a..4a90f412 100644 --- a/tccdbg.c +++ b/tccdbg.c @@ -1958,7 +1958,8 @@ ST_FUNC void tcc_debug_extern_sym(TCCState *s1, Sym *sym, int sh_num, int sym_bi } else { - Section *s = s1->sections[sh_num]; + Section *s = sh_num == SHN_COMMON ? common_section + : s1->sections[sh_num]; CString str; cstr_new (&str);