Skip to content

Commit

Permalink
scripts/mksysmap: Fix badly escaped '$'
Browse files Browse the repository at this point in the history
The backslash characters escaping '$' in the command to sed (intended to
prevent it from interpreting '$' as "end-of-line") are currently being
consumed by the Shell (where they mean that sh should not evaluate what
follows '$' as a variable name). This means that

    sed -e "/ \$/d"

executes the script

    / $/d

instead of the intended

    / \$/d

So escape twice in mksysmap any '$' that actually needs to reach sed
escaped so that the backslash survives the Shell.

Fixes: c480204 ("scripts/mksysmap: use sed with in-line comments")
Fixes: 320e7c9 ("scripts/kallsyms: move compiler-generated symbol patterns to mksysmap")
Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  • Loading branch information
Pierre-Clément Tosi authored and Masahiro Yamada committed Jun 7, 2023
1 parent 20ff368 commit ec336aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/mksysmap
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ${NM} -n ${1} | sed >${2} -e "
# (do not forget a space before each pattern)
# local symbols for ARM, MIPS, etc.
/ \$/d
/ \\$/d
# local labels, .LBB, .Ltmpxxx, .L__unnamed_xx, .LASANPC, etc.
/ \.L/d
Expand All @@ -41,7 +41,7 @@ ${NM} -n ${1} | sed >${2} -e "
/ __efistub_/d
# arm64 local symbols in non-VHE KVM namespace
/ __kvm_nvhe_\$/d
/ __kvm_nvhe_\\$/d
/ __kvm_nvhe_\.L/d
# arm64 lld
Expand Down

0 comments on commit ec336aa

Please sign in to comment.