unj2
unj2

Reputation: 53481

Why doesn't my objdump -D of program look different from .S

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?

Upvotes: 0

Views: 252

Answers (1)

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272447

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.

Upvotes: 2

Related Questions