7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 extern struct bss_tracker tracker
[];
32 int load_elf_file(const char *name
, void *file
);
36 #define SHT_PROGBITS 1
51 #define SHN_ABS 0xfff1
52 #define SHN_COMMON 0xfff2
55 #define SHF_WRITE (1 << 0)
56 #define SHF_ALLOC (1 << 1)
57 #define SHF_EXECINSTR (1 << 2)
63 #define R_X86_64_NONE 0
65 #define R_X86_64_PC32 2
66 #define R_X86_64_32 10
67 #define R_X86_64_32S 11
70 #define R_PPC_ADDR32 1
71 #define R_PPC_ADDR16_LO 4
72 #define R_PPC_ADDR16_HA 6
73 #define R_PPC_REL24 10
74 #define R_PPC_REL32 26
76 #define ELF64_ST_TYPE(i) ((i) & 0x0F)
78 #define ELF64_R_SYM(i) (unsigned long)((i) >> 32)
79 #define ELF64_R_TYPE(i) (unsigned long)((i) & 0xffffffffULL)
80 #define ELF64_R_INFO(sym, type) (((unsigned long long)(sym) << 32) + (type))
82 #define ELF32_R_SYM(i) ((i) >> 8)
83 #define ELF32_R_TYPE(i) ((i) & 0xff)
84 #define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
117 uint32_t p_type
; /* Segment type */
118 uint32_t p_offset
; /* Segment file offset */
119 uint32_t p_vaddr
; /* Segment virtual address */
120 uint32_t p_paddr
; /* Segment physical address */
121 uint32_t p_filesz
; /* Segment size in file */
122 uint32_t p_memsz
; /* Segment size in memory */
123 uint32_t p_flags
; /* Segment flags */
124 uint32_t p_align
; /* Segment alignment */