I've read some documentation that mentions malloc as a weak symbol,such as:
- https://en.wikipedia.org/wiki/Weak_symbol
- An alternative for the deprecated __malloc_hook functionality of glibc
But I don't see malloc declared as a weak symbol in the source code(malloc.c),which is confusing to me. I have the following questions to askļ¼
- Is malloc really a weak symbol? If so, where is it declared as a weak symbol
- an-alternative-for-the-deprecated-malloc-hook-functionality-of-glibc mentioned "but in static linking malloc is not a weak symbol, resulting in a multiple definition error at link time".Static links can allow multiple weak symbols, why does this lead to symbol conflict?
Thanks.