Descriptionld: weak symbols
A reference to the address of weak.foo resolves at link time
to the address of the symbol foo if foo would end up in the
binary anyway, or to zero if foo would not be in the binary.
For example:
int xxx = 1;
int yyy = 2;
int weak·xxx;
int weak·yyy;
void main·main(void) {
runtime·printf("%p %p %p\n", &xxx, &weak·xxx, &weak·yyy);
}
prints the same non-nil address twice, then 0 (because yyy is not
referenced so it was dropped from the binary).
This will be used by the reflection tables.
Patch Set 1 #Patch Set 2 : diff -r 5f0839c8649e https://go.googlecode.com/hg/ #Patch Set 3 : diff -r ef61c195edc3 https://go.googlecode.com/hg/ #
Total comments: 1
Patch Set 4 : diff -r a73bab5de08d https://go.googlecode.com/hg/ #
MessagesTotal messages: 4
|