<div>I have just checked it, the startup.elf and realmode.elf are fine. Only few changes are required for mainline kernel and one commit has to be reverted from lld and a few patches have to be applied.</div><div> </div><div>The only step when I have used BFD is linking vmlinux. I have manually set LD variable in vmlinux_link() function. The vmlinux produced by lld doesn't work yet. I will compare it to the one produced by GNU ld and try to figure out what is wrong (maybe you can suggest some useful objdump flags?)</div><div> </div><div>Regards,</div><div>Dmitry</div><div><br /></div><div><br /></div><div>03.02.2017, 02:23, "Sean Silva" <chisophugis@gmail.com>:</div><blockquote type="cite"><div dir="ltr"><br /><div><br /><div>On Thu, Feb 2, 2017 at 12:38 AM, George Rimar <span dir="ltr"><<a href="mailto:grimar@accesssoftek.com" target="_blank">grimar@accesssoftek.com</a>></span> wrote:<br /><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex;">




<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif;"><span>
<p><span style="color:rgb(33,33,33);font-size:12pt;">>As far as the setup, I would recommend setting up qemu for actually running the LLD-linked kernel and custom bootloader etc. because then you can have a single >script that rebuilds the bootloader and
 kernel and copies the files to the VM. This reduces iteration time significantly.</span><br />
</p>
</span><div style="color:rgb(33,33,33);">
<div>
<div dir="ltr">
<div>
<div><span>
<div>>Davide is the one that set that up and could probably provide more details, but qemu docs might be good enough that you can set things up without much effort </div>
<div>>(not sure though).</div>
<div>> </div>
<div>>-- Sean Silva</div>
<div> ​<br />
</div>
</span><div>By the way, yesterday I configured "smallest possible kernel", linked it with BFD and launched under QEMU.<br />
</div>
<div>It is very small and takes a few seconds to build it from scratch for me, used next article:<br />
</div>
<div><a href="http://mgalgs.github.io/2015/05/16/how-to-build-a-custom-linux-kernel-for-qemu-2015-edition.html" target="_blank">http://mgalgs.github.io/2015/<wbr />05/16/how-to-build-a-custom-<wbr />linux-kernel-for-qemu-2015-<wbr />edition.html</a><br />
</div>
<div><br />
</div>
<div>Now I am going to link it with LLD and check if it boots or now. </div>
<div>I think that should be fastest way - boot that little core and then enable features<br />
</div>
<div>one by one or group by group and fix other things on the road.<br /></div></div></div></div></div></div></div></blockquote><div><br /></div><div>My experience with linker bugs is that usually when things are mis-linked, they are in the "core". E.g. startup code. So linking a small kernel may not avoid as many bugs as you expect. For example, for FreeBSD, I don't think we hit any issues in anything that could have been configured out.</div><div><br /></div><div>-- Sean Silva</div><div> </div><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex;"><div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif;"><div style="color:rgb(33,33,33);"><div><div dir="ltr"><div><div><div>
</div>
<div><br />
</div>
<div>Previously I also worked on a patches for kernel but did not try to minimize it and used some default configuration,<br />
</div>
<div>what probably was good for finding mutliple issues from all sides, but not ideal way to fix/test startup and things.<span><font color="#888888"><br />
</font></span></div><span><font color="#888888">
<div><br />
</div>
<div>George.<br />
</div>
</font></span></div>
</div>
</div>
</div>
</div>
</div>

</blockquote></div><br /></div></div>
</blockquote>