mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-27 06:10:06 +08:00
Avoid crash with "Avoid a crash with weak symbols for "make test""
This fixes commit197a6acb30
which fixed commit95b9a477b6
Also remove useless example files
This commit is contained in:
parent
5e6fabefd7
commit
82c5edb31c
@ -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…
Reference in New Issue
Block a user