def _parseDynamic(self):
        symtab = self.getSectionBytes('.dynsym')
        if symtab == None:
            return

        while symtab:
            if self.bits == 32:
                newsym = Elf32Symbol()
            elif self.bits == 64:
                newsym = Elf64Symbol()
            else:
                raise Exception('Platform not supported: %d' % (self.bits))
            newsym.vsParse(symtab)
            if newsym.st_name:
                name = self.getStrtabString(newsym.st_name, ".dynstr")
                newsym.setName(name)
            self.dynamic_symbols.append(newsym)
            symtab = symtab[len(newsym):]

        dynbytes = self.getSectionBytes('.dynamic')
        while dynbytes:
            if self.bits == 32:
                dyn = Elf32Dynamic()
            elif self.bits == 64:
                dyn = Elf64Dynamic()
            else:
                raise Exception('Platform not supported: %d' % (self.bits))
            dyn.vsParse(dynbytes)
            if dyn.d_tag in Elf32Dynamic.has_string:
                name = self.getStrtabString(dyn.d_value, ".dynstr")
                dyn.setName(name)

            self.dynamics.append(dyn)
            if dyn.d_tag == DT_NULL: # Represents the end
                break
            dynbytes = dynbytes[len(dyn):]
dataset/ETHPy150Open columbia/libtrack/libtrack/elfmod/Elf/__init__.py/Elf._parseDynamic/original