This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
re: [Help] __CTOR_END__
- From: Daniel Kegel <dank at kegel dot com>
- To: libc-alpha at sources dot redhat dot com, cjaiprakash at noida dot hcltech dot com
- Date: Wed, 29 Sep 2004 12:42:16 -0700
- Subject: re: [Help] __CTOR_END__
"C Jaiprakash, Noida" <cjaiprakash at noida dot hcltech dot com> wrote:
I am porting glibc for coldfire v4e. I am using glibc 2.3.2 as base
sources. I have almost done with it. glibc builds fine. But sofini.c file
when compiled have no __CTOR_END__ symbol. I suppose i have to compile this
file with -fno-unit-at-a-time option . But i am not sure where to put this
option? I am using gcc 3.4 and binutils 2.15.91.
Is it correct to add something like CFLAGS-so-fini.c = -fno-unit-at-a-time
in elf/Makefile?
It might be more correct to ditch glibc-2.3.2 and use glibc-2.3.3 instead, I bet.
It already has fixes for many problems like this.
A little googling found this changeset which seems related:
+2003-07-22 Andreas Jaeger <aj@suse.de>
+
+ * elf/readlib.c (process_file): Check that file is a shared
+ object.
+
+ * elf/sofini.c (__FRAME_END__): Use attribute used so that gcc
+ will not optimize it away.
+ (__DTOR_END__): Likewise.
+ (__CTOR_END__): Likewise.
+
+ * include/libc-symbols.h (_elf_set_element): Use attribute used so
+ that gcc will not optimize it away.
+ (link_warning): Likewise.
You can see the sofini.c part of that at
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/elf/sofini.c?cvsroot=glibc
- Dan
p.s. if you're unable to move to glibc-2.3.3 or cvs, the patches in
http://kegel.com/crosstool/crosstool-0.28-rc36/patches/glibc-2.3.2
might be of some help to you, particularly glibc-2.3.2-allow-gcc-3.4-nounit.patch
You might find that crosstool is a good way to run regression tests
to make sure your changes don't break building glibc for other architectures;
it's easy to set up a build for all CPU types glibc supports using crosstool.