ELFSectionProgBits.h revision 74f7a939f44d926babd52f59978e6b093e4bb2d0
1#ifndef ELF_SECTION_PROGBITS_H 2#define ELF_SECTION_PROGBITS_H 3 4#include "ELFTypes.h" 5#include "ELFSectionBits.h" 6#include "ELFSectionHeader.h" 7#include "MemChunk.h" 8 9template <unsigned Bitwidth> 10class ELFSectionProgBits : public ELFSectionBits<Bitwidth> { 11public: 12 ELF_TYPE_INTRO_TO_TEMPLATE_SCOPE(Bitwidth); 13 14public: 15 template <typename Archiver> 16 static ELFSectionProgBits *read(Archiver &AR, 17 ELFObjectTy const *owner, 18 ELFSectionHeaderTy const *sh); 19 20private: 21 template <typename Archiver> 22 bool serialize(Archiver &AR) { 23 AR.seek(this->section_header->getOffset(), true); 24 AR.prologue(this->section_header->getSize()); 25 AR.readBytes(this->buf, this->section_header->getSize()); 26 AR.epilogue(this->section_header->getSize()); 27 return static_cast<bool>(AR); 28 } 29}; 30 31#include "impl/ELFSectionProgBits.hxx" 32 33#endif // ELF_SECTION_PROGBITS_H 34