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

Re: Adding SONAME to a shared object in KLEE



  Hi,

Le 18/02/2016 22:58, Filippo Rusconi a écrit :
> [ longish mail, bear with me ]

Thank you for this long explaination. I just think there is a typo:

[...]
> How would we do that ? We need to tell the linker how to create the
> library file:
> 
> compilation flags to build your libkleeRuntest shared object lib:
> 
> -shared -fPIC -Wl,-soname,libkleeRuntest.so.1.1 -o libkleeRuntest.so.1.1

The argument of the linker option -soname should be the soname and not
the real name:
  -shared -fPIC -Wl,-soname,libkleeRuntest.so.1 -o libkleeRuntest.so.1.1

as this is reflected by your output:
[...]
> readelf -d libkleeRuntest.so.1.1
[...]
>   0x000000000000000e (SONAME)             Library soname: [libkleeRuntest.so.1]
                                                                              ^^^^
no libkleeRuntest.so.1.1 but the correct libkleeRuntest.so.1 soname

>   0x000000000000000c (INIT)               0x4e68

  And a few remarks:
* if the upstream build system want to *link* with this library (after
  creating it), it will need to either use the real name or (better) to
  create the required link (the libNAME.so link)
* if the upstream build system want to *run* this library (for
  example as part of a test suite), it will need to create the other
  link (the libNAME.so.SOVERSION link) and to play with
  LD_LIBRARY_PATH (or use LD_PRELOAD)
It is were build frameworks such as autotools/libtools helps the
developer...

  Regards,
    Vincent

-- 
Vincent Danjean       GPG key ID 0xD17897FA         vdanjean@debian.org
GPG key fingerprint: 621E 3509 654D D77C 43F5  CA4A F6AE F2AF D178 97FA
Unofficial pkgs: http://moais.imag.fr/membres/vincent.danjean/deb.html
APT repo:  deb http://people.debian.org/~vdanjean/debian unstable main


Reply to: