sim: callback: add human readable strings for debugging to maps
[deliverable/binutils-gdb.git] / bfd / syms.c
index 0b0d26ded606bed121789b225c8d938a79663325..9d7a1f43c136f4f3385093851685526db89da459 100644 (file)
@@ -1192,7 +1192,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
                {
                  nul_fun = stab;
                  nul_str = str;
-                 if (file_name >= (char *) info->strs + strsize)
+                 if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
                    file_name = NULL;
                  if (stab + STABSIZE + TYPEOFF < info->stabs + stabsize
                      && *(stab + STABSIZE + TYPEOFF) == (bfd_byte) N_SO)
@@ -1203,7 +1203,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
                      directory_name = file_name;
                      file_name = ((char *) str
                                   + bfd_get_32 (abfd, stab + STRDXOFF));
-                     if (file_name >= (char *) info->strs + strsize)
+                     if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
                        file_name = NULL;
                    }
                }
@@ -1213,7 +1213,8 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
              /* The name of an include file.  */
              file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
              /* PR 17512: file: 0c680a1f.  */
-             if (file_name >= (char *) info->strs + strsize)
+             /* PR 17512: file: 5da8aec4.  */
+             if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
                file_name = NULL;
              break;
 
@@ -1331,7 +1332,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
          if (val <= offset)
            {
              file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
-             if (file_name >= (char *) info->strs + strsize)
+             if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
                file_name = NULL;
              *pline = 0;
            }
This page took 0.024615 seconds and 4 git commands to generate.