Changeset View
Changeset View
Standalone View
Standalone View
contrib/elftoolchain/libelf/libelf.h
Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | |||||
enum Elf_Error { | enum Elf_Error { | ||||
ELF_E_NONE, /* No error */ | ELF_E_NONE, /* No error */ | ||||
ELF_E_ARCHIVE, /* Malformed ar(1) archive */ | ELF_E_ARCHIVE, /* Malformed ar(1) archive */ | ||||
ELF_E_ARGUMENT, /* Invalid argument */ | ELF_E_ARGUMENT, /* Invalid argument */ | ||||
ELF_E_CLASS, /* Mismatched ELF class */ | ELF_E_CLASS, /* Mismatched ELF class */ | ||||
ELF_E_DATA, /* Invalid data descriptor */ | ELF_E_DATA, /* Invalid data descriptor */ | ||||
ELF_E_HEADER, /* Missing or malformed ELF header */ | ELF_E_HEADER, /* Missing or malformed ELF header */ | ||||
ELF_E_IO, /* I/O error */ | ELF_E_IO, /* I/O error */ | ||||
ELF_E_LAYOUT, /* Layout constraint violation */ | ELF_E_LAYOUT, /* Layout constraint violation */ | ||||
emaste: These should go at the end, so that existing enums retain the same values. Consider an existing… | |||||
ELF_E_MODE, /* Wrong mode for ELF descriptor */ | ELF_E_MODE, /* Wrong mode for ELF descriptor */ | ||||
ELF_E_RANGE, /* Value out of range */ | ELF_E_RANGE, /* Value out of range */ | ||||
ELF_E_RESOURCE, /* Resource exhaustion */ | ELF_E_RESOURCE, /* Resource exhaustion */ | ||||
ELF_E_SECTION, /* Invalid section descriptor */ | ELF_E_SECTION, /* Invalid section descriptor */ | ||||
ELF_E_SEQUENCE, /* API calls out of sequence */ | ELF_E_SEQUENCE, /* API calls out of sequence */ | ||||
ELF_E_UNIMPL, /* Feature is unimplemented */ | ELF_E_UNIMPL, /* Feature is unimplemented */ | ||||
ELF_E_VERSION, /* Unknown API version */ | ELF_E_VERSION, /* Unknown API version */ | ||||
ELF_E_INVALID_SECTION_FLAGS, /* Invalid ELF section header flags */ | |||||
ELF_E_INVALID_SECTION_TYPE, /* Invalid ELF section header type */ | |||||
ELF_E_NOT_COMPRESSED, /* Section is not compressed */ | |||||
ELF_E_NUM /* Max error number */ | ELF_E_NUM /* Max error number */ | ||||
Done Inline ActionsELF_E_NUM is supposed to come last. markj: `ELF_E_NUM` is supposed to come last. | |||||
}; | }; | ||||
/* | /* | ||||
* Flags defined by the API. | * Flags defined by the API. | ||||
*/ | */ | ||||
#define ELF_F_LAYOUT 0x001U /* application will layout the file */ | #define ELF_F_LAYOUT 0x001U /* application will layout the file */ | ||||
#define ELF_F_DIRTY 0x002U /* a section or ELF file is dirty */ | #define ELF_F_DIRTY 0x002U /* a section or ELF file is dirty */ | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
int elf_setshstrndx(Elf *_elf, size_t _shnum); | int elf_setshstrndx(Elf *_elf, size_t _shnum); | ||||
char *elf_strptr(Elf *_elf, size_t _section, size_t _offset); | char *elf_strptr(Elf *_elf, size_t _section, size_t _offset); | ||||
off_t elf_update(Elf *_elf, Elf_Cmd _cmd); | off_t elf_update(Elf *_elf, Elf_Cmd _cmd); | ||||
unsigned int elf_version(unsigned int _version); | unsigned int elf_version(unsigned int _version); | ||||
long elf32_checksum(Elf *_elf); | long elf32_checksum(Elf *_elf); | ||||
size_t elf32_fsize(Elf_Type _type, size_t _count, | size_t elf32_fsize(Elf_Type _type, size_t _count, | ||||
unsigned int _version); | unsigned int _version); | ||||
Elf32_Chdr *elf32_getchdr(Elf_Scn *_scn); | |||||
Elf32_Ehdr *elf32_getehdr(Elf *_elf); | Elf32_Ehdr *elf32_getehdr(Elf *_elf); | ||||
Elf32_Phdr *elf32_getphdr(Elf *_elf); | Elf32_Phdr *elf32_getphdr(Elf *_elf); | ||||
Elf32_Shdr *elf32_getshdr(Elf_Scn *_scn); | Elf32_Shdr *elf32_getshdr(Elf_Scn *_scn); | ||||
Elf32_Ehdr *elf32_newehdr(Elf *_elf); | Elf32_Ehdr *elf32_newehdr(Elf *_elf); | ||||
Elf32_Phdr *elf32_newphdr(Elf *_elf, size_t _count); | Elf32_Phdr *elf32_newphdr(Elf *_elf, size_t _count); | ||||
Elf_Data *elf32_xlatetof(Elf_Data *_dst, const Elf_Data *_src, | Elf_Data *elf32_xlatetof(Elf_Data *_dst, const Elf_Data *_src, | ||||
unsigned int _enc); | unsigned int _enc); | ||||
Elf_Data *elf32_xlatetom(Elf_Data *_dst, const Elf_Data *_src, | Elf_Data *elf32_xlatetom(Elf_Data *_dst, const Elf_Data *_src, | ||||
unsigned int _enc); | unsigned int _enc); | ||||
long elf64_checksum(Elf *_elf); | long elf64_checksum(Elf *_elf); | ||||
size_t elf64_fsize(Elf_Type _type, size_t _count, | size_t elf64_fsize(Elf_Type _type, size_t _count, | ||||
unsigned int _version); | unsigned int _version); | ||||
Elf64_Chdr *elf64_getchdr(Elf_Scn *_scn); | |||||
Elf64_Ehdr *elf64_getehdr(Elf *_elf); | Elf64_Ehdr *elf64_getehdr(Elf *_elf); | ||||
Elf64_Phdr *elf64_getphdr(Elf *_elf); | Elf64_Phdr *elf64_getphdr(Elf *_elf); | ||||
Elf64_Shdr *elf64_getshdr(Elf_Scn *_scn); | Elf64_Shdr *elf64_getshdr(Elf_Scn *_scn); | ||||
Elf64_Ehdr *elf64_newehdr(Elf *_elf); | Elf64_Ehdr *elf64_newehdr(Elf *_elf); | ||||
Elf64_Phdr *elf64_newphdr(Elf *_elf, size_t _count); | Elf64_Phdr *elf64_newphdr(Elf *_elf, size_t _count); | ||||
Elf_Data *elf64_xlatetof(Elf_Data *_dst, const Elf_Data *_src, | Elf_Data *elf64_xlatetof(Elf_Data *_dst, const Elf_Data *_src, | ||||
unsigned int _enc); | unsigned int _enc); | ||||
Elf_Data *elf64_xlatetom(Elf_Data *_dst, const Elf_Data *_src, | Elf_Data *elf64_xlatetom(Elf_Data *_dst, const Elf_Data *_src, | ||||
unsigned int _enc); | unsigned int _enc); | ||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
} | } | ||||
#endif | #endif | ||||
#endif /* _LIBELF_H_ */ | #endif /* _LIBELF_H_ */ |
These should go at the end, so that existing enums retain the same values. Consider an existing binary that calls a routine returning an Elf_Error and checks for e.g. ELF_E_IO, and we install a new libelf with these changes.