From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Mon, 15 Jun 2009 13:37:20 -0400 Subject: [U-Boot] [PATCH] kallsyms: fix escaping of NUL char in strings In-Reply-To: <1245087445-14960-1-git-send-email-vapier@gentoo.org> References: <1245087445-14960-1-git-send-email-vapier@gentoo.org> Message-ID: <1245087445-14960-3-git-send-email-vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de The current kallsyms code is using \\0 to escape the backslash in the awk code, but the shell too needs escaping. This way we make sure gcc is passed the \0. Then gcc itself will consume this as an octal, so we have to use 000 so gcc will create the final NUL. Signed-off-by: Mike Frysinger --- Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index d01cc48..8471828 100644 --- a/Makefile +++ b/Makefile @@ -312,7 +312,7 @@ GEN_UBOOT = \ $(obj)u-boot: depend $(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(GEN_UBOOT) ifeq ($(CONFIG_KALLSYMS),y) - smap=`$(call SYSTEM_MAP,u-boot) | awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 "\\0"}'` ; \ + smap=`$(call SYSTEM_MAP,u-boot) | awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 "\\\\000"}'` ; \ $(CC) $(CFLAGS) -DSYSTEM_MAP="\"$${smap}\"" -c common/system_map.c -o $(obj)common/system_map.o $(GEN_UBOOT) $(obj)common/system_map.o endif -- 1.6.3.1