]> git.alrj.org Git - bold.git/blob - Bold/BinArray.py
First support for .gnu.hash/DT_GNU_HASH.
[bold.git] / Bold / BinArray.py
1 # -*- coding: utf-8 -*-
2 # kate: space-indent on; indent-width 2; mixedindent off; indent-mode python;
3
4 # Copyright (C) 2009 Amand 'alrj' Tihon <amand.tihon@alrj.org>
5 #
6 # This file is part of bold, the Byte Optimized Linker.
7 #
8 # You can redistribute this file and/or modify it under the terms of the
9 # GNU General Public License as published by the Free Software Foundation,
10 # either version 3 of the License or (at your option) any later version.
11
12 from array import array
13 import struct
14
15 class BinArray(array):
16   """A specialized array that contains bytes"""
17   def __new__(cls, data=None):
18     if data:
19       return array.__new__(BinArray, "B", data)
20     else:
21       return array.__new__(BinArray, "B")