Re: Bumping libpq version number? - Mailing list pgsql-hackers

From Andrew - Supernews
Subject Re: Bumping libpq version number?
Date
Msg-id slrnd39cjp.3a6.andrew+nonews@trinity.supernews.net
Whole thread Raw
In response to Re: Bumping libpq version number?  (Andrew - Supernews <andrew+nonews@supernews.com>)
List pgsql-hackers
On 2005-03-13, Bruce Momjian <pgman@candle.pha.pa.us> wrote:
> Andrew - Supernews wrote:
>> On 2005-03-11, Bruce Momjian <pgman@candle.pha.pa.us> wrote:
>> > I can think of no way to prevent it, except on Win32 that has an exports
>> > file.
>> 
>> At least a significant minority, if not an actual majority, of Unix
>> platforms do allow this; including (to my knowledge) Solaris, AIX and
>> everything using ELF with GNU ld (therefore including Linux and FreeBSD).
>
> OK, how is this done with ELF?

Using version commands in a linker script file.

The minimal example looks about like this (for GNU ld, for Solaris ld
leave off the outer VERSION { } wrapper):

VERSION {   {       global: foo; bar; baz;       local: *;   };
}

This makes all symbols other than "foo", "bar" and "baz" into local symbols,
not visible outside the library.

This much of the Solaris-style symbol versioning support is handled entirely
in the linker and thus should work on any system with ELF and GNU ld, or on
Solaris with the native linker. (The rest requires runtime support, which
probably doesn't exist on platforms other than Solaris.)

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Cost of XLogInsert CRC calculations
Next
From: Oleg Bartunov
Date:
Subject: materialized views