[llvmlinux] Functions marked with __weak directives are linked in after the _etext symbol

Renato Golin renato.golin at linaro.org
Tue Nov 18 23:23:28 UTC 2014

On 18 November 2014 22:59, Jan-Simon Moeller <dl9pf at gmx.de> wrote:
> we have seen strange behaviour with __weak already (look how module_init and
> module_exit work for modules and for built-in code). This caused confusion
> when compiling the kernel with clang already.

The implementation of weak symbols is undefined, so each compiler
pretty much does what it think is best. Of course, not for all

The _etext and _edata symbols seem to be implemented in many variants
of Unix, though I'm not sure that's in the ELF standard. It may just
be that Clang never had to deal with that before because it's only now
that we're compiling the kernel... :)

If that's the case, I think we should just support the symbols for
what they mean, doesn't look all that complicated. Can you open a bug
on http://llvm.org/bugs/ please?


More information about the LLVMLinux mailing list