005-readelf_fixes.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. --- a/src/mklibs-readelf/main.cpp
  2. +++ b/src/mklibs-readelf/main.cpp
  3. @@ -57,6 +57,10 @@ static void process_elf_header (Elf::fil
  4. static void process_dynamics (Elf::file *file, int64_t tag)
  5. {
  6. const Elf::section_type<Elf::section_type_DYNAMIC> *section = file->get_section_DYNAMIC ();
  7. +
  8. + if (!section)
  9. + return;
  10. +
  11. for (std::vector<Elf::dynamic *>::const_iterator it = section->get_dynamics ().begin (); it != section->get_dynamics ().end (); ++it)
  12. {
  13. Elf::dynamic *dynamic = *it;
  14. @@ -67,6 +71,9 @@ static void process_dynamics (Elf::file
  15. static void process_symbols_provided (const Elf::section_type<Elf::section_type_DYNSYM> *section)
  16. {
  17. + if (!section)
  18. + return;
  19. +
  20. for (std::vector<Elf::symbol *>::const_iterator it = section->get_symbols ().begin (); it != section->get_symbols ().end (); ++it)
  21. {
  22. const Elf::symbol *symbol = *it;
  23. @@ -95,6 +102,9 @@ static void process_symbols_provided (co
  24. static void process_symbols_undefined (const Elf::section_type<Elf::section_type_DYNSYM> *section)
  25. {
  26. + if (!section)
  27. + return;
  28. +
  29. for (std::vector<Elf::symbol *>::const_iterator it = section->get_symbols ().begin (); it != section->get_symbols ().end (); ++it)
  30. {
  31. const Elf::symbol *symbol = *it;