Versioning mess proved!!!

Ulrich Drepper drepper@redhat.com
Tue Oct 3 08:48:00 GMT 2000


Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:

> int main(void)
> {
>    extern void foo (void) __attribute__ ((weak));
>    void (*foop) (void) = foo;
>    printf ("%p\n", foop);
>    if (foop)
>          foop();
>      return 0;
> }

What if you change this to

   extern void foo (void) __attribute__ ((weak));
   void (*foop) (void) = foo;
   asm volatile ("" : "=r" (foop) : "0" (foop));
   printf ("%p\n", foop);
   if (foop)
         foop();
     return 0;

(note the asm).  If this fails, please show me the generated asm code.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------


More information about the Libc-alpha mailing list