summaryrefslogtreecommitdiffstats
path: root/meta-microblaze/recipes-devtools/gdb/gdb/0005-Fix-relaxation-of-assembler-resolved-references.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-microblaze/recipes-devtools/gdb/gdb/0005-Fix-relaxation-of-assembler-resolved-references.patch')
-rw-r--r--meta-microblaze/recipes-devtools/gdb/gdb/0005-Fix-relaxation-of-assembler-resolved-references.patch64
1 files changed, 0 insertions, 64 deletions
diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0005-Fix-relaxation-of-assembler-resolved-references.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0005-Fix-relaxation-of-assembler-resolved-references.patch
deleted file mode 100644
index d851c589..00000000
--- a/meta-microblaze/recipes-devtools/gdb/gdb/0005-Fix-relaxation-of-assembler-resolved-references.patch
+++ /dev/null
@@ -1,64 +0,0 @@
1From 210bb23010e2c3e65f5f54c220d27da0590bab06 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 05/40] Fix relaxation of assembler resolved references
5
6---
7 bfd/elf32-microblaze.c | 41 ++++++++++++++++++++++++++++++++++++++
8 2 files changed, 42 insertions(+)
9
10diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
11index c187d83ee04..dfd82438e35 100644
12--- a/bfd/elf32-microblaze.c
13+++ b/bfd/elf32-microblaze.c
14@@ -1973,6 +1973,47 @@ 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+ val = bfd_get_32 (abfd, ocontents + irelscan->r_offset);
48+ if (val != irelscan->r_addend) {
49+ fprintf(stderr, "%d: CORRUPT relax reloc! %x %lx\n", __LINE__, val, irelscan->r_addend);
50+ }
51+ irelscan->r_addend -= calc_fixup (irelscan->r_addend
52+ + isym->st_value, 0, sec);
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--
632.17.1
64