Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[llvm-objdump] llvm-objdump cannot disassemble __stack_chk_* symbol #85377

Open
CoTinker opened this issue Mar 15, 2024 · 1 comment
Open

[llvm-objdump] llvm-objdump cannot disassemble __stack_chk_* symbol #85377

CoTinker opened this issue Mar 15, 2024 · 1 comment

Comments

@CoTinker
Copy link
Contributor

CoTinker commented Mar 15, 2024

demo.c

#include <string.h>

void func() {
	char c = 'b';
	char str1[1];
	memset(str1, c, 1);
}

https://godbolt.org/z/TxKnEYdbP

compile command

% clang demo.c -c -o demo.o -fstack-protector-strong
% objdump -d demo.o | grep __stack_chk*
   c:   90000008        adrp    x8, 0 <__stack_chk_guard>
  30:   90000008        adrp    x8, 0 <__stack_chk_guard>
  48:   94000000        bl      0 <__stack_chk_fail>
-------------------------------------------------------
% llvm-objdump -d demo.o | grep __stack_chk*
NULL

we can see that binutils objdump can get __stack_chk* symbol, while llvm-objdump can not.
image

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 15, 2024

@llvm/issue-subscribers-tools-llvm-objdump

Author: Longsheng Mou (CoTinker)

demo.c ``` #include <string.h>

void func() {
char c = 'b';
char str1[1];
memset(str1, c, 1);
}

https://godbolt.org/z/TxKnEYdbP

compile command

% clang demo.c -c -o demo.o -fstack-protector-strong
% objdump -d demo.o | grep __stack_chk*
c: 90000008 adrp x8, 0 <__stack_chk_guard>
30: 90000008 adrp x8, 0 <__stack_chk_guard>
48: 94000000 bl 0 <__stack_chk_fail>

% llvm-objdump -d demo.o | grep __stack_chk*
NULL

we can see that binutils `objdump `can get __stack_chk* symbol, while `llvm-objdump` can not.
![image](https://github.com/llvm/llvm-project/assets/84192071/80751e02-aa6c-42c5-876c-3a1ad2cc0e1b)

</details>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants