aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kallsyms.c
diff options
context:
space:
mode:
authorGideon Israel Dsouza <gidisrael@gmail.com>2014-04-07 18:39:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 19:36:11 -0400
commit52f5684c8e1ec7463192aba8e2916df49807511a (patch)
treef8e6061de05014e89e58638f626831f2c38af971 /kernel/kallsyms.c
parentce816fa88cca083c47ab9000b2138a83043a78be (diff)
kernel: use macros from compiler.h instead of __attribute__((...))
To increase compiler portability there is <linux/compiler.h> which provides convenience macros for various gcc constructs. Eg: __weak for __attribute__((weak)). I've replaced all instances of gcc attributes with the right macro in the kernel subsystem. Signed-off-by: Gideon Israel Dsouza <gidisrael@gmail.com> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/kallsyms.c')
-rw-r--r--kernel/kallsyms.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 3127ad52cdb2..cb0cf37dac3a 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -23,6 +23,7 @@
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/ctype.h> 24#include <linux/ctype.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/compiler.h>
26 27
27#include <asm/sections.h> 28#include <asm/sections.h>
28 29
@@ -36,8 +37,8 @@
36 * These will be re-linked against their real values 37 * These will be re-linked against their real values
37 * during the second link stage. 38 * during the second link stage.
38 */ 39 */
39extern const unsigned long kallsyms_addresses[] __attribute__((weak)); 40extern const unsigned long kallsyms_addresses[] __weak;
40extern const u8 kallsyms_names[] __attribute__((weak)); 41extern const u8 kallsyms_names[] __weak;
41 42
42/* 43/*
43 * Tell the compiler that the count isn't in the small data section if the arch 44 * Tell the compiler that the count isn't in the small data section if the arch
@@ -46,10 +47,10 @@ extern const u8 kallsyms_names[] __attribute__((weak));
46extern const unsigned long kallsyms_num_syms 47extern const unsigned long kallsyms_num_syms
47__attribute__((weak, section(".rodata"))); 48__attribute__((weak, section(".rodata")));
48 49
49extern const u8 kallsyms_token_table[] __attribute__((weak)); 50extern const u8 kallsyms_token_table[] __weak;
50extern const u16 kallsyms_token_index[] __attribute__((weak)); 51extern const u16 kallsyms_token_index[] __weak;
51 52
52extern const unsigned long kallsyms_markers[] __attribute__((weak)); 53extern const unsigned long kallsyms_markers[] __weak;
53 54
54static inline int is_kernel_inittext(unsigned long addr) 55static inline int is_kernel_inittext(unsigned long addr)
55{ 56{