- asection *curr;
- asection *prev;
- bfd_size_type total;
- bfd_boolean big_sec;
- bfd_vma curr_toc;
-
- curr = tail;
- if (tail->_cooked_size)
- total = tail->_cooked_size;
- else
- total = tail->_raw_size;
- big_sec = total >= stub_group_size;
- curr_toc = htab->stub_group[tail->id].toc_off;
-
- while ((prev = PREV_SEC (curr)) != NULL
- && ((total += (curr->output_section->vma
- + curr->output_offset
- - prev->output_section->vma
- - prev->output_offset))
- < stub_group_size)
- && htab->stub_group[prev->id].toc_off == curr_toc)
- curr = prev;
-
- /* OK, the size from the start of CURR to the end is less
- than stub_group_size and thus can be handled by one stub
- section. (or the tail section is itself larger than
- stub_group_size, in which case we may be toast.) We
- should really be keeping track of the total size of stubs
- added here, as stubs contribute to the final output
- section size. That's a little tricky, and this way will
- only break if stubs added make the total size more than
- 2^25, ie. for the default stub_group_size, if stubs total
- more than 2097152 bytes, or nearly 75000 plt call stubs. */
- do