[haiku-bugs] [Haiku] #15673: .bss segment ends up in EFI bootloader binary

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Tue, 04 Feb 2020 09:10:11 -0000

#15673: .bss segment ends up in EFI bootloader binary
--------------------------------+------------------------------
 Reporter:  pulkomandy          |        Owner:  nobody
     Type:  bug                 |       Status:  new
 Priority:  low                 |    Milestone:  Unscheduled
Component:  System/Boot Loader  |      Version:  R1/Development
 Keywords:                      |   Blocked By:
 Blocking:                      |  Has a Patch:  0
 Platform:  All                 |
--------------------------------+------------------------------
 For debugging of the EFI loader we added a static 16K buffer for storage
 of logs (as is done in the BIOS loader). This buffer is not initialized so
 it should be in the .bss section (to be cleared at program
 initialization). However we found out that the generated EFI file became
 larger according to the size of the buffer.

 This likely means the BSS segments are included inside the binary, and we
 end up with a larger than needed loader, filled with zeros.

 We should review the linker scripts and conversion to PE format to make
 sure the bss segment is not included in the binary, and if needed, add the
 startup code to allocate and clear it.
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/15673>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: