[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-mes] M2-Planet test23
From: |
Danny Milosavljevic |
Subject: |
Re: [bug-mes] M2-Planet test23 |
Date: |
Sat, 6 Apr 2019 15:55:32 +0200 |
Hi Jeremiah,
on a real ARM machine, I get the Linux kernel error message
[ 1375.455579] 1891 (test23-armv7l-b): Uhuuh, elf segment at 00010000 requested
but the memory is mapped already
when I invoke
./test/results/test23-armv7l-binary
without arguments. That is 100% reproducible.
The following section headers are in the latter file:
There are 7 section headers, starting at offset 0xd0:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 1
[ 1] .text PROGBITS 00010200 000200 007b38 00 AX 0 0 1
[ 2] .data PROGBITS 00017d38 007d38 001e04 00 WA 0 0 1
[ 3] .comment PROGBITS 00010080 000080 000020 00 0 0 1
[ 4] .shstrtab STRTAB 000100a0 0000a0 000030 00 0 0 1
[ 5] .symtab SYMTAB 00019b3c 009b3c 001330 10 6 0 1
[ 6] .strtab STRTAB 000181ef 0081ef 00194d 00 0 0 1
That doesn't look so bad.
Not so fast:
objdump -x says:
./test/results/test23-armv7l-binary: file format elf32-littlearm
./test/results/test23-armv7l-binary
architecture: arm, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x00010200
Program Header:
LOAD off 0x00000000 vaddr 0x00010000 paddr 0x00010000 align 2**16
filesz 0x0000ae6c memsz 0x0000ae6c flags r-x
LOAD off 0x00000000 vaddr 0x00010000 paddr 0x00010000 align 2**0
filesz 0x0000ae6c memsz 0x0000ae6c flags rwx
private flags = 5000200: [Version5 EABI] [soft-float ABI]
I'm not sure it's allowed to have two overlapping entries in Program Header
(see vaddr, memsz)...
Looking at how the ELF program header gets built
(./test/common_armv7l/ELF-armv7l-debug.hex2), we see:
:ELF_program_headers
:ELF_program_header__text
01 00 00 00 # ph_type: PT-LOAD = 1
00 00 00 00 # ph_offset
&ELF_base # ph_vaddr
&ELF_base # ph_physaddr
%ELF_end>ELF_base # ph_filesz
%ELF_end>ELF_base # ph_memsz
05 00 00 00 # p_flags
00 00 01 00 # alignment
# @60
:ELF_program_header__data
01 00 00 00 # ph_type: PT-LOAD = 1
00 00 00 00 # ph_offset
&ELF_base # ph_vaddr
&ELF_base # ph_physaddr
%ELF_end>ELF_base # ph_filesz
So that's twice the same ph_vaddr, right? That's bad...
pgpbEenWf70l4.pgp
Description: OpenPGP digital signature
- Re: [bug-mes] M2-Planet test23,
Danny Milosavljevic <=