In my FASM project (Object), I'm trying to create a jump-table and I use dq
for each jump address but there is a problem!
For each dq .jmp1
(jump address definition), 24 bytes more (plus 8 bytes for .jmp1
address (totalling 32 bytes)) will be added to my final .o file's total size!
What is that extra 24 bytes? Is there any way to avoid it? This happens only in object file, not in executable!
Instead of 8 bytes for each jump address, it defines 32 bytes! What is the problem?
format ELF64
section '.text'
func:
lea rax, [8*rax+.jmp_table]
.jmp1:
.jmp_table:
dq .jmp1 ; 8 bytes + 24 bytes !!! (to .o total size)
dq .jmp1 ; 8 bytes + 24 bytes !!! (to .o total size)
But when I create an executable, each dq
takes only 8 bytes (what I expect) ...
format ELF64 EXECUTABLE
segment readable executable
func:
lea rax, [8*rax+.jmp_table]
.jmp1:
.jmp_table:
dq .jmp1 ; 8-BYTE, no extra 24 bytes to .o total size
dq .jmp1 ; 8-BYTE, no extra 24 bytes to .o total size