<font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"><div style="font-family: Verdana, Arial, Helvetica, sans-serif;">My understanding is that the TOC base points somewhere "in the middle" of the GOT, so that both positive and negative load offsets can be used.  It isn't immediately obvious how aligning the GOT to 256 bytes also aligns the TOC base itself.</div><div style="font-family: Verdana, Arial, Helvetica, sans-serif;"><br></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif;">I guess this works because the TOC base is actually a constant from the GOT:</div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><pre><font face="monospace, Courier New, Courier, monospace">#define TOC_BASE_OFF        0x8000</font></pre></div></blockquote><div style="font-family: Verdana, Arial, Helvetica, sans-serif;"><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"><div>I see the linker script change Alan made is basically the same proposed here, so I trust it is right and I'll make correspondingly similar changes to Hostboot.</div><div><br></div><div>Patrick Williams<br>Power Firmware Development, <br>Bldg 045-2/C034<br>512-286-6369, T/L: 363-6369</div><div>iawillia@us.ibm.com<br></div></font></div><br><br><font color="#990099" style="font-family: Verdana, Arial, Helvetica, sans-serif;">-----Anton Blanchard <anton@samba.org> wrote: -----</font><div class="iNotesHistory" style="font-family: Verdana, Arial, Helvetica, sans-serif; padding-left: 5px;"><div style="padding-right:0px;padding-left:5px;border-left:solid black 2px;">To: Patrick Williams III/Rochester/IBM@IBMUS<br>From: Anton Blanchard <anton@samba.org><br>Date: 05/14/2015 04:34PM<br>Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>, skiboot@lists.ozlabs.org, Alan Modra <amodra@au1.ibm.com><br>Subject: Re: [Skiboot] [PATCH] Align TOC to 256 bytes<br><br><div><font face="Courier New,Courier,monospace" size="3">Hi Patrick,<br><br>> * What part of the toolchain is forcing the TOC to 256 alignment?<br>> * Is the alignment on the beginning of the TOC section or the<br>> TOC-base part of the function pointer tuples  (ABIv1) ?<br><br>It's a recent binutils patch from Alan:<br><br>commit a27e685fa0a6480bdb07e3be359558524cec89b7<br>Author: Alan Modra <amodra@gmail.com><br>Date:   Tue Apr 21 19:18:24 2015 +0930<br><br>    Align .TOC. for PowerPC64<br>    <br>    This change, with prerequisite 0e5fabeb, provides a toc base aligned<br>    to 256 bytes rather than 8 bytes.  This is necessary for a minor gcc<br>    optimisation, allowing use of d-form instructions to correctly access<br>    toc-relative items larger than 8 bytes.<br><br>Anton<br><br></font></div></div></div></font>