Index: bfd/elf32-arm.c =================================================================== RCS file: /cvs/src/src/bfd/elf32-arm.c,v --- bfd/elf32-arm.c 28 Dec 2009 18:55:16 -0000 1.218 +++ bfd/elf32-arm.c 13 Jan 2010 04:26:16 -0000 @@ -3931,8 +3931,7 @@ cortex_a8_erratum_scan (bfd *input_bfd, unsigned int *a8_fix_table_size_p, struct a8_erratum_reloc *a8_relocs, unsigned int num_a8_relocs, - unsigned prev_num_a8_fixes, - bfd_boolean *stub_changed_p) + unsigned prev_num_a8_fixes) { asection *section; struct elf32_arm_link_hash_table *htab = elf32_arm_hash_table (info); @@ -4168,7 +4167,6 @@ cortex_a8_erratum_scan (bfd *input_bfd, { free (stub_name); stub_name = NULL; - *stub_changed_p = TRUE; } } @@ -4292,7 +4290,6 @@ elf32_arm_size_stubs (bfd *output_bfd, bfd *input_bfd; unsigned int bfd_indx; asection *stub_sec; - bfd_boolean stub_changed = FALSE; unsigned prev_num_a8_fixes = num_a8_fixes; num_a8_fixes = 0; @@ -4572,8 +4569,6 @@ elf32_arm_size_stubs (bfd *output_bfd, else sprintf (stub_entry->output_name, STUB_ENTRY_NAME, sym_name); - - stub_changed = TRUE; } while (0); @@ -4633,19 +4628,13 @@ elf32_arm_size_stubs (bfd *output_bfd, if (cortex_a8_erratum_scan (input_bfd, info, &a8_fixes, &num_a8_fixes, &a8_fix_table_size, a8_relocs, num_a8_relocs, - prev_num_a8_fixes, &stub_changed) + prev_num_a8_fixes) != 0) goto error_ret_free_local; } } - if (prev_num_a8_fixes != num_a8_fixes) - stub_changed = TRUE; - - if (!stub_changed) - break; - - /* OK, we've added some stubs. Find out the new size of the + /* We may have added some stubs. Find out the new size of the stub sections. */ for (stub_sec = htab->stub_bfd->sections; stub_sec != NULL; @@ -4655,6 +4644,7 @@ elf32_arm_size_stubs (bfd *output_bfd, if (!strstr (stub_sec->name, STUB_SUFFIX)) continue; + stub_sec->rawsize = stub_sec->size; stub_sec->size = 0; } @@ -4675,6 +4665,19 @@ elf32_arm_size_stubs (bfd *output_bfd, NULL); } + for (stub_sec = htab->stub_bfd->sections; + stub_sec != NULL; + stub_sec = stub_sec->next) + { + if (!strstr (stub_sec->name, STUB_SUFFIX)) + continue; + + if (stub_sec->rawsize != stub_sec->size) + break; + } + + if (stub_sec == NULL) + break; /* Ask the linker to do its stuff. */ (*htab->layout_sections_again) ();