[PATCH] [PECOFF][Writer] Emit .reloc section.

Richard legalize at xmission.com
Mon Jul 15 16:22:08 PDT 2013



================
Comment at: lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp:647
@@ +646,3 @@
+  DefinedAtom *createBaseRelocBlock(const File &file, uint64_t pageAddr,
+                                    std::vector<uint16_t> &offsets) {
+    uint32_t size = 8 + offsets.size() * 2;
----------------
Rui Ueyama wrote:
> Sean Silva wrote:
> > Richard wrote:
> > > offsets is not modified; pass by const reference
> > The assignments via the reinterpret_cast<> are modifying it. As you point out though, all those reinterpret_cast<>'s suggest that there is a safer way to do all this.
> It looks to me that offset can be passed by const reference as Richard pointed out.
The reinterpret_cast<>'s appear to be operating on a local vector ofuint8_t that we've constructed in the body of the function.  The offsets parameter seems only to be accessed with getters.


http://llvm-reviews.chandlerc.com/D1126

COMMIT
  http://llvm-reviews.chandlerc.com/rL186336



More information about the llvm-commits mailing list