2015-03-06 21:18:47 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#RetroLink - Allows a library or executable to link to any symbols, without version restrictions
|
|
|
|
#Usage: ./retrolink foobar_libretro.so
|
2015-03-06 23:49:44 +00:00
|
|
|
#http://www.lightofdawn.org/wiki/wiki.cgi/NewAppsOnOldGlibc
|
2015-03-06 21:18:47 +00:00
|
|
|
|
2017-12-02 06:28:57 +00:00
|
|
|
start=$(readelf -V "$1" | grep -A1 .gnu.version_r | tail -n1 | cut -d' ' -f6)
|
|
|
|
pos=$(readelf -V "$1" | grep 'Flags: none' | cut -d' ' -f3 | sed 's/://')
|
2015-03-06 21:18:47 +00:00
|
|
|
for pos in $pos; do
|
2017-12-02 06:28:57 +00:00
|
|
|
printf '\x02' | dd if=/dev/stdin of="$1" seek=$((start+pos+4)) count=1 bs=1 conv=notrunc 2> /dev/null
|
2015-03-06 21:18:47 +00:00
|
|
|
done
|