[BOLT] link_fdata: accept symbols with slash in the name

Summary:
Change sed separator to allow replacing symbols with slash in the name.
This is required for symbol names produced by BOLT which include
"/1" suffix.

(cherry picked from FBD31324540)
This commit is contained in:
Amir Ayupov 2021-09-30 16:11:09 -07:00 committed by Maksim Panchenko
parent b86c91eae0
commit 8ab49cb4aa
1 changed files with 2 additions and 2 deletions

View File

@ -7,12 +7,12 @@ mapfile -t symbols < <(nm --defined-only "$2")
for line in "${symbols[@]}"; do
val=$(echo $line | cut -d' ' -f1)
symname=$(echo $line | awk '{ $1=$2=""; print $0 }' | sed 's/^[ \t]*//')
symname=$(echo $line | awk '{ $1=$2=""; print $0 }' | sed 's|^[ \t]*||')
if [ -z "$symname" ]; then
continue
fi
if [ -z "${val##*[!0-9a-fA-F]*}" ]; then
continue
fi
sed -i -e "s/\#${symname}\#/$val/g" $3
sed -i -e "s|\#${symname}\#|$val|g" $3
done