[LEDE-DEV] [PATCH] brcm47xx: relocate loader to higher address

Hauke Mehrtens hauke at hauke-m.de
Sun Oct 8 12:35:23 PDT 2017

On 10/08/2017 09:25 PM, p.wassi at gmx.at wrote:
> Hi Hauke,
>> When the kernel gets uncompressed and is bigger than
>> BZ_TEXT_START - LOADADDR it overwrote the loader which was currently uncompressing
>> it and made the board crash.
> Currently, BZ_TEXT_START - LOADADDR = 0x80400000 - 0x80001000 = 3FF000 = 4190208 bytes
> Today's trunk brcm47xx kernel is 4069124 bytes. So increasing the address is actually
> just a preventive countermeasure for future kernels.(?)
> The WRT54GL CFEs seem to use a memory area about half the size of your WRT54GS'
> So I guess, the actual problem for the WRT54GL was that the stack was smashed?
> Once my compiling machine finishes your ar71xx with kernel 4.9, I'll test this one here :-)
> Happy to see, that this problem seems to be solved.


The stack was not a problem with my kernel, I just added it to prevent
later problems, now I debugged this, I do not want to debug this again
in 2 years.

My vmlinux kernel file is 4277380 bytes, so bigger than the available
size you calculated. The stack starts at 0x8043BF30 so there are 4435760
bytes available till my image would overwrite the stack.

It does not matter where CFE is located as we do not need it any more
after the loader started, we will never jump back into it and use the
memory region used for CFE later also for Linux.

With both patches there is now almost 6 MB space available.


More information about the Lede-dev mailing list