This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Is it possible to "partially" link static libraries like this


Hi Paul,

I work for a company that is very zealous about guarding its IP, but is also increasing its use of third party vendors for its work. We routinely deliver a static library containing much of our proprietary code to the vendors, who then build drivers from it. The concern came up recently that the static library exports everything, not just the limited number functions the vendors need, and that makes the paranoid even more nervous. So it became my job to see if we could fix it.

I realize the best solution would be to deliver a dynamically linked library, with all the unnecessary symbols stripped, and this is what we're planning to do for the next generation of the product.

Is there some way to accomplish something like this for our current delivery?

I'm not completely familiar with all the possible options to all the tools available, but I can't seem to construct a solution directly looking at the available documentation for ld, objcopy, etc. I was hoping something like this would be possible:

Sorry I do not think that a partial link is not going to do what you want. Depending upon your target architecture and OS format, a partial link may not be able resolve all of the relocs against the internal-to-
your-library functions and so they may still be present in the partially linked object file. You could probably run a test with your own source code easily enough to find out for sure.


If you are worried about IP leakage through the function names then you could easily obfuscate them. Just create a header file with line like:

#define ImplFn1 aa554fdsfast

and then recompile your library with this file included in every source file.

If this list is meant more for tool development rather than discussing unusual usage scenarios, I apologize and would appreciate pointers to a more appropriate place to ask.

Nope, do not worry - this is the correct list for this kind of discussion.


Cheers
  Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]