]> pd.if.org Git - zpackage/blobdiff - elf/elf.h
remove stray debug fprintf
[zpackage] / elf / elf.h
index d201dfcf35f1e47172fc555a41ea06911cf9c8f1..e316a6e4fe57d9dcc09167e8e34c7b0302345d96 100644 (file)
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -80,6 +80,31 @@ typedef struct {
        Elf64_Xword     sh_entsize;
 } Elf64_Shdr;
 
+typedef struct {
+       Elf64_Word      p_type; 
+       Elf64_Word      p_flags;
+       Elf64_Off       p_offset;
+       Elf64_Addr      p_vaddr;
+       Elf64_Addr      p_paddr;
+       Elf64_Xword     p_filesz;
+       Elf64_Xword     p_memsz;
+       Elf64_Xword     p_align;
+} Elf64_Phdr;
+
+#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_TLS         7
+#define        PT_NUM          8
+#define PT_LOOS                0x60000000
+#define PT_HIOS                0x6fffffff
+#define PT_LOPROC      0x70000000
+#define PT_HIPROC      0x7fffffff
+
 typedef struct {
        Elf32_Word      ch_type;
        Elf32_Word      ch_size;
@@ -544,4 +569,15 @@ typedef struct {
 #define ELFOSABI_CLOUDABI      17
 #define ELFOSABI_OPENVOS       18
 
+/* libelf.c */
+Elf64_Ehdr *libelf_header(void *elf);
+Elf64_Shdr *libelf_shdr(void *elf, int n);
+Elf64_Shdr *libelf_sht_strtab(void *elf);
+char *libelf_sectionname(Elf64_Shdr *section, Elf64_Shdr *strtab);
+Elf64_Shdr *libelf_section_n(void *elf, int n);
+Elf64_Shdr *libelf_section(void *elf, unsigned int type);
+int libelf_type(void *elf);
+int libelf_iself(void *elf);
+char *libelf_soname(void *elf);
+
 #endif