[haiku-commits] haiku: hrev54522 - src/system/ldscripts/m68k

  • From: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 19 Aug 2020 09:39:43 -0400 (EDT)

hrev54522 adds 1 changeset to branch 'master'
old head: ab51e305e9038ecf754050be0f78016b4ff389a8
new head: d4b7d64b8186b2444b7b36c46501621cbe88362f
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=d4b7d64b8186+%5Eab51e305e903

----------------------------------------------------------------------------

d4b7d64b8186: m68k: force fold segments into text, [ro]data & shave 100kB of 
ELF stuff
  
  For some reason the kernel ended up with a bunch of .text.foo or
  .data.rel.bar sections, each with their own ELF section headers and
  other metadata. Forcing them into the base sections drops the binary
  size by about 100kB, even for the stripped one.
  
  I suspect it should work on other archs as well.
  
  Change-Id: I7a8f46480d71267c07b75325423a0f5bfd2d12fb
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/3101
  Reviewed-by: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>

                                          [ François Revol <revol@xxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev54522
Commit:      d4b7d64b8186b2444b7b36c46501621cbe88362f
URL:         https://git.haiku-os.org/haiku/commit/?id=d4b7d64b8186
Author:      François Revol <revol@xxxxxxx>
Date:        Mon Jul 27 01:01:11 2020 UTC
Committer:   Alex von Gluck IV <kallisti5@xxxxxxxxxxx>
Commit-Date: Wed Aug 19 13:39:32 2020 UTC

----------------------------------------------------------------------------

1 file changed, 12 insertions(+), 13 deletions(-)
src/system/ldscripts/m68k/kernel.ld | 25 ++++++++++++-------------

----------------------------------------------------------------------------

diff --git a/src/system/ldscripts/m68k/kernel.ld 
b/src/system/ldscripts/m68k/kernel.ld
index 35cbc5a113..f172691932 100644
--- a/src/system/ldscripts/m68k/kernel.ld
+++ b/src/system/ldscripts/m68k/kernel.ld
@@ -43,28 +43,27 @@ SECTIONS
        .plt : { *(.plt) }
 
        /* text/read-only data */
-       .text : { *(.text .gnu.linkonce.t.*) } :text =0x9090
-
-       .rodata : { *(.rodata) }
+       .text : {
+               *(.text .text.* .gnu.linkonce.t.*) *(.rodata .rodata.*)
+       } :text =0x9090
 
        /* writable data  */
        . = ALIGN(0x1000);
        __data_start = .;
-       .data : { *(.data .gnu.linkonce.d.*) } :data
+       .data : {
+               . = ALIGN(0x4);
+               __ctor_list = .;
+               *(.ctors)
+               __ctor_end = .;
+               *(.data .data.* .gnu.linkonce.d.*)
+               *(.got.plt) *(.got)
+       } :data
 
-       . = ALIGN(0x4);
-       __ctor_list = .;
-       .ctors : { *(.ctors) }
-       __ctor_end = .;
-       __dtor_list = .;
-       .dtors : { *(.dtors) }
-       __dtor_end = .;
-       .got : { *(.got.plt) *(.got) }
        .dynamic : { *(.dynamic) } :dynamic :data
        
        /* uninitialized data (in same segment as writable data) */
        __bss_start = .;
-       .bss : { *(.bss) } :data
+       .bss : { *(.bss .bss.*) } :data
 
        . = ALIGN(0x1000);
        _end = . ;


Other related posts:

  • » [haiku-commits] haiku: hrev54522 - src/system/ldscripts/m68k - Alex von Gluck IV