git: b45594b2713a - stable/13 - firmware: Map '@' in filenames to '_' in symbols.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 13 Jul 2022 16:47:41 UTC
The branch stable/13 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=b45594b2713a38490fde1029f16b2f338a2ef77b
commit b45594b2713a38490fde1029f16b2f338a2ef77b
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-06-14 17:50:51 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-07-13 16:19:51 +0000
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)
---
sys/conf/kmod.mk | 2 +-
sys/tools/fw_stub.awk | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index cc5d394bb186..5a7199091096 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -201,7 +201,7 @@ ${_firmw:C/\:.*$/.fwo/:T}: ${_firmw:C/\:.*$//} ${SYSDIR}/kern/firmw.S
${CC:N${CCACHE_BIN}} -c -x assembler-with-cpp -DLOCORE \
${CFLAGS} ${WERROR} \
-DFIRMW_FILE="${.ALLSRC:M*${_firmw:C/\:.*$//}}" \
- -DFIRMW_SYMBOL="${_firmw:C/\:.*$//:C/[-.\/]/_/g}" \
+ -DFIRMW_SYMBOL="${_firmw:C/\:.*$//:C/[-.\/@]/_/g}" \
${SYSDIR}/kern/firmw.S -o ${.TARGET}
OBJS+= ${_firmw:C/\:.*$/.fwo/:T}
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 , ";