Project

General

Profile

Bug #3451

archive libraries with no symbols shouldn't require a string table

Added by Rich Lowe almost 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
tools - gate/build tools
Start date:
2013-01-05
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

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).

#1

Updated by Rich Lowe almost 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 50 to 100

Resolved in 87c7234

Also available in: Atom PDF