Testing internal classes

Thiago Macieira thiago at kde.org
Wed May 10 18:43:36 BST 2006

Friedrich W. H. Kossebau wrote:
>Such thing as? How would convenience lib then be linked in if at this
> point symbols were already restricted to the explicit visible ones?

Because you had a .a file (which is basically just a collection of .o), 
not a shared library. When the *linker* creates an .so, it drops the 
HIDDEN symbols from the dynamic symbol table. That's why applications 
can't link to them.

Static libraries (.a), however, aren't created by the linker. They are 
created by ar (archive). They could just as well be a .zip, .jar or .tar 
(trivia: tar = Tape ARchive and the command line is very similar to ar).

>I thought the trick with the visibility stuff is that the symbol table
> gets reduced to only those which are tagged to be visible.

That's it. No extra trickery :-)

>So if additionally the full symbol table (and inline function data) is
> still separatly available (in some section, before stripping) the lib
> could be also linked using the intern symbols (whose points they refer
> to are nevertheless still there, aren't they?).

No, you can't do that. In ELF binaries, the symbols are matched to by 
their names, not by their addresses. That's why they are dynamically 
linked: it's the dynamic linker (not the static linker, ld) that binds 
those symbols.

>Was in the old build system the visibility flag only used for non-debug
>versions? And now it's not? This would give a reason why the same setup
>worked with the old build system (auto*), that is for sure :)

There was no difference to the flag. You're seeing it more often now 
because Qt4 supports it, while Qt3 didn't.

If your Qt3 wasn't patched to support the flag, KDE wasn't compiled with 
it either.

>Someone with the clue what to do best?

Solution: create static libraries and link to them in the tests.

Static libraries require keeping the dependency information in an extra 
file, like libtool's .la.

Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
  thiago.macieira (AT) trolltech.com     Trolltech AS
    GPG: 0x6EF45358                   |  Sandakerveien 116,
    E067 918B B660 DBD1 105C          |  NO-0402
    966C 33F5 F005 6EF4 5358          |  Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060510/d38139e5/attachment.sig>

More information about the kde-core-devel mailing list