'Get headers information of Shared Object Libraries linked to target
Args:
- solib: shared library name (String)
- name: specific header name (String)
Returns:
- dictionary of headers {name(String): start(Int), end(Int), type(String))'

@memoized
def elfheader_solib(self, solib=None, name=None):

    header_type = {'code': ['.text', '.fini', '.init', '.plt', '__libc_freeres_fn'], 'data': ['.dynamic', '.data', '.ctors', '.dtors', '.jrc', '.got', '.got.plt', '.bss', '.tdata', '.tbss', '.data.rel.ro', '.fini_array', '__libc_subfreeres', '__libc_thread_subfreeres']}
    @memoized
    def _elfheader_solib_all():
        out = self.execute_redirect('info    files')
        if (not out):
            return None
        p = re.compile('[^\n]*\\s*(0x[^    ]*)    -    (0x[^    ]*)    is    (\\.[^    ]*)    in    (.*)')
        soheaders = p.findall(out)
        result = []
        for (start, end, hname, libname) in soheaders:
            (start, end) = (to_int(start), to_int(end))
            result += [(start, end, hname, os.path.realpath(libname))]
        return result
    elfinfo = {}
    headers = _elfheader_solib_all()
    if (not headers):
        return {}
    if (solib is None):
        return headers
    vmap = self.get_vmmap(solib)
    elfbase = (vmap[0][0] if vmap else 0)
    for (start, end, hname, libname) in headers:
        if (solib in libname):
            if (start < elfbase):
                start += elfbase
            if (end < elfbase):
                end += elfbase
            htype = 'rodata'
            if (hname in header_type['code']):
                htype = 'code'
            elif (hname in header_type['data']):
                htype = 'data'
            elfinfo[hname.strip()] = (start, end, htype)
    result = {}
    if (name is None):
        result = elfinfo
    elif (name in elfinfo):
        result[name] = elfinfo[name]
    else:
        for (k, v) in elfinfo.items():
            if (name in k):
                result[k] = v
    return result
