Fixes page-faulting glibc on certain machines (XCC)
[akaros.git] / tools / compilers / gcc-glibc / binutils-2.21.1-objdump.patch
1 diff -u -p -r1.58 syms.c
2 --- binutils-2.21.1/bfd/syms.c  10 Jan 2013 20:03:55 -0000      1.58
3 +++ binutils-2.21.1/bfd/syms.c  3 Jun 2013 04:01:18 -0000
4 @@ -934,7 +934,7 @@ _bfd_stab_section_find_nearest_line (bfd
5    struct stab_find_info *info;
6    bfd_size_type stabsize, strsize;
7    bfd_byte *stab, *str;
8 -  bfd_byte *last_stab = NULL;
9 +  bfd_byte *last_stab, *last_str;
10    bfd_size_type stroff;
11    struct indexentry *indexentry;
12    char *file_name;
13 @@ -1147,8 +1147,9 @@ _bfd_stab_section_find_nearest_line (bfd
14        file_name = NULL;
15        directory_name = NULL;
16        saw_fun = 1;
17 +      stroff = 0;
18  
19 -      for (i = 0, stroff = 0, stab = info->stabs, str = info->strs;
20 +      for (i = 0, last_stab = stab = info->stabs, last_str = str = info->strs;
21            i < info->indextablesize && stab < info->stabs + stabsize;
22            stab += STABSIZE)
23         {
24 @@ -1174,7 +1175,7 @@ _bfd_stab_section_find_nearest_line (bfd
25                 {
26                   info->indextable[i].val = bfd_get_32 (abfd, last_stab + VALOFF);
27                   info->indextable[i].stab = last_stab;
28 -                 info->indextable[i].str = str;
29 +                 info->indextable[i].str = last_str;
30                   info->indextable[i].directory_name = directory_name;
31                   info->indextable[i].file_name = file_name;
32                   info->indextable[i].function_name = NULL;
33 @@ -1192,6 +1193,7 @@ _bfd_stab_section_find_nearest_line (bfd
34               else
35                 {
36                   last_stab = stab;
37 +                 last_str = str;
38                   if (stab + STABSIZE >= info->stabs + stabsize
39                       || *(stab + STABSIZE + TYPEOFF) != (bfd_byte) N_SO)
40                     {
41 @@ -1242,7 +1244,7 @@ _bfd_stab_section_find_nearest_line (bfd
42         {
43           info->indextable[i].val = bfd_get_32 (abfd, last_stab + VALOFF);
44           info->indextable[i].stab = last_stab;
45 -         info->indextable[i].str = str;
46 +         info->indextable[i].str = last_str;
47           info->indextable[i].directory_name = directory_name;
48           info->indextable[i].file_name = file_name;
49           info->indextable[i].function_name = NULL;
50