aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-01-06 21:50:28 +0000
committerIan Lance Taylor <ian@airs.com>1995-01-06 21:50:28 +0000
commit42cf6d7950ebbb91215bac2035055ceb0d5ccda4 (patch)
tree41b6033b36dc1c0adce0a390afa4ff6e6ba428d7 /bfd
parent09722039025db14916df14dc44fbc093317851c1 (diff)
downloadgdb-42cf6d7950ebbb91215bac2035055ceb0d5ccda4.zip
gdb-42cf6d7950ebbb91215bac2035055ceb0d5ccda4.tar.gz
gdb-42cf6d7950ebbb91215bac2035055ceb0d5ccda4.tar.bz2
* elfcode.h (elf_slurp_symbol_table): Don't set BSF_GLOBAL for an
undefined or common symbol. (elf_link_add_object_symbols): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elfcode.h12
2 files changed, 16 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 99d067d..35cb975 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jan 6 16:39:40 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * elfcode.h (elf_slurp_symbol_table): Don't set BSF_GLOBAL for an
+ undefined or common symbol.
+ (elf_link_add_object_symbols): Likewise.
+
Wed Jan 4 14:14:05 1995 Jeff Law (law@snake.cs.utah.edu)
* som.c (bfd_section_from_som_symbol): Only return sections which
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index f0b515b..ec3828e 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -2801,7 +2801,9 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
sym->symbol.flags |= BSF_LOCAL;
break;
case STB_GLOBAL:
- sym->symbol.flags |= BSF_GLOBAL;
+ if (i_sym.st_shndx != SHN_UNDEF
+ && i_sym.st_shndx != SHN_COMMON)
+ sym->symbol.flags |= BSF_GLOBAL;
break;
case STB_WEAK:
sym->symbol.flags |= BSF_WEAK;
@@ -4202,7 +4204,13 @@ elf_link_add_object_symbols (abfd, info)
continue;
}
else if (bind == STB_GLOBAL)
- flags = BSF_GLOBAL;
+ {
+ if (sym.st_shndx != SHN_UNDEF
+ && sym.st_shndx != SHN_COMMON)
+ flags = BSF_GLOBAL;
+ else
+ flags = 0;
+ }
else if (bind == STB_WEAK)
flags = BSF_WEAK;
else