[AArch64] Remove useless and incorrect assertion
authorJiong Wang <jiong.wang@arm.com>
Mon, 3 Jul 2017 16:15:26 +0000 (17:15 +0100)
committerJiong Wang <jiong.wang@arm.com>
Tue, 4 Jul 2017 08:24:10 +0000 (09:24 +0100)
The outer caller elf_link_output_extsym in elflink.c is a traverse function on
all external symbol, and it will only call *finish_dynamic_symbol if some
conditions is meet.  It is executed conditionally.

If the condition to trigger that assertion is satisified, it then won't satify
the outer check in finish_dynamic_symbol, so *finish_dynamic_symbol won't be
called that the assertion is expected to be dead code.

If elf_link_output_extsym is a traverse function that unconditionally called
on external symbols decided to be exported, then an assertion to make sure these
symbols are in sane status might make sense.

bfd/
        * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
        sanity check at the head of this function.

bfd/ChangeLog
bfd/elfnn-aarch64.c

index b2b028fe59b40422e357851eb0efc6074d93f6ee..810a555484056be5da8fa79dfeb6c5ef39e78fba 100644 (file)
@@ -1,3 +1,8 @@
+2017-07-04  Jiong Wang  <jiong.wang@arm.com>
+
+       * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
+       sanity check at the head of this function.
+
 2017-07-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
index 11954486e16b3a257b483e202b47ccfe1ca802f7..86bae0eaa8eb1462013f3c58e2a6ddffd43dceab 100644 (file)
@@ -8892,13 +8892,6 @@ elfNN_aarch64_finish_dynamic_symbol (bfd *output_bfd,
   struct elf_aarch64_link_hash_table *htab;
   htab = elf_aarch64_hash_table (info);
 
-  /* Sanity check to make sure no unexpected symbol reaches here.  */
-    if (h->dynindx == -1
-       && !h->forced_local
-       && h->root.type != bfd_link_hash_undefweak
-       && bfd_link_pic (info))
-      abort ();
-
   if (h->plt.offset != (bfd_vma) - 1)
     {
       asection *plt, *gotplt, *relplt;