+2017-01-20  Jiong Wang <jiong.wang@arm.com>
+
+       * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
+       (elf_backend_hash_symbol): Define.
+
 2017-01-18  Maciej W. Rozycki  <macro@imgtec.com>
 
        PR ld/20828
 
   return stub_name;
 }
 
+/* Return TRUE if symbol H should be hashed in the `.gnu.hash' section.  For
+   executable PLT slots where the executable never takes the address of those
+   functions, the function symbols are not added to the hash table.  */
+
+static bfd_boolean
+elf_aarch64_hash_symbol (struct elf_link_hash_entry *h)
+{
+  if (h->plt.offset != (bfd_vma) -1
+      && !h->def_regular
+      && !h->pointer_equality_needed)
+    return FALSE;
+
+  return _bfd_elf_hash_symbol (h);
+}
+
+
 /* Look up an entry in the stub hash.  Stub entries are cached because
    creating the stub name takes a bit of time.  */
 
 #define elf_backend_got_header_size (GOT_ENTRY_SIZE * 3)
 #define elf_backend_default_execstack  0
 #define elf_backend_extern_protected_data 1
+#define elf_backend_hash_symbol elf_aarch64_hash_symbol
 
 #undef  elf_backend_obj_attrs_section
 #define elf_backend_obj_attrs_section          ".ARM.attributes"
 
+2017-01-20  Jiong Wang  <jiong.wang@arm.com>
+
+       * testsuite/ld-aarch64/aarch64-elf.exp (aarch64elflinktests): New tests.
+       * testsuite/ld-aarch64/func-in-so.s: New test source file.
+       * testsuite/ld-aarch64/func-sym-hash-opt.s: Likewise.
+       * testsuite/ld-aarch64/func-sym-hash-opt.d: New expected test result.
+
 2017-01-20  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * testsuite/ld-elf/eh-frame-hdr.d: Update expected results.
 
     {} "copy-reloc-so.so"}
   {"ld-aarch64/exe with copy relocation" "-e0 tmpdir/copy-reloc-so.so" "" ""
     {copy-reloc-exe.s} {{objdump -R copy-reloc.d}} "copy-reloc"}
+  {"ld-aarch64/so with global func" "-shared" "" "" {func-in-so.s}
+    {} "func-in-so.so"}
+  {"ld-aarch64/func sym hash opt for exe"
+   "-e0 --hash-style=gnu tmpdir/func-in-so.so" "" ""
+    {func-sym-hash-opt.s} {{readelf --dyn-sym func-sym-hash-opt.d}} "hash-opt"}
 }
 
 run_ld_link_tests $aarch64elflinktests
 
--- /dev/null
+       .text
+       .align  2
+       .global dec
+       .type   dec, %function
+dec:
+       ret
 
--- /dev/null
+
+Symbol table '.dynsym' contains .* entries:
+   Num:    Value          Size Type    Bind   Vis      Ndx Name
+     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
+     1: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND dec
+#...
 
--- /dev/null
+       .text
+       .align  2
+       .global main
+       .type   main, %function
+main:
+       bl      dec
+       ret