Date: Mon, 13 Mar 2000 14:52:02 +1100 From: John Birrell <jb@cimlogic.com.au> To: current@freebsd.org Subject: Weak symbols in libc_r broken? Message-ID: <20000313145201.H34294@freebsd1.cimlogic.com.au>
next in thread | raw e-mail | index | archive | help
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 - jb@cimlogic.com.au; jb@freebsd.org http://www.cimlogic.com.au/
john.birrell@ca.com john.birrell@opendirectory.com.au
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000313145201.H34294>
