diff options
author | Marcus Shawcroft <marcus.shawcroft@gmail.com> | 2015-03-20 20:20:35 +0000 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2015-03-30 21:38:57 -0700 |
commit | acc982ce8112d018af96048638e17a5ac051a93f (patch) | |
tree | 2236e8ca07672e69eccf798b5f88274073368328 /binutils-2.25/bfd | |
parent | 920ee1c9093537f31c4fe779f96e64aa01c277d4 (diff) | |
download | toolchain_binutils-acc982ce8112d018af96048638e17a5ac051a93f.zip toolchain_binutils-acc982ce8112d018af96048638e17a5ac051a93f.tar.gz toolchain_binutils-acc982ce8112d018af96048638e17a5ac051a93f.tar.bz2 |
[AArch64] Factor out _bfd_aarch64_resize_stubs()
Change-Id: I3e92b1a8cf997ea7eb902bc38d5163cf919789e0
Diffstat (limited to 'binutils-2.25/bfd')
-rw-r--r-- | binutils-2.25/bfd/elfnn-aarch64.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/binutils-2.25/bfd/elfnn-aarch64.c b/binutils-2.25/bfd/elfnn-aarch64.c index b7a3bbe..49a82aa 100644 --- a/binutils-2.25/bfd/elfnn-aarch64.c +++ b/binutils-2.25/bfd/elfnn-aarch64.c @@ -3091,6 +3091,29 @@ erratum_835769_scan (bfd *input_bfd, return TRUE; } + +/* Resize all stub sections. */ + +static void +_bfd_aarch64_resize_stubs (struct elf_aarch64_link_hash_table *htab) +{ + asection *section; + + /* OK, we've added some stubs. Find out the new size of the + stub sections. */ + for (section = htab->stub_bfd->sections; + section != NULL; section = section->next) + { + /* Ignore non-stub sections. */ + if (!strstr (section->name, STUB_SUFFIX)) + continue; + section->size = 0; + } + + bfd_hash_traverse (&htab->stub_hash_table, aarch64_size_one_stub, htab); +} + + /* Determine and set the size of the stub section for a final link. The basic idea here is to examine all the relocations looking for @@ -3426,18 +3449,7 @@ elfNN_aarch64_size_stubs (bfd *output_bfd, if (!stub_changed) break; - /* OK, we've added some stubs. Find out the new size of the - stub sections. */ - for (stub_sec = htab->stub_bfd->sections; - stub_sec != NULL; stub_sec = stub_sec->next) - { - /* Ignore non-stub sections. */ - if (!strstr (stub_sec->name, STUB_SUFFIX)) - continue; - stub_sec->size = 0; - } - - bfd_hash_traverse (&htab->stub_hash_table, aarch64_size_one_stub, htab); + _bfd_aarch64_resize_stubs (htab); /* Add erratum 835769 veneers to stub section sizes too. */ if (htab->fix_erratum_835769) |