Re: Using versioned symbols in assembler parts of a source file

Richard Henderson (rth@cygnus.com)
Wed, 13 Aug 1997 18:12:40 -0700 (PDT)


> Do you mean that the definition in the kernel is wrong? Or how it is applied
> in the sourec of my file? What do you propose to do?

I suggest that the following is correct.

r~

--- include/linux/linkage.h.orig Wed Aug 13 19:06:05 1997
+++ include/linux/linkage.h Wed Aug 13 19:11:16 1997
@@ -8,18 +8,25 @@
#endif

#ifdef __ELF__
-#define SYMBOL_NAME_STR(X) #X
-#define SYMBOL_NAME(X) X
+#define SYMBOL_NAME_STR1(X) #X
+#define SYMBOL_NAME_STR(X) SYMBOL_NAME_STR1(X)
+#define SYMBOL_NAME1(X) X
+#define SYMBOL_NAME(X) SYMBOL_NAME1(X)
#ifdef __STDC__
-#define SYMBOL_NAME_LABEL(X) X##:
+#define SYMBOL_NAME_LABEL1(X) X##:
+#define SYMBOL_NAME_LABEL(X) SYMBOL_NAME_LABEL1(X)
#else
#define SYMBOL_NAME_LABEL(X) X/**/:
#endif
#else
-#define SYMBOL_NAME_STR(X) "_"#X
+#define SYMBOL_NAME_STR2(X) #X
+#define SYMBOL_NAME_STR1(X) SYMBOL_NAME_STR2(_##X)
+#define SYMBOL_NAME_STR(X) SYMBOL_NAME_STR1(X)
#ifdef __STDC__
-#define SYMBOL_NAME(X) _##X
-#define SYMBOL_NAME_LABEL(X) _##X##:
+#define SYMBOL_NAME1(X) _##X
+#define SYMBOL_NAME(X) SYMBOL_NAME1(X)
+#define SYMBOL_NAME_LABEL1(X) _##X##:
+#define SYMBOL_NAME_LABEL(X) SYMBOL_NAME_LABEL1(X)
#else
#define SYMBOL_NAME(X) _/**/X
#define SYMBOL_NAME_LABEL(X) _/**/X/**/: