LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-14-2008, 02:21 AM   #1
bootkernel
LQ Newbie
 
Registered: Mar 2008
Posts: 5

Rep: Reputation: 0
detect glibc version based on libpthread.so


Hi,all
I have a libpthread.so,want to know which glibc version compiled this pthread.so
run
Code:
string libpthread.so | grep GLIBC
results:
Code:
GLIBC_2.0
GLIBC_2.1
GLIBC_2.1.1
GLIBC_2.1.2
GLIBC_2.2
GLIBC_2.2.3
GLIBC_2.2.6
GLIBC_2.3.2
GLIBC_PRIVATE
GLIBC_2.1.3
GLIBC_2.3
from above message,can i guess that glibc 2.3.2 version compiled this pthread.so

thanks in advance

Lynn
 
Old 03-15-2008, 01:56 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Quote:
Originally Posted by bootkernel View Post
from above message,can i guess that glibc 2.3.2 version compiled this pthread.so
No, you cannot. Those are members of the version section which give compatibility of specific symbols to specific versions. More detailed information is provided by:
Code:
readelf -V libpthread.so
I am not sure of a reliable way to find out the version of libpthread (at least not without debugging symbols). If you have debugging symbols compiled-in, you can search for the symbol named:
Code:
nptl_version
If you don’t have debugging symbols compiled-in, you have to find this unnamed symbol by other known symbols around it.

I tried this GNU grep out on Gentoo (with glibc-2.7 on amd64) and Ubuntu 7.10 (glibc-2.6.1 on i386), and it gave what you wanted (I am not sure if it will work with earlier or alternate arch versions of glibc):
Code:
grep -az -B30 'Native POSIX Threads Library' libpthread.so
You might have to adjust the number 30 a bit to match yours. If you want the actual version string only:
Code:
grep -az -B30 'Native POSIX Threads Library' libpthread.so | tr '\0' '\n' | head -1
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"symbol __pthread_initialize, version GLIBC_2.0 not defined in file libpthread.so.0" citrus Linux - Software 6 01-05-2007 11:24 PM
glibc... What version? WayneS Linux - Newbie 1 09-13-2006 06:39 PM
/lib/libpthread.so.): version 'GLIBC_2.3.2' not found solutionseeker Linux - Newbie 21 01-29-2005 09:02 PM
what's the difference between libpthread.so and libpthread.a? mmiglia Linux - Software 1 09-16-2004 07:53 AM
glibc version kpachopoulos Linux - Newbie 4 09-09-2004 08:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration