Opened 11 years ago
Closed 11 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)
Change History (6)
Changed 11 years ago by
Attachment: | snapshot6.png added |
---|
comment:1 Changed 11 years ago by
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 Changed 11 years ago by
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 Changed 11 years ago by
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 Changed 11 years ago by
Yeah, if the .interp section is marked as allocable ("a") and @note or @progbits, the interpreter string "kernel" is not stripped and everything works.
Screenshot of the problem on amd64