Note that there are some explanatory texts on larger screens.

plurals
  1. POSymbol hiding in static libraries built with Xcode
    primarykey
    data
    text
    <p>I'm trying to figure out whether I can build a static library that hides all of its internal objects and functions, etc, except for the interfaces I want to export. I'm experimenting with Xcode (gcc 4.2).</p> <p>I've used the <code>__attribute__((visibility("hidden")))</code> attribute on some C++ classes per <a href="http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html" rel="noreferrer">this documentation</a>. I've also defined little helper C functions as being file-local (static), etc.</p> <p>However, when I run <code>strings</code> on the resulting .a library file, even when compiled in Release configuration, I still see the names of my ostensibly-hidden classes, with their method names, and even the names of file-local functions strewn around in there as well. </p> <p>I've added the <code>-fvisibility=hidden</code> and even <code>-fno-rtti</code> to the gcc flags. While this reduces some of the strings, the class names, method names, and static functions names are all still in there in plain or mangled-but-readable form. </p> <p>Is there a reliable way to get the compiler to build this stuff without having the string names of all the internal stuff emitted into the binary? It shouldn't be necessary to have for any external clients linking in.</p> <p>(To clarify: I'm asking about obfuscation of internal naming, versus literal export binding needs. I'm disconcerted that all the internal workings are visible via the <code>strings</code> command, regardless of whether these symbols are formally exported or not.)</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload