How to tell gcc that a static function is really used?

H . J . Lu hjl@lucon.org
Thu Jan 17 17:23:00 GMT 2002


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.



More information about the Libc-alpha mailing list