| 1 |
/* |
| 2 |
* Copyright (c) 2013 Richard Braun. |
| 3 |
* |
| 4 |
* This program is free software: you can redistribute it and/or modify |
| 5 |
* it under the terms of the GNU General Public License as published by |
| 6 |
* the Free Software Foundation, either version 2 of the License, or |
| 7 |
* (at your option) any later version. |
| 8 |
* |
| 9 |
* This program is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
* GNU General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU General Public License |
| 15 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 |
*/ |
| 17 |
|
| 18 |
#ifndef _X86_ELF_H |
| 19 |
#define _X86_ELF_H |
| 20 |
|
| 21 |
#define ELF_SHT_SYMTAB 2 |
| 22 |
#define ELF_SHT_STRTAB 3 |
| 23 |
|
| 24 |
struct elf_shdr { |
| 25 |
unsigned int name; |
| 26 |
unsigned int type; |
| 27 |
unsigned int flags; |
| 28 |
unsigned long addr; |
| 29 |
unsigned long offset; |
| 30 |
unsigned int size; |
| 31 |
unsigned int link; |
| 32 |
unsigned int info; |
| 33 |
unsigned int addralign; |
| 34 |
unsigned int entsize; |
| 35 |
}; |
| 36 |
|
| 37 |
#ifdef __LP64__ |
| 38 |
|
| 39 |
struct elf_sym { |
| 40 |
unsigned int name; |
| 41 |
unsigned char info; |
| 42 |
unsigned char other; |
| 43 |
unsigned short shndx; |
| 44 |
unsigned long value; |
| 45 |
unsigned long size; |
| 46 |
}; |
| 47 |
|
| 48 |
#else /* __LP64__ */ |
| 49 |
|
| 50 |
struct elf_sym { |
| 51 |
unsigned int name; |
| 52 |
unsigned long value; |
| 53 |
unsigned long size; |
| 54 |
unsigned char info; |
| 55 |
unsigned char other; |
| 56 |
unsigned short shndx; |
| 57 |
}; |
| 58 |
|
| 59 |
#endif /* __LP64__ */ |
| 60 |
|
| 61 |
#endif /* _X86_ELF_H */ |