darktjm / stack-shim Goto Github PK
View Code? Open in Web Editor NEWA shim for 32-bit binaries that don't 16-byte align the stack.
A shim for 32-bit binaries that don't 16-byte align the stack.
Hello,
Many thanks for publishing this on GitHub!
I am running Debian GNU/Linux 12 (bookworm) amd64 and I was at a loss on how to fix the eschalon segfault until I read this!
What I did is as follows:
$ pushd /tmp
/tmp ~
$ git clone https://github.com/darktjm/stack-shim.git
Cloning into 'stack-shim'...
remote: Enumerating objects: 14, done.
remote: Counting objects: 100% (14/14), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 14 (delta 3), reused 14 (delta 3), pack-reused 0
Receiving objects: 100% (14/14), 5.51 KiB | 5.51 MiB/s, done.
Resolving deltas: 100% (3/3), done.
$ cd ./stack-shim/
$ sudo apt install gcc-i686-linux-gnu libxcb1-dev:i386 libx11-dev:i386 libglx-dev:i386 libglu1-mesa-dev:i386
[...]
$ sed -f addldovr.sed stack-fix.c > stack-fix_full.c
$ /usr/bin/i686-linux-gnu-gcc -m32 -mincoming-stack-boundary=2 -mpreferred-stack-boundary=4 -shared -o stack-fix.so stack-fix_full.c -ldl -lX11 -lGL
$ ls -l stack-fix.so
-rwxr-xr-x 1 joe joe 29560 Aug 16 22:14 stack-fix.so
$ ldd stack-fix.so
linux-gate.so.1 (0xf7eef000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7c00000)
/lib/ld-linux.so.2 (0xf7ef1000)
$ LD_PRELOAD=/tmp/stack-shim/stack-fix.so /usr/games/eschalon-book-1
ERROR: ld.so: object '/tmp/stack-shim/stack-fix.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/stack-shim/stack-fix.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/stack-shim/stack-fix.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/stack-shim/stack-fix.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/stack-shim/stack-fix.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/stack-shim/stack-fix.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/stack-shim/stack-fix.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/stack-shim/stack-fix.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/stack-shim/stack-fix.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/tmp/stack-shim/stack-fix.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
And then the launch menu appears and the sound starts playing!!!
Any ideas why I get those wrong ELF class errors? Do you get them too? Are they harmful?
Thanks again,
--Joe
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.