aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrischka <grischka>2008-03-08 19:58:57 +0000
committergrischka <grischka>2008-03-08 19:58:57 +0000
commite2c89576c7394d6d125b857765ecc31c2e1b3b4f (patch)
tree59b71fb5f0f74e8ecac2c778e952b01803749ac2
parentc6537d11cbda6e23041c9bbb3ab17b722c08dd1d (diff)
downloadtinycc-e2c89576c7394d6d125b857765ecc31c2e1b3b4f.tar.gz
tinycc-e2c89576c7394d6d125b857765ecc31c2e1b3b4f.tar.bz2
Fix 'tcc -static' with recent glibc
-rw-r--r--tccelf.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/tccelf.c b/tccelf.c
index 273d0b9..4913a04 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -219,14 +219,18 @@ static int add_elf_sym(Section *s, unsigned long value, unsigned long size,
/* weak is ignored if already global */
} else if (sym_vis == STV_HIDDEN || sym_vis == STV_INTERNAL) {
/* 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 {
-#if 0
- printf("new_bind=%d new_shndx=%d last_bind=%d old_shndx=%d\n",
- sym_bind, sh_num, esym_bind, esym->st_shndx);
+#if 1
+ printf("new_bind=%x new_shndx=%x new_vis=%x old_bind=%x old_shndx=%x old_vis=%x\n",
+ sym_bind, sh_num, new_vis, esym_bind, esym->st_shndx, esym_vis);
#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 {
do_patch: