Bug 27080

Summary: gcc should emit .type directives for used undeclared extern variables and functions
Product: gcc Reporter: Nicholas Miell <nmiell>
Component: middle-endAssignee: Not yet assigned to anyone <unassigned>
Status: UNCONFIRMED ---    
Severity: enhancement CC: gcc-bugs
Priority: P3    
Version: unknown   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description Nicholas Miell 2006-04-08 03:54:49 UTC
It doesn't right now, but in a perfect world ld could complain if one object referred to a symbol of type object while another referred to the same symbol of type function.

Of course, in order for ld to do this, gcc would have to actually emit .type directives for extern variables and functions. It doesn't right now, hence this bug.
Comment 1 Andrew Pinski 2006-04-08 04:05:02 UTC
If we do it for all extern functions and variables, it would be about 1000 .types which are not useful.
Comment 2 Andrew Pinski 2006-04-08 04:06:58 UTC
I should note people do tricks and one of them would cause an error being emitting, maybe it should maybe not.  But even emitting used ones can go up in the .s file size causing more compile time issues.