Avoid crash with "Avoid a crash with weak symbols for "make test""
This fixes commit197a6acb30which fixed commit95b9a477b6Also remove useless example files
This commit is contained in:
		
							parent
							
								
									5e6fabefd7
								
							
						
					
					
						commit
						82c5edb31c
					
				
					 3 changed files with 1 additions and 18 deletions
				
			
		| 
						 | 
				
			
			@ -1,11 +0,0 @@
 | 
			
		|||
#! /usr/local/bin/tcc -run
 | 
			
		||||
#include <tcclib.h>
 | 
			
		||||
 | 
			
		||||
extern void weak_f (void) __attribute__ ((weak));
 | 
			
		||||
 | 
			
		||||
int main ()
 | 
			
		||||
{
 | 
			
		||||
    if (weak_f) {
 | 
			
		||||
        weak_f();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,6 +0,0 @@
 | 
			
		|||
#include <tcclib.h>
 | 
			
		||||
 | 
			
		||||
void weak_f (void)
 | 
			
		||||
{
 | 
			
		||||
    printf("Weak\n");
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										2
									
								
								libtcc.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								libtcc.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -429,7 +429,7 @@ ST_FUNC void put_extern_sym2(Sym *sym, Section *section,
 | 
			
		|||
    if (sym->type.t & VT_STATIC)
 | 
			
		||||
        sym_bind = STB_LOCAL;
 | 
			
		||||
    else {
 | 
			
		||||
        if (sym->type.ref && FUNC_WEAK(sym->type.ref->r))
 | 
			
		||||
        if (sym_type == STT_FUNC && sym->type.ref && FUNC_WEAK(sym->type.ref->r))
 | 
			
		||||
            sym_bind = STB_WEAK;
 | 
			
		||||
        else
 | 
			
		||||
            sym_bind = STB_GLOBAL;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue