<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:diana.picus@linaro.org" title="Diana Picus <diana.picus@linaro.org>"> <span class="fn">Diana Picus</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - Gas uses a "Code alignment factor" of 4, MC uses 1"
   href="https://llvm.org/bugs/show_bug.cgi?id=30225">bug 30225</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>WONTFIX
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - Gas uses a "Code alignment factor" of 4, MC uses 1"
   href="https://llvm.org/bugs/show_bug.cgi?id=30225#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - Gas uses a "Code alignment factor" of 4, MC uses 1"
   href="https://llvm.org/bugs/show_bug.cgi?id=30225">bug 30225</a>
              from <span class="vcard"><a class="email" href="mailto:diana.picus@linaro.org" title="Diana Picus <diana.picus@linaro.org>"> <span class="fn">Diana Picus</span></a>
</span></b>
        <pre>I'm not sure this is a bug. AFAICT the code alignment factor in the CIE is only
used to compute offsets for DW_CFA_advance_loc directives, and although the
code alignment factors used by llvm-mc and gas are different, the offsets are
computed correctly.

For instance, for a testcase that I've been playing with gas encodes the
directive
DW_CFA_advance_loc: 12 to 000000000000004c
as
0x43.

The lowest 6 bits mean a delta of 3; multiplied with the code alignment factor
of 4 we obtain an offset of 12.

MC encodes it as 0x4c, which means a delta of 12, multiplied with a code
alignment factor of 1 => again the offset is 12.

I've noticed the same thing with the data alignment factor, which is again
different between gas and MC, but directives such as DW_CFA_offset seem to be
encoded correctly.

So, unless there is something else using these factors that I'm not aware of,
this isn't really a bug. It may be a compatibility issue between gas and MC,
but since each function has its own CIE with its own code/data alignment
factors, debuggers shouldn't have any trouble dealing with this discrepancy.

Feel free to reopen if there are any scenarios where this difference causes
problems.</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>