summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-04-06 00:24:23 +0200
committerRichard Braun <rbraun@sceen.net>2017-04-06 00:24:23 +0200
commit4ac24d88b35c53480e9495e0f69487d9210f8519 (patch)
tree9b77189e850f2866dd038bf650df0a26979e65ba
parent953503820a133cb7f9f92185d6ea570648f44556 (diff)
x86/boot: fix __bootdata macro
Uninitialized variables declared with the __bootdata macro may still be placed into the .bss section. Completely prevent the possibility by including the "used" variable attribute in the macro. See https://bugs.llvm.org//show_bug.cgi?id=9520.
-rw-r--r--arch/x86/machine/boot.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/machine/boot.h b/arch/x86/machine/boot.h
index 7e0d609..6b012f8 100644
--- a/arch/x86/machine/boot.h
+++ b/arch/x86/machine/boot.h
@@ -61,7 +61,7 @@
* Once paging is enabled, their access relies on the kernel identity mapping.
*/
#define __boot __section(".boot.text")
-#define __bootdata __section(".boot.data")
+#define __bootdata __section(".boot.data") __attribute__((used))
/*
* Boundaries of the .boot section.