bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/12181] local COMDAT group names break linking libstdc++.so with


From: hjl.tools at gmail dot com
Subject: [Bug gas/12181] local COMDAT group names break linking libstdc++.so with Sun ld
Date: Sun, 18 Feb 2018 18:08:58 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=12181

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Mark Mitchell from comment #3)
> For what it's worth, and without knowledge of the Solaris linker, I agree
> that the code in the Solaris linker seems to be unecessary.  I don't see
> anything wrong with the symbols as they currently stand.
> 
> It seems slightly undesirable to me to make them global hidden simply
> because that does mean that the linker will "see" them outside of the object
> file where they are defined, and that just seems messy.

obj-elf.c has

      if (!sy 
          || (sy != symbol_lastP
              && (sy->sy_next == NULL 
                  || sy->sy_next->sy_previous != sy)))
        {
          /* 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 weak hidden instead.  */
          symbol_get_bfdsym (sy)->flags |= BSF_WEAK;
          S_SET_OTHER (sy, STV_HIDDEN);
#else
          symbol_get_obj (sy)->local = 1; 
#endif
          symbol_table_insert (sy);

This is wrong:

address@hidden ld]$ cat x.s
        .text
        .global xxx
xxx:
        call foo
address@hidden ld]$ cat y.s
        .section        .text.foo,"Gx",%progbits,foo,comdat
        .text
        .global bar
bar:
        call xxx
address@hidden ld]$ ../gas/as-new -o x.o x.s
address@hidden ld]$ ../gas/as-new -o y.o y.s
address@hidden ld]$ readelf -sW x.o | grep foo
     5: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND foo
address@hidden ld]$ readelf -sW y.o | grep foo
     8: 0000000000000000     0 NOTYPE  WEAK   HIDDEN     1 foo
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  foo shouldn't be weak and
hidden.
address@hidden ld]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]