<div dir="ltr">On Mon, Jul 15, 2013 at 2:13 PM, Sean Silva <span dir="ltr"><<a href="mailto:silvas@purdue.edu" target="_blank">silvas@purdue.edu</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
================<br>
Comment at: lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp:652<br>
@@ +651,3 @@<br>
+    // The first four bytes is the page RVA.<br>
+    *reinterpret_cast<llvm::support::ulittle32_t *>(&contents[0]) = pageAddr;<br>
+<br>
----------------<br>
</div><div class="im">Rui Ueyama wrote:<br>
> Sean Silva wrote:<br>
> > Do you know that the alignment is correct here? It's only a vector of uint8_t.<br>
> Good point! The spec does not say anything about the alignment, and it looks like Windows does not enforce any alignment of the .reloc section. However, the regular binary seems to have an optional empty field at the end of a block to align the block at 32-bit boundary.<br>


</div>I was actually concerned about the pointer `&contents[0]` being only uint8_t-aligned, and not ulittle32_t-aligned.</blockquote><div><br></div><div>I'm not an expert, but if we allocate an array larger than uint32_t, isn't it aligned at at least 32 bit boundary even if it's of type array<uint8_t>?</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
<br>
<a href="http://llvm-reviews.chandlerc.com/D1126" target="_blank">http://llvm-reviews.chandlerc.com/D1126</a><br>
<br>
COMMIT<br>
  <a href="http://llvm-reviews.chandlerc.com/rL186336" target="_blank">http://llvm-reviews.chandlerc.com/rL186336</a><br>
</div></div></blockquote></div><br></div></div>