[llvm-commits] Uninitialized EH DWARF in the JIT

Nick Lewycky nicholas at mxc.ca
Thu Aug 20 21:21:56 PDT 2009


Reid Kleckner wrote:
> Hello,
> 
> This patch fixes a bug where the DWARF emitter in the JIT was not
> initializing alignment bytes.  libgcc doesn't seem to mind, but if you
> pass this EH info to GDB, it doesn't like it.  I don't think that in
> general the JIT should initialize the alignment bytes, since they
> aren't used, so I added a method emitAlignmentWithFill that does it.
> 
> Also, note that if you try to adjust the length to not include the
> uninitialized bytes, readelf -wf *really* doesn't like it, so I went
> with this solution instead.

You only changed 2 of 4 occurrences of emitAlignment to
emitAlignmentWithFill. Why aren't the other two causing you problems?

> Please review; I can commit the patch myself.

+private:
+  /// AlignPtr - Align Ptr to Alignment bytes, rounding up.  Alignment
should
+  /// be a power of two.  This method rounds up, so AlignPtr(7, 4) == 8 and
+  /// AlignPtr(8, 4) == 8.
+  static uint8_t *AlignPtr(uint8_t *Ptr, size_t Alignment) {

Please use RoundUpToAlignment() from llvm/Support/MathExtras.h.

Nick




More information about the llvm-commits mailing list