<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/mac's LC_FUNCTION_STARTS section is all wrong"
   href="https://bugs.llvm.org/show_bug.cgi?id=50576">50576</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lld/mac's LC_FUNCTION_STARTS section is all wrong
          </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>MachO
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>nicolasweber@gmx.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>gkm@fb.com, jezreel@gmail.com, llvm-bugs@lists.llvm.org, smeenai@fb.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>1. Download repro zip from <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - ld64.lld.darwinnew-linked Chromium Framework is somewhat crashy"
   href="show_bug.cgi?id=48657#c0">https://bugs.llvm.org/show_bug.cgi?id=48657#c0</a>

2. Link

3. `xcrun dyldinfo -function_starts Chromium.app/Contents/Frameworks/Chromium\
Framework.framework/Versions/Current/Chromium\ Framework | head -1`

Works fine when linking with ld64, prints garbage with lld. ld64:

% xcrun dyldinfo -function_starts Chromium.app/Contents/Frameworks/Chromium\
Framework.framework/Versions/Current/Chromium\ Framework | head -10
0x3B00   _ChromeAppModeStart_v6
0x4880   _ChromeMain
0x49E0   __ZN25ChromeCrashReporterClient6CreateEv
0x4B80   __ZN25ChromeCrashReporterClientD1Ev
0x4B90   __ZN25ChromeCrashReporterClientD0Ev
0x4BB0  
__ZN25ChromeCrashReporterClient20GetCrashDumpLocationEPN4base8FilePathE
0x4BC0  
__ZN25ChromeCrashReporterClient23GetCrashMetricsLocationEPN4base8FilePathE
0x4BD0   __ZN25ChromeCrashReporterClient19IsRunningUnattendedEv
0x4C40   __ZN25ChromeCrashReporterClient22GetCollectStatsConsentEv
0x4CD0  
__ZN25ChromeCrashReporterClient24EnableBreakpadForProcessERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE

lld:

0x10B2460   __ZN14crash_reporter19CrashReporterClient12GetUploadUrlEv
0x10B2458   ?
0x10B2450  
__ZN14crash_reporter19CrashReporterClient27ReportingIsEnforcedByPolicyEPb
0x10B2460   __ZN14crash_reporter19CrashReporterClient12GetUploadUrlEv
0x10B2458   ?
0x10B2450  
__ZN14crash_reporter19CrashReporterClient27ReportingIsEnforcedByPolicyEPb
0x10B2510   ?
0x4239830   ?
0x423E8E0   ?
0x4274C90   ?



Also, the section is over 1 MB smaller with ld64:

% otool -l Chromium.app/Contents/Frameworks/Chromium\
Framework.framework/Versions/Current/Chromium\ Framework | grep -A3 LC_FUN
      cmd LC_FUNCTION_STARTS
  cmdsize 16
  dataoff 171232496
 datasize 838208

vs with lld:

% otool -l Chromium.app/Contents/Frameworks/Chromium\
Framework.framework/Versions/Current/Chromium\ Framework | grep -A3 LC_FUN
      cmd LC_FUNCTION_STARTS
  cmdsize 16
  dataoff 183842744
 datasize 2003880</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>