<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 - LLD .map files: Request more info for "<internal>:(.rodata)""
   href="https://bugs.llvm.org/show_bug.cgi?id=35248">35248</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLD .map files: Request more info for "<internal>:(.rodata)"
          </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>Linux
          </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>huangs@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=19387" name="attach_19387" title="Sample .map outputs and script + sources to generate them.">attachment 19387</a> <a href="attachment.cgi?id=19387&action=edit" title="Sample .map outputs and script + sources to generate them.">[details]</a></span>
Sample .map outputs and script + sources to generate them.

LLD's generated .map file provides no semantic information on merged data in
.rodata section.  In particular, merged strings are not distinguished from
other data; everything is labelled as "<internal>:(.rodata)".

The missing information is useful for tools that parse .map file to annotate
executable bytes to source.  An example is Chrome's Supersize too (that I'm
working on):
<a href="https://github.com/webrtc-uwp/chromium-tools/blob/master/binary_size/README.md">https://github.com/webrtc-uwp/chromium-tools/blob/master/binary_size/README.md</a>

Comparison with other linkers:

LD .map files annotates  .rodata section names from the original .o files, 
.rodata.cst4   0x0000000000400ad0        0x4
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o
                0x0000000000400ad0                _IO_stdin_used
 *fill*         0x0000000000400ad4        0x4 
 .rodata.cst8   0x0000000000400ad8        0x8 a.o
 .rodata.str1.1
                0x0000000000400ae0       0x3e a.o
                                         0x44 (size before relaxing)


GOLD .map files provides less info, but identifies the type ("** merge
constants" vs. "** mege strings"), e.g.:
.rodata         0x0000000000400af0       0x60
 ** merge constants
                0x0000000000400af0        0x4
 ** merge constants
                0x0000000000400af8        0x8
 ** merge strings
                0x0000000000400b00       0x44


Meanwhile, LLD .map files only has "<internal>:(.rodata)", e.g.:
00000000002002e8 0000000000000060     8 .rodata
00000000002002e8 0000000000000004     4         <internal>:(.rodata)
00000000002002f0 0000000000000008     8         <internal>:(.rodata)
00000000002002f8 0000000000000044     1         <internal>:(.rodata)
0000000000200340 0000000000000008     8         b.o:(.rodata)
0000000000200340 0000000000000008     0                 b


The attached .zip file contains examples to generate the above ('genall'
generates the .map files, and need to be tweaked to get proper paths).</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>