/*
 * Copyright (C) 2010-2017 CS Systemes d'Information
 * Christophe Leroy <christophe.leroy@c-s.fr>
 *
 * (C) Copyright 2001-2003
 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 *
 * Modified by Yuli Barcohen <yuli@arabellasw.com>
 *
 * SPDX-License-Identifier:    GPL-2.0+
 */

OUTPUT_ARCH(powerpc)
SECTIONS
{
	/* Read-only sections, merged into text segment: */
	. = + SIZEOF_HEADERS;
	.text          :
	{
		arch/powerpc/cpu/mpc8xx/start.o	(.text)
		arch/powerpc/cpu/mpc8xx/start.o	(.text*)
		arch/powerpc/cpu/mpc8xx/traps.o	(.text*)
		arch/powerpc/cpu/mpc8xx/built-in.o	(.text*)
		arch/powerpc/lib/built-in.o		(.text*)
		board/cssi/MCR3000/built-in.o	(.text*)
		disk/built-in.o			(.text*)
		drivers/net/built-in.o		(.text*)

		*(.text)
	}
	_etext = .;
	PROVIDE (etext = .);
	.rodata    :
	{
		*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
	}

	/* Read-write section, merged into data segment: */
	. = (. + 0x0FFF) & 0xFFFFF000;
	_erotext = .;
	PROVIDE (erotext = .);
	.reloc   :
	{
		_GOT2_TABLE_ = .;
		KEEP(*(.got2))
		KEEP(*(.got))
		_FIXUP_TABLE_ = .;
		KEEP(*(.fixup))
	}
	__got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
	__fixup_entries = (. - _FIXUP_TABLE_) >> 2;

	.data    :
	{
		*(.data*)
		*(.sdata*)
	}
	_edata  =  .;
	PROVIDE (edata = .);

	. = .;

	. = ALIGN(4);
	.u_boot_list : {
		KEEP(*(SORT(.u_boot_list*)));
	}

	. = .;
	__start___ex_table = .;
	__ex_table : { *(__ex_table) }
	__stop___ex_table = .;

	. = ALIGN(4096);
	__init_begin = .;
	.text.init : { *(.text.init) }
	.data.init : { *(.data.init) }
	. = ALIGN(4096);
	__init_end = .;

	__bss_start = .;
	.bss (NOLOAD)       :
	{
		*(.bss*)
		*(.sbss*)
		*(COMMON)
		. = ALIGN(4);
	}
	__bss_end = . ;
	PROVIDE (end = .);
}
ENTRY(_start)
