diff options
Diffstat (limited to 'meta-microblaze/recipes-devtools/gdb/gdb/0022-fixing-the-.bss-relocation-issue.patch')
-rw-r--r-- | meta-microblaze/recipes-devtools/gdb/gdb/0022-fixing-the-.bss-relocation-issue.patch | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0022-fixing-the-.bss-relocation-issue.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0022-fixing-the-.bss-relocation-issue.patch index aa512b87..3bbe2659 100644 --- a/meta-microblaze/recipes-devtools/gdb/gdb/0022-fixing-the-.bss-relocation-issue.patch +++ b/meta-microblaze/recipes-devtools/gdb/gdb/0022-fixing-the-.bss-relocation-issue.patch | |||
@@ -1,35 +1,35 @@ | |||
1 | From 24f96f4e86895b41aae21f775599a857939d002f Mon Sep 17 00:00:00 2001 | 1 | From e9e4d4837cfea27e67fa656ede535f250205eb2c Mon Sep 17 00:00:00 2001 |
2 | From: Nagaraju Mekala <nmekala@xilix.com> | 2 | From: Nagaraju Mekala <nmekala@xilix.com> |
3 | Date: Wed, 24 Oct 2018 12:34:37 +0530 | 3 | Date: Wed, 24 Oct 2018 12:34:37 +0530 |
4 | Subject: [PATCH 22/40] fixing the .bss relocation issue | 4 | Subject: [PATCH 22/52] fixing the .bss relocation issue |
5 | 5 | ||
6 | --- | 6 | --- |
7 | bfd/elf64-microblaze.c | 18 ++++++++++++------ | 7 | bfd/elf64-microblaze.c | 18 ++++++++++++------ |
8 | 1 file changed, 12 insertions(+), 6 deletions(-) | 8 | 1 file changed, 12 insertions(+), 6 deletions(-) |
9 | 9 | ||
10 | diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c | 10 | Index: gdb-9.2/bfd/elf64-microblaze.c |
11 | index b62c47e8514..cb3b40b574c 100644 | 11 | =================================================================== |
12 | --- a/bfd/elf64-microblaze.c | 12 | --- gdb-9.2.orig/bfd/elf64-microblaze.c |
13 | +++ b/bfd/elf64-microblaze.c | 13 | +++ gdb-9.2/bfd/elf64-microblaze.c |
14 | @@ -1482,7 +1482,7 @@ microblaze_elf_relocate_section (bfd *output_bfd, | 14 | @@ -1492,7 +1492,7 @@ microblaze_elf_relocate_section (bfd *ou |
15 | + input_section->output_offset | 15 | + input_section->output_offset |
16 | + offset + INST_WORD_SIZE); | 16 | + offset + INST_WORD_SIZE); |
17 | unsigned long insn = bfd_get_32 (input_bfd, contents + offset +endian); | 17 | unsigned long insn = bfd_get_32 (input_bfd, contents + offset +endian); |
18 | - if (insn == 0xb2000000 || insn == 0xb2ffffff) | 18 | - if (insn == 0xb2000000 || insn == 0xb2ffffff) |
19 | + if ((insn & 0xff000000) == 0xb2000000) | 19 | + if ((insn & 0xff000000) == 0xb2000000) |
20 | { | 20 | { |
21 | insn &= ~0x00ffffff; | 21 | insn &= ~0x00ffffff; |
22 | insn |= (relocation >> 16) & 0xffffff; | 22 | insn |= (relocation >> 16) & 0xffffff; |
23 | @@ -1595,7 +1595,7 @@ microblaze_elf_relocate_section (bfd *output_bfd, | 23 | @@ -1606,7 +1606,7 @@ microblaze_elf_relocate_section (bfd *ou |
24 | + offset + INST_WORD_SIZE); | 24 | + offset + INST_WORD_SIZE); |
25 | } | 25 | } |
26 | unsigned long insn = bfd_get_32 (input_bfd, contents + offset +endian); | 26 | unsigned long insn = bfd_get_32 (input_bfd, contents + offset +endian); |
27 | - if (insn == 0xb2000000 || insn == 0xb2ffffff) | 27 | - if (insn == 0xb2000000 || insn == 0xb2ffffff) |
28 | + if ((insn & 0xff000000) == 0xb2000000) | 28 | + if ((insn & 0xff000000) == 0xb2000000) |
29 | { | 29 | { |
30 | insn &= ~0x00ffffff; | 30 | insn &= ~0x00ffffff; |
31 | insn |= (relocation >> 16) & 0xffffff; | 31 | insn |= (relocation >> 16) & 0xffffff; |
32 | @@ -1709,7 +1709,7 @@ microblaze_bfd_write_imm_value_32 (bfd *abfd, bfd_byte *bfd_addr, bfd_vma val) | 32 | @@ -1735,7 +1735,7 @@ microblaze_bfd_write_imm_value_32 (bfd * |
33 | { | 33 | { |
34 | unsigned long instr = bfd_get_32 (abfd, bfd_addr); | 34 | unsigned long instr = bfd_get_32 (abfd, bfd_addr); |
35 | 35 | ||
@@ -38,7 +38,7 @@ index b62c47e8514..cb3b40b574c 100644 | |||
38 | { | 38 | { |
39 | instr &= ~0x00ffffff; | 39 | instr &= ~0x00ffffff; |
40 | instr |= (val & 0xffffff); | 40 | instr |= (val & 0xffffff); |
41 | @@ -1732,7 +1732,7 @@ microblaze_bfd_write_imm_value_64 (bfd *abfd, bfd_byte *bfd_addr, bfd_vma val) | 41 | @@ -1758,7 +1758,7 @@ microblaze_bfd_write_imm_value_64 (bfd * |
42 | unsigned long instr_lo; | 42 | unsigned long instr_lo; |
43 | 43 | ||
44 | instr_hi = bfd_get_32 (abfd, bfd_addr); | 44 | instr_hi = bfd_get_32 (abfd, bfd_addr); |
@@ -47,7 +47,7 @@ index b62c47e8514..cb3b40b574c 100644 | |||
47 | { | 47 | { |
48 | instr_hi &= ~0x00ffffff; | 48 | instr_hi &= ~0x00ffffff; |
49 | instr_hi |= (val >> 16) & 0xffffff; | 49 | instr_hi |= (val >> 16) & 0xffffff; |
50 | @@ -2225,7 +2225,10 @@ microblaze_elf_relax_section (bfd *abfd, | 50 | @@ -2251,7 +2251,10 @@ microblaze_elf_relax_section (bfd *abfd, |
51 | unsigned long instr_lo = bfd_get_32 (abfd, ocontents | 51 | unsigned long instr_lo = bfd_get_32 (abfd, ocontents |
52 | + irelscan->r_offset | 52 | + irelscan->r_offset |
53 | + INST_WORD_SIZE); | 53 | + INST_WORD_SIZE); |
@@ -59,7 +59,7 @@ index b62c47e8514..cb3b40b574c 100644 | |||
59 | immediate |= (instr_lo & 0x0000ffff); | 59 | immediate |= (instr_lo & 0x0000ffff); |
60 | offset = calc_fixup (irelscan->r_addend, 0, sec); | 60 | offset = calc_fixup (irelscan->r_addend, 0, sec); |
61 | immediate -= offset; | 61 | immediate -= offset; |
62 | @@ -2269,7 +2272,10 @@ microblaze_elf_relax_section (bfd *abfd, | 62 | @@ -2295,7 +2298,10 @@ microblaze_elf_relax_section (bfd *abfd, |
63 | unsigned long instr_lo = bfd_get_32 (abfd, ocontents | 63 | unsigned long instr_lo = bfd_get_32 (abfd, ocontents |
64 | + irelscan->r_offset | 64 | + irelscan->r_offset |
65 | + INST_WORD_SIZE); | 65 | + INST_WORD_SIZE); |
@@ -71,6 +71,3 @@ index b62c47e8514..cb3b40b574c 100644 | |||
71 | immediate |= (instr_lo & 0x0000ffff); | 71 | immediate |= (instr_lo & 0x0000ffff); |
72 | target_address = immediate; | 72 | target_address = immediate; |
73 | offset = calc_fixup (target_address, 0, sec); | 73 | offset = calc_fixup (target_address, 0, sec); |
74 | -- | ||
75 | 2.17.1 | ||
76 | |||