Skip to content

[ELF][llvm-objdump]Wrong comment when parse atexit() #135730

Open
@cabbaken

Description

@cabbaken

I have this simple code:

#include <stdlib.h>

void foo() 
{
  int a = 1, b = 2;
}

int main()
{
  atexit(foo);

  return 0;
}

And I compiled with

clang t.c

then the output of comment in <atexit> with llvm-objdump -D and objdump -D below are different:
llvm-objdump -D :

0000000000001170 <atexit>:
    1170: f3 0f 1e fa                   endbr64
    1174: 48 8b 15 8d 2e 00 00          movq    0x2e8d(%rip), %rdx      # 0x4008 <__dso_handle>
    117b: 31 f6                         xorl    %esi, %esi
    117d: ff 25 4d 2e 00 00             jmpq    *0x2e4d(%rip)           # 0x3fd0 <__libc_start_main@GLIBC_2.34+0x3fd0>

objdump -D :

0000000000001170 <atexit>:
    1170:       f3 0f 1e fa             endbr64
    1174:       48 8b 15 8d 2e 00 00    mov    0x2e8d(%rip),%rdx        # 4008 <__dso_handle>
    117b:       31 f6                   xor    %esi,%esi
    117d:       ff 25 4d 2e 00 00       jmp    *0x2e4d(%rip)        # 3fd0 <__cxa_atexit@GLIBC_2.2.5>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions