This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bfd/elf32-arm.c build breakage


On Mon, May 16, 2016 at 11:16:10AM +0100, Thomas Preudhomme wrote:
> Ok, I finally managed to reproduce. I needed to build with -O3. The patch fixes 
> the warning. Let me do a bit more tests and then I'll submit it.

Something like this, I expect.

diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 65b593a..f67c59a 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -5663,6 +5663,15 @@ elf32_arm_size_stubs (bfd *output_bfd,
 		  != 0)
 		goto error_ret_free_local;
 	    }
+
+	  if (local_syms != NULL
+	      && symtab_hdr->contents != (unsigned char *) local_syms)
+	    {
+	      if (!info->keep_memory)
+		free (local_syms);
+	      else
+		symtab_hdr->contents = (unsigned char *) local_syms;
+	    }
 	}
 
       if (prev_num_a8_fixes != num_a8_fixes)
@@ -5694,7 +5703,7 @@ elf32_arm_size_stubs (bfd *output_bfd,
 			 a8_fixes[i].section, htab);
 
 	    if (stub_sec == NULL)
-	      goto error_ret_free_local;
+	      return FALSE;
 
 	    stub_sec->size
 	      += find_stub_size_and_template (a8_fixes[i].stub_type, NULL,

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]