[Lldb-commits] [PATCH] D32434: ObjectFileELF: Fix symbol lookup in bss section

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 25 01:10:17 PDT 2017


On 24 April 2017 at 23:16, Zachary Turner <zturner at google.com> wrote:

> I suppose that's a reasonable concern.  I also didn't notice that this was
> a unittest, I assumed it was a lit test.
>
> If that's the case, is there any way to use llvm/Object to construct a
> minimal ELF file in memory with a hardcoded symbol in the BSS section.  It
> can even be missing certain critical things that would be normally required
> by an ELF file, and contain nothing but a single BSS section.  Write it to
> some memory buffer, and then use ObjectFileELF to try to do a lookup on it.
>
> This way there's no input files of *any* kind.  Is this possible?
>


That's sort of that yaml2obj is, except that you use yaml instead of c++ to
describe the file you want to construct. That makes it a lot easier to
write the test, as you can just use obj2yaml to get the yaml (and prune it
if necessary), so this is the direction I'd like to move to. It does mean
that there will be an input file, but I don't think that's such a bad
thing. (well, I suppose I could pipe the yaml into yaml2obj, but that is
not going to help anything).

I'll still need to create a temporary elf file, as the api's I am using
accept a file name.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170425/afcdd49e/attachment.html>


More information about the lldb-commits mailing list