[PATCH] D16599: ELF: Define another entry point.

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 07:53:14 PST 2016

On Mon, Feb 01, 2016 at 07:45:48AM -0800, Rafael EspĂ­ndola via llvm-commits wrote:
> * I would really not want us to be in a situation where we have bugs
> but they are not fixed. If not failing gracefully given broken files
> is to be considered a bug, we *have* to fuzz the linker and fix them.
> A particularly nasty case is relocations being used in ABI invalid
> cases. For example, if a R_X86_64_REX_GOTPCRELX is used in a position
> that doesn't follow a REX prefix, do we have to report the error or
> can we produce garbage when given garbage? Note that checking means
> disassembling the entire section to see if a given byte is a rex
> prefix for a instruction or just a byte of the previous instruction.

That's what I meant earlier in the discussion with sticky error flags.
If we can decently detect this situation, it seems to be perfectly
reasonable to me to just set a flag "this is garbage", but otherwise
continue. Bailing out is only ever going to be needed in cases where
incorrect input could result in extremely long loops or the like, like
dependency cycles that have to be broken at some point. Those situations
should be rare enough that they can be handled appropiately?

It seems to be a good idea to carefully try to detect this situations,
in NetBSDland we have been biten more than once by hitting surprising
edge cases noone ever considered before.


More information about the llvm-commits mailing list