This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] Skip STT_FUNC symbols when looking for common definitions
- To: binutils at sources dot redhat dot com
- Subject: [PATCH] Skip STT_FUNC symbols when looking for common definitions
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 5 Feb 2001 21:04:53 +0100
- Cc: alfredo dot ferrari at cern dot ch
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
Hi!
If one has a common symbol in the link, none of AIX, DU, Solaris
and HP-UX native linkers considers including an archive member containing
global symbol with the same name if it is a function (unless there is some
other reason why to include that member).
This patch makes GNU ld behaviour consistent with it.
I've checked on Solaris where native ld considers including an archive
member if it is STT_OBJECT or STT_NOTYPE, never STT_FUNC and apparently it
does not matter in which section it is or what size it has.
Ok to commit?
2001-02-05 Jakub Jelinek <jakub@redhat.com>
* elflink.h (elf_link_is_defined_archive_symbol): Don't consider
functions when looking for common data definitions.
--- bfd/elflink.h.jj Mon Feb 5 21:38:51 2001
+++ bfd/elflink.h Mon Feb 5 21:40:42 2001
@@ -201,7 +201,8 @@ elf_link_is_defined_archive_symbol (abfd
if (strcmp (name, symdef->name) == 0)
{
- result = is_global_symbol_definition (abfd, & sym);
+ result = is_global_symbol_definition (abfd, & sym)
+ && ELF_ST_TYPE (sym.st_info) != STT_FUNC;
break;
}
}
Jakub