From owner-freebsd-current Sun Mar 12 19:44: 9 2000 Delivered-To: freebsd-current@freebsd.org Received: from cimlogic.com.au (cimlog.lnk.telstra.net [139.130.51.31]) by hub.freebsd.org (Postfix) with ESMTP id 5AD3837B50B for ; Sun, 12 Mar 2000 19:44:05 -0800 (PST) (envelope-from jb@cimlogic.com.au) Received: (from jb@localhost) by cimlogic.com.au (8.9.3/8.9.1) id OAA64073 for current@freebsd.org; Mon, 13 Mar 2000 14:52:02 +1100 (EST) (envelope-from jb) Date: Mon, 13 Mar 2000 14:52:02 +1100 From: John Birrell To: current@freebsd.org Subject: Weak symbols in libc_r broken? Message-ID: <20000313145201.H34294@freebsd1.cimlogic.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.5i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 #include 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 : leal 0xf0,%eax 0x8048222 : int $0x80 0x8048224 : jb 0x8048214 0x8048226 : ret 0x8048227 : 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