corsix / polyfill-glibc

Patch Linux executables for compatibility with older glibc
Other
171 stars 4 forks source link

Strip breaks some processed binaries #3

Open johnsonjh opened 5 months ago

johnsonjh commented 5 months ago

Example:

$ ninja
$ cp polyfill-glibc out

$ ./polyfill-glibc --remove-kernel-version --add-hash --add-gnu-hash --remove-debug ./out
$ ./out
No input file(s) specified.

$ strip out
$ ./out
[1]    1807806 segmentation fault  ./out

Using sstrip produces the following output:

sstrip: out: File too large
sstrip: out: ELF file may have been corrupted!
johnsonjh commented 5 months ago

It seems that it is the --add-hash option that causes strip and other tools to corrupt the binaries.

corsix commented 5 months ago

The sstrip case looks like a bug in sstrip, I've opened https://github.com/BR903/ELFkickers/pull/21 for it.

I'll look at strip in due course.