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

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


With gcc 3.1,

# gcc -O3 -S x.c -DASM

won't emit __dl_runtime_resolve. How do I tell gcc 3.1 to generate
__dl_runtime_resolve even if -O3 is used?



H.J.
--x.c---
static void __dl_runtime_resolve () __attribute__ ((unused));

static void
__dl_runtime_resolve ()
{
}

#if ASM
asm ("
	.align 4
.globl _dl_runtime_resolve
	.type	 _dl_runtime_resolve,@function
_dl_runtime_resolve:
	jmp	__dl_runtime_resolve
.Lfe2:
	.size	 _dl_runtime_resolve,.Lfe2-_dl_runtime_resolve");
#else
_dl_runtime_resolve ()
{
  __dl_runtime_resolve ();
}
#endif



More information about the Gcc mailing list