Bug 1157 – gdc makes functions .globl even when visibility is "hidden" or "internal"
Status
RESOLVED
Resolution
INVALID
Severity
blocker
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2007-04-17T12:07:00Z
Last change time
2015-06-09T05:14:39Z
Assigned to
dvdfrdmn
Creator
madou
Comments
Comment #0 by madou — 2007-04-17T12:07:47Z
The following code:
pragma(GNU_attribute, visibility("hidden"))
void test()
{
}
results in:
.globl _D1x4testFZv
.hidden _D1x4testFZv
.type _D1x4testFZv, @function
_D1x4testFZv:
which is clearly bogus.
Comment #1 by dvdfrdmn — 2007-07-13T21:35:45Z
The visibility attribute applies to the final ELF executable/sharedlib. The ".globl" directive just means that the symbol is available to other object modules during static linking.
The C compiler does the same thing.