Dear Maintainer,
just tried to reproduce this issue.

I suspected this is caused by some changes in the linux kernel,
as a up to date buster amd64 userland inside a qemu VM with following
kernel shows no problem:
    Linux debian 4.16.0-2-amd64 #1 SMP Debian 4.16.12-1 (2018-05-27) x86_64 
GNU/Linux

In following kernels this is visible:
    Linux debian 4.17.0-1-amd64 #1 SMP Debian 4.17.8-1 (2018-07-20) x86_64 
GNU/Linux
    Linux debian 4.18.0-2-amd64 #1 SMP Debian 4.18.10-2 (2018-11-02) x86_64 
GNU/Linux
    Linux debian 4.19.0-rc7-amd64 #1 SMP Debian 4.19~rc7-1~exp1 (2018-10-07) 
x86_64 GNU/Linux


benutzer@debian:~/e3/try2$ file /usr/bin/e3
/usr/bin/e3: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), 
statically linked, no section header

The file utility identifies the e3 binary as 32-bit static executable,
even in the amd64 package, probably related to it being written in assembler.


benutzer@debian:~$ objdump -x /usr/bin/e3
...
Program Header:
    LOAD off    0x00000000 vaddr 0x08048000 paddr 0x08048000 align 2**0
         filesz 0x00003387 memsz 0x00003387 flags r-x
    LOAD off    0x00003387 vaddr 0x0804b387 paddr 0x0804b387 align 2**0
         filesz 0x00000000 memsz 0x0010dcec flags rw-


It might be related to following discussion [1] and kernel patch [2].

Getting the second header entry aligned to 0x4000, what I tried to achive in
attached patch, seems to solve the issue in my test VM.

Kind regards,
Bernhard

[1] 
https://stackoverflow.com/questions/51656713/cannot-load-custom-elf-executable-in-gdb
[2] 
https://github.com/torvalds/linux/commit/a4ff8e8620d3f4f50ac4b41e8067b7d395056843
From 5bf403ebdf25d3a2e008a6c8542ceb4d8bc28703 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= <bernha...@mailbox.org>
Date: Tue, 6 Nov 2018 18:52:41 +0100
Subject: [PATCH] Align header to avoid crash.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=913014
---
 e3.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/e3.h b/e3.h
index 1615be6..25d143d 100644
--- a/e3.h
+++ b/e3.h
@@ -861,6 +861,7 @@ phdr2:					;another Elf32_Phdr starts here
 %else
 	org 0x8048000
 	ELFheader
+	times 0xC79 db 0
 %endif
 %else
 	;nothing
-- 
2.19.1

Reply via email to