<div dir="ltr">Look at COFFBaseDefinedAtom in lib/ReaderWriter/PECOFF/Atoms.h for PE/COFF. Specifically, these functions and a field are for References.<div><br></div><div><div>  void addReference(std::unique_ptr<COFFReference> reference);</div>

<div>  virtual reference_iterator begin() const;</div><div>  virtual reference_iterator end() const;</div><div>  virtual const Reference *derefIterator(const void *iter) const;</div><div>  virtual void incrementIterator(const void *&iter) const;</div>

</div><div><div>  std::vector<std::unique_ptr<COFFReference>> _references;</div></div><div><br></div><div>As you can see References are stored into a single vector already. We don't have anything similar to reference{Start,End}Index because we have never needed it. Iterator knows where it is pointing to, so I don't see any reason why DefiendAtom have to know it separately. What is the use case of the fields in ELF?</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Nov 10, 2013 at 7:10 PM, Shankar Easwaran <span dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
It looks like each flavor chooses to save references in its own way.<br>
<br>
The GNU flavor (ELF) uses a single vector of references and uses referenceStartIndex/<u></u>referenceEndIndex to point to the references for each DefinedAtom.<br>
<br>
Darwin(Mach-O) / WinLink (PECOFF) uses a different way of storing references ?<br>
<br>
Is there a plan to make the WinLink/Darwin(Mach-O) use a single vector of references too at some point in time.<br>
<br>
There are merits/demerits of the approach that the Gnu flavor uses but it would be nice if we settle on one design for storing references.<br>
<br>
Thanks<span class="HOEnZb"><font color="#888888"><br>
<br>
Shankar Easwaran<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation<br>
<br>
</font></span></blockquote></div><br></div>