This revision was automatically updated to reflect the committed changes. Closed by commit rL266316: Find .plt section in object files generated by recent ld (authored by uweigand).
Changed prior to commit: http://reviews.llvm.org/D18973?vs=53288&id=53715#toc Repository: rL LLVM http://reviews.llvm.org/D18973 Files: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp =================================================================== --- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -2611,17 +2611,17 @@ { assert(rel_hdr->sh_type == SHT_RELA || rel_hdr->sh_type == SHT_REL); - // The link field points to the associated symbol table. The info field - // points to the section holding the plt. + // The link field points to the associated symbol table. user_id_t symtab_id = rel_hdr->sh_link; - user_id_t plt_id = rel_hdr->sh_info; // If the link field doesn't point to the appropriate symbol name table then // try to find it by name as some compiler don't fill in the link fields. if (!symtab_id) symtab_id = GetSectionIndexByName(".dynsym"); - if (!plt_id) - plt_id = GetSectionIndexByName(".plt"); + + // Get PLT section. We cannot use rel_hdr->sh_info, since current linkers + // point that to the .got.plt or .got section instead of .plt. + user_id_t plt_id = GetSectionIndexByName(".plt"); if (!symtab_id || !plt_id) return 0;
Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp =================================================================== --- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -2611,17 +2611,17 @@ { assert(rel_hdr->sh_type == SHT_RELA || rel_hdr->sh_type == SHT_REL); - // The link field points to the associated symbol table. The info field - // points to the section holding the plt. + // The link field points to the associated symbol table. user_id_t symtab_id = rel_hdr->sh_link; - user_id_t plt_id = rel_hdr->sh_info; // If the link field doesn't point to the appropriate symbol name table then // try to find it by name as some compiler don't fill in the link fields. if (!symtab_id) symtab_id = GetSectionIndexByName(".dynsym"); - if (!plt_id) - plt_id = GetSectionIndexByName(".plt"); + + // Get PLT section. We cannot use rel_hdr->sh_info, since current linkers + // point that to the .got.plt or .got section instead of .plt. + user_id_t plt_id = GetSectionIndexByName(".plt"); if (!symtab_id || !plt_id) return 0;
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits