[PATCH] D24970: [ELF] - Fixed crash on invalid input.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 02:23:54 PDT 2016


grimar added a comment.

In https://reviews.llvm.org/D24970#554047, @davide wrote:

> In https://reviews.llvm.org/D24970#554045, @grimar wrote:
>
> > In https://reviews.llvm.org/D24970#554040, @davide wrote:
> >
> > > I think the tests should live in a different directory, yes.
> > >  Also, you might want to try reducing this binary.
> >
> >
> > It is just 480 bytes, does it worth that you think ?
>
>
> If the test can be reduced, I don't see a reason why we shouldn't do it.


So I do not know way how to craft the testcase for this without hex editor.
yaml2obj does not seem to have functionality to set Symbol st_name
which is offset in symtab, what is used in that patch. It has next code to set up
st_name:

  Symbol.st_name = DotStrtab.getOffset(Sym.Name);

where DotStrtab is just a StringTableBuilder, so there is no way to set up huge offset manually from yaml.

Also it seems not possible to create own .symtab, when I put into yaml the following description:

  Sections:
    - Name:            .strtab
      Type:            SHT_STRTAB
      Content:         00
      Size:            2

I have next error: "Repeated section name: '.strtab' at YAML section number 0.", because tool tries to create it own
.symtab.

Taking in account that new binary input is among the smallest ones from what we already have in lld and the fact that crafting
such special object is not possible using existent tool functionality, I suggest to leave it as is.


https://reviews.llvm.org/D24970





More information about the llvm-commits mailing list