Procházet zdrojové kódy

Several h8300 updates from Yoshinori Sato <qzb04471@nifty.ne.jp>

Eric Andersen před 23 roky
rodič
revize
5056666758

+ 1 - 1
extra/Configs/Config.h8300

@@ -140,7 +140,7 @@ ARCH_CFLAGS2 = -I$(KERNEL_SOURCE)/include
 #
 # get this from elsewhere, maybe
 #
-OPTIMIZATION = $(DEBUG_CFLAGS)
+OPTIMIZATION = $(DEBUG_CFLAGS) -mh -mint32 -fsigned-char
 
 # This is a COFF compiler (ick), so disable all the cool stuff
 HAVE_ELF = false

+ 8 - 2
include/features.h

@@ -380,11 +380,17 @@ uClibc was built without large file support enabled.
 	asm (".section "  ".gnu.warning." #symbol  "\n\t.previous");	      \
 	    static const char __evoke_link_warning_##symbol[]		      \
 	    __attribute__ ((section (".gnu.warning." #symbol "\n\t#"))) = msg;
-#else
+#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 " #aliasname "\n.set " #aliasname "," #name);
+	__asm__(".global " SYMBOL_PREFIX #aliasname "\n" \
+                ".set " SYMBOL_PREFIX #aliasname "," SYMBOL_PREFIX #name);
 #  define link_warning(symbol, msg) \
 	asm (".stabs \"" msg "\",30,0,0,0\n\t" \
 	      ".stabs \"" #symbol "\",1,0,0,0\n");

+ 4 - 4
libc/sysdeps/linux/common/syscalls.c

@@ -1373,14 +1373,13 @@ int sigsuspend (const sigset_t *mask)
 #endif
 
 //#define __NR_pread                    180
-#ifdef __NR_pread
 #ifdef L___libc_pread
+#ifdef __NR_pread
 #define _XOPEN_SOURCE 500
 #include <unistd.h>
 #define __NR___libc_pread __NR_pread
 _syscall4(ssize_t, __libc_pread, int, fd, void *, buf, size_t, count, __off_t, offset);
 weak_alias (__libc_pread, pread)
-#endif
 #else
 ssize_t pread(int fd, void *buf, size_t count, off_t offset)                                                
 {                                                                                                           
@@ -1388,16 +1387,16 @@ ssize_t pread(int fd, void *buf, size_t count, off_t offset)
 	return -1;                                                                                              
 }                                                                                                           
 #endif
+#endif
 
 //#define __NR_pwrite                   181
-#ifdef __NR_pwrite
 #ifdef L___libc_pwrite
+#ifdef __NR_pwrite
 #define _XOPEN_SOURCE 500
 #include <unistd.h>
 #define __NR___libc_pwrite __NR_pwrite
 _syscall4(ssize_t, __libc_pwrite, int, fd, const void *, buf, size_t, count, __off_t, offset);
 weak_alias (__libc_pwrite, pwrite)
-#endif
 #else
 ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset)                                         
 {                                                                                                           
@@ -1405,6 +1404,7 @@ ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset)
 	return -1;                                                                                              
 }                                                                                                           
 #endif
+#endif
 
 //#define __NR_chown                    182
 #ifdef L_chown

+ 1 - 1
libc/sysdeps/linux/h8300/crt0.S

@@ -58,6 +58,6 @@ empty_func:
  * is linking when the main() function is in a static library (.a)
  * we can be sure that main() actually gets linked in */
 L_dummy_main_reference:
-	.long	main
+	.long	_main