This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gnu.linkonce too aggressive
- To: bug-gcc at gnu dot org
- Subject: gnu.linkonce too aggressive
- From: "Leonid A. Broukhis" <leob at mailcom dot com>
- Date: Wed, 8 Mar 2000 21:01:25 -0800
The following is using gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
on SPARC/Solaris:
qq.cc:
<<<
#include <stdio.h>
static class A {
public:
A() { printf("from qq\n"); }
} qq;
>>>
ww.cc:
<<<
#include <stdio.h>
static class A {
public:
A() { printf("from ww\n"); }
} ww;
main(){}
>>>
When compiled without optimization (so that the constructor is not inlined
into the global constructors code) will print either "from qq" twice
or "from ww" twice, depending on the linking order.
Shouldn't the file name from where the function was taken be included
in the section name instead of "gnu.linkonce" ?
Leo