public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: jkratoch@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  archer-tromey-charset: Merge commit 'origin/master' into archer-tromey-charset
Date: Sat, 28 Feb 2009 20:29:00 -0000	[thread overview]
Message-ID: <20090228202909.10644.qmail@sourceware.org> (raw)

The branch, archer-tromey-charset has been updated
       via  3f26a4add1563e78ab9b50c9f77625f0690fc278 (commit)
       via  b05c50c829e11f33bd58d5fd2de17f761207d22b (commit)
       via  acfa7328d395311e477ec40c8e9f5d64982b6454 (commit)
       via  cee93b972b71faa6c0e9e72fcd03e90a67377875 (commit)
       via  6a6b10af0464c935770d19210a7b595ae439b927 (commit)
       via  11e5be97098e9187c48a77716a319ac3609ab1c0 (commit)
       via  655a09f40df0106966807702a3a12a1d273a1b69 (commit)
       via  a473b338ce3737481feb4d4473aa74caee758671 (commit)
       via  63eafe5276abca7312c6fed52cead4a9229f944e (commit)
       via  dd9c559d2949554eb4002a671d47a7f65f6acd3c (commit)
       via  285bd7c3eb50e65e2a9d8c6ca9cae859349fe90b (commit)
       via  8e336bc6b968e678de0b4baf968a5108e3cee9be (commit)
       via  9f08a3932eefd332b72483ccec1cad049c0c7c4a (commit)
       via  531484da0ccaffb64616f5f892a2c1eec3c2bd30 (commit)
       via  836fe91a251f7419730b7eaf88780eafd2ae738d (commit)
       via  e46198590298ad68582afb2706fdedce886ef3f6 (commit)
       via  a89c5e97893fc81c89c26261b3e8a34fd111f356 (commit)
       via  7e7604fcf501d9f7d00488c3fceb7c814ec9496e (commit)
       via  15926f8a4c3311b90d68392ace929b2808612334 (commit)
       via  68f4aeee38798fbffd52a8f42158594bc849c4a2 (commit)
       via  5f8910120be450edecfbcafa65481c8f29fc0f4c (commit)
       via  32f597d669aec6e7bb5b425b4cb0d29a1023d295 (commit)
       via  2ffc14e5f1d3d75cbfb665474241ebd0975df2e0 (commit)
       via  8dddf6c0682cd4f501b9414af2ee41311559bb62 (commit)
       via  5e61b2ecffe82f6eccc0431ef6e54d38814430d2 (commit)
       via  d7f41c5c6767e858b0587a42b689f7f4c070172b (commit)
       via  8e207759a453dc45961f218d335518464f91f27d (commit)
       via  5b8e2944be405117e44f9d5b1b87bf3b7a796651 (commit)
       via  f585f4c883101a6b1a0d7f324ddd71b3bfa77be7 (commit)
       via  41882f54dd221b655fa2dfb2ff0ac511a41717e7 (commit)
       via  d1325b19cb505b2aa0e446c89702b1b940a6c2ca (commit)
       via  5c84b9312b5dc42b945bd3df3f41a34ad4a84ef1 (commit)
       via  2664777b6b4a69a4a3fc72143a4fbaaf59183d1e (commit)
       via  37f998e0df428dcf831eeedf5459ee663e5cd05a (commit)
       via  bb1d4f60bb5376c3ce6a686035bc6f91bbcd1625 (commit)
       via  9efefe92da03895d9ee3ce840293416bcfc2b06b (commit)
      from  fa841eda831c4da1d1feed323afd9d45d4392c51 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 bfd/ChangeLog             |   74 +
 bfd/elf.c                 |   13 +-
 bfd/elf32-arm.c           |  551 ++-
 bfd/elf32-xtensa.c        |   18 +-
 bfd/version.h             |    2 +-
 gdb/ChangeLog             |  129 +-
 gdb/MAINTAINERS           |    4 +-
 gdb/breakpoint.c          |    5 +-
 gdb/cli/cli-script.c      |    2 +-
 gdb/gdb_proc_service.h    |    4 +-
 gdb/gnu-nat.c             |    4 +-
 gdb/infcmd.c              |   10 +-
 gdb/inflow.c              |    2 +-
 gdb/infrun.c              |    4 +-
 gdb/linux-thread-db.c     |   20 +-
 gdb/maint.c               |    2 +-
 gdb/memattr.c             |    2 +-
 gdb/mips-linux-nat.c      |    4 +-
 gdb/monitor.c             |    4 +-
 gdb/nto-procfs.c          |    4 +-
 gdb/printcmd.c            |    4 +-
 gdb/proc-service.c        |   12 +-
 gdb/python/python-utils.c |   16 +-
 gdb/remote-mips.c         |    4 +-
 gdb/remote-sim.c          |    5 +-
 gdb/remote.c              |    4 +-
 gdb/solib-irix.c          |    2 +-
 gdb/solib-osf.c           |    2 +-
 gdb/solib-pa64.c          |    2 +-
 gdb/solib-som.c           |    2 +-
 gdb/solib-svr4.c          |    2 +-
 gdb/symfile.c             |    2 +-
 gdb/target.c              |    2 +-
 gdb/top.c                 |    6 +-
 gdb/tracepoint.c          |    2 +-
 gdb/valprint.c            |   15 +-
 gdb/version.in            |    2 +-
 gdb/windows-nat.c         |    4 +-
 include/elf/ChangeLog     |    8 +
 include/elf/common.h      |    8 +-
 include/opcode/ChangeLog  |    4 +
 include/opcode/ppc.h      |    3 +
 opcodes/ChangeLog         |   76 +
 opcodes/arm-dis.c         |    8 +-
 opcodes/i386-dis.c        |   11 +-
 opcodes/i386-gen.c        |    3 -
 opcodes/i386-init.h       |   97 +-
 opcodes/i386-opc.h        |    6 +-
 opcodes/i386-opc.tbl      |    3 -
 opcodes/i386-tbl.h        |11240 ++++++++++++++++++++++----------------------
 opcodes/ppc-dis.c         |    5 +-
 opcodes/ppc-opc.c         |  369 ++-
 52 files changed, 6743 insertions(+), 6044 deletions(-)

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 1c4717f..bdd2f80 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,75 @@
+2009-02-26  Christophe Lyon  <christophe.lyon@st.com>
+
+	* elf32-arm.c (stub_reloc_type): Removed.
+	(insn_sequence): Renamed reloc_type field to r_type.
+	(elf32_arm_stub_long_branch_v4t_arm_thumb_pic): New stub.
+	(elf32_arm_stub_long_branch_v4t_thumb_arm_pic): Likewise.
+	(elf32_arm_stub_long_branch_thumb_only_pic): Likewise.
+	(elf32_arm_stub_type): Add new enum entries for the new stubs.
+	(arm_stub_is_thumb): Catch new stubs.
+	(arm_type_of_stub): Handle new stubs.
+	(arm_size_one_stub): Use ARRAY_SIZE. Handle new stubs.
+	(bfd_elf32_arm_process_before_allocation): Remove useless
+	condition.
+
+2009-02-25  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf.c (elf_find_function): Use is_function_type to check
+	function symbol.
+
+2009-02-24  Sterling Augustine  <sterling@jaw.hq.tensilica.com>
+
+	* xtensa-modules.c: Revert to previous version 1.11 due
+	to inadvertant commit.
+
+2009-02-24  Sterling Augustine  <sterling@tensilica.com>
+
+	* elf32-xtensa.c (text_action_add): Separate test for action
+	type.  Break if saved action is ta_widen_insn at same offset.
+
+2009-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* elf32-arm.c (elf32_arm_stub_long_branch_any_any_pic): Rename
+	to elf32_arm_stub_long_branch_any_arm_pic.
+	(elf32_arm_stub_long_branch_any_thumb_pic): New.
+	(enum elf32_arm_stub_type, arm_type_of_stub)
+	(arm_size_one_stub): Handle any to ARM PIC and any to Thumb PIC
+	separately.
+
+2009-02-24  Joseph Myers  <joseph@codesourcery.com>
+
+	* elf32-arm.c (PREV_SEC): Update comment.
+	(group_sections): Rename argument to stubs_always_after_branch.
+	Reverse the list and place stubs at the end of input sections.
+	Undefine NEXT_SEC.
+	(elf32_arm_size_stubs): Update to use stubs_always_after_branch.
+
+2009-02-23  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* elf32-arm.c (arm_build_one_stub): Initialize stub_reloc_offset.
+	Fix formatting.
+	(arm_size_one_stub): Remove unnecessary break.
+	(arm_map_one_stub): Fix formatting.  Return after BFD_FAIL.
+
+2009-02-23  Christophe Lyon  <christophe.lyon@st.com>
+
+	* elf32-arm.c (stub_insn_type): New type.
+	(stub_reloc_type): Likewise.
+	(insn_sequence): Likewise.
+	(elf32_arm_stub_long_branch_any_any): Encode using insn_sequence.
+	(elf32_arm_stub_long_branch_v4t_arm_thumb): Likewise.
+	(elf32_arm_stub_long_branch_thumb_only): Likewise.
+	(elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise.
+	(elf32_arm_stub_short_branch_v4t_thumb_arm): Likewise.
+	(elf32_arm_stub_long_branch_any_any_pic): Likewise.
+	(elf32_arm_stub_hash_entry): Add new helper fields.
+	(stub_hash_newfunc): Initialize these new fields.
+	(arm_build_one_stub): Encode Arm and Thumb instructions separately
+	to take endianness into account.
+	(arm_size_one_stub): Compute size of stubs using insn_sequence.
+	(arm_map_one_stub): Code is now more generic, thanks to
+	insn_sequence.
+
 2009-02-23  Christophe Lyon  <christophe.lyon@st.com>
 
 	* elf32-arm.c (elf32_arm_stub_long_branch_thumb_only): Fix stub
@@ -11,6 +83,8 @@
 	(arm_map_one_stub): Likewise.
 
 2009-02-23  Tristan Gingold  <gingold@adacore.com>
+	    Eric Botcazou  <ebotcazou@adacore.com>
+	    Douglas B Rupp  <rupp@gnat.com>
 
 	* vms.h: Update copyright year, fix comments, reorder declarations.
 	(_bfd_save_vms_section): Remove the prototype.
diff --git a/bfd/elf.c b/bfd/elf.c
index 44af469..97ac5cb 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -7041,7 +7041,7 @@ _bfd_elf_set_arch_mach (bfd *abfd,
    for error reporting.  */
 
 static bfd_boolean
-elf_find_function (bfd *abfd ATTRIBUTE_UNUSED,
+elf_find_function (bfd *abfd,
 		   asection *section,
 		   asymbol **symbols,
 		   bfd_vma offset,
@@ -7061,6 +7061,7 @@ elf_find_function (bfd *abfd ATTRIBUTE_UNUSED,
      make a better choice of file name for local symbols by ignoring
      file symbols appearing after a given local symbol.  */
   enum { nothing_seen, symbol_seen, file_after_symbol_seen } state;
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
 
   filename = NULL;
   func = NULL;
@@ -7071,20 +7072,22 @@ elf_find_function (bfd *abfd ATTRIBUTE_UNUSED,
   for (p = symbols; *p != NULL; p++)
     {
       elf_symbol_type *q;
+      unsigned int type;
 
       q = (elf_symbol_type *) *p;
 
-      switch (ELF_ST_TYPE (q->internal_elf_sym.st_info))
+      type = ELF_ST_TYPE (q->internal_elf_sym.st_info);
+      switch (type)
 	{
-	default:
-	  break;
 	case STT_FILE:
 	  file = &q->symbol;
 	  if (state == symbol_seen)
 	    state = file_after_symbol_seen;
 	  continue;
+	default:
+	  if (!bed->is_function_type (type))
+	    break;
 	case STT_NOTYPE:
-	case STT_FUNC:
 	  if (bfd_get_section (&q->symbol) == section
 	      && q->symbol.value >= low_func
 	      && q->symbol.value <= offset)
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 6cf3322..2527e5e 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -2010,63 +2010,130 @@ static const bfd_vma elf32_arm_symbian_plt_entry [] =
 #define THM2_MAX_FWD_BRANCH_OFFSET (((1 << 24) - 2) + 4)
 #define THM2_MAX_BWD_BRANCH_OFFSET (-(1 << 24) + 4)
 
+enum stub_insn_type
+  {
+    THUMB16_TYPE = 1,
+    THUMB32_TYPE,
+    ARM_TYPE,
+    DATA_TYPE
+  };
+
+#define THUMB16_INSN(X)    {(X), THUMB16_TYPE, R_ARM_NONE, 0}
+#define THUMB32_INSN(X)    {(X), THUMB32_TYPE, R_ARM_NONE, 0}
+#define ARM_INSN(X)        {(X), ARM_TYPE, R_ARM_NONE, 0}
+#define ARM_REL_INSN(X, Z) {(X), ARM_TYPE, R_ARM_JUMP24, (Z)}
+#define DATA_WORD(X,Y,Z)   {(X), DATA_TYPE, (Y), (Z)}
+
+typedef struct
+{
+  bfd_vma data;
+  enum stub_insn_type type;
+  unsigned int r_type;
+  int reloc_addend;
+}  insn_sequence;
+
 /* Arm/Thumb -> Arm/Thumb long branch stub. On V5T and above, use blx
    to reach the stub if necessary.  */
-static const bfd_vma elf32_arm_stub_long_branch_any_any[] =
+static const insn_sequence elf32_arm_stub_long_branch_any_any[] =
   {
-    0xe51ff004,         /* ldr   pc, [pc, #-4] */
-    0x00000000,         /* dcd   R_ARM_ABS32(X) */
+    ARM_INSN(0xe51ff004),            /* ldr   pc, [pc, #-4] */
+    DATA_WORD(0, R_ARM_ABS32, 0),    /* dcd   R_ARM_ABS32(X) */
   };
 
 /* V4T Arm -> Thumb long branch stub. Used on V4T where blx is not
    available.  */
-static const bfd_vma elf32_arm_stub_long_branch_v4t_arm_thumb[] =
+static const insn_sequence elf32_arm_stub_long_branch_v4t_arm_thumb[] =
   {
-    0xe59fc000,         /* ldr   ip, [pc, #0] */
-    0xe12fff1c,         /* bx    ip */
-    0x00000000,         /* dcd   R_ARM_ABS32(X) */
+    ARM_INSN(0xe59fc000),            /* ldr   ip, [pc, #0] */
+    ARM_INSN(0xe12fff1c),            /* bx    ip */
+    DATA_WORD(0, R_ARM_ABS32, 0),    /* dcd   R_ARM_ABS32(X) */
   };
 
 /* Thumb -> Thumb long branch stub. Used on architectures which
    support only this mode, or on V4T where it is expensive to switch
    to ARM.  */
-static const bfd_vma elf32_arm_stub_long_branch_thumb_only[] =
+static const insn_sequence elf32_arm_stub_long_branch_thumb_only[] =
   {
-    0x4802b401,         /* push {r0} */
-                        /* ldr  r0, [pc, #8] */
-    0xbc014684,         /* mov  ip, r0 */
-                        /* pop  {r0} */
-    0xbf004760,         /* bx   ip */
-                        /* nop */
-    0x00000000,         /* dcd  R_ARM_ABS32(X) */
+    THUMB16_INSN(0xb401),             /* push {r0} */
+    THUMB16_INSN(0x4802),             /* ldr  r0, [pc, #8] */
+    THUMB16_INSN(0x4684),             /* mov  ip, r0 */
+    THUMB16_INSN(0xbc01),             /* pop  {r0} */
+    THUMB16_INSN(0x4760),             /* bx   ip */
+    THUMB16_INSN(0xbf00),             /* nop */
+    DATA_WORD(0, R_ARM_ABS32, 0),     /* dcd  R_ARM_ABS32(X) */
   };
 
 /* V4T Thumb -> ARM long branch stub. Used on V4T where blx is not
    available.  */
-static const bfd_vma elf32_arm_stub_long_branch_v4t_thumb_arm[] =
+static const insn_sequence elf32_arm_stub_long_branch_v4t_thumb_arm[] =
   {
-    0x46c04778,         /* bx   pc */
-                        /* nop   */
-    0xe51ff004,         /* ldr   pc, [pc, #-4] */
-    0x00000000,         /* dcd   R_ARM_ABS32(X) */
+    THUMB16_INSN(0x4778),             /* bx   pc */
+    THUMB16_INSN(0x46c0),             /* nop   */
+    ARM_INSN(0xe51ff004),             /* ldr   pc, [pc, #-4] */
+    DATA_WORD(0, R_ARM_ABS32, 0),     /* dcd   R_ARM_ABS32(X) */
   };
 
 /* V4T Thumb -> ARM short branch stub. Shorter variant of the above
    one, when the destination is close enough.  */
-static const bfd_vma elf32_arm_stub_short_branch_v4t_thumb_arm[] =
+static const insn_sequence elf32_arm_stub_short_branch_v4t_thumb_arm[] =
   {
-    0x46c04778,         /* bx   pc */
-                        /* nop   */
-    0xea000000,         /* b    (X) */
+    THUMB16_INSN(0x4778),             /* bx   pc */
+    THUMB16_INSN(0x46c0),             /* nop   */
+    ARM_REL_INSN(0xea000000, -8),     /* b    (X-8) */
   };
 
-/* ARM/Thumb -> ARM/Thumb long branch stub, PIC. On V5T and above, use
+/* ARM/Thumb -> ARM long branch stub, PIC.  On V5T and above, use
    blx to reach the stub if necessary.  */
-static const bfd_vma elf32_arm_stub_long_branch_any_any_pic[] =
+static const insn_sequence elf32_arm_stub_long_branch_any_arm_pic[] =
+  {
+    ARM_INSN(0xe59fc000),             /* ldr   r12, [pc] */
+    ARM_INSN(0xe08ff00c),             /* add   pc, pc, ip */
+    DATA_WORD(0, R_ARM_REL32, -4),    /* dcd   R_ARM_REL32(X-4) */
+  };
+
+/* ARM/Thumb -> Thumb long branch stub, PIC.  On V5T and above, use
+   blx to reach the stub if necessary.  We can not add into pc;
+   it is not guaranteed to mode switch (different in ARMv6 and
+   ARMv7).  */
+static const insn_sequence elf32_arm_stub_long_branch_any_thumb_pic[] =
+  {
+    ARM_INSN(0xe59fc004),             /* ldr   r12, [pc, #4] */
+    ARM_INSN(0xe08fc00c),             /* add   ip, pc, ip */
+    ARM_INSN(0xe12fff1c),             /* bx    ip */
+    DATA_WORD(0, R_ARM_REL32, 0),     /* dcd   R_ARM_REL32(X) */
+  };
+
+/* V4T ARM -> ARM long branch stub, PIC.  */
+static const insn_sequence elf32_arm_stub_long_branch_v4t_arm_thumb_pic[] =
+  {
+    ARM_INSN(0xe59fc004),             /* ldr   ip, [pc, #4] */
+    ARM_INSN(0xe08fc00c),             /* add   ip, pc, ip */
+    ARM_INSN(0xe12fff1c),             /* bx    ip */
+    DATA_WORD(0, R_ARM_REL32, 0),     /* dcd   R_ARM_REL32(X) */
+  };
+
+/* V4T Thumb -> ARM long branch stub, PIC.  */
+static const insn_sequence elf32_arm_stub_long_branch_v4t_thumb_arm_pic[] =
+  {
+    THUMB16_INSN(0x4778),             /* bx   pc */
+    THUMB16_INSN(0x46c0),             /* nop  */
+    ARM_INSN(0xe59fc000),             /* ldr  ip, [pc, #0] */
+    ARM_INSN(0xe08cf00f),             /* add  pc, ip, pc */
+    DATA_WORD(0, R_ARM_REL32, -4),     /* dcd  R_ARM_REL32(X) */
+  };
+
+/* Thumb -> Thumb long branch stub, PIC. Used on architectures which
+   support only this mode, or on V4T where it is expensive to switch
+   to ARM.  */
+static const insn_sequence elf32_arm_stub_long_branch_thumb_only_pic[] =
   {
-    0xe59fc000,         /* ldr   r12, [pc] */
-    0xe08ff00c,         /* add   pc, pc, ip */
-    0x00000000,         /* dcd   R_ARM_REL32(X-4) */
+    THUMB16_INSN(0xb401),             /* push {r0} */
+    THUMB16_INSN(0x4802),             /* ldr  r0, [pc, #8] */
+    THUMB16_INSN(0x46fc),             /* mov  ip, pc */
+    THUMB16_INSN(0x4484),             /* add  ip, r0 */
+    THUMB16_INSN(0xbc01),             /* pop  {r0} */
+    THUMB16_INSN(0x4760),             /* bx   ip */
+    DATA_WORD(0, R_ARM_REL32, 4),     /* dcd  R_ARM_REL32(X) */
   };
 
 /* Section name for stubs is the associated section name plus this
@@ -2081,7 +2148,11 @@ enum elf32_arm_stub_type
   arm_stub_long_branch_thumb_only,
   arm_stub_long_branch_v4t_thumb_arm,
   arm_stub_short_branch_v4t_thumb_arm,
-  arm_stub_long_branch_any_any_pic,
+  arm_stub_long_branch_any_arm_pic,
+  arm_stub_long_branch_any_thumb_pic,
+  arm_stub_long_branch_v4t_arm_thumb_pic,
+  arm_stub_long_branch_v4t_thumb_arm_pic,
+  arm_stub_long_branch_thumb_only_pic,
 };
 
 struct elf32_arm_stub_hash_entry
@@ -2100,7 +2171,14 @@ struct elf32_arm_stub_hash_entry
   bfd_vma target_value;
   asection *target_section;
 
+  /* The stub type.  */
   enum elf32_arm_stub_type stub_type;
+  /* Its encoding size in bytes.  */
+  int stub_size;
+  /* Its template.  */
+  const insn_sequence *stub_template;
+  /* The size of the template (number of entries).  */
+  int stub_template_size;
 
   /* The symbol table entry, if any, that this was derived from.  */
   struct elf32_arm_link_hash_entry *h;
@@ -2469,6 +2547,9 @@ stub_hash_newfunc (struct bfd_hash_entry *entry,
       eh->target_value = 0;
       eh->target_section = NULL;
       eh->stub_type = arm_stub_none;
+      eh->stub_size = 0;
+      eh->stub_template = NULL;
+      eh->stub_template_size = 0;
       eh->h = NULL;
       eh->id_sec = NULL;
     }
@@ -2744,6 +2825,8 @@ arm_stub_is_thumb (enum elf32_arm_stub_type stub_type)
     case arm_stub_long_branch_thumb_only:
     case arm_stub_long_branch_v4t_thumb_arm:
     case arm_stub_short_branch_v4t_thumb_arm:
+    case arm_stub_long_branch_v4t_thumb_arm_pic:
+    case arm_stub_long_branch_thumb_only_pic:
       return TRUE;
     case arm_stub_none:
       BFD_FAIL ();
@@ -2819,9 +2902,9 @@ arm_type_of_stub (struct bfd_link_info *info,
 		    /* PIC stubs.  */
 		    ? ((globals->use_blx)
 		       /* V5T and above.  */
-		       ? arm_stub_long_branch_any_any_pic
-		       /* not yet supported on V4T.  */
-		       : arm_stub_none)
+		       ? arm_stub_long_branch_any_thumb_pic
+		       /* On V4T, use Thumb code only.  */
+		       : arm_stub_long_branch_thumb_only_pic)
 
 		    /* non-PIC stubs.  */
 		    : ((globals->use_blx)
@@ -2833,8 +2916,8 @@ arm_type_of_stub (struct bfd_link_info *info,
 	      else
 		{
 		  stub_type = (info->shared | globals->pic_veneer)
-		    /* PIC stub not yet supported on V4T.  */
-		    ? arm_stub_none
+		    /* PIC stub.  */
+		    ? arm_stub_long_branch_thumb_only_pic
 		    /* non-PIC stub.  */
 		    : arm_stub_long_branch_thumb_only;
 		}
@@ -2856,9 +2939,9 @@ arm_type_of_stub (struct bfd_link_info *info,
 		/* PIC stubs.  */
 		? ((globals->use_blx)
 		   /* V5T and above.  */
-		   ? arm_stub_long_branch_any_any_pic
-		   /* not yet supported on V4T.  */
-		   : arm_stub_none)
+		   ? arm_stub_long_branch_any_arm_pic
+		   /* V4T PIC stub.  */
+		   : arm_stub_long_branch_v4t_thumb_arm_pic)
 
 		/* non-PIC stubs.  */
 		: ((globals->use_blx)
@@ -2899,7 +2982,12 @@ arm_type_of_stub (struct bfd_link_info *info,
 	    {
 	      stub_type = (info->shared | globals->pic_veneer)
 		/* PIC stubs.  */
-		? arm_stub_long_branch_any_any_pic
+		? ((globals->use_blx)
+		   /* V5T and above.  */
+		   ? arm_stub_long_branch_any_thumb_pic
+		   /* V4T stub.  */
+		   : arm_stub_long_branch_v4t_arm_thumb_pic)
+
 		/* non-PIC stubs.  */
 		: ((globals->use_blx)
 		   /* V5T and above.  */
@@ -2916,7 +3004,7 @@ arm_type_of_stub (struct bfd_link_info *info,
 	    {
 	      stub_type = (info->shared | globals->pic_veneer)
 		/* PIC stubs.  */
-		? arm_stub_long_branch_any_any_pic
+		? arm_stub_long_branch_any_arm_pic
 		/* non-PIC stubs.  */
 		: arm_stub_long_branch_any_any;
 	    }
@@ -3108,9 +3196,11 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry,
   bfd_vma sym_value;
   int template_size;
   int size;
-  const bfd_vma *template;
+  const insn_sequence *template;
   int i;
   struct elf32_arm_link_hash_table * globals;
+  int stub_reloc_idx = -1;
+  int stub_reloc_offset = 0;
 
   /* Massage our args to the form they really have.  */
   stub_entry = (struct elf32_arm_stub_hash_entry *) gen_entry;
@@ -3136,101 +3226,61 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry,
 	       + stub_entry->target_section->output_offset
 	       + stub_entry->target_section->output_section->vma);
 
-  switch (stub_entry->stub_type)
-    {
-    case arm_stub_long_branch_any_any:
-      template = elf32_arm_stub_long_branch_any_any;
-      template_size = (sizeof (elf32_arm_stub_long_branch_any_any) / sizeof (bfd_vma)) * 4;
-      break;
-    case arm_stub_long_branch_v4t_arm_thumb:
-      template =  elf32_arm_stub_long_branch_v4t_arm_thumb;
-      template_size = (sizeof (elf32_arm_stub_long_branch_v4t_arm_thumb) / sizeof (bfd_vma)) * 4;
-      break;
-    case arm_stub_long_branch_thumb_only:
-      template =  elf32_arm_stub_long_branch_thumb_only;
-      template_size = (sizeof (elf32_arm_stub_long_branch_thumb_only) / sizeof (bfd_vma)) * 4;
-      break;
-    case arm_stub_long_branch_v4t_thumb_arm:
-      template =  elf32_arm_stub_long_branch_v4t_thumb_arm;
-      template_size = (sizeof (elf32_arm_stub_long_branch_v4t_thumb_arm) / sizeof (bfd_vma)) * 4;
-      break;
-    case arm_stub_short_branch_v4t_thumb_arm:
-      template =  elf32_arm_stub_short_branch_v4t_thumb_arm;
-      template_size = (sizeof(elf32_arm_stub_short_branch_v4t_thumb_arm) / sizeof (bfd_vma)) * 4;
-      break;
-    case arm_stub_long_branch_any_any_pic:
-      template = elf32_arm_stub_long_branch_any_any_pic;
-      template_size = (sizeof (elf32_arm_stub_long_branch_any_any_pic) / sizeof (bfd_vma)) * 4;
-      break;
-    default:
-      BFD_FAIL ();
-      return FALSE;
-    }
+  template = stub_entry->stub_template;
+  template_size = stub_entry->stub_template_size;
 
   size = 0;
-  for (i = 0; i < (template_size / 4); i++)
+  for (i = 0; i < template_size; i++)
     {
-      /* A 0 pattern is a placeholder, every other pattern is an
-	 instruction.  */
-      if (template[i] != 0)
-	put_arm_insn (globals, stub_bfd, template[i], loc + size);
-      else
-	bfd_put_32 (stub_bfd, template[i], loc + size);
+      switch (template[i].type)
+	{
+	case THUMB16_TYPE:
+	  put_thumb_insn (globals, stub_bfd, template[i].data, loc + size);
+	  size += 2;
+	  break;
+
+	case ARM_TYPE:
+	  put_arm_insn (globals, stub_bfd, template[i].data, loc + size);
+	  /* Handle cases where the target is encoded within the
+	     instruction.  */
+	  if (template[i].r_type == R_ARM_JUMP24)
+	    {
+	      stub_reloc_idx = i;
+	      stub_reloc_offset = size;
+	    }
+	  size += 4;
+	  break;
 
-      size += 4;
+	case DATA_TYPE:
+	  bfd_put_32 (stub_bfd, template[i].data, loc + size);
+	  stub_reloc_idx = i;
+	  stub_reloc_offset = size;
+	  size += 4;
+	  break;
+
+	default:
+	  BFD_FAIL ();
+	  return FALSE;
+	}
     }


hooks/post-receive
--
Repository for Project Archer.


             reply	other threads:[~2009-02-28 20:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-28 20:29 jkratoch [this message]
2009-03-12 20:10 jkratoch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090228202909.10644.qmail@sourceware.org \
    --to=jkratoch@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).