Opened 13 years ago

Closed 12 years ago

#430 closed defect (fixed)

Loader crashes when 'Strip binaries' is used

Reported by: Martin Sucha Owned by:
Priority: major Milestone: 0.5.0
Component: helenos/unspecified Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

When 'Strip binaries' is selected, the boot process stops after printing "Spawning /srv/locfs".

The output is different on each architecture. Attached screenshot from amd64.

Tested mainline,1440 compiled with GCC 4.6.3 on

  • amd64 (QEMU 1.0.1)
  • sparc64 (QEMU 1.0.1)
  • mips32 (GXemul)

Attachments (1)

snapshot6.png (23.5 KB ) - added by Martin Sucha 13 years ago.
Screenshot of the problem on amd64

Download all attachments as: .zip

Change History (6)

by Martin Sucha, 13 years ago

Attachment: snapshot6.png added

Screenshot of the problem on amd64

comment:1 by Jakub Jermář, 13 years ago

The problem seems to be in stripping the loader binary. If loader is not stripped, but everything else is, the system boots and operates just fine.

comment:2 by Jiri Svoboda, 13 years ago

For the loader binary, and for the loader binary alone, strip prints out some warnings:

/usr/local/cross/amd64/bin/amd64-linux-gnu-strip loader
BFD: st4kO0FA: section .init lma 0x70001120 adjusted to 0x70002120
BFD: st4kO0FA: section .text lma 0x70001140 adjusted to 0x7000212a
BFD: st4kO0FA: section `.text' can't be allocated in segment 1
LOAD: .init .text

comment:3 by Jiri Svoboda, 13 years ago

Some things appear to be wrong with the stripped file:

kvadrat loader # readelf -l loader.orig 

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

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  INTERP         0x00000000000145a8 0x0000000000000000 0x0000000000000000
                 0x0000000000000007 0x0000000000000000  R      1
      [Requesting program interpreter: kernel]
  LOAD           0x0000000000000000 0x0000000070001000 0x0000000070001000
                 0x00000000000141cc 0x00000000000141cc  R E    20
  LOAD           0x00000000000141e0 0x00000000700161e0 0x00000000700161e0
                 0x00000000000003c8 0x0000000000000670  RW     20
  NOTE           0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000         8

 Section to Segment mapping:
  Segment Sections...
   00     .interp 
   01     .init .text 
   02     .data .bss 
   03     
kvadrat loader # readelf -l loader

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

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  INTERP         0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  R      8
      [Requesting program interpreter: ELF]
  LOAD           0x0000000000000000 0x0000000070000000 0x0000000070001000
                 0x00000000000151b6 0x00000000000151b6  R E    200000
  LOAD           0x00000000000161e0 0x00000000700161e0 0x00000000700161e0
                 0x00000000000003c8 0x0000000000000670  RW     200000
  NOTE           0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000         8

 Section to Segment mapping:
  Segment Sections...
   00     
   01     .init 
   02     .data .bss 
   03     

comment:4 by Jakub Jermář, 12 years ago

Yeah, if the .interp section is marked as allocable ("a") and @note or @progbits, the interpreter string "kernel" is not stripped and everything works.

comment:5 by Jakub Jermář, 12 years ago

Resolution: fixed
Status: newclosed

Fixed in mainline,1564.

Note: See TracTickets for help on using tickets.