[lldb-dev] Symbol lookup failure with copy relocations

Greg Clayton gclayton at apple.com
Thu Feb 27 11:49:01 PST 2014


I just checked with the local linker experts and no, we do not have this issue on MacOSX.

On Feb 27, 2014, at 11:25 AM, Ed Maste <emaste at freebsd.org> wrote:

> There's a report in llvm.org/pr18734 of a symbol lookup issue during
> expression parsing.  The sample code has a global variable 'a' in a
> shared library that's also accessed by the main executable.  When I
> first saw the PR I thought it might be caused by incorrect debug data;
> both LLDB and GDB show the same behaviour, and FreeBSD does have a
> rather old version of the GNU toolchain.
> 
> I finally had a chance to look at it in detail yesterday.  What's
> happening is that the symbol actually ends up located in the main
> executable, which gains a copy relocation (R_X86_64_COPY).  The
> runtime linker copies the data from the shared library into the
> executable, and the space in the shared library is unused from then
> on.  The shared library's debug data refers to this now-unused copy,
> which is what LLDB finds during expression parsing.
> 
> I guess we'll have to build a list of copy relocations while
> processing the main executable, and then apply them during subsequent
> shared library parsing.
> 
> I'm not sure how or if this is done on OS X.  Does the same issue exist there?
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev




More information about the lldb-dev mailing list