This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Avoid GCC 4.7 optimization in elf/soinit.c
- From: Andreas Schwab <schwab at redhat dot com>
- To: Andreas Jaeger <aj at suse dot de>
- Cc: libc-alpha at sources dot redhat dot com, Richard Guenther <rguenther at suse dot de>, Michael Matz <matz at suse dot de>
- Date: Tue, 27 Sep 2011 15:01:05 +0200
- Subject: Re: Avoid GCC 4.7 optimization in elf/soinit.c
- References: <201109271347.20108.aj@suse.de>
Andreas Jaeger <aj@suse.de> writes:
> We recently got a bug report and analysis showed that gcc 4.7 optimized
> __libc_fini and __libc_global_ctors to empty functions since it checked the
> size of __CTOR_LIST__ and does not know that glibc changes the size at link
> time.
>
> Bug report is:
> https://bugzilla.novell.com/show_bug.cgi?id=717671
>
> I'm appending a patch that fixes the problem,
A better approach is perhaps to make __[CD]TOR_LIST__ volatile.
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."