Weak symbols not found by loaded code
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:
> 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.
> Thank you,
> users mailing list
> users at rtems.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the users