[llvm-commits] new patches for compiling linux with integrated-as

Roman Divacky rdivacky at freebsd.org
Thu Nov 8 06:05:14 PST 2012


> - more .cfi* support: linux makes use of 3 CFI directives not yet (fully) supported
>   by llvm.
> 
>   .cfi_startproc simple: i added the 'simple' keyword recognition but a review is needed.
> 
>   .cfi_undefined: new directive, it's only recognized, someone else will have to provide
>   a proper implementation in MCStreamer::EmitCFIUndefined.
> 
>   .cfi_register: new directive, i think MCStreamer::EmitCFIRegister does what it
>   should do, but review (and help with fixing it up :) is needed.

I finished this I think, the patch attached. This is the output I am getting:

test case:

.cfi_startproc

.cfi_register %rdi, %rax
nop
.cfi_undefined %rdx

.cfi_endproc

gnu as:

  # Section 4
  (('sh_name', 0x00000031) # '.eh_frame'
   ('sh_type', 0x00000001)
   ('sh_flags', 0x0000000000000002)
   ('sh_addr', 0x0000000000000000)
   ('sh_offset', 0x0000000000000048)
   ('sh_size', 0x0000000000000030)
   ('sh_link', 0x00000000)
   ('sh_info', 0x00000000)
   ('sh_addralign', 0x0000000000000008)
   ('sh_entsize', 0x0000000000000000)
   ('_section_data', '18000000 00000000 017a5200 01781001 1b0c0708 90010905 00000000 10000000 20000000 00000000 01000000 00410701')
  ),


llvm as:

  # Section 4
  (('sh_name', 0x00000011) # '.eh_frame'
   ('sh_type', 0x00000001)
   ('sh_flags', 0x0000000000000002)
   ('sh_addr', 0x0000000000000000)
   ('sh_offset', 0x0000000000000048)
   ('sh_size', 0x0000000000000030)
   ('sh_link', 0x00000000)
   ('sh_info', 0x00000000)
   ('sh_addralign', 0x0000000000000008)
   ('sh_entsize', 0x0000000000000000)
   ('_section_data', '14000000 00000000 017a5200 01781001 1b0c0708 90010000 14000000 1c000000 00000000 01000000 00800141 07010000')

The output for cfi_undefined is the same (0701), the cfi_register differs, but it's implemented
using already existing code.

What do you think?

Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm.mc.cfi.patch
Type: text/x-diff
Size: 8725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121108/afda0016/attachment.patch>


More information about the llvm-commits mailing list