0

I have the following file:

test.s

.section a_random_section

label_number1:
    jmp label_number1

and after executing as -o test.o test.s && objdump -d test.o I'm getting the following output:


test.o:     file format elf64-x86-64

but I'd expect to get something like this:


test.o:     file format elf64-x86-64


Disassembly of section a_random_section:

0000000000000000 <label_number1>:
   0:   eb fe                   jmp    0 <label_number1>

what am I doing wrong?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
TornaxO7
  • 1,150
  • 9
  • 24
  • 1
    The section is still there in the binary but `-d` only disassembles executable sections. You created a custom section with default attributes which does not make it executable. Either make it executable or use `-D` (capital) to disassemble all sections. – Jester Nov 02 '22 at 14:44
  • Oh god... what a mistake from me.... thank you for your answer! Could you (@Jester) please write your comment as an answer, so I can mark this question as answered? Thanks! – TornaxO7 Nov 02 '22 at 14:46

0 Answers0