scripts: Add symbol hack back

Some libraries would not work with new hack.

Change-Id: I3d43e56b5a64971c595630a8ef3e5430417295f6
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
This commit is contained in:
Jeffy Chen 2024-10-09 09:16:49 +08:00
parent 961afae0c1
commit 80565efba8
2 changed files with 5 additions and 1 deletions

View file

@ -13,4 +13,8 @@ for symbol in symbols:
hidden.visibility = lief.ELF.SYMBOL_VISIBILITY.DEFAULT
hidden = lib.add_dynamic_symbol(hidden)
# 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)

View file

@ -27,7 +27,7 @@ for lib in $LIBS; do
# 'invalid local symbol in global part of symbol table'
#
# depends on lief (pip3 install lief)
readelf -s $lib 2>&1 | grep -w LOCAL | grep -wq __end__ && \
readelf -s $lib 2>&1 | grep -wq Warning && \
scripts/fixup_sym.py $lib&
done