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