[PATCH] D24801: [ELF] - Fix combination of -script and relocatable output.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 15:53:43 PDT 2016


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.

On Mon, Oct 10, 2016 at 1:39 AM, Peter Smith <peter.smith at linaro.org> wrote:

> peter.smith added a comment.
>
> 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.
>
> The only use case that I know of from ld.bfd is the creation of linux
> kernel modules.
> The script in question seems to be: https://github.com/torvalds/
> linux/blob/master/scripts/module-common.lds
>
> 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: http://fxr.watson.org/fxr/source/conf/kmod.mk
> This seems to use ld -r but does not use an ldscript:
> .if ${__KLD_SHARED} == yes
>
>   232 ${KMOD}.kld: ${OBJS}
>   233 .else
>   234 ${FULLPROG}: ${OBJS}
>   235 .endif
>   236         ${LD} ${_LDFLAGS} -r -d -o ${.TARGET} ${OBJS}
>   237 .if ${MK_CTF} != "no"
>   238         ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}
>   239 .endif
>
> I'm not a Linux or BSD expert, my background is tools for bare-metal
> embedded systems. This may be out of date.
>
> In summary I think a case could be made for not supporting the combination
> until someone actually needs it.
>
>
> https://reviews.llvm.org/D24801
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161010/c5f6f600/attachment.html>


More information about the llvm-commits mailing list