<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Should we sort common symbols by alignment?"
   href="https://bugs.llvm.org/show_bug.cgi?id=42088">42088</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Should we sort common symbols by alignment?
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>ELF
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ruiu@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, peter.smith@linaro.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I believe we used to sort common symbols by alignment for better packing, but
looks like the code is now gone. I don't know whether this is a good thing or a
bad thing. To make a decision whether we should sort common symbols or not, I
think we need to answer to the following questions:

 1. Do people still use common symbols? I think the common symbol is a hack to
workaround existing C source files (especially header files) that don't have
"extern" for global variable definitions. This is usually considered a bad
practice.

 2. Does sorting common symbols really makes a difference? If a space we can
save by sorting them is tiny, we shouldn't be bothered to do that.

 3. How does it affect memory locality? By sorting common symbols, common
symbols in the same file would be allocated to two distant places. Does this
affect the performance?

 4. If sorting common symbols makes difference, and that doesn't negatively
affect the performance, why don't we sort symbols in BSS as well? How about
other data sections?</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>