gdb: fix vfork with multiple threads
[deliverable/binutils-gdb.git] / bfd / elfnn-aarch64.c
index e2b1de78789b42e685322b95f31891b6837db0d9..b6f083e430bb51e6930d4663f60362079101511c 100644 (file)
@@ -3423,7 +3423,7 @@ elfNN_aarch64_setup_section_lists (bfd *output_bfd,
   struct elf_aarch64_link_hash_table *htab =
     elf_aarch64_hash_table (info);
 
-  if (!is_elf_hash_table (htab))
+  if (!is_elf_hash_table (&htab->root.root))
     return 0;
 
   /* Count the number of input BFDs and find the top input section id.  */
@@ -8012,34 +8012,42 @@ elfNN_aarch64_maybe_function_sym (const asymbol *sym, asection *sec,
                                  bfd_vma *code_off)
 {
   bfd_size_type size;
+  elf_symbol_type * elf_sym = (elf_symbol_type *) sym;
 
   if ((sym->flags & (BSF_SECTION_SYM | BSF_FILE | BSF_OBJECT
                     | BSF_THREAD_LOCAL | BSF_RELC | BSF_SRELC)) != 0
       || sym->section != sec)
     return 0;
 
+  size = (sym->flags & BSF_SYNTHETIC) ? 0 : elf_sym->internal_elf_sym.st_size;
+  
   if (!(sym->flags & BSF_SYNTHETIC))
-    switch (ELF_ST_TYPE (((elf_symbol_type *) sym)->internal_elf_sym.st_info))
+    switch (ELF_ST_TYPE (elf_sym->internal_elf_sym.st_info))
       {
-       case STT_FUNC:
        case STT_NOTYPE:
+         /* Ignore symbols created by the annobin plugin for gcc and clang.
+            These symbols are hidden, local, notype and have a size of 0.  */
+         if (size == 0
+             && sym->flags & BSF_LOCAL
+             && ELF_ST_VISIBILITY (elf_sym->internal_elf_sym.st_other) == STV_HIDDEN)
+           return 0;
+         /* Fall through.  */
+       case STT_FUNC:
+         /* FIXME: Allow STT_GNU_IFUNC as well ?  */
          break;
        default:
          return 0;
       }
-
+  
   if ((sym->flags & BSF_LOCAL)
       && bfd_is_aarch64_special_symbol_name (sym->name,
                                             BFD_AARCH64_SPECIAL_SYM_TYPE_ANY))
     return 0;
 
   *code_off = sym->value;
-  size = 0;
-  if (!(sym->flags & BSF_SYNTHETIC))
-    size = ((elf_symbol_type *) sym)->internal_elf_sym.st_size;
-  if (size == 0)
-    size = 1;
-  return size;
+
+  /* Do not return 0 for the function's size.  */
+  return size ? size : 1;
 }
 
 static bool
This page took 0.023682 seconds and 4 git commands to generate.