readelf warning on libbass.so

Started by saga,

saga

We're using patchelf to modify the soname of the Linux x64 version of BASS (otherwise it is not found during the linking process; not sure if that is an issue with CMake or the linker). However, patchelf/readelf shows some warnings when parsing the BASS library which then end up in stderr (so it may seem to the build process like there was an error):

readelf -a ./libbass.so
[...]
Symbol table '.dynsym' contains 195 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 00035240     0 NOTYPE  LOCAL  DEFAULT   24 _edata
readelf: Warning: local symbol 1 found at index >= .dynsym's sh_info value of 1
     2: 00047d68     0 NOTYPE  LOCAL  DEFAULT   25 _end
readelf: Warning: local symbol 2 found at index >= .dynsym's sh_info value of 1
     3: 00035240     0 NOTYPE  LOCAL  DEFAULT   25 __bss_start
readelf: Warning: local symbol 3 found at index >= .dynsym's sh_info value of 1
     4: 00024ff6    75 FUNC    GLOBAL DEFAULT   10 BASS_SampleSetData
[...]
It seems like the library is doing some unusual things there which readelf doesn't like. Do you think this is something that could be fixed on the BASS side?
From what I recall, this didn't happen with earlier versions of BASS (from early 2019).

Ian @ un4seen

I'm not certain, but it looks like those warnings may be related to the gcc or binutils version on the current Linux build system. The readelf on the that system doesn't show any warnings, but it does on a more recent system. I guess it isn't a big problem as it isn't stopping the BASS libraries working, or are you finding that it is causing a problem?

saga

It's not an immediate issue, but readelf puts these warnings in stderr so QtCreator's CMake integration thinks that something went wrong during the build. We can most probably work around that, but I thought that I'd report it anyway since it might hint at an issue with the library file itself.

saga

Coming back to this, or something similar at least... We're currently trying to use link using LLVM's lld instead of the GNU tools, and the issue is no longer treated as a warning but an actual error:

ld.lld: error: libbassmix.so: invalid local symbol '_edata' in global part of symbol table
ld.lld: error: libbassmix.so: invalid local symbol '_end' in global part of symbol table
ld.lld: error: libbassmix.so: invalid local symbol '__bss_start' in global part of symbol table

Interestingly the problem appears to be gone with the main BASS library but remains with BASSMIX.

Ian @ un4seen

This issue is/was related to the binutils version that's used to build the Linux libraries. A newer binutils version (which doesn't have the issue) is used these days, but there hasn't yet been a BASSmix release since the change. There should be a new release coming sometime soon. In the meantime, here's the latest build:

    www.un4seen.com/stuff/bassmix-linux.zip