[lld][Darwin] StubHelper atom

Nick Kledzik kledzik at apple.com
Thu Oct 24 14:45:12 PDT 2013


On Oct 24, 2013, at 2:21 PM, Shankar Easwaran <shankare at codeaurora.org> wrote:

> Hi Nick,
> 
> So I found the problem on Darwin when it tries to add a StubHelperAtom :-
> 
>  X86_64StubHelperAtom(const File &file, const Atom &helperCommon)
>  : SimpleDefinedAtom(file) {
>    this->addReference(KindHandler_x86_64::lazyImmediate, 1, nullptr, 0);
>    this->addReference(KindHandler_x86_64::ripRel32, 6, &helperCommon, 0);
>  }
> 
> A reference is being added to point to a nullptr. This has to be fixed to point to the right atom.
> 
> What should the target for the lazyImmediateReference be ?
There is no target.  The lazyImmediate kind is a marker that that location needs to be fixed up later with some value that is an offset into the __LINKEDIT segment.  

Either we:
1) change yaml reader/writer to support references with no targets (which has the draw back that it allows bad yaml files with references that expect a target to be constructed without one).
or,
2) change X86_64StubHelperAtom to use a dummy target, such as the X86_64StubHelperAtom itself.  

-Nick



More information about the llvm-commits mailing list