mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-03 04:30:08 +08:00
Fix 'tcc -static' with recent glibc
This commit is contained in:
parent
c6537d11cb
commit
e2c89576c7
14
tccelf.c
14
tccelf.c
@ -219,13 +219,17 @@ static int add_elf_sym(Section *s, unsigned long value, unsigned long size,
|
|||||||
/* weak is ignored if already global */
|
/* weak is ignored if already global */
|
||||||
} else if (sym_vis == STV_HIDDEN || sym_vis == STV_INTERNAL) {
|
} else if (sym_vis == STV_HIDDEN || sym_vis == STV_INTERNAL) {
|
||||||
/* ignore hidden symbols after */
|
/* ignore hidden symbols after */
|
||||||
|
} else if (esym->st_shndx == SHN_COMMON && sh_num < SHN_LORESERVE) {
|
||||||
|
/* gr: Happens with 'tcc ... -static tcctest.c' on e.g. Ubuntu 6.01
|
||||||
|
No idea if this is the correct solution ... */
|
||||||
|
goto do_patch;
|
||||||
|
} else if (s == tcc_state->dynsymtab_section) {
|
||||||
|
/* we accept that two DLL define the same symbol */
|
||||||
} else {
|
} else {
|
||||||
#if 0
|
#if 1
|
||||||
printf("new_bind=%d new_shndx=%d last_bind=%d old_shndx=%d\n",
|
printf("new_bind=%x new_shndx=%x new_vis=%x old_bind=%x old_shndx=%x old_vis=%x\n",
|
||||||
sym_bind, sh_num, esym_bind, esym->st_shndx);
|
sym_bind, sh_num, new_vis, esym_bind, esym->st_shndx, esym_vis);
|
||||||
#endif
|
#endif
|
||||||
/* NOTE: we accept that two DLL define the same symbol */
|
|
||||||
if (s != tcc_state->dynsymtab_section)
|
|
||||||
error_noabort("'%s' defined twice", name);
|
error_noabort("'%s' defined twice", name);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user