From: jamie.iles@oracle.com (Jamie Iles)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64/debug: don't duplicate filenames.
Date: Thu, 9 Nov 2017 12:14:40 +0000 [thread overview]
Message-ID: <20171109121440.6872-1-jamie.iles@oracle.com> (raw)
Rather than explicitly pushing the filename into .rodata.str, use a
compiler generated string literal and use the address of that as an
input constraint to the inline assembly. This allows the compiler to
emit only one version of the string without relying on the linker to
deduplicate.
Cc: Dave P Martin <Dave.Martin@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Jamie Iles <jamie.iles@oracle.com>
---
arch/arm64/include/asm/bug.h | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/include/asm/bug.h b/arch/arm64/include/asm/bug.h
index a02a57186f56..a7b05625ef63 100644
--- a/arch/arm64/include/asm/bug.h
+++ b/arch/arm64/include/asm/bug.h
@@ -23,12 +23,8 @@
#ifdef CONFIG_DEBUG_BUGVERBOSE
#define _BUGVERBOSE_LOCATION(file, line) __BUGVERBOSE_LOCATION(file, line)
#define __BUGVERBOSE_LOCATION(file, line) \
- ".pushsection .rodata.str,\"aMS\", at progbits,1\n" \
- "2: .string \"" file "\"\n\t" \
- ".popsection\n\t" \
- \
- ".long 2b - 0b\n\t" \
- ".short " #line "\n\t"
+ ".long %[file] - 0b\n\t" \
+ ".short %[line]\n\t"
#else
#define _BUGVERBOSE_LOCATION(file, line)
#endif
@@ -50,7 +46,9 @@ _BUGVERBOSE_LOCATION(__FILE__, __LINE__) \
#define __BUG_FLAGS(flags) \
asm volatile ( \
__BUG_ENTRY(flags) \
- "brk %[imm]" :: [imm] "i" (BUG_BRK_IMM) \
+ "brk %[imm]" :: [imm] "i" (BUG_BRK_IMM),\
+ [line] "i" (__LINE__), \
+ [file] "i" (__FILE__) \
);
--
2.15.0
next reply other threads:[~2017-11-09 12:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 12:14 Jamie Iles [this message]
2017-11-09 12:35 ` [PATCH] arm64/debug: don't duplicate filenames Dave Martin
2017-11-09 13:08 ` Jamie Iles
2017-11-09 14:31 ` Dave Martin
2017-11-09 14:41 ` Jamie Iles
2017-11-09 14:48 ` Dave Martin
2017-11-09 15:01 ` Dave Martin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171109121440.6872-1-jamie.iles@oracle.com \
--to=jamie.iles@oracle.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).