bug-binutils
[Top][All Lists]
Advanced

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

[Bug gold/13245] New: PREVAILING_DEF reported too often.


From: hubicka at gcc dot gnu.org
Subject: [Bug gold/13245] New: PREVAILING_DEF reported too often.
Date: Sat, 01 Oct 2011 15:48:56 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=13245

             Bug #: 13245
           Summary: PREVAILING_DEF reported too often.
           Product: binutils
           Version: 2.23 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified


Consider the following:
address@hidden:/abuild/jh/trunk-install/bin> cat t.C
__attribute__ ((noinline))
inline int test()
{
}

void
test3()
{
  test();
}
address@hidden:/abuild/jh/trunk-install/bin> cat t2.C

__attribute__ ((noinline))
inline int test()
{
}

extern void test3();
int test2()
{
  test();
  test3();
}
address@hidden:/abuild/jh/trunk-install/bin> ./gcc t.C --shared -o libt.so -fPIC
address@hidden:/abuild/jh/trunk-install/bin> ./gcc t2.C --shared -o t2.so -fPIC 
-L ./
-lt -flto -fuse-linker-plugin --save-temps
[Leaving LTRANS /tmp/cc4hfq9X.args]
[Leaving LTRANS t2.so.ltrans.out]
[Leaving LTRANS /tmp/ccGWs68c.args]
[Leaving LTRANS t2.so.ltrans0.o]
address@hidden:/abuild/jh/trunk-install/bin> more ./*.res
1
t2.o 3
164 929187be PREVAILING_DEF _Z4testv
172 929187be PREVAILING_DEF_IRONLY_EXP _Z5test2v
176 929187be RESOLVED_DYN _Z5test3v
address@hidden:/abuild/jh/trunk-install/bin> 

Here the function test is comdat both in libt.so and t2.so. 
In t2.so we would like to make it static because doing so improves dynamic
linking time (i.e. the function in question don't need to be resolved at all).
We can't want to do that in libt.so because that one is not LTOed.

This would happen if linker returned PREVAILING_DEF_IRONLY_EXP for _Z4testv
instead of PREVAILING_DEF.  I think this is consistent with documentation of it
- i.e. symbol is IRONLY within current DSO but exported. It does not matter
much whether we know if libt.so will bind to it or not.

I.e. I would like the output to be equivalent to:
address@hidden:/abuild/jh/trunk-install/bin> ./gcc t2.C --shared -o t2.so -fPIC 
-L ./
 -flto -fuse-linker-plugin --save-temps
[Leaving LTRANS /tmp/ccJrd58U.args]
[Leaving LTRANS t2.so.ltrans.out]
[Leaving LTRANS /tmp/ccyRSkGM.args]
[Leaving LTRANS t2.so.ltrans0.o]
address@hidden:/abuild/jh/trunk-install/bin> more ./*.res
1
t2.o 3
164 72744d77 PREVAILING_DEF_IRONLY_EXP _Z4testv
172 72744d77 PREVAILING_DEF_IRONLY_EXP _Z5test2v
176 72744d77 UNDEF _Z5test3v
address@hidden:/abuild/jh/trunk-install/bin> nm -D t2.so
                 w _Jv_RegisterClasses
000000000000055c T _Z5test2v
                 U _Z5test3v
00000000000018c0 A __bss_start
                 w __cxa_finalize
                 w __gmon_start__
00000000000018c0 A _edata
00000000000018d0 A _end
00000000000005b8 T _fini
0000000000000448 T _init

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]