mirror of
https://github.com/mirror/tinycc.git
synced 2024-12-28 04:00:06 +08:00
Fix core dump in case -static is used
This commit is contained in:
parent
a4e0f7ef05
commit
afc136262e
2
tccelf.c
2
tccelf.c
@ -2541,7 +2541,7 @@ static void elf_patch_global_offset_size(TCCState *s1, Section *s)
|
|||||||
{
|
{
|
||||||
int sym_index;
|
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;
|
((ElfW(Sym) *)s->data)[sym_index].st_size = s1->got->data_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user