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: Stripping jni libs



On Dec 26, 2007, at 3:22 PM, Bjorn Roche wrote:

Hey gang,

This is more of a gcc/gnu toolchain question, but it's related to java and in the past y'all've had some good answers, so here goes: I'd like to strip a jnilib so that non-visible functions are harder to spot and futz with by hackers. Here's what I do: I use - fvisibility=hidden and just make a few functions visible (those that are needed for the JNI interface). After the library is compiled, I use strip -x to strip, but no luck -- many of the functions I'd like to hide are still visible when I type nm (they're just not global).

I've also tried strip -s, but this seems to break my library, so if someone had a good example of how to use that, I'd appreciate it.

Another option to try is to pass "-exported_symbols_list <filename>" to ld. That ensures that only teh symbols you specify are exported by your binary. See the ld manpage for more details.


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

This email sent to email@hidden
References: 
 >Stripping jni libs (From: Bjorn Roche <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.