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

Alexey Kardashevskiy aik at ozlabs.ru
Thu Oct 22 11:39:38 AEDT 2015


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.


> ---
>   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