I'm trying to link directly using ld
to isolate a build problem.
When I include /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.so
, I get a few issues:
ac-aaa.o: In function `__static_initialization_and_destruction_0':
/usr/include/c++/4.7/iostream:75: undefined reference to `__dso_handle'
ac-callback.o: In function `__static_initialization_and_destruction_0':
/usr/include/c++/4.7/iostream:75: undefined reference to `__dso_handle'
...
Searching for __dso_handle
:
$ grep __dso_handle /usr/lib/gcc/x86_64-linux-gnu/4.7/*
Binary file /usr/lib/gcc/x86_64-linux-gnu/4.7/cc1plus matches
Binary file /usr/lib/gcc/x86_64-linux-gnu/4.7/crtbegin.o matches
Binary file /usr/lib/gcc/x86_64-linux-gnu/4.7/crtbeginS.o matches
Binary file /usr/lib/gcc/x86_64-linux-gnu/4.7/crtbeginT.o matches
What is the difference between crtbegin.o
, crtbeginT.o
and crtbeginS.o
?