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

           Summary: Improve the error message for linking failure
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: qiao...@gentoo.org


I'm building a C++ shared library project. When I add "--coverage" to CXXFLAGS,
the project fails to compile because libtool uses --nostdlib. The error message
is not that helpful:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.2/../../../../x86_64-pc-linux-gnu/bin/ld:
.libs/variable_printer: hidden symbol `atexit' in
/usr/lib64/libc_nonshared.a(atexit.oS) is referenced by DSO
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.2/../../../../x86_64-pc-linux-gnu/bin/ld:
final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[1]: *** [variable_printer] Error 1

The message doesn't tell where the hidden symbol is referenced from. I need to
run readelf to figure what's going on. I wonder if the error output could be
improved to show the information.

Reply via email to