[Bug target/35514] New: Gcc shoud generate symbol type for undefined symbol
hjl dot tools at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Mar 9 15:53:00 GMT 2008
Gcc doesn't generate symbol types for undefined symbol on ELF targets:
bash-3.2$ cat x.c
extern void foo() __attribute__((weak,visibility("hidden")));
extern int puts( char const* );
int main()
{
foo ? foo() : puts( "foo == null, skipped." );
return 0;
}
bash-3.2$ gcc -c x.c
bash-3.2$ readelf -s x.o
Symbol table '.symtab' contains 12 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 FILE LOCAL DEFAULT ABS x.c
2: 0000000000000000 0 SECTION LOCAL DEFAULT 1
3: 0000000000000000 0 SECTION LOCAL DEFAULT 3
4: 0000000000000000 0 SECTION LOCAL DEFAULT 4
5: 0000000000000000 0 SECTION LOCAL DEFAULT 5
6: 0000000000000000 0 SECTION LOCAL DEFAULT 6
7: 0000000000000000 0 SECTION LOCAL DEFAULT 9
8: 0000000000000000 0 SECTION LOCAL DEFAULT 8
9: 0000000000000000 43 FUNC GLOBAL DEFAULT 1 main
10: 0000000000000000 0 NOTYPE WEAK DEFAULT UND foo
11: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND puts
bash-3.2$
ELF linker needs symbol type to properly issue diagnostic message.
--
Summary: Gcc shoud generate symbol type for undefined symbol
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hjl dot tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35514
More information about the Gcc-bugs
mailing list