2#ifndef ROSE_SgAsmElfSectionTableEntry_H
3#define ROSE_SgAsmElfSectionTableEntry_H
5#include <Cxx_GrammarDeclarations.h>
6#include <SgAsmExecutableFileFormat.h>
27#include <Rose/BinaryAnalysis/ByteOrder.h>
28#include <sageContainer.h>
35#if !defined(DOCUMENTATION)
50#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
52 friend class boost::serialization::access;
58 s & BOOST_SERIALIZATION_NVP(p_sh_name);
59 s & BOOST_SERIALIZATION_NVP(p_sh_type);
60 s & BOOST_SERIALIZATION_NVP(p_sh_link);
61 s & BOOST_SERIALIZATION_NVP(p_sh_info);
62 s & BOOST_SERIALIZATION_NVP(p_sh_flags);
63 s & BOOST_SERIALIZATION_NVP(p_sh_addr);
64 s & BOOST_SERIALIZATION_NVP(p_sh_offset);
65 s & BOOST_SERIALIZATION_NVP(p_sh_size);
66 s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
67 s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
68 s & BOOST_SERIALIZATION_NVP(p_extra);
91 SHT_LOOS = 0x60000000,
92 SHT_GNU_verdef = 0x6ffffffd,
93 SHT_GNU_verneed = 0x6ffffffe,
94 SHT_GNU_versym = 0x6fffffff,
95 SHT_HIOS = 0x6fffffff,
97 SHT_LOPROC = 0x70000000,
98 SHT_HIPROC = 0x7fffffff,
99 SHT_LOUSER = 0x80000000,
100 SHT_HIUSER = 0xffffffff
108 SHF_EXECINSTR= (1 << 2),
110 SHF_STRINGS= (1 << 5),
111 SHF_INFO_LINK= (1 << 6),
112 SHF_LINK_ORDER= (1 << 7),
113 SHF_OS_NONCONFORMING=(1 << 8),
116 SHF_MASKOS= 0x0ff00000,
117 SHF_MASKPROC= 0xf0000000
129 struct Elf32SectionTableEntry_disk {
138 uint32_t sh_addralign;
141#if !defined(SWIG) && !defined(_MSC_VER)
142 __attribute__((packed))
146 struct Elf64SectionTableEntry_disk {
155 uint64_t sh_addralign;
158#if !defined(SWIG) && !defined(_MSC_VER)
159 __attribute__((packed))
176 unsigned const& get_sh_name()
const;
177 void set_sh_name(
unsigned const&);
196 unsigned long const& get_sh_link()
const;
197 void set_sh_link(
unsigned long const&);
206 unsigned long const& get_sh_info()
const;
207 void set_sh_info(
unsigned long const&);
216 uint64_t
const& get_sh_flags()
const;
217 void set_sh_flags(uint64_t
const&);
226 rose_addr_t
const& get_sh_addr()
const;
227 void set_sh_addr(rose_addr_t
const&);
236 rose_addr_t
const& get_sh_offset()
const;
237 void set_sh_offset(rose_addr_t
const&);
246 rose_addr_t
const& get_sh_size()
const;
247 void set_sh_size(rose_addr_t
const&);
256 rose_addr_t
const& get_sh_addralign()
const;
257 void set_sh_addralign(rose_addr_t
const&);
266 rose_addr_t
const& get_sh_entsize()
const;
267 void set_sh_entsize(rose_addr_t
const&);
276 SgUnsignedCharList
const& get_extra()
const;
277 SgUnsignedCharList& get_extra();
278 void set_extra(SgUnsignedCharList
const&);
305 virtual void dump(FILE*,
const char *prefix, ssize_t idx)
const;
315 void update_from_section(
SgAsmElfSection*) ROSE_DEPRECATED(
"use updateFromSection");
352 virtual std::string
class_name()
const override;
355 virtual VariantT
variantT()
const override;
360 enum { static_variant = V_SgAsmElfSectionTableEntry };
375 static const unsigned pool_size;
377 static std::vector<unsigned char *> pools;
382 static unsigned long initializeStorageClassArray(SgAsmElfSectionTableEntryStorageClass *);
385 static void clearMemoryPool();
386 static void deleteMemoryPool();
389 static void extendMemoryPoolForFileIO();
397 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(
unsigned long);
399 static void resetValidFreepointers();
401 static unsigned long getNumberOfLastValidPointer();
404#if defined(INLINE_FUNCTIONS)
406 inline void *
operator new (
size_t size);
409 void *
operator new (
size_t size);
412 void operator delete (
void* pointer,
size_t size);
415 void operator delete (
void* pointer)
461#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
464 virtual RTIReturnType
roseRTI()
override;
478 virtual const char*
sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
484 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
666 friend class SgAsmElfSectionTableEntryStorageClass;
669 friend class AstSpecificDataManagingClass;
672 friend class AstSpecificDataManagingClassStorageClass;
704#define BUILD_ATERM_SUPPORT 0
705 #if BUILD_ATERM_SUPPORT
706 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
718 virtual ATerm generate_ATerm()
override;
721 virtual void generate_ATerm_Annotation(ATerm & term)
override;
765unsigned long p_sh_link;
769unsigned long p_sh_info;
777rose_addr_t p_sh_addr;
781rose_addr_t p_sh_offset;
785rose_addr_t p_sh_size;
789rose_addr_t p_sh_addralign;
793rose_addr_t p_sh_entsize;
797SgUnsignedCharList p_extra;
Class holding static data and functions supporting File I/O.
Attribute containing a regex expression as a string.
Represents one entry in an ELF section table.
SectionType
Section types (host order).
SectionFlags
Section Flags (host order).
Base class for ELF file sections.
Supporting class from copy mechanism within ROSE.
This class represents the base class for all IR nodes within Sage III.
virtual size_t get_numberOfTraversalSuccessors()
return number of children in the traversal successor list
virtual RTIReturnType roseRTI()
return C++ Runtime-Time-Information
virtual std::vector< std::string > get_traversalSuccessorNamesContainer()
container of names of variables or container indices used used in the traversal to access AST success...
virtual void debugSerializationEnd(const char *className)
Called by generated serializers.
static std::string getNodeIdString(SgNode *sgnode)
compute the NodeId for a particular SgNode*.
virtual bool isInMemoryPool()
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the he...
int variant() const
Older version function returns enum value "NODE".
virtual void processDataMemberReferenceToPointers(ReferenceToPointerHandler *)
FOR INTERNAL USE Processes pairs of references to SgNode* and strings for use in AST tools
virtual VariantT variantT() const
returns new style SageIII enum values
virtual long getChildIndex(SgNode *childNode) const
FOR INTERNAL USE Returns a unique index value for the childNode in the list of children at this IR no...
virtual size_t get_childIndex(SgNode *child)
index-based access to traversal successors by child node
virtual void debugSerializationBegin(const char *className)
Called by generated serializers.
virtual std::vector< SgNode * > get_traversalSuccessorContainer()
container of pointers to AST successor nodes used in the traversal overridden in every class by gener...
virtual std::string class_name() const
returns a string representing the class name
static void visitRepresentativeNode(ROSE_VisitTraversal &visit)
FOR INTERNAL USE Support for type-based traversal.
virtual void checkDataMemberPointersIfInMemoryPool()
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the he...
static size_t numberOfNodes()
Returns the total number of IR nodes of this type.
virtual void accept(ROSE_VisitorPattern &visitor)
support for the classic visitor pattern done in GoF
virtual SgNode * get_traversalSuccessorByIndex(size_t idx)
index-based access to traversal successors by index number
static void traverseMemoryPoolVisitorPattern(ROSE_VisitorPattern &visitor)
FOR INTERNAL USE Support for visitor pattern.
void executeVisitorMemberFunction(ROSE_VisitorPattern &visitor)
FOR INTERNAL USE Support for visitor pattern.
static SgNode * getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx)
Find a node by its variant type, pool index, and item index.
static size_t memoryUsage()
Returns the size in bytes of the total memory allocated for all IR nodes of this type.
static void traverseMemoryPoolNodes(ROSE_VisitTraversal &visit)
FOR INTERNAL USE Support for visitor pattern over all IR nodes by type of IR node.
virtual const char * sage_class_name() const
generates string representing the class name: (e.g. for SgNode returns "SgNode").
virtual std::vector< std::pair< SgNode *, std::string > > returnDataMemberPointers() const
FOR INTERNAL USE Returns STL vector of pairs of SgNode* and strings for use in AST tools
static SgNode * getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx)
FOR INTERNAL USE Find an SgNode from its memory pool and location therin.
SgNode * addRegExpAttribute(std::string s, AstRegExAttribute *a)
Support for AST matching using regular expression.
ROSE_UTIL_API std::string toString(const Path &)
Convert a path to a string.
void serialize(std::ostream &output, Graph &graph)
Serialize a graph into a stream of bytes.
void copy(const Word *src, const BitRange &srcRange, Word *dst, const BitRange &dstRange)
Copy some bits.
const char * SectionType(int64_t)
Convert SgAsmElfSectionTableEntry::SectionType enum constant to a string.
const char * SectionFlags(int64_t)
Convert SgAsmElfSectionTableEntry::SectionFlags enum constant to a string.
File format of an ELF Section header.