Is a weak symbol guaranteed to be zero-initialized if it's not resolved at link time

Viewed 56
__attribute__((weak)) void f1();
__attribute__((weak)) void f2();

void f2(){}

int main()
{
    assert(0 == f1); // always true?
    assert(0 != f2); // always true?
}

The GCC's manual page is rather vague about whether a weak symbol is guaranteed to be zero-initialized if it's not resolved at link time.

Any definitive reference? Especially nice if it's from GCC's documentation.

0 Answers
Related