Possible bug with __attribute__((constructor)) and static libraries
Paweł Sikora
pluto@agmk.net
Tue Aug 29 13:39:00 GMT 2006
$ make
g++ module.cpp -c -O2
ar cq libmodule.a module.o
g++ test.cpp module.o -o from-object
g++ test.cpp -Wl,--whole-archive libmodule.a -Wl,--no-whole-archive \
-o from-lib
$ ./from-object
Yay life is good.
$ ./from-lib
Yay life is good.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: module.cpp
Type: text/x-c++src
Size: 119 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20060829/c0456ad4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cpp
Type: text/x-c++src
Size: 49 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20060829/c0456ad4/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: module.hpp
Type: text/x-c++hdr
Size: 41 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20060829/c0456ad4/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: text/x-makefile
Size: 179 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20060829/c0456ad4/attachment-0003.bin>
More information about the Gcc-bugs
mailing list