{
struct ppc_link_hash_table *htab;
asection *osec;
- bfd_size_type stub14_group_size;
bfd_boolean suppress_size_errors;
htab = ppc_hash_table (info);
return FALSE;
suppress_size_errors = FALSE;
- stub14_group_size = stub_group_size >> 10;
if (stub_group_size == 1)
{
/* Default values. */
if (stubs_always_before_branch)
- {
- stub_group_size = 0x1e00000;
- stub14_group_size = 0x7800;
- }
+ stub_group_size = 0x1e00000;
else
- {
- stub_group_size = 0x1c00000;
- stub14_group_size = 0x7000;
- }
+ stub_group_size = 0x1c00000;
suppress_size_errors = TRUE;
}
bfd_boolean big_sec;
bfd_vma curr_toc;
struct map_stub *group;
+ bfd_size_type group_size;
curr = tail;
total = tail->size;
- big_sec = total > (ppc64_elf_section_data (tail) != NULL
- && ppc64_elf_section_data (tail)->has_14bit_branch
- ? stub14_group_size : stub_group_size);
+ group_size = (ppc64_elf_section_data (tail) != NULL
+ && ppc64_elf_section_data (tail)->has_14bit_branch
+ ? stub_group_size >> 10 : stub_group_size);
+
+ big_sec = total > group_size;
if (big_sec && !suppress_size_errors)
(*_bfd_error_handler) (_("%B section %A exceeds stub group size"),
tail->owner, tail);
&& ((total += curr->output_offset - prev->output_offset)
< (ppc64_elf_section_data (prev) != NULL
&& ppc64_elf_section_data (prev)->has_14bit_branch
- ? stub14_group_size : stub_group_size))
+ ? (group_size = stub_group_size >> 10) : group_size))
&& htab->sec_info[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
+ than 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. */
+ 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. */
group = bfd_alloc (curr->owner, sizeof (*group));
if (group == NULL)
return FALSE;
}
while (tail != curr && (tail = prev) != NULL);
- /* But wait, there's more! Input sections up to stub_group_size
+ /* But wait, there's more! Input sections up to group_size
bytes before the stub section can be handled by it too.
Don't do this if we have a really large section after the
stubs, as adding more stubs increases the chance that
&& ((total += tail->output_offset - prev->output_offset)
< (ppc64_elf_section_data (prev) != NULL
&& ppc64_elf_section_data (prev)->has_14bit_branch
- ? stub14_group_size : stub_group_size))
+ ? (group_size = stub_group_size >> 10) : group_size))
&& htab->sec_info[prev->id].toc_off == curr_toc)
{
tail = prev;