21
21
#define max_log 256
22
22
23
23
24
- __attribute__((weak )) struct _IO_FILE * stderr = -1 ;
24
+ __attribute__((weak )) struct _IO_FILE * stderr = ( _IO_FILE * ) -1 ;
25
25
26
26
static int vwrite_err (const char * format , va_list ap )
27
27
{
@@ -55,7 +55,7 @@ __attribute__((weak)) int fprintf (FILE *__restrict __stream,
55
55
return -1 ;
56
56
} else {
57
57
va_list args ;
58
- int ret = 0 ;
58
+ ret = 0 ;
59
59
va_start (args , __format );
60
60
ret += vwrite_err (__format , args );
61
61
va_end (args );
@@ -102,7 +102,7 @@ extern uint64_t TEXT_BASE;
102
102
extern uint64_t TEXT_SIZE ;
103
103
extern uint64_t EH_FRM_HDR_BASE ;
104
104
extern uint64_t EH_FRM_HDR_SIZE ;
105
- extern void IMAGE_BASE ;
105
+ extern char IMAGE_BASE ;
106
106
107
107
typedef Elf64_Phdr Elf_Phdr ;
108
108
int
@@ -121,7 +121,7 @@ dl_iterate_phdr (int (*callback) (struct dl_phdr_info *,
121
121
122
122
memset (pinfo , 0 , sizeof (* pinfo ));
123
123
124
- pinfo -> dlpi_addr = & IMAGE_BASE ;
124
+ pinfo -> dlpi_addr = ( ElfW ( Addr )) & IMAGE_BASE ;
125
125
pinfo -> dlpi_phnum = 2 ;
126
126
127
127
pinfo -> dlpi_phdr = phdr ;
@@ -154,7 +154,7 @@ void *libuw_malloc(size_t size)
154
154
{
155
155
struct libwu_rs_alloc_meta * meta ;
156
156
size_t alloc_size = size + sizeof (struct libwu_rs_alloc_meta );
157
- meta = (void * )__rust_alloc (alloc_size , sizeof (size_t ));
157
+ meta = (void * )__rust_c_alloc (alloc_size , sizeof (size_t ));
158
158
if (!meta ) {
159
159
return NULL ;
160
160
}
@@ -169,5 +169,5 @@ void libuw_free(void *p)
169
169
return ;
170
170
}
171
171
meta = META_FROM_PTR (p );
172
- __rust_dealloc ((unsigned char * )meta , meta -> alloc_size , sizeof (size_t ));
172
+ __rust_c_dealloc ((unsigned char * )meta , meta -> alloc_size , sizeof (size_t ));
173
173
}
0 commit comments