Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dlsym(...) and Intel Macs



Wouldn't dlopen() be the first thing to fail if the bundle wasn't of the appropriate architecture? I assume Damien is also properly checking the value of mainHandle against NULL when it's returned...

- Jordan

On Jul 17, 2006, at 8:01 PM, Eric Albert wrote:

On Jul 17, 2006, at 7:08 PM, Damien Sorresso wrote:

Does dlsym(...) not work the same on Intel Macs? I have some symbol loading code that works just fine on PowerPC Macs, but on Intel Macs, it returns NULL. Here is a line.

int *debug_addr = (int *)dlsym(mainHandle, "__debug_level");

This loads the symbol named `__debug_level'. This code is executed from a dynamically-loaded bundle, and it loads the address of the symbol from the main executable. On PowerPC, I get the address you'd get by doing `nm' on the executable. On Intel Macs, I get NULL. Any ideas what's happening here?

Is your bundle universal (or at least built for Intel)? Does nm - arch i386 show the same thing for this sybmol as nm -arch ppc does?


-Eric

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >dlsym(...) and Intel Macs (From: Damien Sorresso <email@hidden>)
 >Re: dlsym(...) and Intel Macs (From: Eric Albert <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.