You've already forked libmali-rockchip
mirror of
https://github.com/armbian/libmali-rockchip.git
synced 2026-01-06 12:03:41 -08:00
HACK: scripts: Add fixup_dynsym.py
Some pre-built mali libraries would have local symbol issue: readelf -s <libmali.so>: Warning: local symbol 9 found at index >= .dynsym's sh_info value of 9 Let's use lief to increase .dynsym section's sh_info to workaround it. Change-Id: Icf2037824d9c1312c5b24b982f628319a118988a Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
This commit is contained in:
12
scripts/fixup_dynsym.py
Executable file
12
scripts/fixup_dynsym.py
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
import lief
|
||||
import sys
|
||||
|
||||
libpath = sys.argv[1]
|
||||
lib = lief.parse(libpath)
|
||||
|
||||
# HACK: increase .dynsym's sh_info to workaround local symbol warning:
|
||||
# 'found local symbol in global part of symbol table'
|
||||
lib.get_section('.dynsym').information = 10
|
||||
|
||||
lib.write(libpath)
|
||||
@@ -16,6 +16,13 @@ for lib in $LIBS; do
|
||||
echo $DEPS | grep -q "Library soname: \[$SONAME\]" ||
|
||||
patchelf --set-soname $SONAME $lib
|
||||
|
||||
# Increase .dynsym's sh_info to workaround local symbol warning:
|
||||
# 'found local symbol in global part of symbol table'
|
||||
#
|
||||
# depends on lief (pip3 install lief)
|
||||
readelf -s $lib 2>&1 | grep -q Warning && \
|
||||
scripts/fixup_dynsym.py $lib&
|
||||
|
||||
# Rename default libs to -x11
|
||||
echo $lib | grep -qE "\-[rg].p.\.so" || continue
|
||||
[ ! -L $lib ] && mv $lib ${lib%.so}-x11.so
|
||||
@@ -24,3 +31,5 @@ done
|
||||
|
||||
# Update debian control and rules
|
||||
scripts/update_debian.sh
|
||||
|
||||
wait
|
||||
|
||||
Reference in New Issue
Block a user