]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd/
authorRoland McGrath <roland@gnu.org>
Thu, 18 Jul 2013 21:48:10 +0000 (21:48 +0000)
committerRoland McGrath <roland@gnu.org>
Thu, 18 Jul 2013 21:48:10 +0000 (21:48 +0000)
* elf32-arm.c (elf32_arm_stub_long_branch_arm_nacl): New variable.
(elf32_arm_stub_long_branch_arm_nacl_pic): New variable.
(arm_build_one_stub): Increase MAXRELOCS to 3.
(arm_type_of_stub): Use them if GLOBALS->nacl_p.
(struct elf32_arm_link_hash_table): Give add_stub_section member's
pointee type a third argument.
(elf32_arm_create_or_find_stub_sec): Update caller.
(elf32_arm_size_stubs): Update argument type.
* bfd-in.h (elf32_arm_size_stubs): Update decl.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.

ld/
* emultempl/armelf.em (elf32_arm_add_stub_section): Take third
argument ALIGNMENT_POWER, use it instead of constant 3.

ld/testsuite/
* ld-arm/farcall-arm-nacl.d: New file.
* ld-arm/farcall-arm-nacl-pic.d: New file.
* ld-arm/farcall-data-nacl.d: New file.
* ld-arm/arm-elf.exp (armeabitests_common): Add extra element to
"action" lists for those cases to use a different dump file for NaCl
targets.
Massage $armeabitests_common to drop the extra element or the one
before it, depending on [istarget "arm*-*-nacl*"].

* ld-arm/arm-elf.exp (armelftests_common): Move all "Cortex-A8
erratum fix", Thumb-only and interworking cases to ...
(armelftests_nonacl): ... here.
(armeabitests_common): Move all "erratum 760522 fix", Thumb-only
and interworking cases to ...
(armeabitests_nonacl): ... here.

bfd/ChangeLog
bfd/bfd-in.h
bfd/bfd-in2.h
bfd/elf32-arm.c
ld/ChangeLog
ld/emultempl/armelf.em
ld/testsuite/ChangeLog
ld/testsuite/ld-arm/arm-elf.exp
ld/testsuite/ld-arm/farcall-arm-nacl-pic.d [new file with mode: 0644]
ld/testsuite/ld-arm/farcall-arm-nacl.d [new file with mode: 0644]
ld/testsuite/ld-arm/farcall-data-nacl.d [new file with mode: 0644]

index 45d1919a6165e3291a249ae60640c72a4d396877..fb91e5635a5d7fd360c4a13c39d1e007b10f0e5f 100644 (file)
@@ -1,3 +1,17 @@
+2013-07-18  Roland McGrath  <mcgrathr@google.com>
+
+       * elf32-arm.c (elf32_arm_stub_long_branch_arm_nacl): New variable.
+       (elf32_arm_stub_long_branch_arm_nacl_pic): New variable.
+       (arm_build_one_stub): Increase MAXRELOCS to 3.
+       (arm_type_of_stub): Use them if GLOBALS->nacl_p.
+       (struct elf32_arm_link_hash_table): Give add_stub_section member's
+       pointee type a third argument.
+       (elf32_arm_create_or_find_stub_sec): Update caller.
+       (elf32_arm_size_stubs): Update argument type.
+       * bfd-in.h (elf32_arm_size_stubs): Update decl.
+       * bfd-in2.h: Regenerate.
+       * libbfd.h: Regenerate.
+
 2013-05-28  Will Newton  <will.newton@linaro.org>
 
        * elf32-arm.c (elf32_arm_populate_plt_entry): Call
 
 2012-11-19  Joey Ye  <joey.ye@arm.com>
 
-       * elf32-arm.c (elf32_arm_final_link_relocate, 
+       * elf32-arm.c (elf32_arm_final_link_relocate,
        case R_ARM_THM_ALU_PREL_11_0, case R_ARM_THM_PC12): Align address of
        the place being relocated.
        (elf32_arm_final_link_relocate, case R_ARM_THM_PC8): Align address
index a8c2db1daab323c7d6572668a41b09be0e646e0a..fa780d746606c05bf07dd6b5baadbfc969d190cd 100644 (file)
@@ -2,7 +2,7 @@
 
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-   2012 Free Software Foundation, Inc.
+   2012, 2013 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.
 
@@ -909,7 +909,8 @@ extern void elf32_arm_next_input_section
   (struct bfd_link_info *, struct bfd_section *);
 extern bfd_boolean elf32_arm_size_stubs
   (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
-   struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void));
+   struct bfd_section * (*) (const char *, struct bfd_section *, unsigned int),
+   void (*) (void));
 extern bfd_boolean elf32_arm_build_stubs
   (struct bfd_link_info *);
 
@@ -991,4 +992,3 @@ struct coff_comdat_info
 
 extern struct coff_comdat_info *bfd_coff_get_comdat_section
   (bfd *, struct bfd_section *);
-
index e496083d6ebb0842cfe0a7777dc76cdbd18c7134..82f265ef636b12b2b8b45139406dfad90383718d 100644 (file)
@@ -9,7 +9,7 @@
 
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-   2012 Free Software Foundation, Inc.
+   2012, 2013 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.
 
@@ -916,7 +916,8 @@ extern void elf32_arm_next_input_section
   (struct bfd_link_info *, struct bfd_section *);
 extern bfd_boolean elf32_arm_size_stubs
   (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
-   struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void));
+   struct bfd_section * (*) (const char *, struct bfd_section *, unsigned int),
+   void (*) (void));
 extern bfd_boolean elf32_arm_build_stubs
   (struct bfd_link_info *);
 
@@ -998,7 +999,6 @@ struct coff_comdat_info
 
 extern struct coff_comdat_info *bfd_coff_get_comdat_section
   (bfd *, struct bfd_section *);
-
 /* Extracted from init.c.  */
 void bfd_init (void);
 
index 7e87d707ffeb583ed8607edea81777734ad0f9e1..c065945d4c7290532e874141e64131d8cb0f6728 100644 (file)
@@ -2416,6 +2416,33 @@ static const insn_sequence elf32_arm_stub_long_branch_v4t_thumb_tls_pic[] =
   DATA_WORD (0, R_ARM_REL32, -4),    /* dcd  R_ARM_REL32(X) */
 };
 
+/* NaCl ARM -> ARM long branch stub.  */
+static const insn_sequence elf32_arm_stub_long_branch_arm_nacl[] =
+{
+  ARM_INSN (0xe59fc00c),               /* ldr  ip, [pc, #12] */
+  ARM_INSN (0xe3ccc13f),               /* bic  ip, ip, #0xc000000f */
+  ARM_INSN (0xe12fff1c),                /* bx  ip */
+  ARM_INSN (0xe320f000),                /* nop */
+  ARM_INSN (0xe125be70),                /* bkpt        0x5be0 */
+  DATA_WORD (0, R_ARM_ABS32, 0),        /* dcd R_ARM_ABS32(X) */
+  DATA_WORD (0, R_ARM_NONE, 0),         /* .word 0 */
+  DATA_WORD (0, R_ARM_NONE, 0),         /* .word 0 */
+};
+
+/* NaCl ARM -> ARM long branch stub, PIC.  */
+static const insn_sequence elf32_arm_stub_long_branch_arm_nacl_pic[] =
+{
+  ARM_INSN (0xe59fc00c),               /* ldr  ip, [pc, #12] */
+  ARM_INSN (0xe08cc00f),                /* add ip, ip, pc */
+  ARM_INSN (0xe3ccc13f),               /* bic  ip, ip, #0xc000000f */
+  ARM_INSN (0xe12fff1c),                /* bx  ip */
+  ARM_INSN (0xe125be70),                /* bkpt        0x5be0 */
+  DATA_WORD (0, R_ARM_REL32, 8),        /* dcd R_ARM_REL32(X+8) */
+  DATA_WORD (0, R_ARM_NONE, 0),         /* .word 0 */
+  DATA_WORD (0, R_ARM_NONE, 0),         /* .word 0 */
+};
+
+
 /* Cortex-A8 erratum-workaround stubs.  */
 
 /* Stub used for conditional branches (which may be beyond +/-1MB away, so we
@@ -2492,6 +2519,8 @@ static const insn_sequence elf32_arm_stub_a8_veneer_blx[] =
   DEF_STUB(long_branch_thumb_only_pic) \
   DEF_STUB(long_branch_any_tls_pic) \
   DEF_STUB(long_branch_v4t_thumb_tls_pic) \
+  DEF_STUB(long_branch_arm_nacl) \
+  DEF_STUB(long_branch_arm_nacl_pic) \
   DEF_STUB(a8_veneer_b_cond) \
   DEF_STUB(a8_veneer_b) \
   DEF_STUB(a8_veneer_bl) \
@@ -2984,7 +3013,7 @@ struct elf32_arm_link_hash_table
   bfd *stub_bfd;
 
   /* Linker call-backs.  */
-  asection * (*add_stub_section) (const char *, asection *);
+  asection * (*add_stub_section) (const char *, asection *, unsigned int);
   void (*layout_sections_again) (void);
 
   /* Array to keep track of which stub sections have been created, and
@@ -3808,8 +3837,10 @@ arm_type_of_stub (struct bfd_link_info *info,
                ? (r_type == R_ARM_TLS_CALL
                   /* TLS PIC Stub */
                   ? arm_stub_long_branch_any_tls_pic
+                  : globals->nacl_p ? arm_stub_long_branch_arm_nacl_pic
                   : arm_stub_long_branch_any_arm_pic)
                /* non-PIC stubs.  */
+               : globals->nacl_p ? arm_stub_long_branch_arm_nacl
                : arm_stub_long_branch_any_any;
            }
        }
@@ -3946,7 +3977,8 @@ elf32_arm_create_or_find_stub_sec (asection **link_sec_p, asection *section,
 
          memcpy (s_name, link_sec->name, namelen);
          memcpy (s_name + namelen, STUB_SUFFIX, sizeof (STUB_SUFFIX));
-         stub_sec = (*htab->add_stub_section) (s_name, link_sec);
+         stub_sec = (*htab->add_stub_section) (s_name, link_sec,
+                                               htab->nacl_p ? 4 : 3);
          if (stub_sec == NULL)
            return NULL;
          htab->stub_group[link_sec->id].stub_sec = stub_sec;
@@ -4079,6 +4111,10 @@ arm_stub_required_alignment (enum elf32_arm_stub_type stub_type)
     case arm_stub_a8_veneer_blx:
       return 4;
 
+    case arm_stub_long_branch_arm_nacl:
+    case arm_stub_long_branch_arm_nacl_pic:
+      return 16;
+
     default:
       abort ();  /* Should be unreachable.  */
     }
@@ -4088,7 +4124,7 @@ static bfd_boolean
 arm_build_one_stub (struct bfd_hash_entry *gen_entry,
                    void * in_arg)
 {
-#define MAXRELOCS 2
+#define MAXRELOCS 3
   struct elf32_arm_stub_hash_entry *stub_entry;
   struct elf32_arm_link_hash_table *globals;
   struct bfd_link_info *info;
@@ -4900,7 +4936,8 @@ elf32_arm_size_stubs (bfd *output_bfd,
                      bfd *stub_bfd,
                      struct bfd_link_info *info,
                      bfd_signed_vma group_size,
-                     asection * (*add_stub_section) (const char *, asection *),
+                     asection * (*add_stub_section) (const char *, asection *,
+                                                     unsigned int),
                      void (*layout_sections_again) (void))
 {
   bfd_size_type stub_group_size;
index 20c59c77ca67ed30e209fc5ddf9bffcd4639ffd9..b0f237c346ac4ff00c03535e525b17684bcf285d 100644 (file)
@@ -1,3 +1,8 @@
+2013-07-18  Roland McGrath  <mcgrathr@google.com>
+
+       * emultempl/armelf.em (elf32_arm_add_stub_section): Take third
+       argument ALIGNMENT_POWER, use it instead of constant 3.
+
 2013-03-05  Alan Modra  <amodra@gmail.com>
 
        PR ld/15222
index 7f7d2cc00f64f55ca5e920a42d6e13f0b6531f5b..2adddbb964a320055e42f7b5efba204b89e3bb78 100644 (file)
@@ -1,6 +1,6 @@
 # This shell script emits a C file. -*- C -*-
 #   Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-#   2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+#   2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
 #   Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
@@ -74,8 +74,8 @@ arm_elf_before_allocation (void)
       /* Here we rummage through the found bfds to collect glue information.  */
       LANG_FOR_EACH_INPUT_STATEMENT (is)
        {
-          /* Initialise mapping tables for code/data.  */
-          bfd_elf32_arm_init_maps (is->the_bfd);
+         /* Initialise mapping tables for code/data.  */
+         bfd_elf32_arm_init_maps (is->the_bfd);
 
          if (!bfd_elf32_arm_process_before_allocation (is->the_bfd,
                                                        &link_info)
@@ -185,7 +185,8 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp)
 
 static asection *
 elf32_arm_add_stub_section (const char *stub_sec_name,
-                           asection *input_section)
+                           asection *input_section,
+                           unsigned int alignment_power)
 {
   asection *stub_sec;
   flagword flags;
@@ -201,7 +202,7 @@ elf32_arm_add_stub_section (const char *stub_sec_name,
   if (stub_sec == NULL)
     goto err_ret;
 
-  bfd_set_section_alignment (stub_file->the_bfd, stub_sec, 3);
+  bfd_set_section_alignment (stub_file->the_bfd, stub_sec, alignment_power);
 
   output_section = input_section->output_section;
   secname = bfd_get_section_name (output_section->owner, output_section);
@@ -280,7 +281,7 @@ gld${EMULATION_NAME}_after_allocation (void)
         the unwind table index.  */
       unsigned int list_size = 10;
       asection **sec_list = (asection **)
-          xmalloc (list_size * sizeof (asection *));
+         xmalloc (list_size * sizeof (asection *));
       unsigned int sec_count = 0;
 
       LANG_FOR_EACH_INPUT_STATEMENT (is)
@@ -307,7 +308,7 @@ gld${EMULATION_NAME}_after_allocation (void)
                    {
                      list_size *= 2;
                      sec_list = (asection **)
-                          xrealloc (sec_list, list_size * sizeof (asection *));
+                         xrealloc (sec_list, list_size * sizeof (asection *));
                    }
 
                  sec_list[sec_count++] = sec;
@@ -373,9 +374,9 @@ gld${EMULATION_NAME}_finish (void)
   {
     LANG_FOR_EACH_INPUT_STATEMENT (is)
       {
-        /* Figure out where VFP11 erratum veneers (and the labels returning
-           from same) have been placed.  */
-        bfd_elf32_arm_vfp11_fix_veneer_locations (is->the_bfd, &link_info);
+       /* Figure out where VFP11 erratum veneers (and the labels returning
+          from same) have been placed.  */
+       bfd_elf32_arm_vfp11_fix_veneer_locations (is->the_bfd, &link_info);
       }
   }
 
@@ -470,13 +471,13 @@ arm_elf_create_output_section_statements (void)
                                   fix_arm1176);
 
   stub_file = lang_add_input_file ("linker stubs",
-                                  lang_input_file_is_fake_enum,
-                                  NULL);
+                                  lang_input_file_is_fake_enum,
+                                  NULL);
   stub_file->the_bfd = bfd_create ("linker stubs", link_info.output_bfd);
   if (stub_file->the_bfd == NULL
       || ! bfd_set_arch_mach (stub_file->the_bfd,
-                             bfd_get_arch (link_info.output_bfd),
-                             bfd_get_mach (link_info.output_bfd)))
+                             bfd_get_arch (link_info.output_bfd),
+                             bfd_get_mach (link_info.output_bfd)))
     {
       einfo ("%X%P: can not create BFD %E\n");
       return;
@@ -577,13 +578,13 @@ PARSE_AND_LIST_OPTIONS='
   fprintf (file, _("  --pic-veneer                Always generate PIC interworking veneers\n"));
   fprintf (file, _("\
   --stub-group-size=N         Maximum size of a group of input sections that\n\
-                               can be handled by one stub section.  A negative\n\
-                               value locates all stubs after their branches\n\
-                               (with a group size of -N), while a positive\n\
-                               value allows two groups of input sections, one\n\
-                               before, and one after each stub section.\n\
-                               Values of +/-1 indicate the linker should\n\
-                               choose suitable defaults.\n"));
+                              can be handled by one stub section.  A negative\n\
+                              value locates all stubs after their branches\n\
+                              (with a group size of -N), while a positive\n\
+                              value allows two groups of input sections, one\n\
+                              before, and one after each stub section.\n\
+                              Values of +/-1 indicate the linker should\n\
+                              choose suitable defaults.\n"));
   fprintf (file, _("  --[no-]fix-cortex-a8        Disable/enable Cortex-A8 Thumb-2 branch erratum fix\n"));
   fprintf (file, _("  --no-merge-exidx-entries    Disable merging exidx entries\n"));
   fprintf (file, _("  --[no-]fix-arm1176          Disable/enable ARM1176 BLX immediate erratum fix\n"));
@@ -628,13 +629,13 @@ PARSE_AND_LIST_ARGS_CASES='
 
     case OPTION_VFP11_DENORM_FIX:
       if (strcmp (optarg, "none") == 0)
-        vfp11_denorm_fix = BFD_ARM_VFP11_FIX_NONE;
+       vfp11_denorm_fix = BFD_ARM_VFP11_FIX_NONE;
       else if (strcmp (optarg, "scalar") == 0)
-        vfp11_denorm_fix = BFD_ARM_VFP11_FIX_SCALAR;
+       vfp11_denorm_fix = BFD_ARM_VFP11_FIX_SCALAR;
       else if (strcmp (optarg, "vector") == 0)
-        vfp11_denorm_fix = BFD_ARM_VFP11_FIX_VECTOR;
+       vfp11_denorm_fix = BFD_ARM_VFP11_FIX_VECTOR;
       else
-        einfo (_("Unrecognized VFP11 fix type '\''%s'\''.\n"), optarg);
+       einfo (_("Unrecognized VFP11 fix type '\''%s'\''.\n"), optarg);
       break;
 
     case OPTION_NO_ENUM_SIZE_WARNING:
@@ -653,8 +654,8 @@ PARSE_AND_LIST_ARGS_CASES='
       {
        const char *end;
 
-        group_size = bfd_scan_vma (optarg, &end, 0);
-        if (*end)
+       group_size = bfd_scan_vma (optarg, &end, 0);
+       if (*end)
          einfo (_("%P%F: invalid number `%s'\''\n"), optarg);
       }
       break;
index 4cb34d323da70b89d3c1ba87d0451f885744d0c7..cb4238ad8e67802377398a3146cb600044ed5be9 100644 (file)
@@ -1,3 +1,21 @@
+2013-07-18  Roland McGrath  <mcgrathr@google.com>
+
+       * ld-arm/farcall-arm-nacl.d: New file.
+       * ld-arm/farcall-arm-nacl-pic.d: New file.
+       * ld-arm/farcall-data-nacl.d: New file.
+       * ld-arm/arm-elf.exp (armeabitests_common): Add extra element to
+       "action" lists for those cases to use a different dump file for NaCl
+       targets.
+       Massage $armeabitests_common to drop the extra element or the one
+       before it, depending on [istarget "arm*-*-nacl*"].
+
+       * ld-arm/arm-elf.exp (armelftests_common): Move all "Cortex-A8
+       erratum fix", Thumb-only and interworking cases to ...
+       (armelftests_nonacl): ... here.
+       (armeabitests_common): Move all "erratum 760522 fix", Thumb-only
+       and interworking cases to ...
+       (armeabitests_nonacl): ... here.
+
 2013-05-28  Will Newton  <will.newton@linaro.org>
 
        * ld-arm/arm-elf.exp: Add IFUNC test 17.
index 91b06571deed955ac80fae07a1489384fd007a01..641dcccfbc3b04cef24e8f984671a7f06087f994 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for various ARM ELF tests.
-#   Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012
+#   Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012, 2013
 #   Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
@@ -71,9 +71,6 @@ set armelftests_common {
     {"Group relocations" "-Ttext 0x8000 --section-start zero=0x0 --section-start alpha=0xeef0 --section-start beta=0xffeef0" "" {group-relocs.s}
      {{objdump -dr group-relocs.d}}
      "group-relocs"}
-    {"Thumb-1 BL" "-Ttext 0x1000 --section-start .foo=0x401000" "" {thumb1-bl.s}
-     {{objdump -dr thumb1-bl.d}}
-     "thumb1-bl"}
     {"Indirect cross-library function reference (set-up)"
      "-shared" "" {arm-lib-plt-2a.s}
      {}
@@ -142,12 +139,6 @@ set armelftests_common {
     {"TLS descseq relaxation BE32" "-T arm-dyn.ld -EB" "-mbig-endian" {tls-descrelax-be32.s}
      {{objdump -fdw tls-descrelax-be32.d}}
      "tls-descrelax-be32"}
-    {"Thumb entry point" "-T arm.ld" "" {thumb-entry.s}
-     {{readelf -h thumb-entry.d}}
-     "thumb-entry"}
-    {"thumb-rel32" "-static -T arm.ld" "" {thumb-rel32.s}
-     {{objdump -s thumb-rel32.d}}
-     "thumb-rel32"}
     {"MOVW/MOVT" "-static -T arm.ld" "" {arm-movwt.s}
      {{objdump -dw arm-movwt.d}}
      "arm-movwt"}
@@ -166,79 +157,9 @@ set armelftests_common {
      "-EL --vfp11-denorm-fix=scalar -Ttext=0x8000" "-EL -mfpu=vfpxd" {vfp11-fix-none.s}
      {{objdump -dr vfp11-fix-none.d}}
      "vfp11-fix-none"}
-    {"Cortex-A8 erratum fix, b.w"
-     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-b.s}
-     {{objdump -dr cortex-a8-fix-b.d}}
-     "cortex-a8-fix-b"}
-    {"Cortex-A8 erratum fix, bl.w"
-     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-bl.s}
-     {{objdump -dr cortex-a8-fix-bl.d}}
-     "cortex-a8-fix-bl"}
-    {"Cortex-A8 erratum fix, bcc.w"
-     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-bcc.s}
-     {{objdump -dr cortex-a8-fix-bcc.d}}
-     "cortex-a8-fix-bcc"}
-    {"Cortex-A8 erratum fix, blx.w"
-     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-blx.s}
-     {{objdump -dr cortex-a8-fix-blx.d}}
-     "cortex-a8-fix-blx"}
-    {"Cortex-A8 erratum fix, relocate b.w to ARM"
-     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-b-rel.s}
-     {{objdump -dr cortex-a8-fix-b-rel-arm.d}}
-     "cortex-a8-fix-b-rel-arm"}
-    {"Cortex-A8 erratum fix, relocate b.w to Thumb"
-     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-b-rel.s}
-     {{objdump -dr cortex-a8-fix-b-rel-thumb.d}}
-     "cortex-a8-fix-b-rel-thumb"}
-    {"Cortex-A8 erratum fix, relocate bl.w to ARM"
-     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-bl-rel.s}
-     {{objdump -dr cortex-a8-fix-bl-rel-arm.d}}
-     "cortex-a8-fix-bl-rel-arm"}
-    {"Cortex-A8 erratum fix, relocate bl.w to Thumb"
-     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bl-rel.s}
-     {{objdump -dr cortex-a8-fix-bl-rel-thumb.d}}
-     "cortex-a8-fix-bl-rel-thumb"}
-    {"Cortex-A8 erratum fix, relocate b<cond>.w to Thumb"
-     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bcc-rel.s}
-     {{objdump -dr cortex-a8-fix-bcc-rel-thumb.d}}
-     "cortex-a8-fix-bcc-rel-thumb"}
-    {"Cortex-A8 erratum fix, relocate blx.w to ARM"
-     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-blx-rel.s}
-     {{objdump -dr cortex-a8-fix-blx-rel-arm.d}}
-     "cortex-a8-fix-blx-rel-arm"}
-    {"Cortex-A8 erratum fix, relocate blx.w to Thumb"
-     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-blx-rel.s}
-     {{objdump -dr cortex-a8-fix-blx-rel-thumb.d}}
-     "cortex-a8-fix-blx-rel-thumb"}
-    {"Cortex-A8 erratum fix, relocate bl.w and far call"
-     "-EL -Ttext=0x00 --fix-cortex-a8 --defsym _start=0"
-     "-EL -mcpu=cortex-a8" {cortex-a8-far-1.s cortex-a8-far-2.s cortex-a8-far-3.s}
-     {{objdump -dr cortex-a8-far.d}}
-     "cortex-a8-far"}
-    {"Cortex-A8 erratum fix, headers"
-     "-EL --fix-cortex-a8 -T cortex-a8-fix-hdr.t"
-     "-EL -mcpu=cortex-a8" {cortex-a8-fix-hdr.s}
-     {{objdump -dr cortex-a8-fix-hdr.d}}
-     "cortex-a8-fix-hdr"}
-    {"Cortex-A8 erratum fix, blx.w and b<cond>.w together"
-     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-blx-bcond.s}
-     {{objdump -dr cortex-a8-fix-blx-bcond.d}}
-     "cortex-a8-fix-blx-bcond"}
     {"Unwinding and -gc-sections" "-gc-sections" "" {gc-unwind.s}
      {{objdump -sj.data gc-unwind.d}}
      "gc-unwind"}
-    {"Thumb and -gc-sections" "-shared -T arm-dyn.ld" "" {gc-thumb-lib.s}
-     {}
-     "gc-thumb-lib.so"}
-    {"Thumb and -gc-sections" "-pie -T arm.ld -gc-sections tmpdir/gc-thumb-lib.so" "" {gc-thumb.s}
-     {{readelf --relocs gc-thumb.d}}
-     "gc-thumb"}
-    {"arm-pic-veneer" "-static -T arm.ld --pic-veneer" "" {arm-pic-veneer.s}
-     {{objdump -d arm-pic-veneer.d}}
-     "arm-pic-veneer"}
-    {"jump19" "-static -T arm.ld" "" {jump19.s}
-     {{objdump -dr jump19.d}}
-     "jump19"}
     {"script-type" "-static -T script-type.ld" "" {script-type.s}
      {{readelf -s script-type.sym}}
      "script-type"}
@@ -274,6 +195,28 @@ set armelftests_common {
 }
 
 set armelftests_nonacl {
+    {"Thumb-1 BL" "-Ttext 0x1000 --section-start .foo=0x401000" "" {thumb1-bl.s}
+     {{objdump -dr thumb1-bl.d}}
+     "thumb1-bl"}
+    {"Thumb entry point" "-T arm.ld" "" {thumb-entry.s}
+     {{readelf -h thumb-entry.d}}
+     "thumb-entry"}
+    {"thumb-rel32" "-static -T arm.ld" "" {thumb-rel32.s}
+     {{objdump -s thumb-rel32.d}}
+     "thumb-rel32"}
+    {"Thumb and -gc-sections" "-shared -T arm-dyn.ld" "" {gc-thumb-lib.s}
+     {}
+     "gc-thumb-lib.so"}
+    {"Thumb and -gc-sections" "-pie -T arm.ld -gc-sections tmpdir/gc-thumb-lib.so" "" {gc-thumb.s}
+     {{readelf --relocs gc-thumb.d}}
+     "gc-thumb"}
+    {"arm-pic-veneer" "-static -T arm.ld --pic-veneer" "" {arm-pic-veneer.s}
+     {{objdump -d arm-pic-veneer.d}}
+     "arm-pic-veneer"}
+    {"jump19" "-static -T arm.ld" "" {jump19.s}
+     {{objdump -dr jump19.d}}
+     "jump19"}
+
     {"Simple non-PIC shared library" "-shared" "" {arm-lib.s}
      {{objdump -fdw arm-lib.d} {objdump -Rw arm-lib.r}}
      "arm-lib.so"}
@@ -351,6 +294,64 @@ set armelftests_nonacl {
      "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bl-rel.s}
      {{objdump -dr cortex-a8-fix-bl-rel-plt.d}}
      "cortex-a8-fix-bl-rel-thumb"}
+    {"Cortex-A8 erratum fix, b.w"
+     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-b.s}
+     {{objdump -dr cortex-a8-fix-b.d}}
+     "cortex-a8-fix-b"}
+    {"Cortex-A8 erratum fix, bl.w"
+     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-bl.s}
+     {{objdump -dr cortex-a8-fix-bl.d}}
+     "cortex-a8-fix-bl"}
+    {"Cortex-A8 erratum fix, bcc.w"
+     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-bcc.s}
+     {{objdump -dr cortex-a8-fix-bcc.d}}
+     "cortex-a8-fix-bcc"}
+    {"Cortex-A8 erratum fix, blx.w"
+     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-blx.s}
+     {{objdump -dr cortex-a8-fix-blx.d}}
+     "cortex-a8-fix-blx"}
+    {"Cortex-A8 erratum fix, relocate b.w to ARM"
+     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-b-rel.s}
+     {{objdump -dr cortex-a8-fix-b-rel-arm.d}}
+     "cortex-a8-fix-b-rel-arm"}
+    {"Cortex-A8 erratum fix, relocate b.w to Thumb"
+     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-b-rel.s}
+     {{objdump -dr cortex-a8-fix-b-rel-thumb.d}}
+     "cortex-a8-fix-b-rel-thumb"}
+    {"Cortex-A8 erratum fix, relocate bl.w to ARM"
+     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-bl-rel.s}
+     {{objdump -dr cortex-a8-fix-bl-rel-arm.d}}
+     "cortex-a8-fix-bl-rel-arm"}
+    {"Cortex-A8 erratum fix, relocate bl.w to Thumb"
+     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bl-rel.s}
+     {{objdump -dr cortex-a8-fix-bl-rel-thumb.d}}
+     "cortex-a8-fix-bl-rel-thumb"}
+    {"Cortex-A8 erratum fix, relocate b<cond>.w to Thumb"
+     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bcc-rel.s}
+     {{objdump -dr cortex-a8-fix-bcc-rel-thumb.d}}
+     "cortex-a8-fix-bcc-rel-thumb"}
+    {"Cortex-A8 erratum fix, relocate blx.w to ARM"
+     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-blx-rel.s}
+     {{objdump -dr cortex-a8-fix-blx-rel-arm.d}}
+     "cortex-a8-fix-blx-rel-arm"}
+    {"Cortex-A8 erratum fix, relocate blx.w to Thumb"
+     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-blx-rel.s}
+     {{objdump -dr cortex-a8-fix-blx-rel-thumb.d}}
+     "cortex-a8-fix-blx-rel-thumb"}
+    {"Cortex-A8 erratum fix, relocate bl.w and far call"
+     "-EL -Ttext=0x00 --fix-cortex-a8 --defsym _start=0"
+     "-EL -mcpu=cortex-a8" {cortex-a8-far-1.s cortex-a8-far-2.s cortex-a8-far-3.s}
+     {{objdump -dr cortex-a8-far.d}}
+     "cortex-a8-far"}
+    {"Cortex-A8 erratum fix, headers"
+     "-EL --fix-cortex-a8 -T cortex-a8-fix-hdr.t"
+     "-EL -mcpu=cortex-a8" {cortex-a8-fix-hdr.s}
+     {{objdump -dr cortex-a8-fix-hdr.d}}
+     "cortex-a8-fix-hdr"}
+    {"Cortex-A8 erratum fix, blx.w and b<cond>.w together"
+     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-blx-bcond.s}
+     {{objdump -dr cortex-a8-fix-blx-bcond.d}}
+     "cortex-a8-fix-blx-bcond"}
     {"IFUNC test 1" "-T ifunc-static.ld" "" {ifunc-1.s}
      {{objdump -d ifunc-1.dd}
       {objdump {-s -j.data -j.got} ifunc-1.gd}
@@ -477,7 +478,13 @@ if { ![istarget "arm*-*-*eabi"] && ![istarget "arm*-*-nacl*"] } {
     return
 }
 
-# Farcalls stubs are fully supported for ARM-EABI only
+# Farcalls stubs are fully supported for ARM-EABI only.
+# This list is massaged below into run_ld_link_tests standard format.
+# The source list is almost that same format.  The one difference is
+# that each "action" (elements of element 5) might have four elements
+# instead of three; in that case, the fourth element is the name of
+# the dump file to use for arm*-*nacl* targets instead of the canonical
+# dump file (the third element).
 set armeabitests_common {
      {"EABI attribute merging" "-r" "" {attr-merge.s attr-merge.s}
       {{readelf -A attr-merge.attr}}
@@ -515,108 +522,29 @@ set armeabitests_common {
      {"EABI attribute arch merging 2 reversed" "-r" "" {arch-v6.s arch-v6k.s}
       {{readelf -A attr-merge-arch-2.attr}}
       "attr-merge-arch-2r"}
-     {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x1001000" "" {thumb2-bl.s}
-      {{objdump -dr thumb2-bl.d}}
-      "thumb2-bl"}
-     {"Thumb-2 Interworked branch" "-T arm.ld" "" {thumb2-b-interwork.s}
-      {{objdump -dr thumb2-b-interwork.d}}
-      "thumb2-b-interwork"}
-    {"BL/BLX interworking" "-T arm.ld" "" {thumb2-bl-blx-interwork.s}
-     {{objdump -dr thumb2-bl-blx-interwork.d}}
-     "thumb2-bl-blx-interwork"}
-    {"ARMv4 interworking" "-static -T arm.ld --fix-v4bx-interworking" "--fix-v4bx -meabi=4" {armv4-bx.s}
-     {{objdump -d armv4-bx.d}}
-     "armv4-bx"}
     {"MOVW/MOVT and merged sections" "-T arm.ld" "" {movw-merge.s}
      {{objdump -dw movw-merge.d}}
      "movw-merge"}
     {"MOVW/MOVT against shared libraries" "tmpdir/arm-lib.so" "" {arm-app-movw.s}
      {{objdump -Rw arm-app.r}}
      "arm-app-movw"}
-    {"Thumb-2-as-Thumb-1 BL" "--no-fix-arm1176 -Ttext 0x1000 --section-start .foo=0x100100c" "" {thumb2-bl-as-thumb1-bad.s}
-     {{objdump -d thumb2-bl-as-thumb1-bad.d}}
-     "thumb2-bl-as-thumb1-bad"}
-    {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x100100c" "" {thumb2-bl-bad.s}
-     {{objdump -d thumb2-bl-bad.d}}
-     "thumb2-bl-bad"}
 
     {"ARM-ARM farcall" "-Ttext 0x1000 --section-start .foo=0x2001020" "" {farcall-arm-arm.s}
-     {{objdump -d farcall-arm-arm.d}}
+     {{objdump -d farcall-arm-arm.d farcall-arm-nacl.d}}
      "farcall-arm-arm"}
     {"ARM-ARM farcall (PIC veneer)" "-Ttext 0x1000 --section-start .foo=0x2001020 --pic-veneer" "" {farcall-arm-arm.s}
-     {{objdump -d farcall-arm-arm-pic-veneer.d}}
+     {{objdump -d farcall-arm-arm-pic-veneer.d farcall-arm-nacl-pic.d}}
      "farcall-arm-arm-pic-veneer"}
     {"ARM-ARM farcall (BE8)" "-Ttext 0x1000 --section-start .foo=0x2001020 -EB --be8" "-EB" {farcall-arm-arm.s}
-     {{objdump -d farcall-arm-arm.d}}
+     {{objdump -d farcall-arm-arm.d farcall-arm-nacl.d}}
      "farcall-arm-arm-be8"}
     {"ARM-ARM farcall (BE)" "-Ttext 0x1000 --section-start .foo=0x2001020 -EB" "-EB" {farcall-arm-arm.s}
-     {{objdump -d farcall-arm-arm.d}}
+     {{objdump -d farcall-arm-arm.d farcall-arm-nacl.d}}
      "farcall-arm-arm-be"}
 
-    {"Multiple farcalls" "-Ttext 0x1000 --section-start .foo=0x2002020" "" {farcall-mix.s}
-     {{objdump -d farcall-mix.d}}
-     "farcall-mix"}
-    {"Multiple farcalls from several sections" "-Ttext 0x1000 --section-start .mytext=0x2000 --section-start .foo=0x2003020" "" {farcall-mix2.s}
-     {{objdump -d farcall-mix2.d}}
-     "farcall-mix2"}
-
-    {"Default group size" "-Ttext 0x1000 --section-start .foo=0x2003020" "" {farcall-group.s farcall-group2.s}
-     {{objdump -d farcall-group.d}}
-     "farcall-group-default"}
-    {"Group size=2" "-Ttext 0x1000 --section-start .foo=0x2003020 --stub-group-size=2" "" {farcall-group.s farcall-group2.s}
-     {{objdump -d farcall-group-size2.d}}
-     "farcall-group-size2"}
-    {"Group size limit" "-Ttext 0x1000 --section-start .far=0x2003020" "" {farcall-group3.s farcall-group4.s}
-     {{objdump -d farcall-group-limit.d}}
-     "farcall-group-limit"}
-
     {"Long branch with mixed text and data" "-T arm.ld" "" {farcall-data.s}
-     {{objdump -dr farcall-data.d}}
+     {{objdump -dr farcall-data.d farcall-data-nacl.d}}
      "farcall-data"}
-
-    {"R_ARM_THM_JUMP24 Relocation veneers: Short 1"
-     "--no-fix-arm1176 --section-start destsect=0x00009000 --section-start .text=0x8000"
-     "-march=armv7-a -mthumb"
-     {jump-reloc-veneers.s}
-     {{objdump -d jump-reloc-veneers-short1.d}}
-     "jump-reloc-veneers-short1"}
-    {"R_ARM_THM_JUMP24 Relocation veneers: Short 2"
-     "--no-fix-arm1176 --section-start destsect=0x00900000 --section-start .text=0x8000"
-     "-march=armv7-a -mthumb"
-     {jump-reloc-veneers.s}
-     {{objdump -d jump-reloc-veneers-short2.d}}
-     "jump-reloc-veneers-short2"}
-    {"R_ARM_THM_JUMP24 Relocation veneers: Long"
-     "--no-fix-arm1176 --section-start destsect=0x09000000 --section-start .text=0x8000"
-     "-march=armv7-a -mthumb"
-     {jump-reloc-veneers.s}
-     {{objdump -d jump-reloc-veneers-long.d}}
-     "jump-reloc-veneers-long"}
-
-    {"erratum 760522 fix (default for v6z)" "--section-start=.foo=0x2001014"
-     "-march=armv6z" {fix-arm1176.s}
-     {{objdump -d fix-arm1176-on.d}}
-     "fix-arm1176-1"}
-    {"erratum 760522 fix (explicitly on at v6z)" "--section-start=.foo=0x2001014 --fix-arm1176"
-     "-march=armv6z" {fix-arm1176.s}
-     {{objdump -d fix-arm1176-on.d}}
-     "fix-arm1176-2"}
-    {"erratum 760522 fix (explicitly off at v6z)" "--section-start=.foo=0x2001014 --no-fix-arm1176"
-     "-march=armv6z" {fix-arm1176.s}
-     {{objdump -d fix-arm1176-off.d}}
-     "fix-arm1176-3"}
-    {"erratum 760522 fix (default for v5)" "--section-start=.foo=0x2001014 "
-     "-march=armv5te" {fix-arm1176.s}
-     {{objdump -d fix-arm1176-on.d}}
-     "fix-arm1176-4"}
-    {"erratum 760522 fix (default for v7-a)" "--section-start=.foo=0x2001014 "
-     "-march=armv7-a" {fix-arm1176.s}
-     {{objdump -d fix-arm1176-off.d}}
-     "fix-arm1176-5"}
-    {"erratum 760522 fix (default for ARM1156)" "--section-start=.foo=0x2001014 "
-     "-mcpu=arm1156t2f-s" {fix-arm1176.s}
-     {{objdump -d fix-arm1176-off.d}}
-     "fix-arm1176-6"}
 }
 
 set armeabitests_nonacl {
@@ -677,6 +605,23 @@ set armeabitests_nonacl {
      {{objdump -d farcall-thumb-arm-pic-veneer.d}}
      "farcall-thumb-arm-pic-veneer"}
 
+    {"Multiple farcalls" "-Ttext 0x1000 --section-start .foo=0x2002020" "" {farcall-mix.s}
+     {{objdump -d farcall-mix.d}}
+     "farcall-mix"}
+    {"Multiple farcalls from several sections" "-Ttext 0x1000 --section-start .mytext=0x2000 --section-start .foo=0x2003020" "" {farcall-mix2.s}
+     {{objdump -d farcall-mix2.d}}
+     "farcall-mix2"}
+
+    {"Default group size" "-Ttext 0x1000 --section-start .foo=0x2003020" "" {farcall-group.s farcall-group2.s}
+     {{objdump -d farcall-group.d}}
+     "farcall-group-default"}
+    {"Group size=2" "-Ttext 0x1000 --section-start .foo=0x2003020 --stub-group-size=2" "" {farcall-group.s farcall-group2.s}
+     {{objdump -d farcall-group-size2.d}}
+     "farcall-group-size2"}
+    {"Group size limit" "-Ttext 0x1000 --section-start .far=0x2003020" "" {farcall-group3.s farcall-group4.s}
+     {{objdump -d farcall-group-limit.d}}
+     "farcall-group-limit"}
+
     {"Mixed ARM/Thumb dynamic application with farcalls" "tmpdir/mixed-lib.so -T arm-dyn.ld --section-start .far_arm=0x2100000 --section-start .far_thumb=0x2200000" ""
      {farcall-mixed-app.s}
      {{objdump -fdw farcall-mixed-app.d} {objdump -Rw farcall-mixed-app.r}
@@ -698,6 +643,70 @@ set armeabitests_nonacl {
      {{objdump -fdw farcall-mixed-lib.d}}
      "farcall-mixed-lib.so"}
 
+    {"Thumb-2-as-Thumb-1 BL" "--no-fix-arm1176 -Ttext 0x1000 --section-start .foo=0x100100c" "" {thumb2-bl-as-thumb1-bad.s}
+     {{objdump -d thumb2-bl-as-thumb1-bad.d}}
+     "thumb2-bl-as-thumb1-bad"}
+    {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x100100c" "" {thumb2-bl-bad.s}
+     {{objdump -d thumb2-bl-bad.d}}
+     "thumb2-bl-bad"}
+
+    {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x1001000" "" {thumb2-bl.s}
+     {{objdump -dr thumb2-bl.d}}
+     "thumb2-bl"}
+    {"Thumb-2 Interworked branch" "-T arm.ld" "" {thumb2-b-interwork.s}
+     {{objdump -dr thumb2-b-interwork.d}}
+     "thumb2-b-interwork"}
+    {"BL/BLX interworking" "-T arm.ld" "" {thumb2-bl-blx-interwork.s}
+     {{objdump -dr thumb2-bl-blx-interwork.d}}
+    "thumb2-bl-blx-interwork"}
+    {"ARMv4 interworking" "-static -T arm.ld --fix-v4bx-interworking" "--fix-v4bx -meabi=4" {armv4-bx.s}
+     {{objdump -d armv4-bx.d}}
+     "armv4-bx"}
+
+    {"R_ARM_THM_JUMP24 Relocation veneers: Short 1"
+     "--no-fix-arm1176 --section-start destsect=0x00009000 --section-start .text=0x8000"
+     "-march=armv7-a -mthumb"
+     {jump-reloc-veneers.s}
+     {{objdump -d jump-reloc-veneers-short1.d}}
+     "jump-reloc-veneers-short1"}
+    {"R_ARM_THM_JUMP24 Relocation veneers: Short 2"
+     "--no-fix-arm1176 --section-start destsect=0x00900000 --section-start .text=0x8000"
+     "-march=armv7-a -mthumb"
+     {jump-reloc-veneers.s}
+     {{objdump -d jump-reloc-veneers-short2.d}}
+     "jump-reloc-veneers-short2"}
+    {"R_ARM_THM_JUMP24 Relocation veneers: Long"
+     "--no-fix-arm1176 --section-start destsect=0x09000000 --section-start .text=0x8000"
+     "-march=armv7-a -mthumb"
+     {jump-reloc-veneers.s}
+     {{objdump -d jump-reloc-veneers-long.d}}
+     "jump-reloc-veneers-long"}
+
+    {"erratum 760522 fix (default for v6z)" "--section-start=.foo=0x2001014"
+     "-march=armv6z" {fix-arm1176.s}
+     {{objdump -d fix-arm1176-on.d}}
+     "fix-arm1176-1"}
+    {"erratum 760522 fix (explicitly on at v6z)" "--section-start=.foo=0x2001014 --fix-arm1176"
+     "-march=armv6z" {fix-arm1176.s}
+     {{objdump -d fix-arm1176-on.d}}
+     "fix-arm1176-2"}
+    {"erratum 760522 fix (explicitly off at v6z)" "--section-start=.foo=0x2001014 --no-fix-arm1176"
+     "-march=armv6z" {fix-arm1176.s}
+     {{objdump -d fix-arm1176-off.d}}
+     "fix-arm1176-3"}
+    {"erratum 760522 fix (default for v5)" "--section-start=.foo=0x2001014 "
+     "-march=armv5te" {fix-arm1176.s}
+     {{objdump -d fix-arm1176-on.d}}
+     "fix-arm1176-4"}
+    {"erratum 760522 fix (default for v7-a)" "--section-start=.foo=0x2001014 "
+     "-march=armv7-a" {fix-arm1176.s}
+     {{objdump -d fix-arm1176-off.d}}
+     "fix-arm1176-5"}
+    {"erratum 760522 fix (default for ARM1156)" "--section-start=.foo=0x2001014 "
+     "-mcpu=arm1156t2f-s" {fix-arm1176.s}
+     {{objdump -d fix-arm1176-off.d}}
+     "fix-arm1176-6"}
+
     {"TLS gnu shared library" "--no-fix-arm1176 -shared -T arm-dyn.ld" "" {tls-gdesc.s}
      {{objdump -fdw tls-gdesc.d} {objdump -Rw tls-gdesc.r}}
      "tls-lib2.so"}
@@ -715,6 +724,27 @@ set armeabitests_nonacl {
      "tls-thumb1"}
 }
 
+# Massage the $armeabitests_common list into run_ld_link_tests standard form.
+# See the comment before 'set armeabitests_common', above.
+set elide_action_elt 3
+set is_nacl [istarget "arm*-*-nacl*"]
+if {$is_nacl} {
+    set elide_action_elt 2
+}
+set neabi_common [llength $armeabitests_common]
+for {set i 0} {$i < $neabi_common} {incr i} {
+    set case [lindex $armeabitests_common $i]
+    set actions [lindex $case 4]
+    set nactions [llength $actions]
+    for {set j 0} {$j < $nactions} {incr j} {
+       set action [lindex $actions $j]
+       if {[llength $action] == 4} {
+           set action [lreplace $action $elide_action_elt $elide_action_elt]
+           lset armeabitests_common $i 4 $j $action
+       }
+    }
+}
+
 run_ld_link_tests $armeabitests_common
 if { ![istarget "arm*-*-nacl*"] } {
     run_ld_link_tests $armeabitests_nonacl
diff --git a/ld/testsuite/ld-arm/farcall-arm-nacl-pic.d b/ld/testsuite/ld-arm/farcall-arm-nacl-pic.d
new file mode 100644 (file)
index 0000000..62d3421
--- /dev/null
@@ -0,0 +1,20 @@
+.*:     file format .*
+
+Disassembly of section \.text:
+
+0+1000 <_start>:
+\s*1000:\s+eb000002\s+bl\s+1010 <__bar_veneer>
+#...
+
+0+1010 <__bar_veneer>:
+\s*1010:\s+e59fc00c\s+ldr\s+ip, \[pc, #12\]\s+; 1024 <__bar_veneer\+0x14>
+\s*1014:\s+e08cc00f\s+add\s+ip, ip, pc
+\s*1018:\s+e3ccc13f\s+bic\s+ip, ip, #-1073741809\s+; 0xc000000f
+\s*101c:\s+e12fff1c\s+bx\s+ip
+\s*1020:\s+e125be70\s+bkpt\s+0x5be0
+\s*1024:\s+02000004\s+.word\s+0x02000004
+#...
+
+\s*Disassembly of section \.foo:
+\s*02001020 <bar>:
+\s*2001020:\s+e12fff1e\s+bx\s+lr
diff --git a/ld/testsuite/ld-arm/farcall-arm-nacl.d b/ld/testsuite/ld-arm/farcall-arm-nacl.d
new file mode 100644 (file)
index 0000000..58f2a58
--- /dev/null
@@ -0,0 +1,20 @@
+.*:     file format .*
+
+Disassembly of section \.text:
+
+0+1000 <_start>:
+\s*1000:\s+eb000002\s+bl\s+1010 <__bar_veneer>
+#...
+
+0+1010 <__bar_veneer>:
+\s*1010:\s+e59fc00c\s+ldr\s+ip, \[pc, #12\]\s+; 1024 <__bar_veneer\+0x14>
+\s*1014:\s+e3ccc13f\s+bic\s+ip, ip, #-1073741809\s+; 0xc000000f
+\s*1018:\s+e12fff1c\s+bx\s+ip
+\s*101c:\s+e320f000\s+nop\s+\{0\}
+\s*1020:\s+e125be70\s+bkpt\s+0x5be0
+\s*1024:\s+02001020\s+.word\s+0x02001020
+#...
+
+\s*Disassembly of section \.foo:
+\s*02001020 <bar>:
+\s*2001020:\s+e12fff1e\s+bx\s+lr
diff --git a/ld/testsuite/ld-arm/farcall-data-nacl.d b/ld/testsuite/ld-arm/farcall-data-nacl.d
new file mode 100644 (file)
index 0000000..1524fa6
--- /dev/null
@@ -0,0 +1,24 @@
+.*:     file format .*
+
+Disassembly of section .text:
+
+0+8000 <_start>:
+\s*8000:\s+ea000002\s+b\s+8010 <__far_veneer>
+#...
+
+0+8010 <__far_veneer>:
+\s*8010:\s+e59fc00c\s+ldr\s+ip, \[pc, #12\]\s+; 8024 <__far_veneer\+0x14>
+\s*8014:\s+e3ccc13f\s+bic\s+ip, ip, #-1073741809\s+; 0xc000000f
+\s*8018:\s+e12fff1c\s+bx\s+ip
+\s*801c:\s+e320f000\s+nop\s+\{0\}
+\s*8020:\s+e125be70\s+bkpt\s+0x5be0
+\s*8024:\s+12340000\s+.word\s+0x12340000
+#...
+
+0+8030 <after>:
+\s*8030:\s+11111111\s+\.word\s+0x11111111
+
+Disassembly of section \.far:
+
+12340000 <far>:
+12340000:\s+e12fff1e\s+bx\s+lr