This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]