Kinetis Bootloader Host  2.0.0
Host Tools for Kinetis devices
apps/elftosb/common/GHSSecInfo.h
1 /*
2  * File: GHSSecInfo.h
3  *
4  * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
5  * See included license file for license details.
6  */
7 #if !defined(_GHSSecInfo_h_)
8 #define _GHSSecInfo_h_
9 
10 #include "StELFFile.h"
11 #include "smart_ptr.h"
12 
13 namespace elftosb
14 {
32 {
33 public:
35  GHSSecInfo(StELFFile *elf);
36 
38  bool hasSecinfo() const { return m_hasInfo; }
40  bool isSectionFilled(uint32_t addr, uint32_t length);
41 
43  bool isSectionFilled(const Elf32_Shdr &section);
44 
45 protected:
46 #pragma pack(1)
47 
52  {
53  uint32_t m_clearAddr;
54  uint32_t m_clearValue;
55  uint32_t m_numBytesToClear;
56  };
57 
58 #pragma pack()
59 
60 protected:
62  bool m_hasInfo;
65  unsigned m_entryCount;
66 };
67 
68 }; // namespace elftosb
69 
70 #endif // _GHSSecInfo_h_
ELF section header.
Definition: apps/elftosb/common/ELF.h:135
The structure of one .secinfo entry.
Definition: apps/elftosb/common/GHSSecInfo.h:51
Wrapper around the GHS-specific .secinfo ELF section.
Definition: apps/elftosb/common/GHSSecInfo.h:31
bool hasSecinfo() const
Returns true if there is a .secinfo section present in the ELF file.
Definition: apps/elftosb/common/GHSSecInfo.h:38
uint32_t m_numBytesToClear
Number of bytes to fill.
Definition: apps/elftosb/common/GHSSecInfo.h:55
GHSSecInfo(StELFFile *elf)
Default constructor.
Definition: apps/elftosb/common/GHSSecInfo.cpp:22
uint32_t m_clearAddr
Address to start filling from.
Definition: apps/elftosb/common/GHSSecInfo.h:53
Definition: BootImage.h:13
bool m_hasInfo
Whether .secinfo is present in the ELF file.
Definition: apps/elftosb/common/GHSSecInfo.h:62
unsigned m_entryCount
Number of entries in m_info.
Definition: apps/elftosb/common/GHSSecInfo.h:65
smart_array_ptr< ghs_secinfo_t > m_info
Pointer to the .secinfo entries. Will be NULL if there is no .secinfo section in the file...
Definition: apps/elftosb/common/GHSSecInfo.h:64
Simple, standard smart pointer class that uses the array delete operator.
Definition: apps/elftosb/common/smart_ptr.h:121
uint32_t m_clearValue
Value to fill with.
Definition: apps/elftosb/common/GHSSecInfo.h:54
Parser for Executable and Linking Format (ELF) files.
Definition: apps/elftosb/common/StELFFile.h:42
bool isSectionFilled(uint32_t addr, uint32_t length)
Determines if a section should be filled.
Definition: apps/elftosb/common/GHSSecInfo.cpp:65
StELFFile * m_elf
The parser object for our ELF file.
Definition: apps/elftosb/common/GHSSecInfo.h:61