Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Dell 5440

    $ git clone https://github.com/meribold/btry
    ...
    $ make
    as -mx86-used-note=no btry.s -o btry.o
    objcopy -O binary btry.o btry
    chmod +x btry

    $ ./btry 
    Segmentation fault         ./btry

    $ strace -f ./btry 
    execve("./btry", ["./btry"], 0x7ffc1a562078 /* 57 vars */) = -1 ENOMEM (Cannot allocate memory)

    $ file btry
    btry: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, corrupted section header size


Looks like I may have stretched what values are acceptable for p_filesz/p_memsz too far. What's your kernel version? (I tested it on 6.8.0 and 4.4.0.) Perhaps the 316-byte version at commit 451827cfd5399074 (before that particular hack was introduced) would work.


I fixed the most likely culprit now (excessively large p_memsz value). It cost a few bytes; the new executable size is 307 bytes.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: