git: e879436ce4b5 - stable/13 - loader: fix powerpc* ofw loader

From: Alfredo Dal'Ava Junior <alfredo_at_FreeBSD.org>
Date: Mon, 04 Jul 2022 09:36:16 UTC
The branch stable/13 has been updated by alfredo:

URL: https://cgit.FreeBSD.org/src/commit/?id=e879436ce4b5d02803f6aa176b4f233f98dff9bd

commit e879436ce4b5d02803f6aa176b4f233f98dff9bd
Author:     Alfredo Dal'Ava Junior <alfredo@FreeBSD.org>
AuthorDate: 2022-07-01 15:54:01 +0000
Commit:     Alfredo Dal'Ava Junior <alfredo@FreeBSD.org>
CommitDate: 2022-07-04 12:36:04 +0000

    loader: fix powerpc* ofw loader
    
    With the introduction of llvm14, the powerpc* loader used on ofw/pseries
    for 32 and 64 bit architectures puts the .data.rel.ro section after
    .data section. This caused a crash kernel didn't boot. Bisect pointed to
    change https://reviews.llvm.org/D111717 but problem could be fixed by
    adding a section description to make it appear in the expected order.
    
    This patch is based on discussion at:
            https://github.com/llvm/llvm-project/issues/56306
    
    MFC after:      1 day
    Sponsored by:   Instituto de Pesquisas Eldorado (eldorado.org.br)
    
    (cherry picked from commit 5d48fb3b16c1496bf415fee620c61cc944b0326d)
---
 stand/powerpc/ofw/ldscript.powerpc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/stand/powerpc/ofw/ldscript.powerpc b/stand/powerpc/ofw/ldscript.powerpc
index 5fa27eaf6a13..9202eff286b2 100644
--- a/stand/powerpc/ofw/ldscript.powerpc
+++ b/stand/powerpc/ofw/ldscript.powerpc
@@ -57,6 +57,7 @@ SECTIONS
   .sbss2     : { *(.sbss2)   }
   /* Adjust the address for the data segment to the next page up. */
   . = ((. + 0x1000) & ~(0x1000 - 1));
+  .data.rel.ro : { *(.data.rel.ro*) }
   .data    :
   {
     *(.data)