You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to disassembly rust generated ELF binaries, GNU Development Tools (objdump) do not disassemble .rodata section correctly, although hexeditor can see the bytes correctly.
Issue can be reproduced by basic hello world example:
cargo new hello
cd hello
cargo build
objdump -d -j .rodata target/debug/hello | less
I believe this is a case of objdump using various heuristics to determine whether data is code or not when using the --disassemble flag. The existence of a symbol nearby (for panic messages) might also affect heuristics.
You likely want one of the other flags that just shows the data in the section rather than attempts to parse it as assembly code.
rustbot
added
C-discussion
Category: Discussion or questions that doesn't represent real issues.
and removed
C-bug
Category: This is a bug.
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Jun 4, 2025
When I try to disassembly rust generated ELF binaries, GNU Development Tools (
objdump
) do not disassemble .rodata section correctly, although hexeditor can see the bytes correctly.Issue can be reproduced by basic hello world example:
I expected to see something similar to this:
This is disassembly of basic C hello world program (
)
Instead,
.rodata
section is interpreted as asm instructions, runningobjdump -d -j .rodata target/debug/hello| less
produces
Hello world string is obviously present at 0x87e0, bytes seem to be correct, so why
objdump
produces those instructions?Meta
rustc --version --verbose
:Issue was also produced on this machine
Is this a problem with rust or just with GNU Development Tools?
The text was updated successfully, but these errors were encountered: