def __init__(self, addr, size, perms, filename, offset=<NUM_LIT:0>, overlay=None, **kwargs):
super().__init__(addr, size, perms, **kwargs)<EOL>assert isinstance(offset, int)<EOL>assert offset >= <NUM_LIT:0><EOL>self._filename = filename<EOL>self._offset = offset<EOL>with open(filename, '<STR_LIT:r>') as fileobject:<EOL><INDENT>fileobject.seek(<NUM_LIT:0>, <NUM_LIT:2>)<EOL>file_size = fileobject.tell()<EOL>self._mapped_size = min(size, file_size - offset)<EOL>self._data = mmap(fileobject.fileno(), offset, self._mapped_size)<EOL><DEDENT>if overlay is not None:<EOL><INDENT>self._overlay = dict(overlay)<EOL><DEDENT>else:<EOL><INDENT>self._overlay = dict()<EOL><DEDENT>
Builds a map of memory  initialized with the content of filename.

:param addr: the first valid address of the file map.
:param size: the size of the file map.
:param perms: the access permissions of the file map.
:param filename: the file to map in memory.
:param offset: the offset into the file where to start the mapping. \
        This offset must be a multiple of pagebitsize.