git: e3b74ec119a7 - main - kboot: powerpc ldscript catchup

From: Warner Losh <imp_at_FreeBSD.org>
Date: Sun, 04 Dec 2022 04:42:29 UTC
The branch main has been updated by imp:

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

commit e3b74ec119a7d98a0f340674e28923707b7166b4
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-12-04 04:41:05 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-12-04 04:41:28 +0000

    kboot: powerpc ldscript catchup
    
    Catch up with the latest ldscript for powerpc. Make it match others in
    the tree.
    
    Sponsored by:           Netflix
---
 stand/kboot/arch/powerpc64/ldscript.powerpc | 48 +++++++++++++++++++++++------
 1 file changed, 38 insertions(+), 10 deletions(-)

diff --git a/stand/kboot/arch/powerpc64/ldscript.powerpc b/stand/kboot/arch/powerpc64/ldscript.powerpc
index 729113695105..662871eb7c09 100644
--- a/stand/kboot/arch/powerpc64/ldscript.powerpc
+++ b/stand/kboot/arch/powerpc64/ldscript.powerpc
@@ -10,15 +10,7 @@ SECTIONS
 {
   /* Read-only sections, merged into text segment: */
   . = 0x100000;
-  .text      :
-  {
-    *(.text)
-    /* .gnu.warning sections are handled specially by elf32.em.  */
-    *(.gnu.warning)
-    *(.gnu.linkonce.t*)
-  } =0
-  _etext = .;
-  .interp     : { *(.interp) 	}
+  .interp     : { *(.interp) 	} :text
   .hash          : { *(.hash)		}
   .dynsym        : { *(.dynsym)		}
   .dynstr        : { *(.dynstr)		}
@@ -40,7 +32,9 @@ SECTIONS
   .rela.fini     : { *(.rela.fini)	}
   .rela.bss      : { *(.rela.bss)		}
   .rela.plt      : { *(.rela.plt)		}
+  .rela.sdata    : { *(.rela.sdata)		}
   .rela.sbss     : { *(.rela.sbss)		}
+  .rela.sdata2   : { *(.rela.sdata2)		}
   .rela.sbss2    : { *(.rela.sbss2)		}
   .text      :
   {
@@ -55,9 +49,11 @@ SECTIONS
   .fini      : { *(.fini)    } =0
   .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }
   .rodata1   : { *(.rodata1) }
+  .sdata2    : { *(.sdata2)  }
   .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)
@@ -86,6 +82,10 @@ SECTIONS
   .got            : { *(.got) }
   .got.plt        : { *(.got.plt) }
                 PROVIDE (_GOT_END_ = .);
+  /* We want the small data sections together, so single-instruction offsets
+     can access them all, and initialized data all before uninitialized, so
+     we can shorten the on-disk segment size.  */
+  .sdata     : { *(.sdata) }
   _edata  =  .;
   PROVIDE (edata = .);
   .sbss      :
@@ -107,5 +107,33 @@ SECTIONS
   . = ALIGN(4096);
   _end = . ;
   PROVIDE (end = .);
+  /* Stabs debugging sections.  */
+  .stab 0 : { *(.stab) }
+  .stabstr 0 : { *(.stabstr) }
+  /* DWARF debug sections.
+     Symbols in the DWARF debugging sections are relative to the beginning
+     of the section so we begin them at 0.  */
+  /* DWARF 1 */
+  .debug          0 : { *(.debug) }
+  .line           0 : { *(.line) }
+  /* GNU DWARF 1 extensions */
+  .debug_srcinfo  0 : { *(.debug_srcinfo) }
+  .debug_sfnames  0 : { *(.debug_sfnames) }
+  /* DWARF 1.1 and DWARF 2 */
+  .debug_aranges  0 : { *(.debug_aranges) }
+  .debug_pubnames 0 : { *(.debug_pubnames) }
+  /* DWARF 2 */
+  .debug_info     0 : { *(.debug_info) }
+  .debug_abbrev   0 : { *(.debug_abbrev) }
+  .debug_line     0 : { *(.debug_line) }
+  .debug_frame    0 : { *(.debug_frame) }
+  .debug_str      0 : { *(.debug_str) }
+  .debug_loc      0 : { *(.debug_loc) }
+  .debug_macinfo  0 : { *(.debug_macinfo) }
+  /* SGI/MIPS DWARF 2 extensions */
+  .debug_weaknames 0 : { *(.debug_weaknames) }
+  .debug_funcnames 0 : { *(.debug_funcnames) }
+  .debug_typenames 0 : { *(.debug_typenames) }
+  .debug_varnames  0 : { *(.debug_varnames) }
+  /* These must appear regardless of  .  */
 }
-