<div xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml">11.10.2018, 22:55, "Carter Cheng" <cartercheng@gmail.com>:</div><blockquote xmlns="http://www.w3.org/1999/xhtml" type="cite"><div>Actually I have compiled and installed kernels before. I am wondering however if LTO still works for compiling kernel images on clang or gcc since my understanding is the kernel code includes a kernel loader which loads the ELF format but the image of an OS kernel is loaded either directly or via a bootloader which my understanding is cannot read ELF(is this correct?).<div> </div></div></blockquote><div xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml">Hello,</div><div xmlns="http://www.w3.org/1999/xhtml">you are right my friend about this but you want can read through a tool such as readelf after executable.</div><div xmlns="http://www.w3.org/1999/xhtml">hexdump and readelf will help with read and analysis elf file :)</div><div xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml">Ozgur</div><div xmlns="http://www.w3.org/1999/xhtml"> </div><div xmlns="http://www.w3.org/1999/xhtml"> </div><blockquote xmlns="http://www.w3.org/1999/xhtml" type="cite"><div> </div> <div><div>On Fri, Oct 12, 2018 at 2:02 AM <<a target="_blank" href="mailto:o@goosey.org">o@goosey.org</a>> wrote:</div><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex;"><div> </div><div> </div><div>11.10.2018, 17:48, "Carter Cheng" <<a target="_blank" href="mailto:cartercheng@gmail.com">cartercheng@gmail.com</a>>:</div><blockquote type="cite"><div><div>Hi,</div><div> </div></div></blockquote><div> </div><div>Hello,</div><div> </div><div>I want to ask pardon me and have you ever compiled a linux kernel?</div><div><div>In my opinion you should first examine gcc ld and make process :)</div><div> </div><div>The elf format executable format and  the process after compiling the c code.</div><div>Please read:</div><div> </div><div><a target="_blank" href="http://www.ntu.edu.sg/home/ehchua/programming/cpp/gcc_make.html">http://www.ntu.edu.sg/home/ehchua/programming/cpp/gcc_make.html</a></div><div> </div><div>keep calm and go step by step and continue to learn c, gcc, ld, make, c code compile to machine code.</div><div> </div><div>Ozgur</div><div> </div><div> </div><div> </div></div><blockquote type="cite"><div>There are some detaills about the current procedures for linking the kernel that I am unfamiliar with. My understanding is that GCC and Clang both have the ability to do link time analysis and transforms on code but is it possible to write link time passes that will run on the kernel since the linking phase is a bit different (i.e. doesnt produce an ELF file)?<div> </div><div>Regards,</div><div> </div><div>Carter.</div></div>,<p>_______________________________________________<br />Kernelnewbies mailing list<br /><a target="_blank" href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br /><a target="_blank" href="https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a></p></blockquote></blockquote></div></blockquote>