aboutsummaryrefslogtreecommitdiff
path: root/tccelf.c
diff options
context:
space:
mode:
authorgrischka <grischka>2009-06-17 02:08:54 +0200
committergrischka <grischka>2009-06-17 02:08:54 +0200
commitbba515afe5496ee59fc10c3307577a87c94fb87f (patch)
tree3a97533d7744875977e10a5e8eda1d50180d0115 /tccelf.c
parente7297581fcebbd5242e8349fa9537c4ccb1a9eba (diff)
downloadtinycc-bba515afe5496ee59fc10c3307577a87c94fb87f.tar.gz
tinycc-bba515afe5496ee59fc10c3307577a87c94fb87f.tar.bz2
tccelf: accept BSS symbol with same name from other module
... such as 'int baz;' in two files at the same time
Diffstat (limited to 'tccelf.c')
-rw-r--r--tccelf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tccelf.c b/tccelf.c
index 4020e24..1b0ed13 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -233,7 +233,8 @@ 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) {
+ } else if (esym->st_shndx == SHN_COMMON
+ && (sh_num < SHN_LORESERVE || sh_num == SHN_COMMON)) {
/* gr: Happens with 'tcc ... -static tcctest.c' on e.g. Ubuntu 6.01
No idea if this is the correct solution ... */
goto do_patch;