The branch main has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=628a4156a761d3daac8a4adc0e675c6e6064fd5a

commit 628a4156a761d3daac8a4adc0e675c6e6064fd5a
Author:     John Baldwin <[email protected]>
AuthorDate: 2022-06-14 17:50:51 +0000
Commit:     John Baldwin <[email protected]>
CommitDate: 2022-06-14 17:50: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
---
 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 b67c84faea07..7ec3c918d5d8 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -199,7 +199,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 , ";

Reply via email to