public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-keiths-linespec-rewrite: Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite
@ 2012-03-16 23:48 kseitz
  0 siblings, 0 replies; 8+ messages in thread
From: kseitz @ 2012-03-16 23:48 UTC (permalink / raw)
  To: archer-commits

The branch, archer-keiths-linespec-rewrite has been updated
       via  0f71eb02bb04e340cad29d5f0ffde88bce7e5242 (commit)
       via  7d88a86396ca36f64a7e5d435ebc8439532d07d9 (commit)
       via  d5bc117868b2062712a1b3de41de8d0a79b669c2 (commit)
       via  b3a19e4dbf598ae0b33e80f77583b25b94196459 (commit)
       via  fb064b7e2ed57d24a5deb87245ccba336a161d3e (commit)
       via  facda9cb2701bda45dc901ecf9be8115b70f04d5 (commit)
       via  c55ff693014c302c8b91b99cee0484751f105e15 (commit)
       via  e6fdde6964c1d797f9e9337adb0afe24e46ae9db (commit)
       via  759c5fffb2d76fa8844c2ee5ec91746dcea434a8 (commit)
       via  7f8076204b091192cb2050f5aa80cdf4c45a7926 (commit)
       via  cc89c790f5fe692768ba246325c71b7e58f496f6 (commit)
       via  cf56649757d05c7bbe2f76d9fcadfdee65b99c7d (commit)
       via  d77939f6c2c8efa0e583abbf61a0920eabb579a2 (commit)
       via  e4e4948e3da703ffc745386e7462851c02a31c4e (commit)
       via  5cddcb364a808283eed8f4a427796a789b83ebde (commit)
       via  e384caece0b8fadc1c904bab294f749b3e0472a3 (commit)
       via  75dcd60a60fa0e3f47d558b8312d00fe2b08efa4 (commit)
       via  171e9f303ff92d99018142fc40bca86989ca396b (commit)
       via  601078dae9e3e738ab39bfe5eee21f653304f485 (commit)
      from  53031c1df4ddea9b5f0d44341e062362fcf878e3 (commit)

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

- Log -----------------------------------------------------------------
commit 0f71eb02bb04e340cad29d5f0ffde88bce7e5242
Merge: 7d88a86 d5bc117
Author: Keith Seitz <keiths@redhat.com>
Date:   Fri Mar 16 16:44:28 2012 -0700

    Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite
    
    Conflicts:
    	gdb/linespec.c

commit 7d88a86396ca36f64a7e5d435ebc8439532d07d9
Author: Keith Seitz <keiths@redhat.com>
Date:   Fri Mar 16 16:16:52 2012 -0700

    "end-of-input" -> "end of input"

commit d5bc117868b2062712a1b3de41de8d0a79b669c2
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Mar 16 18:26:00 2012 +0000

    gdb/
    	PR symtab/13777
    	* dwarf2read.c (process_full_comp_unit): Set LOCATIONS_VALID only for
    	GCC >=4.5.
    
    gdb/testsuite/
    	PR symtab/13777
    	* gdb.dwarf2/dw2-skip-prologue.S (DW_AT_producer): Set it to 4.5.0.

commit b3a19e4dbf598ae0b33e80f77583b25b94196459
Author: Tom Tromey <tromey@redhat.com>
Date:   Fri Mar 16 18:22:23 2012 +0000

    2012-03-16  Chris January  <chris.january@allinea.com>
    
    	* tui-tui.win.c (tui_resize_all): Use erase and clearok instead
    	of clear.

commit fb064b7e2ed57d24a5deb87245ccba336a161d3e
Author: Tom Tromey <tromey@redhat.com>
Date:   Fri Mar 16 18:20:28 2012 +0000

    2012-03-16  Chris January  <chris.january@allinea.com>
    
    	* source.c (add_path): Use memmove instead of strcpy because the
    	strings overlap.

commit facda9cb2701bda45dc901ecf9be8115b70f04d5
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Fri Mar 16 17:55:39 2012 +0000

    [Ada] Crash when trying to set value of packed array element
    
    Consider the following declaration:
    
       type Small is new Integer range 0 .. 2 ** 4 - 1;
       type Simple_Array is array (1 .. 4) of Small;
       pragma Pack (Simple_Array);
    
       SA : Simple_Array := (1, 2, 3, 4);
    
    Trying to change the value of one of the elements in the packed array
    causes the debugger to crash:
    
        (gdb) set sa(3) := 9
        [1]    4880 segmentation fault  gdb -q foo
    
    The circumstances leading to the crash are as follow:
    
       . ada_evaluate_subexp creates a value corresponding to "sa(3)".
    
       . ada_evaluate_subexp then tries to assign 9 to this value, and
         for this calls value_assign (via ada_value_assign).
    
       . Because the array is packed, the destination value is 3 bits long,
         and as a result, value_assign uses the parent to determine that
         element byte address and offset:
    
          | if (value_bitsize (toval))
          |   {
          |     struct value *parent = value_parent (toval);
          |
          |     changed_addr = value_address (parent) + value_offset (toval);
    
    The destination value (corresponding to "sa(3)") was incorrectly created
    by ada-lang.c:ada_value_primitive_packed_val, because the "parent" was
    left as NULL. So, when we try to dereference it to get the parent address,
    GDB crashed.
    
    The first part of the fix therefore consists in setting that field.
    This required the addition of a new "setter" in value.[hc].  It fixes
    the crash, but is still not sufficient for the assignment to actually
    work.
    
    The second part of the problem came from the fact that value_assign
    seems to expect the "child"'s address to be equal to the parent's address,
    with the difference being the offset. Unfortunately, this requirement was
    not followed by ada_value_primitive_packed_val, so the second part of
    the fix consisted in fixing that.
    
    Still, this was not sufficient, because it caused a regression when
    trying to perform an aggregate assignment of a packed array of packed
    record.  The key element here is the nesting of packed entities.
    Looking at the way ada_value_primitive_packed_val creates the value
    of each sub-component, one can see that the value's offset is set
    to the offset compared to the start of the parent. This was meant to
    match what value_primitive_field does as well.
    
    So, with our array of records, if the record offset was 2, and if
    the field we're interested in that record is at offset 1, the record
    value's offset would be set to 2, and the field value's offset would
    be set to 1. But the address for both values would be left to the
    array's address. This is where things start breaking down, because
    the value_address function for our field value would return the
    address of the array + 1, instead of + 3.
    
    This is what causes the final issue, here, because ada-lang.c's
    value_assign_to_component needs to compute the offset of the
    subcomponent compared to the top-level aggregate's start address
    (the array in our case). And it does so by subtracting the array's
    address from the sub-component's address.  When you have two levels
    of packed components, and the mid-level component is at an offset of
    the top-level component, things didn't work, because the component's
    address was miscomputed (the parent's offset is missing).
    
    The fix consists is fixing value_address to match the work done by
    value_primitive_field (where we ignore the parent's offset).
    
    gdb/ChangeLog:
    
            * value.h (set_value_parent): Add declaration.
            * value.c (set_value_parent): New function.
            (value_address): If VALUE->PARENT is not NULL, then use it as
            the base address instead of VALUE->LOCATION.address.
            * ada-lang.c (ada_value_primitive_packed_val): Keep V's address
            the same as OBJ's address.  Adjust V's offset accordingly.
            Set V's parent.
    
    gdb/testsuite/ChangeLog:
    
            * gdb.ada/set_pckd_arr_elt: New testcase.

commit c55ff693014c302c8b91b99cee0484751f105e15
Author: gary <gary>
Date:   Fri Mar 16 16:47:29 2012 +0000

    gdb:
    	PR breakpoints/10738
    	* dwarf2read.c (use_deprecated_index_sections): New global.
    	(struct partial_die_info): New member may_be_inlined.
    	(read_partial_die): Set may_be_inlined where appropriate.
    	(add_partial_subprogram): Add partial symbols for partial
    	DIEs that may be inlined.
    	(new_symbol_full): Add inlined subroutines to the current
    	scope.
    	(write_psymtabs_to_index): Bump version number.
    	(dwarf2_read_index): Read only version 6 indices unless
    	use_deprecated_index_sections is set.
    	* linespec.c (symbol_and_data_callback): New structure.
    	(iterate_inline_only): New function.
    	(iterate_over_all_matching_symtabs): New argument
    	"include_inline".  If nonzero, also call the callback for
    	symbols representing inlined subroutines.
    	(lookup_prefix_sym): Pass extra argument to the above.
    	(find_function_symbols): Likewise.
    	(add_matching_symbols_to_info): Likewise.
    	* NEWS: Mention that GDB can now set breakpoints on inlined
    	functions.
    
    gdb/doc:
    	PR breakpoints/10738
    	* gdb.texinfo (Inline Functions): Remove the now-unnecessary @item
    	stating that GDB cannot set breakpoints on inlined functions.
    	(Mode Options): Document --use-deprecated-index-sections.
    	(Index Section Format): Document new index section version format.
    
    gdb/testsuite:
    	PR breakpoints/10738
    	* gdb.opt/inline-break.exp: New file.
    	* gdb.opt/inline-break.c: Likewise.
    	* gdb.dwarf2/inline-break.exp: Likewise.
    	* gdb.dwarf2/inline-break.S: Likewise.
    	* gdb.base/annota1.exp: Cope with old .gdb_index warnings.
    	* gdb.base/async-shell.exp: Likewise.
    	* lib/mi-support.exp (library_loaded_re): Likewise.

commit e6fdde6964c1d797f9e9337adb0afe24e46ae9db
Author: mgretton <mgretton>
Date:   Fri Mar 16 15:15:13 2012 +0000

    	* bfd/elf32-arm.c (elf32_arm_attributes_accept_div): New function.
    	(elf32_arm_attributes_forbid_div): Likewise.
    	(elf32_arm_merge_eabi_attributes): Correct handling of
    	Tag_DIV_use.

commit 759c5fffb2d76fa8844c2ee5ec91746dcea434a8
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Fri Mar 16 12:14:31 2012 +0000

    	* ppc-dis.c (PPC_OPC_SEGS, PPC_OP_TO_SEG): Delete.
    	(powerpc_opcd_indices): Bump array size.
    	(disassemble_init_powerpc): Set powerpc_opcd_indices entries
    	corresponding to unused opcodes to following entry.
    	(lookup_powerpc): New function, extracted and optimised from..
    	(print_insn_powerpc): ..here.

commit 7f8076204b091192cb2050f5aa80cdf4c45a7926
Author: Pierre Muller <muller@ics.u-strasbg.fr>
Date:   Fri Mar 16 11:10:04 2012 +0000

    	* p-typeprint.c (pascal_type_print_method_args):
    	Fix display of parameter of methods.

commit cc89c790f5fe692768ba246325c71b7e58f496f6
Author: Pierre Muller <muller@ics.u-strasbg.fr>
Date:   Fri Mar 16 10:54:38 2012 +0000

    	* amd64-windows-nat.c (_initialize_amd64_windows_nat):
    	Add missing prototype.

commit cf56649757d05c7bbe2f76d9fcadfdee65b99c7d
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Mar 16 08:18:07 2012 +0000

    gdb/
    	Fix false compilation warning.
    	* gnu-v3-abi.c (print_one_vtable): Initialize ADDR.

commit d77939f6c2c8efa0e583abbf61a0920eabb579a2
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Fri Mar 16 00:00:33 2012 +0000

    *** empty log message ***

commit e4e4948e3da703ffc745386e7462851c02a31c4e
Merge: e384cae 75dcd60
Author: Keith Seitz <keiths@redhat.com>
Date:   Thu Mar 15 16:01:03 2012 -0700

    Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite

commit 5cddcb364a808283eed8f4a427796a789b83ebde
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Thu Mar 15 23:00:05 2012 +0000

    daily update

commit e384caece0b8fadc1c904bab294f749b3e0472a3
Author: Keith Seitz <keiths@redhat.com>
Date:   Thu Mar 15 12:38:56 2012 -0700

    More consistent wording of error messages.

commit 75dcd60a60fa0e3f47d558b8312d00fe2b08efa4
Author: Jonathan Larmour <jifl@eCosCentric.com>
Date:   Thu Mar 15 18:53:42 2012 +0000

    	* arm-tdep.c: Include "remote.h" and "features/arm-with-m-fpa-layout.c".
    	(arm_register_g_packet_guesses): New function.
    	(arm_gdbarch_init): Don't force a target description with
    	registers when the executable is detected as M-profile.  Instead
    	set gdbarch->tdep->is_m.  Register `g' packet guesses.
    	(_initialize_arm_tdep): Initialize the new target description.
    	* features/arm-with-m-fpa-layout.xml: New description.
    	* features/arm-with-m-fpa-layout.c: New, generated.

commit 171e9f303ff92d99018142fc40bca86989ca396b
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Thu Mar 15 18:33:43 2012 +0000

    Problem after hitting breakpoint on Windows (with GDBserver)
    
    When debugging on Windows with GDBserver, the debugger starts
    failing after hitting a breakpoint.  For instance:
    
        (gdb) b foo
        Breakpoint 1 at 0x40177e: file foo.adb, line 5.
        (gdb) cont
        Continuing.
    
        Breakpoint 1, foo () at foo.adb:5
        5          Put_Line ("Hello World.");  -- STOP
        (gdb) n
    
        Program received signal SIGSEGV, Segmentation fault.
        0x00401782 in foo () at foo.adb:5
        5          Put_Line ("Hello World.");  -- STOP
    
    There are two issues:
    
      1. While trying to re-insert a breakpoint that is still inserted
         in memory, insert_bp_location wipes out the breakpoint location's
         shadow_contents.  As a consequence, we cannot restore the proper
         instruction when removing the breakpoint anymore.  That's why
         the inferior's behavior changes when trying to resume after
         the breakpoint was hit.
    
      2. mem-break.c:default_memory_insert_breakpoint passes a breakpoint
         location's shadow_contents as the buffer for a memory read.
         This reveals a limitation of the various memory-read target
         functions.  This patch documents this limitation and adjust
         the two calls that seem to hit that limitation.
    
    gdb/ChangeLog:
    
            * breakpoint.c (breakpoint_xfer_memory): Add assertion.
            Update function description.
            (insert_bp_location): Do not wipe bl->target_info out.
            * mem-break.c: #include "gdb_string.h".
            (default_memory_insert_breakpoint): Do not call target_read_memory
            with a pointer to the breakpoint's shadow_contents buffer.  Use
            a local buffer instead.
            * m32r-tdep.c (m32r_memory_insert_breakpoint): Ditto.

commit 601078dae9e3e738ab39bfe5eee21f653304f485
Author: Roland McGrath <roland@gnu.org>
Date:   Thu Mar 15 18:20:21 2012 +0000

    	* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Use
    	elf_x86_64_backend_data parameters for plt_eh_frame.
    
    Change-Id: I4e1a7c2787ed1276765e269f50fc8ba89bab41d5

-----------------------------------------------------------------------

Summary of changes:
 bfd/ChangeLog                                  |   10 +
 bfd/elf32-arm.c                                |   79 +-
 bfd/elf64-x86-64.c                             |   10 +-
 bfd/version.h                                  |    2 +-
 gdb/ChangeLog                                  |   89 ++
 gdb/NEWS                                       |   11 +
 gdb/ada-lang.c                                 |   17 +-
 gdb/amd64-windows-nat.c                        |    3 +
 gdb/arm-tdep.c                                 |   42 +-
 gdb/breakpoint.c                               |   21 +-
 gdb/doc/ChangeLog                              |    8 +
 gdb/doc/gdb.texinfo                            |   24 +-
 gdb/dwarf2read.c                               |   62 +-
 gdb/features/arm-with-m-fpa-layout.c           |   44 +
 gdb/features/arm-with-m-fpa-layout.xml         |   45 +
 gdb/gnu-v3-abi.c                               |    3 +-
 gdb/linespec.c                                 |   59 +-
 gdb/m32r-tdep.c                                |    3 +-
 gdb/main.c                                     |    6 +
 gdb/mem-break.c                                |   17 +-
 gdb/p-typeprint.c                              |    3 +-
 gdb/source.c                                   |    2 +-
 gdb/symfile.h                                  |    3 +
 gdb/testsuite/ChangeLog                        |   20 +
 gdb/testsuite/gdb.ada/set_pckd_arr_elt.exp     |   47 +
 gdb/testsuite/gdb.ada/set_pckd_arr_elt/foo.adb |   22 +
 gdb/testsuite/gdb.ada/set_pckd_arr_elt/pck.adb |   21 +
 gdb/testsuite/gdb.ada/set_pckd_arr_elt/pck.ads |   22 +
 gdb/testsuite/gdb.base/annota1.exp             |    2 +-
 gdb/testsuite/gdb.base/async-shell.exp         |    4 +-
 gdb/testsuite/gdb.dwarf2/dw2-inline-break.S    | 1663 ++++++++++++++++++++++++
 gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp  |  124 ++
 gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S   |    2 +-
 gdb/testsuite/gdb.linespec/ls-errs.exp         |    8 +-
 gdb/testsuite/gdb.opt/inline-break.c           |  159 +++
 gdb/testsuite/gdb.opt/inline-break.exp         |  114 ++
 gdb/testsuite/lib/mi-support.exp               |    3 +-
 gdb/tui/tui-win.c                              |   11 +-
 gdb/value.c                                    |   13 +-
 gdb/value.h                                    |    1 +
 gdb/version.in                                 |    2 +-
 opcodes/ChangeLog                              |    9 +
 opcodes/ppc-dis.c                              |  115 +-
 43 files changed, 2779 insertions(+), 146 deletions(-)
 create mode 100644 gdb/features/arm-with-m-fpa-layout.c
 create mode 100644 gdb/features/arm-with-m-fpa-layout.xml
 create mode 100644 gdb/testsuite/gdb.ada/set_pckd_arr_elt.exp
 create mode 100644 gdb/testsuite/gdb.ada/set_pckd_arr_elt/foo.adb
 create mode 100644 gdb/testsuite/gdb.ada/set_pckd_arr_elt/pck.adb
 create mode 100644 gdb/testsuite/gdb.ada/set_pckd_arr_elt/pck.ads
 create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-inline-break.S
 create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp
 create mode 100644 gdb/testsuite/gdb.opt/inline-break.c
 create mode 100644 gdb/testsuite/gdb.opt/inline-break.exp

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 0a674b8..15819e6 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,15 @@
+2012-03-16  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
+
+	* elf32-arm.c (elf32_arm_attributes_accept_div): New function.
+	(elf32_arm_attributes_forbid_div): Likewise.
+	(elf32_arm_merge_eabi_attributes): Correct handling of
+	Tag_DIV_use.
+
 2012-03-15  Roland McGrath  <mcgrathr@google.com>
 
+	* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Use
+	elf_x86_64_backend_data parameters for plt_eh_frame.
+
 	* elf64-x86-64.c (struct elf_x86_64_backend_data): New type.
 	(get_elf_x86_64_backend_data, GET_PLT_ENTRY_SIZE): New macros.
 	(elf_x86_64_arch_bed): New variable.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 9231552..8721f94 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -11268,6 +11268,46 @@ tag_cpu_arch_combine (bfd *ibfd, int oldtag, int *secondary_compat_out,
 #undef T
 }
 
+/* Query attributes object to see if integer divide instructions may be
+   present in an object.  */
+static bfd_boolean
+elf32_arm_attributes_accept_div (const obj_attribute *attr)
+{
+  int arch = attr[Tag_CPU_arch].i;
+  int profile = attr[Tag_CPU_arch_profile].i;
+
+  switch (attr[Tag_DIV_use].i)
+    {
+    case 0:
+      /* Integer divide allowed if instruction contained in archetecture.  */
+      if (arch == TAG_CPU_ARCH_V7 && (profile == 'R' || profile == 'M'))
+	return TRUE;
+      else if (arch >= TAG_CPU_ARCH_V7E_M)
+	return TRUE;
+      else
+	return FALSE;
+
+    case 1:
+      /* Integer divide explicitly prohibited.  */
+      return FALSE;
+
+    default:
+      /* Unrecognised case - treat as allowing divide everywhere.  */
+    case 2:
+      /* Integer divide allowed in ARM state.  */
+      return TRUE;
+    }
+}
+
+/* Query attributes object to see if integer divide instructions are
+   forbidden to be in the object.  This is not the inverse of
+   elf32_arm_attributes_accept_div.  */
+static bfd_boolean
+elf32_arm_attributes_forbid_div (const obj_attribute *attr)
+{
+  return attr[Tag_DIV_use].i == 1;
+}
+
 /* Merge EABI object attributes from IBFD into OBFD.  Raise an error if there
    are conflicting attributes.  */
 
@@ -11709,29 +11749,22 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
 	  break;
 
 	case Tag_DIV_use:
-	  /* This tag is set to zero if we can use UDIV and SDIV in Thumb
-	     mode on a v7-M or v7-R CPU; to one if we can not use UDIV or
-	     SDIV at all; and to two if we can use UDIV or SDIV on a v7-A
-	     CPU.  We will merge as follows: If the input attribute's value
-	     is one then the output attribute's value remains unchanged.  If
-	     the input attribute's value is zero or two then if the output
-	     attribute's value is one the output value is set to the input
-	     value, otherwise the output value must be the same as the
-	     inputs.  */ 
-	  if (in_attr[i].i != 1 && out_attr[i].i != 1) 
-	    { 
-	      if (in_attr[i].i != out_attr[i].i)
-		{
-		  _bfd_error_handler
-		    (_("DIV usage mismatch between %B and %B"),
-		     ibfd, obfd); 
-		  result = FALSE;
-		}
-	    } 
-
-	  if (in_attr[i].i != 1)
-	    out_attr[i].i = in_attr[i].i; 
-	  
+	  /* A value of zero on input means that the divide instruction may
+	     be used if available in the base architecture as specified via
+	     Tag_CPU_arch and Tag_CPU_arch_profile.  A value of 1 means that
+	     the user did not want divide instructions.  A value of 2
+	     explicitly means that divide instructions were allowed in ARM
+	     and Thumb state.  */
+	  if (in_attr[i].i == out_attr[i].i)
+	    /* Do nothing.  */ ;
+	  else if (elf32_arm_attributes_forbid_div (in_attr)
+		   && !elf32_arm_attributes_accept_div (out_attr))
+	    out_attr[i].i = 1;
+	  else if (elf32_arm_attributes_forbid_div (out_attr)
+		   && elf32_arm_attributes_accept_div (in_attr))
+	    out_attr[i].i = in_attr[i].i;
+	  else if (in_attr[i].i == 2)
+	    out_attr[i].i = in_attr[i].i;
 	  break;
 
 	case Tag_MPextension_use_legacy:
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index c0a4493..51204a5 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -981,6 +981,8 @@ elf_x86_64_create_dynamic_sections (bfd *dynobj,
       && bfd_get_section_by_name (dynobj, ".eh_frame") == NULL
       && htab->elf.splt != NULL)
     {
+      const struct elf_x86_64_backend_data *const abed
+        = get_elf_x86_64_backend_data (dynobj);
       flagword flags = get_elf_backend_data (dynobj)->dynamic_sec_flags;
       htab->plt_eh_frame
 	= bfd_make_section_with_flags (dynobj, ".eh_frame",
@@ -989,11 +991,11 @@ elf_x86_64_create_dynamic_sections (bfd *dynobj,
 	  || !bfd_set_section_alignment (dynobj, htab->plt_eh_frame, 3))
 	return FALSE;
 
-      htab->plt_eh_frame->size = sizeof (elf_x86_64_eh_frame_plt);
+      htab->plt_eh_frame->size = abed->eh_frame_plt_size;
       htab->plt_eh_frame->contents
-	= bfd_alloc (dynobj, htab->plt_eh_frame->size);
-      memcpy (htab->plt_eh_frame->contents, elf_x86_64_eh_frame_plt,
-	      sizeof (elf_x86_64_eh_frame_plt));
+        = bfd_alloc (dynobj, htab->plt_eh_frame->size);
+      memcpy (htab->plt_eh_frame->contents,
+              abed->eh_frame_plt, abed->eh_frame_plt_size);
     }
   return TRUE;
 }
diff --git a/bfd/version.h b/bfd/version.h
index c00a05b..f1ed722 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20120315
+#define BFD_VERSION_DATE 20120316
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1a75508..7325047 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,92 @@
+2012-03-16  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	PR symtab/13777
+	* dwarf2read.c (process_full_comp_unit): Set LOCATIONS_VALID only for
+	GCC >=4.5.
+
+2012-03-16  Chris January  <chris.january@allinea.com>
+
+	* tui-tui.win.c (tui_resize_all): Use erase and clearok instead
+	of clear.
+
+2012-03-16  Chris January  <chris.january@allinea.com>
+
+	* source.c (add_path): Use memmove instead of strcpy because the
+	strings overlap.
+
+2012-03-16  Joel Brobecker  <brobecker@adacore.com>
+
+	* value.h (set_value_parent): Add declaration.
+	* value.c (set_value_parent): New function.
+	(value_address): If VALUE->PARENT is not NULL, then use it as
+	the base address instead of VALUE->LOCATION.address.
+	* ada-lang.c (ada_value_primitive_packed_val): Keep V's address
+	the same as OBJ's address.  Adjust V's offset accordingly.
+	Set V's parent.
+
+2012-03-16  Gary Benson  <gbenson@redhat.com>
+
+	PR breakpoints/10738
+	* dwarf2read.c (use_deprecated_index_sections): New global.
+	(struct partial_die_info): New member may_be_inlined.
+	(read_partial_die): Set may_be_inlined where appropriate.
+	(add_partial_subprogram): Add partial symbols for partial
+	DIEs that may be inlined.
+	(new_symbol_full): Add inlined subroutines to the current
+	scope.
+	(write_psymtabs_to_index): Bump version number.
+	(dwarf2_read_index): Read only version 6 indices unless
+	use_deprecated_index_sections is set.
+	* linespec.c (symbol_and_data_callback): New structure.
+	(iterate_inline_only): New function.
+	(iterate_over_all_matching_symtabs): New argument
+	"include_inline".  If nonzero, also call the callback for
+	symbols representing inlined subroutines.
+	(lookup_prefix_sym): Pass extra argument to the above.
+	(find_function_symbols): Likewise.
+	(add_matching_symbols_to_info): Likewise.
+	* NEWS: Mention that GDB can now set breakpoints on inlined
+	functions.
+
+2012-03-16  Pierre Muller  <muller@ics.u-strasbg.fr>
+
+	* p-typeprint.c (pascal_type_print_method_args):
+	Fix display of parameter of methods.
+
+2012-03-16  Pierre Muller  <muller@ics.u-strasbg.fr>
+
+	* amd64-windows-nat.c (_initialize_amd64_windows_nat):
+	Add missing prototype.
+
+2012-03-16  Yao Qi  <yao@codesourcery.com>
+	    Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Fix false compilation warning.
+	* gnu-v3-abi.c (print_one_vtable): Initialize ADDR.
+
+2012-03-15  Jonathan Larmour  <jifl@eCosCentric.com>
+	    Pedro Alves  <pedro@codesourcery.com>
+
+	* arm-tdep.c: Include "remote.h" and "features/arm-with-m-fpa-layout.c".
+	(arm_register_g_packet_guesses): New function.
+	(arm_gdbarch_init): Don't force a target description with
+	registers when the executable is detected as M-profile.  Instead
+	set gdbarch->tdep->is_m.  Register `g' packet guesses.
+	(_initialize_arm_tdep): Initialize the new target description.
+	* features/arm-with-m-fpa-layout.xml: New description.
+	* features/arm-with-m-fpa-layout.c: New, generated.
+
+2012-03-15  Joel Brobecker  <brobecker@adacore.com>
+
+	* breakpoint.c (breakpoint_xfer_memory): Add assertion.
+	Update function description.
+	(insert_bp_location): Do not wipe bl->target_info out.
+	* mem-break.c: #include "gdb_string.h".
+	(default_memory_insert_breakpoint): Do not call target_read_memory
+	with a pointer to the breakpoint's shadow_contents buffer.  Use
+	a local buffer instead.
+	* m32r-tdep.c (m32r_memory_insert_breakpoint): Ditto.
+
 2012-03-15  Tom Tromey  <tromey@redhat.com>
 
 	* NEWS: Mention "info vtbl", not "info vtable".
diff --git a/gdb/NEWS b/gdb/NEWS
index 6444984..e6bf59c 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -62,6 +62,17 @@
 * The "info static-tracepoint-marker" command will now also work on
   native Linux targets with in-process agent.
 
+* GDB can now set breakpoints on inlined functions.
+
+* The .gdb_index section has been updated to include symbols for
+  inlined functions.  GDB will ignore older .gdb_index sections by
+  default, which could cause symbol files to be loaded more slowly
+  until their .gdb_index sections can be recreated.  The new option
+  --use-deprecated-index-sections will cause GDB to use any older
+  .gdb_index sections it finds.  This will restore performance, but
+  the ability to set breakpoints on inlined functions will be lost
+  in symbol files with older .gdb_index sections.
+
 * New commands
 
   ** "catch load" and "catch unload" can be used to stop when a shared
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 040d606..78a0261 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -2297,10 +2297,9 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
     }
   else if (VALUE_LVAL (obj) == lval_memory && value_lazy (obj))
     {
-      v = value_at (type,
-                    value_address (obj) + offset);
+      v = value_at (type, value_address (obj));
       bytes = (unsigned char *) alloca (len);
-      read_memory (value_address (v), bytes, len);
+      read_memory (value_address (v) + offset, bytes, len);
     }
   else
     {
@@ -2310,18 +2309,22 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
 
   if (obj != NULL)
     {
-      CORE_ADDR new_addr;
+      long new_offset = offset;
 
       set_value_component_location (v, obj);
-      new_addr = value_address (obj) + offset;
       set_value_bitpos (v, bit_offset + value_bitpos (obj));
       set_value_bitsize (v, bit_size);
       if (value_bitpos (v) >= HOST_CHAR_BIT)
         {
-	  ++new_addr;
+	  ++new_offset;
           set_value_bitpos (v, value_bitpos (v) - HOST_CHAR_BIT);
         }
-      set_value_address (v, new_addr);
+      set_value_offset (v, new_offset);
+
+      /* Also set the parent value.  This is needed when trying to
+	 assign a new value (in inferior memory).  */
+      set_value_parent (v, obj);
+      value_incref (obj);
     }
   else
     set_value_bitsize (v, bit_size);
diff --git a/gdb/amd64-windows-nat.c b/gdb/amd64-windows-nat.c
index 49119d1..bc2c047 100644
--- a/gdb/amd64-windows-nat.c
+++ b/gdb/amd64-windows-nat.c
@@ -85,6 +85,9 @@ static const int mappings[] =
 };
 #undef context_offset
 
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_amd64_windows_nat;
+
 void
 _initialize_amd64_windows_nat (void)
 {
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index b4da01d..a3cdc7c 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -40,6 +40,7 @@
 #include "dwarf2-frame.h"
 #include "gdbtypes.h"
 #include "prologue-value.h"
+#include "remote.h"
 #include "target-descriptions.h"
 #include "user-regs.h"
 #include "observer.h"
@@ -55,6 +56,7 @@
 #include "vec.h"
 
 #include "features/arm-with-m.c"
+#include "features/arm-with-m-fpa-layout.c"
 #include "features/arm-with-iwmmxt.c"
 #include "features/arm-with-vfpv2.c"
 #include "features/arm-with-vfpv3.c"
@@ -9665,6 +9667,41 @@ arm_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
 }
 
 \f
+/* For backward-compatibility we allow two 'g' packet lengths with
+   the remote protocol depending on whether FPA registers are
+   supplied.  M-profile targets do not have FPA registers, but some
+   stubs already exist in the wild which use a 'g' packet which
+   supplies them albeit with dummy values.  The packet format which
+   includes FPA registers should be considered deprecated for
+   M-profile targets.  */
+
+static void
+arm_register_g_packet_guesses (struct gdbarch *gdbarch)
+{
+  if (gdbarch_tdep (gdbarch)->is_m)
+    {
+      /* If we know from the executable this is an M-profile target,
+	 cater for remote targets whose register set layout is the
+	 same as the FPA layout.  */
+      register_remote_g_packet_guess (gdbarch,
+				      /* r0-r12,sp,lr,pc; f0-f7; fps,cpsr */
+				      (16 * INT_REGISTER_SIZE)
+				      + (8 * FP_REGISTER_SIZE)
+				      + (2 * INT_REGISTER_SIZE),
+				      tdesc_arm_with_m_fpa_layout);
+
+      /* The regular M-profile layout.  */
+      register_remote_g_packet_guess (gdbarch,
+				      /* r0-r12,sp,lr,pc; xpsr */
+				      (16 * INT_REGISTER_SIZE)
+				      + INT_REGISTER_SIZE,
+				      tdesc_arm_with_m);
+    }
+
+  /* Otherwise we don't have a useful guess.  */
+}
+
+\f
 /* Initialize the current architecture based on INFO.  If possible,
    re-use an architecture from ARCHES, which is a list of
    architectures already created during this debugging session.
@@ -9798,7 +9835,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 		  && (attr_arch == TAG_CPU_ARCH_V6_M
 		      || attr_arch == TAG_CPU_ARCH_V6S_M
 		      || attr_profile == 'M'))
-		tdesc = tdesc_arm_with_m;
+		is_m = 1;
 #endif
 	    }
 
@@ -10055,6 +10092,8 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   tdep->have_neon_pseudos = have_neon_pseudos;
   tdep->have_neon = have_neon;
 
+  arm_register_g_packet_guesses (gdbarch);
+
   /* Breakpoints.  */
   switch (info.byte_order_for_code)
     {
@@ -10291,6 +10330,7 @@ _initialize_arm_tdep (void)
 
   /* Initialize the standard target descriptions.  */
   initialize_tdesc_arm_with_m ();
+  initialize_tdesc_arm_with_m_fpa_layout ();
   initialize_tdesc_arm_with_iwmmxt ();
   initialize_tdesc_arm_with_vfpv2 ();
   initialize_tdesc_arm_with_vfpv3 ();
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index d35704d..debf2b2 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1318,6 +1318,10 @@ bp_location_has_shadow (struct bp_location *bl)
 /* Update BUF, which is LEN bytes read from the target address MEMADDR,
    by replacing any memory breakpoints with their shadowed contents.
 
+   If READBUF is not NULL, this buffer must not overlap with any of
+   the breakpoint location's shadow_contents buffers.  Otherwise,
+   a failed assertion internal error will be raised.
+
    The range of shadowed area by each bp_location is:
      bl->address - bp_location_placed_address_before_address_max
      up to bl->address + bp_location_shadow_len_after_address_max
@@ -1446,6 +1450,12 @@ breakpoint_xfer_memory (gdb_byte *readbuf, gdb_byte *writebuf,
 
     if (readbuf != NULL)
       {
+	/* Verify that the readbuf buffer does not overlap with
+	   the shadow_contents buffer.  */
+	gdb_assert (bl->target_info.shadow_contents >= readbuf + len
+		    || readbuf >= (bl->target_info.shadow_contents
+				   + bl->target_info.shadow_len));
+
 	/* Update the read buffer with this inserted breakpoint's
 	   shadow.  */
 	memcpy (readbuf + bp_addr - memaddr,
@@ -2082,8 +2092,15 @@ insert_bp_location (struct bp_location *bl,
   if (!should_be_inserted (bl) || (bl->inserted && !bl->needs_update))
     return 0;
 
-  /* Initialize the target-specific information.  */
-  memset (&bl->target_info, 0, sizeof (bl->target_info));
+  /* Note we don't initialize bl->target_info, as that wipes out
+     the breakpoint location's shadow_contents if the breakpoint
+     is still inserted at that location.  This in turn breaks
+     target_read_memory which depends on these buffers when
+     a memory read is requested at the breakpoint location:
+     Once the target_info has been wiped, we fail to see that
+     we have a breakpoint inserted at that address and thus
+     read the breakpoint instead of returning the data saved in
+     the breakpoint location's shadow contents.  */
   bl->target_info.placed_address = bl->address;
   bl->target_info.placed_address_space = bl->pspace->aspace;
   bl->target_info.length = bl->length;
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 8ea02d0..cb6d0e9 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,11 @@
+2012-03-16  Gary Benson  <gbenson@redhat.com>
+
+	PR breakpoints/10738
+	* gdb.texinfo (Inline Functions): Remove the now-unnecessary @item
+	stating that GDB cannot set breakpoints on inlined functions.
+	(Mode Options): Document --use-deprecated-index-sections.
+	(Index Section Format): Document new index section version format.
+
 2012-03-15  Tom Tromey  <tromey@redhat.com>
 
 	* gdb.texinfo (Debugging C Plus Plus): Document "info vtbl".
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index d4c5656..56bf5d5 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -1221,6 +1221,13 @@ memory usage after it completes each command and returns to the prompt.
 This option causes @value{GDBN} to print its version number and
 no-warranty blurb, and exit.
 
+@item -use-deprecated-index-sections
+@cindex @code{--use-deprecated-index-sections}
+This option causes @value{GDBN} to read and use deprecated
+@samp{.gdb_index} sections from symbol files.  This can speed up
+startup, but may result in some functionality being lost.
+@xref{Index Section Format}.
+
 @end table
 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [SCM]  archer-keiths-linespec-rewrite: Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite
@ 2012-03-30 20:55 kseitz
  0 siblings, 0 replies; 8+ messages in thread
From: kseitz @ 2012-03-30 20:55 UTC (permalink / raw)
  To: archer-commits

The branch, archer-keiths-linespec-rewrite has been updated
       via  7ecbc682e5e87b9b3050f080e0bbaef735373c0a (commit)
       via  06d550a95b64991c0bc16306107e029146d72444 (commit)
       via  1f77461ac7709d026de460dc0ab0d2910c90eed3 (commit)
       via  aa4149e524e3107bb10fdc62d433aec5914ca581 (commit)
       via  63ba485ec16b1eaa3f6608468f59df5027cd5834 (commit)
       via  e9dfdcd982542382219633d65c35e18957313cd1 (commit)
       via  5b409cbf08f7ba2f03eccdcaea1a592d9e69639c (commit)
       via  0d078fd58e0a0e1991f3fa59764d3880e2609c9d (commit)
       via  ecf3b10c2c47a04410adc90d6be5f6f26ee81d92 (commit)
       via  1eb23047aca59893799f82b0b4f881076ec2c2d2 (commit)
       via  8a84116d40cfbd737e40121497349bfb2e11ca06 (commit)
       via  c2fe8b175fb0ac61280a6bc3a50d8959247fc72c (commit)
       via  56afba236e344625b16c1488686df253c81b5439 (commit)
       via  4643799535d50ec03c6f204f493e0b8f84033d28 (commit)
       via  163b023b01b01b6e6a2142f6f0827c6ad12f6c9d (commit)
       via  4bd99b035e2894d769d9ab120c45c7b0fad57cf9 (commit)
       via  5b36f78d860593cdc228e425b2b4cd5c3c59f233 (commit)
       via  73e7ee4e16dd314cf92b2479c6daa71cb78ac50c (commit)
       via  d87ba317232961fe0e6d30858220c930a11a53b0 (commit)
       via  8f389cfa3c9c83ee6cad4c2dd2daf63f5c9951c4 (commit)
       via  8fbe13573758f2599c6387ebd01cf67be7b50990 (commit)
       via  a5f03e33295582aa7ad0c88fae45124c4fdf3ea9 (commit)
       via  b24a2c30426d9d41eca48e618c425ae5ca70a1c9 (commit)
       via  57b97e957b7741a6c9485e538746a0986cc030e6 (commit)
       via  6a649ab13c0db352922c7cbbacd5c60a4c6c9b43 (commit)
       via  d084403b007aafeb88eb28f81ae0e441b9a1de8a (commit)
       via  ff905874cd2c7903416f20d06e7da23883833d9a (commit)
       via  6825a12de5348c4f25ccc69a81d7459b98fe2ae1 (commit)
       via  843c3d4f1b1cfb512cf636dac7a7c8922cea1f75 (commit)
       via  86f222feb8ce47aad73750e6a1e75d27d787c3d3 (commit)
       via  b08a0c3476ee1a2dfa35893f3a5955a7b8e0ca28 (commit)
       via  3f7abee6f972f8fb37cf0ded16ef4ac5956d7f32 (commit)
       via  810fc7bf06e766f762bfafe71ae566395a54fcf4 (commit)
       via  7f0e7e8581446c677a376fecd11540533760a05e (commit)
       via  e7a153ccfdac0bb45958b19293fa3fb509b9a9e5 (commit)
       via  3eec4be3d4f50a8ccfa2cfb26efd673b105008a4 (commit)
       via  a7916980e89510b79f52f0bc9c58015318d81478 (commit)
       via  2d0291bf2118f556e2efda26662f23559eddd4ab (commit)
       via  6d7e224c93a0abf474b3a3a85cd0e8c68fec546d (commit)
       via  52c93ee1151eb1bdc576b9e100fae548d78433c4 (commit)
       via  655e820cf9a039ee55325d9e1f8423796d592b4b (commit)
       via  5eadef623d0ca84c44370864186ae85ac29f433d (commit)
       via  a012ecd57f4c62e42a6fcd1454541ea209df03e0 (commit)
       via  2d3bed914eb219769399d4be7c95885b9f0956a3 (commit)
       via  33c618f861d9ad56df661bd5759e03d16114682a (commit)
       via  109e341ea4ed4259a4cc49d16c8b9e7cb70e5f47 (commit)
      from  94b015b421d5a7b29d82bd9ed322b8e7acabc42e (commit)

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

- Log -----------------------------------------------------------------
commit 7ecbc682e5e87b9b3050f080e0bbaef735373c0a
Merge: 06d550a 1f77461
Author: Keith Seitz <keiths@redhat.com>
Date:   Fri Mar 30 13:50:17 2012 -0700

    Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite

commit 06d550a95b64991c0bc16306107e029146d72444
Author: Keith Seitz <keiths@redhat.com>
Date:   Fri Mar 30 13:46:55 2012 -0700

    	* linespec.c (enum ls_token_type): Add LSTOKEN_COMMA.
    	(find_parameter_list_end): New function.
    	(linespec_lexer_lex_string): Cope with commas.
    	(linespec_lexer_lex_one): Likewise.
    	(unexpected_linespec_error): Likewise.
    	(linespec_parse_basic): Use LSTOKEN_COMMA.
    	(parse_linespec): Likewise.
    
    testsuite/ChangeLog
    	* gdb.linespec/ls-errs.exp: "'main.c',21" should give invalid
    	function error.

commit 1f77461ac7709d026de460dc0ab0d2910c90eed3
Author: Thiago Jung Bauermann <bauerman@br.ibm.com>
Date:   Fri Mar 30 20:23:16 2012 +0000

    	* configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t
    	are available.
    	* linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef.
    	[HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise.
    	* config.in: Regenerate.
    	* configure: Likewise.

commit aa4149e524e3107bb10fdc62d433aec5914ca581
Author: Tom Tromey <tromey@redhat.com>
Date:   Fri Mar 30 20:05:51 2012 +0000

    	* python/python.c (gdbpy_decode_line): Move cleanup creation out
    	of TRY_CATCH.  Fix error handling.
    	* python/py-value.c (convert_value_from_python): Move 'old'
    	declaration to innermost scope.

commit 63ba485ec16b1eaa3f6608468f59df5027cd5834
Merge: 94b015b 5b409cb
Author: Keith Seitz <keiths@redhat.com>
Date:   Fri Mar 30 12:21:31 2012 -0700

    Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite

commit e9dfdcd982542382219633d65c35e18957313cd1
Author: Keith Seitz <keiths@redhat.com>
Date:   Fri Mar 30 19:16:51 2012 +0000

    	* gdb.python: Add test for linespecs with commas.

-----------------------------------------------------------------------

Summary of changes:
 bfd/ChangeLog                          |   42 +
 bfd/bfd-in.h                           |   12 +-
 bfd/bfd-in2.h                          |   12 +-
 bfd/elf32-s390.c                       |  537 ++++----
 bfd/elf64-s390.c                       |  376 +++----
 bfd/elflink.c                          |    3 +-
 bfd/version.h                          |    2 +-
 gdb/.dir-locals.el                     |   24 +
 gdb/ChangeLog                          |  183 +++
 gdb/Makefile.in                        |    5 +-
 gdb/NEWS                               |    2 +
 gdb/ada-exp.y                          |   33 +-
 gdb/ada-lang.c                         |  128 ++-
 gdb/ada-lang.h                         |   20 +-
 gdb/ada-valprint.c                     |   67 +-
 gdb/ada-varobj.c                       |  889 ++++++++++++++
 gdb/ada-varobj.h                       |   56 +
 gdb/doc/ChangeLog                      |    6 +
 gdb/doc/gdb.texinfo                    |    6 +
 gdb/gdbserver/ChangeLog                |   41 +
 gdb/gdbserver/config.in                |    6 +
 gdb/gdbserver/configure                |   24 +
 gdb/gdbserver/configure.ac             |    4 +
 gdb/gdbserver/linux-arm-low.c          |    1 +
 gdb/gdbserver/linux-bfin-low.c         |    1 +
 gdb/gdbserver/linux-cris-low.c         |    1 +
 gdb/gdbserver/linux-crisv32-low.c      |    1 +
 gdb/gdbserver/linux-ia64-low.c         |   45 +-
 gdb/gdbserver/linux-low.c              |   42 +-
 gdb/gdbserver/linux-low.h              |    8 +
 gdb/gdbserver/linux-m32r-low.c         |    1 +
 gdb/gdbserver/linux-m68k-low.c         |    1 +
 gdb/gdbserver/linux-mips-low.c         |    1 +
 gdb/gdbserver/linux-ppc-low.c          |    1 +
 gdb/gdbserver/linux-s390-low.c         |    1 +
 gdb/gdbserver/linux-sh-low.c           |    1 +
 gdb/gdbserver/linux-sparc-low.c        |    1 +
 gdb/gdbserver/linux-tic6x-low.c        |    1 +
 gdb/gdbserver/linux-x86-low.c          |    1 +
 gdb/gdbserver/linux-xtensa-low.c       |    1 +
 gdb/ia64-linux-nat.c                   |   47 +-
 gdb/linespec.c                         |  109 ++-
 gdb/python/py-inferior.c               |   20 +-
 gdb/python/py-value.c                  |    3 +-
 gdb/python/python.c                    |   29 +-
 gdb/testsuite/ChangeLog                |   14 +
 gdb/testsuite/gdb.linespec/ls-errs.exp |    2 +-
 gdb/testsuite/gdb.python/python.exp    |    3 +
 gdb/v850-tdep.c                        |  139 +++-
 gdb/varobj.c                           |  282 ++++-
 gdb/version.in                         |    2 +-
 sim/common/ChangeLog                   |    7 +
 sim/common/sim-trace.c                 |   13 +-
 sim/common/sim-trace.h                 |   17 +
 sim/v850/ChangeLog                     |   55 +
 sim/v850/sim-main.h                    |  298 +++++-
 sim/v850/simops.c                      |  716 +++++++++++-
 sim/v850/simops.h                      |   47 +
 sim/v850/v850-dc                       |   29 +-
 sim/v850/v850.igen                     | 2081 +++++++++++++++++++++++++++++++-
 60 files changed, 5769 insertions(+), 731 deletions(-)
 create mode 100644 gdb/.dir-locals.el
 create mode 100644 gdb/ada-varobj.c
 create mode 100644 gdb/ada-varobj.h

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 04c3b31..8bd12f2 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,45 @@
+2012-03-30  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
+	* elf64-s390.c: Fix several comments regarding PLT entry
+	description.
+	* elf32-s390.c: Likewise.
+
+2012-03-30  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
+	* elf64-s390.c: Use the section pointer shortcuts in
+	elf_link_hash_table and remove them from the target specific
+	variant.
+	* elf32-s390.c: Likewise.
+
+2012-03-30  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
+	* elf64-s390.c (elf_s390x_plt_entry, elf_s390x_first_plt_entry):
+	New definitions.
+	(PLT_PIC_ENTRY_WORD*, PLT_PIC12_ENTRY_WORD*): Remove.
+	(elf_s390_finish_dynamic_symbol): Use memcpy instead of bfd_put_32.
+	(elf_s390_finish_dynamic_sections): Likewise.
+	* elf32-s390.c (elf_s390_plt_entry, elf_s390_plt_pic_entry)
+	(elf_s390_plt_pic12_entry, elf_s390_plt_pic16_entry)
+	(elf_s390_plt_first_entry, elf_s390_plt_pic_first_entry): New definitions.
+	(PLT_PIC16_ENTRY_WORD*, PLT_ENTRY_WORD*)
+	(PLT_PIC_FIRST_ENTRY_WORD*, PLT_FIRST_ENTRY_WORD*): Remove.
+
+2012-03-30  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
+	* elf32-s390.c (struct elf_s390_dyn_relocs): Remove.
+	Rename all occurrences in the file to elf_dyn_relocs.
+	* elf64-s390.c: Likewise.
+
+2012-03-30  Alan Modra  <amodra@gmail.com>
+
+	* elflink.c (_bfd_elf_gc_mark_reloc): Don't delve into dynamic
+	libraries.
+
+2012-03-29  Alan Modra  <amodra@gmail.com>
+
+	* bfd-in.h (bfd_get_arch_size, bfd_get_sign_extend_vma): Delete.
+	* bfd-in2.h: Regenerate.
+
 2012-03-23  Alan Modra  <amodra@gmail.com>
 
 	* elf.c (assign_file_positions_for_non_load_sections): Don't warn
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index c331f3b..d50f7e9 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -1,8 +1,8 @@
 /* Main header file for the bfd library -- portable access to object files.
 
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+   2012 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.
 
@@ -694,14 +694,6 @@ extern bfd *bfd_elf_bfd_from_remote_memory
   (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
    int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len));
 
-/* Return the arch_size field of an elf bfd, or -1 if not elf.  */
-extern int bfd_get_arch_size
-  (bfd *);
-
-/* Return TRUE if address "naturally" sign extends, or -1 if not elf.  */
-extern int bfd_get_sign_extend_vma
-  (bfd *);
-
 extern struct bfd_section *_bfd_elf_tls_setup
   (bfd *, struct bfd_link_info *);
 
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 61513f2..07898be 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -8,8 +8,8 @@
 /* Main header file for the bfd library -- portable access to object files.
 
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+   2012 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.
 
@@ -701,14 +701,6 @@ extern bfd *bfd_elf_bfd_from_remote_memory
   (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
    int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len));
 
-/* Return the arch_size field of an elf bfd, or -1 if not elf.  */
-extern int bfd_get_arch_size
-  (bfd *);
-
-/* Return TRUE if address "naturally" sign extends, or -1 if not elf.  */
-extern int bfd_get_sign_extend_vma
-  (bfd *);
-
 extern struct bfd_section *_bfd_elf_tls_setup
   (bfd *, struct bfd_link_info *);
 
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index fcced0f..7793d07 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -509,7 +509,7 @@ elf_s390_is_local_label_name (abfd, name)
    The GOT holds the address in the PLT to be executed.
    The loader then gets:
    24(15) =  Pointer to the structure describing the object.
-   28(15) =  Offset in symbol table
+   28(15) =  Offset into rela.plt
 
    The loader  must  then find the module where the function is
    and insert the address in the GOT.
@@ -527,7 +527,7 @@ RET1: BASR 1,0         # 2 bytes  Return from GOT 1st time
       BRC  15,-x       # 4 bytes  Jump to start of PLT
       .word 0          # 2 bytes filler
       .long ?          # 4 bytes  offset in GOT
-      .long ?          # 4 bytes  offset into symbol table
+      .long ?          # 4 bytes  offset into rela.plt
 
   This was the general case. There are two additional, optimizes PLT
   definitions. One for GOT offsets < 4096 and one for GOT offsets < 32768.
@@ -537,10 +537,10 @@ PLT1: L    1,<offset>(12) # 4 bytes  Load address from GOT in R1
       BCR  15,1           # 2 bytes  Jump to address
       .word 0,0,0         # 6 bytes  filler
 RET1: BASR 1,0            # 2 bytes  Return from GOT 1st time
-      L    1,14(1)        # 4 bytes  Load offset in symbol table in r1
+      L    1,14(1)        # 4 bytes  Load offset in rela.plt in r1
       BRC  15,-x          # 4 bytes  Jump to start of PLT
       .word 0,0,0         # 6 bytes  filler
-      .long ?             # 4 bytes  offset into symbol table
+      .long ?             # 4 bytes  offset into rela.plt
 
   Second the one for GOT offsets < 32768:
 
@@ -549,10 +549,10 @@ PLT1: LHI  1,<offset>     # 4 bytes  Load offset in GOT to r1
       BCR  15,1           # 2 bytes  Jump to address
       .word 0             # 2 bytes  filler
 RET1: BASR 1,0            # 2 bytes  Return from GOT 1st time
-      L    1,14(1)        # 4 bytes  Load offset in symbol table in r1
+      L    1,14(1)        # 4 bytes  Load offset in rela.plt in r1
       BRC  15,-x          # 4 bytes  Jump to start of PLT
       .word 0,0,0         # 6 bytes  filler
-      .long ?             # 4 bytes  offset into symbol table
+      .long ?             # 4 bytes  offset into rela.plt
 
 Total = 32 bytes per PLT entry
 
@@ -567,40 +567,76 @@ RET1: BASR 1,0         # 2 bytes  Return from GOT 1st time
       BRC  15,-x       # 4 bytes  Jump to start of PLT
       .word 0          # 2 bytes  filler
       .long ?          # 4 bytes  address of GOT entry
-      .long ?          # 4 bytes  offset into symbol table  */
-
-#define PLT_PIC_ENTRY_WORD0 0x0d105810
-#define PLT_PIC_ENTRY_WORD1 0x10165811
-#define PLT_PIC_ENTRY_WORD2 0xc00007f1
-#define PLT_PIC_ENTRY_WORD3 0x0d105810
-#define PLT_PIC_ENTRY_WORD4 0x100ea7f4
-
-#define PLT_PIC12_ENTRY_WORD0 0x5810c000
-#define PLT_PIC12_ENTRY_WORD1 0x07f10000
-#define PLT_PIC12_ENTRY_WORD2 0x00000000
-#define PLT_PIC12_ENTRY_WORD3 0x0d105810
-#define PLT_PIC12_ENTRY_WORD4 0x100ea7f4
-
-#define PLT_PIC16_ENTRY_WORD0 0xa7180000
-#define PLT_PIC16_ENTRY_WORD1 0x5811c000
-#define PLT_PIC16_ENTRY_WORD2 0x07f10000
-#define PLT_PIC16_ENTRY_WORD3 0x0d105810
-#define PLT_PIC16_ENTRY_WORD4 0x100ea7f4
-
-#define PLT_ENTRY_WORD0     0x0d105810
-#define PLT_ENTRY_WORD1     0x10165810
-#define PLT_ENTRY_WORD2     0x100007f1
-#define PLT_ENTRY_WORD3     0x0d105810
-#define PLT_ENTRY_WORD4     0x100ea7f4
-
-/* The first PLT entry pushes the offset into the symbol table
+      .long ?          # 4 bytes  offset into rela.plt  */
+
+static const bfd_byte elf_s390_plt_entry[PLT_ENTRY_SIZE] =
+  {
+    0x0d, 0x10,                             /* basr    %r1,%r0     */
+    0x58, 0x10, 0x10, 0x16,                 /* l       %r1,22(%r1) */
+    0x58, 0x10, 0x10, 0x00,                 /* l       %r1,0(%r1)  */
+    0x07, 0xf1,                             /* br      %r1         */
+    0x0d, 0x10,                             /* basr    %r1,%r0     */
+    0x58, 0x10, 0x10, 0x0e,                 /* l       %r1,14(%r1) */
+    0xa7, 0xf4, 0x00, 0x00,                 /* j       first plt   */
+    0x00, 0x00,                             /* padding             */
+    0x00, 0x00, 0x00, 0x00,                 /* GOT offset          */
+    0x00, 0x00, 0x00, 0x00                  /* rela.plt offset     */
+  };
+
+/* Generic PLT pic entry.  */
+static const bfd_byte elf_s390_plt_pic_entry[PLT_ENTRY_SIZE] =
+  {
+    0x0d, 0x10,                             /* basr    %r1,%r0         */
+    0x58, 0x10, 0x10, 0x16,                 /* l       %r1,22(%r1)     */
+    0x58, 0x11, 0xc0, 0x00,                 /* l       %r1,0(%r1,%r12) */
+    0x07, 0xf1,                             /* br      %r1             */
+    0x0d, 0x10,                             /* basr    %r1,%r0         */
+    0x58, 0x10, 0x10, 0x0e,                 /* l       %r1,14(%r1)     */
+    0xa7, 0xf4, 0x00, 0x00,                 /* j       first plt       */
+    0x00, 0x00,                             /* padding                 */
+    0x00, 0x00, 0x00, 0x00,                 /* GOT offset              */
+    0x00, 0x00, 0x00, 0x00                  /* rela.plt offset         */
+  };
+
+/* Optimized PLT pic entry for GOT offset < 4k.  xx will be replaced
+   when generating the PLT slot with the GOT offset.  */
+static const bfd_byte elf_s390_plt_pic12_entry[PLT_ENTRY_SIZE] =
+  {
+    0x58, 0x10, 0xc0, 0x00,                 /* l       %r1,xx(%r12) */
+    0x07, 0xf1,                             /* br      %r1          */
+    0x00, 0x00, 0x00, 0x00,                 /* padding              */
+    0x00, 0x00,
+    0x0d, 0x10,                             /* basr    %r1,%r0      */
+    0x58, 0x10, 0x10, 0x0e,                 /* l       %r1,14(%r1)  */
+    0xa7, 0xf4, 0x00, 0x00,                 /* j       first plt    */
+    0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00
+  };
+
+/* Optimized PLT pic entry for GOT offset < 32k.  xx will be replaced
+   when generating the PLT slot with the GOT offset.  */
+static const bfd_byte elf_s390_plt_pic16_entry[PLT_ENTRY_SIZE] =
+  {
+    0xa7, 0x18, 0x00, 0x00,                 /* lhi     %r1,xx          */
+    0x58, 0x11, 0xc0, 0x00,                 /* l       %r1,0(%r1,%r12) */
+    0x07, 0xf1,                             /* br      %r1             */
+    0x00, 0x00,
+    0x0d, 0x10,                             /* basr    %r1,%r0         */
+    0x58, 0x10, 0x10, 0x0e,                 /* l       %r1,14(%r1)     */
+    0xa7, 0xf4, 0x00, 0x00,                 /* j       first plt       */
+    0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00
+  };
+
+/* The first PLT entry pushes the offset into the rela.plt
    from R1 onto the stack at 8(15) and the loader object info
    at 12(15), loads the loader address in R1 and jumps to it.  */
 
 /* The first entry in the PLT for PIC code:
 
 PLT0:
-   ST   1,28(15)  # R1 has offset into symbol table
+   ST   1,28(15)  # R1 has offset into rela.plt
    L    1,4(12)   # Get loader ino(object struct address)
    ST   1,24(15)  # Store address
    L    1,8(12)   # Entry address of loader in R1
@@ -609,7 +645,7 @@ PLT0:
    The first entry in the PLT for static code:
 
 PLT0:
-   ST   1,28(15)      # R1 has offset into symbol table
+   ST   1,28(15)      # R1 has offset into rela.plt
    BASR 1,0
    L    1,18(0,1)     # Get address of GOT
    MVC  24(4,15),4(1) # Move loader ino to stack
@@ -618,38 +654,32 @@ PLT0:
    .word 0            # filler
    .long got          # address of GOT  */
 
-#define PLT_PIC_FIRST_ENTRY_WORD0 0x5010f01c
-#define PLT_PIC_FIRST_ENTRY_WORD1 0x5810c004
-#define PLT_PIC_FIRST_ENTRY_WORD2 0x5010f018
-#define PLT_PIC_FIRST_ENTRY_WORD3 0x5810c008
-#define PLT_PIC_FIRST_ENTRY_WORD4 0x07f10000
-
-#define PLT_FIRST_ENTRY_WORD0     0x5010f01c
-#define PLT_FIRST_ENTRY_WORD1     0x0d105810
-#define PLT_FIRST_ENTRY_WORD2     0x1012D203
-#define PLT_FIRST_ENTRY_WORD3     0xf0181004
-#define PLT_FIRST_ENTRY_WORD4     0x58101008
-#define PLT_FIRST_ENTRY_WORD5     0x07f10000
-
-/* The s390 linker needs to keep track of the number of relocs that it
-   decides to copy as dynamic relocs in check_relocs for each symbol.
-   This is so that it can later discard them if they are found to be
-   unnecessary.  We store the information in a field extending the
-   regular ELF linker hash table.  */
-
-struct elf_s390_dyn_relocs
-{
-  struct elf_s390_dyn_relocs *next;
-
-  /* The input section of the reloc.  */
-  asection *sec;
-
-  /* Total number of relocs copied for the input section.  */
-  bfd_size_type count;
+static const bfd_byte elf_s390_plt_first_entry[PLT_FIRST_ENTRY_SIZE] =
+  {
+    0x50, 0x10, 0xf0, 0x1c,                   /* st      %r1,28(%r15)      */
+    0x0d, 0x10,                               /* basr    %r1,%r0           */
+    0x58, 0x10, 0x10, 0x12,                   /* l       %r1,18(%r1)       */
+    0xd2, 0x03, 0xf0, 0x18, 0x10, 0x04,       /* mvc     24(4,%r15),4(%r1) */
+    0x58, 0x10, 0x10, 0x08,                   /* l       %r1,8(%r1)        */
+    0x07, 0xf1,                               /* br      %r1               */
+    0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00
+  };
+
+static const bfd_byte elf_s390_plt_pic_first_entry[PLT_FIRST_ENTRY_SIZE] =
+  {
+    0x50, 0x10, 0xf0, 0x1c,                     /* st      %r1,28(%r15)  */
+    0x58, 0x10, 0xc0, 0x04,                     /* l       %r1,4(%r12)   */
+    0x50, 0x10, 0xf0, 0x18,                     /* st      %r1,24(%r15)  */
+    0x58, 0x10, 0xc0, 0x08,                     /* l       %r1,8(%r12)   */
+    0x07, 0xf1,                                 /* br      %r1           */
+    0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00
+  };
 
-  /* Number of pc-relative relocs copied for the input section.  */
-  bfd_size_type pc_count;
-};
 
 /* s390 ELF linker hash entry.  */
 
@@ -658,7 +688,7 @@ struct elf_s390_link_hash_entry
   struct elf_link_hash_entry elf;
 
   /* Track dynamic relocs copied for this symbol.  */
-  struct elf_s390_dyn_relocs *dyn_relocs;
+  struct elf_dyn_relocs *dyn_relocs;
 
   /* Number of GOTPLT references for a function.  */
   bfd_signed_vma gotplt_refcount;
@@ -717,11 +747,6 @@ struct elf_s390_link_hash_table
   struct elf_link_hash_table elf;
 
   /* Short-cuts to get to dynamic linker sections.  */
-  asection *sgot;
-  asection *sgotplt;
-  asection *srelgot;
-  asection *splt;
-  asection *srelplt;
   asection *sdynbss;
   asection *srelbss;
 
@@ -794,11 +819,11 @@ elf_s390_link_hash_table_create (abfd)
       return NULL;
     }
 
-  ret->sgot = NULL;
-  ret->sgotplt = NULL;
-  ret->srelgot = NULL;
-  ret->splt = NULL;
-  ret->srelplt = NULL;
+  ret->elf.sgot = NULL;
+  ret->elf.sgotplt = NULL;
+  ret->elf.srelgot = NULL;
+  ret->elf.splt = NULL;
+  ret->elf.srelplt = NULL;
   ret->sdynbss = NULL;
   ret->srelbss = NULL;
   ret->tls_ldm_got.refcount = 0;
@@ -821,10 +846,10 @@ create_got_section (dynobj, info)
     return FALSE;
 
   htab = elf_s390_hash_table (info);
-  htab->sgot = bfd_get_section_by_name (dynobj, ".got");
-  htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
-  htab->srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
-  if (!htab->sgot || !htab->sgotplt || !htab->srelgot)
+  htab->elf.sgot = bfd_get_section_by_name (dynobj, ".got");
+  htab->elf.sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
+  htab->elf.srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+  if (!htab->elf.sgot || !htab->elf.sgotplt || !htab->elf.srelgot)
     abort ();
 
   return TRUE;
@@ -842,19 +867,19 @@ elf_s390_create_dynamic_sections (dynobj, info)
   struct elf_s390_link_hash_table *htab;
 
   htab = elf_s390_hash_table (info);
-  if (!htab->sgot && !create_got_section (dynobj, info))
+  if (!htab->elf.sgot && !create_got_section (dynobj, info))
     return FALSE;
 
   if (!_bfd_elf_create_dynamic_sections (dynobj, info))
     return FALSE;
 
-  htab->splt = bfd_get_section_by_name (dynobj, ".plt");
-  htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt");
+  htab->elf.splt = bfd_get_section_by_name (dynobj, ".plt");
+  htab->elf.srelplt = bfd_get_section_by_name (dynobj, ".rela.plt");
   htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss");
   if (!info->shared)
     htab->srelbss = bfd_get_section_by_name (dynobj, ".rela.bss");
 
-  if (!htab->splt || !htab->srelplt || !htab->sdynbss
+  if (!htab->elf.splt || !htab->elf.srelplt || !htab->sdynbss
       || (!info->shared && !htab->srelbss))
     abort ();
 
@@ -877,14 +902,14 @@ elf_s390_copy_indirect_symbol (info, dir, ind)
     {
       if (edir->dyn_relocs != NULL)
 	{
-	  struct elf_s390_dyn_relocs **pp;
-	  struct elf_s390_dyn_relocs *p;
+	  struct elf_dyn_relocs **pp;
+	  struct elf_dyn_relocs *p;
 
 	  /* Add reloc counts against the indirect sym to the direct sym
 	     list.  Merge any entries against the same section.  */
 	  for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
 	    {
-	      struct elf_s390_dyn_relocs *q;
+	      struct elf_dyn_relocs *q;
 
 	      for (q = edir->dyn_relocs; q != NULL; q = q->next)
 		if (q->sec == p->sec)
@@ -1056,7 +1081,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
 	case R_390_GOTOFF32:
 	case R_390_GOTPC:
 	case R_390_GOTPCDBL:
-	  if (htab->sgot == NULL)
+	  if (htab->elf.sgot == NULL)
 	    {
 	      if (htab->elf.dynobj == NULL)
 		htab->elf.dynobj = abfd;
@@ -1265,8 +1290,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
 		  && (h->root.type == bfd_link_hash_defweak
 		      || !h->def_regular)))
 	    {
-	      struct elf_s390_dyn_relocs *p;
-	      struct elf_s390_dyn_relocs **head;
+	      struct elf_dyn_relocs *p;
+	      struct elf_dyn_relocs **head;
 
 	      /* We must copy these reloc types into the output file.
 		 Create a reloc section in dynobj and make room for
@@ -1308,7 +1333,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
 		    s = sec;
 
 		  vpp = &elf_section_data (s)->local_dynrel;
-		  head = (struct elf_s390_dyn_relocs **) vpp;
+		  head = (struct elf_dyn_relocs **) vpp;
 		}
 
 	      p = *head;
@@ -1316,7 +1341,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
 		{
 		  bfd_size_type amt = sizeof *p;
 
-		  p = ((struct elf_s390_dyn_relocs *)
+		  p = ((struct elf_dyn_relocs *)
 		       bfd_alloc (htab->elf.dynobj, amt));
 		  if (p == NULL)
 		    return FALSE;
@@ -1414,8 +1439,8 @@ elf_s390_gc_sweep_hook (bfd *abfd,
       if (r_symndx >= symtab_hdr->sh_info)
 	{
 	  struct elf_s390_link_hash_entry *eh;
-	  struct elf_s390_dyn_relocs **pp;
-	  struct elf_s390_dyn_relocs *p;
+	  struct elf_dyn_relocs **pp;
+	  struct elf_dyn_relocs *p;
 
 	  h = sym_hashes[r_symndx - symtab_hdr->sh_info];
 	  while (h->root.type == bfd_link_hash_indirect
@@ -1628,7 +1653,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
   if (ELIMINATE_COPY_RELOCS)
     {
       struct elf_s390_link_hash_entry * eh;
-      struct elf_s390_dyn_relocs *p;
+      struct elf_dyn_relocs *p;
 
       eh = (struct elf_s390_link_hash_entry *) h;
       for (p = eh->dyn_relocs; p != NULL; p = p->next)
@@ -1684,7 +1709,7 @@ allocate_dynrelocs (h, inf)
   struct bfd_link_info *info;
   struct elf_s390_link_hash_table *htab;
   struct elf_s390_link_hash_entry *eh;
-  struct elf_s390_dyn_relocs *p;
+  struct elf_dyn_relocs *p;
 
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
@@ -1707,7 +1732,7 @@ allocate_dynrelocs (h, inf)
       if (info->shared


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [SCM]  archer-keiths-linespec-rewrite: Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite
@ 2012-03-26 21:41 kseitz
  0 siblings, 0 replies; 8+ messages in thread
From: kseitz @ 2012-03-26 21:41 UTC (permalink / raw)
  To: archer-commits

The branch, archer-keiths-linespec-rewrite has been updated
       via  e35c7e8e719cdaf8771b9b03b06be508c35f9949 (commit)
       via  79be8325606facdce0467e5e1b54b30513f8f727 (commit)
       via  b0e5cb87d66e1c74613ba923664bef9547b96172 (commit)
       via  a5cb0e3d12758e08a1ccc7f6f73529bc102a6d31 (commit)
       via  57feba1a12c978c57836cd9a78bace3aa68ff881 (commit)
       via  1ba1689e5d9a078016564b0f40729917563a9bb1 (commit)
       via  994022538d9a8c3f57f94f90b21f9796d54f6ea3 (commit)
       via  bb4f55dbcc7aa2bf1b0cdd439b7088d9ea7e9b00 (commit)
       via  3ef3d2e1c985426ccac17157185a962d20952624 (commit)
       via  c338d4bceb084a629b479e1ac36ab2b42737e1c2 (commit)
       via  a1c41c98de0b006bdad3a512be5d05be0ef9d8aa (commit)
       via  c6bbedcf2bdb97ade67f9dacd11d78152316d051 (commit)
       via  ecbf6e89d2155e3429a9cb9b30419a539565afe2 (commit)
       via  f4a023ee8a2015d98fd3aeb50a5ccde2f201ec46 (commit)
       via  68c4998cf419703473c5985f99aee1715c92d5e4 (commit)
       via  5e92d838c0cd75ff9755f144aa84a1fb7d256e38 (commit)
       via  179a88f7f91130bc9ed3f62db06b7107909c0f17 (commit)
       via  26d46e62d77bdac3c3593d4e45854ad6ea78c6f2 (commit)
       via  7542f04ef01f0c98f79d855104dd63f4304f51a1 (commit)
       via  107456deabeb1c7b634264ab21818d64ae270ffe (commit)
       via  103be0f063fb84666222b0388298d9aabe8f3588 (commit)
       via  63b12f0554e013feafe2b86c19bb1b0c33659a8f (commit)
       via  6fd66ac74c0027650ef43577fdbe4d7f236051f2 (commit)
       via  238a89c5e410f61d2786cffca0a55dcf50325cd4 (commit)
       via  7bd3bcfebb31726b090ee1e94a598f7b1ae97ff8 (commit)
       via  483b15745ae9f8ea4490ca5fb87cb9c1405785a4 (commit)
       via  3fa74e6cd934b778a46812e85aacb75f5bb8ebf0 (commit)
       via  abef1f2b99a19695e75d2b8caca0409d68377a68 (commit)
       via  68a5e2c18948f7654ff9e1ba942e6384223eafd1 (commit)
       via  1ee91b8dc930c4a3093ada1ff16e46247143415f (commit)
       via  de9e84839d6034a7ceeb77c774f2e36e48cbd97d (commit)
       via  bee9c58b7e871312ed9f00f244dcfc3ea7888c0d (commit)
       via  104ac57ff96d3a8854569062910c42f7a9f762af (commit)
       via  6b02e7db494f5b445c71de1f59b034854008002b (commit)
       via  5371d4e89fdf618acf847a6337a8c91b99c673fa (commit)
       via  db6edb160e34a79d59886896b36650ac4e089539 (commit)
      from  63ef85dc45ff48ac0b216fac25786db84ec85eb1 (commit)

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

- Log -----------------------------------------------------------------
commit e35c7e8e719cdaf8771b9b03b06be508c35f9949
Merge: 63ef85d 79be832
Author: Keith Seitz <keiths@redhat.com>
Date:   Mon Mar 26 13:56:14 2012 -0700

    Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite

commit 79be8325606facdce0467e5e1b54b30513f8f727
Author: ozapawandeep <ozapawandeep>
Date:   Mon Mar 26 18:18:37 2012 +0000

    MAINTAINERS (Write After Approval): Add myself to the list.

commit b0e5cb87d66e1c74613ba923664bef9547b96172
Author: Pedro Alves <pedro@codesourcery.com>
Date:   Mon Mar 26 13:54:57 2012 +0000

    2012-03-26  Pedro Alves  <palves@redhat.com>
    
    	* server.c (handle_qxfer_libraries): Don't bail early if
    	the_target->qxfer_libraries_svr4 is not NULL.

commit a5cb0e3d12758e08a1ccc7f6f73529bc102a6d31
Author: Pedro Alves <pedro@codesourcery.com>
Date:   Mon Mar 26 12:39:19 2012 +0000

    2012-03-26  Pedro Alves  <palves@redhat.com>
    
    	* linux-low.c (linux_qxfer_libraries_svr4): Fix pasto in comment.

commit 57feba1a12c978c57836cd9a78bace3aa68ff881
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Mon Mar 26 02:18:43 2012 +0000

    sim: add a proper sim_core_trans_addr prototype
    
    The common code has a sim_core_trans_addr() helper that only the m32r code
    uses.  Move the inline extern in the m32r code to the proper common header.
    
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>

commit 1ba1689e5d9a078016564b0f40729917563a9bb1
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Mon Mar 26 00:00:03 2012 +0000

    *** empty log message ***

commit 994022538d9a8c3f57f94f90b21f9796d54f6ea3
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Sun Mar 25 23:00:05 2012 +0000

    daily update

commit bb4f55dbcc7aa2bf1b0cdd439b7088d9ea7e9b00
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sun Mar 25 16:51:46 2012 +0000

    sim: bfin: skip .c/.S tests if no compiler is available
    
    Similar to logic in the cris exp, attempt a simple compile and if it fails
    (presumably due to the compiler being broken), skip all the related tests.
    Fortunately, most tests (~600 out of ~800) are pure assembly, so people should
    still get pretty good coverage.
    
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>

-----------------------------------------------------------------------

Summary of changes:
 bfd/ChangeLog                                     |   21 ++
 bfd/bfd-in.h                                      |    3 +
 bfd/bfd-in2.h                                     |    3 +
 bfd/elf.c                                         |   13 +-
 bfd/elf64-ppc.c                                   |    9 +-
 bfd/elflink.c                                     |   21 +-
 bfd/linker.c                                      |  143 +++++----
 bfd/version.h                                     |    2 +-
 gdb/ChangeLog                                     |   34 ++
 gdb/MAINTAINERS                                   |    3 +-
 gdb/NEWS                                          |    8 +-
 gdb/doc/ChangeLog                                 |    7 +
 gdb/doc/gdb.texinfo                               |   73 ++++
 gdb/gdbserver/ChangeLog                           |   21 ++
 gdb/gdbserver/linux-low.c                         |   36 ++-
 gdb/gdbserver/server.c                            |    4 -
 gdb/jit.c                                         |   13 +-
 gdb/python/py-value.c                             |   43 +++
 gdb/sparc-linux-nat.c                             |    2 +-
 gdb/sparc-nat.c                                   |    2 +-
 gdb/testsuite/ChangeLog                           |   12 +
 gdb/testsuite/gdb.python/Makefile.in              |    2 +-
 gdb/testsuite/gdb.python/py-value-cc.exp          |   48 +++
 gdb/testsuite/gdb.python/py-value.cc              |   39 +++
 gdb/testsuite/lib/gdb.exp                         |    5 +-
 gdb/version.in                                    |    2 +-
 opcodes/ChangeLog                                 |    4 +
 opcodes/mips-dis.c                                |    8 +
 sim/arm/ChangeLog                                 |    4 +
 sim/arm/aclocal.m4                                |   11 +-
 sim/arm/config.in                                 |   32 ++
 sim/arm/configure                                 |  304 ++++++++++-------
 sim/avr/ChangeLog                                 |    4 +
 sim/avr/aclocal.m4                                |   11 +-
 sim/avr/config.in                                 |   32 ++
 sim/avr/configure                                 |  304 ++++++++++-------
 sim/bfin/ChangeLog                                |    4 +
 sim/bfin/aclocal.m4                               |   11 +-
 sim/bfin/config.in                                |   32 ++
 sim/bfin/configure                                |  370 ++++++++++++--------
 sim/common/ChangeLog                              |   21 ++
 sim/common/acinclude.m4                           |   65 +++--
 sim/common/aclocal.m4                             |   11 +-
 sim/common/config.in                              |   32 ++
 sim/common/configure                              |  298 ++++++++++-------
 sim/common/nrun.c                                 |   16 +
 sim/common/sim-core.h                             |    8 +
 sim/cr16/ChangeLog                                |    4 +
 sim/cr16/aclocal.m4                               |   11 +-
 sim/cr16/config.in                                |   32 ++
 sim/cr16/configure                                |  376 +++++++++++++--------
 sim/cris/ChangeLog                                |    4 +
 sim/cris/aclocal.m4                               |   11 +-
 sim/cris/config.in                                |   35 ++
 sim/cris/configure                                |  376 +++++++++++++--------
 sim/d10v/ChangeLog                                |    4 +
 sim/d10v/aclocal.m4                               |   11 +-
 sim/d10v/config.in                                |   32 ++
 sim/d10v/configure                                |  376 +++++++++++++--------
 sim/erc32/ChangeLog                               |    4 +
 sim/erc32/aclocal.m4                              |   11 +-
 sim/erc32/config.in                               |   32 ++
 sim/erc32/configure                               |  298 ++++++++++-------
 sim/frv/ChangeLog                                 |    4 +
 sim/frv/aclocal.m4                                |   11 +-
 sim/frv/config.in                                 |   32 ++
 sim/frv/configure                                 |  304 ++++++++++-------
 sim/h8300/ChangeLog                               |    4 +
 sim/h8300/aclocal.m4                              |   11 +-
 sim/h8300/config.in                               |   32 ++
 sim/h8300/configure                               |  304 ++++++++++-------
 sim/igen/ChangeLog                                |    4 +
 sim/igen/configure                                |  116 +++++--
 sim/iq2000/ChangeLog                              |    4 +
 sim/iq2000/aclocal.m4                             |   11 +-
 sim/iq2000/config.in                              |   32 ++
 sim/iq2000/configure                              |  304 ++++++++++-------
 sim/lm32/ChangeLog                                |    4 +
 sim/lm32/aclocal.m4                               |   11 +-
 sim/lm32/config.in                                |   35 ++
 sim/lm32/configure                                |  304 ++++++++++-------
 sim/m32c/ChangeLog                                |    4 +
 sim/m32c/aclocal.m4                               |   11 +-
 sim/m32c/config.in                                |   34 ++-
 sim/m32c/configure                                |  304 ++++++++++-------
 sim/m32r/ChangeLog                                |    8 +
 sim/m32r/aclocal.m4                               |   11 +-
 sim/m32r/config.in                                |   32 ++
 sim/m32r/configure                                |  304 ++++++++++-------
 sim/m32r/traps-linux.c                            |    1 -
 sim/m68hc11/ChangeLog                             |    4 +
 sim/m68hc11/aclocal.m4                            |   11 +-
 sim/m68hc11/config.in                             |   35 ++
 sim/m68hc11/configure                             |  376 +++++++++++++--------
 sim/mcore/ChangeLog                               |    4 +
 sim/mcore/aclocal.m4                              |   11 +-
 sim/mcore/config.in                               |   32 ++
 sim/mcore/configure                               |  304 ++++++++++-------
 sim/microblaze/ChangeLog                          |    4 +
 sim/microblaze/aclocal.m4                         |   11 +-
 sim/microblaze/config.in                          |   32 ++
 sim/microblaze/configure                          |  304 ++++++++++-------
 sim/mips/ChangeLog                                |    4 +
 sim/mips/aclocal.m4                               |   11 +-
 sim/mips/config.in                                |   32 ++
 sim/mips/configure                                |  378 +++++++++++++--------
 sim/mn10300/ChangeLog                             |    4 +
 sim/mn10300/aclocal.m4                            |   11 +-
 sim/mn10300/config.in                             |   35 ++
 sim/mn10300/configure                             |  376 +++++++++++++--------
 sim/moxie/ChangeLog                               |    4 +
 sim/moxie/aclocal.m4                              |   11 +-
 sim/moxie/config.in                               |   47 +++
 sim/moxie/configure                               |  304 ++++++++++-------
 sim/rl78/ChangeLog                                |    4 +
 sim/rl78/aclocal.m4                               |   11 +-
 sim/rl78/config.in                                |   38 ++-
 sim/rl78/configure                                |  304 ++++++++++-------
 sim/rx/ChangeLog                                  |    9 +
 sim/rx/aclocal.m4                                 |   11 +-
 sim/rx/config.in                                  |   44 ++-
 sim/rx/configure                                  |  310 ++++++++++-------
 sim/rx/configure.ac                               |    6 +-
 sim/sh/ChangeLog                                  |    4 +
 sim/sh/aclocal.m4                                 |   11 +-
 sim/sh/config.in                                  |   32 ++
 sim/sh/configure                                  |  304 ++++++++++-------
 sim/sh64/ChangeLog                                |    4 +
 sim/sh64/aclocal.m4                               |   11 +-
 sim/sh64/config.in                                |   32 ++
 sim/sh64/configure                                |  304 ++++++++++-------
 sim/testsuite/ChangeLog                           |    4 +
 sim/testsuite/configure                           |    3 +
 sim/testsuite/sim/bfin/ChangeLog                  |   16 +
 sim/testsuite/sim/bfin/allinsn.exp                |   28 ++
 sim/testsuite/sim/bfin/c_dsp32mac_dr_a1a0.s       |    2 +-
 sim/testsuite/sim/bfin/c_dsp32mac_dr_a1a0_iutsh.s |    2 +-
 sim/testsuite/sim/bfin/c_dsp32mac_dr_a1a0_m.s     |    2 +-
 sim/testsuite/sim/bfin/c_dsp32shift_vmaxvmax.s    |    2 +-
 sim/testsuite/sim/bfin/c_dsp32shiftim_af_s.s      |    2 +-
 sim/testsuite/sim/bfin/fact.s                     |    6 +-
 sim/testsuite/sim/cris/ChangeLog                  |    9 +
 sim/testsuite/sim/cris/c/clone5.c                 |    2 +-
 sim/testsuite/sim/cris/c/fcntl1.c                 |    2 +-
 sim/testsuite/sim/cris/c/kill2.c                  |    2 +-
 sim/testsuite/sim/cris/c/kill3.c                  |    2 +-
 sim/testsuite/sim/cris/c/mprotect1.c              |    2 +-
 sim/testsuite/sim/cris/c/pipe5.c                  |    2 +-
 sim/testsuite/sim/cris/c/readlink5.c              |    2 +-
 sim/testsuite/sim/cris/c/rtsigprocmask1.c         |    2 +-
 sim/testsuite/sim/cris/c/rtsigsuspend1.c          |    2 +-
 sim/testsuite/sim/cris/c/sig10.c                  |    2 +-
 sim/testsuite/sim/cris/c/sig11.c                  |    2 +-
 sim/testsuite/sim/cris/c/sig3.c                   |    2 +-
 sim/testsuite/sim/cris/c/sig4.c                   |    2 +-
 sim/testsuite/sim/cris/c/sig5.c                   |    2 +-
 sim/testsuite/sim/cris/c/sig6.c                   |    2 +-
 sim/testsuite/sim/cris/c/sig7.c                   |    2 +-
 sim/testsuite/sim/cris/c/sig8.c                   |    2 +-
 sim/testsuite/sim/cris/c/sigreturn1.c             |    2 +-
 sim/testsuite/sim/cris/c/sigreturn2.c             |    2 +-
 sim/testsuite/sim/cris/c/syscall1.c               |    2 +-
 sim/testsuite/sim/cris/c/syscall2.c               |    2 +-
 sim/testsuite/sim/cris/c/syscall3.c               |    2 +-
 sim/testsuite/sim/cris/c/syscall4.c               |    2 +-
 sim/testsuite/sim/cris/c/sysctl2.c                |    2 +-
 sim/v850/ChangeLog                                |    4 +
 sim/v850/aclocal.m4                               |   11 +-
 sim/v850/config.in                                |   32 ++
 sim/v850/configure                                |  376 +++++++++++++--------
 170 files changed, 6758 insertions(+), 3577 deletions(-)
 create mode 100644 gdb/testsuite/gdb.python/py-value-cc.exp
 create mode 100644 gdb/testsuite/gdb.python/py-value.cc

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index da9f409..04c3b31 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,24 @@
+2012-03-23  Alan Modra  <amodra@gmail.com>
+
+	* elf.c (assign_file_positions_for_non_load_sections): Don't warn
+	on empty alloc sections.
+
+2012-03-23  Alan Modra  <amodra@gmail.com>
+
+	* linker.c (_bfd_nearby_section): New function, split out from..
+	(fix_syms): ..here.
+	* bfd-in.h (_bfd_nearby_section): Declare.
+	* bfd-in2.h: Regenerate.
+	* elflink.c (elf_link_input_bfd): Don't use text_index_section or
+	data_index_section with ld -q or ld -r output relocs against
+	stripped output sections.  Instead use _bfd_nearby_section.
+
+2012-03-23  Alan Modra  <amodra@gmail.com>
+
+	PR binutils/13894
+	* elf64-ppc.c (opd_entry_value): Read full symbol table when
+	sym hashes unavailable.
+
 2012-03-21  Eliot Dresselhaus  <eliot@sonic.net>
 
 	* elf32-tic6x.c (elf32_tic6x_merge_private_bfd_data): Return TRUE
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 40ed786..c331f3b 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -705,6 +705,9 @@ extern int bfd_get_sign_extend_vma
 extern struct bfd_section *_bfd_elf_tls_setup
   (bfd *, struct bfd_link_info *);
 
+extern struct bfd_section *
+_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
+
 extern void _bfd_fix_excluded_sec_syms
   (bfd *, struct bfd_link_info *);
 
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index bea3a05..61513f2 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -712,6 +712,9 @@ extern int bfd_get_sign_extend_vma
 extern struct bfd_section *_bfd_elf_tls_setup
   (bfd *, struct bfd_link_info *);
 
+extern struct bfd_section *
+_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
+
 extern void _bfd_fix_excluded_sec_syms
   (bfd *, struct bfd_link_info *);
 
diff --git a/bfd/elf.c b/bfd/elf.c
index 5aabeeb..df43a6a 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4820,12 +4820,13 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
 	BFD_ASSERT (hdr->sh_offset == hdr->bfd_section->filepos);
       else if ((hdr->sh_flags & SHF_ALLOC) != 0)
 	{
-	  (*_bfd_error_handler)
-	    (_("%B: warning: allocated section `%s' not in segment"),
-	     abfd,
-	     (hdr->bfd_section == NULL
-	      ? "*unknown*"
-	      : hdr->bfd_section->name));
+	  if (hdr->sh_size != 0)
+	    (*_bfd_error_handler)
+	      (_("%B: warning: allocated section `%s' not in segment"),
+	       abfd,
+	       (hdr->bfd_section == NULL
+		? "*unknown*"
+		: hdr->bfd_section->name));
 	  /* We don't need to page align empty sections.  */
 	  if ((abfd->flags & D_PAGED) != 0 && hdr->sh_size != 0)
 	    off += vma_page_aligned_bias (hdr->sh_addr, off,
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index f4f5d0b..e7a01c2 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -5585,15 +5585,18 @@ opd_entry_value (asection *opd_sec,
 	      unsigned long symndx = ELF64_R_SYM (look->r_info);
 	      asection *sec;
 
-	      if (symndx < symtab_hdr->sh_info)
+	      if (symndx < symtab_hdr->sh_info
+		  || elf_sym_hashes (opd_bfd) == NULL)
 		{
 		  Elf_Internal_Sym *sym;
 
 		  sym = (Elf_Internal_Sym *) symtab_hdr->contents;
 		  if (sym == NULL)
 		    {
-		      sym = bfd_elf_get_elf_syms (opd_bfd, symtab_hdr,
-						  symtab_hdr->sh_info,
+		      size_t symcnt = symtab_hdr->sh_info;
+		      if (elf_sym_hashes (opd_bfd) == NULL)
+			symcnt = symtab_hdr->sh_size / symtab_hdr->sh_entsize;
+		      sym = bfd_elf_get_elf_syms (opd_bfd, symtab_hdr, symcnt,
 						  0, NULL, NULL, NULL);
 		      if (sym == NULL)
 			break;
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 7f9ec60..3236911 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -9747,23 +9747,12 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
 			      r_symndx = osec->target_index;
 			      if (r_symndx == STN_UNDEF)
 				{
-				  struct elf_link_hash_table *htab;
-				  asection *oi;
-
-				  htab = elf_hash_table (finfo->info);
-				  oi = htab->text_index_section;
-				  if ((osec->flags & SEC_READONLY) == 0
-				      && htab->data_index_section != NULL)
-				    oi = htab->data_index_section;
-
-				  if (oi != NULL)
-				    {
-				      irela->r_addend += osec->vma - oi->vma;
-				      r_symndx = oi->target_index;
-				    }
+				  irela->r_addend += osec->vma;
+				  osec = _bfd_nearby_section (output_bfd, osec,
+							      osec->vma);
+				  irela->r_addend -= osec->vma;
+				  r_symndx = osec->target_index;
 				}
-
-			      BFD_ASSERT (r_symndx != STN_UNDEF);
 			    }
 			}
 
diff --git a/bfd/linker.c b/bfd/linker.c
index 0404474..2f8ecbb 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -3130,6 +3130,81 @@ _bfd_generic_section_already_linked (bfd *abfd ATTRIBUTE_UNUSED,
   return FALSE;
 }
 
+/* Choose a neighbouring section to S in OBFD that will be output, or
+   the absolute section if ADDR is out of bounds of the neighbours.  */
+
+asection *
+_bfd_nearby_section (bfd *obfd, asection *s, bfd_vma addr)
+{
+  asection *next, *prev, *best;
+
+  /* Find preceding kept section.  */
+  for (prev = s->prev; prev != NULL; prev = prev->prev)
+    if ((prev->flags & SEC_EXCLUDE) == 0
+	&& !bfd_section_removed_from_list (obfd, prev))
+      break;
+
+  /* Find following kept section.  Start at prev->next because
+     other sections may have been added after S was removed.  */
+  if (s->prev != NULL)
+    next = s->prev->next;
+  else
+    next = s->owner->sections;
+  for (; next != NULL; next = next->next)
+    if ((next->flags & SEC_EXCLUDE) == 0
+	&& !bfd_section_removed_from_list (obfd, next))
+      break;
+
+  /* Choose better of two sections, based on flags.  The idea
+     is to choose a section that will be in the same segment
+     as S would have been if it was kept.  */
+  best = next;
+  if (prev == NULL)
+    {
+      if (next == NULL)
+	best = bfd_abs_section_ptr;
+    }
+  else if (next == NULL)
+    best = prev;
+  else if (((prev->flags ^ next->flags)
+	    & (SEC_ALLOC | SEC_THREAD_LOCAL | SEC_LOAD)) != 0)
+    {
+      if (((next->flags ^ s->flags)
+	   & (SEC_ALLOC | SEC_THREAD_LOCAL)) != 0
+	  /* We prefer to choose a loaded section.  Section S
+	     doesn't have SEC_LOAD set (it being excluded, that
+	     part of the flag processing didn't happen) so we
+	     can't compare that flag to those of NEXT and PREV.  */
+	  || ((prev->flags & SEC_LOAD) != 0
+	      && (next->flags & SEC_LOAD) == 0))
+	best = prev;
+    }
+  else if (((prev->flags ^ next->flags) & SEC_READONLY) != 0)
+    {
+      if (((next->flags ^ s->flags) & SEC_READONLY) != 0)
+	best = prev;
+    }
+  else if (((prev->flags ^ next->flags) & SEC_CODE) != 0)
+    {
+      if (((next->flags ^ s->flags) & SEC_CODE) != 0)
+	best = prev;
+    }
+  else
+    {
+      /* Flags we care about are the same.  Prefer the following
+	 section if that will result in a positive valued sym.  */
+      if (addr < next->vma)
+	best = prev;
+    }
+
+  /* Refuse to choose a section for which we are out of bounds.  */
+  /* ??? This may make most of the above moot.  */
+  if (addr < best->vma || addr > best->vma + best->size)
+    best = bfd_abs_section_ptr;
+
+  return best;
+}
+
 /* Convert symbols in excluded output sections to use a kept section.  */
 
 static bfd_boolean
@@ -3146,74 +3221,10 @@ fix_syms (struct bfd_link_hash_entry *h, void *data)
 	  && (s->output_section->flags & SEC_EXCLUDE) != 0
 	  && bfd_section_removed_from_list (obfd, s->output_section))
 	{
-	  asection *op, *op1;
+	  asection *op;
 
 	  h->u.def.value += s->output_offset + s->output_section->vma;
-
-	  /* Find preceding kept section.  */
-	  for (op1 = s->output_section->prev; op1 != NULL; op1 = op1->prev)
-	    if ((op1->flags & SEC_EXCLUDE) == 0
-		&& !bfd_section_removed_from_list (obfd, op1))
-	      break;
-
-	  /* Find following kept section.  Start at prev->next because
-	     other sections may have been added after S was removed.  */
-	  if (s->output_section->prev != NULL)
-	    op = s->output_section->prev->next;
-	  else
-	    op = s->output_section->owner->sections;
-	  for (; op != NULL; op = op->next)
-	    if ((op->flags & SEC_EXCLUDE) == 0
-		&& !bfd_section_removed_from_list (obfd, op))
-	      break;
-
-	  /* Choose better of two sections, based on flags.  The idea
-	     is to choose a section that will be in the same segment
-	     as S would have been if it was kept.  */
-	  if (op1 == NULL)
-	    {
-	      if (op == NULL)
-		op = bfd_abs_section_ptr;
-	    }
-	  else if (op == NULL)
-	    op = op1;
-	  else if (((op1->flags ^ op->flags)
-		    & (SEC_ALLOC | SEC_THREAD_LOCAL | SEC_LOAD)) != 0)
-	    {
-	      if (((op->flags ^ s->flags)
-		   & (SEC_ALLOC | SEC_THREAD_LOCAL)) != 0
-		  /* We prefer to choose a loaded section.  Section S
-		     doesn't have SEC_LOAD set (it being excluded, that
-		     part of the flag processing didn't happen) so we
-		     can't compare that flag to those of OP and OP1.  */
-		  || ((op1->flags & SEC_LOAD) != 0
-		      && (op->flags & SEC_LOAD) == 0))
-		op = op1;
-	    }
-	  else if (((op1->flags ^ op->flags) & SEC_READONLY) != 0)
-	    {
-	      if (((op->flags ^ s->flags) & SEC_READONLY) != 0)
-		op = op1;
-	    }
-	  else if (((op1->flags ^ op->flags) & SEC_CODE) != 0)
-	    {
-	      if (((op->flags ^ s->flags) & SEC_CODE) != 0)
-		op = op1;
-	    }
-	  else
-	    {
-	      /* Flags we care about are the same.  Prefer the following
-		 section if that will result in a positive valued sym.  */
-	      if (h->u.def.value < op->vma)
-		op = op1;
-	    }
-
-	  /* Refuse to choose a section for which we are out of bounds.  */
-	  /* ??? This may make most of the above moot.  */
-	  if (h->u.def.value < op->vma
-	      || h->u.def.value > op->vma + op->size)
-	    op = bfd_abs_section_ptr;
-
+	  op = _bfd_nearby_section (obfd, s->output_section, h->u.def.value);
 	  h->u.def.value -= op->vma;
 	  h->u.def.section = op;
 	}
diff --git a/bfd/version.h b/bfd/version.h
index ace12b2..0912d1c 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20120322
+#define BFD_VERSION_DATE 20120326
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 000b921..5304e17 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,37 @@
+2012-03-26 Oza Pawandeep  <oza.pawandeep@gmail.com>
+
+        * MAINTAINERS (Write After Approval): Add myself to the list.
+
+2012-03-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* NEWS (set breakpoint condition-evaluation): Change "gdb" to "host".
+	Describe also the option "auto".
+
+2012-03-22  Richard Henderson  <rth@redhat.com>
+
+	* sparc-linux-nat.c (_initialize_sparc_linux_nat): Fix prototype.
+	* sparc-nat.c (sparc_xfer_wcookie): Make static.
+
+2012-03-22  Richard Henderson  <rth@redhat.com>
+
+	* jit.c (jit_read_code_entry): Compute alignment and offset of
+	int64_t member before computing entry_size.
+
+2012-03-22  Siva Chandra Reddy  <sivachandra@google.com>
+
+	Python scripting: Add new method Value.referenced_value to
+	gdb.Value which can dereference pointer as well as reference
+	values.
+	* NEWS: Add entry under 'Python scripting' about the new method
+	Value.referenced_value on gdb.Value objects.
+	* python/py-value.c (valpy_referenced_value): New function
+	defining a new method on gdb.Value objects which can dereference
+	pointer and reference values.
+
+2012-03-22  Siva Chandra Reddy  <sivachandra@google.com>
+
+	* MAINTAINERS (Write After Approval): Add myself to the list.
+
 2012-03-21  Kevin Buettner  <kevinb@redhat.com>
 
 	* symtab.c (skip_prologue_sal): Change test to check for "main()"
diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS
index a92216f..6dc5d67 100644
--- a/gdb/MAINTAINERS
+++ b/gdb/MAINTAINERS
@@ -590,6 +590,7 @@ Marek Polacek					mpolacek@redhat.com
 Vladimir Prus                                   vladimir@codesourcery.com
 Yao Qi						yao@codesourcery.com
 Qinwei						qinwei@sunnorth.com.cn
+Siva Chandra Reddy				sivachandra@google.com
 Matt Rice					ratmice@gmail.com
 Frederic Riss					frederic.riss@st.com
 Aleksandar Ristovski				aristovski@qnx.com
@@ -648,7 +649,7 @@ Jie Zhang					jzhang918@gmail.com
 Wu Zhou						woodzltc@cn.ibm.com
 Yoshinori Sato					ysato@users.sourceforge.jp
 Hui Zhu						teawater@gmail.com
-
+Oza Pawandeep					oza.pawandeep@gmail.com
 
 			Past Maintainers
 
diff --git a/gdb/NEWS b/gdb/NEWS
index d23a773..f21921a 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -25,6 +25,9 @@
      frame in order to compute its value, and the latter computes the
      symbol's value.
 
+  ** A new method 'referenced_value' on gdb.Value objects which can
+     dereference pointer as well as C++ reference values.
+
 * GDBserver now supports stdio connections.
   E.g. (gdb) target remote | ssh myhost gdbserver - hello
 
@@ -99,8 +102,9 @@ HP OpenVMS ia64			ia64-hp-openvms*
 
 set breakpoint condition-evaluation
 show breakpoint condition-evaluation
-  Controls whether breakpoint conditions are evaluated by GDB ("gdb") or by
-  GDBserver ("target").
+  Controls whether breakpoint conditions are evaluated by GDB ("host") or by
+  GDBserver ("target").  Default option "auto" chooses the most efficient
+  available mode.
   This option can improve debugger efficiency depending on the speed of the
   target.
 
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 92e3e1b..ff7786f 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,10 @@
+2012-03-22  Siva Chandra Reddy  <sivachandra@google.com>
+
+	* gdb.texinfo (Python API/Values From Inferior): Add description
+	about the new method Value.referenced_value.  Add description on
+	how Value.dereference is different (and similar) to
+	Value.referenced_value.
+
 2012-03-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	* gdb.texinfo (File Options): Describe --init-command=FILE, -ix and
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 677af3b..dbf1a71 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -22136,6 +22136,79 @@ bar = foo.dereference ()
 
 The result @code{bar} will be a @code{gdb.Value} object holding the
 value pointed to by @code{foo}.
+
+A similar function @code{Value.referenced_value} exists which also
+returns @code{gdb.Value} objects corresonding to the values pointed to
+by pointer values (and additionally, values referenced by reference
+values).  However, the behavior of @code{Value.dereference}
+differs from @code{Value.referenced_value} by the fact that the
+behavior of @code{Value.dereference} is identical to applying the C
+unary operator @code{*} on a given value.  For example, consider a
+reference to a pointer @code{ptrref}, declared in your C@t{++} program
+as
+
+@smallexample
+typedef int *intptr;
+...
+int val = 10;
+intptr ptr = &val;
+intptr &ptrref = ptr;
+@end smallexample
+
+Though @code{ptrref} is a reference value, one can apply the method
+@code{Value.dereference} to the @code{gdb.Value} object corresponding
+to it and obtain a @code{gdb.Value} which is identical to that
+corresponding to @code{val}.  However, if you apply the method
+@code{Value.referenced_value}, the result would be a @code{gdb.Value}
+object identical to that corresponding to @code{ptr}.
+
+@smallexample
+py_ptrref = gdb.parse_and_eval ("ptrref")
+py_val = py_ptrref.dereference ()
+py_ptr = py_ptrref.referenced_value ()
+@end smallexample
+
+The @code{gdb.Value} object @code{py_val} is identical to that
+corresponding to @code{val}, and @code{py_ptr} is identical to that
+corresponding to @code{ptr}.  In general, @code{Value.dereference} can
+be applied whenever the C unary operator @code{*} can be applied
+to the corresponding C value.  For those cases where applying both
+@code{Value.dereference} and @code{Value.referenced_value} is allowed,
+the results obtained need not be identical (as we have seen in the above
+example).  The results are however identical when applied on
+@code{gdb.Value} objects corresponding to pointers (@code{gdb.Value}
+objects with type code @code{TYPE_CODE_PTR}) in a C/C@t{++} program.
+@end defun
+
+@defun Value.referenced_value ()
+For pointer or reference data types, this method returns a new
+@code{gdb.Value} object corresponding to the value referenced by the
+pointer/reference value.  For pointer data types,
+@code{Value.dereference} and @code{Value.referenced_value} produce
+identical results.  The difference between these methods is that
+@code{Value.dereference} cannot get the values referenced by reference
+values.  For example, consider a reference to an @code{int}, declared
+in your C@t{++} program as
+
+@smallexample
+int val = 10;
+int &ref = val;
+@end smallexample
+
+@noindent
+then applying @code{Value.dereference} to the @code{gdb.Value} object
+corresponding to @code{ref} will result in an error, while applying
+@code{Value.referenced_value} will result in a @code{gdb.Value} object
+identical to that corresponding to @code{val}.
+
+@smallexample
+py_ref = gdb.parse_and_eval ("ref")
+er_ref = py_ref.dereference ()       # Results in error
+py_val = py_ref.referenced_value ()  # Returns the referenced value
+@end smallexample
+
+The @code{gdb.Value} object @code{py_val} is identical to that
+corresponding to @code{val}.
 @end defun
 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [SCM]  archer-keiths-linespec-rewrite: Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite
@ 2012-03-19 19:24 kseitz
  0 siblings, 0 replies; 8+ messages in thread
From: kseitz @ 2012-03-19 19:24 UTC (permalink / raw)
  To: archer-commits

The branch, archer-keiths-linespec-rewrite has been updated
       via  380143a6f3b302231b64e104ffbc8725782964ed (commit)
       via  e3ec945d53406d7232ec8e043c941e9be1572c78 (commit)
       via  b65ecc84c539325076f4fd8c963e8ee191877a70 (commit)
       via  03ae95e867a4c94f0bdf7a2358cedc39a19a1fdb (commit)
       via  35d2e24b5a91d04403d10514e896f68df8b40dea (commit)
       via  dff5a25c1f0ade13d791de1864948696381debeb (commit)
       via  f0a040c143cbcec1244eebc0970b32013fb98a8a (commit)
      from  0f2b6d4b7db4a52e143eae4a894be518a651e342 (commit)

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

- Log -----------------------------------------------------------------
commit 380143a6f3b302231b64e104ffbc8725782964ed
Merge: e3ec945 03ae95e
Author: Keith Seitz <keiths@redhat.com>
Date:   Mon Mar 19 12:13:02 2012 -0700

    Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite

commit e3ec945d53406d7232ec8e043c941e9be1572c78
Author: Keith Seitz <keiths@redhat.com>
Date:   Mon Mar 19 12:00:46 2012 -0700

    New dollars-in-linespecs tests.

commit b65ecc84c539325076f4fd8c963e8ee191877a70
Author: Keith Seitz <keiths@redhat.com>
Date:   Mon Mar 19 11:58:59 2012 -0700

    remove c++ compile option

commit 03ae95e867a4c94f0bdf7a2358cedc39a19a1fdb
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Mar 19 18:23:51 2012 +0000

    gdb/
    	Code cleanup.
    	* python/py-auto-load.c (source_section_scripts): New variable back_to.
    	Turn fclose and xfree calls into make_cleanup_fclose and make_cleanup
    	with xfree.
    	(auto_load_objfile_script): Turn fclose into make_cleanup_fclose.

commit 35d2e24b5a91d04403d10514e896f68df8b40dea
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Mar 19 18:19:23 2012 +0000

    gdb/
    	* NEWS: Describe new options --init-command=FILE, -ix and
    	--init-eval-command=COMMAND, -iex.
    	* main.c (struct cmdarg): New enum items CMDARG_INIT_FILE and
    	CMDARG_INIT_COMMAND.
    	(captured_main): New enum items OPT_IX and OPT_IEX.  Add
    	"init-command", "init-eval-command", "ix" and "iex" to the variable
    	long_options.  Handle OPT_IX and OPT_IEX.  Process them from CMDARG_VEC.
    	New comment for CMDARG_FILE and CMDARG_COMMAND processing.
    	(print_gdb_help): Describe --init-command=FILE, -ix and
    	--init-eval-command=COMMAND, -iex.
    
    gdb/doc/
    	* gdb.texinfo (File Options): Describe --init-command=FILE, -ix and
    	--init-eval-command=COMMAND, -iex.
    	(Startup): Describe -iex and -ix.  Simplify the example
    	for "set auto-load-scripts off".
    
    gdb/testsuite/
    	* gdb.gdb/selftest.exp (do_steps_and_nexts): New entry
    	for cmdarg_vec = NULL.  Remove entries for cmdsize = 1, cmdarg = and
    	ncmd = 0.  New entry for VEC_cleanup cmdarg_s.

commit dff5a25c1f0ade13d791de1864948696381debeb
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Mar 19 18:16:17 2012 +0000

    gdb/
    	Code cleanup.
    	* main.c (struct cmdarg): Move it here from main.  Add more comments.
    	(cmdarg_s, VEC (cmdarg_s)): New.
    	(main): Move struct cmdarg from here.  New variables cmdarg_vec and
    	cmdarg_p.  Remove variables cmdsize and ncmd and their initialization.
    	Install cleanup for cmdarg_vec.  Update filling for options 'x' and
    	'X'.  Replace cmdarg processing by cmdarg_vec processing.  Remove xfree
    	of CMDARG.

commit f0a040c143cbcec1244eebc0970b32013fb98a8a
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 19 18:13:39 2012 +0000

    	* gnu-v3-abi.c (gnuv3_print_vtable): Initialize 'result_vec'.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog                            |   36 +++++++++
 gdb/NEWS                                 |    7 ++
 gdb/doc/ChangeLog                        |    7 ++
 gdb/doc/gdb.texinfo                      |   32 +++++++--
 gdb/gnu-v3-abi.c                         |    2 +-
 gdb/main.c                               |  121 +++++++++++++++++++++---------
 gdb/python/py-auto-load.c                |   15 +++-
 gdb/testsuite/ChangeLog                  |    6 ++
 gdb/testsuite/gdb.gdb/selftest.exp       |   20 ++---
 gdb/testsuite/gdb.linespec/ls-dollar.cc  |   26 +++++++
 gdb/testsuite/gdb.linespec/ls-dollar.exp |   38 +++++++++
 gdb/testsuite/gdb.linespec/ls-errs.exp   |    2 +-
 12 files changed, 252 insertions(+), 60 deletions(-)
 create mode 100644 gdb/testsuite/gdb.linespec/ls-dollar.cc
 create mode 100644 gdb/testsuite/gdb.linespec/ls-dollar.exp

First 500 lines of diff:
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7325047..3059d69 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,39 @@
+2012-03-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Code cleanup.
+	* python/py-auto-load.c (source_section_scripts): New variable back_to.
+	Turn fclose and xfree calls into make_cleanup_fclose and make_cleanup
+	with xfree.
+	(auto_load_objfile_script): Turn fclose into make_cleanup_fclose.
+
+2012-03-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* NEWS: Describe new options --init-command=FILE, -ix and
+	--init-eval-command=COMMAND, -iex.
+	* main.c (struct cmdarg): New enum items CMDARG_INIT_FILE and
+	CMDARG_INIT_COMMAND.
+	(captured_main): New enum items OPT_IX and OPT_IEX.  Add
+	"init-command", "init-eval-command", "ix" and "iex" to the variable
+	long_options.  Handle OPT_IX and OPT_IEX.  Process them from CMDARG_VEC.
+	New comment for CMDARG_FILE and CMDARG_COMMAND processing.
+	(print_gdb_help): Describe --init-command=FILE, -ix and
+	--init-eval-command=COMMAND, -iex.
+
+2012-03-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Code cleanup.
+	* main.c (struct cmdarg): Move it here from main.  Add more comments.
+	(cmdarg_s, VEC (cmdarg_s)): New.
+	(main): Move struct cmdarg from here.  New variables cmdarg_vec and
+	cmdarg_p.  Remove variables cmdsize and ncmd and their initialization.
+	Install cleanup for cmdarg_vec.  Update filling for options 'x' and
+	'X'.  Replace cmdarg processing by cmdarg_vec processing.  Remove xfree
+	of CMDARG.
+
+2012-03-19  Tom Tromey  <tromey@redhat.com>
+
+	* gnu-v3-abi.c (gnuv3_print_vtable): Initialize 'result_vec'.
+
 2012-03-16  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	PR symtab/13777
diff --git a/gdb/NEWS b/gdb/NEWS
index e6bf59c..d23a773 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -118,6 +118,13 @@ QProgramSignals:
   Specify the signals which the remote stub may pass to the debugged
   program without GDB involvement.
 
+* New command line options
+
+--init-command=FILE, -ix          Like --command, -x but execute it
+                                  before loading inferior.
+--init-eval-command=COMMAND, -iex Like --eval-command=COMMAND, -ex but
+                                  execute it before loading inferior.
+
 *** Changes in GDB 7.4
 
 * GDB now handles ambiguous linespecs more consistently; the existing
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index cb6d0e9..92e3e1b 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,10 @@
+2012-03-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* gdb.texinfo (File Options): Describe --init-command=FILE, -ix and
+	--init-eval-command=COMMAND, -iex.
+	(Startup): Describe -iex and -ix.  Simplify the example
+	for "set auto-load-scripts off".
+
 2012-03-16  Gary Benson  <gbenson@redhat.com>
 
 	PR breakpoints/10738
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 56bf5d5..677af3b 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -990,6 +990,22 @@ also be interleaved with @samp{-command} as required.
    -x setbreakpoints -ex 'run' a.out
 @end smallexample
 
+@item -init-command @var{file}
+@itemx -ix @var{file}
+@cindex @code{--init-command}
+@cindex @code{-ix}
+Execute commands from file @var{file} before loading gdbinit files or the
+inferior.
+@xref{Startup}.
+
+@item -init-eval-command @var{command}
+@itemx -iex @var{command}
+@cindex @code{--init-eval-command}
+@cindex @code{-iex}
+Execute a single @value{GDBN} command before loading gdbinit files or the
+inferior.
+@xref{Startup}.
+
 @item -directory @var{directory}
 @itemx -d @var{directory}
 @cindex @code{--directory}
@@ -1242,6 +1258,13 @@ Sets up the command interpreter as specified by the command line
 (@pxref{Mode Options, interpreter}).
 
 @item
+Executes commands and command files specified by the @samp{-iex} and
+@samp{-ix} options in their specified order.  Usually you should use the
+@samp{-ex} and @samp{-x} options instead, but this way you can apply
+settings before @value{GDBN} init files get executed and before inferior
+gets loaded.
+
+@item
 @cindex init file
 Reads the system-wide @dfn{init file} (if @option{--with-system-gdbinit} was
 used when building @value{GDBN}; @pxref{System-wide configuration,
@@ -1275,14 +1298,11 @@ If you wish to disable the auto-loading during startup,
 you must do something like the following:
 
 @smallexample
-$ gdb -ex "set auto-load-scripts off" -ex "file myprogram"
+$ gdb -iex "set auto-load-scripts off" myprogram
 @end smallexample
 
-The following does not work because the auto-loading is turned off too late:
-
-@smallexample
-$ gdb -ex "set auto-load-scripts off" myprogram
-@end smallexample
+Option @samp{-ex} does not work because the auto-loading is then turned
+off too late.
 
 @item
 Executes commands and command files specified by the @samp{-ex} and
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index 72ca2a1..1095c60 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -907,7 +907,7 @@ gnuv3_print_vtable (struct value *value)
   struct value_print_options opts;
   htab_t offset_hash;
   struct cleanup *cleanup;
-  VEC (value_and_voffset_p) *result_vec;
+  VEC (value_and_voffset_p) *result_vec = NULL;
   struct value_and_voffset *iter;
   int i, count;
 
diff --git a/gdb/main.c b/gdb/main.c
index a63a385..e528cd1 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -239,6 +239,31 @@ captured_command_loop (void *data)
   return 1;
 }
 
+/* Arguments of --command option and its counterpart.  */
+typedef struct cmdarg {
+  /* Type of this option.  */
+  enum {
+    /* Option type -x.  */
+    CMDARG_FILE,
+
+    /* Option type -ex.  */
+    CMDARG_COMMAND,
+
+    /* Option type -ix.  */
+    CMDARG_INIT_FILE,
+    
+    /* Option type -iex.  */
+    CMDARG_INIT_COMMAND
+  } type;
+
+  /* Value of this option - filename or the GDB command itself.  String memory
+     is not owned by this structure despite it is 'const'.  */
+  char *string;
+} cmdarg_s;
+
+/* Define type VEC (cmdarg_s).  */
+DEF_VEC_O (cmdarg_s);
+
 static int
 captured_main (void *data)
 {
@@ -263,17 +288,8 @@ captured_main (void *data)
   static int print_version;
 
   /* Pointers to all arguments of --command option.  */
-  struct cmdarg {
-    enum {
-      CMDARG_FILE,
-      CMDARG_COMMAND
-    } type;
-    char *string;
-  } *cmdarg;
-  /* Allocated size of cmdarg.  */
-  int cmdsize;
-  /* Number of elements of cmdarg used.  */
-  int ncmd;
+  VEC (cmdarg_s) *cmdarg_vec = NULL;
+  struct cmdarg *cmdarg_p;
 
   /* Indices of all arguments of --directory option.  */
   char **dirarg;
@@ -309,9 +325,7 @@ captured_main (void *data)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
-  cmdsize = 1;
-  cmdarg = (struct cmdarg *) xmalloc (cmdsize * sizeof (*cmdarg));
-  ncmd = 0;
+  make_cleanup (VEC_cleanup (cmdarg_s), &cmdarg_vec);
   dirsize = 1;
   dirarg = (char **) xmalloc (dirsize * sizeof (*dirarg));
   ndir = 0;
@@ -386,7 +400,9 @@ captured_main (void *data)
       OPT_STATISTICS,
       OPT_TUI,
       OPT_NOWINDOWS,
-      OPT_WINDOWS
+      OPT_WINDOWS,
+      OPT_IX,
+      OPT_IEX
     };
     static struct option long_options[] =
     {
@@ -426,6 +442,10 @@ captured_main (void *data)
       {"version", no_argument, &print_version, 1},
       {"x", required_argument, 0, 'x'},
       {"ex", required_argument, 0, 'X'},
+      {"init-command", required_argument, 0, OPT_IX},
+      {"init-eval-command", required_argument, 0, OPT_IEX},
+      {"ix", required_argument, 0, OPT_IX},
+      {"iex", required_argument, 0, OPT_IEX},
 #ifdef GDBTK
       {"tclcommand", required_argument, 0, 'z'},
       {"enable-external-editor", no_argument, 0, 'y'},
@@ -536,24 +556,32 @@ captured_main (void *data)
 	    pidarg = optarg;
 	    break;
 	  case 'x':
-	    cmdarg[ncmd].type = CMDARG_FILE;
-	    cmdarg[ncmd++].string = optarg;
-	    if (ncmd >= cmdsize)
-	      {
-		cmdsize *= 2;
-		cmdarg = xrealloc ((char *) cmdarg,
-				   cmdsize * sizeof (*cmdarg));
-	      }
+	    {
+	      struct cmdarg cmdarg = { CMDARG_FILE, optarg };
+
+	      VEC_safe_push (cmdarg_s, cmdarg_vec, &cmdarg);
+	    }
 	    break;
 	  case 'X':
-	    cmdarg[ncmd].type = CMDARG_COMMAND;
-	    cmdarg[ncmd++].string = optarg;
-	    if (ncmd >= cmdsize)
-	      {
-		cmdsize *= 2;
-		cmdarg = xrealloc ((char *) cmdarg,
-				   cmdsize * sizeof (*cmdarg));
-	      }
+	    {
+	      struct cmdarg cmdarg = { CMDARG_COMMAND, optarg };
+
+	      VEC_safe_push (cmdarg_s, cmdarg_vec, &cmdarg);
+	    }
+	    break;
+	  case OPT_IX:
+	    {
+	      struct cmdarg cmdarg = { CMDARG_INIT_FILE, optarg };
+
+	      VEC_safe_push (cmdarg_s, cmdarg_vec, &cmdarg);
+	    }
+	    break;
+	  case OPT_IEX:
+	    {
+	      struct cmdarg cmdarg = { CMDARG_INIT_COMMAND, optarg };
+
+	      VEC_safe_push (cmdarg_s, cmdarg_vec, &cmdarg);
+	    }
 	    break;
 	  case 'B':
 	    batch_flag = batch_silent = 1;
@@ -806,6 +834,20 @@ captured_main (void *data)
   quit_pre_print = error_pre_print;
   warning_pre_print = _("\nwarning: ");
 
+  /* Process '-ix' and '-iex' options early.  */
+  for (i = 0; VEC_iterate (cmdarg_s, cmdarg_vec, i, cmdarg_p); i++)
+    switch (cmdarg_p->type)
+    {
+      case CMDARG_INIT_FILE:
+        catch_command_errors (source_script, cmdarg_p->string,
+			      !batch_flag, RETURN_MASK_ALL);
+	break;
+      case CMDARG_INIT_COMMAND:
+        catch_command_errors (execute_command, cmdarg_p->string,
+			      !batch_flag, RETURN_MASK_ALL);
+	break;
+    }
+
   /* Read and execute the system-wide gdbinit file, if it exists.
      This is done *before* all the command line arguments are
      processed; it sets global parameters, which are independent of
@@ -908,16 +950,19 @@ captured_main (void *data)
   ALL_OBJFILES (objfile)
     load_auto_scripts_for_objfile (objfile);
 
-  for (i = 0; i < ncmd; i++)
+  /* Process '-x' and '-ex' options.  */
+  for (i = 0; VEC_iterate (cmdarg_s, cmdarg_vec, i, cmdarg_p); i++)
+    switch (cmdarg_p->type)
     {
-      if (cmdarg[i].type == CMDARG_FILE)
-        catch_command_errors (source_script, cmdarg[i].string,
+      case CMDARG_FILE:
+        catch_command_errors (source_script, cmdarg_p->string,
 			      !batch_flag, RETURN_MASK_ALL);
-      else  /* cmdarg[i].type == CMDARG_COMMAND */
-        catch_command_errors (execute_command, cmdarg[i].string,
+	break;
+      case CMDARG_COMMAND:
+        catch_command_errors (execute_command, cmdarg_p->string,
 			      !batch_flag, RETURN_MASK_ALL);
+	break;
     }
-  xfree (cmdarg);
 
   /* Read in the old history after all the command files have been
      read.  */
@@ -988,6 +1033,8 @@ Options:\n\n\
                      Execute a single GDB command.\n\
                      May be used multiple times and in conjunction\n\
                      with --command.\n\
+  --init-command=FILE, -ix Like -x but execute it before loading inferior.\n\
+  --init-eval-command=COMMAND, -iex Like -ex but before loading inferior.\n\
   --core=COREFILE    Analyze the core dump COREFILE.\n\
   --pid=PID          Attach to running process PID.\n\
 "), stream);
diff --git a/gdb/python/py-auto-load.c b/gdb/python/py-auto-load.c
index e297bf3..14e75a7 100644
--- a/gdb/python/py-auto-load.c
+++ b/gdb/python/py-auto-load.c
@@ -254,6 +254,7 @@ source_section_scripts (struct objfile *objfile, const char *source_name,
       FILE *stream;
       char *full_path;
       int opened, in_hash_table;
+      struct cleanup *back_to;
 
       if (*p != 1)
 	{
@@ -286,6 +287,13 @@ source_section_scripts (struct objfile *objfile, const char *source_name,
       opened = find_and_open_script (file, 1 /*search_path*/,
 				     &stream, &full_path);
 
+      back_to = make_cleanup (null_cleanup, NULL);
+      if (opened)
+	{
+	  make_cleanup_fclose (stream);
+	  make_cleanup (xfree, full_path);
+	}
+
       /* If one script isn't found it's not uncommon for more to not be
 	 found either.  We don't want to print an error message for each
 	 script, too much noise.  Instead, we print the warning once and tell
@@ -313,9 +321,9 @@ Use `info auto-load-scripts [REGEXP]' to list them."),
 	  /* If this file is not currently loaded, load it.  */
 	  if (! in_hash_table)
 	    source_python_script_for_objfile (objfile, stream, full_path);
-	  fclose (stream);
-	  xfree (full_path);
 	}
+
+      do_cleanups (back_to);
     }
 }
 
@@ -420,6 +428,8 @@ auto_load_objfile_script (struct objfile *objfile, const char *suffix)
     {
       struct auto_load_pspace_info *pspace_info;
 
+      make_cleanup_fclose (input);
+
       /* Add this script to the hash table too so "info auto-load-scripts"
 	 can print it.  */
       pspace_info =
@@ -432,7 +442,6 @@ auto_load_objfile_script (struct objfile *objfile, const char *suffix)
 	 and these scripts are required to be idempotent under multiple
 	 loads anyway.  */
       source_python_script_for_objfile (objfile, input, debugfile);
-      fclose (input);
     }
 
   do_cleanups (cleanups);
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index f2ea686..2a8bf9d 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* gdb.gdb/selftest.exp (do_steps_and_nexts): New entry
+	for cmdarg_vec = NULL.  Remove entries for cmdsize = 1, cmdarg = and
+	ncmd = 0.  New entry for VEC_cleanup cmdarg_s.
+
 2012-03-19  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
 	* gdb.base/cond-eval-mode.exp: Fix the anticipated warning string.
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
index 1ffa945..7645caf 100644
--- a/gdb/testsuite/gdb.gdb/selftest.exp
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
@@ -88,6 +88,10 @@ proc do_steps_and_nexts {} {
 		set description "step over ttyarg initialization"
 		set command "step"
 	    }
+	    -re ".*cmdarg_vec = NULL.*$gdb_prompt $" {
+		set description "step over cmdarg_vec initialization"
+		set command "step"
+	    }
 	    -re ".*pre_stat_chain = make_command_stats_cleanup.*$gdb_prompt $" {
 		set description "next over make_command_stats_cleanup and everything it calls"
 		set command "next"
@@ -124,18 +128,6 @@ proc do_steps_and_nexts {} {
 		set description "next over conditional stack alignment alloca"
 		set command "next"
 	    }
-	    -re ".*cmdsize = 1.*$gdb_prompt $" {
-		set description "step over cmdsize initialization"
-		set command "next"
-	    }
-	    -re ".*cmdarg = .* xmalloc.*$gdb_prompt $" {
-		set description "next over cmdarg initialization via xmalloc"
-		set command "next"
-	    }
-	    -re ".*ncmd = 0.*$gdb_prompt $" {
-		set description "next over ncmd initialization"
-		set command "next"
-	    }
 	    -re ".*dirsize = 1.*$gdb_prompt $" {
 		set description "next over dirsize initialization"
 		set command "next"
@@ -159,6 +151,10 @@ proc do_steps_and_nexts {} {
 		set description "next over textdomain PACKAGE"
 		set command "next"
 	    }
+	    -re ".*VEC_cleanup .cmdarg_s.*$gdb_prompt $" {
+		set description "next over cmdarg_s VEC_cleanup"
+		set command "next"
+	    }
 	    -re "\[0-9\]+\[\t \]+\{\r\n$gdb_prompt $" {
 		set description "step over initial brace"
 		set command "step"
diff --git a/gdb/testsuite/gdb.linespec/ls-dollar.cc b/gdb/testsuite/gdb.linespec/ls-dollar.cc
new file mode 100644
index 0000000..72e792b
--- /dev/null
+++ b/gdb/testsuite/gdb.linespec/ls-dollar.cc
@@ -0,0 +1,26 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+static int $dollar_var = 0;
+
+int $dollar_func (void) { return $dollar_var; } /* dollar_func */
+
+int
+main (void)
+{
+  return $dollar_func ();
+}
diff --git a/gdb/testsuite/gdb.linespec/ls-dollar.exp b/gdb/testsuite/gdb.linespec/ls-dollar.exp
new file mode 100644
index 0000000..e82dc08
--- /dev/null
+++ b/gdb/testsuite/gdb.linespec/ls-dollar.exp
@@ -0,0 +1,38 @@
+# Copyright 2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [SCM]  archer-keiths-linespec-rewrite: Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite
@ 2012-03-19 17:21 kseitz
  0 siblings, 0 replies; 8+ messages in thread
From: kseitz @ 2012-03-19 17:21 UTC (permalink / raw)
  To: archer-commits

The branch, archer-keiths-linespec-rewrite has been updated
       via  0f2b6d4b7db4a52e143eae4a894be518a651e342 (commit)
       via  107d4a8ed2758747ffea0ca6ce5796f8dba96157 (commit)
       via  186404b922ac69f05e8fed4c35bea14b0d800789 (commit)
       via  4521af1eac0a64252b25589ef061c7aa413767b2 (commit)
       via  1ed0872161a4a49810b2686179979b46f12ad746 (commit)
       via  8f76c9938614819e2390efc6b386c8fb2f452b4e (commit)
       via  8ab59c15b5d137ddccd432f0946e59fa462e30ef (commit)
       via  8281376dc21b49eb1cda353cbcfc1b964d05b544 (commit)
       via  3d3ec0b91e50c07e5400b7b54f54abb782761bcb (commit)
       via  ad290c1f04dc60f599d351800fb156e571839156 (commit)
       via  198f38cfaf0c47455278772acb7499920b3f7f9b (commit)
       via  dc8b55393ea3f1d41542b867fad99be3ad5e5f9e (commit)
       via  3d359a151ef30fd6670933c90d2c25e57661a757 (commit)
       via  8b6432db4f820d48346e40404a55279fbb0fa203 (commit)
       via  be9570d85d16a8f236e7a491d5d37a5f0f5e01ff (commit)
       via  54a949f3445bf1f892948b0e230110c9ddc4bfd0 (commit)
       via  628d407b7cefcdadc5d1d83e70901e2103aecc9c (commit)
       via  c0a3cf19c5685ee971445c6684e081b6273cefb7 (commit)
       via  911c219a4dc5f54622ba9c11c88adebfd3868bc5 (commit)
       via  8dd8348932371b493c3123ff457e7eefcc4af30e (commit)
       via  bcea091dc97b88c6dd976cb7fc3c29444798247f (commit)
       via  ff1c36b8202762ff6a6596ce4bedfcc6526bc4bb (commit)
       via  c6fac428e24e1fbf29e8971953152bcb80946f2f (commit)
       via  0ea61917ed3bc31a0fa98d1280bf87890ba89b06 (commit)
       via  60c520c9959c107cdc25a2cbeeeecfa62dddddca (commit)
      from  0f71eb02bb04e340cad29d5f0ffde88bce7e5242 (commit)

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

- Log -----------------------------------------------------------------
commit 0f2b6d4b7db4a52e143eae4a894be518a651e342
Merge: bcea091 107d4a8
Author: Keith Seitz <keiths@redhat.com>
Date:   Mon Mar 19 10:15:41 2012 -0700

    Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite

commit bcea091dc97b88c6dd976cb7fc3c29444798247f
Merge: ff1c36b c6fac42
Author: Keith Seitz <keiths@redhat.com>
Date:   Sat Mar 17 12:09:21 2012 -0700

    Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite

commit ff1c36b8202762ff6a6596ce4bedfcc6526bc4bb
Author: Keith Seitz <keiths@redhat.com>
Date:   Sat Mar 17 12:04:44 2012 -0700

    Another trivial cleanup.

-----------------------------------------------------------------------

Summary of changes:
 bfd/ChangeLog                                 |    9 +
 bfd/config.bfd                                |    6 +
 bfd/configure                                 |    3 +-
 bfd/configure.in                              |   11 +-
 bfd/elf64-x86-64.c                            |  222 +-
 bfd/targets.c                                 |    6 +-
 bfd/version.h                                 |    2 +-
 gdb/gdbserver/ChangeLog                       |    8 +
 gdb/gdbserver/server.c                        |   24 +-
 gdb/linespec.c                                |    8 +-
 gdb/testsuite/ChangeLog                       |   12 +-
 gdb/testsuite/dg-extract-results.sh           |    8 +-
 gdb/testsuite/gdb.base/cond-eval-mode.exp     |    2 +-
 gdb/version.in                                |    2 +-
 sim/bfin/ChangeLog                            |   23 +
 sim/bfin/bfin-sim.c                           |   98 +-
 sim/bfin/dv-bfin_ebiu_amc.c                   |    9 +-
 sim/common/ChangeLog                          |   11 +
 sim/common/Make-common.in                     |    2 +-
 sim/common/acinclude.m4                       |    2 +-
 sim/common/gennltvals.sh                      |   32 +-
 sim/common/nrun.c                             |    3 +-
 sim/testsuite/.gitignore                      |    1 +
 sim/testsuite/ChangeLog                       |    4 +
 sim/testsuite/sim/bfin/ChangeLog              |   23 +
 sim/testsuite/sim/bfin/c_dsp32shiftim_amix.s  |    7 +
 sim/testsuite/sim/bfin/random_0014.S          |   82 +
 sim/testsuite/sim/bfin/random_0015.S          |   25 +
 sim/testsuite/sim/bfin/random_0016.S          |   26 +
 sim/testsuite/sim/bfin/se_all16bitopcodes.S   |  142 +-
 sim/testsuite/sim/bfin/se_all32bitopcodes.S   |  163 +-
 sim/testsuite/sim/bfin/se_all64bitg0opcodes.S |33371 +++++++++++++++++++++++++
 sim/testsuite/sim/bfin/se_all64bitg1opcodes.S |   83 +
 sim/testsuite/sim/bfin/se_all64bitg2opcodes.S |   58 +
 sim/testsuite/sim/bfin/se_allopcodes.h        |  211 +
 35 files changed, 34326 insertions(+), 373 deletions(-)
 create mode 100644 sim/testsuite/.gitignore
 create mode 100644 sim/testsuite/sim/bfin/random_0014.S
 create mode 100644 sim/testsuite/sim/bfin/random_0015.S
 create mode 100644 sim/testsuite/sim/bfin/random_0016.S
 create mode 100644 sim/testsuite/sim/bfin/se_all64bitg0opcodes.S
 create mode 100644 sim/testsuite/sim/bfin/se_all64bitg1opcodes.S
 create mode 100644 sim/testsuite/sim/bfin/se_all64bitg2opcodes.S
 create mode 100644 sim/testsuite/sim/bfin/se_allopcodes.h

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 15819e6..b9849f8 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,12 @@
+2012-03-16  Roland McGrath  <mcgrathr@google.com>
+
+	* config.bfd: Handle x86_64-*-nacl*.
+	* elf64-x86-64.c (bfd_elf64_x86_64_nacl_vec): New backend vector stanza.
+	(bfd_elf32_x86_64_nacl_vec): Likewise.
+	* targets.c: Support them.
+	* configure.in: Likewise.
+	* configure: Regenerated.
+
 2012-03-16  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
 
 	* elf32-arm.c (elf32_arm_attributes_accept_div): New function.
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 2cf89ed..e84ba58 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -574,6 +574,7 @@ case "${targ}" in
   i[3-7]86-*-nacl*)
     targ_defvec=bfd_elf32_i386_nacl_vec
     targ_selvecs="bfd_elf32_i386_vec"
+    targ64_selvecs="bfd_elf64_x86_64_nacl_vec bfd_elf32_x86_64_nacl_vec"
     ;;
 #ifdef BFD64
   x86_64-*-darwin*)
@@ -612,6 +613,11 @@ case "${targ}" in
     targ_selvecs="bfd_elf32_i386_vec bfd_elf32_x86_64_vec i386linux_vec i386pei_vec x86_64pei_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
     want64=true
     ;;
+  x86_64-*-nacl*)
+    targ_defvec=bfd_elf32_x86_64_nacl_vec
+    targ_selvecs="bfd_elf32_i386_nacl_vec bfd_elf64_x86_64_nacl_vec"
+    want64=true
+    ;;
   x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep)
     targ_defvec=x86_64pe_vec
     targ_selvecs="x86_64pe_vec x86_64pei_vec bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec i386pe_vec i386pei_vec bfd_elf32_i386_vec"
diff --git a/bfd/configure b/bfd/configure
index dc2a63c..cff9b26 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -15349,9 +15349,11 @@ do
     bfd_elf64_tradlittlemips_vec | bfd_elf64_tradlittlemips_freebsd_vec)
 				tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     bfd_elf64_x86_64_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
+    bfd_elf64_x86_64_nacl_vec)	tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_x86_64_sol2_vec)  tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_x86_64_vec)	tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf32_x86_64_vec)	tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
+    bfd_elf32_x86_64_nacl_vec)	tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
     bfd_elf64_l1om_vec)		tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_l1om_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_k1om_vec)		tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
@@ -18750,4 +18752,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
-
diff --git a/bfd/configure.in b/bfd/configure.in
index d6f3fe3..c40c825 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -109,7 +109,7 @@ if test $want_elf_stt_common = true; then
   AC_DEFINE(USE_STT_COMMON, 1,
     [Define if we may generate symbols with ELF's STT_COMMON type])
 fi
-	 
+
 ACX_PKGVERSION([GNU Binutils])
 ACX_BUGURL([http://www.sourceware.org/bugzilla/])
 
@@ -684,9 +684,9 @@ do
     bfd_elf32_big_generic_vec) 	tb="$tb elf32-gen.lo elf32.lo $elf" ;;
     bfd_elf32_bigarc_vec)	tb="$tb elf32-arc.lo elf32.lo $elf" ;;
     bfd_elf32_bigarm_vec)	tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
-    bfd_elf32_bigarm_symbian_vec)	
+    bfd_elf32_bigarm_symbian_vec)
                                 tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
-    bfd_elf32_bigarm_vxworks_vec)	
+    bfd_elf32_bigarm_vxworks_vec)
                                 tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
     bfd_elf32_bigmips_vec) 	tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_bigmips_vxworks_vec)
@@ -694,7 +694,7 @@ do
     bfd_elf32_cr16_vec)		tb="$tb elf32-cr16.lo elf32.lo $elf" ;;
     bfd_elf32_cr16c_vec)	tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
     bfd_elf32_cris_vec)		tb="$tb elf32-cris.lo elf32.lo $elf" ;;
-    bfd_elf32_crx_vec)          tb="$tb elf32-crx.lo elf32.lo $elf" ;;    
+    bfd_elf32_crx_vec)          tb="$tb elf32-crx.lo elf32.lo $elf" ;;
     bfd_elf32_d10v_vec)		tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
     bfd_elf32_d30v_vec)		tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
     bfd_elf32_dlx_big_vec)	tb="$tb elf32-dlx.lo elf32.lo $elf" ;;
@@ -848,9 +848,11 @@ do
     bfd_elf64_tradlittlemips_vec | bfd_elf64_tradlittlemips_freebsd_vec)
 				tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
     bfd_elf64_x86_64_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
+    bfd_elf64_x86_64_nacl_vec)	tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_x86_64_sol2_vec)  tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_x86_64_vec)	tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf32_x86_64_vec)	tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
+    bfd_elf32_x86_64_nacl_vec)	tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
     bfd_elf64_l1om_vec)		tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_l1om_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_k1om_vec)		tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
@@ -1150,4 +1152,3 @@ AC_SUBST(htmldir)
 AC_SUBST(pdfdir)
 
 AC_OUTPUT
-
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 51204a5..f2f803a 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -982,7 +982,7 @@ elf_x86_64_create_dynamic_sections (bfd *dynobj,
       && htab->elf.splt != NULL)
     {
       const struct elf_x86_64_backend_data *const abed
-        = get_elf_x86_64_backend_data (dynobj);
+	= get_elf_x86_64_backend_data (dynobj);
       flagword flags = get_elf_backend_data (dynobj)->dynamic_sec_flags;
       htab->plt_eh_frame
 	= bfd_make_section_with_flags (dynobj, ".eh_frame",
@@ -993,9 +993,9 @@ elf_x86_64_create_dynamic_sections (bfd *dynobj,
 
       htab->plt_eh_frame->size = abed->eh_frame_plt_size;
       htab->plt_eh_frame->contents
-        = bfd_alloc (dynobj, htab->plt_eh_frame->size);
+	= bfd_alloc (dynobj, htab->plt_eh_frame->size);
       memcpy (htab->plt_eh_frame->contents,
-              abed->eh_frame_plt, abed->eh_frame_plt_size);
+	      abed->eh_frame_plt, abed->eh_frame_plt_size);
     }
   return TRUE;
 }
@@ -1075,6 +1075,14 @@ elf64_x86_64_elf_object_p (bfd *abfd)
   return TRUE;
 }
 
+static bfd_boolean
+elf32_x86_64_elf_object_p (bfd *abfd)
+{
+  /* Set the right machine number for an x86-64 elf32 file.  */
+  bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_x64_32);
+  return TRUE;
+}
+
 /* Return TRUE if the TLS access code sequence support transition
    from R_TYPE.  */
 
@@ -5087,6 +5095,179 @@ static const struct bfd_elf_special_section
 
 #include "elf64-target.h"
 
+/* Native Client support.  */
+
+#undef	TARGET_LITTLE_SYM
+#define	TARGET_LITTLE_SYM		bfd_elf64_x86_64_nacl_vec
+#undef	TARGET_LITTLE_NAME
+#define	TARGET_LITTLE_NAME		"elf64-x86-64-nacl"
+#undef	elf64_bed
+#define	elf64_bed			elf64_x86_64_nacl_bed
+
+#undef	ELF_MAXPAGESIZE
+#undef	ELF_MINPAGESIZE
+#undef	ELF_COMMONPAGESIZE
+#define ELF_MAXPAGESIZE			0x10000
+#define ELF_MINPAGESIZE			0x10000
+#define ELF_COMMONPAGESIZE		0x10000
+
+/* Restore defaults.  */
+#undef	ELF_OSABI
+#undef	elf_backend_static_tls_alignment
+#undef	elf_backend_want_plt_sym
+#define elf_backend_want_plt_sym	0
+
+/* NaCl uses substantially different PLT entries for the same effects.  */
+
+#undef	elf_backend_plt_alignment
+#define elf_backend_plt_alignment	5
+#define NACL_PLT_ENTRY_SIZE		64
+#define	NACLMASK			0xe0 /* 32-byte alignment mask.  */
+
+static const bfd_byte elf_x86_64_nacl_plt0_entry[NACL_PLT_ENTRY_SIZE] =
+  {
+    0xff, 0x35, 8, 0, 0, 0,             /* pushq GOT+8(%rip) 		*/
+    0x4c, 0x8b, 0x1d, 16, 0, 0, 0,	/* mov GOT+16(%rip), %r11	*/
+    0x41, 0x83, 0xe3, NACLMASK,         /* and $-32, %r11d		*/
+    0x4d, 0x01, 0xfb,             	/* add %r15, %r11		*/
+    0x41, 0xff, 0xe3,             	/* jmpq *%r11			*/
+
+    /* 41 bytes of nop to pad out to the standard size.  */
+    0x66, 0x66, 0x66, 0x66, 0x66, 0x66,    /* excess data32 prefixes	*/
+    0x2e, 0x0f, 0x1f, 0x84, 0, 0, 0, 0, 0, /* nopw %cs:0x0(%rax,%rax,1)	*/
+    0x66, 0x66, 0x66, 0x66, 0x66, 0x66,    /* excess data32 prefixes	*/
+    0x2e, 0x0f, 0x1f, 0x84, 0, 0, 0, 0, 0, /* nopw %cs:0x0(%rax,%rax,1)	*/
+    0x66, 0x66,                            /* excess data32 prefixes	*/
+    0x2e, 0x0f, 0x1f, 0x84, 0, 0, 0, 0, 0, /* nopw %cs:0x0(%rax,%rax,1)	*/
+  };
+
+static const bfd_byte elf_x86_64_nacl_plt_entry[NACL_PLT_ENTRY_SIZE] =
+  {
+    0x4c, 0x8b, 0x1d, 0, 0, 0, 0,	/* mov name@GOTPCREL(%rip),%r11	*/
+    0x41, 0x83, 0xe3, NACLMASK,         /* and $-32, %r11d		*/
+    0x4d, 0x01, 0xfb,             	/* add %r15, %r11		*/
+    0x41, 0xff, 0xe3,             	/* jmpq *%r11			*/
+
+    /* 15-byte nop sequence to pad out to the next 32-byte boundary.  */
+    0x66, 0x66, 0x66, 0x66, 0x66, 0x66,    /* excess data32 prefixes	*/
+    0x2e, 0x0f, 0x1f, 0x84, 0, 0, 0, 0, 0, /* nopw %cs:0x0(%rax,%rax,1)	*/
+
+    /* Lazy GOT entries point here (32-byte aligned).  */
+    0x68,                 /* pushq immediate */
+    0, 0, 0, 0,           /* replaced with index into relocation table.  */
+    0xe9,                 /* jmp relative */
+    0, 0, 0, 0,           /* replaced with offset to start of .plt0.  */
+
+    /* 22 bytes of nop to pad out to the standard size.  */
+    0x66, 0x66, 0x66, 0x66, 0x66, 0x66,    /* excess data32 prefixes	*/
+    0x2e, 0x0f, 0x1f, 0x84, 0, 0, 0, 0, 0, /* nopw %cs:0x0(%rax,%rax,1)	*/
+    0x0f, 0x1f, 0x80, 0, 0, 0, 0,          /* nopl 0x0(%rax)		*/
+  };
+
+/* .eh_frame covering the .plt section.  */
+
+static const bfd_byte elf_x86_64_nacl_eh_frame_plt[] =
+  {
+#if (PLT_CIE_LENGTH != 20                               \
+     || PLT_FDE_LENGTH != 36                            \
+     || PLT_FDE_START_OFFSET != 4 + PLT_CIE_LENGTH + 8  \
+     || PLT_FDE_LEN_OFFSET != 4 + PLT_CIE_LENGTH + 12)
+# error "Need elf_x86_64_backend_data parameters for eh_frame_plt offsets!"
+#endif
+    PLT_CIE_LENGTH, 0, 0, 0,	/* CIE length */
+    0, 0, 0, 0,			/* CIE ID */
+    1,				/* CIE version */
+    'z', 'R', 0,                /* Augmentation string */
+    1,				/* Code alignment factor */
+    0x78,                       /* Data alignment factor */
+    16,				/* Return address column */
+    1,				/* Augmentation size */
+    DW_EH_PE_pcrel | DW_EH_PE_sdata4, /* FDE encoding */
+    DW_CFA_def_cfa, 7, 8,	/* DW_CFA_def_cfa: r7 (rsp) ofs 8 */
+    DW_CFA_offset + 16, 1,	/* DW_CFA_offset: r16 (rip) at cfa-8 */
+    DW_CFA_nop, DW_CFA_nop,
+
+    PLT_FDE_LENGTH, 0, 0, 0,	/* FDE length */
+    PLT_CIE_LENGTH + 8, 0, 0, 0,/* CIE pointer */
+    0, 0, 0, 0,			/* R_X86_64_PC32 .plt goes here */
+    0, 0, 0, 0,			/* .plt size goes here */
+    0,				/* Augmentation size */
+    DW_CFA_def_cfa_offset, 16,	/* DW_CFA_def_cfa_offset: 16 */
+    DW_CFA_advance_loc + 6,	/* DW_CFA_advance_loc: 6 to __PLT__+6 */
+    DW_CFA_def_cfa_offset, 24,	/* DW_CFA_def_cfa_offset: 24 */
+    DW_CFA_advance_loc + 58,	/* DW_CFA_advance_loc: 58 to __PLT__+64 */
+    DW_CFA_def_cfa_expression,	/* DW_CFA_def_cfa_expression */
+    13,				/* Block length */
+    DW_OP_breg7, 8,		/* DW_OP_breg7 (rsp): 8 */
+    DW_OP_breg16, 0,		/* DW_OP_breg16 (rip): 0 */
+    DW_OP_const1u, 63, DW_OP_and, DW_OP_const1u, 37, DW_OP_ge,
+    DW_OP_lit3, DW_OP_shl, DW_OP_plus,
+    DW_CFA_nop, DW_CFA_nop
+  };
+
+static const struct elf_x86_64_backend_data elf_x86_64_nacl_arch_bed =
+  {
+    elf_x86_64_nacl_plt0_entry,              /* plt0_entry */
+    elf_x86_64_nacl_plt_entry,               /* plt_entry */
+    NACL_PLT_ENTRY_SIZE,                     /* plt_entry_size */
+    2,                                       /* plt0_got1_offset */
+    9,                                       /* plt0_got2_offset */
+    13,                                      /* plt0_got2_insn_end */
+    3,                                       /* plt_got_offset */
+    33,                                      /* plt_reloc_offset */
+    38,                                      /* plt_plt_offset */
+    7,                                       /* plt_got_insn_size */
+    42,                                      /* plt_plt_insn_end */
+    32,                                      /* plt_lazy_offset */
+    elf_x86_64_nacl_eh_frame_plt,            /* eh_frame_plt */
+    sizeof (elf_x86_64_nacl_eh_frame_plt),   /* eh_frame_plt_size */
+  };
+
+#undef	elf_backend_arch_data
+#define	elf_backend_arch_data	&elf_x86_64_nacl_arch_bed
+
+#include "elf64-target.h"
+
+/* Native Client x32 support.  */
+
+#undef  TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM		bfd_elf32_x86_64_nacl_vec
+#undef  TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME		"elf32-x86-64-nacl"
+#undef	elf32_bed
+#define	elf32_bed			elf32_x86_64_nacl_bed
+
+#define bfd_elf32_bfd_link_hash_table_create \
+  elf_x86_64_link_hash_table_create
+#define bfd_elf32_bfd_link_hash_table_free \
+  elf_x86_64_link_hash_table_free
+#define bfd_elf32_bfd_reloc_type_lookup	\
+  elf_x86_64_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup \
+  elf_x86_64_reloc_name_lookup
+#define bfd_elf32_mkobject \
+  elf_x86_64_mkobject
+
+#undef elf_backend_object_p
+#define elf_backend_object_p \
+  elf32_x86_64_elf_object_p
+
+#undef elf_backend_bfd_from_remote_memory
+#define elf_backend_bfd_from_remote_memory \
+  _bfd_elf32_bfd_from_remote_memory
+
+#undef elf_backend_size_info
+#define elf_backend_size_info \
+  _bfd_elf32_size_info
+
+#include "elf32-target.h"
+
+/* Restore defaults.  */
+#undef elf_backend_object_p
+#define elf_backend_object_p		    elf64_x86_64_elf_object_p
+#undef elf_backend_bfd_from_remote_memory
+#undef elf_backend_size_info
+
 /* Intel L1OM support.  */
 
 static bfd_boolean
@@ -5115,10 +5296,17 @@ elf64_l1om_elf_object_p (bfd *abfd)
 #undef elf_backend_object_p
 #define elf_backend_object_p		    elf64_l1om_elf_object_p
 
-#undef  elf_backend_static_tls_alignment
-
-#undef elf_backend_want_plt_sym
-#define elf_backend_want_plt_sym	    0
+/* Restore defaults.  */
+#undef	ELF_MAXPAGESIZE
+#undef	ELF_MINPAGESIZE
+#undef	ELF_COMMONPAGESIZE
+#define ELF_MAXPAGESIZE			0x200000
+#define ELF_MINPAGESIZE			0x1000
+#define ELF_COMMONPAGESIZE		0x1000
+#undef	elf_backend_plt_alignment
+#define elf_backend_plt_alignment	4
+#undef	elf_backend_arch_data
+#define	elf_backend_arch_data	&elf_x86_64_arch_bed
 
 #include "elf64-target.h"
 
@@ -5189,18 +5377,11 @@ elf64_k1om_elf_object_p (bfd *abfd)
 
 /* 32bit x86-64 support.  */
 
-static bfd_boolean
-elf32_x86_64_elf_object_p (bfd *abfd)
-{
-  /* Set the right machine number for an x86-64 elf32 file.  */
-  bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_x64_32);
-  return TRUE;
-}
-
 #undef  TARGET_LITTLE_SYM
 #define TARGET_LITTLE_SYM		    bfd_elf32_x86_64_vec
 #undef  TARGET_LITTLE_NAME
 #define TARGET_LITTLE_NAME		    "elf32-x86-64"
+#undef	elf32_bed
 
 #undef ELF_ARCH
 #define ELF_ARCH			    bfd_arch_i386
@@ -5208,17 +5389,6 @@ elf32_x86_64_elf_object_p (bfd *abfd)
 #undef	ELF_MACHINE_CODE
 #define ELF_MACHINE_CODE		    EM_X86_64
 
-#define bfd_elf32_bfd_link_hash_table_create \
-  elf_x86_64_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free \
-  elf_x86_64_link_hash_table_free
-#define bfd_elf32_bfd_reloc_type_lookup	\
-  elf_x86_64_reloc_type_lookup
-#define bfd_elf32_bfd_reloc_name_lookup \
-  elf_x86_64_reloc_name_lookup
-#define bfd_elf32_mkobject \
-  elf_x86_64_mkobject
-
 #undef	ELF_OSABI
 
 #undef elf_backend_object_p
diff --git a/bfd/targets.c b/bfd/targets.c
index e5d08af..112ac12 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -1,6 +1,6 @@
 /* Generic target-file-type support for the BFD library.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -751,8 +751,10 @@ extern const bfd_target bfd_elf64_tradlittlemips_vec;
 extern const bfd_target bfd_elf64_tradbigmips_freebsd_vec;
 extern const bfd_target bfd_elf64_tradlittlemips_freebsd_vec;
 extern const bfd_target bfd_elf64_x86_64_freebsd_vec;
+extern const bfd_target bfd_elf64_x86_64_nacl_vec;
 extern const bfd_target bfd_elf64_x86_64_sol2_vec;
 extern const bfd_target bfd_elf64_x86_64_vec;
+extern const bfd_target bfd_elf32_x86_64_nacl_vec;
 extern const bfd_target bfd_elf32_x86_64_vec;
 extern const bfd_target bfd_elf64_l1om_freebsd_vec;
 extern const bfd_target bfd_elf64_l1om_vec;
@@ -1123,8 +1125,10 @@ static const bfd_target * const _bfd_target_vector[] =
 	&bfd_elf64_tradbigmips_freebsd_vec,
 	&bfd_elf64_tradlittlemips_freebsd_vec,
 	&bfd_elf64_x86_64_freebsd_vec,
+	&bfd_elf64_x86_64_nacl_vec,
 	&bfd_elf64_x86_64_sol2_vec,
 	&bfd_elf64_x86_64_vec,
+	&bfd_elf32_x86_64_nacl_vec,
 	&bfd_elf32_x86_64_vec,
 	&bfd_elf64_l1om_freebsd_vec,
 	&bfd_elf64_l1om_vec,
diff --git a/bfd/version.h b/bfd/version.h
index f1ed722..241c6fe 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20120316
+#define BFD_VERSION_DATE 20120319
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 61607a6..91b12e0 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,11 @@
+2012-03-19  Pedro Alves  <palves@redhat.com>
+	    Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* server.c (cont_thread, general_thread): Add describing comments.
+	(start_inferior): Clear `cont_thread'.
+	(handle_v_cont): Don't set `cont_thread' if resuming all threads
+	of a process.
+
 2012-03-15  Yao Qi  <yao@codesourcery.com>
 
 	* tracepoint.c (install_tracepoint): Move duplicated tracepoint
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 3c97dbd..a4e9e57 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -30,7 +30,19 @@
 #include <sys/wait.h>
 #endif
 
+/* The thread set with an `Hc' packet.  `Hc' is deprecated in favor of
+   `vCont'.  Note the multi-process extensions made `vCont' a
+   requirement, so `Hc pPID.TID' is pretty much undefined.  So
+   CONT_THREAD can be null_ptid for no `Hc' thread, minus_one_ptid for
+   resuming all threads of the process (again, `Hc' isn't used for
+   multi-process), or a specific thread ptid_t.
+
+   We also set this when handling a single-thread `vCont' resume, as
+   some places in the backends check it to know when (and for which
+   thread) single-thread scheduler-locking is in effect.  */
 ptid_t cont_thread;
+
+/* The thread set with an `Hg' packet.  */
 ptid_t general_thread;
 
 int server_waiting;
@@ -262,6 +274,10 @@ start_inferior (char **argv)
   signal (SIGTTIN, SIG_DFL);
 #endif
 
+  /* Clear this so the backend doesn't get confused, thinking
+     CONT_THREAD died, and it needs to resume all threads.  */
+  cont_thread = null_ptid;
+
   signal_pid = create_inferior (new_argv[0], new_argv);
 
   /* FIXME: we don't actually know at this point that the create
@@ -1962,9 +1978,13 @@ handle_v_cont (char *own_buf)
   if (i < n)
     resume_info[i] = default_action;
 
-  /* Still used in occasional places in the backend.  */
+  /* `cont_thread' is still used in occasional places in the backend,
+     to implement single-thread scheduler-locking.  Doesn't make sense
+     to set it if we see a stop request, or any form of wildcard
+     vCont.  */
   if (n == 1
-      && !ptid_equal (resume_info[0].thread, minus_one_ptid)
+      && !(ptid_equal (resume_info[0].thread, minus_one_ptid)


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [SCM]  archer-keiths-linespec-rewrite: Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite
@ 2012-03-15 19:14 kseitz
  0 siblings, 0 replies; 8+ messages in thread
From: kseitz @ 2012-03-15 19:14 UTC (permalink / raw)
  To: archer-commits

The branch, archer-keiths-linespec-rewrite has been updated
       via  53031c1df4ddea9b5f0d44341e062362fcf878e3 (commit)
       via  778c912278239e4ba44acf2b866023cfb6f8ae13 (commit)
       via  2037eec927a91e9f939f176ee67556ca48a7f23e (commit)
       via  8aaf828f00db4415170187f1d9e786bbb916d489 (commit)
       via  69acdef42f5cff62cf1d069348fcf4ed14305c96 (commit)
       via  cdfae53fa67f5576d6a15500bba8ea3fb7e5aa71 (commit)
       via  de2f714807e42df981348b72164f60ea71b37543 (commit)
       via  8f255da61a5667b640ee0c5d68d3a5fb380db813 (commit)
       via  d1620965b61cd9a39a766fbb07b8b2681c14f47a (commit)
       via  7493f930ad532c91f186f7b2fbaacba308f90945 (commit)
       via  5ba09d5182a185d0b7a1cf686d7808131536d281 (commit)
       via  89cc5bbe4b835a5b4efa384ef2da9c3ba1b3cac5 (commit)
       via  fe7de29ee44ce25f11b2cd0f5aafa86170d0d867 (commit)
       via  dbc01db95dfa6f9d32e156d13abc437a80b858b9 (commit)
       via  fcbe86bcd4734566694e12e6c0c519364e2ed538 (commit)
       via  ee520d1b19ccd7bd17bf7cb0cb0264b1f5446f2c (commit)
       via  05dbea72ad0b63e512fcdb94136acf42c6a86f77 (commit)
       via  becc34639008f2a60146735f8fb26ac080edd208 (commit)
      from  5ee352b2795621dea72001d3b4a5d586b4d8e633 (commit)

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

- Log -----------------------------------------------------------------
commit 53031c1df4ddea9b5f0d44341e062362fcf878e3
Merge: 778c912 8aaf828
Author: Keith Seitz <keiths@redhat.com>
Date:   Thu Mar 15 11:34:42 2012 -0700

    Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite
    
    Conflicts:
    	gdb/cp-support.c

commit 778c912278239e4ba44acf2b866023cfb6f8ae13
Author: Keith Seitz <keiths@redhat.com>
Date:   Thu Mar 15 11:29:00 2012 -0700

    More linespec.c cleanups. Deal with functions starting with '$'
    (remove WHATS_THIS_FOR) and add tests. Test "::foo" and "::n::foo".

commit 2037eec927a91e9f939f176ee67556ca48a7f23e
Author: Keith Seitz <keiths@redhat.com>
Date:   Thu Mar 15 11:27:40 2012 -0700

    Add tests for setting breakpoints on labels in methods.

commit 8aaf828f00db4415170187f1d9e786bbb916d489
Author: Roland McGrath <roland@gnu.org>
Date:   Thu Mar 15 16:37:21 2012 +0000

    	* elf64-x86-64.c (struct elf_x86_64_backend_data): New type.
    	(get_elf_x86_64_backend_data, GET_PLT_ENTRY_SIZE): New macros.
    	(elf_x86_64_arch_bed): New variable.
    	(elf_backend_arch_data): New macro.
    	(elf_x86_64_adjust_dynamic_symbol): Use GET_PLT_ENTRY_SIZE.
    	(elf_x86_64_allocate_dynrelocs): Likewise.
    	(elf_x86_64_relocate_section): Likewise.
    	(elf_x86_64_plt_sym_val): Likewise.
    	(elf_x86_64_finish_dynamic_symbol): Use elf_x86_64_backend_data
    	parameters for PLT details.
    	(elf_x86_64_finish_dynamic_sections): Likewise.

commit 69acdef42f5cff62cf1d069348fcf4ed14305c96
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Mar 15 16:32:12 2012 +0000

    	* NEWS: Mention "info vtbl", not "info vtable".
    	* cp-support.c (info_vtbl_command): Fix comment.
    	(_initialize_cp_support): Fix text.

commit cdfae53fa67f5576d6a15500bba8ea3fb7e5aa71
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Mar 15 15:49:40 2012 +0000

    	* cp-valprint.c (cp_print_value_fields): Use
    	print_function_pointer_address for vtable slot.
    gdb/testsuite
    	* gdb.cp/virtfunc2.exp: Update expected output.
    	* gdb.cp/pr9631.exp: Update expected output.
    	* gdb.cp/member-ptr.exp: Update expected output.
    	* gdb.cp/inherit.exp (test_print_mvi_classes): Update expected
    	output.
    	* gdb.cp/casts.exp: Update expected output.

commit de2f714807e42df981348b72164f60ea71b37543
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Mar 15 15:43:05 2012 +0000

    	* gnu-v3-abi.c (struct value_and_voffset): New.
    	(hash_value_and_voffset, eq_value_and_voffset)
    	(compare_value_and_voffset, compute_vtable_size)
    	(print_one_vtable, gnuv3_print_vtable): New functions.
    	(init_gnuv3_ops): Initialize 'print_vtable' field.
    	* cp-support.c (info_vtbl_command): New function.
    	(_initialize_cp_support): Add "info vtbl".
    	* cp-abi.h (cplus_print_vtable): Declare.
    	(struct cp_abi_ops) <print_vtable>: New field.
    	* cp-abi.c (cplus_print_vtable): New function.
    	* NEWS: Update.
    gdb/testsuite
    	* gdb.cp/virtfunc.exp (make_one_vtable_result): New proc.
    	(test_info_vtbl): Likewise.
    	(do_tests): Call test_info_vtbl.
    	* gdb.cp/virtfunc.cc (va): New global.
    gdb/doc
    	* gdb.texinfo (Debugging C Plus Plus): Document "info vtbl".

commit 8f255da61a5667b640ee0c5d68d3a5fb380db813
Author: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
Date:   Thu Mar 15 14:13:31 2012 +0000

    	* configure.ac (enable_libgomp): Remove *-*-irix6*.
    	(unsupported_languages): Remove mips-sgi-irix6.*.
    	(noconfigdirs): Don't add ${libgcj} for mips*-*-irix6*.
    	(with_stabs): Remove.
    	* configure: Regenerate.

commit d1620965b61cd9a39a766fbb07b8b2681c14f47a
Author: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
Date:   Thu Mar 15 14:11:37 2012 +0000

    	* configure.ac (enable_libgomp): Remove *-*-osf*.
    	(with_stabs): Remove alpha*-*-osf*.
    	* configure: Regenerate.

commit 7493f930ad532c91f186f7b2fbaacba308f90945
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Mar 15 14:06:17 2012 +0000

    	* d-lang.c (d_language_defn) <la_iterate_over_symbols>: Set to
    	iterate_over_symbols.

commit 5ba09d5182a185d0b7a1cf686d7808131536d281
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Thu Mar 15 12:58:47 2012 +0000

    include/
    	* dis-asm.h (disassemble_init_powerpc): Declare.
    opcodes/
    	* disassemble.c (disassemble_init_for_target): Handle ppc init.
    	* ppc-dis.c (private): New var.
    	(powerpc_init_dialect): Don't return calloc failure, instead use
    	private.
    	(PPC_OPCD_SEGS, PPC_OP_TO_SEG): Define.
    	(powerpc_opcd_indices): New array.
    	(disassemble_init_powerpc): New function.
    	(print_insn_big_powerpc): Don't init dialect here.
    	(print_insn_little_powerpc): Likewise.
    	(print_insn_powerpc): Start search using powerpc_opcd_indices.

commit 89cc5bbe4b835a5b4efa384ef2da9c3ba1b3cac5
Author: qiyao <qiyao>
Date:   Thu Mar 15 12:57:12 2012 +0000

    gdb/gdbserver/
    
    	* tracepoint.c (install_tracepoint): Move duplicated tracepoint
    	handling to ...
    	(cmd_qtdp): ... here.

commit fe7de29ee44ce25f11b2cd0f5aafa86170d0d867
Author: qiyao <qiyao>
Date:   Thu Mar 15 10:42:38 2012 +0000

    gdb/gdbserver/
    
    	* tracepoint.c (struct tracepoint_action_ops): New.
    	(struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field.
    	(m_tracepoint_action_download): New.
    	(r_tracepoint_action_download): New.
    	(x_tracepoint_action_download): New.
    	(l_tracepoint_action_download): New.
    	(add_tracepoint_action): Install `action->ops' according type.
    	(download_tracepoint_1): Move code `download' function pointer
    	of various tracepoint_action_ops.

commit dbc01db95dfa6f9d32e156d13abc437a80b858b9
Author: tschwinge <tschwinge>
Date:   Thu Mar 15 09:08:09 2012 +0000

    gdb/testsuite/
    	* gdb.dwarf2/dw2-ada-ffffffff.S: Use .4byte instead of .long for
    	describing DWARF data structures.
    	* gdb.dwarf2/dw2-bad-parameter-type.S: Likewise.
    	* gdb.dwarf2/dw2-double-set-die-type.S: Likewise.
    	* gdb.dwarf2/dw2-empty-pc-range.S: Likewise.
    	* gdb.dwarf2/dw2-entry-value.S: Likewise.
    	* gdb.dwarf2/dw2-modula2-self-type.S: Likewise.
    	* gdb.dwarf2/dw2-param-error.S: Likewise.
    	* gdb.dwarf2/dw2-skip-prologue.S: Likewise.
    	* gdb.dwarf2/dw2-stack-boundary.S: Likewise.
    	* gdb.dwarf2/dw4-sig-type-unused.S: Likewise.
    	* gdb.dwarf2/implptr-optimized-out.S: Likewise.
    	* gdb.dwarf2/member-ptr-forwardref.S: Likewise.
    	* gdb.dwarf2/pr11465.S: Likewise.

commit fcbe86bcd4734566694e12e6c0c519364e2ed538
Author: Doug Evans <dje@google.com>
Date:   Thu Mar 15 02:34:47 2012 +0000

    	* dwarf2read.c (dwarf_stack_op_name): Add DW_OP_GNU_encoded_addr,
    	DW_OP_GNU_parameter_ref.

commit ee520d1b19ccd7bd17bf7cb0cb0264b1f5446f2c
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Thu Mar 15 00:00:32 2012 +0000

    *** empty log message ***

commit 05dbea72ad0b63e512fcdb94136acf42c6a86f77
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Wed Mar 14 23:00:05 2012 +0000

    daily update

commit becc34639008f2a60146735f8fb26ac080edd208
Author: Roland McGrath <roland@gnu.org>
Date:   Wed Mar 14 19:32:10 2012 +0000

    	* elf32-i386.c (elf_i386_nacl_pic_plt0_entry): Initialize up
    	to the full size, padding out with nop instructions.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |   14 ++
 bfd/ChangeLog                                      |   19 ++
 bfd/elf32-i386.c                                   |    7 +-
 bfd/elf64-x86-64.c                                 |  201 +++++++++++------
 bfd/version.h                                      |    2 +-
 configure                                          |   23 +--
 configure.ac                                       |   23 +--
 gdb/ChangeLog                                      |   35 +++
 gdb/NEWS                                           |    3 +
 gdb/cp-abi.c                                       |   10 +
 gdb/cp-abi.h                                       |    6 +
 gdb/cp-support.c                                   |   19 ++
 gdb/cp-valprint.c                                  |   11 +
 gdb/d-lang.c                                       |    2 +-
 gdb/doc/ChangeLog                                  |    4 +
 gdb/doc/gdb.texinfo                                |    6 +
 gdb/dwarf2read.c                                   |    4 +
 gdb/gdbserver/ChangeLog                            |   18 ++
 gdb/gdbserver/tracepoint.c                         |  211 +++++++++++------
 gdb/gnu-v3-abi.c                                   |  241 ++++++++++++++++++++
 gdb/linespec.c                                     |  127 ++++++-----
 gdb/testsuite/ChangeLog                            |   33 +++
 gdb/testsuite/gdb.cp/casts.exp                     |    2 +-
 gdb/testsuite/gdb.cp/cplabel.cc                    |   80 +++++++
 gdb/testsuite/gdb.cp/cplabel.exp                   |   38 +++
 gdb/testsuite/gdb.cp/inherit.exp                   |    4 +-
 gdb/testsuite/gdb.cp/member-ptr.exp                |    4 +-
 gdb/testsuite/gdb.cp/namespace.exp                 |   10 +
 gdb/testsuite/gdb.cp/pr9631.exp                    |    2 +-
 gdb/testsuite/gdb.cp/virtbase.exp                  |    2 +-
 gdb/testsuite/gdb.cp/virtfunc.cc                   |    1 +
 gdb/testsuite/gdb.cp/virtfunc.exp                  |   49 ++++
 gdb/testsuite/gdb.cp/virtfunc2.exp                 |    1 +
 gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S        |    4 +-
 gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S  |   10 +-
 gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S |   98 ++++----
 gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S      |    4 +-
 gdb/testsuite/gdb.dwarf2/dw2-entry-value.S         |   16 +-
 gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S   |   18 +-
 gdb/testsuite/gdb.dwarf2/dw2-param-error.S         |   12 +-
 gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S       |   10 +-
 gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S      |    4 +-
 gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S     |   10 +-
 gdb/testsuite/gdb.dwarf2/implptr-optimized-out.S   |    6 +-
 gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.S   |   76 +++---
 gdb/testsuite/gdb.dwarf2/pr11465.S                 |   70 +++---
 gdb/testsuite/gdb.linespec/ls-errs.exp             |    9 +-
 gdb/version.in                                     |    2 +-
 include/ChangeLog                                  |    4 +
 include/dis-asm.h                                  |    3 +-
 opcodes/ChangeLog                                  |   14 ++
 opcodes/disassemble.c                              |   13 +-
 opcodes/ppc-dis.c                                  |   51 +++-
 53 files changed, 1207 insertions(+), 439 deletions(-)
 create mode 100644 gdb/testsuite/gdb.cp/cplabel.cc
 create mode 100644 gdb/testsuite/gdb.cp/cplabel.exp

First 500 lines of diff:
diff --git a/ChangeLog b/ChangeLog
index a7a08e8..cff1dfb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2012-03-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* configure.ac (enable_libgomp): Remove *-*-irix6*.
+	(unsupported_languages): Remove mips-sgi-irix6.*.
+	(noconfigdirs): Don't add ${libgcj} for mips*-*-irix6*.
+	(with_stabs): Remove.
+	* configure: Regenerate.
+
+2012-03-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* configure.ac (enable_libgomp): Remove *-*-osf*.
+	(with_stabs): Remove alpha*-*-osf*.
+	* configure: Regenerate.
+
 2012-03-09  Jeff Johnston  <jjohnstn@redhat.com>
 
 	* COPYING.NEWLIB: Modify DJ Delorie license to include
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index eacf84e..0a674b8 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,22 @@
+2012-03-15  Roland McGrath  <mcgrathr@google.com>
+
+	* elf64-x86-64.c (struct elf_x86_64_backend_data): New type.
+	(get_elf_x86_64_backend_data, GET_PLT_ENTRY_SIZE): New macros.
+	(elf_x86_64_arch_bed): New variable.
+	(elf_backend_arch_data): New macro.
+	(elf_x86_64_adjust_dynamic_symbol): Use GET_PLT_ENTRY_SIZE.
+	(elf_x86_64_allocate_dynrelocs): Likewise.
+	(elf_x86_64_relocate_section): Likewise.
+	(elf_x86_64_plt_sym_val): Likewise.
+	(elf_x86_64_finish_dynamic_symbol): Use elf_x86_64_backend_data
+	parameters for PLT details.
+	(elf_x86_64_finish_dynamic_sections): Likewise.
+
+2012-03-14  Roland McGrath  <mcgrathr@google.com>
+
+	* elf32-i386.c (elf_i386_nacl_pic_plt0_entry): Initialize up
+	to the full size, padding out with nop instructions.
+
 2012-03-12  Alan Modra  <amodra@gmail.com>
 
 	* elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Don't warn
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 3014a0a..4ae2166 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -2702,7 +2702,7 @@ elf_i386_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
      it's not incremented, so in order to compute the space reserved
      for them, it suffices to multiply the reloc count by the jump
      slot size.
-     
+
      PR ld/13302: We start next_irelative_index at the end of .rela.plt
      so that R_386_IRELATIVE entries come last.  */
   if (htab->elf.srelplt)
@@ -5109,7 +5109,10 @@ elf_i386_nacl_pic_plt0_entry[sizeof (elf_i386_nacl_plt0_entry)] =
     0x8b, 0x4b, 0x08,		/* mov 0x8(%ebx), %ecx */
     0x83, 0xe1, 0xe0,		/* and $NACLMASK, %ecx */
     0xff, 0xe1,			/* jmp *%ecx */
-    0x90                        /* nop */
+
+    /* This is expected to be the same size as elf_i386_nacl_plt0_entry,
+       so pad to that size with nop instructions.  */
+    0x90, 0x90, 0x90, 0x90, 0x90, 0x90
   };
 
 static const bfd_byte elf_i386_nacl_pic_plt_entry[NACL_PLT_ENTRY_SIZE] =
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 88c47f9..c0a4493 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -585,6 +585,70 @@ static const bfd_byte elf_x86_64_eh_frame_plt[] =
   DW_CFA_nop, DW_CFA_nop, DW_CFA_nop, DW_CFA_nop
 };
 
+/* Architecture-specific backend data for x86-64.  */
+
+struct elf_x86_64_backend_data
+{
+  /* Templates for the initial PLT entry and for subsequent entries.  */
+  const bfd_byte *plt0_entry;
+  const bfd_byte *plt_entry;
+  unsigned int plt_entry_size;          /* Size of each PLT entry.  */
+
+  /* Offsets into plt0_entry that are to be replaced with GOT[1] and GOT[2].  */
+  unsigned int plt0_got1_offset;
+  unsigned int plt0_got2_offset;
+
+  /* Offset of the end of the PC-relative instruction containing
+     plt0_got2_offset.  */
+  unsigned int plt0_got2_insn_end;
+
+  /* Offsets into plt_entry that are to be replaced with...  */
+  unsigned int plt_got_offset;    /* ... address of this symbol in .got. */
+  unsigned int plt_reloc_offset;  /* ... offset into relocation table. */
+  unsigned int plt_plt_offset;    /* ... offset to start of .plt. */
+
+  /* Length of the PC-relative instruction containing plt_got_offset.  */
+  unsigned int plt_got_insn_size;
+
+  /* Offset of the end of the PC-relative jump to plt0_entry.  */
+  unsigned int plt_plt_insn_end;
+
+  /* Offset into plt_entry where the initial value of the GOT entry points.  */
+  unsigned int plt_lazy_offset;
+
+  /* .eh_frame covering the .plt section.  */
+  const bfd_byte *eh_frame_plt;
+  unsigned int eh_frame_plt_size;
+};
+
+#define get_elf_x86_64_backend_data(abfd) \
+  ((const struct elf_x86_64_backend_data *) \
+   get_elf_backend_data (abfd)->arch_data)
+
+#define GET_PLT_ENTRY_SIZE(abfd) \
+  get_elf_x86_64_backend_data (abfd)->plt_entry_size
+
+/* These are the standard parameters.  */
+static const struct elf_x86_64_backend_data elf_x86_64_arch_bed =
+  {
+    elf_x86_64_plt0_entry,              /* plt0_entry */
+    elf_x86_64_plt_entry,               /* plt_entry */
+    sizeof (elf_x86_64_plt_entry),      /* plt_entry_size */
+    2,                                  /* plt0_got1_offset */
+    8,                                  /* plt0_got2_offset */
+    12,                                 /* plt0_got2_insn_end */
+    2,                                  /* plt_got_offset */
+    7,                                  /* plt_reloc_offset */
+    12,                                 /* plt_plt_offset */
+    6,                                  /* plt_got_insn_size */
+    PLT_ENTRY_SIZE,                     /* plt_plt_insn_end */
+    6,                                  /* plt_lazy_offset */
+    elf_x86_64_eh_frame_plt,            /* eh_frame_plt */
+    sizeof (elf_x86_64_eh_frame_plt),   /* eh_frame_plt_size */
+  };
+
+#define	elf_backend_arch_data	&elf_x86_64_arch_bed
+
 /* x86-64 ELF linker hash entry.  */
 
 struct elf_x86_64_link_hash_entry
@@ -721,8 +785,8 @@ elf_x86_64_link_hash_newfunc (struct bfd_hash_entry *entry,
   if (entry == NULL)
     {
       entry = (struct bfd_hash_entry *)
-          bfd_hash_allocate (table,
-                             sizeof (struct elf_x86_64_link_hash_entry));
+	  bfd_hash_allocate (table,
+			     sizeof (struct elf_x86_64_link_hash_entry));
       if (entry == NULL)
 	return entry;
     }
@@ -839,7 +903,7 @@ elf_x86_64_link_hash_table_create (bfd *abfd)
   ret->tls_ld_got.refcount = 0;
   ret->sgotplt_jump_table_size = 0;
   ret->tls_module_base = NULL;
-  ret->next_jump_slot_index = 0; 
+  ret->next_jump_slot_index = 0;
   ret->next_irelative_index = 0;
 
   if (ABI_64_P (abfd))
@@ -1107,7 +1171,7 @@ elf_x86_64_check_tls_transition (bfd *abfd,
 
       h = sym_hashes[r_symndx - symtab_hdr->sh_info];
       /* Use strncmp to check __tls_get_addr since __tls_get_addr
-	 may be versioned.  */ 
+	 may be versioned.  */
       return (h != NULL
 	      && h->root.root.string != NULL
 	      && (ELF32_R_TYPE (rel[1].r_info) == R_X86_64_PC32
@@ -2007,7 +2071,7 @@ elf_x86_64_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
 	  if (h != NULL)
 	    {
 	      if (r_type == R_X86_64_GOTPLT64 && h->plt.refcount > 0)
-	        h->plt.refcount -= 1;
+		h->plt.refcount -= 1;
 	      if (h->got.refcount > 0)
 		h->got.refcount -= 1;
 	      if (h->type == STT_GNU_IFUNC)
@@ -2207,6 +2271,7 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
   struct elf_x86_64_link_hash_entry *eh;
   struct elf_dyn_relocs *p;
   const struct elf_backend_data *bed;
+  unsigned int plt_entry_size;
 
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
@@ -2218,6 +2283,7 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
   if (htab == NULL)
     return FALSE;
   bed = get_elf_backend_data (info->output_bfd);
+  plt_entry_size = GET_PLT_ENTRY_SIZE (info->output_bfd);
 
   /* Since STT_GNU_IFUNC symbol must go through PLT, we handle it
      here if it is defined and referenced in a non-shared object.  */
@@ -2225,7 +2291,7 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
       && h->def_regular)
     return _bfd_elf_allocate_ifunc_dyn_relocs (info, h,
 					       &eh->dyn_relocs,
-					       PLT_ENTRY_SIZE,
+					       plt_entry_size,
 					       GOT_ENTRY_SIZE);
   else if (htab->elf.dynamic_sections_created
 	   && h->plt.refcount > 0)
@@ -2247,7 +2313,7 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
 	  /* If this is the first .plt entry, make room for the special
 	     first entry.  */
 	  if (s->size == 0)
-	    s->size += PLT_ENTRY_SIZE;
+	    s->size += plt_entry_size;
 
 	  h->plt.offset = s->size;
 
@@ -2264,7 +2330,7 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
 	    }
 
 	  /* Make room for this entry.  */
-	  s->size += PLT_ENTRY_SIZE;
+	  s->size += plt_entry_size;
 
 	  /* We also need to make an entry in the .got.plt section, which
 	     will be placed in the .got section by the linker script.  */
@@ -2688,9 +2754,9 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd,
 	  /* Reserve room for the initial entry.
 	     FIXME: we could probably do away with it in this case.  */
 	  if (htab->elf.splt->size == 0)
-	    htab->elf.splt->size += PLT_ENTRY_SIZE;
+	    htab->elf.splt->size += GET_PLT_ENTRY_SIZE (output_bfd);
 	  htab->tlsdesc_plt = htab->elf.splt->size;
-	  htab->elf.splt->size += PLT_ENTRY_SIZE;
+	  htab->elf.splt->size += GET_PLT_ENTRY_SIZE (output_bfd);
 	}
     }
 
@@ -2702,7 +2768,7 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd,
 				  FALSE, FALSE, FALSE);
 
       /* Don't allocate .got.plt section if there are no GOT nor PLT
-         entries and there is no refeence to _GLOBAL_OFFSET_TABLE_.  */
+	 entries and there is no refeence to _GLOBAL_OFFSET_TABLE_.  */
       if ((got == NULL
 	   || !got->ref_regular_nonweak)
 	  && (htab->elf.sgotplt->size
@@ -2828,7 +2894,7 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd,
 	  /* If any dynamic relocs apply to a read-only section,
 	     then we need a DT_TEXTREL entry.  */
 	  if ((info->flags & DF_TEXTREL) == 0)
-	    elf_link_hash_traverse (&htab->elf, 
+	    elf_link_hash_traverse (&htab->elf,
 				    elf_x86_64_readonly_dynrelocs,
 				    info);
 
@@ -2981,6 +3047,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
   bfd_vma *local_tlsdesc_gotents;
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
+  const unsigned int plt_entry_size = GET_PLT_ENTRY_SIZE (info->output_bfd);
 
   BFD_ASSERT (is_x86_64_elf (input_bfd));
 
@@ -3023,7 +3090,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
 	}
 
       if (r_type != (int) R_X86_64_32
-	  || ABI_64_P (output_bfd)) 
+	  || ABI_64_P (output_bfd))
 	howto = x86_64_elf_howto_table + r_type;
       else
 	howto = (x86_64_elf_howto_table
@@ -3050,7 +3117,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
 	      if (h == NULL)
 		abort ();
 
-	      /* Set STT_GNU_IFUNC symbol value.  */ 
+	      /* Set STT_GNU_IFUNC symbol value.  */
 	      h->root.u.def.value = sym->st_value;
 	      h->root.u.def.section = sec;
 	    }
@@ -3126,7 +3193,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
 	      if (ABI_64_P (output_bfd))
 		goto do_relocation;
 	      /* FALLTHROUGH */
-	    case R_X86_64_64: 
+	    case R_X86_64_64:
 	      if (rel->r_addend != 0)
 		{
 		  if (h->root.root.string)
@@ -3211,13 +3278,13 @@ elf_x86_64_relocate_section (bfd *output_bfd,
 
 		  if (htab->elf.splt != NULL)
 		    {
-		      plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
+		      plt_index = h->plt.offset / plt_entry_size - 1;
 		      off = (plt_index + 3) * GOT_ENTRY_SIZE;
 		      base_got = htab->elf.sgotplt;
 		    }
 		  else
 		    {
-		      plt_index = h->plt.offset / PLT_ENTRY_SIZE;
+		      plt_index = h->plt.offset / plt_entry_size;
 		      off = plt_index * GOT_ENTRY_SIZE;
 		      base_got = htab->elf.igotplt;
 		    }
@@ -3226,9 +3293,9 @@ elf_x86_64_relocate_section (bfd *output_bfd,
 		      || h->forced_local
 		      || info->symbolic)
 		    {
-		      /* This references the local defitionion.  We must 
+		      /* This references the local defitionion.  We must
 			 initialize this entry in the global offset table.
-			 Since the offset must always be a multiple of 8, 
+			 Since the offset must always be a multiple of 8,
 			 we use the least significant bit to record
 			 whether we have initialized it already.
 
@@ -3284,14 +3351,14 @@ elf_x86_64_relocate_section (bfd *output_bfd,
 
 	      off = h->got.offset;
 	      if (h->needs_plt
-	          && h->plt.offset != (bfd_vma)-1
+		  && h->plt.offset != (bfd_vma)-1
 		  && off == (bfd_vma)-1)
 		{
 		  /* We can't use h->got.offset here to save
 		     state, or even just remember the offset, as
 		     finish_dynamic_symbol would use that as offset into
 		     .got.  */
-		  bfd_vma plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
+		  bfd_vma plt_index = h->plt.offset / plt_entry_size - 1;
 		  off = (plt_index + 3) * GOT_ENTRY_SIZE;
 		  base_got = htab->elf.sgotplt;
 		}
@@ -3322,7 +3389,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
 		      bfd_put_64 (output_bfd, relocation,
 				  base_got->contents + off);
 		      /* Note that this is harmless for the GOTPLT64 case,
-		         as -1 | 1 still is -1.  */
+			 as -1 | 1 still is -1.  */
 		      h->got.offset |= 1;
 		    }
 		}
@@ -3420,7 +3487,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
 	case R_X86_64_PLTOFF64:
 	  /* Relocation is PLT entry relative to GOT.  For local
 	     symbols it's the symbol itself relative to GOT.  */
-          if (h != NULL
+	  if (h != NULL
 	      /* See PLT32 handling.  */
 	      && h->plt.offset != (bfd_vma) -1
 	      && htab->elf.splt != NULL)
@@ -4154,6 +4221,8 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
 				  Elf_Internal_Sym *sym)
 {
   struct elf_x86_64_link_hash_table *htab;
+  const struct elf_x86_64_backend_data *const abed
+    = get_elf_x86_64_backend_data (output_bfd);
 
   htab = elf_x86_64_hash_table (info);
   if (htab == NULL)
@@ -4207,39 +4276,38 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
 
       if (plt == htab->elf.splt)
 	{
-	  got_offset = h->plt.offset / PLT_ENTRY_SIZE - 1;
+	  got_offset = h->plt.offset / abed->plt_entry_size - 1;
 	  got_offset = (got_offset + 3) * GOT_ENTRY_SIZE;
 	}
       else
 	{
-	  got_offset = h->plt.offset / PLT_ENTRY_SIZE;
+	  got_offset = h->plt.offset / abed->plt_entry_size;
 	  got_offset = got_offset * GOT_ENTRY_SIZE;
 	}
 
       /* Fill in the entry in the procedure linkage table.  */
-      memcpy (plt->contents + h->plt.offset, elf_x86_64_plt_entry,
-	      PLT_ENTRY_SIZE);
-
-      /* Insert the relocation positions of the plt section.  The magic
-	 numbers at the end of the statements are the positions of the
-	 relocations in the plt section.  */
-      /* Put offset for jmp *name@GOTPCREL(%rip), since the
-	 instruction uses 6 bytes, subtract this value.  */
+      memcpy (plt->contents + h->plt.offset, abed->plt_entry,
+	      abed->plt_entry_size);
+
+      /* Insert the relocation positions of the plt section.  */
+
+      /* Put offset the PC-relative instruction referring to the GOT entry,
+	 subtracting the size of that instruction.  */
       bfd_put_32 (output_bfd,
-		      (gotplt->output_section->vma
-		       + gotplt->output_offset
-		       + got_offset
-		       - plt->output_section->vma
-		       - plt->output_offset
-		       - h->plt.offset
-		       - 6),
-		  plt->contents + h->plt.offset + 2);
+		  (gotplt->output_section->vma
+		   + gotplt->output_offset
+		   + got_offset
+		   - plt->output_section->vma
+		   - plt->output_offset
+		   - h->plt.offset
+		   - abed->plt_got_insn_size),
+		  plt->contents + h->plt.offset + abed->plt_got_offset);
 
       /* Fill in the entry in the global offset table, initially this
-	 points to the pushq instruction in the PLT which is at offset 6.  */
+	 points to the second part of the PLT entry.  */
       bfd_put_64 (output_bfd, (plt->output_section->vma
 			       + plt->output_offset
-			       + h->plt.offset + 6),
+			       + h->plt.offset + abed->plt_lazy_offset),
 		  gotplt->contents + got_offset);
 
       /* Fill in the entry in the .rela.plt section.  */
@@ -4273,10 +4341,10 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
 	{
 	  /* Put relocation index.  */
 	  bfd_put_32 (output_bfd, plt_index,
-		      plt->contents + h->plt.offset + 7);
+		      plt->contents + h->plt.offset + abed->plt_reloc_offset);
 	  /* Put offset for jmp .PLT0.  */
-	  bfd_put_32 (output_bfd, - (h->plt.offset + PLT_ENTRY_SIZE),
-		      plt->contents + h->plt.offset + 12);
+	  bfd_put_32 (output_bfd, - (h->plt.offset + abed->plt_plt_insn_end),
+		      plt->contents + h->plt.offset + abed->plt_plt_offset);
 	}
 
       bed = get_elf_backend_data (output_bfd);
@@ -4408,7 +4476,7 @@ elf_x86_64_finish_local_dynamic_symbol (void **slot, void *inf)
   struct elf_link_hash_entry *h
     = (struct elf_link_hash_entry *) *slot;
   struct bfd_link_info *info
-    = (struct bfd_link_info *) inf; 
+    = (struct bfd_link_info *) inf;
 
   return elf_x86_64_finish_dynamic_symbol (info->output_bfd,
 					     info, h, NULL);
@@ -4442,6 +4510,8 @@ elf_x86_64_finish_dynamic_sections (bfd *output_bfd,
   struct elf_x86_64_link_hash_table *htab;
   bfd *dynobj;
   asection *sdyn;
+  const struct elf_x86_64_backend_data *const abed
+    = get_elf_x86_64_backend_data (output_bfd);
 
   htab = elf_x86_64_hash_table (info);
   if (htab == NULL)
@@ -4524,8 +4594,8 @@ elf_x86_64_finish_dynamic_sections (bfd *output_bfd,
       if (htab->elf.splt && htab->elf.splt->size > 0)
 	{
 	  /* Fill in the first entry in the procedure linkage table.  */
-	  memcpy (htab->elf.splt->contents, elf_x86_64_plt0_entry,
-		  PLT_ENTRY_SIZE);
+	  memcpy (htab->elf.splt->contents,
+		  abed->plt0_entry, abed->plt_entry_size);
 	  /* Add offset for pushq GOT+8(%rip), since the instruction
 	     uses 6 bytes subtract this value.  */
 	  bfd_put_32 (output_bfd,
@@ -4535,20 +4605,20 @@ elf_x86_64_finish_dynamic_sections (bfd *output_bfd,
 		       - htab->elf.splt->output_section->vma
 		       - htab->elf.splt->output_offset
 		       - 6),
-		      htab->elf.splt->contents + 2);
-	  /* Add offset for jmp *GOT+16(%rip). The 12 is the offset to
-	     the end of the instruction.  */
+		      htab->elf.splt->contents + abed->plt0_got1_offset);
+	  /* Add offset for the PC-relative instruction accessing GOT+16,
+	     subtracting the offset to the end of that instruction.  */
 	  bfd_put_32 (output_bfd,
 		      (htab->elf.sgotplt->output_section->vma
 		       + htab->elf.sgotplt->output_offset
 		       + 16
 		       - htab->elf.splt->output_section->vma
 		       - htab->elf.splt->output_offset
-		       - 12),
-		      htab->elf.splt->contents + 8);
+		       - abed->plt0_got2_insn_end),
+		      htab->elf.splt->contents + abed->plt0_got2_offset);
 
-	  elf_section_data (htab->elf.splt->output_section)->this_hdr.sh_entsize =
-	    PLT_ENTRY_SIZE;
+	  elf_section_data (htab->elf.splt->output_section)
+	    ->this_hdr.sh_entsize = abed->plt_entry_size;
 
 	  if (htab->tlsdesc_plt)
 	    {
@@ -4556,8 +4626,7 @@ elf_x86_64_finish_dynamic_sections (bfd *output_bfd,
 			  htab->elf.sgot->contents + htab->tlsdesc_got);
 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [SCM]  archer-keiths-linespec-rewrite: Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite
@ 2012-03-14 18:54 kseitz
  0 siblings, 0 replies; 8+ messages in thread
From: kseitz @ 2012-03-14 18:54 UTC (permalink / raw)
  To: archer-commits

The branch, archer-keiths-linespec-rewrite has been updated
       via  5ee352b2795621dea72001d3b4a5d586b4d8e633 (commit)
       via  fb7f39bc778010f4d1fc32d5e13660159f60b149 (commit)
       via  da6ec63a13ac3cd2cf6b8a8ea7e59ea1ee4f6cb9 (commit)
       via  0067cc7c1ad992da92f1a4e8568c6e7990f5c6e4 (commit)
       via  1c603d2d9bc394132964ca3681eb4745a84932f3 (commit)
       via  181c7f1c94a549fad5ce0a73c8855f462a184a8c (commit)
       via  c1b07e788b83e73e0a76306392c8d94b86bdaeb9 (commit)
       via  d7a9e1cdfb8eb4ba72c32e97bf143db71c6d94b7 (commit)
       via  7058f6ce5949ab67021d681410cdc363ff8e6141 (commit)
       via  8b1db1260675f235c66446533c4b224d644ea51f (commit)
       via  820dd2b62a2f176874c5b08c114d89d70ca3880f (commit)
       via  e0da1dbc89bdddf6f45e7f98eef935fcb5ca30c3 (commit)
       via  a6c252423c3bfe1adb83d8e1120c7cede77ecd04 (commit)
       via  7e0874ee6165f4284daf1d378fe44a665ee46be1 (commit)
       via  3b8846cfe9c3f6f33666d8d22dfd0efbd67edb22 (commit)
      from  828153415da5654864cace16f9118bbc873ff7d2 (commit)

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

- Log -----------------------------------------------------------------
commit 5ee352b2795621dea72001d3b4a5d586b4d8e633
Merge: fb7f39b da6ec63
Author: keiths <keiths@redhat.com>
Date:   Wed Mar 14 11:42:39 2012 -0700

    Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite

commit fb7f39bc778010f4d1fc32d5e13660159f60b149
Author: keiths <keiths@redhat.com>
Date:   Wed Mar 14 11:42:16 2012 -0700

    EOF -> EOI

commit da6ec63a13ac3cd2cf6b8a8ea7e59ea1ee4f6cb9
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Mar 14 07:58:01 2012 +0000

    gdb/
    	Fix double prompt of 'interpreter-exec mi'.
    	* mi/mi-interp.c (mi_execute_command_input_handler): New prototype.
    	(mi_interpreter_resume): use it.
    	(mi_execute_command_input_handler): New function.
    	* mi/mi-main.c (mi_execute_command): Move prompt printing to
    	mi_execute_command_input_handler.
    
    gdb/testsuite/
    	* gdb.mi/mi2-prompt.exp: New file.

commit 0067cc7c1ad992da92f1a4e8568c6e7990f5c6e4
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Wed Mar 14 05:04:18 2012 +0000

    sim: ppc: fix compilation on AIX 7.1 due to st_pad name collisions
    
    AIX 7.1 defines st_pad[123] to st_[amc]tim.tv_pad, respectively,
    breaking declaration of st_pad[123] members in struct solaris_stat.
    Undefine them as this is no less terrible than other solutions (like
    renaming the fields and losing the binding to Solaris' names).
    
    From: Michael Haubenwallner <haubi@s01en24.gentoo.org>

commit 1c603d2d9bc394132964ca3681eb4745a84932f3
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Wed Mar 14 01:47:45 2012 +0000

    Mark latest entry in ChangeLog as "tiny change".

commit 181c7f1c94a549fad5ce0a73c8855f462a184a8c
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Wed Mar 14 01:46:59 2012 +0000

    Fix -Wmissing-prototypes build warnings on Darwin.
    
    gdb/
    2012-03-13  Josh Matthews  <josh@joshmatthews.net>
    
    	* darwin-nat-info.c (_initialize_darwin_info_commands): Add
    	prototype.
    	(darwin_debug_port_info): Make static.
    	* darwin-nat.c (_initialize_darwin_inferior): Add prototype.
    	* machoread.c (_initialize_machoread): Add prototype.
    	* i386-darwin-nat.c (i386_darwin_dr_set, i386_darwin_dr_get)
    	(i386_darwin_set_control, i386_darwin_get_control)
    	i386_darwin_dr_set_addr, i386_darwin_get_addr)
    	i386_darwin_get_status, i386_darwin_get_control):
    	Comment out with HW_WATCHPOINT_NOT_YET_ENABLED macro.

commit c1b07e788b83e73e0a76306392c8d94b86bdaeb9
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Wed Mar 14 01:39:11 2012 +0000

    Testcase for: "ax-gdb: Do not treat enums and bools as integers".
    
    gdb/testsuite/ChangeLog:
    
            * gdb.base/enum_cond.c, gdb.base/enum_cond.exp: New testcase.

commit d7a9e1cdfb8eb4ba72c32e97bf143db71c6d94b7
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Wed Mar 14 01:38:58 2012 +0000

    ax-gdb: Do not treat enums and bools as integers.
    
    This patch fixes a problem when using gdb + gdbserver, and trying
    to break on a function when one of the (enum) parameters is equal
    to a certain value, and the size of that enum is 1 byte.
    
        (gdb) break mixed.adb:15 if light = green
        Breakpoint 2 at 0x402d5a: file mixed.adb, line 15.
        (gdb) cont
        Continuing.
        [Inferior 1 (process 9742) exited normally]
    
    The debugger should have stopped once when our function was call
    with light set to green.
    
    Here is what happens: Because we're using a recent GDBserver,
    GDB hands off the evaluation of the condition to GDBserver, by
    providing it in the Z0 packet. This is what GDB sends:
    
        $Z0,402d5a,1;X13,26000622100223ff1c16100219162022011327#cf
    
    I decoded the condition as follow:
    
        260006    reg 6 -> push
        2210      const8 0x10 -> push
        02        add (stack now has 1 element equal to reg6 + 16)
        23ff1c    const16 0xff1c
        1610      ext 16 (sign extend 16 bits)
        02        add (stack now has 1 element equal to reg6 + 16 - 228)
        19        ref32: Pop as addr, push 32bit value at addr.
        1620      ext 32 (sign extend 32 bits)
        2201      const8 0x01
        13        equal
        27        end
    
    The beginning of the agent expression can be explained by the address
    of symbol "light":
    
        (gdb) info addr light
        Symbol "light" is a variable at frame base reg $rbp offset 16+-228.
    
    However, the mistake is the "ext 32" operation (extend 32 bits),
    because our variable is *not* 32bits, only 8:
    
        (gdb) print light'size
        $5 = 8
    
    But the reason why GDB decides to use a 32bit extension is because
    it overrides the symbol's type with a plain integer type in
    ax-gdb.c:gen_usual_unary...
    
          /* If the value is an enum or a bool, call it an integer.  */
        case TYPE_CODE_ENUM:
        case TYPE_CODE_BOOL:
          value->type = builtin_type (exp->gdbarch)->builtin_int;
          break;
    
    ... before calling require_rvalue. And of course, that causes the
    generator to generate a sizeof(int) extension of the result.
    
    One way to fix this would be to use an integer type of the correct
    size, but I do not understand why this is necessary. The two routines
    that use that information to generate the opcode down the line are
    gen_fetch (for a memory value), or gen_extend (for a register value).
    And they both have handling of enums and bools.
    
    So the fix we elected to implement was simply to remove that code.
    
    gdb/ChangeLog:
    
            * ax-gdb.c (gen_usual_unary): Remove special handling of
            enum and bool types.

commit 7058f6ce5949ab67021d681410cdc363ff8e6141
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Wed Mar 14 01:38:50 2012 +0000

    testcase for "gdb-ax.c: Add handling of TYPE_CODE_RANGE types"
    
    gdb/testsuite/ChangeLog:
    
            * gdb.ada/bp_range_type: New testcase.

commit 8b1db1260675f235c66446533c4b224d644ea51f
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Wed Mar 14 01:38:29 2012 +0000

    ax-gdb.c: Add handling of TYPE_CODE_RANGE types.
    
    This patch fixes an error that occurs with GDB + GDBserver when
    trying to insert a breakpoint with a condition that involves
    a range type. For instance:
    
        type INT_T  is range 0 .. 1000;
        INT_VAR : INT_T := 12;
    
    And then trying to insert the breakpoint:
    
        (gdb) break foo.adb:18 if int_var > 15
        Breakpoint 1 at 0x4021eb: file foo.adb, line 18.
        (gdb) cont
        Continuing.
        /[...]/ax-gdb.c:560: internal-error: gen_fetch: bad type code
        A problem internal to GDB has been detected,
        further debugging may prove unreliable.
        Quit this debugging session? (y or n)
    
    This patch fixes the problem by adding handling for range types
    in gen_fetch.
    
    gdb/ChangeLog:
    
            * ax-gdb.c (gen_fetch): Add handling for TYPE_CODE_RANGE types.

commit 820dd2b62a2f176874c5b08c114d89d70ca3880f
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Wed Mar 14 00:00:32 2012 +0000

    *** empty log message ***

commit e0da1dbc89bdddf6f45e7f98eef935fcb5ca30c3
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Tue Mar 13 23:00:05 2012 +0000

    daily update

commit a6c252423c3bfe1adb83d8e1120c7cede77ecd04
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Tue Mar 13 22:29:45 2012 +0000

    Minor cleanup in aix-thread.c:supply_fprs.
    
    This is a minor cleanup that makes supply_fprs more consistent with
    how fill_fprs was written.
    
    gdb/ChangeLog:
    
            * aix-thread.c (supply_fprs): Make more consistent with fill_fprs.

commit 7e0874ee6165f4284daf1d378fe44a665ee46be1
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Tue Mar 13 22:27:11 2012 +0000

    Fix buffer overflow in aix-thread.c:fill_fprs
    
    gdb/
    2012-03-08  Chris January  <chris.january@allinea.com>
    
    	* aix-thread.c (fill_sprs): Store the floating point registers
    	at the correct offsets into vals.

commit 3b8846cfe9c3f6f33666d8d22dfd0efbd67edb22
Author: Doug Evans <dje@google.com>
Date:   Tue Mar 13 21:02:35 2012 +0000

    	* NEWS: Mention symbol-reloading has been deleted.
    	* symfile.c (symbol_reloading): Delete.
    	(show_symbol_reloading): Delete.
    	(_initialize_symfile): Delete set/show symbol-reloading.
    
    	doc/
    	* gdb.texinfo (Help): Change apropos example to use "alias" instead
    	of "reload".
    	(Symbols): Delete docs for set/show symbol-reloading.
    	* gdbint.texinfo (Defining Other Architecture Features): Delete
    	SYMBOL_RELOADING_DEFAULT.
    	* refcard.tex: Delete reference to symbol-reloading.
    
    	testsuite/
    	* gdb.base/default.exp: Delete tests for symbol-reloading.
    	* gdb.base/help.exp: Ditto.
    	* gdb.base/setshow.exp: Ditto.
    	* gdb.base/gdb_history: Delete references to symbol-reloading.

-----------------------------------------------------------------------

Summary of changes:
 bfd/version.h                               |    2 +-
 gdb/ChangeLog                               |   45 +++++++++++++++++++++++++
 gdb/NEWS                                    |    2 +
 gdb/aix-thread.c                            |   11 ++++--
 gdb/ax-gdb.c                                |    9 ++---
 gdb/darwin-nat-info.c                       |    5 ++-
 gdb/darwin-nat.c                            |    3 ++
 gdb/doc/ChangeLog                           |    9 +++++
 gdb/doc/gdb.texinfo                         |   38 +++------------------
 gdb/doc/gdbint.texinfo                      |    5 ---
 gdb/doc/refcard.tex                         |    2 +-
 gdb/i386-darwin-nat.c                       |    3 +-
 gdb/linespec.c                              |   24 +++++++-------
 gdb/machoread.c                             |    3 ++
 gdb/mi/mi-interp.c                          |   14 +++++++-
 gdb/mi/mi-main.c                            |    3 --
 gdb/symfile.c                               |   25 --------------
 gdb/testsuite/ChangeLog                     |   19 ++++++++++
 gdb/testsuite/gdb.ada/bp_range_type.exp     |   41 +++++++++++++++++++++++
 gdb/testsuite/gdb.ada/bp_range_type/foo.adb |   26 ++++++++++++++
 gdb/testsuite/gdb.ada/bp_range_type/pck.adb |   21 ++++++++++++
 gdb/testsuite/gdb.ada/bp_range_type/pck.ads |   19 ++++++++++
 gdb/testsuite/gdb.base/default.exp          |    4 --
 gdb/testsuite/gdb.base/enum_cond.c          |   48 +++++++++++++++++++++++++++
 gdb/testsuite/gdb.base/enum_cond.exp        |   44 ++++++++++++++++++++++++
 gdb/testsuite/gdb.base/gdb_history          |    2 -
 gdb/testsuite/gdb.base/help.exp             |    4 --
 gdb/testsuite/gdb.base/setshow.exp          |    4 --
 gdb/testsuite/gdb.linespec/ls-errs.exp      |    6 ++--
 gdb/testsuite/gdb.mi/mi2-prompt.exp         |   38 +++++++++++++++++++++
 gdb/version.in                              |    2 +-
 sim/ppc/ChangeLog                           |    4 ++
 sim/ppc/emul_unix.c                         |    5 +++
 33 files changed, 380 insertions(+), 110 deletions(-)
 create mode 100644 gdb/testsuite/gdb.ada/bp_range_type.exp
 create mode 100644 gdb/testsuite/gdb.ada/bp_range_type/foo.adb
 create mode 100644 gdb/testsuite/gdb.ada/bp_range_type/pck.adb
 create mode 100644 gdb/testsuite/gdb.ada/bp_range_type/pck.ads
 create mode 100644 gdb/testsuite/gdb.base/enum_cond.c
 create mode 100644 gdb/testsuite/gdb.base/enum_cond.exp
 create mode 100644 gdb/testsuite/gdb.mi/mi2-prompt.exp

First 500 lines of diff:
diff --git a/bfd/version.h b/bfd/version.h
index ac88154..e422220 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20120313
+#define BFD_VERSION_DATE 20120314
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0db4a16..f3d56c1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,50 @@
+2012-03-14  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Fix double prompt of 'interpreter-exec mi'.
+	* mi/mi-interp.c (mi_execute_command_input_handler): New prototype.
+	(mi_interpreter_resume): use it.
+	(mi_execute_command_input_handler): New function.
+	* mi/mi-main.c (mi_execute_command): Move prompt printing to
+	mi_execute_command_input_handler.
+
+2012-03-13  Josh Matthews  <josh@joshmatthews.net>  (tiny change)
+
+	* darwin-nat-info.c (_initialize_darwin_info_commands): Add
+	prototype.
+	(darwin_debug_port_info): Make static.
+	* darwin-nat.c (_initialize_darwin_inferior): Add prototype.
+	* machoread.c (_initialize_machoread): Add prototype.
+	* i386-darwin-nat.c (i386_darwin_dr_set, i386_darwin_dr_get)
+	(i386_darwin_set_control, i386_darwin_get_control)
+	i386_darwin_dr_set_addr, i386_darwin_get_addr)
+	i386_darwin_get_status, i386_darwin_get_control):
+	Comment out with HW_WATCHPOINT_NOT_YET_ENABLED macro.
+
+2012-03-13  Joel Brobecker  <brobecker@adacore.com>
+
+	* ax-gdb.c (gen_usual_unary): Remove special handling of
+	enum and bool types.
+
+2012-03-13  Joel Brobecker  <brobecker@adacore.com>
+
+	* ax-gdb.c (gen_fetch): Add handling for TYPE_CODE_RANGE types.
+
+2012-03-13  Joel Brobecker  <brobecker@adacore.com>
+
+	* aix-thread.c (supply_fprs): Make more consistent with fill_fprs.
+
+2012-03-13  Chris January  <chris.january@allinea.com>
+
+	* aix-thread.c (fill_sprs): Store the floating point registers
+	at the correct offsets into vals.
+
 2012-03-13  Doug Evans  <dje@google.com>
 
+	* NEWS: Mention symbol-reloading has been deleted.
+	* symfile.c (symbol_reloading): Delete.
+	(show_symbol_reloading): Delete.
+	(_initialize_symfile): Delete set/show symbol-reloading.
+
 	* dwarf2read.c (load_partial_comp_unit): Defer adding cu to
 	read_in_chain until we have successfully read it in.
 	(load_full_comp_unit): Ditto.
diff --git a/gdb/NEWS b/gdb/NEWS
index 9c89346..7d70404 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,8 @@
 
 *** Changes since GDB 7.4
 
+* The option "symbol-reloading" has been deleted as it is no longer used.
+
 * Python scripting
 
   ** GDB commands implemented in Python can now be put in command class
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 3cdab48..534f731 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -1075,9 +1075,11 @@ supply_fprs (struct regcache *regcache, double *vals)
      floating-point registers.  */
   gdb_assert (ppc_floating_point_unit_p (gdbarch));
 
-  for (regno = 0; regno < ppc_num_fprs; regno++)
-    regcache_raw_supply (regcache, regno + tdep->ppc_fp0_regnum,
-			 (char *) (vals + regno));
+  for (regno = tdep->ppc_fp0_regnum;
+       regno < tdep->ppc_fp0_regnum + ppc_num_fprs;
+       regno++)
+    regcache_raw_supply (regcache, regno,
+			 (char *) (vals + regno - tdep->ppc_fp0_regnum));
 }
 
 /* Predicate to test whether given register number is a "special" register.  */
@@ -1356,7 +1358,8 @@ fill_fprs (const struct regcache *regcache, double *vals)
        regno < tdep->ppc_fp0_regnum + ppc_num_fprs;
        regno++)
     if (REG_VALID == regcache_register_status (regcache, regno))
-      regcache_raw_collect (regcache, regno, vals + regno);
+      regcache_raw_collect (regcache, regno,
+			    vals + regno - tdep->ppc_fp0_regnum);
 }
 
 /* Store the special registers into the specified 64-bit and 32-bit
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index bd81338..a76e781 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -515,6 +515,9 @@ gen_fetch (struct agent_expr *ax, struct type *type)
       ax_trace_quick (ax, TYPE_LENGTH (type));
     }
 
+  if (TYPE_CODE (type) == TYPE_CODE_RANGE)
+    type = TYPE_TARGET_TYPE (type);
+
   switch (TYPE_CODE (type))
     {
     case TYPE_CODE_PTR:
@@ -877,12 +880,6 @@ gen_usual_unary (struct expression *exp, struct agent_expr *ax,
     case TYPE_CODE_STRUCT:
     case TYPE_CODE_UNION:
       return;
-
-      /* If the value is an enum or a bool, call it an integer.  */
-    case TYPE_CODE_ENUM:
-    case TYPE_CODE_BOOL:
-      value->type = builtin_type (exp->gdbarch)->builtin_int;
-      break;
     }
 
   /* If the value is an lvalue, dereference it.  */
diff --git a/gdb/darwin-nat-info.c b/gdb/darwin-nat-info.c
index 9170e14..9741538 100644
--- a/gdb/darwin-nat-info.c
+++ b/gdb/darwin-nat-info.c
@@ -301,7 +301,7 @@ info_mach_ports_command (char *args, int from_tty)
 }
 
 
-void
+static void
 darwin_debug_port_info (task_t task, mach_port_t port)
 {
   kern_return_t kret;
@@ -843,6 +843,9 @@ info_mach_exceptions_command (char *args, int from_tty)
     }
 }
 
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_darwin_info_commands;
+
 void
 _initialize_darwin_info_commands (void)
 {
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 0feebe3..de661a3 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -2015,6 +2015,9 @@ darwin_supports_multi_process (void)
   return 1;
 }
 
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_darwin_inferior;
+
 void
 _initialize_darwin_inferior (void)
 {
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 20f2816..80dd326 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,12 @@
+2012-03-13  Doug Evans  <dje@google.com>
+
+	* gdb.texinfo (Help): Change apropos example to use "alias" instead
+	of "reload".
+	(Symbols): Delete docs for set/show symbol-reloading.
+	* gdbint.texinfo (Defining Other Architecture Features): Delete
+	SYMBOL_RELOADING_DEFAULT.
+	* refcard.tex: Delete reference to symbol-reloading.
+
 2012-03-07  Pedro Alves  <palves@redhat.com>
 
 	* gdb.texinfo (General Query Packets): Document new
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index e8bbded..a5022d4 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -1700,7 +1700,7 @@ commands, and their documentation, for the regular expression specified in
 @var{args}.  It prints out all matches found.  For example:
 
 @smallexample
-apropos reload
+apropos alias
 @end smallexample
 
 @noindent
@@ -1708,10 +1708,11 @@ results in:
 
 @smallexample
 @c @group
-set symbol-reloading -- Set dynamic symbol table reloading
-                        multiple times in one run
-show symbol-reloading -- Show dynamic symbol table reloading
-                        multiple times in one run
+alias -- Define a new command that is an alias of an existing command
+aliases -- Aliases of other commands
+d -- Delete some breakpoints or auto-display expressions
+del -- Delete some breakpoints or auto-display expressions
+delete -- Delete some breakpoints or auto-display expressions
 @c @end group
 @end smallexample
 
@@ -14721,33 +14722,6 @@ from the @code{ptype} command can be overwhelming and hard to use.  The
 which match the regular-expression @var{regexp}.
 @end ignore
 
-@cindex reloading symbols
-Some systems allow individual object files that make up your program to
-be replaced without stopping and restarting your program.  For example,
-in VxWorks you can simply recompile a defective object file and keep on
-running.  If you are running on one of these systems, you can allow
-@value{GDBN} to reload the symbols for automatically relinked modules:
-
-@table @code
-@kindex set symbol-reloading
-@item set symbol-reloading on
-Replace symbol definitions for the corresponding source file when an
-object file with a particular name is seen again.
-
-@item set symbol-reloading off
-Do not replace symbol definitions when encountering object files of the
-same name more than once.  This is the default state; if you are not
-running on a system that permits automatic relinking of modules, you
-should leave @code{symbol-reloading} off, since otherwise @value{GDBN}
-may discard symbols when linking large programs, that may contain
-several modules (from different directories or libraries) with the same
-name.
-
-@kindex show symbol-reloading
-@item show symbol-reloading
-Show the current @code{on} or @code{off} setting.
-@end table
-
 @cindex opaque data types
 @kindex set opaque-type-resolution
 @item set opaque-type-resolution on
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index 026dc59..fcc106c 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -4916,11 +4916,6 @@ number of that register.
 Use this function to convert stab register @var{stab_regnr} into @value{GDBN}
 regnum.  If not defined, no conversion will be done.
 
-@item SYMBOL_RELOADING_DEFAULT
-@findex SYMBOL_RELOADING_DEFAULT
-The default value of the ``symbol-reloading'' variable.  (Never defined in
-current sources.)
-
 @item TARGET_CHAR_BIT
 @findex TARGET_CHAR_BIT
 Number of bits in a char; defaults to 8.
diff --git a/gdb/doc/refcard.tex b/gdb/doc/refcard.tex
index c6656e5..bee7c3d 100644
--- a/gdb/doc/refcard.tex
+++ b/gdb/doc/refcard.tex
@@ -68,7 +68,7 @@
 % all variations of a command.
 % The GDB-under-Emacs section omits gdb-mode functions without default
 % keybindings.  GDB startup options are not described.
-% set print sevenbit-strings, set symbol-reloading omitted.
+% set print sevenbit-strings omitted.
 % printsyms, printpsyms, omitted since they're for GDB maintenance primarily
 % share omitted due to obsolescence
 % set check range/type omitted at least til code is in GDB.
diff --git a/gdb/i386-darwin-nat.c b/gdb/i386-darwin-nat.c
index b452f1e..ced2903 100644
--- a/gdb/i386-darwin-nat.c
+++ b/gdb/i386-darwin-nat.c
@@ -260,7 +260,7 @@ i386_darwin_store_inferior_registers (struct target_ops *ops,
     }
 }
 
-
+#ifdef HW_WATCHPOINT_NOT_YET_ENABLED
 /* Support for debug registers, boosted mostly from i386-linux-nat.c.  */
 
 static void
@@ -410,6 +410,7 @@ i386_darwin_dr_get_control (void)
 {
   return i386_darwin_dr_get (DR_CONTROL);
 }
+#endif
 
 void
 darwin_check_osabi (darwin_inferior *inf, thread_t thread)
diff --git a/gdb/linespec.c b/gdb/linespec.c
index c8fd5f1..533ff0e 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -199,8 +199,8 @@ enum ls_token_type
   /* A number  */
   LSTOKEN_NUMBER,
 
-  /* EOF  */
-  LSTOKEN_EOF,
+  /* EOI (end of input)  */
+  LSTOKEN_EOI,
 
   /* Consumed token  */
   LSTOKEN_CONSUMED
@@ -451,7 +451,7 @@ skip_quote_char (const char *string, char quote_char)
       else if (*p == quote_char)
 	{
 	  /* We found the quote_char, but keep going until
-	     we see EOF or a terminal.  */
+	     we see EOI or a terminal.  */
 	  found = p;
 	}
 
@@ -562,7 +562,7 @@ linespec_lexer_lex_string (linespec_parser *parser)
 	      PARSER_STREAM (parser) = p;
 	    }
 
-	  /* If the next character is EOF or (single) ':', the
+	  /* If the next character is EOI or (single) ':', the
 	     string is complete;  return the token.  */
 	  if (*PARSER_STREAM (parser) == 0)
 	    {
@@ -623,7 +623,7 @@ linespec_lexer_lex_one (linespec_parser *parser)
       switch (*PARSER_STREAM (parser))
 	{
 	case 0:
-	  parser->lexer.current.type = LSTOKEN_EOF;
+	  parser->lexer.current.type = LSTOKEN_EOI;
 	  break;
 
 	case '+': case '-':
@@ -1216,7 +1216,7 @@ unexpected_linespec_error (linespec_parser *parser)
 {
   linespec_token token;
   static const char * token_type_strings[]
-    = {"keyword", "colon", "string", "number", "EOF"};
+    = {"keyword", "colon", "string", "number", "end-of-input"};
 
   /* Get the token that generated the error.  */
   token = linespec_lexer_lex_one (parser);
@@ -1279,8 +1279,8 @@ linespec_parse_basic (linespec_parser *parser)
   /* Get the next token.  */
   token = linespec_lexer_lex_one (parser);
 
-  /* If it is EOF or KEYWORD, issue an error.  */
-  if (token.type == LSTOKEN_KEYWORD || token.type == LSTOKEN_EOF)
+  /* If it is EOI or KEYWORD, issue an error.  */
+  if (token.type == LSTOKEN_KEYWORD || token.type == LSTOKEN_EOI)
     unexpected_linespec_error (parser);
   /* If it is a LSTOKEN_NUMBER, we have an offset.  */
   else if (token.type == LSTOKEN_NUMBER)
@@ -1302,13 +1302,13 @@ linespec_parse_basic (linespec_parser *parser)
 	  && *LS_TOKEN_STOKEN (token).ptr == ',')
 	return;
 
-      /* If the next token is anything but EOF or KEYWORD, issue
+      /* If the next token is anything but EOI or KEYWORD, issue
 	 an error.  */
-      if (token.type != LSTOKEN_KEYWORD && token.type != LSTOKEN_EOF)
+      if (token.type != LSTOKEN_KEYWORD && token.type != LSTOKEN_EOI)
 	unexpected_linespec_error (parser);
     }
 
-  if (token.type == LSTOKEN_KEYWORD || token.type == LSTOKEN_EOF)
+  if (token.type == LSTOKEN_KEYWORD || token.type == LSTOKEN_EOI)
     return;
 
   /* Next token must be LSTOKEN_STRING.  */
@@ -1965,7 +1965,7 @@ parse_linespec (linespec_parser *parser, char **argptr)
   /* Get the last token and record how much of the input was parsed
      if necessary.  */
   token = linespec_lexer_lex_one (parser);
-  if (token.type != LSTOKEN_EOF && token.type != LSTOKEN_KEYWORD)
+  if (token.type != LSTOKEN_EOI && token.type != LSTOKEN_KEYWORD)
     PARSER_STREAM (parser) = LS_TOKEN_STOKEN (token).ptr;
 
   /* Convert the data in PARSER_RESULT to SALs.  */
diff --git a/gdb/machoread.c b/gdb/machoread.c
index 88ce612..8a6b500 100644
--- a/gdb/machoread.c
+++ b/gdb/machoread.c
@@ -1035,6 +1035,9 @@ static const struct sym_fns macho_sym_fns = {
   &psym_functions
 };
 
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_machoread;
+
 void
 _initialize_machoread ()
 {
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index cb12549..daae480 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -40,6 +40,7 @@
    interpreter.  */
 
 static void mi_execute_command_wrapper (char *cmd);
+static void mi_execute_command_input_handler (char *cmd);
 static void mi_command_loop (int mi_version);
 
 /* These are hooks that we put in place while doing interpreter_exec
@@ -151,7 +152,7 @@ mi_interpreter_resume (void *data)
   /* These overwrite some of the initialization done in
      _intialize_event_loop.  */
   call_readline = gdb_readline2;
-  input_handler = mi_execute_command_wrapper;
+  input_handler = mi_execute_command_input_handler;
   add_file_handler (input_fd, stdin_event_handler, 0);
   async_command_editing_p = 0;
   /* FIXME: This is a total hack for now.  PB's use of the MI
@@ -297,6 +298,17 @@ mi_execute_command_wrapper (char *cmd)
   mi_execute_command (cmd, stdin == instream);
 }
 
+/* mi_execute_command_wrapper wrapper suitable for INPUT_HANDLER.  */
+
+static void
+mi_execute_command_input_handler (char *cmd)
+{
+  mi_execute_command_wrapper (cmd);
+
+  fputs_unfiltered ("(gdb) \n", raw_stdout);
+  gdb_flush (raw_stdout);
+}
+
 static void
 mi1_command_loop (void)
 {
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 787d247..9f14f01 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -2029,9 +2029,6 @@ mi_execute_command (char *cmd, int from_tty)
 
       mi_parse_free (command);
     }
-
-  fputs_unfiltered ("(gdb) \n", raw_stdout);
-  gdb_flush (raw_stdout);
 }
 
 static void
diff --git a/gdb/symfile.c b/gdb/symfile.c
index ad46748..816b574 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -147,23 +147,6 @@ DEF_VEC_P (sym_fns_ptr);
 
 static VEC (sym_fns_ptr) *symtab_fns = NULL;
 
-/* Flag for whether user will be reloading symbols multiple times.
-   Defaults to ON for VxWorks, otherwise OFF.  */
-
-#ifdef SYMBOL_RELOADING_DEFAULT
-int symbol_reloading = SYMBOL_RELOADING_DEFAULT;
-#else
-int symbol_reloading = 0;
-#endif
-static void
-show_symbol_reloading (struct ui_file *file, int from_tty,
-		       struct cmd_list_element *c, const char *value)
-{
-  fprintf_filtered (file, _("Dynamic symbol table reloading "
-			    "multiple times in one run is %s.\n"),
-		    value);
-}
-
 /* If non-zero, shared library symbols will be added automatically
    when the inferior is created, new libraries are loaded, or when
    attaching to the inferior.  This is almost always what users will
@@ -3833,14 +3816,6 @@ for access from GDB.\n\
 A load OFFSET may also be given."), &cmdlist);
   set_cmd_completer (c, filename_completer);
 
-  add_setshow_boolean_cmd ("symbol-reloading", class_support,
-			   &symbol_reloading, _("\
-Set dynamic symbol table reloading multiple times in one run."), _("\
-Show dynamic symbol table reloading multiple times in one run."), NULL,
-			   NULL,
-			   show_symbol_reloading,
-			   &setlist, &showlist);
-
   add_prefix_cmd ("overlay", class_support, overlay_command,
 		  _("Commands for debugging overlays."), &overlaylist,
 		  "overlay ", 0, &cmdlist);
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [SCM]  archer-keiths-linespec-rewrite: Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite
@ 2012-03-13 21:22 kseitz
  0 siblings, 0 replies; 8+ messages in thread
From: kseitz @ 2012-03-13 21:22 UTC (permalink / raw)
  To: archer-commits

The branch, archer-keiths-linespec-rewrite has been updated
       via  d14a86c4c46eb6f5ddcb2ee83b2cd4f5b50f7267 (commit)
       via  b7522666365970695d1948f80faaa5cff93ee4a9 (commit)
       via  d2b433de6faa61355736bc72318f929fd4ca98f5 (commit)
       via  c7412c9f6c1bdbbb8e4fcc20313994cc243accec (commit)
      from  833a899be8b7e037bdf9f341ef31fc98a04532ee (commit)

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

- Log -----------------------------------------------------------------
commit d14a86c4c46eb6f5ddcb2ee83b2cd4f5b50f7267
Merge: 833a899 b752266
Author: keiths <keiths@redhat.com>
Date:   Tue Mar 13 14:22:20 2012 -0700

    Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite

commit b7522666365970695d1948f80faaa5cff93ee4a9
Author: Doug Evans <dje@google.com>
Date:   Tue Mar 13 17:16:18 2012 +0000

    	* dwarf2read.c (load_partial_comp_unit): Defer adding cu to
    	read_in_chain until we have successfully read it in.
    	(load_full_comp_unit): Ditto.
    	(read_signatured_type): Add comment.

commit d2b433de6faa61355736bc72318f929fd4ca98f5
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Tue Mar 13 16:29:15 2012 +0000

    [stabs] The address of Fortran common blocks may be > INT_MAX.
    
    gdb/
    2012-03-08  Chris January  <chris.january@allinea.com>
    
            * stabsread.c (fix_common_block): Change type of valu argument
            to CORE_ADDR.

commit c7412c9f6c1bdbbb8e4fcc20313994cc243accec
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Tue Mar 13 16:15:35 2012 +0000

    [ppc/prologue] Support the "oril r29, r1, 0x0" insn.
    
    gdb/
    2012-03-13  Chris January  <chris.january@allinea.com>
    
    	* rs6000-tdep.c (skip_prologue): Support the oril r29, r1, 0x0
    	instruction.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog     |   17 +++++++++++++++++
 gdb/dwarf2read.c  |   17 +++++++++--------
 gdb/rs6000-tdep.c |    9 +++++++++
 gdb/stabsread.c   |    4 ++--
 4 files changed, 37 insertions(+), 10 deletions(-)

First 500 lines of diff:
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8e466c8..0db4a16 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,20 @@
+2012-03-13  Doug Evans  <dje@google.com>
+
+	* dwarf2read.c (load_partial_comp_unit): Defer adding cu to
+	read_in_chain until we have successfully read it in.
+	(load_full_comp_unit): Ditto.
+	(read_signatured_type): Add comment.
+
+2012-03-13  Chris January  <chris.january@allinea.com>
+
+	* stabsread.c (fix_common_block): Change type of valu argument
+	to CORE_ADDR.
+
+2012-03-13  Chris January  <chris.january@allinea.com>
+
+	* rs6000-tdep.c (skip_prologue): Support the oril r29, r1, 0x0
+	instruction.
+
 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	* common/linux-procfs.c (linux_proc_get_int): New, from
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index ebe855b..807d36d 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -3686,10 +3686,6 @@ load_partial_comp_unit (struct dwarf2_per_cu_data *this_cu)
 	  do_cleanups (free_cu_cleanup);
 	  return;
 	}
-
-      /* Link this CU into read_in_chain.  */
-      this_cu->cu->read_in_chain = dwarf2_per_objfile->read_in_chain;
-      dwarf2_per_objfile->read_in_chain = this_cu;
     }
   else
     {
@@ -3722,6 +3718,10 @@ load_partial_comp_unit (struct dwarf2_per_cu_data *this_cu)
       /* We've successfully allocated this compilation unit.  Let our
 	 caller clean it up when finished with it.  */
       discard_cleanups (free_cu_cleanup);
+
+      /* Link this CU into read_in_chain.  */
+      this_cu->cu->read_in_chain = dwarf2_per_objfile->read_in_chain;
+      dwarf2_per_objfile->read_in_chain = this_cu;
     }
 }
 
@@ -4700,10 +4700,6 @@ load_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
       /* Complete the cu_header.  */
       cu->header.offset = offset;
       cu->header.first_die_offset = info_ptr - beg_of_comp_unit;
-
-      /* Link this CU into read_in_chain.  */
-      per_cu->cu->read_in_chain = dwarf2_per_objfile->read_in_chain;
-      dwarf2_per_objfile->read_in_chain = per_cu;
     }
   else
     {
@@ -4730,6 +4726,10 @@ load_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
       /* We've successfully allocated this compilation unit.  Let our
 	 caller clean it up when finished with it.  */
       discard_cleanups (free_cu_cleanup);
+
+      /* Link this CU into read_in_chain.  */
+      per_cu->cu->read_in_chain = dwarf2_per_objfile->read_in_chain;
+      dwarf2_per_objfile->read_in_chain = per_cu;
     }
 }
 
@@ -14445,6 +14445,7 @@ read_signatured_type (struct signatured_type *type_sig)
      clean it up when finished with it.	 */
   discard_cleanups (free_cu_cleanup);
 
+  /* Link this TU into read_in_chain.  */
   type_sig->per_cu.cu->read_in_chain = dwarf2_per_objfile->read_in_chain;
   dwarf2_per_objfile->read_in_chain = &type_sig->per_cu;
 }
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index a8ff777..2b1a0a5 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1822,6 +1822,15 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
 
 	  /* Set up frame pointer */
 	}
+      else if (op == 0x603d0000)       /* oril r29, r1, 0x0 */
+	{
+	  fdata->frameless = 0;
+	  framep = 1;
+	  fdata->alloca_reg = (tdep->ppc_gp0_regnum + 29);
+	  continue;
+
+	  /* Another way to set up the frame pointer.  */
+	}
       else if (op == 0x603f0000	/* oril r31, r1, 0x0 */
 	       || op == 0x7c3f0b78)
 	{			/* mr r31, r1 */
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index afcfe06..ac82652 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -98,7 +98,7 @@ static void
 patch_block_stabs (struct pending *, struct pending_stabs *,
 		   struct objfile *);
 
-static void fix_common_block (struct symbol *, int);
+static void fix_common_block (struct symbol *, CORE_ADDR);
 
 static int read_type_number (char **, int *);
 
@@ -4397,7 +4397,7 @@ common_block_end (struct objfile *objfile)
    the common block name).  */
 
 static void
-fix_common_block (struct symbol *sym, int valu)
+fix_common_block (struct symbol *sym, CORE_ADDR valu)
 {
   struct pending *next = (struct pending *) SYMBOL_TYPE (sym);
 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-03-30 20:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-16 23:48 [SCM] archer-keiths-linespec-rewrite: Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite kseitz
  -- strict thread matches above, loose matches on Subject: below --
2012-03-30 20:55 kseitz
2012-03-26 21:41 kseitz
2012-03-19 19:24 kseitz
2012-03-19 17:21 kseitz
2012-03-15 19:14 kseitz
2012-03-14 18:54 kseitz
2012-03-13 21:22 kseitz

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).