[PATCH] D28898: [ELF] - Allow emulation to be different from input objects target.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 23 13:56:44 PST 2017


On Mon, Jan 23, 2017 at 1:48 PM, George Rimar <grimar at accesssoftek.com>
wrote:

> > Is there any way to rewrite that part of the linker script in the Linux
> kernel so that the kernel doesn't depend on this dark-corner behavior of
> the bfd linker? If > removing `-m` from Makefile which build that
> particular file fixes the issue, I'd definitely do that.
>
> That probably will work, as well as changing to -m elf_i386. But then
> that means we have bfd, gold and LLD all with different behavior.
> I am not sure why do you want this incompatibility when we can just ignore
> -m if have any object files ?
>

So let's say gold ignores `-m` if at least one .o is present on command
line (I did not verify that myself.) It feels weird, doesn't it? Why should
we ignore `-m` if an object file is given? If that's the correct behavior
for some reason, why don't we completely ignore `-m` even when all object
files are in static archives?

(currently patch do override of -m, but I think I can update it to "check
> that -m is valid value and ignore it if type was inferred from .o")
>
> Current way that looks duplicates gold behavior seems logical enough and
> does not require fix of side applications.
>
> George.​
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170123/bbd895ce/attachment.html>


More information about the llvm-commits mailing list