summaryrefslogtreecommitdiff
path: root/bfd/elf32-hppa.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2003-02-08 08:18:41 +0000
committerAlan Modra <amodra@bigpond.net.au>2003-02-08 08:18:41 +0000
commita65939673abb09b36a5be50316af7ba0764f1367 (patch)
treec49fef7bf3f84d793f2de82378998b528802fd3a /bfd/elf32-hppa.c
parent07c4b486076615ed5b6451c82c2c5d8558a8702e (diff)
downloadbinutils-redhat-a65939673abb09b36a5be50316af7ba0764f1367.tar.gz
* elf32-hppa.c (group_sections): Don't share a stub section if
stubs are for a large section.
Diffstat (limited to 'bfd/elf32-hppa.c')
-rw-r--r--bfd/elf32-hppa.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 69ead0dbf4..80e8b1861c 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -2686,12 +2686,15 @@ group_sections (htab, stub_group_size, stubs_always_before_branch)
asection *curr;
asection *prev;
bfd_size_type total;
+ bfd_boolean big_sec;
curr = tail;
if (tail->_cooked_size)
total = tail->_cooked_size;
else
total = tail->_raw_size;
+ big_sec = total >= stub_group_size;
+
while ((prev = PREV_SEC (curr)) != NULL
&& ((total += curr->output_offset - prev->output_offset)
< stub_group_size))
@@ -2719,8 +2722,11 @@ group_sections (htab, stub_group_size, stubs_always_before_branch)
while (tail != curr && (tail = prev) != NULL);
/* But wait, there's more! Input sections up to 240000
- bytes before the stub section can be handled by it too. */
- if (!stubs_always_before_branch)
+ 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
+ branches may not reach into the stub section. */
+ if (!stubs_always_before_branch && !big_sec)
{
total = 0;
while (prev != NULL