summaryrefslogtreecommitdiff
path: root/arch/powerpc/boot/zImage.ps3.lds.S
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2013-08-27 10:07:49 +0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-08-27 10:59:30 +0400
commitbdbc29c19b2633b1d9c52638fb732bcde7a2031a (patch)
treede4fe4de7dc8abe6d79db9e99dd042c1e34cec56 /arch/powerpc/boot/zImage.ps3.lds.S
parentf5f6cbb61610b7bf9d9d96db9c3979d62a424bab (diff)
downloadlinux-bdbc29c19b2633b1d9c52638fb732bcde7a2031a.tar.xz
powerpc: Work around gcc miscompilation of __pa() on 64-bit
On 64-bit, __pa(&static_var) gets miscompiled by recent versions of gcc as something like: addis 3,2,.LANCHOR1+4611686018427387904@toc@ha addi 3,3,.LANCHOR1+4611686018427387904@toc@l This ends up effectively ignoring the offset, since its bottom 32 bits are zero, and means that the result of __pa() still has 0xC in the top nibble. This happens with gcc 4.8.1, at least. To work around this, for 64-bit we make __pa() use an AND operator, and for symmetry, we make __va() use an OR operator. Using an AND operator rather than a subtraction ends up with slightly shorter code since it can be done with a single clrldi instruction, whereas it takes three instructions to form the constant (-PAGE_OFFSET) and add it on. (Note that MEMORY_START is always 0 on 64-bit.) CC: <stable@vger.kernel.org> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/boot/zImage.ps3.lds.S')
0 files changed, 0 insertions, 0 deletions