This is the mail archive of the gcc-bugs@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]

gnu.linkonce too aggressive


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
	

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