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