[AArch64] Long branch veneer support far symbol defined by --defsym
authorJiong Wang <jiong.wang@arm.com>
Tue, 11 Aug 2015 20:55:52 +0000 (21:55 +0100)
committerJiong Wang <jiong.wang@arm.com>
Tue, 11 Aug 2015 20:55:52 +0000 (21:55 +0100)
2015-08-11  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * bfd/elfnn-aarch64.c (aarch64_type_of_stub): New parameter "sym_sec".
  Loose the check for symbol from ABS section.
  (elfNN_aarch64_size_stubs): Pass sym_sec.

ld/testsuite/
  * ld-aarch64/farcall-b-defsym.s: New test.
  * ld-aarch64/farcall-bl-defsym.s: Likewise.
  * ld-aarch64/farcall-b-defsym.d: New expectation.
  * ld-aarch64/farcall-bl-defsym.d: Likewise.

bfd/ChangeLog
bfd/elfnn-aarch64.c
ld/testsuite/ChangeLog
ld/testsuite/ld-aarch64/aarch64-elf.exp

index e2378fe3d0d5c0b8ac5379842b01d1e6c7345889..f4acd033838928b8797c7ad4a9dfeb61c9d2fff9 100644 (file)
@@ -1,3 +1,9 @@
+2015-08-11  Jiong Wang  <jiong.wang@arm.com>
+
+       * bfd/elfnn-aarch64.c (aarch64_type_of_stub): New parameter "sym_sec".
+       Loose the check for symbol from ABS section.
+       (elfNN_aarch64_size_stubs): Pass sym_sec.
+
 2015-08-11  Jiong Wang  <jiong.wang@arm.com>
 
        PR ld/18668
index 097a275990f1d350be8f68943093926a5c66157a..37fe1a655b5a6955c2ad3d31c601167074c00c03 100644 (file)
@@ -2316,6 +2316,7 @@ static enum elf_aarch64_stub_type
 aarch64_type_of_stub (struct bfd_link_info *info,
                      asection *input_sec,
                      const Elf_Internal_Rela *rel,
+                     asection *sym_sec,
                      unsigned char st_type,
                      struct elf_aarch64_link_hash_entry *hash,
                      bfd_vma destination)
@@ -2327,7 +2328,8 @@ aarch64_type_of_stub (struct bfd_link_info *info,
   enum elf_aarch64_stub_type stub_type = aarch64_stub_none;
   bfd_boolean via_plt_p;
 
-  if (st_type != STT_FUNC)
+  if (st_type != STT_FUNC
+      && (sym_sec != bfd_abs_section_ptr))
     return stub_type;
 
   globals = elf_aarch64_hash_table (info);
@@ -3815,7 +3817,7 @@ elfNN_aarch64_size_stubs (bfd *output_bfd,
 
                  /* Determine what (if any) linker stub is needed.  */
                  stub_type = aarch64_type_of_stub
-                   (info, section, irela, st_type, hash, destination);
+                   (info, section, irela, sym_sec, st_type, hash, destination);
                  if (stub_type == aarch64_stub_none)
                    continue;
 
index 9b16f251f68bc94fb61204c1a7dbe34d82c79728..bb6ece69ca5907e8443ddafebd84f0aac4da477a 100644 (file)
@@ -1,3 +1,10 @@
+2015-08-11  Jiong Wang  <jiong.wang@arm.com>
+
+       * ld-aarch64/farcall-b-defsym.s: New test.
+       * ld-aarch64/farcall-bl-defsym.s: Likewise.
+       * ld-aarch64/farcall-b-defsym.d: New expectation.
+       * ld-aarch64/farcall-bl-defsym.d: Likewise.
+
 2015-08-11  Jiong Wang  <jiong.wang@arm.com>
 
        * ld-aarch64/farcall-b-gsym.s: New test.
index b87b198596a5cf140744dfea473892a06a977420..9554ea186433572aae3d81b5307cc47dbbee6b95 100644 (file)
@@ -127,6 +127,8 @@ run_dump_test "limit-b"
 run_dump_test "limit-bl"
 run_dump_test "farcall-section"
 run_dump_test "farcall-back"
+run_dump_test "farcall-b-defsym"
+run_dump_test "farcall-bl-defsym"
 run_dump_test "farcall-b-gsym"
 run_dump_test "farcall-b-plt"
 run_dump_test "farcall-bl-plt"