[haiku-bugs] [Haiku] #15819: haiku_loader ELF loader don't support separate BSS segment

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Sun, 22 Mar 2020 21:38:55 -0000

#15819: haiku_loader ELF loader don't support separate BSS segment
-----------------------+------------------------------
 Reporter:  X512       |        Owner:  nobody
     Type:  bug        |       Status:  new
 Priority:  normal     |    Milestone:  Unscheduled
Component:  - General  |      Version:  R1/Development
 Keywords:  clang lld  |   Blocked By:
 Blocking:             |  Has a Patch:  0
 Platform:  All        |
-----------------------+------------------------------
 This is hrev53967.

 LLVM linker lld produce separate LOAD entry with 0 file size for .bss
 section that is not handled by haiku_loader.

 Place to be fixed: https://git.haiku-
 os.org/haiku/tree/src/system/boot/loader/elf.cpp#n204.

 Following error is written to serial output:
 {{{
 load kernel kernel_x86_64...
 elf: rw already handled!
 unhandled pheader type 0x6474e552
 unhandled pheader type 0x6474e551
 relocating kernel failed: ffffffff!
 }}}

 Program header of kernel produced by lld:
 {{{

readelf -l kernel_x86_64

 Elf file type is EXEC (Executable file)
 Entry point 0xffffffff8006c710
 There are 8 program headers, starting at offset 64

 Program Headers:
   Type           Offset             VirtAddr           PhysAddr
                  FileSiz            MemSiz              Flags  Align
   PHDR           0x0000000000000040 0xffffffff80000040 0xffffffff80000040
                  0x00000000000001c0 0x00000000000001c0  R      0x8
   INTERP         0x0000000000000200 0xffffffff80000200 0xffffffff80000200
                  0x000000000000000a 0x000000000000000a  R      0x1
       [Requesting program interpreter: /dev/null]
   LOAD           0x0000000000000000 0xffffffff80000000 0xffffffff80000000
                  0x00000000001a8498 0x00000000001a8498  R E    0x1000
   LOAD           0x00000000001a9000 0xffffffff801a9000 0xffffffff801a9000
                  0x0000000000001bf8 0x0000000000001bf8  RW     0x1000
   LOAD           0x00000000001aac00 0xffffffff801aac00 0xffffffff801aac00
                  0x0000000000000000 0x000000000003c5e0  RW     0x1000
   DYNAMIC        0x00000000001aab38 0xffffffff801aab38 0xffffffff801aab38
                  0x00000000000000c0 0x00000000000000c0  RW     0x8
   GNU_RELRO      0x00000000001aa9c0 0xffffffff801aa9c0 0xffffffff801aa9c0
                  0x0000000000000238 0x0000000000001000  R      0x1
   GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
                  0x0000000000000000 0x0000000000000000  RW     0x0

  Section to Segment mapping:
   Segment Sections...
    00
    01     .interp
    02     .interp .hash .dynsym .dynstr .gnu.version .gnu.version_d
 .gnu.hash .text .rodata .altcodepatch
    03     .data _haiku_revision .ctors .got .dynamic
    04     .bss
    05     .dynamic
    06     .ctors .got .dynamic
    07
 }}}
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/15819>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: