From 3bde7443c944378c3988542fa518583c2f6538cc Mon Sep 17 00:00:00 2001 From: Travis Geiselbrecht Date: Mon, 15 Mar 2004 23:04:32 +0000 Subject: [PATCH] more x86_64 work: Added structure definitions for elf64 made bootmaker elf64 aware some syscall glue stuff add function type to the trap macros git-svn-id: svn+ssh://newos.org/var/svn/newos/newos@1093 c25cc9d1-44fa-0310-b259-ad778cb1d433 --- boot/x86_64/config.ini | 138 ++++----- include/boot/bootdir.h | 7 +- include/newos/{elf32.h => elf.h} | 204 ++++++------ include/newos/elf32.h | 446 ++++++--------------------- include/newos/elf64.h | 95 ++++++ kernel/arch/x86_64/arch_interrupts.S | 2 + lib/libnewos/system/arch/x86_64/syscalls.inc | 64 ++-- tools/bootmaker.c | 107 ++++++- 8 files changed, 488 insertions(+), 575 deletions(-) copy include/newos/{elf32.h => elf.h} (77%) rewrite include/newos/elf32.h (78%) create mode 100644 include/newos/elf64.h diff --git a/boot/x86_64/config.ini b/boot/x86_64/config.ini index a09434c..588ecb4 100644 --- a/boot/x86_64/config.ini +++ b/boot/x86_64/config.ini @@ -5,11 +5,11 @@ # really start happening. This MUST be the first entry in the .ini # [bootstrap] -type=elf32 +type=elf64 file=build/x86_64/boot/stage2 [kernel] -type=elf32 +type=elf64 file=build/x86_64/kernel/kernel [bootscript] @@ -21,172 +21,172 @@ type=text file=scripts/loginscript [addons/fs/fat] -type=elf32 +type=elf64 file=build/x86_64/kernel/addons/fs/fat/fat [addons/fs/iso9660] -type=elf32 +type=elf64 file=build/x86_64/kernel/addons/fs/iso9660/iso9660 [addons/fs/nfs] -type=elf32 +type=elf64 file=build/x86_64/kernel/addons/fs/nfs/nfs [addons/fs/zfs] -type=elf32 +type=elf64 file=build/x86_64/kernel/addons/fs/zfs/zfs #[addons/modules/bus_managers/pci] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/modules/bus_managers/pci/pci #[addons/modules/bus_managers/isa] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/modules/bus_managers/isa/isa #[addons/modules/busses/ide/ide_isa] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/modules/busses/ide/ide_isa/ide_isa #[addons/modules/bus_managers/ide] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/modules/bus_managers/ide/ide #[addons/modules/bus_managers/scsi] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/modules/bus_managers/scsi/scsi #[addons/modules/generic/locked_pool] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/modules/generic/locked_pool/locked_pool #[addons/modules/bus_managers/usb] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/modules/bus_managers/usb/usb #[addons/modules/busses/usb/ohci] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/modules/busses/usb/ohci/ohci #[addons/modules/console/vmware] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/modules/console/vmware/vmware #[addons/modules/generic/blkman] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/modules/generic/blkman/blkman #[addons/modules/generic/scsi_periph] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/modules/generic/scsi_periph/scsi_periph #[addons/modules/console/text] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/modules/console/text/text #[addons/dev/disk/scsi/scsi_dsk] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/dev/disk/scsi/scsi_dsk/scsi_dsk #[addons/dev/netblock] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/dev/disk/netblock/netblock #[addons/dev/console] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/dev/console/console #[addons/dev/tty] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/dev/tty/tty #[addons/dev/pcnet32] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/dev/net/pcnet32/pcnet32 #[addons/dev/rtl8139] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/dev/net/rtl8139/rtl8139 #[addons/dev/keyboard] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/dev/arch/x86_64/keyboard/keyboard #[addons/dev/ps2mouse] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/dev/arch/x86_64/ps2mouse/ps2mouse #[addons/dev/vesa] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/dev/arch/x86_64/vesa/vesa # Disable the floppy for now #[addons/dev/floppy] -#type=elf32 +#type=elf64 #file=build/x86_64/kernel/addons/dev/arch/x86_64/floppy/floppy [bin/init] -type=elf32 +type=elf64 file=build/x86_64/apps/init/init [bin/cpptest] -type=elf32 +type=elf64 file=build/x86_64/apps/cpptest/cpptest [bin/window_server] -type=elf32 +type=elf64 file=build/x86_64/apps/window_server/window_server [bin/guiapp] -type=elf32 +type=elf64 file=build/x86_64/apps/guiapp/guiapp [bin/consoled] -type=elf32 +type=elf64 file=build/x86_64/apps/consoled/consoled [bin/inputd] -type=elf32 +type=elf64 file=build/x86_64/apps/inputd/inputd [bin/socketd] -type=elf32 +type=elf64 file=build/x86_64/apps/socketd/socketd [bin/telnetd] -type=elf32 +type=elf64 file=build/x86_64/apps/telnetd/telnetd [bin/shell] -type=elf32 +type=elf64 file=build/x86_64/apps/shell/shell [bin/ls] -type=elf32 +type=elf64 file=build/x86_64/apps/ls/ls [bin/mount] -type=elf32 +type=elf64 file=build/x86_64/apps/mount/mount [bin/unmount] -type=elf32 +type=elf64 file=build/x86_64/apps/unmount/unmount [bin/test_input] -type=elf32 +type=elf64 file=build/x86_64/apps/test_input/test_input [bin/test_output] -type=elf32 +type=elf64 file=build/x86_64/apps/test_output/test_output [bin/test_time] -type=elf32 +type=elf64 file=build/x86_64/apps/test_time/test_time [bin/fortune] -type=elf32 +type=elf64 file=build/x86_64/apps/fortune/fortune [etc/fortunes] @@ -198,103 +198,103 @@ type=data file=apps/test_input/test_input.txt [bin/rm] -type=elf32 +type=elf64 file=build/x86_64/apps/rm/rm [bin/ps] -type=elf32 +type=elf64 file=build/x86_64/apps/ps/ps [bin/kill] -type=elf32 +type=elf64 file=build/x86_64/apps/kill/kill [bin/top] -type=elf32 +type=elf64 file=build/x86_64/apps/top/top [bin/netcfg] -type=elf32 +type=elf64 file=build/x86_64/apps/netcfg/netcfg [bin/nettest] -type=elf32 +type=elf64 file=build/x86_64/apps/nettest/nettest [bin/irc] -type=elf32 +type=elf64 file=build/x86_64/apps/irc/irc [bin/testapp] -type=elf32 +type=elf64 file=build/x86_64/apps/testapp/testapp [bin/true] -type=elf32 +type=elf64 file=build/x86_64/apps/true/true [bin/false] -type=elf32 +type=elf64 file=build/x86_64/apps/false/false [bin/vmtest] -type=elf32 +type=elf64 file=build/x86_64/apps/vmtest/vmtest [bin/vmstat] -type=elf32 +type=elf64 file=build/x86_64/apps/vmstat/vmstat [bin/vtcolors] -type=elf32 +type=elf64 file=build/x86_64/apps/vtcolors/vtcolors [bin/fibo] -type=elf32 +type=elf64 file=build/x86_64/apps/fibo/fibo [bin/disktest] -type=elf32 +type=elf64 file=build/x86_64/apps/disktest/disktest [libexec/rld.so] -type=elf32 +type=elf64 file=build/x86_64/apps/rld/rld.so [bin/rldtest] -type=elf32 +type=elf64 file=build/x86_64/apps/rldtest/rldtest [lib/librldtest.so] -type=elf32 +type=elf64 file=build/x86_64/apps/rldtest/librldtest.so [lib/girlfriend.so] -type=elf32 +type=elf64 file=build/x86_64/apps/rldtest/girlfriend.so [lib/libc.so] -type=elf32 +type=elf64 file=build/x86_64/lib/libc.so [lib/libm.so] -type=elf32 +type=elf64 file=build/x86_64/lib/libm.so [lib/libnewos.so] -type=elf32 +type=elf64 file=build/x86_64/lib/libnewos.so [lib/libsocket.so] -type=elf32 +type=elf64 file=build/x86_64/lib/libsocket.so [lib/libsupc++.so] -type=elf32 +type=elf64 file=build/x86_64/lib/libsupc++.so [lib/libwin.so] -type=elf32 +type=elf64 file=build/x86_64/lib/libwin.so [testfile] diff --git a/include/boot/bootdir.h b/include/boot/bootdir.h index fb6c5cb..baa8fba 100644 --- a/include/boot/bootdir.h +++ b/include/boot/bootdir.h @@ -1,4 +1,8 @@ -/* $Id$ +/* +** Portions Copyright 2001-2004, Travis Geiselbrecht. All rights reserved. +** Distributed under the terms of the NewOS License. +*/ +/* ** ** Copyright 1998 Brian J. Swetland ** All rights reserved. @@ -57,6 +61,7 @@ typedef struct { #define BE_TYPE_CODE 3 /* executable code object */ #define BE_TYPE_DATA 4 /* raw data object */ #define BE_TYPE_ELF32 5 /* 32bit ELF object */ +#define BE_TYPE_ELF64 6 /* 64bit ELF object */ /* for BE_TYPE_CODE */ #define be_code_vaddr be_extra0 /* virtual address (rel offset 0) */ diff --git a/include/newos/elf32.h b/include/newos/elf.h similarity index 77% copy from include/newos/elf32.h copy to include/newos/elf.h index 6dba8c7..5ad6b9c 100644 --- a/include/newos/elf32.h +++ b/include/newos/elf.h @@ -1,18 +1,12 @@ /* -** Copyright 2001, Travis Geiselbrecht. All rights reserved. +** Copyright 2001-2004, Travis Geiselbrecht. All rights reserved. ** Distributed under the terms of the NewOS License. */ -#ifndef _ELF32_H -#define _ELF32_H +#ifndef _ELF_H +#define _ELF_H #include -typedef uint32 Elf32_Addr; -typedef uint16 Elf32_Half; -typedef uint32 Elf32_Off; -typedef int32 Elf32_Sword; -typedef uint32 Elf32_Word; - #define ELF_MAGIC "\x7f""ELF" #define EI_MAG0 0 #define EI_MAG1 1 @@ -21,7 +15,8 @@ typedef uint32 Elf32_Word; #define EI_CLASS 4 #define EI_DATA 5 #define EI_VERSION 6 -#define EI_PAD 7 +#define EI_OSABI 7 +#define EI_ABIVERSION 8 #define EI_NIDENT 16 #define EM_SPARC 2 @@ -34,6 +29,9 @@ typedef uint32 Elf32_Word; #define EM_ARM 40 #define EM_SH 42 #define EM_SPARCV9 43 +#define EM_IA_64 50 +#define EM_X86_64 62 +#define EM_ALPHA 0x9026 #define ELFCLASS32 1 #define ELFCLASS64 2 @@ -41,35 +39,10 @@ typedef uint32 Elf32_Word; #define ELFDATA2MSB 2 #define EV_CURRENT 1 -struct Elf32_Ehdr { - unsigned char e_ident[EI_NIDENT]; - Elf32_Half e_type; - Elf32_Half e_machine; - Elf32_Word e_version; - Elf32_Addr e_entry; - Elf32_Off e_phoff; - Elf32_Off e_shoff; - Elf32_Word e_flags; - Elf32_Half e_ehsize; - Elf32_Half e_phentsize; - Elf32_Half e_phnum; - Elf32_Half e_shentsize; - Elf32_Half e_shnum; - Elf32_Half e_shstrndx; -} ; - -struct Elf32_Shdr { - Elf32_Word sh_name; - Elf32_Word sh_type; - Elf32_Word sh_flags; - Elf32_Addr sh_addr; - Elf32_Off sh_offset; - Elf32_Word sh_size; - Elf32_Word sh_link; - Elf32_Word sh_info; - Elf32_Word sh_addralign; - Elf32_Word sh_entsize; -} ; +#define ET_REL 1 +#define ET_EXEC 2 +#define ET_DYN 3 +#define ET_CORE 4 #define SHT_NULL 0 #define SHT_PROGBITS 1 @@ -83,30 +56,24 @@ struct Elf32_Shdr { #define SHT_REL 9 #define SHT_SHLIB 10 #define SHT_DYNSYM 11 +#define SHT_LOOS 0x60000000 +#define SHT_HIOS 0x6fffffff #define SHT_LOPROC 0x70000000 #define SHT_HIPROC 0x7fffffff #define SHT_LOUSER 0x80000000 #define SHT_HIUSER 0xffffffff -#define SHF_WRITE 1 - -struct Elf32_Phdr { - Elf32_Word p_type; - Elf32_Off p_offset; - Elf32_Addr p_vaddr; - Elf32_Addr p_paddr; - Elf32_Word p_filesz; - Elf32_Word p_memsz; - Elf32_Word p_flags; - Elf32_Word p_align; -} ; +#define SHF_WRITE 0x1 +#define SHF_ALLOC 0x2 +#define SHF_EXECINSTR 0x4 +#define SHF_TLS 0x400 +#define SHF_MASKPROC 0xf0000000 #define PF_X 0x1 #define PF_W 0x2 #define PF_R 0x4 #define PF_MASKPROC 0xf0000000 - #define PT_NULL 0 #define PT_LOAD 1 #define PT_DYNAMIC 2 @@ -114,6 +81,9 @@ struct Elf32_Phdr { #define PT_NOTE 4 #define PT_SHLIB 5 #define PT_PHDR 6 +#define PT_TLS 7 +#define PT_LOOS 0x60000000 +#define PT_HIOS 0x6fffffff #define PT_LOPROC 0x70000000 #define PT_HIPROC 0x7fffffff @@ -125,24 +95,12 @@ struct Elf32_Phdr { #define SHN_COMMON 0xfff2 #define SHN_HIRESERVE 0xffff -struct Elf32_Sym { - Elf32_Word st_name; - Elf32_Addr st_value; - Elf32_Word st_size; - unsigned char st_info; - unsigned char st_other; - Elf32_Half st_shndx; -}; - -#define ELF32_ST_BIND(i) ((i) >> 4) -#define ELF32_ST_TYPE(i) ((i) & 0xf) -#define ELF32_ST_INFO(b, t) (((b) << 4) + ((t) & 0xf)) - #define STT_NOTYPE 0 #define STT_OBJECT 1 #define STT_FUNC 2 #define STT_SECTION 3 #define STT_FILE 4 +#define STT_TLS 6 #define STT_LOPROC 13 #define STT_HIPROC 15 @@ -154,20 +112,44 @@ struct Elf32_Sym { #define STN_UNDEF 0 -struct Elf32_Rel { - Elf32_Addr r_offset; - Elf32_Word r_info; -}; - -struct Elf32_Rela { - Elf32_Addr r_offset; - Elf32_Word r_info; - Elf32_Sword r_addend; -}; - -#define ELF32_R_SYM(i) ((i) >> 8) -#define ELF32_R_TYPE(i) ((unsigned char)(i)) -#define ELF32_R_INFO(s, t) (((s) << 8) + (unsigned char)(t)) +#define DT_NULL 0 +#define DT_NEEDED 1 +#define DT_PLTRELSZ 2 +#define DT_PLTGOT 3 +#define DT_HASH 4 +#define DT_STRTAB 5 +#define DT_SYMTAB 6 +#define DT_RELA 7 +#define DT_RELASZ 8 +#define DT_RELAENT 9 +#define DT_STRSZ 10 +#define DT_SYMENT 11 +#define DT_INIT 12 +#define DT_FINI 13 +#define DT_SONAME 14 +#define DT_RPATH 15 +#define DT_SYMBOLIC 16 +#define DT_REL 17 +#define DT_RELSZ 18 +#define DT_RELENT 19 +#define DT_PLTREL 20 +#define DT_DEBUG 21 +#define DT_TEXTREL 22 +#define DT_JMPREL 23 +#define DT_BIND_NOW 24 +#define DT_INIT_ARRAY 25 +#define DT_FINI_ARRAY 26 +#define DT_INIT_ARRAYSZ 27 +#define DT_FINI_ARRAYSZ 28 +#define DT_RUNPATH 29 +#define DT_FLAGS 30 +#define DT_ENCODING 32 +#define DT_PREINIT_ARRAY 32 +#define DT_PREINIT_ARRAYSZ 33 +#define DT_LOOS 0x6000000d +#define DT_HIOS 0x6fff0000 +#define DT_LOPROC 0x70000000 +#define DT_HIPROC 0x7fffffff /* * i386 relocation types @@ -185,6 +167,34 @@ struct Elf32_Rela { #define R_386_GOTPC 10 /* + * x86-64 relocation types + */ +#define R_X86_64_NONE 0 +#define R_X86_64_64 1 +#define R_X86_64_PC32 2 +#define R_X86_64_GOT32 3 +#define R_X86_64_PLT32 4 +#define R_X86_64_COPY 5 +#define R_X86_64_GLOB_DAT 6 +#define R_X86_64_JUMP_SLOT 7 +#define R_X86_64_RELATIVE 8 +#define R_X86_64_GOTPCREL 9 +#define R_X86_64_32 10 +#define R_X86_64_32S 11 +#define R_X86_64_16 12 +#define R_X86_64_PC16 13 +#define R_X86_64_8 14 +#define R_X86_64_PC8 15 +#define R_X86_64_DPTMOD64 16 +#define R_X86_64_DTPOFF64 17 +#define R_X86_64_TPOFF64 18 +#define R_X86_64_TLSGD 19 +#define R_X86_64_TLSLD 20 +#define R_X86_64_DTPOFF32 21 +#define R_X86_64_GOTTPOFF 22 +#define R_X86_64_TPOFF32 23 + +/* * sh4 relocation types */ #define R_SH_NONE 0 @@ -314,40 +324,4 @@ struct Elf32_Rela { #define R_PPC_SECTOFF_HA 36 #define R_PPC_NUM 37 - -struct Elf32_Dyn { - Elf32_Sword d_tag; - union { - Elf32_Word d_val; - Elf32_Addr d_ptr; - } d_un; -}; - -#define DT_NULL 0 -#define DT_NEEDED 1 -#define DT_PLTRELSZ 2 -#define DT_PLTGOT 3 -#define DT_HASH 4 -#define DT_STRTAB 5 -#define DT_SYMTAB 6 -#define DT_RELA 7 -#define DT_RELASZ 8 -#define DT_RELAENT 9 -#define DT_STRSZ 10 -#define DT_SYMENT 11 -#define DT_INIT 12 -#define DT_FINI 13 -#define DT_SONAME 14 -#define DT_RPATH 15 -#define DT_SYMBOLIC 16 -#define DT_REL 17 -#define DT_RELSZ 18 -#define DT_RELENT 19 -#define DT_PLTREL 20 -#define DT_DEBUG 21 -#define DT_TEXTREL 22 -#define DT_JMPREL 23 -#define DT_LOPROC 0x70000000 -#define DT_HIPROC 0x7fffffff - #endif diff --git a/include/newos/elf32.h b/include/newos/elf32.h dissimilarity index 78% index 6dba8c7..0d7f471 100644 --- a/include/newos/elf32.h +++ b/include/newos/elf32.h @@ -1,353 +1,93 @@ -/* -** Copyright 2001, Travis Geiselbrecht. All rights reserved. -** Distributed under the terms of the NewOS License. -*/ -#ifndef _ELF32_H -#define _ELF32_H - -#include - -typedef uint32 Elf32_Addr; -typedef uint16 Elf32_Half; -typedef uint32 Elf32_Off; -typedef int32 Elf32_Sword; -typedef uint32 Elf32_Word; - -#define ELF_MAGIC "\x7f""ELF" -#define EI_MAG0 0 -#define EI_MAG1 1 -#define EI_MAG2 2 -#define EI_MAG3 3 -#define EI_CLASS 4 -#define EI_DATA 5 -#define EI_VERSION 6 -#define EI_PAD 7 -#define EI_NIDENT 16 - -#define EM_SPARC 2 -#define EM_386 3 -#define EM_68K 4 -#define EM_MIPS 8 -#define EM_SPARC32PLUS 18 -#define EM_PPC 20 -#define EM_PPC64 21 -#define EM_ARM 40 -#define EM_SH 42 -#define EM_SPARCV9 43 - -#define ELFCLASS32 1 -#define ELFCLASS64 2 -#define ELFDATA2LSB 1 -#define ELFDATA2MSB 2 -#define EV_CURRENT 1 - -struct Elf32_Ehdr { - unsigned char e_ident[EI_NIDENT]; - Elf32_Half e_type; - Elf32_Half e_machine; - Elf32_Word e_version; - Elf32_Addr e_entry; - Elf32_Off e_phoff; - Elf32_Off e_shoff; - Elf32_Word e_flags; - Elf32_Half e_ehsize; - Elf32_Half e_phentsize; - Elf32_Half e_phnum; - Elf32_Half e_shentsize; - Elf32_Half e_shnum; - Elf32_Half e_shstrndx; -} ; - -struct Elf32_Shdr { - Elf32_Word sh_name; - Elf32_Word sh_type; - Elf32_Word sh_flags; - Elf32_Addr sh_addr; - Elf32_Off sh_offset; - Elf32_Word sh_size; - Elf32_Word sh_link; - Elf32_Word sh_info; - Elf32_Word sh_addralign; - Elf32_Word sh_entsize; -} ; - -#define SHT_NULL 0 -#define SHT_PROGBITS 1 -#define SHT_SYMTAB 2 -#define SHT_STRTAB 3 -#define SHT_RELA 4 -#define SHT_HASH 5 -#define SHT_DYNAMIC 6 -#define SHT_NOTE 7 -#define SHT_NOBITS 8 -#define SHT_REL 9 -#define SHT_SHLIB 10 -#define SHT_DYNSYM 11 -#define SHT_LOPROC 0x70000000 -#define SHT_HIPROC 0x7fffffff -#define SHT_LOUSER 0x80000000 -#define SHT_HIUSER 0xffffffff - -#define SHF_WRITE 1 - -struct Elf32_Phdr { - Elf32_Word p_type; - Elf32_Off p_offset; - Elf32_Addr p_vaddr; - Elf32_Addr p_paddr; - Elf32_Word p_filesz; - Elf32_Word p_memsz; - Elf32_Word p_flags; - Elf32_Word p_align; -} ; - -#define PF_X 0x1 -#define PF_W 0x2 -#define PF_R 0x4 -#define PF_MASKPROC 0xf0000000 - - -#define PT_NULL 0 -#define PT_LOAD 1 -#define PT_DYNAMIC 2 -#define PT_INTERP 3 -#define PT_NOTE 4 -#define PT_SHLIB 5 -#define PT_PHDR 6 -#define PT_LOPROC 0x70000000 -#define PT_HIPROC 0x7fffffff - -#define SHN_UNDEF 0 -#define SHN_LORESERVE 0xff00 -#define SHN_LOPROC 0xff00 -#define SHN_HIPROC 0xff1f -#define SHN_ABS 0xfff1 -#define SHN_COMMON 0xfff2 -#define SHN_HIRESERVE 0xffff - -struct Elf32_Sym { - Elf32_Word st_name; - Elf32_Addr st_value; - Elf32_Word st_size; - unsigned char st_info; - unsigned char st_other; - Elf32_Half st_shndx; -}; - -#define ELF32_ST_BIND(i) ((i) >> 4) -#define ELF32_ST_TYPE(i) ((i) & 0xf) -#define ELF32_ST_INFO(b, t) (((b) << 4) + ((t) & 0xf)) - -#define STT_NOTYPE 0 -#define STT_OBJECT 1 -#define STT_FUNC 2 -#define STT_SECTION 3 -#define STT_FILE 4 -#define STT_LOPROC 13 -#define STT_HIPROC 15 - -#define STB_LOCAL 0 -#define STB_GLOBAL 1 -#define STB_WEAK 2 -#define STB_LOPROC 13 -#define STB_HIPROC 15 - -#define STN_UNDEF 0 - -struct Elf32_Rel { - Elf32_Addr r_offset; - Elf32_Word r_info; -}; - -struct Elf32_Rela { - Elf32_Addr r_offset; - Elf32_Word r_info; - Elf32_Sword r_addend; -}; - -#define ELF32_R_SYM(i) ((i) >> 8) -#define ELF32_R_TYPE(i) ((unsigned char)(i)) -#define ELF32_R_INFO(s, t) (((s) << 8) + (unsigned char)(t)) - -/* - * i386 relocation types - */ -#define R_386_NONE 0 -#define R_386_32 1 -#define R_386_PC32 2 -#define R_386_GOT32 3 -#define R_386_PLT32 4 -#define R_386_COPY 5 -#define R_386_GLOB_DAT 6 -#define R_386_JMP_SLOT 7 -#define R_386_RELATIVE 8 -#define R_386_GOTOFF 9 -#define R_386_GOTPC 10 - -/* - * sh4 relocation types - */ -#define R_SH_NONE 0 -#define R_SH_DIR32 1 -#define R_SH_REL32 2 -#define R_SH_DIR8WPN 3 -#define R_SH_IND12W 4 -#define R_SH_DIR8WPL 5 -#define R_SH_DIR8WPZ 6 -#define R_SH_DIR8BP 7 -#define R_SH_DIR8W 8 -#define R_SH_DIR8L 9 -#define R_SH_SWITCH16 25 -#define R_SH_SWITCH32 26 -#define R_SH_USES 27 -#define R_SH_COUNT 28 -#define R_SH_ALIGN 29 - -#define R_SH_CODE 30 -#define R_SH_DATA 31 -#define R_SH_LABEL 32 -#define R_SH_SWITCH8 33 -#define R_SH_GNU_VTINHERIT 34 -#define R_SH_GNU_VTENTRY 35 -#define R_SH_LOOP_START 36 -#define R_SH_LOOP_END 37 -#define R_SH_DIR5U 45 -#define R_SH_DIR6U 46 -#define R_SH_DIR6S 47 -#define R_SH_DIR10S 48 -#define R_SH_DIR10SW 49 -#define R_SH_DIR10SL 50 -#define R_SH_DIR10SQ 51 -#define R_SH_GOT32 160 -#define R_SH_PLT32 161 -#define R_SH_COPY 162 -#define R_SH_GLOB_DAT 163 -#define R_SH_JMP_SLOT 164 -#define R_SH_RELATIVE 165 -#define R_SH_GOTOFF 166 -#define R_SH_GOTPC 167 -#define R_SH_GOTPLT32 168 -#define R_SH_GOT_LOW16 169 -#define R_SH_GOT_MEDLOW16 170 -#define R_SH_GOT_MEDHI16 171 -#define R_SH_GOT_HI16 172 -#define R_SH_GOTPLT_LOW16 173 -#define R_SH_GOTPLT_MEDLOW16 174 -#define R_SH_GOTPLT_MEDHI16 175 -#define R_SH_GOTPLT_HI16 176 -#define R_SH_PLT_LOW16 177 -#define R_SH_PLT_MEDLOW16 178 -#define R_SH_PLT_MEDHI16 179 -#define R_SH_PLT_HI16 180 -#define R_SH_GOTOFF_LOW16 181 -#define R_SH_GOTOFF_MEDLOW16 182 -#define R_SH_GOTOFF_MEDHI16 183 -#define R_SH_GOTOFF_HI16 184 -#define R_SH_GOTPC_LOW16 185 -#define R_SH_GOTPC_MEDLOW16 186 -#define R_SH_GOTPC_MEDHI16 187 -#define R_SH_GOTPC_HI16 188 -#define R_SH_GOT10BY4 189 -#define R_SH_GOTPLT10BY4 190 -#define R_SH_GOT10BY8 191 -#define R_SH_GOTPLT10BY8 192 -#define R_SH_COPY64 193 -#define R_SH_GLOB_DAT64 194 -#define R_SH_JMP_SLOT64 195 -#define R_SH_RELATIVE64 196 -#define R_SH_SHMEDIA_CODE 242 -#define R_SH_PT_16 243 -#define R_SH_IMMS16 244 -#define R_SH_IMMU16 245 -#define R_SH_IMM_LOW16 246 -#define R_SH_IMM_LOW16_PCREL 247 -#define R_SH_IMM_MEDLOW16 248 -#define R_SH_IMM_MEDLOW16_PCREL 249 -#define R_SH_IMM_MEDHI16 250 -#define R_SH_IMM_MEDHI16_PCREL 251 -#define R_SH_IMM_HI16 252 -#define R_SH_IMM_HI16_PCREL 253 -#define R_SH_64 254 -#define R_SH_64_PCREL 255 - -/* PowerPC specific declarations */ - -/* - * ppc relocation types - */ -#define R_PPC_NONE 0 -#define R_PPC_ADDR32 1 /* 32bit absolute address */ -#define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */ -#define R_PPC_ADDR16 3 /* 16bit absolute address */ -#define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */ -#define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */ -#define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */ -#define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */ -#define R_PPC_ADDR14_BRTAKEN 8 -#define R_PPC_ADDR14_BRNTAKEN 9 -#define R_PPC_REL24 10 /* PC relative 26 bit */ -#define R_PPC_REL14 11 /* PC relative 16 bit */ -#define R_PPC_REL14_BRTAKEN 12 -#define R_PPC_REL14_BRNTAKEN 13 -#define R_PPC_GOT16 14 -#define R_PPC_GOT16_LO 15 -#define R_PPC_GOT16_HI 16 -#define R_PPC_GOT16_HA 17 -#define R_PPC_PLTREL24 18 -#define R_PPC_COPY 19 -#define R_PPC_GLOB_DAT 20 -#define R_PPC_JMP_SLOT 21 -#define R_PPC_RELATIVE 22 -#define R_PPC_LOCAL24PC 23 -#define R_PPC_UADDR32 24 -#define R_PPC_UADDR16 25 -#define R_PPC_REL32 26 -#define R_PPC_PLT32 27 -#define R_PPC_PLTREL32 28 -#define R_PPC_PLT16_LO 29 -#define R_PPC_PLT16_HI 30 -#define R_PPC_PLT16_HA 31 -#define R_PPC_SDAREL16 32 -#define R_PPC_SECTOFF 33 -#define R_PPC_SECTOFF_LO 34 -#define R_PPC_SECTOFF_HI 35 -#define R_PPC_SECTOFF_HA 36 -#define R_PPC_NUM 37 - - -struct Elf32_Dyn { - Elf32_Sword d_tag; - union { - Elf32_Word d_val; - Elf32_Addr d_ptr; - } d_un; -}; - -#define DT_NULL 0 -#define DT_NEEDED 1 -#define DT_PLTRELSZ 2 -#define DT_PLTGOT 3 -#define DT_HASH 4 -#define DT_STRTAB 5 -#define DT_SYMTAB 6 -#define DT_RELA 7 -#define DT_RELASZ 8 -#define DT_RELAENT 9 -#define DT_STRSZ 10 -#define DT_SYMENT 11 -#define DT_INIT 12 -#define DT_FINI 13 -#define DT_SONAME 14 -#define DT_RPATH 15 -#define DT_SYMBOLIC 16 -#define DT_REL 17 -#define DT_RELSZ 18 -#define DT_RELENT 19 -#define DT_PLTREL 20 -#define DT_DEBUG 21 -#define DT_TEXTREL 22 -#define DT_JMPREL 23 -#define DT_LOPROC 0x70000000 -#define DT_HIPROC 0x7fffffff - -#endif +/* +** Copyright 2001-2004, Travis Geiselbrecht. All rights reserved. +** Distributed under the terms of the NewOS License. +*/ +#ifndef _ELF32_H +#define _ELF32_H + +#include + +typedef uint32 Elf32_Addr; +typedef uint16 Elf32_Half; +typedef uint32 Elf32_Off; +typedef int32 Elf32_Sword; +typedef uint32 Elf32_Word; + +struct Elf32_Ehdr { + unsigned char e_ident[EI_NIDENT]; + Elf32_Half e_type; + Elf32_Half e_machine; + Elf32_Word e_version; + Elf32_Addr e_entry; + Elf32_Off e_phoff; + Elf32_Off e_shoff; + Elf32_Word e_flags; + Elf32_Half e_ehsize; + Elf32_Half e_phentsize; + Elf32_Half e_phnum; + Elf32_Half e_shentsize; + Elf32_Half e_shnum; + Elf32_Half e_shstrndx; +} ; + +struct Elf32_Shdr { + Elf32_Word sh_name; + Elf32_Word sh_type; + Elf32_Word sh_flags; + Elf32_Addr sh_addr; + Elf32_Off sh_offset; + Elf32_Word sh_size; + Elf32_Word sh_link; + Elf32_Word sh_info; + Elf32_Word sh_addralign; + Elf32_Word sh_entsize; +} ; + +struct Elf32_Phdr { + Elf32_Word p_type; + Elf32_Off p_offset; + Elf32_Addr p_vaddr; + Elf32_Addr p_paddr; + Elf32_Word p_filesz; + Elf32_Word p_memsz; + Elf32_Word p_flags; + Elf32_Word p_align; +} ; + +struct Elf32_Sym { + Elf32_Word st_name; + Elf32_Addr st_value; + Elf32_Word st_size; + unsigned char st_info; + unsigned char st_other; + Elf32_Half st_shndx; +}; + +#define ELF32_ST_BIND(i) ((i) >> 4) +#define ELF32_ST_TYPE(i) ((i) & 0xf) +#define ELF32_ST_INFO(b, t) (((b) << 4) + ((t) & 0xf)) + +struct Elf32_Rel { + Elf32_Addr r_offset; + Elf32_Word r_info; +}; + +struct Elf32_Rela { + Elf32_Addr r_offset; + Elf32_Word r_info; + Elf32_Sword r_addend; +}; + +#define ELF32_R_SYM(i) ((i) >> 8) +#define ELF32_R_TYPE(i) ((unsigned char)(i)) +#define ELF32_R_INFO(s, t) (((s) << 8) + (unsigned char)(t)) + +struct Elf32_Dyn { + Elf32_Sword d_tag; + union { + Elf32_Word d_val; + Elf32_Addr d_ptr; + } d_un; +}; + +#endif diff --git a/include/newos/elf64.h b/include/newos/elf64.h new file mode 100644 index 0000000..996d06f --- /dev/null +++ b/include/newos/elf64.h @@ -0,0 +1,95 @@ +/* +** Copyright 2001-2004, Travis Geiselbrecht. All rights reserved. +** Distributed under the terms of the NewOS License. +*/ +#ifndef _ELF64_H +#define _ELF64_H + +#include + +typedef uint64 Elf64_Addr; +typedef uint32 Elf64_Half; +typedef uint16 Elf64_Quarter; +typedef uint64 Elf64_Off; +typedef uint64 Elf64_Size; +typedef int64 Elf64_Sword; +typedef uint64 Elf64_Word; + +struct Elf64_Ehdr { + unsigned char e_ident[EI_NIDENT]; + Elf64_Quarter e_type; + Elf64_Quarter e_machine; + Elf64_Half e_version; + Elf64_Addr e_entry; + Elf64_Off e_phoff; + Elf64_Off e_shoff; + Elf64_Half e_flags; + Elf64_Quarter e_ehsize; + Elf64_Quarter e_phentsize; + Elf64_Quarter e_phnum; + Elf64_Quarter e_shentsize; + Elf64_Quarter e_shnum; + Elf64_Quarter e_shstrndx; +}; + +struct Elf64_Shdr { + Elf64_Half sh_name; + Elf64_Half sh_type; + Elf64_Size sh_flags; + Elf64_Addr sh_addr; + Elf64_Off sh_offset; + Elf64_Size sh_size; + Elf64_Half sh_link; + Elf64_Half sh_info; + Elf64_Size sh_addralign; + Elf64_Size sh_entsize; +} ; + +struct Elf64_Phdr { + Elf64_Half p_type; + Elf64_Half p_flags; + Elf64_Off p_offset; + Elf64_Addr p_vaddr; + Elf64_Addr p_paddr; + Elf64_Size p_filesz; + Elf64_Size p_memsz; + Elf64_Size p_align; +}; + +struct Elf64_Sym { + Elf64_Half st_name; + unsigned char st_info; + unsigned char st_other; + Elf64_Quarter st_shndx; + Elf64_Addr st_value; + Elf64_Size st_size; +}; + +#define ELF64_ST_BIND(i) ((i) >> 4) +#define ELF64_ST_TYPE(i) ((i) & 0xf) +#define ELF64_ST_INFO(b, t) (((b) << 4) + ((t) & 0xf)) + +struct Elf64_Rel { + Elf64_Addr r_offset; + Elf64_Size r_info; +}; + +struct Elf64_Rela { + Elf64_Addr r_offset; + Elf64_Size r_info; + Elf64_Off r_addend; +}; + +#define ELF64_R_SYM(i) ((i) >> 32) +#define ELF64_R_TYPE(i) ((unsigned char)(i)) +#define ELF32_R_INFO(s, t) (((s) << 32) + (unsigned char)(t)) + +struct Elf64_Dyn { + Elf64_Size d_tag; + union { + Elf64_Size d_val; + Elf64_Addr d_ptr; + } d_un; +}; + +#endif diff --git a/kernel/arch/x86_64/arch_interrupts.S b/kernel/arch/x86_64/arch_interrupts.S index 433d6c5..a0fa691 100644 --- a/kernel/arch/x86_64/arch_interrupts.S +++ b/kernel/arch/x86_64/arch_interrupts.S @@ -13,6 +13,7 @@ #define TRAP_ERRC(name, vector) \ .globl name; \ +.type x,@function; \ .align 8; \ name: \ push $vector; \ @@ -20,6 +21,7 @@ name: \ #define TRAP(name, vector) \ .globl name; \ +.type x,@function; \ .align 8; \ name: \ push $0; \ diff --git a/lib/libnewos/system/arch/x86_64/syscalls.inc b/lib/libnewos/system/arch/x86_64/syscalls.inc index caf3a28..19a6307 100644 --- a/lib/libnewos/system/arch/x86_64/syscalls.inc +++ b/lib/libnewos/system/arch/x86_64/syscalls.inc @@ -17,8 +17,8 @@ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $0,%r11; \ + mov $n,%ax; \ + mov $0,%r11b; \ syscall; \ ret @@ -27,8 +27,8 @@ name: \ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $0,%r11; \ + mov $n,%ax; \ + mov $0,%r11b; \ syscall; \ ret @@ -37,8 +37,8 @@ name: \ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $0,%r11; \ + mov $n,%ax; \ + mov $0,%r11b; \ mov %rcx,%r10; \ syscall; \ ret @@ -48,8 +48,8 @@ name: \ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $0,%r11; \ + mov $n,%ax; \ + mov $0,%r11b; \ mov %rcx,%r10; \ syscall; \ ret @@ -59,8 +59,8 @@ name: \ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $0,%r11; \ + mov $n,%ax; \ + mov $0,%r11b; \ mov %rcx,%r10; \ syscall; \ ret @@ -70,8 +70,8 @@ name: \ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $0,%r11; \ + mov $n,%ax; \ + mov $0,%r11b; \ mov %rcx,%r10; \ syscall; \ ret @@ -81,8 +81,8 @@ name: \ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $0,%r11; \ + mov $n,%ax; \ + mov $0,%r11b; \ mov %rcx,%r10; \ syscall; \ ret @@ -92,8 +92,8 @@ name: \ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $1,%r11; \ + mov $n,%ax; \ + mov $1,%r11b; \ mov %rcx,%r10; \ syscall; \ ret @@ -103,8 +103,8 @@ name: \ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $2,%r11; \ + mov $n,%ax; \ + mov $2,%r11b; \ mov %rcx,%r10; \ syscall; \ ret @@ -114,8 +114,8 @@ name: \ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $3,%r11; \ + mov $n,%ax; \ + mov $3,%r11b; \ mov %rcx,%r10; \ syscall; \ ret @@ -125,8 +125,8 @@ name: \ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $4,%r11; \ + mov $n,%ax; \ + mov $4,%r11b; \ mov %rcx,%r10; \ syscall; \ ret @@ -136,8 +136,8 @@ name: \ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $5,%r11; \ + mov $n,%ax; \ + mov $5,%r11b; \ mov %rcx,%r10; \ syscall; \ ret @@ -147,8 +147,8 @@ name: \ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $6,%r11; \ + mov $n,%ax; \ + mov $6,%r11b; \ mov %rcx,%r10; \ syscall; \ ret @@ -158,8 +158,8 @@ name: \ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $7,%r11; \ + mov $n,%ax; \ + mov $7,%r11b; \ mov %rcx,%r10; \ syscall; \ ret @@ -169,8 +169,8 @@ name: \ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $8,%r11; \ + mov $n,%ax; \ + mov $8,%r11b; \ mov %rcx,%r10; \ syscall; \ ret @@ -180,8 +180,8 @@ name: \ .type name,@function; \ .align 8; \ name: \ - mov $n,%rax; \ - mov $9,%r11; \ + mov $n,%ax; \ + mov $9,%r11b; \ mov %rcx,%r10; \ syscall; \ ret diff --git a/tools/bootmaker.c b/tools/bootmaker.c index ed21bb5..9afd15a 100644 --- a/tools/bootmaker.c +++ b/tools/bootmaker.c @@ -1,5 +1,5 @@ /* -** Some Portions Copyright 2001, Travis Geiselbrecht. All rights reserved. +** Portions Copyright 2001-2004, Travis Geiselbrecht. All rights reserved. ** Distributed under the terms of the NewOS License. */ /* @@ -54,6 +54,8 @@ #define SWAP32(x) \ ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) | (((x) & 0xff0000) >> 8) | (((x) & 0xff000000) >> 24)) +#define SWAP64(x) \ + SWAP32((x) << 32) | SWAP32((x) >> 32) #if xBIG_ENDIAN #define HOST_TO_BENDIAN32(x) (x) @@ -124,6 +126,43 @@ struct Elf32_Phdr { Elf32_Word p_align; }; +// ELF64 stuff +typedef unsigned long long Elf64_Addr; +typedef unsigned short Elf64_Quarter; +typedef unsigned int Elf64_Half; +typedef unsigned long long Elf64_Off; +typedef unsigned long long Elf64_Size; +typedef long long Elf64_Sword; +typedef unsigned long long Elf64_Word; + +struct Elf64_Ehdr { + unsigned char e_ident[EI_NIDENT]; + Elf64_Quarter e_type; + Elf64_Quarter e_machine; + Elf64_Half e_version; + Elf64_Addr e_entry; + Elf64_Off e_phoff; + Elf64_Off e_shoff; + Elf64_Half e_flags; + Elf64_Quarter e_ehsize; + Elf64_Quarter e_phentsize; + Elf64_Quarter e_phnum; + Elf64_Quarter e_shentsize; + Elf64_Quarter e_shnum; + Elf64_Quarter e_shstrndx; +}; + +struct Elf64_Phdr { + Elf64_Half p_type; + Elf64_Half p_flags; + Elf64_Off p_offset; + Elf64_Addr p_vaddr; + Elf64_Addr p_paddr; + Elf64_Size p_filesz; + Elf64_Size p_memsz; + Elf64_Size p_align; +}; + #ifndef O_BINARY #define O_BINARY 0 #endif @@ -388,7 +427,7 @@ char *getvaldef(section *s, char *name, char *def) return def; } -Elf32_Addr elf_find_entry(void *buf, int size) +Elf32_Off elf32_find_entry(void *buf, int size) { struct Elf32_Ehdr *header; struct Elf32_Phdr *pheader; @@ -398,11 +437,20 @@ Elf32_Addr elf_find_entry(void *buf, int size) #define SWAPIT(x) ((byte_swap) ? SWAP32(x) : (x)) - if(memcmp(cbuf, ELF_MAGIC, sizeof(ELF_MAGIC)-1) != 0) + if(memcmp(cbuf, ELF_MAGIC, sizeof(ELF_MAGIC)-1) != 0) { + fprintf(stderr, "file does not have proper magic value\n"); return 0; + } - if(cbuf[EI_CLASS] != ELFCLASS32) + if(cbuf[EI_CLASS] != ELFCLASS32) { + fprintf(stderr, "wrong elf class (%d)\n", cbuf[EI_CLASS]); return 0; + } + + if(cbuf[EI_VERSION] != 1) { + fprintf(stderr, "elf file has unsupported version (%d)\n", cbuf[EI_VERSION]); + return 0; + } byte_swap = 0; #if xBIG_ENDIAN @@ -420,8 +468,52 @@ Elf32_Addr elf_find_entry(void *buf, int size) // XXX only looking at the first program header. Should be ok return SWAPIT(pheader->p_offset); +#undef SWAPIT } + +Elf64_Off elf64_find_entry(void *buf, int size) +{ + struct Elf64_Ehdr *header; + struct Elf64_Phdr *pheader; + char *cbuf = buf; + int byte_swap; + int index; + +#define SWAPIT(x) ((byte_swap) ? SWAP64(x) : (x)) + + if(memcmp(cbuf, ELF_MAGIC, sizeof(ELF_MAGIC)-1) != 0) { + fprintf(stderr, "file does not have proper magic value\n"); + return 0; + } + + if(cbuf[EI_CLASS] != ELFCLASS64) { + fprintf(stderr, "wrong elf class (%d)\n", cbuf[EI_CLASS]); + return 0; + } + + if(cbuf[EI_VERSION] != 1) { + fprintf(stderr, "elf file has unsupported version (%d)\n", cbuf[EI_VERSION]); + return 0; + } + + byte_swap = 0; +#if xBIG_ENDIAN + if(cbuf[EI_DATA] == ELFDATA2LSB) { + byte_swap = 1; + } +#else + if(cbuf[EI_DATA] == ELFDATA2MSB) { + byte_swap = 1; + } +#endif + + header = (struct Elf64_Ehdr *)cbuf; + pheader = (struct Elf64_Phdr *)&cbuf[SWAPIT(header->e_phoff)]; + + // XXX only looking at the first program header. Should be ok + return SWAPIT(pheader->p_offset); #undef SWAPIT +} #define centry bdir.bd_entry[c] void makeboot(section *s, char *outfile) @@ -502,7 +594,12 @@ void makeboot(section *s, char *outfile) if(!strcmp(type,"elf32")){ centry.be_type = fix(BE_TYPE_ELF32); centry.be_code_vaddr = 0; - centry.be_code_ventr = fix(elf_find_entry(rawdata[c], rawsize[c])); + centry.be_code_ventr = fix(elf32_find_entry(rawdata[c], rawsize[c])); + } + if(!strcmp(type,"elf64")){ + centry.be_type = fix(BE_TYPE_ELF64); + centry.be_code_vaddr = 0; + centry.be_code_ventr = fix(elf64_find_entry(rawdata[c], rawsize[c])); } if(centry.be_type == BE_TYPE_NONE){ -- 2.11.4.GIT