summaryrefslogtreecommitdiffstats
path: root/meta-microblaze/recipes-devtools/binutils/binutils/0033-Fix-various-compile-warnings.patch
blob: 7339995e7cc5bba3ed798563573d8d25cf4bfd0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
From d9114e764eb42ae1daaf6af7c2a5e48fc764109d Mon Sep 17 00:00:00 2001
From: Mark Hatle <mark.hatle@kernel.crashing.org>
Date: Fri, 17 Jul 2020 09:20:54 -0500
Subject: [PATCH 33/40] Fix various compile warnings

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
 bfd/elf64-microblaze.c     |  9 +++++----
 gas/config/tc-microblaze.c | 11 +++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/bfd/elf64-microblaze.c b/bfd/elf64-microblaze.c
index b002b414d64..8308f1ebd09 100644
--- a/bfd/elf64-microblaze.c
+++ b/bfd/elf64-microblaze.c
@@ -692,7 +692,7 @@ microblaze_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 /* Set the howto pointer for a RCE ELF reloc.  */
 
 static bfd_boolean
-microblaze_elf_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED,
+microblaze_elf_info_to_howto (bfd * abfd,
 			      arelent * cache_ptr,
 			      Elf_Internal_Rela * dst)
 {
@@ -705,14 +705,14 @@ microblaze_elf_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED,
   r_type = ELF64_R_TYPE (dst->r_info);
   if (r_type >= R_MICROBLAZE_max)
     {
-      (*_bfd_error_handler) (_("%pB: unrecognised MicroBlaze reloc number: %d"),
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
 			     abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       return FALSE;
     }
 
   cache_ptr->howto = microblaze_elf_howto_table [r_type];
- return TRUE;
+  return TRUE;
 }
 
 /* Microblaze ELF local labels start with 'L.' or '$L', not '.L'.  */
@@ -1560,7 +1560,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
 			else
 			  {
 			    BFD_FAIL ();
-			    (*_bfd_error_handler)
+			    _bfd_error_handler
 			      (_("%pB: probably compiled without -fPIC?"),
 			       input_bfd);
 			    bfd_set_error (bfd_error_bad_value);
@@ -2554,6 +2554,7 @@ microblaze_elf_check_relocs (bfd * abfd,
           goto dogottls;
         case R_MICROBLAZE_TLSLD:
           tls_type |= (TLS_TLS | TLS_LD);
+          /* Fall through. */
         dogottls:
           sec->has_tls_reloc = 1;
           /* Fall through. */
diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
index da99d4ef482..62daa56b47a 100644
--- a/gas/config/tc-microblaze.c
+++ b/gas/config/tc-microblaze.c
@@ -1091,7 +1091,6 @@ md_assemble (char * str)
         reg  = is_reg (temp_op_end + 1);
       if (reg) 
 	{
-          
  	  opcode->inst_type=INST_TYPE_RD_R1_IMML;
           opcode->inst_offset_type = OPCODE_MASK_H;
           if (streq (name, "addli"))
@@ -1242,18 +1241,18 @@ md_assemble (char * str)
 	  else if (streq (name, "smi"))
 	    as_fatal (_("smi pseudo instruction should not use a label in imm field"));
           if(streq (name, "lli") || streq (name, "sli"))
-            opc = str_microblaze_64;
+            opc = strdup(str_microblaze_64);
           else if ((microblaze_arch_size == 64) && ((streq (name, "lbui")
 			|| streq (name, "lhui") || streq (name, "lwi") || streq (name, "sbi")
 			|| streq (name, "shi") || streq (name, "swi"))))
 	    {
-              opc = str_microblaze_64;
+              opc = strdup(str_microblaze_64);
 	      subtype = opcode->inst_offset_type;
 	    }
 	  else if (reg2 == REG_ROSDP)
-	    opc = str_microblaze_ro_anchor;
+	    opc = strdup(str_microblaze_ro_anchor);
 	  else if (reg2 == REG_RWSDP)
-	    opc = str_microblaze_rw_anchor;
+	    opc = strdup(str_microblaze_rw_anchor);
 	  else
 	    opc = NULL;
 	  if (exp.X_md != 0)
@@ -1718,7 +1717,7 @@ md_assemble (char * str)
       inst |= (reg1 << RD_LOW) & RD_MASK;
       inst |= (immed << IMM_LOW) & IMM16_MASK;
       break;
-	
+
     case INST_TYPE_R1_RFSL:
       if (strcmp (op_end, ""))
         op_end = parse_reg (op_end + 1, &reg1);  /* Get r1.  */
-- 
2.17.1