toDynamicEntryType :: Word64 -> DynamicEntryType
toDynamicEntryType x = case x of
   0               -> DynTypeNone
   1               -> DynTypeNeededLibraryName
   2               -> DynTypePLTRelocSize
   3               -> DynTypePLTGOTAddress
   4               -> DynTypeSymbolHashTableAddress
   5               -> DynTypeStringTableAddress
   6               -> DynTypeSymbolTableAddress
   7               -> DynTypeRelocaAddress
   8               -> DynTypeRelocaSize
   9               -> DynTypeRelocaEntrySize
   10              -> DynTypeStringTableSize
   11              -> DynTypeSymbolEntrySize
   12              -> DynTypeInitFunctionAddress
   13              -> DynTypeFiniFunctionAddress
   14              -> DynTypeSharedObjectName
   15              -> DynTypeLibrarySearchPathOld
   16              -> DynTypeSymbolic
   17              -> DynTypeRelocAddress
   18              -> DynTypeRelocSize
   19              -> DynTypeRelocEntrySize
   20              -> DynTypePLTRelocType
   21              -> DynTypeDebug
   22              -> DynTypeRelocatableText
   23              -> DynTypePLTRelocAddress
   24              -> DynTypeBindNow
   25              -> DynTypeInitFunctionArrayAddress
   26              -> DynTypeFiniFunctionArrayAddress
   27              -> DynTypeInitFunctionArraySize
   28              -> DynTypeFiniFunctionArraySize
   29              -> DynTypeLibrarySearchPath
   30              -> DynTypeFlags
   --32            -> DynTypeEncoding
   32              -> DynTypePreInitFunctionArrayAddress
   33              -> DynTypePreInitFunctionArraySize

   0x6ffffdf5      -> DynTypeGNUPrelinkedTimestamp
   0x6ffffdf6      -> DynTypeGNUConflictSize
   0x6ffffdf7      -> DynTypeGNULibraryListSize
   0x6ffffdf8      -> DynTypeChecksum
   0x6ffffdf9      -> DynTypePLTPaddingSize
   0x6ffffdfa      -> DynTypeMoveEntrySize
   0x6ffffdfb      -> DynTypeMoveSize
   0x6ffffdfc      -> DynTypeFeatureSelection
   0x6ffffdfd      -> DynTypePositionalFlags
   0x6ffffdfe      -> DynTypeSymbolInfoSize
   0x6ffffdff      -> DynTypeSymbolInfoEntrySize

   0x6ffffef5      -> DynTypeGNUHashTableAddress
   0x6ffffef6      -> DynTypeTLSDescPLT
   0x6ffffef7      -> DynTypeTLSDescGOT
   0x6ffffef8      -> DynTypeGNUConflictSection
   0x6ffffef9      -> DynTypeGNULibraryList
   0x6ffffefa      -> DynTypeConfigInfo
   0x6ffffefb      -> DynTypeDependencyAuditing
   0x6ffffefc      -> DynTypeObjectAuditing
   0x6ffffefd      -> DynTypePLTPadding
   0x6ffffefe      -> DynTypeMoveTable
   0x6ffffeff      -> DynTypeSymbolInfoTable

   0x6ffffff0      -> DynTypeSymbolVersion
   0x6ffffff9      -> DynTypeRelocaCount
   0x6ffffffa      -> DynTypeRelocCount
   0x6ffffffb      -> DynTypeStateFlags
   0x6ffffffc      -> DynTypeVersionDefinitionTable
   0x6ffffffd      -> DynTypeVersionDefinitionCount
   0x6ffffffe      -> DynTypeVersionNeededTable
   0x6fffffff      -> DynTypeVersionNeededCount

   0x7ffffffd      -> DynTypeLoadBefore
   0x7fffffff      -> DynTypeGetValuesFrom

   v               -> DynTypeUnknown v


-- | Dynamic entry flags (DynTypeFlags)
toDynamicEntryType :: Word64 -> DynamicEntryType
toDynamicEntryType x = case x of
   0               -> DynTypeNone
   1               -> DynTypeNeededLibraryName
   2               -> DynTypePLTRelocSize
   3               -> DynTypePLTGOTAddress
   4               -> DynTypeSymbolHashTableAddress
   5               -> DynTypeStringTableAddress
   6               -> DynTypeSymbolTableAddress
   7               -> DynTypeRelocaAddress
   8               -> DynTypeRelocaSize
   9               -> DynTypeRelocaEntrySize
   10              -> DynTypeStringTableSize
   11              -> DynTypeSymbolEntrySize
   12              -> DynTypeInitFunctionAddress
   13              -> DynTypeFiniFunctionAddress
   14              -> DynTypeSharedObjectName
   15              -> DynTypeLibrarySearchPathOld
   16              -> DynTypeSymbolic
   17              -> DynTypeRelocAddress
   18              -> DynTypeRelocSize
   19              -> DynTypeRelocEntrySize
   20              -> DynTypePLTRelocType
   21              -> DynTypeDebug
   22              -> DynTypeRelocatableText
   23              -> DynTypePLTRelocAddress
   24              -> DynTypeBindNow
   25              -> DynTypeInitFunctionArrayAddress
   26              -> DynTypeFiniFunctionArrayAddress
   27              -> DynTypeInitFunctionArraySize
   28              -> DynTypeFiniFunctionArraySize
   29              -> DynTypeLibrarySearchPath
   30              -> DynTypeFlags
   --32            -> DynTypeEncoding
   32              -> DynTypePreInitFunctionArrayAddress
   33              -> DynTypePreInitFunctionArraySize

   0x6ffffdf5      -> DynTypeGNUPrelinkedTimestamp
   0x6ffffdf6      -> DynTypeGNUConflictSize
   0x6ffffdf7      -> DynTypeGNULibraryListSize
   0x6ffffdf8      -> DynTypeChecksum
   0x6ffffdf9      -> DynTypePLTPaddingSize
   0x6ffffdfa      -> DynTypeMoveEntrySize
   0x6ffffdfb      -> DynTypeMoveSize
   0x6ffffdfc      -> DynTypeFeatureSelection
   0x6ffffdfd      -> DynTypePositionalFlags
   0x6ffffdfe      -> DynTypeSymbolInfoSize
   0x6ffffdff      -> DynTypeSymbolInfoEntrySize

   0x6ffffef5      -> DynTypeGNUHashTableAddress
   0x6ffffef6      -> DynTypeTLSDescPLT
   0x6ffffef7      -> DynTypeTLSDescGOT
   0x6ffffef8      -> DynTypeGNUConflictSection
   0x6ffffef9      -> DynTypeGNULibraryList
   0x6ffffefa      -> DynTypeConfigInfo
   0x6ffffefb      -> DynTypeDependencyAuditing
   0x6ffffefc      -> DynTypeObjectAuditing
   0x6ffffefd      -> DynTypePLTPadding
   0x6ffffefe      -> DynTypeMoveTable
   0x6ffffeff      -> DynTypeSymbolInfoTable

   0x6ffffff0      -> DynTypeSymbolVersion
   0x6ffffff9      -> DynTypeRelocaCount
   0x6ffffffa      -> DynTypeRelocCount
   0x6ffffffb      -> DynTypeStateFlags
   0x6ffffffc      -> DynTypeVersionDefinitionTable
   0x6ffffffd      -> DynTypeVersionDefinitionCount
   0x6ffffffe      -> DynTypeVersionNeededTable
   0x6fffffff      -> DynTypeVersionNeededCount

   0x7ffffffd      -> DynTypeLoadBefore
   0x7fffffff      -> DynTypeGetValuesFrom

   v               -> DynTypeUnknown v


-- | Dynamic entry flags (DynTypeFlags)
toDynamicEntryType x = case x of
   0               -> DynTypeNone
   1               -> DynTypeNeededLibraryName
   2               -> DynTypePLTRelocSize
   3               -> DynTypePLTGOTAddress
   4               -> DynTypeSymbolHashTableAddress
   5               -> DynTypeStringTableAddress
   6               -> DynTypeSymbolTableAddress
   7               -> DynTypeRelocaAddress
   8               -> DynTypeRelocaSize
   9               -> DynTypeRelocaEntrySize
   10              -> DynTypeStringTableSize
   11              -> DynTypeSymbolEntrySize
   12              -> DynTypeInitFunctionAddress
   13              -> DynTypeFiniFunctionAddress
   14              -> DynTypeSharedObjectName
   15              -> DynTypeLibrarySearchPathOld
   16              -> DynTypeSymbolic
   17              -> DynTypeRelocAddress
   18              -> DynTypeRelocSize
   19              -> DynTypeRelocEntrySize
   20              -> DynTypePLTRelocType
   21              -> DynTypeDebug
   22              -> DynTypeRelocatableText
   23              -> DynTypePLTRelocAddress
   24              -> DynTypeBindNow
   25              -> DynTypeInitFunctionArrayAddress
   26              -> DynTypeFiniFunctionArrayAddress
   27              -> DynTypeInitFunctionArraySize
   28              -> DynTypeFiniFunctionArraySize
   29              -> DynTypeLibrarySearchPath
   30              -> DynTypeFlags
   --32            -> DynTypeEncoding
   32              -> DynTypePreInitFunctionArrayAddress
   33              -> DynTypePreInitFunctionArraySize

   0x6ffffdf5      -> DynTypeGNUPrelinkedTimestamp
   0x6ffffdf6      -> DynTypeGNUConflictSize
   0x6ffffdf7      -> DynTypeGNULibraryListSize
   0x6ffffdf8      -> DynTypeChecksum
   0x6ffffdf9      -> DynTypePLTPaddingSize
   0x6ffffdfa      -> DynTypeMoveEntrySize
   0x6ffffdfb      -> DynTypeMoveSize
   0x6ffffdfc      -> DynTypeFeatureSelection
   0x6ffffdfd      -> DynTypePositionalFlags
   0x6ffffdfe      -> DynTypeSymbolInfoSize
   0x6ffffdff      -> DynTypeSymbolInfoEntrySize

   0x6ffffef5      -> DynTypeGNUHashTableAddress
   0x6ffffef6      -> DynTypeTLSDescPLT
   0x6ffffef7      -> DynTypeTLSDescGOT
   0x6ffffef8      -> DynTypeGNUConflictSection
   0x6ffffef9      -> DynTypeGNULibraryList
   0x6ffffefa      -> DynTypeConfigInfo
   0x6ffffefb      -> DynTypeDependencyAuditing
   0x6ffffefc      -> DynTypeObjectAuditing
   0x6ffffefd      -> DynTypePLTPadding
   0x6ffffefe      -> DynTypeMoveTable
   0x6ffffeff      -> DynTypeSymbolInfoTable

   0x6ffffff0      -> DynTypeSymbolVersion
   0x6ffffff9      -> DynTypeRelocaCount
   0x6ffffffa      -> DynTypeRelocCount
   0x6ffffffb      -> DynTypeStateFlags
   0x6ffffffc      -> DynTypeVersionDefinitionTable
   0x6ffffffd      -> DynTypeVersionDefinitionCount
   0x6ffffffe      -> DynTypeVersionNeededTable
   0x6fffffff      -> DynTypeVersionNeededCount

   0x7ffffffd      -> DynTypeLoadBefore
   0x7fffffff      -> DynTypeGetValuesFrom

   v               -> DynTypeUnknown v


-- | Dynamic entry flags (DynTypeFlags)