This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/DRA744: How to remove 'private' symbols from a C66x library?

Part Number: DRA744

Tool/software: TI C/C++ Compiler

The wiki article mentions that for IP-Protection 'hide' and 'unhide' could be used to remove symbols from e.g. a codec library. That's exactly what one of my customers is trying to accomplish. How does that need to be implemented? Usually a linker step isn't existing if building just a library using the archiver, and ar6x doesn't know any 'hide' or 'unhide' options.

Best regards,

Manfred

  • Later edit ... Please ignore this post.  I keep it here only to preserve the continuity of the thread.  Everything said here turns out to be wrong.  -George

    The techniques in that article presume that partial linking is a practical alternative to a library.  That is the case with COFF object file format.  But it is not the case with ELF object file format.  And except for C2000 (and perhaps other very rare exceptions), ELF is the only object file format in use now.  I will change the article to note that is no longer up-to-date.

    Thanks and regards,

    -George

  • George,

    are there any other options to hide symbols in an ELF library?

    Regards,
    Manfred
  • Manfred,

    I'm glad you pushed me on this.  Because it caused me to take a closer look.  It turns out I was completely wrong.  I take back everything I said in my last post.  You can use partial linking with ELF object format.

    I have not completely checked everything in the wiki article Managing Symbols with the Linker.  But I expect it will mostly work, provided you observe these changes:

    • Never invoke the linker directly with lnk6x.  Always invoke it through the compiler shell cl6x.  Every instance of lnk6x options files should be replaced with cl6x -z  options files
    • Every partial link must use the option  --relocatable (or -r for short).  In ELF, you must retain the relocations if you plan to link again.

    Another change I recommend is a best practice, but not absolutely required.  If your library defines any global or static data, whether exposed to the library user or not, declare it far, and use DATA_SECTION to put it in its own section.  Then document to your library users the expectation on where that data is typically allocated in a system.

    So, with all that as background, you are welcome to use the options --hide and --unhide to hide symbols in a library (which is really a partially linked object file).

    Thanks and regards,

    -George