[llvm-bugs] [Bug 30225] Gas uses a "Code alignment factor" of 4, MC uses 1

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 25 04:42:14 PST 2017


https://llvm.org/bugs/show_bug.cgi?id=30225

Diana Picus <diana.picus at linaro.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #1 from Diana Picus <diana.picus at linaro.org> ---
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170125/cca626f5/attachment.html>


More information about the llvm-bugs mailing list