[LLVMdev] writeNopData and non-instructions in .text

Joerg Sonnenberger joerg at britannica.bec.de
Wed Sep 17 02:43:50 PDT 2014


On Tue, Sep 16, 2014 at 11:33:13PM -0400, David Majnemer wrote:
> I would be in favor of the following:
> 1. If the start is aligned *and* the length is aligned, use nops.
> 2. If the start is aligned but the length is not aligned, insert as many
> nops possible but pad out with zero.
> 3. Otherwise (if the start is misaligned), use *just* zeros.

>From reading MCAssembler.cpp, the function is always called before an
aligned place to pad. As such seems the correct behavior is to assume
that end will be aligned and "end - k * instruction size" should be
padded with nops and [start, end - k * instruction size) should be
padded with plain nulls?

Joerg



More information about the llvm-dev mailing list