public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/53337] New: [4.7.1 lto] produces warning: relocation refers to discarded section in linker (gold, binutil 2.22)
@ 2012-05-13 19:24 vincenzo.innocente at cern dot ch
  2012-05-14  7:42 ` [Bug lto/53337] " vincenzo.innocente at cern dot ch
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-05-13 19:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53337

             Bug #: 53337
           Summary: [4.7.1 lto] produces warning: relocation refers to
                    discarded section in linker (gold, binutil 2.22)
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vincenzo.innocente@cern.ch


I get these kind of warnings (from gold) with 4.7.1, not with 4.8

c++ -v
Using built-in specs.
COLLECT_GCC=c++
COLLECT_LTO_WRAPPER=/build/ge/new-binutils/b/slc5_amd64_gcc470/external/gcc/4.7.0-cms/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure
--prefix=/build/ge/new-binutils/b/tmp/BUILDROOT/a72d117de7727d2dbd542a4ad4d72e45/opt/cmssw/slc5_amd64_gcc470/external/gcc/4.7.0-cms
--disable-multilib --disable-nls --enable-languages=c,c++,fortran
--enable-gold=yes --enable-lto
--with-gmp=/build/ge/new-binutils/b/tmp/BUILDROOT/a72d117de7727d2dbd542a4ad4d72e45/opt/cmssw/slc5_amd64_gcc470/external/gcc/4.7.0-cms
--with-mpfr=/build/ge/new-binutils/b/tmp/BUILDROOT/a72d117de7727d2dbd542a4ad4d72e45/opt/cmssw/slc5_amd64_gcc470/external/gcc/4.7.0-cms
--with-mpc=/build/ge/new-binutils/b/tmp/BUILDROOT/a72d117de7727d2dbd542a4ad4d72e45/opt/cmssw/slc5_amd64_gcc470/external/gcc/4.7.0-cms
--with-ppl=/build/ge/new-binutils/b/tmp/BUILDROOT/a72d117de7727d2dbd542a4ad4d72e45/opt/cmssw/slc5_amd64_gcc470/external/gcc/4.7.0-cms
--with-cloog=/build/ge/new-binutils/b/tmp/BUILDROOT/a72d117de7727d2dbd542a4ad4d72e45/opt/cmssw/slc5_amd64_gcc470/external/gcc/4.7.0-cms
--enable-cloog-backend=isl --enable-shared CC='gcc -fPIC' CXX='c++ -fPIC'
CPP=cpp CXXCPP='c++ -E'
Thread model: posix
gcc version 4.7.1 20120510 (prerelease) (GCC) 
ld -v
GNU gold (GNU Binutils 2.22) 1.11

when complied with -flto and -O2 this simple code

cat boostLto.cc 
#include "boost/thread/mutex.hpp"
namespace edm {
  namespace rootfix {
    boost::mutex* getGlobalMutex();
  }
}

boost::mutex* edm::rootfix::getGlobalMutex() { 
    static boost::mutex m_;
    return &m_;
}

produces

c++ -O2 -fPIC -shared -o bha.so boostLto.cc -Iboost/1.49.0/include

c++ -O2 -flto -fPIC -shared -o bha.so boostLto.cc -Iboost/1.49.0/include
/tmp/innocent/ccwLpwep.ltrans1.ltrans.o:ccwLpwep.ltrans1.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorISt12out_of_rangeEEEE.local.234:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans1.ltrans.o:ccwLpwep.ltrans1.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorISt12out_of_rangeEEEE.local.234:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans1.ltrans.o:ccwLpwep.ltrans1.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorISt12out_of_rangeEEEE.local.234:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans1.ltrans.o:ccwLpwep.ltrans1.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorISt12out_of_rangeEEEE.local.234:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans1.ltrans.o:ccwLpwep.ltrans1.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_9gregorian15bad_day_of_yearEEEEE.local.240:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans1.ltrans.o:ccwLpwep.ltrans1.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_9gregorian15bad_day_of_yearEEEEE.local.240:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans1.ltrans.o:ccwLpwep.ltrans1.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_9gregorian15bad_day_of_yearEEEEE.local.240:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans1.ltrans.o:ccwLpwep.ltrans1.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_9gregorian15bad_day_of_yearEEEEE.local.240:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans1.ltrans.o:ccwLpwep.ltrans1.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_9gregorian16bad_day_of_monthEEEEE.local.232:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans1.ltrans.o:ccwLpwep.ltrans1.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_9gregorian16bad_day_of_monthEEEEE.local.232:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans1.ltrans.o:ccwLpwep.ltrans1.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_9gregorian16bad_day_of_monthEEEEE.local.232:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans1.ltrans.o:ccwLpwep.ltrans1.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_9gregorian16bad_day_of_monthEEEEE.local.232:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans2.ltrans.o:ccwLpwep.ltrans2.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_12bad_weak_ptrEEEEE.local.230:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans2.ltrans.o:ccwLpwep.ltrans2.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_12bad_weak_ptrEEEEE.local.230:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans2.ltrans.o:ccwLpwep.ltrans2.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_12bad_weak_ptrEEEEE.local.230:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans2.ltrans.o:ccwLpwep.ltrans2.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_12bad_weak_ptrEEEEE.local.230:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans5.ltrans.o:ccwLpwep.ltrans5.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_9gregorian11bad_weekdayEEEEE.local.246:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans5.ltrans.o:ccwLpwep.ltrans5.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_9gregorian11bad_weekdayEEEEE.local.246:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans5.ltrans.o:ccwLpwep.ltrans5.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_9gregorian11bad_weekdayEEEEE.local.246:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans5.ltrans.o:ccwLpwep.ltrans5.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_9gregorian11bad_weekdayEEEEE.local.246:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans5.ltrans.o:ccwLpwep.ltrans5.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_21thread_resource_errorEEEEE.local.236:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans5.ltrans.o:ccwLpwep.ltrans5.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_21thread_resource_errorEEEEE.local.236:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans5.ltrans.o:ccwLpwep.ltrans5.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_21thread_resource_errorEEEEE.local.236:
warning: relocation refers to discarded section
/tmp/innocent/ccwLpwep.ltrans5.ltrans.o:ccwLpwep.ltrans5.o:function
_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_21thread_resource_errorEEEEE.local.236:
warning: relocation refers to discarded section


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug lto/53337] [4.7.1 lto] produces warning: relocation refers to discarded section in linker (gold, binutil 2.22)
  2012-05-13 19:24 [Bug lto/53337] New: [4.7.1 lto] produces warning: relocation refers to discarded section in linker (gold, binutil 2.22) vincenzo.innocente at cern dot ch
@ 2012-05-14  7:42 ` vincenzo.innocente at cern dot ch
  2012-05-14 13:31 ` [Bug lto/53337] 4.7.1 lto " hjl.tools at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-05-14  7:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53337

--- Comment #1 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-05-14 07:39:45 UTC ---
Created attachment 27397
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27397
preprocessed file (for those not having boost)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug lto/53337] 4.7.1 lto produces warning: relocation refers to discarded section in linker (gold, binutil 2.22)
  2012-05-13 19:24 [Bug lto/53337] New: [4.7.1 lto] produces warning: relocation refers to discarded section in linker (gold, binutil 2.22) vincenzo.innocente at cern dot ch
  2012-05-14  7:42 ` [Bug lto/53337] " vincenzo.innocente at cern dot ch
@ 2012-05-14 13:31 ` hjl.tools at gmail dot com
  2012-05-14 14:46 ` vincenzo.innocente at cern dot ch
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: hjl.tools at gmail dot com @ 2012-05-14 13:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53337

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl.tools at gmail dot com

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2012-05-14 13:28:56 UTC ---
Have you tried gold and ld in binutils trunk?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug lto/53337] 4.7.1 lto produces warning: relocation refers to discarded section in linker (gold, binutil 2.22)
  2012-05-13 19:24 [Bug lto/53337] New: [4.7.1 lto] produces warning: relocation refers to discarded section in linker (gold, binutil 2.22) vincenzo.innocente at cern dot ch
  2012-05-14  7:42 ` [Bug lto/53337] " vincenzo.innocente at cern dot ch
  2012-05-14 13:31 ` [Bug lto/53337] 4.7.1 lto " hjl.tools at gmail dot com
@ 2012-05-14 14:46 ` vincenzo.innocente at cern dot ch
  2012-05-15 10:53 ` vincenzo.innocente at cern dot ch
  2012-06-29 10:45 ` vincenzo.innocente at cern dot ch
  4 siblings, 0 replies; 6+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-05-14 14:46 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53337

--- Comment #3 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-05-14 14:08:04 UTC ---
I will try the trunk go binutils.
Still I confirm that this warning does not appear at all (in real-life code,
not just in the attached test case) with gcc 4.8


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug lto/53337] 4.7.1 lto produces warning: relocation refers to discarded section in linker (gold, binutil 2.22)
  2012-05-13 19:24 [Bug lto/53337] New: [4.7.1 lto] produces warning: relocation refers to discarded section in linker (gold, binutil 2.22) vincenzo.innocente at cern dot ch
                   ` (2 preceding siblings ...)
  2012-05-14 14:46 ` vincenzo.innocente at cern dot ch
@ 2012-05-15 10:53 ` vincenzo.innocente at cern dot ch
  2012-06-29 10:45 ` vincenzo.innocente at cern dot ch
  4 siblings, 0 replies; 6+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-05-15 10:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53337

--- Comment #4 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-05-15 10:19:29 UTC ---
tested with latest binutil
no change (but nicer error message)

GNU gold (GNU Binutils 2.22.52.20120515) 1.11
/tmp/innocent/ccIKFOKY.ltrans1.ltrans.o:ccIKFOKY.ltrans1.o:function vtable for
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::out_of_range>
> [clone .local.234]: warning: relocation refers to discarded section
/tmp/innocent/ccIKFOKY.ltrans1.ltrans.o:ccIKFOKY.ltrans1.o:function vtable for
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::out_of_range>
> [clone .local.234]: warning: relocation refers to discarded section
….


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug lto/53337] 4.7.1 lto produces warning: relocation refers to discarded section in linker (gold, binutil 2.22)
  2012-05-13 19:24 [Bug lto/53337] New: [4.7.1 lto] produces warning: relocation refers to discarded section in linker (gold, binutil 2.22) vincenzo.innocente at cern dot ch
                   ` (3 preceding siblings ...)
  2012-05-15 10:53 ` vincenzo.innocente at cern dot ch
@ 2012-06-29 10:45 ` vincenzo.innocente at cern dot ch
  4 siblings, 0 replies; 6+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-06-29 10:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53337

vincenzo Innocente <vincenzo.innocente at cern dot ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #5 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-06-29 10:45:05 UTC ---
get rid of one,  move to 53768

*** This bug has been marked as a duplicate of bug 53768 ***


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-06-29 10:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-13 19:24 [Bug lto/53337] New: [4.7.1 lto] produces warning: relocation refers to discarded section in linker (gold, binutil 2.22) vincenzo.innocente at cern dot ch
2012-05-14  7:42 ` [Bug lto/53337] " vincenzo.innocente at cern dot ch
2012-05-14 13:31 ` [Bug lto/53337] 4.7.1 lto " hjl.tools at gmail dot com
2012-05-14 14:46 ` vincenzo.innocente at cern dot ch
2012-05-15 10:53 ` vincenzo.innocente at cern dot ch
2012-06-29 10:45 ` vincenzo.innocente at cern dot ch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).