This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: How to tell gcc that a static function is really used?
- From: "H . J . Lu" <hjl at lucon dot org>
- To: GNU C Library <libc-alpha at sources dot redhat dot com>
- Date: Thu, 17 Jan 2002 17:23:14 -0800
- Subject: Re: How to tell gcc that a static function is really used?
- References: <20020117142047.A6196@lucon.org> <orhepko4w9.fsf@free.redhat.lsd.ic.unicamp.br>
On Thu, Jan 17, 2002 at 10:54:14PM -0200, Alexandre Oliva wrote:
> On Jan 17, 2002, "H . J . Lu" <hjl@lucon.org> wrote:
>
> > won't emit __dl_runtime_resolve. How do I tell gcc 3.1 to generate
> > __dl_runtime_resolve even if -O3 is used?
>
> Try attribute used instead of unused.
>
> > static void __dl_runtime_resolve () __attribute__ ((unused));
>
I'd like to use __attribute__ ((used)) in the mips dynamic linker so
that gcc won't skip a static function. But it is only available in
gcc 3.1. Should I send in a patch with
#if __GNUC_PREREQ (3,1)
# define __attribute_used__ __attribute__ ((__used__))
#else
# define __attribute_used__ __attribute__ ((__unused__))
#endif
H.J.