Re: On the cost of libraries



Maciej Stachowiak <mjs noisehavoc org> writes: 
> 1) Will symbols with static linkage automatically be private? (I sure
> hope so).

AFAIK this is true.

> 2) How do I make symbols with extern linkage private to the library?

See GTK - use libtool:

 # libtool option to control which symbols are exported
 # right now, symbols starting with _ are not exported
 LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)

We make private symbols start with _, but if you didn't want to do
that you can also have a file where you make a list of private
symbols. libtool just uses the regexp to generate the file.

Havoc





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]