summaryrefslogtreecommitdiffstats
path: root/include/linux/linkage.h
diff options
context:
space:
mode:
authorTim Abbott <tabbott@ksplice.com>2009-09-20 18:14:12 -0400
committerSam Ravnborg <sam@ravnborg.org>2009-09-21 06:27:08 +0200
commit42f29a25207dc7b3051d299cc028d4b395d1328d (patch)
tree34c0d4bc868752b9cb559c8db4c124783d70ff05 /include/linux/linkage.h
parent51b563fc93c8cb5bff1d67a0a71c374e4a4ea049 (diff)
kbuild: Don't define ALIGN and ENTRY when preprocessing linker scripts.
Adding a reference to <linux/linkage.h> to x86's <asm/cache.h> causes the x86 linker script to have syntax errors, because the ALIGN and ENTRY keywords get redefined to the assembly implementations of those. One could fix this by adjusting the include structure, but I think any solution based on that approach would be fragile. Currently, it is impossible when writing a header to do something different for assembly files and linker scripts, even though there are clearly cases where one wants them to define macros differently for the two (ENTRY being an excellent example). So I think the right solution here is to introduce a new preprocessor definition, called LINKER_SCRIPT that is set along with __ASSEMBLY__ for linker scripts, and to use that to not define ALIGN and ENTRY in linker scripts. I suspect we'll find other uses for this mechanism in the future. Signed-off-by: Tim Abbott <tabbott@ksplice.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'include/linux/linkage.h')
-rw-r--r--include/linux/linkage.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index 691f59171c6..5126cceb6ae 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -57,6 +57,7 @@
#ifdef __ASSEMBLY__
+#ifndef LINKER_SCRIPT
#define ALIGN __ALIGN
#define ALIGN_STR __ALIGN_STR
@@ -66,6 +67,7 @@
ALIGN; \
name:
#endif
+#endif /* LINKER_SCRIPT */
#ifndef WEAK
#define WEAK(name) \