u-boot-brain/arch/mips/cpu/u-boot.lds
Daniel Schwierzeck 9630146411 MIPS: make size of relocation table fixed but configurable
Currently the size of the relocation table will be shrunk
to the actual size needed. Although this gives a maximal
space saving, it messes up the _end symbol. This breaks
features like appended DTBs because the _end symbol doesn't
point to the real end of the U-Boot binary.

Remove the size shrinking and make the size of the relocation
table fixed but configurable. This follows the Linux approach
and the user can adjust the size to his needs.

Also rename the relocation table section from .rel to .data.reloc
to follow the Linux approach and to avoid ambiguities with the
.rel.* sections added by the linker.

Reported-by: Lars Povlsen <lars.povlsen@microsemi.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2018-11-02 22:39:07 +01:00

107 lines
1.3 KiB
Plaintext

/* SPDX-License-Identifier: GPL-2.0+ */
/*
* (C) Copyright 2003
* Wolfgang Denk Engineering, <wd@denx.de>
*/
OUTPUT_ARCH(mips)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text : {
__text_start = .;
*(.text*)
__text_end = .;
}
. = ALIGN(4);
.rodata : {
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
}
. = ALIGN(4);
.data : {
*(.data*)
}
. = ALIGN(4);
.sdata : {
*(.sdata*)
}
. = ALIGN(4);
.u_boot_list : {
KEEP(*(SORT(.u_boot_list*)));
}
. = ALIGN(4);
__image_copy_end = .;
__init_end = .;
.data.reloc : {
__rel_start = .;
/*
* Space for relocation table
* This needs to be filled so that the
* mips-reloc tool can overwrite the content.
* An invalid value is left at the start of the
* section to abort relocation if the table
* has not been filled in.
*/
LONG(0xFFFFFFFF);
FILL(0);
. += CONFIG_MIPS_RELOCATION_TABLE_SIZE - 4;
}
. = ALIGN(4);
_end = .;
.bss __rel_start (OVERLAY) : {
__bss_start = .;
*(.sbss.*)
*(.bss.*)
*(COMMON)
. = ALIGN(4);
__bss_end = .;
}
.dynsym _end : {
*(.dynsym)
}
.dynbss : {
*(.dynbss)
}
.dynstr : {
*(.dynstr)
}
.dynamic : {
*(.dynamic)
}
.plt : {
*(.plt)
}
.interp : {
*(.interp)
}
.gnu : {
*(.gnu*)
}
.MIPS.stubs : {
*(.MIPS.stubs)
}
.hash : {
*(.hash)
}
}