Is it just me, or are the weak symbols in libc_r confusing the linker?

When I link the following program with "gcc -v -g -static -pthread"

====
#include <stdio.h>
#include <time.h>

int main (int argc, char *argv[])
{
    struct timespec t1;
    struct timespec t2;
    t1.tv_sec   = 5;
    t1.tv_nsec  = 0;
    nanosleep(&t1,&t2);
    printf("Remaining time %ld.%09ld\n",(long) t2.tv_sec, (long) t2.tv_nsec);
    return(0);
}
====

the linker gives me the weak symbol version which refers to
_thread_sys_nanosleep (i.e. the syscall), instead of the nanosleep
function in libc_r.

Is there someone with a recent -current system who has time to try
this out? Link the program and use gdb to disassemble the nanosleep
function. If you get:

(gdb) disassemble nanosleep
Dump of assembler code for function nanosleep:
0x804821c <nanosleep>:  leal   0xf0,%eax
0x8048222 <nanosleep+6>:        int    $0x80
0x8048224 <nanosleep+8>:        jb     0x8048214 <atexit+92>
0x8048226 <nanosleep+10>:       ret
0x8048227 <nanosleep+11>:       nop
End of assembler dump.

... then libc_r is broken.

TIA.

-- 
John Birrell - [EMAIL PROTECTED]; [EMAIL PROTECTED] http://www.cimlogic.com.au/
               [EMAIL PROTECTED] [EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to