On Friday 23 March 2007 11:48, Matthew R. Dempsky wrote:
> On Fri, Mar 23, 2007 at 10:27:45AM -0700, J.C. Roberts wrote:
> > No. You've just destroyed your libraries in a way that's worse than
> > just deleting them since now you will need to wade through strange
> > error messages which are trying to tell you why your stripped
> > libraries no longer work.
>
> Stripping symbols from a .a archive does render it useless, but I
> suspect otherwise you're thinking about .so libraries.  Archives are
> only used at link-time.  ld.so(1) deals with shared objects files
> (i.e., .so files).

Yep, I was less than perfectly clear. The result of removing all symbols
from static, link-time libaries (archives) will trash them but since he
had said, "You may also stripe (SIC) nearly all of your libraries," I
tried to cover what happens when you remove all symbols from shared
libraries.

Unfortunately, it actually is possible to remove the typically used
function name symbols from dynamically loaded libraries (shared
objects). Stripping the function name symbols (along with debug
symbols) from shared libraries is often used in copyright protection
schemes as a way to thwart auditing and analysis. The resoning is
because some feel that the function names help with understanding the
code. -BUT important thing to remember is the protected programs using
these libraries _only_ work because they are not calling the shared
library functions by name. Though this kind of nonsense can be made to
work in UNIX, the approach is more typically seen in Microsoft Windows
applications.

In contrast to "protected" programs where the shared library functions
are called by ordinal or some other convoluted method, most normal
programs will call by name. On an open source unix system where the
shared libraries are actually used by many different programs written
by many different people, removing all the symbols will generally break
any program that tires to call by name.  -The only possible exception I
can dream up is if strip(1) with --strip-all is smart enough to not
remove the needed relocation symbols, the shared library has DT_FLAGS
set with DF_SYMBOLIC, and strip(1) is also smart enough to notice
DF_SYMBOLIC and not remove symbolic function names but that's a whole
lot of "if's" and I think it would only save you on elf?

JCR

Reply via email to