]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Factor out _bfd_aarch64_get_stub_for_link_section.
authorMarcus Shawcroft <marcus.shawcroft@arm.com>
Mon, 2 Mar 2015 12:11:40 +0000 (12:11 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 23 Aug 2017 20:37:13 +0000 (17:37 -0300)
bfd/ChangeLog
bfd/elfnn-aarch64.c

index 506c4dbdd182a31fd82817faa3c44db6cf1bfb20..a32337221bdc7a6ad97a33ed0b6dbdc1eab8376c 100644 (file)
@@ -1,3 +1,9 @@
+2015-03-24  Marcus Shawcroft  <marcus.shawcroft@arm.com>
+
+       * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Factor
+       code into:
+       (_bfd_aarch64_get_stub_for_link_section): Define.
+
 2015-03-24  Marcus Shawcroft  <marcus.shawcroft@arm.com>
 
        * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Adjust
index 8d58ad57d7003279189e9481d7cd88e7a729fbfe..f0a49cd9c1448d3c617a4c22f5b6e9100e00bcae 100644 (file)
@@ -2315,6 +2315,22 @@ _bfd_aarch64_create_stub_section (asection *section,
 }
 
 
+/* Find or create a stub section for a link section.
+
+   Fix or create the stub section used to collect stubs attached to
+   the specified link section.  */
+
+static asection *
+_bfd_aarch64_get_stub_for_link_section (asection *link_section,
+                                       struct elf_aarch64_link_hash_table *htab)
+{
+  if (htab->stub_group[link_section->id].stub_sec == NULL)
+    htab->stub_group[link_section->id].stub_sec
+      = _bfd_aarch64_create_stub_section (link_section, htab);
+  return htab->stub_group[link_section->id].stub_sec;
+}
+
+
 /* Find or create a stub section in the stub group for an input
    section.  */
 
@@ -2322,18 +2338,8 @@ static asection *
 _bfd_aarch64_create_or_find_stub_sec (asection *section,
                                      struct elf_aarch64_link_hash_table *htab)
 {
-  asection *link_sec;
-  asection *stub_sec;
-
-  link_sec = htab->stub_group[section->id].link_sec;
-  BFD_ASSERT (link_sec != NULL);
-  stub_sec = htab->stub_group[link_sec->id].stub_sec;
-  if (stub_sec == NULL)
-    {
-      stub_sec = _bfd_aarch64_create_stub_section (link_sec, htab);
-      htab->stub_group[link_sec->id].stub_sec = stub_sec;
-    }
-  return stub_sec;
+  asection *link_sec = htab->stub_group[section->id].link_sec;
+  return _bfd_aarch64_get_stub_for_link_section (link_sec, htab);
 }