summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/gdb/files/0007-Fix-relaxation-of-assembler-resolved-references.patch
diff options
context:
space:
mode:
authorNathan Rossi <nathan.rossi@xilinx.com>2013-12-16 16:48:36 +1000
committerNathan Rossi <nathan.rossi@xilinx.com>2013-12-16 16:48:36 +1000
commit74f73159e5c659d8ee52a3d48238932b36e4fe93 (patch)
tree824b4a830e733161d055a12d6993dc6c8cd45da3 /recipes-devtools/gdb/files/0007-Fix-relaxation-of-assembler-resolved-references.patch
parent3ec0d044ea0c5fca26eecc0335bb9847871255ea (diff)
downloadmeta-xilinx-74f73159e5c659d8ee52a3d48238932b36e4fe93.tar.gz
gdb: Add MicroBlaze support
* Import Xilinx gdb patches for MicroBlaze * Disable dependence on LTTng-UST for MicroBlaze, it is not supported Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Diffstat (limited to 'recipes-devtools/gdb/files/0007-Fix-relaxation-of-assembler-resolved-references.patch')
-rw-r--r--recipes-devtools/gdb/files/0007-Fix-relaxation-of-assembler-resolved-references.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/recipes-devtools/gdb/files/0007-Fix-relaxation-of-assembler-resolved-references.patch b/recipes-devtools/gdb/files/0007-Fix-relaxation-of-assembler-resolved-references.patch
new file mode 100644
index 00000000..3aaaf0ab
--- /dev/null
+++ b/recipes-devtools/gdb/files/0007-Fix-relaxation-of-assembler-resolved-references.patch
@@ -0,0 +1,62 @@
1From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
2Date: Tue, 14 Feb 2012 01:00:22 +0100
3Subject: Fix relaxation of assembler resolved references
4
5Upstream-Status: Pending
6---
7 bfd/elf32-microblaze.c | 39 +++++++++++++++++++++++++++++++++++++++
8 1 file changed, 39 insertions(+)
9
10diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
11index 365546c..61926a4 100644
12--- a/bfd/elf32-microblaze.c
13+++ b/bfd/elf32-microblaze.c
14@@ -1967,6 +1967,45 @@ microblaze_elf_relax_section (bfd *abfd,
15 irelscanend = irelocs + o->reloc_count;
16 for (irelscan = irelocs; irelscan < irelscanend; irelscan++)
17 {
18+ if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_NONE)
19+ {
20+ unsigned int val;
21+
22+ isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
23+
24+ /* This was a PC-relative instruction that was completely resolved. */
25+ if (ocontents == NULL)
26+ {
27+ if (elf_section_data (o)->this_hdr.contents != NULL)
28+ ocontents = elf_section_data (o)->this_hdr.contents;
29+ else
30+ {
31+ /* We always cache the section contents.
32+ Perhaps, if info->keep_memory is FALSE, we
33+ should free them, if we are permitted to. */
34+
35+ if (o->rawsize == 0)
36+ o->rawsize = o->size;
37+ ocontents = (bfd_byte *) bfd_malloc (o->rawsize);
38+ if (ocontents == NULL)
39+ goto error_return;
40+ if (!bfd_get_section_contents (abfd, o, ocontents,
41+ (file_ptr) 0,
42+ o->rawsize))
43+ goto error_return;
44+ elf_section_data (o)->this_hdr.contents = ocontents;
45+ }
46+ }
47+
48+ irelscan->r_addend -= calc_fixup (irelscan->r_addend
49+ + isym->st_value, sec);
50+ val = bfd_get_32 (abfd, ocontents + irelscan->r_offset);
51+ microblaze_bfd_write_imm_value_32 (abfd, ocontents + irelscan->r_offset,
52+ irelscan->r_addend);
53+ }
54+ if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_64_NONE) {
55+ fprintf(stderr, "Unhandled NONE 64\n");
56+ }
57 if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32)
58 {
59 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
60--
611.7.9.5
62