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

Jan-Simon Moeller dl9pf at gmx.de
Tue Nov 18 22:59:36 UTC 2014


Hi Jason, 

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.

I think this is a question for the llvm/clang list or @Renato what do you 
think ?

Best regards,
Jan-Simon

Am Dienstag, 18. November 2014, 16:25:01 schrieb Jason Gionta:
> Hi,
> 
> I was wondering if anyone could tell me why functions with __weak
> directives are linked into the vmlinux image after the _etext symbol. Is
> this by design? In a gcc compiled vmlinux, these symbols are dispersed
> throughout the code. As a result, _etext is no longer the end of code, but
> some weak symbol assumes that role.
> 
> Thanks,



More information about the LLVMLinux mailing list