summaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2001-02-07 23:42:15 +0000
committerNick Clifton <nickc@redhat.com>2001-02-07 23:42:15 +0000
commit7da9d88fe4efed1e933fd0a1dbf681199b9c27bb (patch)
tree0ddd54bbf8ded3d1fcbbef43fc44861cda29a261 /bfd/elflink.h
parent7340082dc8d4b1fcd14f6d18fc0086fdae31d556 (diff)
downloadbinutils-gdb-7da9d88fe4efed1e933fd0a1dbf681199b9c27bb.tar.gz
ignore common definitions of function symbols in unlinked archives
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index d3b44e8831a..9464ff2e106 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -80,9 +80,9 @@ elf_bfd_link_add_symbols (abfd, info)
}
}
-/* Return true iff this is a non-common definition of a symbol. */
+/* Return true iff this is a non-common, definition of a non-function symbol. */
static boolean
-is_global_symbol_definition (abfd, sym)
+is_global_data_symbol_definition (abfd, sym)
bfd * abfd ATTRIBUTE_UNUSED;
Elf_Internal_Sym * sym;
{
@@ -91,6 +91,10 @@ is_global_symbol_definition (abfd, sym)
&& ELF_ST_BIND (sym->st_info) < STB_LOOS)
return false;
+ /* Function symbols do not count. */
+ if (ELF_ST_TYPE (sym->st_info) == STT_FUNC)
+ return false;
+
/* If the section is undefined, then so is the symbol. */
if (sym->st_shndx == SHN_UNDEF)
return false;
@@ -116,7 +120,7 @@ is_global_symbol_definition (abfd, sym)
}
/* Search the symbol table of the archive element of the archive ABFD
- whoes archove map contains a mention of SYMDEF, and determine if
+ whoes archive map contains a mention of SYMDEF, and determine if
the symbol is defined in this element. */
static boolean
elf_link_is_defined_archive_symbol (abfd, symdef)
@@ -201,7 +205,7 @@ elf_link_is_defined_archive_symbol (abfd, symdef)
if (strcmp (name, symdef->name) == 0)
{
- result = is_global_symbol_definition (abfd, & sym);
+ result = is_global_data_symbol_definition (abfd, & sym);
break;
}
}