<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">&gt; No clue. I note that Apple’s entire point of putting that pointer to the TOC there is because ELF files don’t initialize the TOC for you. If you were to compile for XCOFF, you could just leave that code snippet out entirely.</blockquote><div><br></div><div>Unfortunately no. Every object module has to define an entry point. If no custom entry point was specified, PPCLink will link to &quot;__start&quot; from StdCRuntime.o which, in turn, depends on InterfaceLib etc. In other words, tons of code Trampoline doesn&#39;t need.</div><div><br></div><div>Trampoline&#39;s start code initializes the stack pointer as well. Stack area is located in the BSS section and is 65536 bytes big. Referencing this stack area in the assembly was easy.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Maybe the TOC was put there by some late-stage tool that converts the XCOFF to ELF?<br></blockquote><div><br></div><div>This is surely possible and easy doable. I&#39;ll reconsider this solution later when writing a XCOFF-&gt;ELF converter...</div></div></div>