lkml.org 
[lkml]   [2013]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH v2] kernel/modsign_certificate.S: use real contents instead of macro GLOBAL()
If a macro is only used within 2 times, and also its contents are
within 2 lines, recommend to expand it to shrink code line.

For our case, the macro is not portable either: some architectures'
assembler may use another character to mark newline in a macro (e.g.
'`' for arc), which will cause issue (e.g. arc with allmodconfig):

LD init/built-in.o
kernel/built-in.o: In function `load_module_signing_keys':
kernel/modsign_pubkey.c:66: undefined reference to `modsign_certificate_list'
kernel/modsign_pubkey.c:71: undefined reference to `modsign_certificate_list_end'
kernel/modsign_pubkey.c:67: undefined reference to `modsign_certificate_list_end'

If still want to use macro and let it portable enough, it will need
additional line -- include additional header file (e.g "#include
<linux/linkage.h>", although it also need be fixed).


Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
kernel/modsign_certificate.S | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/kernel/modsign_certificate.S b/kernel/modsign_certificate.S
index 4a9a86d..1967dcd 100644
--- a/kernel/modsign_certificate.S
+++ b/kernel/modsign_certificate.S
@@ -1,12 +1,10 @@
#include <linux/export.h>

-#define GLOBAL(name) \
- .globl VMLINUX_SYMBOL(name); \
- VMLINUX_SYMBOL(name):
-
.section ".init.data","aw"

-GLOBAL(modsign_certificate_list)
+ .globl VMLINUX_SYMBOL(modsign_certificate_list)
+VMLINUX_SYMBOL(modsign_certificate_list):
.incbin "signing_key.x509"
.incbin "extra_certificates"
-GLOBAL(modsign_certificate_list_end)
+ .globl VMLINUX_SYMBOL(modsign_certificate_list_end)
+VMLINUX_SYMBOL(modsign_certificate_list_end):
--
1.7.7.6



\
 
 \ /
  Last update: 2013-10-29 03:41    [W:0.514 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site