[rtems commit] bsps/powerpc: Adjust ppcboot.lds

Sebastian Huber sebh at rtems.org
Mon May 27 08:25:53 UTC 2019


Module:    rtems
Branch:    master
Commit:    f419349a1370ffed9cb3d2322d01e801e012134e
Changeset: http://git.rtems.org/rtems/commit/?id=f419349a1370ffed9cb3d2322d01e801e012134e

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon May 27 10:14:48 2019 +0200

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

---

 .../motorola_powerpc/bootloader/ppcboot.lds        | 24 +++++++++++++---------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/bsps/powerpc/motorola_powerpc/bootloader/ppcboot.lds b/bsps/powerpc/motorola_powerpc/bootloader/ppcboot.lds
index b47e01f..cf9c2cd 100644
--- a/bsps/powerpc/motorola_powerpc/bootloader/ppcboot.lds
+++ b/bsps/powerpc/motorola_powerpc/bootloader/ppcboot.lds
@@ -58,11 +58,9 @@ SECTIONS
     *(.got2)
     _FIXUP_TABLE_ = .;
     *(.fixup)
+    _FIXUP_END_ = .;
   }
 
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
-  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
-
   .handlers : 
   {
     *(.exception)
@@ -74,20 +72,26 @@ SECTIONS
     *(.data*)
     *(.sdata)
     . = 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 :
   {
     *(.sbss)
     *(.bss)
     . = ALIGN(4);
   }
-  __bss_words = SIZEOF(.bss)>>2;
-  __size = . ;
+  .abs 0 : {
+    __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/ : 
   {
     *(.comment)




More information about the vc mailing list