public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Linux Kernel Development <linux-kernel@vger.kernel.org>,
	linux-parisc@vger.kernel.org,
	linux-security-module@vger.kernel.org, dhowells@redhat.com
Subject: [PATCH] kernel/modsign_certificate.S: fix build on parisc architecture
Date: Sun, 5 May 2013 23:31:18 +0200	[thread overview]
Message-ID: <20130505213118.GA1622@p100.box> (raw)

Module signing functionality breaks the kernel build on parisc with the
following error: 

kernel/built-in.o: In function `load_module_signing_keys':
kernel/modsign_pubkey.c:67: undefined reference to `modsign_certificate_list_end'
kernel/modsign_pubkey.c:66: undefined reference to `modsign_certificate_list'
make[3]: *** [vmlinux] Error 1

The reason why the build fails is because on parisc assembly syntax is
different than on other architectures. Most importantly, a semicolon
marks the start of a comment, while exclamation marks separates
statements.

Currently the GLOBAL(name) macro uses a semicolon to separate the .globl
and the ASM_SYMBOL() statements. On PA-RISC the semicolon will now just
strip the ASM_SYMBOL() statements since it thinks it is a comment and as
such the modsign_certificate_list/modsign_certificate_list_end symbols
will not get defined and will not be in the vmlinux binary.

Fix this problem by adding an own implementation for GLOBAL() on the
PARISC architecture.

Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/kernel/modsign_certificate.S b/kernel/modsign_certificate.S
index 246b4c6..9b9c2ab 100644
--- a/kernel/modsign_certificate.S
+++ b/kernel/modsign_certificate.S
@@ -7,9 +7,17 @@
 #define ASM_SYMBOL(sym) PASTE(SYMBOL_PREFIX, sym)
 #endif
 
-#define GLOBAL(name)	\
-	.globl ASM_SYMBOL(name);	\
+#if defined(__hppa__)
+ /* HPPA/PA-RISC assembly is special: comments start with semicolon
+  * and exclamation marks separates statements. */
+ #define GLOBAL(name)	\
+	.globl ASM_SYMBOL(name) ! \
 	ASM_SYMBOL(name):
+#else
+ #define GLOBAL(name)	\
+	.globl ASM_SYMBOL(name) ; \
+	ASM_SYMBOL(name):
+#endif
 
 	.section ".init.data","aw"
 

                 reply	other threads:[~2013-05-05 21:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20130505213118.GA1622@p100.box \
    --to=deller@gmx.de \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.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