This fixes commit 197a6acb30940068d1dc3d0fa53c9f0863309885 which fixed commit 95b9a477b6743004e0e9bf728b25bf63d2908777 Also remove useless example files
Unified · Split
| @@ -1,11 +0,0 @@ | ||
| 1 | −#! /usr/local/bin/tcc -run | |
| 2 | −#include <tcclib.h> | |
| 3 | − | |
| 4 | −extern void weak_f (void) __attribute__ ((weak)); | |
| 5 | − | |
| 6 | −int main () | |
| 7 | −{ | |
| 8 | − if (weak_f) { | |
| 9 | − weak_f(); | |
| 10 | − } | |
| 11 | −} | |
| @@ -1,6 +0,0 @@ | ||
| 1 | −#include <tcclib.h> | |
| 2 | − | |
| 3 | −void weak_f (void) | |
| 4 | −{ | |
| 5 | − printf("Weak\n"); | |
| 6 | −} | |
| @@ -429,7 +429,7 @@ ST_FUNC void put_extern_sym2(Sym *sym, Section *section, · 428 unmodified lines | ||
| 429 | 429 | if (sym->type.t & VT_STATIC) |
| 430 | 430 | sym_bind = STB_LOCAL; |
| 431 | 431 | else { |
| 432 | − if (sym->type.ref && FUNC_WEAK(sym->type.ref->r)) | |
| 432 | + if (sym_type == STT_FUNC && sym->type.ref && FUNC_WEAK(sym->type.ref->r)) | |
| 433 | 433 | sym_bind = STB_WEAK; |
| 434 | 434 | else |
| 435 | 435 | sym_bind = STB_GLOBAL; |