bug-mes
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] lib: Make objdump work on binaries in amd64


From: Ekaitz Zarraga
Subject: [PATCH] lib: Make objdump work on binaries in amd64
Date: Sat, 02 Sep 2023 22:18:16 +0000

>From e034430c17d6a4b3739c068aef8c8be1c0c682f1 Mon Sep 17 00:00:00 2001
From: Ekaitz Zarraga <ekaitz@elenq.tech>
Date: Sun, 3 Sep 2023 00:05:22 +0200
Subject: [PATCH] lib: Make objdump work on binaries in amd64

XXX: do the same for other architectures

* lib/linux/x86_64-mes/elf64-header.hex2: Fix header sizes until objdump
    stops complaining.
---
 lib/linux/x86_64-mes/elf64-header.hex2 | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/linux/x86_64-mes/elf64-header.hex2 
b/lib/linux/x86_64-mes/elf64-header.hex2
index 258e3da5..027fdf4c 100644
--- a/lib/linux/x86_64-mes/elf64-header.hex2
+++ b/lib/linux/x86_64-mes/elf64-header.hex2
@@ -39,7 +39,7 @@
 01                             # e_ident[EI_DATA] Indicating little endianness
 01                             # e_ident[EI_VERSION] Indicating original elf
 
-00                             # e_ident[EI_OSABI] Set at 0 because none cares
+03                             # e_ident[EI_OSABI] Set at 3 because FreeBSD is 
strict
 00                             # e_ident[EI_ABIVERSION] See above
 
 00 00 00 00 00 00 00           # e_ident[EI_PAD]
@@ -50,10 +50,9 @@
 01 00 00 00                    # e_version Indicating original elf
 
 # 0x18
-&ELF_text 00 00 00 00          # e_entry Address of the entry point
+&_start 00 00 00 00            # e_entry Address of the entry point
 %ELF_program_headers>ELF_base  # e_phoff Address of program header table
   00 00 00 00
-
 %ELF_section_headers>ELF_base  # e_shoff Address of section header table
   00 00 00 00
 
@@ -65,9 +64,9 @@
 01 00                          # e_phnum number of entries in program table
 
 40 00                          # e_shentsize size of a section header table
-07 00                          # e_shnum number of entries in section table
+05 00                          # e_shnum number of entries in section table
 
-04 00                          # e_shstrndx index of the section names
+02 00                          # e_shstrndx index of the section names
 
 # @40
 :ELF_program_headers
-- 
2.41.0





reply via email to

[Prev in Thread] Current Thread [Next in Thread]