>At this point I'm able to link Linux kernel with LLD and objcopy doen't give me any errors.> >The versions are: > >Linux 4.10.0-rc5 (+ applied the patch from my previous message) >LLD 5.0.0 (https://github.com/llvm-mirror/lld db83a5cc3968b3aac1dbe3270190bd3282862e74) (+ applied D28612) >GNU objcopy (GNU Binutils) 2.27 > >The problem is that the resulting kernel doesn't boot. Does anybody have any suggestions on how to debug it or any guesses what did go wrong while linking? > >Regards, >DmitryIt should not boot atm, I believe. I mentioned earlier, LLD currently generates wrong output for scripts like: .rodata : { *(.rodata) *(.rodata.*) . = ALIGN(16); video_cards = .; *(.videocards) video_cards_end = .;? That is sample from kernel realmode script. We produce wrong values for video_cards/video_cards_end. Reduced sample is D29217, and thread with possible patch for that is D27415 which is under discussions now. (Though there are also probably can be other issues, but that one is obvious atm). I have a question also. You added -m elf_i386 to workaround emulation conflict issue in LLD, do you know does output produced by BFD boot fine after that change ? George. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170129/2ea02ee0/attachment.html>
Dmitry Golovin via llvm-dev
2017-Jan-30 22:35 UTC
[llvm-dev] Linking Linux kernel with LLD
<div>> I have a question also. You added <span style="font-family:"Segoe UI","Segoe UI Web Regular","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255);">-m elf_i386 </span>to workaround emulation conflict issue in LLD, do you know<div>> does output produced by BFD boot fine after that change ?</div>Doesn't seem to affect BFD at all.</div><div><br /></div><div><br /></div><div>29.01.2017, 10:18, "George Rimar" <grimar@accesssoftek.com>:</div><blockquote type="cite"> <div dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;"> <p><span style="color:rgb(33,33,33);font-size:12pt;">>At this point I'm able to link Linux kernel with LLD and objcopy doen't give me any errors.</span><br /> </p> <div style="color:rgb(33,33,33);"> <div> <div>> </div> <div>>The versions are:</div> <div>> </div> <div>>Linux 4.10.0-rc5 (+ applied the patch from my previous message)</div> <div>>LLD 5.0.0 (<a href="https://github.com/llvm-mirror/lld">https://github.com/llvm-mirror/lld</a> db83a5cc3968b3aac1dbe<span>3270190</span>bd<span>3282862</span>e74) (+ applied D28612)</div> <div>>GNU objcopy (GNU Binutils) 2.27</div> <div>> <br /> </div> <div>>The problem is that the resulting kernel doesn't boot. Does anybody have any suggestions on how to debug it or any guesses what did go wrong while linking?</div> <div>> </div> <div>>Regards,</div> <div>>Dmitry<br /> </div> <div><br /> </div> <div>It should not boot atm, I believe.<br /> I mentioned earlier, LLD currently generates wrong output for scripts like:<br /> </div> <div><br /> </div> <div> <pre style="margin-top:0px;margin-bottom:0px;padding:12px;border:0px;background:rgba(71,87,120,0.0784314);overflow:auto;border-radius:3px;white-space:pre-wrap;font-stretch:normal;font-size:12px;line-height:15px;font-family:Menlo,Consolas,Monaco,monospace;">.rodata : { *(.rodata) *(.rodata.*) . = ALIGN(16); video_cards = .; *(.videocards) video_cards_end = .;<br /></pre> <br /> </div> <div>That is sample from kernel realmode script. We produce wrong values for video_cards/video_cards_end.<br /> </div> <div>Reduced sample is D29217, and thread with possible patch for that is D27415 which is under discussions now.<br /> </div> <div>(Though there are also probably can be other issues, but that one is obvious atm).<br /> </div> <div><br /> </div> <div>I have a question also. You added <span style="font-family:"Segoe UI","Segoe UI Web Regular","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255);">-m elf_i386 </span>to workaround emulation conflict issue in LLD, do you know<br /> </div> <div>does output produced by BFD boot fine after that change ?<br /> </div> <div><br /> </div> <div>George.<br /> </div> </div> </div> </div> </blockquote>
>> I have a question also. You added -m elf_i386 to workaround emulation conflict issue in LLD, do you know>> does output produced by BFD boot fine after that change ? >Doesn't seem to affect BFD at all.Thanks ! ?George. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170131/a91cad77/attachment.html>