[uClibc]SYMBOL_PREFIX in <features.h>

Yoshinori Sato qzb04471 at nifty.ne.jp
Wed May 29 02:38:05 MDT 2002


At 27 May 2002 15:08:46 +0900,
Miles Bader wrote:
> 
> A recent change in <features.h> added the following #ifdef:
> 
> +#  if defined(__H8300H__)
> +#    define SYMBOL_PREFIX "_"      /* H8/300 Target of add "_" to symbol prefix */
> 
> as well as some code below to use it.
> 
> There's already some stuff in the top-level Makefile to look for a
> `C_SYMBOL_PREFIX' variable (from the Config file), and define a
> similarly named cpp macro in uClibc_config.h if found (I added this for
> the v850, which also has a confused compiler).
> 
> I think the latter approach is preferable, since it avoids dodgy
> system-specific #ifdefs in common files, and allows the user to override
> it easily if necessary.  The name C_SYMBOL_PREFIX is also arguably
> better, as it gives a tiny clue as to what it's referring to...
> 
> So, I'd say it would be good to remove the #ifdef and #define from
> <features.h>, change the dependent code to use C_SYMBOL_PREFIX, and add
> a definition of that variable to the appropiate Config file.
> 

Is it better to use config file.
It corrected so that C_SYMBOL_PREFIX might be used.

Index: extra/Configs/Config.h8300
===================================================================
RCS file: /cvsroot/uclinux-h8/uClibc/extra/Configs/Config.h8300,v
retrieving revision 1.2
diff -u -r1.2 Config.h8300
--- extra/Configs/Config.h8300	21 May 2002 15:49:53 -0000	1.2
+++ extra/Configs/Config.h8300	28 May 2002 15:06:20 -0000
@@ -193,3 +193,5 @@
 #PREFIX = $(TOPDIR)/_install
 PREFIX =
 
+# C defiend symbols prefix charactor
+C_SYMBOL_PREFIX = _
\ No newline at end of file
Index: include/features.h
===================================================================
RCS file: /cvsroot/uclinux-h8/uClibc/include/features.h,v
retrieving revision 1.2
diff -u -r1.2 features.h
--- include/features.h	21 May 2002 15:49:55 -0000	1.2
+++ include/features.h	28 May 2002 15:06:47 -0000
@@ -381,16 +381,11 @@
 	    static const char __evoke_link_warning_##symbol[]		      \
 	    __attribute__ ((section (".gnu.warning." #symbol "\n\t#"))) = msg;
 #else /* !defined HAVE_ELF */
-#  if defined(__H8300H__)
-#    define SYMBOL_PREFIX "_"      /* H8/300 Target of add "_" to symbol prefix */
-#  else
-#    define SYMBOL_PREFIX 
-#  endif
 #  define strong_alias(name, aliasname) _strong_alias (name, aliasname)
 #  define weak_alias(name, aliasname) _strong_alias (name, aliasname)
 #  define _strong_alias(name, aliasname) \
-	__asm__(".global " SYMBOL_PREFIX #aliasname "\n" \
-                ".set " SYMBOL_PREFIX #aliasname "," SYMBOL_PREFIX #name);
+	__asm__(".global " C_SYMBOL_PREFIX #aliasname "\n" \
+                ".set " C_SYMBOL_PREFIX #aliasname "," C_SYMBOL_PREFIX #name);
 #  define link_warning(symbol, msg) \
 	asm (".stabs \"" msg "\",30,0,0,0\n\t" \
 	      ".stabs \"" #symbol "\",1,0,0,0\n");

-- 
Yoshinori Sato
<qzb04471 at nifty.ne.jp>



More information about the uClibc mailing list