[PATCH] D14382: [ELF2] - Basic implementation of -r/--relocatable

Ed Maste via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 17:57:01 PST 2015


On 5 November 2015 at 18:13, Davide Italiano via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
> Just FYI even in FreeBSD this is not very high priority. -r is used
> only for OpenPAM and another few modules that we can (easily)
> disabled.

We can disable the openpam_static build, but then we won't have the
static openpam library. Although it's a little odd, we do rely on -r's
functionality.

In normal operation pam is usually accessed as a set of shared objects
that are loaded based on a configuration file, but we also build a
static library with all of the modules included. Symbols from the
individual modules are not directly referenced. Instead we use a
linker set, and a function iterates over the set to locate the desired
"module" based on a string match. The build uses -r to link the search
routine and all of the modules into a single .o which is subsequently
built into the ar archive. We could replace this with an archive
containing the individual module objects, but this would then require
consumers to link with --whole-archive.

This may well be an esoteric use case (along with crunchgen) that we
don't feel the need to support in LLD, but I suspect there are some
similar uses of -r in the wild.


More information about the llvm-commits mailing list