This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


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

Re: Versioning mess proved!!!


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   `------------------------

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