This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: OpenBSD shared library external versioning
- From: "Ian Lance Taylor via binutils" <binutils at sourceware dot org>
- To: Cary Coutant <ccoutant at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>, Alan Modra <amodra at gmail dot com>, Nick Clifton <nickc at redhat dot com>
- Date: Mon, 18 Jun 2018 10:38:56 -0700
- Subject: Re: OpenBSD shared library external versioning
- References: <CAJimCsH+LE-R3z-n1bQobjGqpdd5XHaKzr=aUesJ2nHWwmRKfA@mail.gmail.com>
- Reply-to: Ian Lance Taylor <iant at google dot com>
On Sat, Jun 16, 2018 at 11:23 AM, Cary Coutant <ccoutant@gmail.com> wrote:
> In PR 23295, the following claim is made:
>
>> On OpenBSD (at least), shared libraries are in the form
>> libname.so.X.Y, where X and Y are both versioned symbol numbers.
>> As I understand gold's code in fileread.cc,
>> Input_file::find_file, if you are not linking statically gold
>> will take each -lname given to it, construct a libname.so and
>> libname.a, and push both onto the search list.
>>
>> This setup does not work for OpenBSD, since there are no bare
>> libname.so shared libraries (with rare exception) gold can never
>> find the shared libraries. I intend to eventually prepare a patch
>> that would permit adding libname.so.X.Y (and likely also
>> libname.so.X as well in case any systems use that scheme) to the
>> search list but am submitting the bug report now in case it is in
>> fact easy enough for someone else to just do it.
>
> Please tell me that ld.bfd doesn't do something as absurd as what he's
> proposing. I've explained how symlinks and sonames work, but he claims
> OpenBSD just doesn't do it that way. I looked through ldfile.c and the
> emultempl/elf32.em version of open_dynamic_archive, but couldn't find
> anything that would support that.
I'm not aware of any special search for OpenBSD, but I'll comment that
SunOS 4 required a similar special search, which is implemented in
gld${EMULATION_NAME}_search_dir in ld/emulteml/sunos.em.
Ian