Project

General

Profile

Actions

Feature #2704

open

ld could translate --as-needed to -z ignore

Added by Rich Lowe about 9 years ago. Updated about 9 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
tools - gate/build tools
Start date:
2012-05-09
Due date:
% Done:

50%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

GNU ld has an option, --as-needed to only record dynamic dependencies for libraries which are actually referenced.

We have -z ignore which does the same thing, but also ignores unreferenced ELF sections from relocatable objects.

In practice, it should be safe to map --as-needed to -zignore for GNU compatibility. The risk would be to applications which had unreferenced ELF sections which they nevertheless wished to be represented in output and had discovered and passed --as-needed and did so in a way which positionally affected the input object.

This is unlikely.

The obvious code is available from:

https://github.com/richlowe/illumos-gate/compare/ld/as-needed

Actions #1

Updated by Rich Lowe about 9 years ago

It should be mentioned that while we can do this part, it doesn't actually help for the specific case in which it is desired, because of some other issues related to C++ exception handling.

Implementing this actually makes the case we care about worse, unless that is fixed

Actions #2

Updated by Andrew Stormont about 6 years ago

  • Blocks deleted (Bug #3062: illumos should build/work with GCC 4.6 or newer)
Actions

Also available in: Atom PDF