This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: Avoid link error with Solaris ld and local COMDAT group signature symbols (PR gas/12181)


Mark Mitchell <mark@codesourcery.com> writes:

>> While the Solaris linker maintainers are willing to change ld,
>> unfortunately nobody cared to comment on their analysis in the PR.
>> Could someone (Mark?) please to so to get some progress on the Sun ld
>> side of things?
>
> I've now commented in the PR.

Thanks.  I've passed this on and the fill will appear in Solaris 11
build 154.

>> -	  symbol_get_obj (sy)->local = 1;
>> +	  symbol_get_bfdsym (sy)->flags |= BSF_OBJECT | BSF_GLOBAL;
>> +	  S_SET_OTHER (sy, STV_HIDDEN);
>
> FWIW, this seems like a hack to me.  I think the symbol really should be
> local; why expose it to other systems?  If we want to do this for
> Solaris ld compatibility (which I agree is a valid reason), I think we
> should do conditionally on Solaris.

Here's the patch that does this.  It allowed me too bootstrap GCC
mainline with both Sun ld (unfixed) and CVS GNU ld without regressions.

Ok for mainline and 2.2.1 branch now?

Thanks.
	Rainer


2010-11-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR gas/12181
	* config/obj-elf.c (elf_adjust_symtab) [TE_SOLARIS]: Make sy
	global hidden.

diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 79f8033..4b84bdb 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -2142,7 +2142,14 @@ elf_adjust_symtab (void)
 	{
 	  /* Create the symbol now.  */
 	  sy = symbol_new (group_name, now_seg, (valueT) 0, frag_now);
+#ifdef TE_SOLARIS
+	  /* Before Solaris 11 build 154, Sun ld rejects local group
+	     signature symbols, so make them global hidden instead.  */
+	  symbol_get_bfdsym (sy)->flags |= BSF_OBJECT | BSF_GLOBAL;
+	  S_SET_OTHER (sy, STV_HIDDEN);
+#else
 	  symbol_get_obj (sy)->local = 1;
+#endif
 	  symbol_table_insert (sy);
 	}
       elf_group_id (s) = symbol_get_bfdsym (sy);

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


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