forked from OSchip/llvm-project
[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:
parent
b86c91eae0
commit
8ab49cb4aa
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue