RE: Version of dynamic library
RE: Version of dynamic library
- Subject: RE: Version of dynamic library
- From: "anukriti_shrimal" <email@hidden>
- Date: Fri, 11 Apr 2008 18:43:38 +0530
I need to display the version information for the list of libraries(full
path) given to me as an input without using any tool(like otool, lipo etc.).
This is my project requirement.
Thanks for the information. It has really proved useful.
But I m stuck again.
The approach that I m following is that I read all the fat_arch structs from
the library.Then for each struct I try to match its cpu_type and cpu_subtype
with my system's cpu_type and cpu_subtype. If they match, I'll retrieve the
Mach-O header from the file using that fat_arch struct.
Now, my problem is that for all fat_arch structs, I am getting cpu_type = 0
or 3.
But the header file mach/machine.h doen't define 3 or 0 to be valid types.
My machine is having cpu_type = 7 (x86) and cpu_subtype = 4.
Since these don't match, I m unable to proceed further.
Kindly help.
-----Original Message-----
From:
darwin-kernel-bounces+anukriti_shrimal=email@hidden
[mailto:darwin-kernel-bounces+anukriti_shrimal=email@hidden.
com] On Behalf Of Quinn
Sent: Friday, April 11, 2008 3:09 PM
To: email@hidden
Subject: RE: Version of dynamic library
At 14:45 +0530 11/4/08, anukriti_shrimal wrote:
>Well, when I read the fat_header, it gives following values:
>
> magic = 3199925962, (bebafeca)
> nfat_arch = 0
>Since the no. of fat_archs is 0, how can I determine the version number in
>this case.
A value of zero for fat_archs is very unlikely. You're doing
something wrong in your read code. Here's a typical example of a fat
header:
$ hexdump -n 8 /usr/lib/libSystem.dylib
0000000 ca fe ba be 00 00 00 04
Remember that fat headers are always big endian.
>My high level goal is to find the version of the dynamic library when I m
>given its full path.
That's just a restatement of your original question. I was asking
about /why/ you're trying to get this information. If I can
understand what you're trying to do, I may be able to suggest a
better approach (where "better" means "less code for you to write").
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
istent.co.in
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden