scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

elf64.h (1384B)


      1 #include <scc/elf/elftypes.h>
      2 #include <scc/elf/elfhdr.h>
      3 #include <scc/elf/elfphdr.h>
      4 #include <scc/elf/elfshdr.h>
      5 #include <scc/elf/elfent.h>
      6 
      7 #define ELF_ST_BIND ELF64_ST_BIND
      8 #define ELF_ST_TYPE ELF64_ST_TYPE
      9 #define Elf_Ehdr Elf64_Ehdr
     10 #define Elf_Phdr Elf64_Phdr
     11 #define Elf_Shdr Elf64_Shdr
     12 #define Elf_Sym Elf64_Sym
     13 #define ELFHSZ ELFH64SZ
     14 #define ELFPSZ ELFP64SZ
     15 #define ELFSSZ ELFS64SZ
     16 #define ELFESZ ELFE64SZ
     17 
     18 
     19 #define SEC_STRTBL 0
     20 #define SYM_STRTBL 1
     21 
     22 typedef struct elf64 Elf64;
     23 
     24 struct elf64 {
     25 	Elf_Ehdr hdr;
     26 	Elf_Phdr *phdr;
     27 	Elf_Shdr *shdr;
     28 	Elf_Shdr *symtab;
     29 	Elf_Sym *syms;
     30 
     31 	char *strtbl[2];
     32 	size_t strsiz[2];
     33 
     34 	size_t nsec;
     35 	size_t nsym;
     36 };
     37 
     38 extern int elf64new(Obj *);
     39 extern int elf64read(Obj *, FILE *);
     40 extern int elf64setidx(long, char **, long *, FILE *);
     41 extern int elf64getidx(long *, char ***, long **, FILE *);
     42 extern int elf64pc2line(Obj *, unsigned long long , char *, int *);
     43 extern int elf64strip(Obj *);
     44 extern void elf64del(Obj *);
     45 extern int elf64write(Obj *, Map *, FILE *);
     46 extern int elf64probe(unsigned char *, char **);
     47 
     48 extern int elf64xsetidx(int long , char *[], long [], FILE *);
     49 extern int elf64xgetidx(int, long *, char ***, long **, FILE *);
     50 
     51 extern Symbol *elf64getsym(Obj *, int *, Symbol *);
     52 extern Section *elf64getsec(Obj *, int *, Section *);
     53 extern Map *elf64loadmap(Obj *, FILE *);
     54 
     55 extern char *elf64str(Obj *, int n, long);