[SLOF] [PATCH] Align stage2 TOC to 256 bytes for binutils 2.25.1.

Alexey Kardashevskiy aik at ozlabs.ru
Sat Oct 24 20:19:35 AEDT 2015


On 10/22/2015 12:45 PM, Alexey Kardashevskiy wrote:
> On 10/22/2015 11:39 AM, Alexey Kardashevskiy wrote:
>> On 10/09/2015 03:22 PM, William Grant wrote:
>>> 2.25.1 changed BFD to align the TOC to 256 rather than 8 bytes, so
>>> __toc_start pointed to the wrong place and stage2's TOC references were
>>> wrong. This caused an inevitable crash just after entering C.
>>
>>
>> "sob" is missing, could you please repost it?
>> Otherwise it is good.
>
> Although the patch itself does not seem to be the problem, new binutils (or
> new gcc - 5.2.1) compile SLOF which cannot boot over the net which works
> with "gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC)".
>
>
> Nikunj,
>
> could you please take a look?


I rebased the tree locally and put this patch earlier and bisected and 
discovered that actually since Benh's
6495aef5b6 "net-snk: Remove module system"
network boot does not work IF compiled with very last gcc (>=5.2.1) and 
binutils (>=2.25.1).

People of SLOF, please help :)



>
>
> /home/aik/qemu-system-ppc64 -enable-kvm -m 2048 -machine pseries -nographic
> -vga none -boot strict=on -netdev user,id=id3,hostfwd=tcp::5000-:22 -device
> e1000,id=id4,netdev=id3,bootindex=1 -bios ./slof-binutils-2-25-51.bin
>
>
>
> SLOF **********************************************************************
> QEMU Starting
>   Build Date = Oct 22 2015 11:18:36
>   FW Version = git-9ecf0ae95ece078a
>   Press "s" to enter Open Firmware.
>
> Populating /vdevice methods
> Populating /vdevice/vty at 71000000
> Populating /vdevice/nvram at 71000001
> Populating /vdevice/v-scsi at 71000002
>         SCSI: Looking for devices
>            8200000000000000 CD-ROM   : "QEMU     QEMU CD-ROM      2.4."
> Populating /pci at 800000020000000
>                       00 0000 (D) : 8086 100e    e1000 [ net ]
> No NVRAM common partition, re-initializing...
> Scanning USB
> Using default console: /vdevice/vty at 71000000
>
>    Welcome to Open Firmware
>
>    Copyright (c) 2004, 2011 IBM Corporation All rights reserved.
>    This program and the accompanying materials are made available
>    under the terms of the BSD License available at
>    http://www.opensource.org/licenses/bsd-license.php
>
>
> Trying to load:  from: /pci at 800000020000000/ethernet at 0 ...
>
> ( 700 ) Program Exception [ 4c ]
>
>
>      R0 .. R7           R8 .. R15         R16 .. R23         R24 .. R31
> 000000007eae190c   0000000000000020   0000000000000000   0000000000000000
> 000000007ebf0d10   0000000000000001   0000000000000000   0000000000000000
> 000000007eaf8870   000000007eaeea40   0000000000000000   0000000000000000
> 000000007ebf0e00   0000000000000108   0000000000000000   0000000000000000
> 000000007ebf0f90   000000007fb977c8   0000000000000000   000000007ebf0f70
> 000000000000004c   0000000000000000   0000000000000000   0000000000000000
> 0000000000000000   0000000000000000   0000000000000000   0000000000000000
> 000000007dbe04f0   0000000000000000   0000000000000000   000000007eaeea50
>
>      CR / XER           LR / CTR          SRR0 / SRR1        DAR / DSISR
>          80000004   000000007eae2918   000000007ebf0f90   0000000000000000
> 0000000000000000   000000007ebf0f90   8000000000083000           00000000
>
>
> 3 >
>
>
>
>>
>>
>>> ---
>>>   board-js2x/llfw/stage2.lds | 3 ++-
>>>   board-qemu/llfw/stage2.lds | 3 ++-
>>>   2 files changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/board-js2x/llfw/stage2.lds b/board-js2x/llfw/stage2.lds
>>> index f91f065..f60cf5a 100644
>>> --- a/board-js2x/llfw/stage2.lds
>>> +++ b/board-js2x/llfw/stage2.lds
>>> @@ -41,7 +41,8 @@ SECTIONS {
>>>           *(.bss)
>>>       }
>>>
>>> -    . = ALIGN(8);
>>> +    /* binutils >= 2.25.1 require the TOC to be 256-byte aligned. */
>>> +    . = ALIGN(256);
>>>       __bss_end = .;
>>>       __bss_size = (__bss_end - __bss_start);
>>>
>>> diff --git a/board-qemu/llfw/stage2.lds b/board-qemu/llfw/stage2.lds
>>> index e060dd1..002b871 100644
>>> --- a/board-qemu/llfw/stage2.lds
>>> +++ b/board-qemu/llfw/stage2.lds
>>> @@ -45,7 +45,8 @@ SECTIONS {
>>>           *(.bss)
>>>       }
>>>
>>> -    . = ALIGN(8);
>>> +    /* binutils >= 2.25.1 require the TOC to be 256-byte aligned. */
>>> +    . = ALIGN(256);
>>>       __bss_end = .;
>>>       __bss_size = (__bss_end - __bss_start);
>>
>>
>
>


-- 
Alexey


More information about the SLOF mailing list