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]

Re: Function with __attribute__ ((constructor)) not placed in .ctors section


msciboor <msciboor@googlemail.com> writes:

> I read through Internet that .ctors section is used to hold pointers
> to functions with __attribute__ ((constructor)). However when I
> compile my program with function with __attribute__ ((constructor)),
> then .ctors section is empty and this function is invoked directly
> from __libc_csu_init function instead of __do_global_ctors_aux. Was it
> changed lately?

Debian gcc-4.6 4.6.3-8 does place the pointer in .ctors, but ld
of binutils 2.22-6.1 then moves it to .init_array.  Perhaps the
same happens in your test with 4.6.3-1ubuntu5.  Mentioned in
<http://sources.redhat.com/bugzilla/show_bug.cgi?id=12910>.

Debian gcc-4.7 4.7.1-2 places the pointer directly in .init_array.
Implemented in <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46770>.


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