FireBirdLib - Topfield TMS PVR TAP Programming Library
ELFReadSectionHeaders.c
Go to the documentation of this file.
1
#include <stdlib.h>
2
#include "
ELF.h
"
3
#include "
FBLib_elf.h
"
4
5
bool
ELFReadSectionHeaders
(
void
)
6
{
7
TRACEENTER
();
8
9
if
(
ELFHeader
->
e_shnum
== 0)
10
{
11
TRACEEXIT
();
12
return
FALSE;
13
}
14
15
if
(!(
SectionHeaders
= TAP_MemAlloc(
ELFHeader
->
e_shnum
*
sizeof
(
Elf32_Shdr
))))
16
{
17
TRACEEXIT
();
18
return
FALSE;
19
}
20
21
lseek(
fTAP
,
ELFHeader
->
e_shoff
,
SEEK_SET
);
22
if
(read(
fTAP
,
SectionHeaders
,
ELFHeader
->
e_shnum
*
sizeof
(
Elf32_Shdr
)) != (
int
)(
ELFHeader
->
e_shnum
*
sizeof
(
Elf32_Shdr
)))
23
{
24
TRACEEXIT
();
25
return
FALSE;
26
}
27
28
29
TRACEEXIT
();
30
return
TRUE;
31
}
SectionHeaders
Elf32_Shdr * SectionHeaders
Definition:
ELFOpenFile.c:7
ELFHeader
Elf32_Ehdr * ELFHeader
Definition:
ELFOpenFile.c:6
fTAP
int fTAP
Definition:
ELFOpenFile.c:5
ELFReadSectionHeaders
bool ELFReadSectionHeaders(void)
Definition:
ELFReadSectionHeaders.c:5
ELF.h
FBLib_elf.h
SEEK_SET
#define SEEK_SET
Definition:
libFireBird.h:1875
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
Elf32_Ehdr::e_shoff
Elf32_Off e_shoff
Definition:
ELF.h:38
Elf32_Ehdr::e_shnum
Elf32_Half e_shnum
Definition:
ELF.h:44
Elf32_Shdr
Definition:
ELF.h:49
elf
ELFReadSectionHeaders.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3