mescc: Update elf32-header for linux-4.17.

Previously, our binaries showed this

    $ readelf -s scaffold/main.mes-out
    There are 2 program headers, starting at offset 64

    Program Headers:
      Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
      LOAD           0x000000 0x01000000 0x01000000 0x0557c 0x0557c RWE 0x1
      LOAD           0x000000 0x01000000 0x01000000 0x0557c 0x0557c RWE 0x1

     Section to Segment mapping:
      Segment Sections...
       00     .text .data
       01     .text .data

Linux-4.17 refuses to run this and says

    Uhuuh, elf segment at 0000000001000000 requested but the memory is mapped already
    Segmentation fault

* lib/x86-mes/elf32-header.hex2: Remove unused data program header.
This commit is contained in:
Jan Nieuwenhuizen 2018-06-16 08:32:12 +02:00
parent d8e6046453
commit 125b43acc8
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 13 additions and 10 deletions

View File

@ -51,7 +51,7 @@
34 00 # e_ehsize Indicating our 52 Byte header
20 00 # e_phentsize size of a program header table
02 00 # e_phnum number of entries in program table
01 00 # e_phnum number of entries in program table
28 00 # e_shentsize size of a section header table
07 00 # e_shnum number of entries in section table
@ -76,15 +76,18 @@
01 00 00 00 # ph_align
# @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
%ELF_end>ELF_base # ph_memsz
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
01 00 00 00 # ph_align
#:ELF_program_header__data # NOT USED
# FIXME: linux 4.17 does not allow this overlap
# Uhuuh, elf segment at 0000000001000000
# requested but the memory is mapped already
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
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
01 00 00 00 # ph_align
# @80
:ELF_comment