From 56f74f2eeb62107de736cca0c2aa38040de3333a Mon Sep 17 00:00:00 2001 From: herman ten brugge Date: Tue, 12 Jan 2021 21:41:41 +0100 Subject: [PATCH] Add shstrtab name in tccelf.c Last commit removed shstrtab which make gdb/readelf unhappy. --- tccelf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tccelf.c b/tccelf.c index 48c9fbe6..de06af21 100644 --- a/tccelf.c +++ b/tccelf.c @@ -2723,7 +2723,7 @@ static void alloc_sec_names(TCCState *s1, int is_obj) s = s1->sections[i]; if (is_obj) s->sh_size = s->data_offset; - if (s->sh_size || (s->sh_flags & SHF_ALLOC)) + if (s == strsec || s->sh_size || (s->sh_flags & SHF_ALLOC)) s->sh_name = put_elf_str(strsec, s->name); } strsec->sh_size = strsec->data_offset;