From afc136262e93ae85fb3643005b36dbfc30d99c42 Mon Sep 17 00:00:00 2001 From: herman ten brugge Date: Thu, 26 May 2022 15:41:52 +0200 Subject: [PATCH] Fix core dump in case -static is used --- tccelf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tccelf.c b/tccelf.c index 7035b7c2..f08460a8 100644 --- a/tccelf.c +++ b/tccelf.c @@ -2541,7 +2541,7 @@ static void elf_patch_global_offset_size(TCCState *s1, Section *s) { int sym_index; - if ((sym_index = find_elf_sym(s, "_GLOBAL_OFFSET_TABLE_"))) + if (s && (sym_index = find_elf_sym(s, "_GLOBAL_OFFSET_TABLE_"))) ((ElfW(Sym) *)s->data)[sym_index].st_size = s1->got->data_offset; }