GPLv2 release
[centaur.git] / include / libelfu / elfops.h
1 /* This file is part of centaur.
2  *
3  * centaur is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License 2 as
5  * published by the Free Software Foundation.
6
7  * centaur is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11
12  * You should have received a copy of the GNU General Public License
13  * along with centaur.  If not, see <http://www.gnu.org/licenses/>.
14  */
15
16 /*!
17  * @file elfops.h
18  * @brief Operations offered by libelfu on libelf handles
19  *
20  * This includes:
21  *  - Checks
22  *  - Post-processing for ELF specification compliance
23  */
24
25 #ifndef __LIBELFU_ELFOPS_H_
26 #define __LIBELFU_ELFOPS_H_
27
28 #include <libelf.h>
29 #include <gelf.h>
30
31 #include <libelfu/types.h>
32
33
34 /*!
35  * @brief Perform a large array of sanity checks.
36  * @param e libelf handle to file to be checked.
37  * @result 0 if successful.
38  *         Anything else indicates an error.
39  * @note If a file does not pass these checks,
40  *       then it cannot be processed by libelfu.
41  */
42 int elfu_eCheck(Elf *e);
43
44
45
46 /*!
47  * @brief Reorder PHDRs to comply with ELF specification.
48  * @param e libelf handle to file to be post-processed.
49  */
50 void elfu_eReorderPhdrs(Elf *e);
51
52
53 #endif