[PATCH] uml: export symbols added by GCC hardened
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / um / os-Linux / user_syms.c
blob3f33165ada689cfea8d8bf92bd0bb36610a0060a
1 #include "linux/types.h"
2 #include "linux/module.h"
4 /* Some of this are builtin function (some are not but could in the future),
5 * so I *must* declare good prototypes for them and then EXPORT them.
6 * The kernel code uses the macro defined by include/linux/string.h,
7 * so I undef macros; the userspace code does not include that and I
8 * add an EXPORT for the glibc one.*/
10 #undef strlen
11 #undef strstr
12 #undef memcpy
13 #undef memset
15 extern size_t strlen(const char *);
16 extern void *memcpy(void *, const void *, size_t);
17 extern void *memmove(void *, const void *, size_t);
18 extern void *memset(void *, int, size_t);
19 extern int printf(const char *, ...);
21 /* If they're not defined, the export is included in lib/string.c.*/
22 #ifdef __HAVE_ARCH_STRLEN
23 EXPORT_SYMBOL(strlen);
24 #endif
25 #ifdef __HAVE_ARCH_STRSTR
26 EXPORT_SYMBOL(strstr);
27 #endif
29 EXPORT_SYMBOL(memcpy);
30 EXPORT_SYMBOL(memmove);
31 EXPORT_SYMBOL(memset);
32 EXPORT_SYMBOL(printf);
34 /* Here, instead, I can provide a fake prototype. Yes, someone cares: genksyms.
35 * However, the modules will use the CRC defined *here*, no matter if it is
36 * good; so the versions of these symbols will always match
38 #define EXPORT_SYMBOL_PROTO(sym) \
39 int sym(void); \
40 EXPORT_SYMBOL(sym);
42 extern void readdir64(void) __attribute__((weak));
43 EXPORT_SYMBOL(readdir64);
44 extern void truncate64(void) __attribute__((weak));
45 EXPORT_SYMBOL(truncate64);
47 #ifdef SUBARCH_i386
48 EXPORT_SYMBOL(vsyscall_ehdr);
49 EXPORT_SYMBOL(vsyscall_end);
50 #endif
52 EXPORT_SYMBOL_PROTO(__errno_location);
54 EXPORT_SYMBOL_PROTO(access);
55 EXPORT_SYMBOL_PROTO(open);
56 EXPORT_SYMBOL_PROTO(open64);
57 EXPORT_SYMBOL_PROTO(close);
58 EXPORT_SYMBOL_PROTO(read);
59 EXPORT_SYMBOL_PROTO(write);
60 EXPORT_SYMBOL_PROTO(dup2);
61 EXPORT_SYMBOL_PROTO(__xstat);
62 EXPORT_SYMBOL_PROTO(__lxstat);
63 EXPORT_SYMBOL_PROTO(__lxstat64);
64 EXPORT_SYMBOL_PROTO(lseek);
65 EXPORT_SYMBOL_PROTO(lseek64);
66 EXPORT_SYMBOL_PROTO(chown);
67 EXPORT_SYMBOL_PROTO(truncate);
68 EXPORT_SYMBOL_PROTO(utime);
69 EXPORT_SYMBOL_PROTO(chmod);
70 EXPORT_SYMBOL_PROTO(rename);
71 EXPORT_SYMBOL_PROTO(__xmknod);
73 EXPORT_SYMBOL_PROTO(symlink);
74 EXPORT_SYMBOL_PROTO(link);
75 EXPORT_SYMBOL_PROTO(unlink);
76 EXPORT_SYMBOL_PROTO(readlink);
78 EXPORT_SYMBOL_PROTO(mkdir);
79 EXPORT_SYMBOL_PROTO(rmdir);
80 EXPORT_SYMBOL_PROTO(opendir);
81 EXPORT_SYMBOL_PROTO(readdir);
82 EXPORT_SYMBOL_PROTO(closedir);
83 EXPORT_SYMBOL_PROTO(seekdir);
84 EXPORT_SYMBOL_PROTO(telldir);
86 EXPORT_SYMBOL_PROTO(ioctl);
88 EXPORT_SYMBOL_PROTO(pread64);
89 EXPORT_SYMBOL_PROTO(pwrite64);
91 EXPORT_SYMBOL_PROTO(statfs);
92 EXPORT_SYMBOL_PROTO(statfs64);
94 EXPORT_SYMBOL_PROTO(getuid);
96 EXPORT_SYMBOL_PROTO(fsync);
97 EXPORT_SYMBOL_PROTO(fdatasync);
99 /* Export symbols used by GCC for the stack protector. */
100 extern void __stack_smash_handler(void *) __attribute__((weak));
101 EXPORT_SYMBOL(__stack_smash_handler);
103 extern long __guard __attribute__((weak));
104 EXPORT_SYMBOL(__guard);
107 * Overrides for Emacs so that we follow Linus's tabbing style.
108 * Emacs will notice this stuff at the end of the file and automatically
109 * adjust the settings for this buffer only. This must remain at the end
110 * of the file.
111 * ---------------------------------------------------------------------------
112 * Local variables:
113 * c-file-style: "linux"
114 * End: