<div dir="ltr">Agreed. I think the fact that ld.bfd supports linker scripts with -r is because the entire ld.bfd is driven by built-in linker scripts. There's no choice to not support linker scripts for them whether it makes sense or not. For us, I think it is better to not support linker scripts for -r.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 10, 2016 at 1:39 AM, Peter Smith <span dir="ltr"><<a href="mailto:peter.smith@linaro.org" target="_blank">peter.smith@linaro.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">peter.smith added a comment.<br>
<br>
I don't have a personal use case for ld -r and scripts, it is just one of the possible combinations that someone can use, and make exceptions more difficult.<br>
<br>
The only use case that I know of from ld.bfd is the creation of linux kernel modules.<br>
The script in question seems to be: <a href="https://github.com/torvalds/linux/blob/master/scripts/module-common.lds" rel="noreferrer" target="_blank">https://github.com/torvalds/<wbr>linux/blob/master/scripts/<wbr>module-common.lds</a><br>
<br>
As to whether we need them, I think anyone using linux will happily use ld.bfd or gold. For BSD there may not be an option other that lld. From what I can dig up via searching the web I found the makefile for BSD kernel modules: <a href="http://fxr.watson.org/fxr/source/conf/kmod.mk" rel="noreferrer" target="_blank">http://fxr.watson.org/fxr/<wbr>source/conf/kmod.mk</a><br>
This seems to use ld -r but does not use an ldscript:<br>
.if ${__KLD_SHARED} == yes<br>
<br>
  232 ${KMOD}.kld: ${OBJS}<br>
  233 .else<br>
  234 ${FULLPROG}: ${OBJS}<br>
  235 .endif<br>
  236         ${LD} ${_LDFLAGS} -r -d -o ${.TARGET} ${OBJS}<br>
  237 .if ${MK_CTF} != "no"<br>
  238         ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}<br>
  239 .endif<br>
<br>
I'm not a Linux or BSD expert, my background is tools for bare-metal embedded systems. This may be out of date.<br>
<br>
In summary I think a case could be made for not supporting the combination until someone actually needs it.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D24801" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D24801</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>