<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Feb 27, 2014, at 5:52 PM, Shankar Easwaran <<a href="mailto:shankare@codeaurora.org">shankare@codeaurora.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
  
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 2/27/2014 6:34 PM, Michael Spencer
      wrote:<br>
    </div>
    <blockquote cite="mid:CACXTSikZ+6uhqNAQP0QqQMsVbF9jQsLZJQcR3JJTJORqu8rZJQ@mail.gmail.com" type="cite">
      <pre wrap="">On Thu, Feb 27, 2014 at 4:05 PM, Shankar Easwaran
<a class="moz-txt-link-rfc2396E" href="mailto:shankare@codeaurora.org"><shankare@codeaurora.org></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">On 2/27/2014 4:45 PM, Nick Kledzik wrote:

On Feb 27, 2014, at 2:31 PM, Michael Spencer <a class="moz-txt-link-rfc2396E" href="mailto:bigcheesegs@gmail.com"><bigcheesegs@gmail.com></a> wrote:

On Thu, Feb 27, 2014 at 2:14 PM, Rafael Espíndola
<a class="moz-txt-link-rfc2396E" href="mailto:rafael.espindola@gmail.com"><rafael.espindola@gmail.com></a> wrote:

It appears that the linker needs to deal with two namespaces, and think its
best to consider the group signature separately from the other atoms. We
could have an additional map in the Resolver that would just handle
resolution for groups ?

It is probably a good idea. The part of the linker deciding to load or
not a group only needs to checks those symbols. The rest of the linker
never needs to check those symbols. Cases like the simple inline c++
function would just happen to be in both tables.

Cheers,
Rafael

From what I understand, there is nothing special about signature
symbols. They are just a way to give a name to a group and participate
in linking as normal.

Are you saying that we have a separate table that represents groups in
addition to leaving all the symbols in the normal symbol table?

Yes, lets have a separate group table from the symbol table.

I think we need two special signature atom types

a) typeGroup
b) typeGroupComdat

These atoms would be inserted into a separate group table as part of symbol
resolution.

The signatureAtoms would list all the members, that the group will contain,
like how Nick mentioned earlier.

defined-atoms:
  - name:            g1
    scope:           global
    type:            typeGroup/typeGroupComdat

    references:
      - kind:            group-child
        target:          f1
      - kind:            group-
child
        target:          f2
      - kind:            group-child
        target:          d1
  - name:            f1
    scope:           global
    type:            typeCode
    references:
      - kind:            group-parent
        target:          g1
  - name:            f2
    scope:           global
    type:            typeCode
    references:
      - kind:            group-parent
        target:          g1
  - name:            d1
    scope:           global
    type:            typeData
    references:
      - kind:            group-parent
        target:          g1
  - name:            f3
    scope:           global
    type:            typeCode


Atoms within the signature group table will be iterated to make sure groups
contain the same group members by name. If they are not, depending on the
configuration, the new group will be ignored or an error would be thrown.

What do you think ?

Thanks

Shankar Easwaran
</pre>
      </blockquote>
      <pre wrap="">g1 is a normal symbol. There is nothing special about it to the
resolver (according to the spec). This does not correctly model that.
</pre>
    </blockquote>
    g1 would just identify the signature here, and it belongs in a
    separate table(group table) in lld's symboltable. <br></div></blockquote><div>Yes.  There would need to be another map<> in the symbol table just for groups, and the symbol table would</div><div>need to look at the atom’s contentType to see if it goes into the the new group map or the existing _nameTable.</div><div>When there is a collision in the group map, all atoms in one group (the new one?) need to be added to</div><div>the _replacementAtoms map to be removed.</div><div> </div><br><blockquote type="cite"><div text="#000000" bgcolor="#FFFFFF">
    <br>
    I would like the group also to be treated as an atom, as opposed to
    being explicit, considering everything in lld as Atoms.<br>
    <br>
    Nick ? <br>
    <br>
    This is with the example as below :-<br>
    <br>
    <div>ELF foo.o contains:</div>
    <div><br>
    </div>
    <div>   section 1: SHT_GROUP , name=“g1”, content=3,4</div>
    <div>   section 3: </div>
    <div>         symbol: name=“f1”, size=30</div>
    <div>         symbol: name=“f2”, size=16<br>
               symbol: name=“g1”, size=30<br>
    </div>
    <div>   section 4: </div>
    <div>         symbol: name=“d1”, size=4</div>
    <div>   section 5: </div>
    <div>         symbol: name=“f3”, size=30</div>
    <div> <br>
      For ELF, where g1 is part of section 3, g1 would also be an atom
      as below :-<br>
      <br>
      <div><font size="1" face="Monaco">defined-atoms:<br>
            - name:            g1<br>
              scope:           global<br>
              type:            typeGroupComdat<br>
              references:<br>
                - kind:            group-child<br>
                  target:          f1<br>
               </font><font size="1" face="Monaco"> - kind:           
          group-</font><span style="font-family: Monaco; font-size:
          x-small;">child</span><font size="1" face="Monaco"><br>
        </font>
        <div text="#000000" bgcolor="#FFFFFF">
          <div class="moz-cite-prefix"><font size="1" face="Monaco">   
                  target:          f2 <br>
                   </font><font size="1" face="Monaco"> -
              kind:            group-</font><span style="font-family:
              Monaco; font-size: x-small;">child</span><font size="1" face="Monaco"><br>
            </font>
            <div text="#000000" bgcolor="#FFFFFF">
              <div class="moz-cite-prefix"><font size="1" face="Monaco"> 
                        target:          g1<br>
                </font></div>
            </div>
          </div>
        </div>
      </div>
      <div>
        <div><font size="1" face="Monaco">      - kind:           
            group-</font><span style="font-family: Monaco; font-size:
            x-small;">child</span><font size="1" face="Monaco"><br>
          </font>
          <div text="#000000" bgcolor="#FFFFFF">
            <div class="moz-cite-prefix"><font size="1" face="Monaco"> 
                      target:          d1 <br>
              </font></div>
            <div><font size="1" face="Monaco">  - name:            f1<br>
                    scope:           global<br>
                    type:            typeCode<br>
              </font></div>
          </div>
        </div>
      </div>
      <div><font size="1" face="Monaco">    references:<br>
                - kind:            group-parent<br>
                  target:          g1<br>
        </font></div>
      <div>
        <div>
          <div text="#000000" bgcolor="#FFFFFF"><font size="1" face="Monaco">  - name:            f2<br>
                  scope:           global<br>
                  type:            typeCode<br>
            </font></div>
        </div>
        <div><font size="1" face="Monaco">    references:<br>
                  - kind:            group-</font><span style="font-family: Monaco; font-size: x-small;">parent</span><font size="1" face="Monaco"><br>
                    target:          g1</font><font size="1" face="Monaco"><br>
          </font>
          <div>
            <div>
              <div text="#000000" bgcolor="#FFFFFF"><font size="1" face="Monaco">  - name:            g1<br>
                      scope:           global<br>
                      type:            typeCode<br>
                </font></div>
            </div>
            <div><font size="1" face="Monaco">    references:<br>
                      - kind:            group-</font><span style="font-family: Monaco; font-size: x-small;">parent</span><font size="1" face="Monaco"><br>
                        target:          g1</font></div>
          </div>
        </div>
      </div>
      <div>
        <div>
          <div>
            <div text="#000000" bgcolor="#FFFFFF"><font size="1" face="Monaco">  - name:            d1<br>
                    scope:           global<br>
                    type:            typeData<br>
              </font></div>
          </div>
          <div><font size="1" face="Monaco">    references:<br>
                    - kind:            group-</font><span style="font-family: Monaco; font-size: x-small;">parent</span><font size="1" face="Monaco"><br>
                      target:          g1<br>
            </font></div>
        </div>
      </div>
      <div>
        <div>
          <div>
            <div text="#000000" bgcolor="#FFFFFF"><font size="1" face="Monaco">  - name:            f3<br>
                    scope:           global<br>
                    type:            typeCode</font></div>
          </div>
          <div><br>
            Do we want to marshall the name for the atom with type
            typeGroupComdat ?<br></div></div></div></div></div></blockquote><div>I don’t know what you mean here.</div><div><br></div><br><blockquote type="cite"><div text="#000000" bgcolor="#FFFFFF"><div><div><div><div>
          </div>
        </div>
      </div>
    </div>
    <br>
    Thanks<br>
    <br>
    Shankar Easwaran<br>
    <pre class="moz-signature" cols="72">-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation</pre>
  </div>

</blockquote></div><br></body></html>