<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 17, 2015 at 5:57 PM, Ed Maste via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On 5 November 2015 at 18:13, Davide Italiano via llvm-commits<br>
<span class=""><<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
><br>
> Just FYI even in FreeBSD this is not very high priority. -r is used<br>
> only for OpenPAM and another few modules that we can (easily)<br>
> disabled.<br>
<br>
</span>We can disable the openpam_static build, but then we won't have the<br>
static openpam library. Although it's a little odd, we do rely on -r's<br>
functionality.<br>
<br>
In normal operation pam is usually accessed as a set of shared objects<br>
that are loaded based on a configuration file, but we also build a<br>
static library with all of the modules included. Symbols from the<br>
individual modules are not directly referenced. Instead we use a<br>
linker set, and a function iterates over the set to locate the desired<br>
"module" based on a string match. The build uses -r to link the search<br>
routine and all of the modules into a single .o which is subsequently<br>
built into the ar archive. We could replace this with an archive<br>
containing the individual module objects, but this would then require<br>
consumers to link with --whole-archive.<br>
<br>
This may well be an esoteric use case (along with crunchgen) that we<br>
don't feel the need to support in LLD, but I suspect there are some<br>
similar uses of -r in the wild.<br></blockquote><div> </div><div>Thanks for the info. I saw some need for -r, and I agree that this is just one case and there would be other use cases in the wild. At the same time, I feel like they do that way since the linker supports that feature, which could have been done in a different way. They could update the code to remove dependency to the -r functionality. (I'm happy to contribute such patch to a project that uses -r.) It is much harder to remove a feature than adding, so I'd want to be conservative now.</div><div><br></div><div>It sounds like OpenPAM static build could be updated so that it does not use -r, couldn't it?</div></div></div></div>