This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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]

gcov fails to work with shared library on 64bit platform


Hello,

I have a C++ shared library project. When I add "--coverage" to
CXXFLAGS(I also added -g and -O0) and LDFLAGS, the project fails to
compile, here's the error message:

/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
make[1]: *** Waiting for unfinished jobs....
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.2/../../../../x86_64-pc-linux-gnu/bin/ld:
.libs/metadata_generator: 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

variable_printer and metadata_generator are two utilities that are
linked against the shared libraries. The above error only occurs on
64bit platform. It works fine on 32bit platform. I tried with
"configure --disable-shared" and it worked for us. But I don't know
the reason of the above error and can't be sure if --disable-shared is
the correct solution.

-- 
Best wishes,
Mu Qiao
GnuPG fingerprint: 92B1 B0C4 8D14 F8C4 EFA5? 3ACC 30B3 0DE4 17B1 57E9


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