]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* syms.c (_bfd_stab_section_find_nearest_line): Add last_str
authorAlan Modra <amodra@gmail.com>
Mon, 3 Jun 2013 04:11:09 +0000 (04:11 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 3 Jun 2013 04:11:09 +0000 (04:11 +0000)
var.  Use it with last_stab.

bfd/ChangeLog
bfd/syms.c

index d148669a15b9b58f0363b62e1b73b039d33763ba..1b56e1d03af023b1fb0274f26312b7270cf4ba6e 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-03  Alan Modra  <amodra@gmail.com>
+
+       * syms.c (_bfd_stab_section_find_nearest_line): Add last_str
+       var.  Use it with last_stab.
+
 2013-05-30  Paul Brook  <paul@codesourcery.com>
 
        * bfd-in2.h: Regenerate.
index 98d596ed44f5347af114ba5065e794c9245d982c..9d91d48e96311172105e5c4faf86f8b51154fe86 100644 (file)
@@ -934,7 +934,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
   struct stab_find_info *info;
   bfd_size_type stabsize, strsize;
   bfd_byte *stab, *str;
-  bfd_byte *last_stab = NULL;
+  bfd_byte *last_stab, *last_str;
   bfd_size_type stroff;
   struct indexentry *indexentry;
   char *file_name;
@@ -1147,8 +1147,9 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
       file_name = NULL;
       directory_name = NULL;
       saw_fun = 1;
+      stroff = 0;
 
-      for (i = 0, stroff = 0, stab = info->stabs, str = info->strs;
+      for (i = 0, last_stab = stab = info->stabs, last_str = str = info->strs;
           i < info->indextablesize && stab < info->stabs + stabsize;
           stab += STABSIZE)
        {
@@ -1174,7 +1175,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
                {
                  info->indextable[i].val = bfd_get_32 (abfd, last_stab + VALOFF);
                  info->indextable[i].stab = last_stab;
-                 info->indextable[i].str = str;
+                 info->indextable[i].str = last_str;
                  info->indextable[i].directory_name = directory_name;
                  info->indextable[i].file_name = file_name;
                  info->indextable[i].function_name = NULL;
@@ -1192,6 +1193,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
              else
                {
                  last_stab = stab;
+                 last_str = str;
                  if (stab + STABSIZE >= info->stabs + stabsize
                      || *(stab + STABSIZE + TYPEOFF) != (bfd_byte) N_SO)
                    {
@@ -1242,7 +1244,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
        {
          info->indextable[i].val = bfd_get_32 (abfd, last_stab + VALOFF);
          info->indextable[i].stab = last_stab;
-         info->indextable[i].str = str;
+         info->indextable[i].str = last_str;
          info->indextable[i].directory_name = directory_name;
          info->indextable[i].file_name = file_name;
          info->indextable[i].function_name = NULL;