[llvm-dev] Need help with code generation

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 23 06:33:53 PDT 2016


On Wed, Mar 23, 2016 at 11:00:08AM +0000, David Chisnall via llvm-dev wrote:
> On 22 Mar 2016, at 19:57, Rui Ueyama via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> > 
> > ELF is a documented file format so if you are not sure if something should be considered valid, you can take a look at the spec to determine whether it is valid or not. File validity is an independent concept from LLD and I think we can determine it according to the spec.
> 
> Some folk in Cambridge (including Stephen Kell, who I think you met at
> dinner on Friday) are working on a formal model for ELF and of linker
> semantics.  From what I’ve seen of their work, I’d echo Raphael’s
> comment: determining that a file is a valid ELF file is a long way from
> being trivial.

But determining that an ELF file is valid is not required here. Code
only has to make sure it is not obviously harmful. This means doing
basic out-of-bounds checks the first time one of the data structures is
processed, but it doesn't mean trying terribly hard to make sure that
the content makes sense. That's a huge difference.

Joerg


More information about the llvm-dev mailing list