Bug #3451
closedarchive libraries with no symbols shouldn't require a string table
100%
Description
At present, libelf mandates that any archive library with a symbol table has a "complete" symbol table, as described in ar(3HEAD). This means that we mandate a string table exist, even if there are no symbols in the file.
GNU ar, when it creates an archive with an empty symbol table, has merely the header, not the string table. This causes us to reject the archive, like this:
ld: elf error: file badgnu.a: elf_getarsym
and fail the link. This is annoying where complicated 3rd party software may construct libraries which are only sometimes empty and, if empty on Solaris, will thus fail to build.
This impacts several pieces of software in pkgsrc, has broken mysql in the past, has broken LLVM in the past, and no doubt many others. A search for 'solaris elf_getarsym' displays the gory damage.
We should fix libelf to not require a strtab if the symbol count is 0 (that is, the first uint32 in the symbol table member).
Updated by Rich Lowe almost 11 years ago
- Status changed from New to Resolved
- % Done changed from 50 to 100
Resolved in 87c7234