diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 32 |
2 files changed, 29 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index bc12f9f..f15e157 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ 2009-03-05 Christophe Lyon <christophe.lyon@st.com> + * elf32-arm.c (group_sections): Take next section size into + account before accepting to group it. + +2009-03-05 Christophe Lyon <christophe.lyon@st.com> + * elf32-arm.c (arm_type_of_stub): Handle long branches targetting PLT entries. (elf32_arm_final_link_relocate): Likewise. diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 607ba04..f534290 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -3554,11 +3554,20 @@ group_sections (struct elf32_arm_link_hash_table *htab, bfd_size_type total; curr = head; - total = head->size; - while ((next = NEXT_SEC (curr)) != NULL - && ((total += next->output_offset - curr->output_offset) - < stub_group_size)) + total = 0; + while ((next = NEXT_SEC (curr)) != NULL) + { + if ( (total + next->output_offset - curr->output_offset + + next->size) + < stub_group_size ) + { + total += next->output_offset - curr->output_offset; + } + else + break; + curr = next; + } /* OK, the size from the start to the start of CURR is less than stub_group_size and thus can be handled by one stub @@ -3579,11 +3588,18 @@ group_sections (struct elf32_arm_link_hash_table *htab, bytes after the stub section can be handled by it too. */ if (!stubs_always_after_branch) { - total = 0; - while (next != NULL - && ((total += next->output_offset - head->output_offset) - < stub_group_size)) + total = head->size; + while (next != NULL) { + if ( (total + next->output_offset - head->output_offset + + next->size) + < stub_group_size ) + { + total += next->output_offset - head->output_offset; + } + else + break; + head = next; next = NEXT_SEC (head); htab->stub_group[head->id].link_sec = curr; |