문제

I am learning the toolchains for my C++ and trying out the objdump.

The disassembled file from objdump doesn't even have the word "Hello World". Why is that? Is it not reliable at all?

도움이 되었습니까?

해결책

The following code:

#include <stdio.h>
int main(void) { printf("Hello world\n"); }

can be completely disassembled with objdump -Dslx my_prog, which reveals, amongst other things, the following:

Contents of section .rodata:
 400598 01000200 00000000 00000000 00000000  ................
 4005a8 48656c6c 6f20776f 726c6400           Hello world.

If yours is different, then please post code, etc.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top