File: retrolink.sh

package info (click to toggle)
libretro-core-info 1.3.6%2Bgit20160816-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 1,292 kB
  • ctags: 129
  • sloc: sh: 5,078; makefile: 15
file content (10 lines) | stat: -rwxr-xr-x 484 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
#!/bin/bash
#RetroLink - Allows a library or executable to link to any symbols, without version restrictions
#Usage: ./retrolink foobar_libretro.so
#http://www.lightofdawn.org/wiki/wiki.cgi/NewAppsOnOldGlibc

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/://')
for pos in $pos; do
printf '\x02' | dd if=/dev/stdin of=$1 seek=$(($start+$pos+4)) count=1 bs=1 conv=notrunc 2> /dev/null
done