Re: libpq's pollution of application namespace

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: libpq's pollution of application namespace
Дата
Msg-id 200510241511.j9OFBlD07615@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: libpq's pollution of application namespace  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
This has been saved for the 8.2 release:
http://momjian.postgresql.org/cgi-bin/pgpatches_hold

---------------------------------------------------------------------------

Martijn van Oosterhout wrote:
-- Start of PGP signed section.
> On Sun, Oct 16, 2005 at 06:21:37PM -0400, Tom Lane wrote:
> > I find that libpq.so exports the following symbols that have neither
> > PQ, pq, pg, nor lo_ as a prefix:
> 
> <snip>
> 
> > It'd be nicer if we could filter out all exported symbols that don't
> > appear in exports.txt, but I don't know any portable way to do that.
> 
> With GNU LD it is trivial, using the --version-script command. If you
> use AWK to create the script from exports.txt like so:
> 
> awk 'BEGIN { print "{ global: " } { if( $1 != "#" ) {print $1,";"} } END { print "local: *; };" }' <exports.txt
>exports.version
> 
> And then add "-Wl,--version-script,exports.version" to the link
> command, viola, stray symbols removed. Given we already have a
> configure test for GNU ld, it wouldn't be too hard to make it work for
> them. For windows it already uses exports.txt. What other linkers do we
> need to support?
> 
> Another possibility would be to use strip like so:
> 
> strip -w -K PQ* -K pq* -K pg* -K lo_* -K *PQ* -o output.so
> 
> But then, that may be a GNU strip extention... And it doesn't follow
> the exports file then.
> 
> Recent gcc versions support visibility directives in the source code but
> that's a lot more work (although doing it in the code would produce a
> more efficient library). And not portable to other compilers either...
> 
> Hope this helps,
> -- 
> Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> > tool for doing 5% of the work and then sitting around waiting for someone
> > else to do the other 95% so you can sue them.
-- End of PGP section, PGP failed!

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [PATCHES] Win32 CHECK_FOR_INTERRUPTS() performance
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCHES] Win32 CHECK_FOR_INTERRUPTS() performance