aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorMarcus Shawcroft <marcus.shawcroft@gmail.com>2015-03-20 20:20:35 +0000
committerMarcus Shawcroft <marcus.shawcroft@arm.com>2015-03-23 16:14:05 +0000
commit13f622ec5967f0a56d5876e7c7305c260cb4928f (patch)
tree084c013d3efc29286919d0dbf131127fabeb8e95 /bfd
parent665856756517ff4eb0c31c07f5c7e1666ccd4445 (diff)
downloadgdb-13f622ec5967f0a56d5876e7c7305c260cb4928f.zip
gdb-13f622ec5967f0a56d5876e7c7305c260cb4928f.tar.gz
gdb-13f622ec5967f0a56d5876e7c7305c260cb4928f.tar.bz2
[AArch64] Factor out _bfd_aarch64_resize_stubs()
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elfnn-aarch64.c36
2 files changed, 30 insertions, 12 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e281c7f..cde4d4c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
+ * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Factor out
+ stub resize code into...
+ (bfd_aarch64_resize_stubs): Define.
+
+2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
+
* elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Factor stub
creation code into...
(bfd_aarch64_create_stub_section): Define.
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 5f80a2d..d5a64b5 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -3118,6 +3118,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
@@ -3453,18 +3476,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)