History

Avoid crash with "Avoid a crash with weak symbols for "make test""

This fixes commit 197a6acb30940068d1dc3d0fa53c9f0863309885 which fixed commit 95b9a477b6743004e0e9bf728b25bf63d2908777 Also remove useless example files

grischka committed 16 years ago

Commit 82c5edb1 parent 5e6fabe3 files · +1 −18Browse files

Unified · Split

3 files
  1. examples/ex_weak.c +0 −11
  2. examples/weak_f.c +0 −6
  3. libtcc.c +1 −1
examples/ex_weak.c+0−11
@@ -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−}
examples/weak_f.c+0−6
@@ -1,6 +0,0 @@
1−#include <tcclib.h>
2−
3−void weak_f (void)
4−{
5− printf("Weak\n");
6−}
libtcc.c+1−1
@@ -429,7 +429,7 @@ ST_FUNC void put_extern_sym2(Sym *sym, Section *section, · 428 unmodified lines
429429 if (sym->type.t & VT_STATIC)
430430 sym_bind = STB_LOCAL;
431431 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))
433433 sym_bind = STB_WEAK;
434434 else
435435 sym_bind = STB_GLOBAL;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t