This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Skip STT_FUNC symbols when looking for common definitions


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]