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,
28 extern struct bss_tracker tracker
[];
30 int load_elf_file(const char *name
, void *file
, unsigned long virt
);
33 void ptr_ro_add(int amount
);
35 #define SHT_PROGBITS 1
50 #define SHN_ABS 0xfff1
51 #define SHN_COMMON 0xfff2
54 #define SHF_WRITE (1 << 0)
55 #define SHF_ALLOC (1 << 1)
56 #define SHF_EXECINSTR (1 << 2)
62 #define R_X86_64_NONE 0
64 #define R_X86_64_PC32 2
65 #define R_X86_64_32 10
66 #define R_X86_64_32S 11
69 #define R_PPC_ADDR32 1
70 #define R_PPC_ADDR16_LO 4
71 #define R_PPC_ADDR16_HA 6
72 #define R_PPC_REL24 10
73 #define R_PPC_REL32 26
75 #define ELF64_ST_TYPE(i) ((i) & 0x0F)
77 #define ELF64_R_SYM(i) (unsigned long)((i) >> 32)
78 #define ELF64_R_TYPE(i) (unsigned long)((i) & 0xffffffffULL)
79 #define ELF64_R_INFO(sym, type) (((unsigned long long)(sym) << 32) + (type))
81 #define ELF32_R_SYM(i) ((i) >> 8)
82 #define ELF32_R_TYPE(i) ((i) & 0xff)
83 #define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))