Weak symbols not found by loaded code
Joel Sherrill
joel at rtems.org
Tue May 10 13:37:05 UTC 2016
On May 10, 2016 1:56 AM, "Patrick Gauvin" <pggauvin at gmail.com> wrote:
>
> Hello,
>
> I stumbled across this while trying to load C++ code using libdl. If a
> symbol is weakly defined in the base image and used in the loaded
> code, the loaded code is unable to find it. It is my understanding
> that if there is not a globally exported version of the symbol, the
> weak version will be globally available. Is this correct? Or is there
> a special procedure I need to use for this situation?
>
> I made a test case in pure C and I see the same behavior. If the
> symbol is weak and only present in the base image, it is not found and
> left unresolved. However, if the weak symbol is overrode by a symbol
> in the loaded code (weak or not), the symbol is resolved and the
> loaded code works. I can provide the test source if requested, I'm
> just out of time for tonight.
I lean to this being a bug on an untested case. If you can prepare a test
case and file a ticket, then Chris can take a look at it.
I am pretty sure the existing dl tested don't exercise this case.
--joel
> Thank you,
>
> -Patrick
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20160510/ae27c6bf/attachment-0002.html>
More information about the users
mailing list