diff options
author | John Baldwin <jhb@FreeBSD.org> | 2022-06-14 17:50:51 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2022-07-13 16:19:51 +0000 |
commit | b45594b2713a38490fde1029f16b2f338a2ef77b (patch) | |
tree | d392ac673028f309b692fea249a39c6ca028950b /sys/tools | |
parent | 498f1c8ed2cf0f9748b0b96b197720f1cc45642b (diff) | |
download | src-b45594b2713a38490fde1029f16b2f338a2ef77b.tar.gz src-b45594b2713a38490fde1029f16b2f338a2ef77b.zip |
firmware: Map '@' in filenames to '_' in symbols.
'@' is not a valid character in symbol names and can sometimes appear
in path names.
Reviewed by: imp, markj
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D35480
(cherry picked from commit 628a4156a761d3daac8a4adc0e675c6e6064fd5a)
Diffstat (limited to 'sys/tools')
-rw-r--r-- | sys/tools/fw_stub.awk | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/tools/fw_stub.awk b/sys/tools/fw_stub.awk index 94975687f4e2..1d01cf1f2c29 100644 --- a/sys/tools/fw_stub.awk +++ b/sys/tools/fw_stub.awk @@ -143,8 +143,8 @@ if (opt_l) { for (file_i = 0; file_i < num_files; file_i++) { symb = filenames[file_i]; - # '-', '.' and '/' are converted to '_' - gsub(/-|\.|\//, "_", symb); + # '-', '.', '/', and '@' are converted to '_' + gsub(/-|\.|\/|@/, "_", symb); printc("extern char _binary_" symb "_start[], _binary_" symb "_end[];"); } @@ -172,8 +172,8 @@ for (file_i = 0; file_i < num_files; file_i++) { short = shortnames[file_i]; symb = filenames[file_i]; version = versions[file_i]; - # '-', '.' and '/' are converted to '_' - gsub(/-|\.|\//, "_", symb); + # '-', '.', '/', and '@' are converted to '_' + gsub(/-|\.|\/|@/, "_", symb); reg = "\t\tfp = "; reg = reg "firmware_register(\"" short "\", _binary_" symb "_start , "; |