Browse Source

fix assembler error. libc_hidden_data_def cannot work on COMMONs,
thus need to initialize stuff with 0 to force it into bss.
All hell can again break loose if future gcc will be smart enough
to ignore it.

Denis Vlasenko 18 năm trước cách đây
mục cha
commit
452f9f6951
1 tập tin đã thay đổi với 6 bổ sung3 xóa
  1. 6 3
      libc/stdlib/__uc_malloc.c

+ 6 - 3
libc/stdlib/__uc_malloc.c

@@ -24,8 +24,11 @@ Cambridge, MA 02139, USA.
 #include <unistd.h>
 #include <malloc.h>
 
-void (*__uc_malloc_failed)(size_t size);
-libc_hidden_data_def(__uc_malloc_failed);
+void (*__uc_malloc_failed)(size_t size) = NULL;
+/* Seemingly superfluous assigment of NULL above prevents gas error
+ * ("__uc_malloc_failed can't be equated to common symbol
+ * __GI___uc_malloc_failed") in libc_hidden_data_def: */
+libc_hidden_data_def(__uc_malloc_failed)
 
 void *__uc_malloc(size_t size)
 {
@@ -40,4 +43,4 @@ void *__uc_malloc(size_t size)
 		__uc_malloc_failed(size);
 	}
 }
-libc_hidden_def(__uc_malloc);
+libc_hidden_def(__uc_malloc)