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

Jason Gionta jjgionta at ncsu.edu
Wed Nov 19 14:00:05 UTC 2014


Thanks for the insight and discussion. I will open a bug.

Thanks,

Jason

On Tue, Nov 18, 2014 at 6:23 PM, Renato Golin <renato.golin at linaro.org>
wrote:

> 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
> cases...
>
> 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?
>
> cheers,
> --renato
>



-- 
Jason Gionta
Cyber Defense Lab
North Carolina State University
jjgionta at ncsu.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/llvmlinux/attachments/20141119/cbea8529/attachment.html>


More information about the LLVMLinux mailing list