[PATCH] D144653: do not collect CFI info on empty functions

Sebastian Pop via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 24 06:19:08 PST 2023


sebpop added a comment.

I let delta reduce the yaml representation of the binary, however it did not go very far over night...
Maybe delta could work on smaller inputs (this current one is way too large: 4Gb.)

The assert is in BinaryFunction.h:

    void addCFIInstruction(uint64_t Offset, MCCFIInstruction &&Inst) {                                                                                                                                               
  =>  assert(!Instructions.empty()); 
  
  (gdb) p this->dump()
  Binary Function "lj_vm_ffi_call/1(*2)"  {
    All names   : lj_vm_ffi_call/1
                  lj_vm_ffi_call/buildvm_arm64.dasc/1
    Number      : 17598
    State       : disassembled
    Address     : 0x18c9890
    Size        : 0x80
    MaxSize     : 0x80
    Offset      : 0x18b9890
    Section     : .text
    Orc Section : .local.text.lj_vm_ffi_call/1
    LSDA        : 0x0
    IsSimple    : 1
    IsMultiEntry: 0
    IsSplit     : 0
    BB Count    : 0
  }
  DWARF CFI Instructions:
      <empty>
  End of Function "lj_vm_ffi_call/1(*2)"

It seems to me like llvm-objdump is not able to decode the instructions in that function:

  $ llvm-objdump -d envoy
  
  00000000018c9890 <lj_vm_ffi_call>:
   18c9890: fd 7b be a9   .word   0xa9be7bfd
   18c9894: fd 03 00 91   .word   0x910003fd
   18c9898: f3 0b 00 f9   .word   0xf9000bf3
   18c989c: f3 03 00 aa   .word   0xaa0003f3
   18c98a0: 08 08 40 b9   .word   0xb9400808
   18c98a4: 69 32 40 39   .word   0x39403269
   18c98a8: 6a 62 02 91   .word   0x9102626a
   18c98ac: 29 05 00 f1   .word   0xf1000529
   18c98b0: 6b 02 40 f9   .word   0xf940026b
   18c98b4: bf 63 28 cb   .word   0xcb2863bf
   18c98b8: a4 00 00 54   .word   0x540000a4
   18c98bc: 48 79 69 f8   .word   0xf8697948
   18c98c0: e8 7b 29 f8   .word   0xf8297be8
   18c98c4: 29 05 00 f1   .word   0xf1000529
   18c98c8: a5 ff ff 54   .word   0x54ffffa5
   18c98cc: 60 86 45 a9   .word   0xa9458660
   18c98d0: 60 86 41 6d   .word   0x6d418660
   18c98d4: 62 8e 46 a9   .word   0xa9468e62
   18c98d8: 62 8e 42 6d   .word   0x6d428e62
   18c98dc: 64 96 47 a9   .word   0xa9479664
   18c98e0: 64 96 43 6d   .word   0x6d439664
   18c98e4: 66 9e 48 a9   .word   0xa9489e66
   18c98e8: 66 9e 44 6d   .word   0x6d449e66
   18c98ec: 68 0a 40 f9   .word   0xf9400a68
   18c98f0: 60 01 3f d6   .word   0xd63f0160
   18c98f4: bf 03 00 91   .word   0x910003bf
   18c98f8: 60 86 05 a9   .word   0xa9058660
   18c98fc: 60 86 01 6d   .word   0x6d018660
   18c9900: 62 8e 02 6d   .word   0x6d028e62
   18c9904: f3 0b 40 f9   .word   0xf9400bf3
   18c9908: fd 7b c2 a8   .word   0xa8c27bfd
   18c990c: c0 03 5f d6   .word   0xd65f03c0

Same function disassembled by the GNU objdump:

  $ objdump -d envoy
  
  00000000018c9890 <lj_vm_ffi_call>:
   18c9890:       a9be7bfd        stp     x29, x30, [sp, #-32]!
   18c9894:       910003fd        mov     x29, sp
   18c9898:       f9000bf3        str     x19, [sp, #16]
   18c989c:       aa0003f3        mov     x19, x0
   18c98a0:       b9400808        ldr     w8, [x0, #8]
   18c98a4:       39403269        ldrb    w9, [x19, #12]
   18c98a8:       9102626a        add     x10, x19, #0x98
   18c98ac:       f1000529        subs    x9, x9, #0x1
   18c98b0:       f940026b        ldr     x11, [x19]
   18c98b4:       cb2863bf        sub     sp, x29, x8
   18c98b8:       540000a4        b.mi    18c98cc <lj_vm_ffi_call+0x3c>  // b.first
   18c98bc:       f8697948        ldr     x8, [x10, x9, lsl #3]
   18c98c0:       f8297be8        str     x8, [sp, x9, lsl #3]
   18c98c4:       f1000529        subs    x9, x9, #0x1
   18c98c8:       54ffffa5        b.pl    18c98bc <lj_vm_ffi_call+0x2c>  // b.nfrst
   18c98cc:       a9458660        ldp     x0, x1, [x19, #88]
   18c98d0:       6d418660        ldp     d0, d1, [x19, #24]
   18c98d4:       a9468e62        ldp     x2, x3, [x19, #104]
   18c98d8:       6d428e62        ldp     d2, d3, [x19, #40]
   18c98dc:       a9479664        ldp     x4, x5, [x19, #120]
   18c98e0:       6d439664        ldp     d4, d5, [x19, #56]
   18c98e4:       a9489e66        ldp     x6, x7, [x19, #136]
   18c98e8:       6d449e66        ldp     d6, d7, [x19, #72]
   18c98ec:       f9400a68        ldr     x8, [x19, #16]
   18c98f0:       d63f0160        blr     x11
   18c98f4:       910003bf        mov     sp, x29
   18c98f8:       a9058660        stp     x0, x1, [x19, #88]
   18c98fc:       6d018660        stp     d0, d1, [x19, #24]
   18c9900:       6d028e62        stp     d2, d3, [x19, #40]
   18c9904:       f9400bf3        ldr     x19, [sp, #16]
   18c9908:       a8c27bfd        ldp     x29, x30, [sp], #32
   18c990c:       d65f03c0        ret


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144653/new/

https://reviews.llvm.org/D144653



More information about the llvm-commits mailing list