[LLVMdev] [lld] Handling non SHF_ALLOC sections.

Sean Silva chisophugis at gmail.com
Tue Sep 17 13:06:32 PDT 2013


On Mon, Sep 16, 2013 at 8:23 PM, Michael Spencer <bigcheesegs at gmail.com>wrote:

> Debug info linking is currently broken due to how we handle reading and
> laying out non SHF_ALLOC sections. I posted a patch that partially fixes
> this, but it's both the wrong approach and doesn't handle multiple input
> files with debug info (wrong relocation values).
>
> The first issue is representing non SHF_ALLOC atoms in the Atom model. We
> currently don't have a type for this, and DefinedAtom.cpp makes assumptions
> about the permissions of an Atom based on their type, so it's hard to use
> an existing type.
>
> The next problem is in the ELF writer. It currently cannot handle
> AtomSections that are not in a segment as file offsets and addresses are
> never set. This means that assignOffsets is not called, and that the atoms
> within are never added to the _atomToAddressMap. However, we can't just add
> them to that map with their virtual address, as they don't have a virtual
> address. We need to use the symbol value, which is the offset into the
> section. My current hack to fix this is to call
> assignVirtualAddresses(-fileoffset) and then explicitly added them to the
> _atomToAddressMap.
>
> Any ideas for the proper fix here?
>

This seems like a problem that will be solved along the way of implementing
`ld -r`, so the "proper" solution will probably be something in the general
direction of `ld -r`.

-- Sean Silva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130917/3b530490/attachment.html>


More information about the llvm-dev mailing list