aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/setup.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-03-15 02:19:38 -0400
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-03-17 15:56:52 -0400
commit0b1c723d0bd199300a1a2de57a46000d17577498 (patch)
treefbc5ae907b8bc9053ab3fc1f8a83c1bd938d2094 /arch/x86/include/asm/setup.h
parent60ac98213914cc615c67e84bfb964aa95a080d13 (diff)
x86/brk: make the brk reservation symbols inaccessible from C
Impact: bulletproofing, clarification The brk reservation symbols are just there to document the amount of space reserved by brk users in the final vmlinux file. Their addresses are irrelevent, and using their addresses will cause certain havok. Name them ".brk.NAME", which is a valid asm symbol but C can't reference it; it also highlights their special role in the symbol table. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86/include/asm/setup.h')
-rw-r--r--arch/x86/include/asm/setup.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index 61b126b97885..fbf0521eeed8 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -116,13 +116,13 @@ void *extend_brk(size_t size, size_t align);
116 * executable.) 116 * executable.)
117 */ 117 */
118#define RESERVE_BRK(name,sz) \ 118#define RESERVE_BRK(name,sz) \
119 static void __section(.discard) __used \ 119 static void __section(.discard) __used \
120 __brk_reservation_fn_##name##__(void) { \ 120 __brk_reservation_fn_##name##__(void) { \
121 asm volatile ( \ 121 asm volatile ( \
122 ".pushsection .brk_reservation,\"aw\",@nobits;" \ 122 ".pushsection .brk_reservation,\"aw\",@nobits;" \
123 "__brk_reservation_" #name "__:" \ 123 ".brk." #name ":" \
124 " 1:.skip %c0;" \ 124 " 1:.skip %c0;" \
125 " .size __brk_reservation_" #name "__, . - 1b;" \ 125 " .size .brk." #name ", . - 1b;" \
126 " .popsection" \ 126 " .popsection" \
127 : : "i" (sz)); \ 127 : : "i" (sz)); \
128 } 128 }
@@ -141,9 +141,9 @@ void __init x86_64_start_reservations(char *real_mode_data);
141#else 141#else
142#define RESERVE_BRK(name,sz) \ 142#define RESERVE_BRK(name,sz) \
143 .pushsection .brk_reservation,"aw",@nobits; \ 143 .pushsection .brk_reservation,"aw",@nobits; \
144__brk_reservation_##name##__: \ 144.brk.name: \
1451: .skip sz; \ 1451: .skip sz; \
146 .size __brk_reservation_##name##__,.-1b; \ 146 .size .brk.name,.-1b; \
147 .popsection 147 .popsection
148#endif /* __ASSEMBLY__ */ 148#endif /* __ASSEMBLY__ */
149#endif /* __KERNEL__ */ 149#endif /* __KERNEL__ */