<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 6/5/2013 6:52 PM, Rui Ueyama wrote:<br>
    </div>
    <blockquote
cite="mid:CAJENXgvdcfz19u0Ywy1g=K0gHtcm+tJXu3bNKGGTd-TDDMVHoA@mail.gmail.com"
      type="cite">
      <pre wrap="">Shankar,

I tried not to change the behavior of the existing code when I was doing
this. I splitt the function and felt like it became easier to read, but I
still don't fully understand the logic of createAtom. Can I ask a few
questions?

- Looks like we create both LayoutBefore and LayoutAfter references. Do we
really need to create both? If A-layout-before-B is equivalent to
B-layout-after-A it doesn't look necessary.
</pre>
    </blockquote>
    This is needed so that garbage collection wont remove the reference.
    If there is no atom thats referencing the current atom, that atom
    will be removed. So its needed for Atoms in a section to have both
    layout-after and layout-before.<br>
    <br>
    See the thread
    <a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121022/154084.html">http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121022/154084.html</a>
    for more details on it.<br>
    <blockquote
cite="mid:CAJENXgvdcfz19u0Ywy1g=K0gHtcm+tJXu3bNKGGTd-TDDMVHoA@mail.gmail.com"
      type="cite">
      <pre wrap="">
- The constraints and the reason that weak symbols need to satisfy about
Reference are not very clear. Why are we handling weak symbols in such a
way and how these References are handled in the later passes?</pre>
    </blockquote>
    Weak references are tricky, that they can be overridden, so what we
    do is when there is a weak reference that contains some data, we
    create a weak atom followed by an anonymous atom that holds the
    data(Because of the same property that you want to keep everything
    in the ELF section). If the weak atom gets overridden you can safely
    remove the weak atom, since there is nothing that refers to (no
    layout before). Also another thing thats used is for example:<br>
    <br>
    An atom "A" is followed by a Weak atom(W). We create the three atoms
    A, W, W' (the atom that holds the data) and make A to be followed by
    W' and a back reference of layout before from W' to A. There is a
    bug that if there are two weak atoms one after another though, that
    some of the references are not created properly(I am going to fix
    that later). <br>
    <br>
    There are multiple tests (weak*.test), testing these scenarios.<br>
    <br>
    As you would have noticed, these are very critical for the final ELF
    image to work, in all cases. <br>
    <br>
    <blockquote
cite="mid:CAJENXgvdcfz19u0Ywy1g=K0gHtcm+tJXu3bNKGGTd-TDDMVHoA@mail.gmail.com"
      type="cite">
      <pre wrap="">

On Wed, Jun 5, 2013 at 2:52 PM, Rui Ueyama <a class="moz-txt-link-rfc2396E" href="mailto:ruiu@google.com"><ruiu@google.com></a> wrote:

</pre>
      <blockquote type="cite">
        <pre wrap="">Hi shankarke,

 - Split createAtom() in lib/ReaderWriter/ELF/File.h into small methods.
 - Added comments to code in other methods.

No functionality changes.

<a class="moz-txt-link-freetext" href="http://llvm-reviews.chandlerc.com/D921">http://llvm-reviews.chandlerc.com/D921</a>

Files:
  lib/ReaderWriter/ELF/File.h
  test/elf/X86_64/weak-override.test

</pre>
      </blockquote>
      <pre wrap="">
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
llvm-commits mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation</pre>
  </body>
</html>