From 09d4e4f408387fa897a9c5d28ef4e50969574da6 Mon Sep 17 00:00:00 2001 From: seyko Date: Tue, 3 Mar 2015 14:39:27 +0300 Subject: [PATCH] Revert a grischka patch: gdb refused to know "main" It is a strange patch because before this commit a gdb is working well and after this commit there is exactly the same problem on Linux: gdb refuses to know "main" Author: grischka Date: Tue Feb 5 21:18:29 2013 +0100 tccelf: fix debug section relocation With: tcc -g hello.c gdb a.out b main gdb refused to know "main" because of broken dwarf info. --- tccelf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tccelf.c b/tccelf.c index 2b07f60..419a0e1 100644 --- a/tccelf.c +++ b/tccelf.c @@ -2302,7 +2302,7 @@ static int final_sections_reloc(TCCState *s1) /* XXX: ignore sections with allocated relocations ? */ for(i = 1; i < s1->nb_sections; i++) { s = s1->sections[i]; - if (s->reloc && s != s1->got) + if (s->reloc && s != s1->got && (s->sh_flags & SHF_ALLOC)) //gr relocate_section(s1, s); }