'Loads the PLT symbols
>>> path = pwnlib.data.elf.path
>>> for test in glob(os.path.join(path, \'test-*\')):
...     test = ELF(test)
...     assert \'__stack_chk_fail\' in test.got, test
...     if test.arch != \'ppc\':
...         assert \'__stack_chk_fail\' in test.plt, test'

def _populate_plt(self):

    if self.statically_linked:
        log.debug(('%r    is    statically    linked,    skipping    GOT/PLT    symbols' % self.path))
        return
    if (not self.got):
        log.debug(("%r    doesn't    have    any    GOT    symbols,    skipping    PLT" % self.path))
        return
    dt_pltgot = (self.dynamic_value_by_tag('DT_PLTGOT') or 0)
    plt = self.get_section_by_name('.plt')
    plt_got = self.get_section_by_name('.plt.got')
    plt_mips = self.get_section_by_name('.MIPS.stubs')
    inv_symbols = {v: k for (k, v) in self.got.items()}
    inv_symbols.update({v: k for (k, v) in self.symbols.items()})
    with context.local(arch=self.arch, bits=self.bits, endian=self.endian):
        for section in (plt, plt_got, plt_mips):
            if (not section):
                continue
            res = emulate_plt_instructions(self, dt_pltgot, section.header.sh_addr, section.data(), inv_symbols)
            for (address, target) in reversed(sorted(res.items())):
                self.plt[inv_symbols[target]] = address
    for (a, n) in sorted({v: k for (k, v) in self.plt.items()}.items()):
        log.debug('PLT    %#x    %s', a, n)
