Szabolcs Nagy
2011-07-28 12:58:17 UTC
attribute weak is only supported with alias
with the following code
static void f() {}
void g() __attribute__((weak, alias("f")));
void h() __attribute((weak));
static void *p = h;
nm t.o prints
00000000 t f
00000000 W g
U h
00000000 d p
with gcc nm t.o prints
00000000 t f
00000000 W g
w h
00000000 d p
(linux, elf objects, i386, not stripped)
it may worth supporting the plain weak attribute
if it's not too much extra effort
with the following code
static void f() {}
void g() __attribute__((weak, alias("f")));
void h() __attribute((weak));
static void *p = h;
nm t.o prints
00000000 t f
00000000 W g
U h
00000000 d p
with gcc nm t.o prints
00000000 t f
00000000 W g
w h
00000000 d p
(linux, elf objects, i386, not stripped)
it may worth supporting the plain weak attribute
if it's not too much extra effort