]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blame - binutils/patches/binutils-2.23.52.0.1-addr2line-dynsymtab.patch0
elfutils: Update to 0.166
[people/arne_f/ipfire-3.x.git] / binutils / patches / binutils-2.23.52.0.1-addr2line-dynsymtab.patch0
CommitLineData
602900c1
MT
1*** ../binutils-2.23.52.0.1.orig/bfd/opncls.c 2013-03-14 11:25:30.338306122 +0000
2--- bfd/opncls.c 2013-03-14 12:20:21.686397360 +0000
3*************** find_separate_debug_file (bfd *abfd, con
4*** 1297,1302 ****
5--- 1297,1304 ----
6 bfd_malloc (strlen (debug_file_directory) + 1
7 + (canon_dirlen > dirlen ? canon_dirlen : dirlen)
8 + strlen (".debug/")
9+ #define FEDORA_LIB_DEBUG_DIR "/usr/lib/debug/"
10+ + strlen (FEDORA_LIB_DEBUG_DIR) + strlen ("usr/")
11 + strlen (base)
12 + 1);
13 if (debugfile == NULL)
14*************** find_separate_debug_file (bfd *abfd, con
15*** 1332,1337 ****
16--- 1334,1359 ----
17 if (check_func (debugfile, crc32))
18 goto found;
19
20+ /* Then try in the global debug dir for Fedora libraries. */
21+ sprintf (debugfile, "%s%s%s", FEDORA_LIB_DEBUG_DIR, dir, base);
22+ if (separate_debug_file_exists (debugfile, crc32))
23+ {
24+ free (base);
25+ free (dir);
26+ free (canon_dir);
27+ return debugfile;
28+ }
29+
30+ /* Then try in the usr subdirectory of the global debug dir for Fedora libraries. */
31+ sprintf (debugfile, "%s/usr%s%s", FEDORA_LIB_DEBUG_DIR, dir, base);
32+ if (separate_debug_file_exists (debugfile, crc32))
33+ {
34+ free (base);
35+ free (dir);
36+ free (canon_dir);
37+ return debugfile;
38+ }
39+
40 /* Then try in the global debugfile directory. */
41 strcpy (debugfile, debug_file_directory);
42 dirlen = strlen (debug_file_directory) - 1;
43*** ../binutils-2.23.52.0.1.orig/bfd/dwarf2.c 2013-03-14 11:25:30.608306129 +0000
44--- bfd/dwarf2.c 2013-03-14 13:14:18.102487075 +0000
45*************** find_line (bfd *abfd,
46*** 3339,3346 ****
47--- 3339,3349 ----
48 struct dwarf2_debug *stash;
49 /* What address are we looking for? */
50 bfd_vma addr;
51+ /* What is the address without relocation ? */
52+ bfd_vma unrelocated_addr;
53 struct comp_unit* each;
54 bfd_vma found = FALSE;
55+ bfd_vma possible_find = FALSE;
56 bfd_boolean do_line;
57
58 *filename_ptr = NULL;
59*************** find_line (bfd *abfd,
60*** 3380,3385 ****
61--- 3383,3394 ----
62 else
63 abort ();
64
65+ /* If we are dealing with PIC code then the debug information
66+ will be based on unrelocated addresses. Since we cannot be
67+ sure if this is a PIC address we test both with and without
68+ relocation. */
69+ unrelocated_addr = addr;
70+
71 if (section->output_section)
72 addr += section->output_section->vma + section->output_offset;
73 else
74*************** find_line (bfd *abfd,
75*** 3442,3447 ****
76--- 3451,3466 ----
77 stash));
78 if (found)
79 goto done;
80+
81+ if (! possible_find)
82+ possible_find = ((each->arange.high == 0
83+ || comp_unit_contains_address (each, unrelocated_addr))
84+ && comp_unit_find_nearest_line (each, unrelocated_addr,
85+ filename_ptr,
86+ functionname_ptr,
87+ linenumber_ptr,
88+ discriminator_ptr,
89+ stash));
90 }
91 }
92
93*************** find_line (bfd *abfd,
94*** 3535,3540 ****
95--- 3554,3569 ----
96 discriminator_ptr,
97 stash));
98
99+ if (! found && ! do_line && ! possible_find)
100+ possible_find = ((each->arange.high == 0
101+ || comp_unit_contains_address (each, unrelocated_addr))
102+ && comp_unit_find_nearest_line (each, unrelocated_addr,
103+ filename_ptr,
104+ functionname_ptr,
105+ linenumber_ptr,
106+ discriminator_ptr,
107+ stash));
108+
109 if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr)
110 == stash->sec->size)
111 {
112*************** find_line (bfd *abfd,
113*** 3552,3557 ****
114--- 3581,3588 ----
115 if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
116 unset_sections (stash);
117
118+ if (! found)
119+ return possible_find;
120 return found;
121 }
122