[Bug other/11669] [3.4 regression] Calling of static functions does not work (build of glibc broken)

pinskia at physics dot uc dot edu gcc-bugzilla@gcc.gnu.org
Fri Jul 25 14:50:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11669


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-25 14:50 -------
But you should never assume the name of static variable then so the code is still wrong.
The way to fix it is to use asm to make sure the name will be the same as the asm name.
#if USE_DECLARATION
/* Removing the prototype makes this work.  */
static int fixup (int i)__asm__("fixup") __attribute__ ((used)); 
#endif

static int __attribute__ ((__used__))
fixup (int i)
{
  return i+1;
}

int
call_fixup (void)
{

  asm ("call fixup\n\t");

  return 0;
}



More information about the Gcc-bugs mailing list