if you already have gdb on your system, you can easily disassemble the executable as follows:
[hemlo@zero example]$ gdb rodata
GNU gdb (GDB) 15.2
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from rodata...
(No debugging symbols found in rodata)
(gdb) starti
Program stopped.
0x00000000004000b0 in ?? ()
(gdb) x/8i $rip
=> 0x4000b0: mov $0x1,%eax
0x4000b5: mov $0x1,%edi
0x4000ba: mov $0x4010d1,%rsi
0x4000c1: mov $0x7,%edx
0x4000c6: syscall
0x4000c8: mov $0x3c,%eax
0x4000cd: xor %edi,%edi
0x4000cf: syscall
the above demo use two gdb command, starti and x, it basically put a breakpoint at the beginning of the instruction and examine the memory address from there (instruction pointer),
the assembly source code (rodata.asm):
format ELF64 executable
SYS_exit = 60
SYS_write = 1
STDOUT_FILENO = 1
_start:
mov eax, SYS_write
mov edi, STDOUT_FILENO
mov rsi, msg
mov edx, msg_len
syscall
mov eax, SYS_exit
xor edi, edi
syscall
segment readable
msg db "hellow", 0xa
msg_len = $-msg
.textsection), only program headers that tell the OS how to map it into memory. I don't know a good convenient way to disassemble it, other than treating it like a flat binary and disassembling everything (e.g.ndisasm -b32). Then finding the start of the actual instructions yourself.-D(capital D, disassemble all) option of objdump to see if that works better.-Dresults in same output: ` file format elf64-x86-64`-Dstill uses section headers (not segment), it just doesn't restrict to.text. So it still doesn't help for FASM-generated executables.