Blob Blame History Raw
--- binutils.orig/bfd/elf64-ppc.c	2017-03-08 13:43:51.185482217 +0000
+++ binutils-2.27/bfd/elf64-ppc.c	2017-03-08 13:44:28.403034088 +0000
@@ -12514,7 +12514,10 @@ ppc64_elf_size_stubs (struct bfd_link_in
 	   stub_sec = stub_sec->next)
 	if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
 	  {
-	    stub_sec->rawsize = stub_sec->size;
+           if (htab->stub_iteration <= STUB_SHRINK_ITER
+               || stub_sec->rawsize < stub_sec->size)
+             /* Past STUB_SHRINK_ITER, rawsize is the max size seen.  */
+             stub_sec->rawsize = stub_sec->size;
 	    stub_sec->size = 0;
 	    stub_sec->reloc_count = 0;
 	    stub_sec->flags &= ~SEC_RELOC;