aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/vdso/vma.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-01-30 07:30:41 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:30:41 -0500
commit7f3646aa16f496201e045183402c6614fa27b0c7 (patch)
treeafbee61e10ce854f683e27b0fdd0097fc9200f75 /arch/x86/vdso/vma.c
parent5b93049337301d6fbd3cf55db99b34e6b0dbd3a3 (diff)
x86 vDSO: use vdso-syms.lds
This patch changes the kernel's references to addresses in the vDSO image to be based on the symbols defined by vdso-syms.lds instead of the old vdso-syms.o symbols. This is all wrapped up in a macro defined by the new asm-x86/vdso.h header; that's the only place in the kernel source that has to know the details of the scheme for getting vDSO symbol values. Signed-off-by: Roland McGrath <roland@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/vdso/vma.c')
-rw-r--r--arch/x86/vdso/vma.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c
index ff9333e5fb08..3fdd51497a83 100644
--- a/arch/x86/vdso/vma.c
+++ b/arch/x86/vdso/vma.c
@@ -11,23 +11,20 @@
11#include <asm/vsyscall.h> 11#include <asm/vsyscall.h>
12#include <asm/vgtod.h> 12#include <asm/vgtod.h>
13#include <asm/proto.h> 13#include <asm/proto.h>
14#include "voffset.h" 14#include <asm/vdso.h>
15 15
16int vdso_enabled = 1; 16#include "vextern.h" /* Just for VMAGIC. */
17
18#define VEXTERN(x) extern typeof(__ ## x) *vdso_ ## x;
19#include "vextern.h"
20#undef VEXTERN 17#undef VEXTERN
21 18
22extern char vdso_kernel_start[], vdso_start[], vdso_end[]; 19int vdso_enabled = 1;
20
21extern char vdso_start[], vdso_end[];
23extern unsigned short vdso_sync_cpuid; 22extern unsigned short vdso_sync_cpuid;
24 23
25struct page **vdso_pages; 24struct page **vdso_pages;
26 25
27static inline void *var_ref(void *vbase, char *var, char *name) 26static inline void *var_ref(void *p, char *name)
28{ 27{
29 unsigned offset = var - &vdso_kernel_start[0] + VDSO_TEXT_OFFSET;
30 void *p = vbase + offset;
31 if (*(void **)p != (void *)VMAGIC) { 28 if (*(void **)p != (void *)VMAGIC) {
32 printk("VDSO: variable %s broken\n", name); 29 printk("VDSO: variable %s broken\n", name);
33 vdso_enabled = 0; 30 vdso_enabled = 0;
@@ -62,9 +59,8 @@ static int __init init_vdso_vars(void)
62 vdso_enabled = 0; 59 vdso_enabled = 0;
63 } 60 }
64 61
65#define V(x) *(typeof(x) *) var_ref(vbase, (char *)RELOC_HIDE(&x, 0), #x)
66#define VEXTERN(x) \ 62#define VEXTERN(x) \
67 V(vdso_ ## x) = &__ ## x; 63 *(typeof(__ ## x) **) var_ref(VDSO64_SYMBOL(vbase, x), #x) = &__ ## x;
68#include "vextern.h" 64#include "vextern.h"
69#undef VEXTERN 65#undef VEXTERN
70 return 0; 66 return 0;