bsps/powerpc: Adjust ppcboot.lds

The GNU ld had a couple of changes which resulted in a broken bootloader
image generation.  Recent linker versions tie assignments to their
nearest output section statement.  Place all absolute symbols which are
used with @sectoff relocations into a special section.

See also:

"Binutils 2.28 on PowerPC: dangerous relocation: generic linker can't
handle R_PPC_SECTOFF_HA"

https://www.sourceware.org/ml/binutils/2019-05/msg00183.html

Update #3727
This commit is contained in:
Sebastian Huber
2019-05-27 10:14:48 +02:00
parent 20bd667d8a
commit f419349a13

View File

@@ -58,11 +58,9 @@ SECTIONS
*(.got2) *(.got2)
_FIXUP_TABLE_ = .; _FIXUP_TABLE_ = .;
*(.fixup) *(.fixup)
_FIXUP_END_ = .;
} }
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
__fixup_entries = (. - _FIXUP_TABLE_)>>2;
.handlers : .handlers :
{ {
*(.exception) *(.exception)
@@ -74,20 +72,26 @@ SECTIONS
*(.data*) *(.data*)
*(.sdata) *(.sdata)
. = ALIGN(4); . = ALIGN(4);
_edata = .; _data_end = .;
} }
PROVIDE(_binary_initrd_gz_start = 0);
PROVIDE(_binary_initrd_gz_end = 0);
_rtems_gz_size = _binary_rtems_gz_end - _binary_rtems_gz_start;
_rtems_size = __rtems_end - __rtems_start;
.bss : .bss :
{ {
*(.sbss) *(.sbss)
*(.bss) *(.bss)
. = ALIGN(4); . = ALIGN(4);
} }
__bss_words = SIZEOF(.bss)>>2; .abs 0 : {
__size = . ; __got2_entries = ABSOLUTE((_FIXUP_TABLE_ - _GOT2_TABLE_) >>2);
__fixup_entries = ABSOLUTE((_FIXUP_END_ - _FIXUP_TABLE_)>>2);
_edata = ABSOLUTE(_data_end);
PROVIDE(_binary_initrd_gz_start = ABSOLUTE(0));
PROVIDE(_binary_initrd_gz_end = ABSOLUTE(0));
_rtems_gz_size = ABSOLUTE(_binary_rtems_gz_end - _binary_rtems_gz_start);
_rtems_size = ABSOLUTE(__rtems_end - __rtems_start);
__bss_words = ABSOLUTE(SIZEOF(.bss)>>2);
__size = ABSOLUTE(.);
}
/DISCARD/ : /DISCARD/ :
{ {
*(.comment) *(.comment)