public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  users/jkratoch/indexcxx-nameswrite-namesread: .
@ 2017-05-24  8:46 jkratoch
  0 siblings, 0 replies; 5+ messages in thread
From: jkratoch @ 2017-05-24  8:46 UTC (permalink / raw)
  To: archer-commits

The branch, users/jkratoch/indexcxx-nameswrite-namesread has been updated
       via  cdc35f2b9e6cfe316be27a637cbcea17faa802a1 (commit)
       via  ddcf6f7a9870e33b8808b65634d6d23fbee99566 (commit)
      from  115acb62c076b103ba79e71e10a78146996733e9 (commit)

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

- Log -----------------------------------------------------------------
commit cdc35f2b9e6cfe316be27a637cbcea17faa802a1
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed May 24 10:43:27 2017 +0200

    .

commit ddcf6f7a9870e33b8808b65634d6d23fbee99566
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed May 24 10:39:03 2017 +0200

    .

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

Summary of changes:
 gdb/dwarf2read.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

First 500 lines of diff:
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 6b215bc..3c7c529 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -4863,14 +4863,23 @@ dw2_find_pc_sect_compunit_symtab (struct objfile *objfile,
   if (!data)
     return NULL;
 
+  bool warned (false);
   if (warn_if_readin && data->v.quick->compunit_symtab)
-    warning (_("(Internal error: pc %s in read in CU, but not in symtab.)"),
-	     paddress (get_objfile_arch (objfile), pc));
+    {
+      warning (_("(Internal error: pc %s in read in CU, but not in symtab.)"),
+	       paddress (get_objfile_arch (objfile), pc));
+      warned = true;
+    }
 
   result
     = recursively_find_pc_sect_compunit_symtab (dw2_instantiate_symtab (data),
 						pc);
-  gdb_assert (result != NULL);
+  if (result == NULL && !warned)
+    complaint (&symfile_complaints,
+	       _("Wrong .debug_aranges for PC %s [in module %s]"),
+	       paddress (get_objfile_arch (objfile), pc),
+	       objfile_name (dwarf2_per_objfile->objfile));
+
   return result;
 }
 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [SCM]  users/jkratoch/indexcxx-nameswrite-namesread: .
@ 2017-05-22 21:41 jkratoch
  0 siblings, 0 replies; 5+ messages in thread
From: jkratoch @ 2017-05-22 21:41 UTC (permalink / raw)
  To: archer-commits

The branch, users/jkratoch/indexcxx-nameswrite-namesread has been updated
       via  3bd2320fbad278743efe491edb301caa5abd37e7 (commit)
       via  c33162d9d898a902c28e89ce0ec9f0d855b584e8 (commit)
       via  8e76921b533ca4e4f103654b2c379164761565cf (commit)
      from  2af3f7cc3675de402387152f5d1737df9c266287 (commit)

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

- Log -----------------------------------------------------------------
commit 3bd2320fbad278743efe491edb301caa5abd37e7
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon May 22 23:40:57 2017 +0200

    .

commit c33162d9d898a902c28e89ce0ec9f0d855b584e8
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon May 22 23:20:01 2017 +0200

    .

commit 8e76921b533ca4e4f103654b2c379164761565cf
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon May 22 21:08:17 2017 +0200

    .

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

Summary of changes:
 gdb/psymtab.c                                      |    3 +++
 gdb/testsuite/gdb.base/maint.exp                   |    7 +++++--
 gdb/testsuite/gdb.dlang/watch-loc.c                |   19 +++++++++++++++++++
 .../gdb.dwarf2/dw2-case-insensitive-debug.S        |   17 +++++++++++++++++
 4 files changed, 44 insertions(+), 2 deletions(-)

First 500 lines of diff:
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index bb482ee..1681929 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -1988,6 +1988,9 @@ maintenance_print_psymbols (char *args, int from_tty)
       int print_for_objfile = 1;
 
       QUIT;
+      if (objfile->sf->sym_read_psymbols == NULL)
+	continue;
+
       if (objfile_arg != NULL)
 	print_for_objfile
 	  = compare_filenames_for_search (objfile_name (objfile),
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index 782a21c..8e79451 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -91,8 +91,11 @@ if ![runto_main] then {
 
 # If we're using .gdb_index there will be no psymtabs.
 set have_gdb_index 0
-gdb_test_multiple "maint info sections .gdb_index" "check for .gdb_index" {
-    -re ": .gdb_index.*$gdb_prompt $" {
+gdb_test_multiple "maint info sections .gdb_index .debug_names" "check for .gdb_index" {
+    -re ": \\.gdb_index .*\r\n$gdb_prompt $" {
+	set have_gdb_index 1
+    }
+    -re ": \\.debug_names .*\r\n$gdb_prompt $" {
 	set have_gdb_index 1
     }
     -re ".*$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.dlang/watch-loc.c b/gdb/testsuite/gdb.dlang/watch-loc.c
index 0ffc377..a1f3caa 100644
--- a/gdb/testsuite/gdb.dlang/watch-loc.c
+++ b/gdb/testsuite/gdb.dlang/watch-loc.c
@@ -34,3 +34,22 @@ main (void)
   return _Dmain ();
 }
 
+// .gdb_index contained this map but .debug_names is generated by GDB
+// while it depends on .debug_aranges generated by GCC.
+asm (
+"	.pushsection	.debug_aranges,\"\",@progbits \n"
+"	.4byte	.Laranges_end - .Laranges_start \n"	// Length of Address Ranges Info
+".Laranges_start: \n"
+"	.2byte	0x2 \n"	// DWARF Version
+"	.4byte	0 \n" // .Ldebug_info0 - Offset of Compilation Unit Info
+"	.byte	4 \n"	// Size of Address
+"	.byte	0 \n"	// Size of Segment Descriptor
+"	.2byte	0 \n"	// Pad to 16 byte boundary
+"	.2byte	0 \n"
+"	.4byte	_Dmain \n"	// Address
+"	.4byte	0x1000 \n"	// Length
+"	.4byte	0 \n"
+"	.4byte	0 \n"
+".Laranges_end: \n"
+"	.popsection \n"
+);
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S
index 3bbd725..5a968bd 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S
@@ -57,6 +57,23 @@
 	.byte		0			/* End of children of CU */
 .Lcu1_end:
 
+	// .gdb_index contained this map but .debug_names is generated by GDB
+	// while it depends on .debug_aranges generated by GCC.
+	.section	.debug_aranges,"",@progbits
+	.4byte	.Laranges_end - .Laranges_start	// Length of Address Ranges Info
+.Laranges_start:
+	.2byte	0x2	// DWARF Version
+	.4byte	0 // .Ldebug_info0 - Offset of Compilation Unit Info
+	.byte	PTRBITS / 8	// Size of Address
+	.byte	0	// Size of Segment Descriptor
+	.2byte	0	// Pad to 16 byte boundary
+	.2byte	0
+	PTRBYTE	cu_text_start	// Address
+	PTRBYTE	0x1000 // cu_text_end - cu_text_start	// Length
+	PTRBYTE	0
+	PTRBYTE	0
+.Laranges_end:
+
 /* Abbrev table */
 	.section .debug_abbrev
 .Labbrev1_begin:


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


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [SCM]  users/jkratoch/indexcxx-nameswrite-namesread: .
@ 2017-04-30 18:28 jkratoch
  0 siblings, 0 replies; 5+ messages in thread
From: jkratoch @ 2017-04-30 18:28 UTC (permalink / raw)
  To: archer-commits

The branch, users/jkratoch/indexcxx-nameswrite-namesread has been updated
       via  8fd75b5f6edf3f1ad68acb903efa092869f7b096 (commit)
       via  bb5c93af3d3345ff436f28b649677b30ad9bd703 (commit)
      from  0b6916bdf557d987df0636f024bc264a308045d7 (commit)

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

- Log -----------------------------------------------------------------
commit 8fd75b5f6edf3f1ad68acb903efa092869f7b096
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sun Apr 30 19:29:34 2017 +0200

    .

commit bb5c93af3d3345ff436f28b649677b30ad9bd703
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sun Apr 30 19:23:59 2017 +0200

    .

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

Summary of changes:
 gdb/dwarf2read.c |   64 +++++++++++++++++++++++++++---------------------------
 1 files changed, 32 insertions(+), 32 deletions(-)

First 500 lines of diff:
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index d339e84..2534d19 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -208,14 +208,16 @@ struct mapped_index
   const char *constant_pool;
 };
 
-/* A description of the mapped .debug_names.  */
+// A description of the mapped .debug_names.
+// Uninitialized map has CU_COUNT 0.
 class Mapped_debug_names
 {
 public:
   bfd_endian dwarf5_byte_order;
   bool dwarf5_is_dwarf64;
   uint8_t offset_size;
-  uint32_t cu_count, tu_count, bucket_count, name_count;
+  uint32_t cu_count = 0;
+  uint32_t tu_count, bucket_count, name_count;
   const gdb_byte *cu_table_reordered, *tu_table_reordered;
   const uint32_t *bucket_table_reordered, *hash_table_reordered;
   const gdb_byte *name_table_string_offs_reordered;
@@ -3691,7 +3693,6 @@ read_debug_names_from_section (struct objfile *objfile,
   const gdb_byte *addr, *abbrev_table_start;
   offset_type *metadata;
   int i;
-  bfd *abfd = get_section_bfd_owner (section);
   unsigned int bytes_read;
   LONGEST length;
   uint16_t version, padding;
@@ -3712,6 +3713,7 @@ read_debug_names_from_section (struct objfile *objfile,
 
   addr = section->buffer;
 
+  bfd *const abfd (get_section_bfd_owner (section));
   length = read_initial_length (abfd, addr, &bytes_read);
   addr += bytes_read;
   map.dwarf5_is_dwarf64 = bytes_read != 4;
@@ -3761,7 +3763,7 @@ read_debug_names_from_section (struct objfile *objfile,
      in the foreign TU list.  */
   foreign_tu_count = read_4_bytes (abfd, addr);
   addr += 4;
-  if (foreign_tu_count != 5)
+  if (foreign_tu_count != 0)
     {
       warning (_("Section .debug_names in %s has unsupported %lu foreign TUs, "
 		 "ignoring .debug_names."),
@@ -4668,6 +4670,28 @@ dw_expand_symtabs_matching_file_matcher
 }
 
 static void
+dw2_expand_symtabs_matching_one
+  (struct dwarf2_per_cu_data *per_cu,
+   gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
+   gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify)
+{
+  if (file_matcher == NULL || per_cu->v.quick->mark)
+    {
+      int symtab_was_null =
+	(per_cu->v.quick->compunit_symtab == NULL);
+
+      dw2_instantiate_symtab (per_cu);
+
+      if (expansion_notify != NULL
+	  && symtab_was_null
+	  && per_cu->v.quick->compunit_symtab != NULL)
+	{
+	  expansion_notify (per_cu->v.quick->compunit_symtab);
+	}
+    }
+}
+
+static void
 dw2_expand_symtabs_matching
   (struct objfile *objfile,
    gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
@@ -4769,20 +4793,8 @@ dw2_expand_symtabs_matching
 	    }
 
 	  per_cu = dw2_get_cutu (cu_index);
-	  if (file_matcher == NULL || per_cu->v.quick->mark)
-	    {
-	      int symtab_was_null =
-		(per_cu->v.quick->compunit_symtab == NULL);
-
-	      dw2_instantiate_symtab (per_cu);
-
-	      if (expansion_notify != NULL
-		  && symtab_was_null
-		  && per_cu->v.quick->compunit_symtab != NULL)
-		{
-		  expansion_notify (per_cu->v.quick->compunit_symtab);
-		}
-	    }
+	  dw2_expand_symtabs_matching_one (per_cu, file_matcher,
+					   expansion_notify);
 	}
     }
 }
@@ -5394,20 +5406,8 @@ dw2_debug_names_expand_symtabs_matching
 
       struct dwarf2_per_cu_data *per_cu;
       while ((per_cu = iter.next ()) != NULL)
-	if (file_matcher == NULL || per_cu->v.quick->mark)
-	  {
-	    int symtab_was_null =
-	      (per_cu->v.quick->compunit_symtab == NULL);
-
-	    dw2_instantiate_symtab (per_cu);
-
-	    if (expansion_notify != NULL
-		&& symtab_was_null
-		&& per_cu->v.quick->compunit_symtab != NULL)
-	      {
-		expansion_notify (per_cu->v.quick->compunit_symtab);
-	      }
-	  }
+	dw2_expand_symtabs_matching_one (per_cu, file_matcher,
+					 expansion_notify);
     }
 }
 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [SCM]  users/jkratoch/indexcxx-nameswrite-namesread: .
@ 2017-04-29 22:28 jkratoch
  0 siblings, 0 replies; 5+ messages in thread
From: jkratoch @ 2017-04-29 22:28 UTC (permalink / raw)
  To: archer-commits

The branch, users/jkratoch/indexcxx-nameswrite-namesread has been updated
       via  0b6916bdf557d987df0636f024bc264a308045d7 (commit)
       via  86df21f7742980c9cb72c54e026a19aff4fd2b1c (commit)
       via  90ce9379105f3c780affda2e825b9e9f91cb4710 (commit)
       via  98bebcd98b51d05daf04b0d5c4d7f6e112597c57 (commit)
       via  a86ddb6afcc9712317c0a1894cfe2d92d21ce045 (commit)
       via  96c251d4cc5421589a3350e121ab23f00035f6bf (commit)
       via  fe7f71b504e6c06215166db70b7c4d25a95d8abc (commit)
       via  a941291cab71b9ac356e1c03968c177c03e602ab (commit)
       via  45ce1b47e4490993b5c1a04f4a8acb62d9ec5039 (commit)
       via  a93866c8bfd4ad4b32c81e73e6a73aa9d831d350 (commit)
       via  0749542484129e77a30f1089d6d671197be5035f (commit)
       via  deb1fa3edaf10c65d1f39951779927da955e3a57 (commit)
       via  b421c83cb866120ab347d60fda20fb0e2011be8c (commit)
       via  ef79d9a3c6ed1e3ccd466bae76956019a7c5d376 (commit)
       via  f8fdb78eafb3f70661f6e4a43beb004dde9e0921 (commit)
       via  9ccbfd7bc1b7228d67f2d4ca878224d493918264 (commit)
       via  76e75227c37bc058449a09fe5017eeb40cda0781 (commit)
       via  51046d9e60727cd6a4cfeae29a05ce2e1e394dc9 (commit)
       via  4023ae762ed9b52e4925242b705d0b3a50f6ed13 (commit)
       via  af43057bafa7260dbcc453d2acc47eb63b974c50 (commit)
       via  b091120773f8a740065b6449617cfbf1e0e789f4 (commit)
       via  6c401f72e979ddd7e2f890dcc88f93f683233d74 (commit)
       via  d0e449a1865c741c5e0c9d43a7d61a0621163aa7 (commit)
       via  434a40239548115cf04a80410e4f570f35c361c1 (commit)
       via  1670f9c1546818c4ffe02e8f460df1c1c4b1601d (commit)
       via  d6f48aed23d1004a4ed8ab3b2742b0bf7c838c1c (commit)
       via  428544e8ae6252a615a3100889f3df7d2c5483c4 (commit)
       via  750eaa47f10f48d19aacbec74ab6867da0164677 (commit)
       via  4621115fe529869e938dca605bb90190ea52316a (commit)
       via  b06b2c92c06cf100f259f218337d007ee0b1c884 (commit)
       via  4e3afec278d1fb55b983751d02119f65566bd094 (commit)
       via  d949ff5607b9f595e0eed2ff15fbe5eb84eb3a34 (commit)
       via  339053c29abac25e5f86a1ccccd4e8e3b2d362df (commit)
       via  7974a6050b6e2c44722a533e2d5d9131e7db00ff (commit)
       via  343b374c61f793f745b820c3cf61f69186566b18 (commit)
       via  e15c3eb45bdc8bd5717fd5ceddcc30c3de07b58f (commit)
       via  5b66fac4bad619766fb1a5f5179c08b67d48a8c5 (commit)
       via  72bc1d246686ff38ef01f5a35769ebdbe39f023c (commit)
       via  de9a3c4285fad1914929ee304ddaa26e76af8031 (commit)
       via  1b7a53f3f0494af0d33982631ca207c5360cfdf0 (commit)
       via  da3d25afa26476bf24247b8696fd00ab31f39db9 (commit)
       via  fba37edd96c8dc65a63bd5b4fef5366de45b165a (commit)
       via  1f78f649e868979d36490d7c2ea0b3d41abc5ec6 (commit)
       via  55bcecda5703eb4647165cb3ddb86aed63fd44d2 (commit)
       via  14f72d45a22f25f6d00a62fc03bcf9827df226f5 (commit)
       via  1425c41dcd68350d9be9670910c547cc7ab91e0e (commit)
       via  5c99fcf8031bcf96f2c948e9fc5d3b03c97f631a (commit)
       via  f2d830a50def7a00a911620a3e9c7d920e5ef0f0 (commit)
       via  76c20d54ca5042e11af9ddf5723cc24cf47736ec (commit)
       via  d7153c4ac333c9127c18efcf184607d368bb142d (commit)
       via  641338d8e9b62bde9672f13f0dca2324b61e46e2 (commit)
       via  21d68fcd0c2f9113369d860ee1e5841bfacc35ff (commit)
       via  a61d92b7bd4da998dd5d73e9205b4871f7c4825d (commit)
       via  7a81a73b2e5d00b76e15d97db7b8f0c9809ba1b7 (commit)
       via  ce8ad8721313d288a05a95b62d95ca43db584ebb (commit)
       via  97d343d40012b1030f1fd219f91efcab180fb3ef (commit)
       via  04b31182bf3f8a1a76e995bdfaaaab4c009b9cb2 (commit)
       via  d21f3ddb0d5f95aff5c769ae283ce5522262f48d (commit)
       via  740a463062bd5d1641bdfb639295dafe89341b9b (commit)
       via  3e6b644558f941d3fe482e15efbc53d8f39ef8b7 (commit)
       via  b41c5a85a734b9ca813d4a314b66ef4b4b4d1b11 (commit)
       via  23ec1e32b1ab714649a7c25e49b5d721fe3bd3db (commit)
       via  c46cec3a8cfe02fbe0f6c67ba53abc5369c5c659 (commit)
       via  bbdd9a6894d7875407da59d490faf5588163d21c (commit)
       via  e63d123268f23a4cbc45ee55fb6dbc7d84729da3 (commit)
       via  c185f580b2b3baf7cee762c8ab31ab6925b9534a (commit)
       via  19c4559475791cd70e319eaf5c1e23d23d9ae81e (commit)
       via  03def0812a9ee962d9dcfe9b0ba37783e58acfb8 (commit)
       via  4658f12e9c5ec0d2efb04f1688f6cd6bd9f1a47d (commit)
       via  c4ab9505b53cdc899506ed421fddb7e1f8faf7a3 (commit)
       via  919383ac718c2a3187ee2a9ad659daa22da26258 (commit)
       via  126124cc0f3f0417913bfd84d83e4e525b6facf9 (commit)
       via  be6a24d8eabdbeef32a9d79e81307af4491fcf56 (commit)
       via  d581dda88162831ebbd0757312fa93681d945327 (commit)
       via  0348fd79d4c32243d91e8a55f20f408a9b4ec20d (commit)
       via  6e3d1f0728d980a384c5aa63ce7f2ff3919c5024 (commit)
       via  adc1273cb27286452ed8b32c5ca3ea263b4854f0 (commit)
       via  debed3db4887483552103da36d180967ef0dca5f (commit)
       via  d28b6364b1fba1c0270c001f0d82a69e351e1922 (commit)
       via  b0b92aeb3828219075fce23543fb39fee8608e99 (commit)
       via  16c4d54a71d8052988ed9c8005a03a7f934245f4 (commit)
       via  b5c3668253b909fd1f5b011893a35bb8dfd3be9b (commit)
       via  5625a2864147f4d92b22edfeeab7600818988be2 (commit)
       via  23bcc18f470ee4364bd362a8b78c6c1415a9dadb (commit)
       via  a49abe0bb18e04d3a4b692995fcfae70cd470775 (commit)
       via  9e9821ddd80c0d0b3dda54d34cc8867f256d4583 (commit)
       via  0dc9a308a1ec9675bf6b33bae9e8b1faa0bad9ed (commit)
       via  0d1d688c31da7a2ec1c3a2d0287c92fc10fb11fb (commit)
       via  46aed380156e5dcac1091eb7ca986947f9b5247e (commit)
       via  e1ba30532c6de26a14404ab4919bb591e8da3eab (commit)
       via  7e52b3ad523accbd1892f3dea96c128841a6e302 (commit)
       via  2c010169bb8392c28f662e989311f8f23a001f74 (commit)
       via  f929084c142a492d676ff6c69d9183a301a5468c (commit)
       via  bb8fec0bdcdb16deb2cdadabfa2f80187feee5b8 (commit)
       via  e662f84f5d6d014746550ce3d3f623583c043ff0 (commit)
       via  1587442d37ee4266e54d59bfdc783574f0587aff (commit)
       via  534455547021f3262fa60d32cabb626af01692a3 (commit)
       via  8b353c47b70568ab9f0cfd619b7a19e931c2b0c8 (commit)
       via  957f6b39cab6cac0e4c54e650c7f75109544ac1d (commit)
       via  9ad8982091eeb76b380e459fe721aaeacf7b8f24 (commit)
       via  42354845ae5e00ec1c3519e1f2166b79a9533401 (commit)
       via  7034215fd6d99f275998f7f0f8a346ab35fcbee6 (commit)
       via  b02cd3e978e9273074f7cbe2ca1d5b372225a56d (commit)
       via  7eacd66b086cabb1daab20890d5481894d4f56b2 (commit)
       via  bce964aa6c777d236fbd641f2bc7bb931cfe4bf3 (commit)
       via  97e83a100aa8250be783304bfe0429761c6e6b6b (commit)
       via  f082820db966c79e47a143da774700055a1fad41 (commit)
       via  b43eea27e99f5fd270b3bec455054ea53ac700bb (commit)
       via  bf1554384b186b448904dbc13ee5374239c88520 (commit)
       via  10f489e57677e670bf980e93896762594e9ad908 (commit)
       via  0092b74da6d86185c4d0c0fa0f540b97647bf44a (commit)
       via  a14a62ddff9eadbb8a7ad101ab06b02e44b6c00a (commit)
       via  46b9c12945629fffb61001a8f13a37c96675c0b7 (commit)
       via  2e78302469502f4f8a98144b60c09d4d9b6438fd (commit)
      from  c29f36f52c1d6be48fa15d75ee66bc10161661b4 (commit)

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

- Log -----------------------------------------------------------------
commit 0b6916bdf557d987df0636f024bc264a308045d7
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sun Apr 30 00:27:58 2017 +0200

    .

commit 86df21f7742980c9cb72c54e026a19aff4fd2b1c
Merge: a86ddb6 90ce937
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sat Apr 29 23:58:50 2017 +0200

    Merge branch 'indexcxx-nameswrite' into indexcxx-nameswrite-namesread

commit a86ddb6afcc9712317c0a1894cfe2d92d21ce045
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sat Apr 29 23:56:51 2017 +0200

    .

commit 96c251d4cc5421589a3350e121ab23f00035f6bf
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sat Apr 29 23:25:34 2017 +0200

    .

commit fe7f71b504e6c06215166db70b7c4d25a95d8abc
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sat Apr 29 22:42:21 2017 +0200

    .

commit 1b7a53f3f0494af0d33982631ca207c5360cfdf0
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Apr 27 21:09:47 2017 +0200

    .

commit 0d1d688c31da7a2ec1c3a2d0287c92fc10fb11fb
Merge: 7e52b3a 46aed38
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Apr 24 22:30:54 2017 +0200

    Merge branch 'indexcxx-nameswrite' into indexcxx-nameswrite-namesread

commit 7e52b3ad523accbd1892f3dea96c128841a6e302
Merge: f929084 2c01016
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Apr 24 21:59:55 2017 +0200

    Merge branch 'indexcxx-nameswrite' into indexcxx-nameswrite-namesread

commit f929084c142a492d676ff6c69d9183a301a5468c
Merge: c29f36f bb8fec0
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Apr 24 21:38:53 2017 +0200

    Merge branch 'indexcxx-nameswrite' into indexcxx-nameswrite-namesread

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

Summary of changes:
 bfd/ChangeLog                                      |  191 +++
 bfd/bfd-in2.h                                      |   12 +
 bfd/compress.c                                     |   19 +-
 bfd/dwarf2.c                                       |    2 +-
 bfd/elf-bfd.h                                      |   30 +-
 bfd/elf-eh-frame.c                                 |  162 +++-
 bfd/elf-properties.c                               |   11 +-
 bfd/elf.c                                          |   67 +-
 bfd/elf32-i386.c                                   |  230 ++--
 bfd/elf32-m32c.c                                   |    3 +-
 bfd/elf32-msp430.c                                 |    3 +-
 bfd/elf32-ppc.c                                    |   38 +-
 bfd/elf64-ppc.c                                    |   28 +-
 bfd/elf64-x86-64.c                                 |  326 +++---
 bfd/elflink.c                                      |   48 +-
 bfd/elfxx-mips.c                                   |    2 +-
 bfd/elfxx-mips.h                                   |    3 +-
 bfd/elfxx-target.h                                 |    8 +-
 bfd/reloc.c                                        |   29 +-
 bfd/section.c                                      |   24 +-
 bfd/version.h                                      |    2 +-
 binutils/ChangeLog                                 |   80 ++
 binutils/ar.c                                      |   13 +-
 binutils/bucomm.c                                  |    3 +
 binutils/dwarf.c                                   |   98 +-
 binutils/objdump.c                                 |    7 +-
 binutils/readelf.c                                 |  175 ++-
 binutils/testsuite/binutils-all/mips/mips.exp      |    2 +
 .../testsuite/binutils-all/mips/mips16-alias.d     |   15 +
 .../testsuite/binutils-all/mips/mips16-alias.s     |   20 +
 .../testsuite/binutils-all/mips/mips16-noalias.d   |   16 +
 binutils/testsuite/binutils-all/note-2-32.s        |   32 +-
 binutils/testsuite/binutils-all/note-2-64.s        |   34 +-
 gas/ChangeLog                                      |  114 ++
 gas/config/tc-arm.c                                |   14 +-
 gas/config/tc-mips.c                               |  316 +++---
 gas/config/tc-sparc.c                              |    9 +-
 gas/symbols.c                                      |   16 +-
 gas/testsuite/gas/arc/b.d                          |    8 +-
 gas/testsuite/gas/arc/leave_enter.d                |   41 +-
 gas/testsuite/gas/arc/leave_enter.s                |   11 +
 gas/testsuite/gas/arc/noargs_hs.d                  |    2 +-
 .../arm/thumb2_ldr_immediate_highregs_armv6t2.d    |   24 +-
 .../arm/thumb2_ldr_immediate_highregs_armv6t2.s    |   16 +-
 gas/testsuite/gas/mips/mips.exp                    |    9 +
 gas/testsuite/gas/mips/mips16-branch-addend-4.d    |   30 +
 gas/testsuite/gas/mips/mips16-branch-addend-4.s    |   24 +
 gas/testsuite/gas/mips/mips16-branch-addend-5.d    |    4 +
 gas/testsuite/gas/mips/mips16-branch-addend-5.l    |   11 +
 gas/testsuite/gas/mips/mips16-branch-addend-5.s    |   24 +
 gas/testsuite/gas/mips/option-pic-relax-0.d        |   21 +
 gas/testsuite/gas/mips/option-pic-relax-0.s        |   15 +
 gas/testsuite/gas/mips/option-pic-relax-1.d        |   18 +
 gas/testsuite/gas/mips/option-pic-relax-1.s        |   12 +
 gas/testsuite/gas/mips/option-pic-relax-2.d        |   28 +
 gas/testsuite/gas/mips/option-pic-relax-2.l        |    2 +
 gas/testsuite/gas/mips/option-pic-relax-2.s        |   19 +
 gas/testsuite/gas/mips/option-pic-relax-3.d        |   20 +
 gas/testsuite/gas/mips/option-pic-relax-3.l        |    2 +
 gas/testsuite/gas/mips/option-pic-relax-3.s        |   16 +
 gas/testsuite/gas/mips/option-pic-relax-3a.d       |    9 +
 gas/testsuite/gas/mips/option-pic-relax-4.d        |   28 +
 gas/testsuite/gas/mips/option-pic-relax-4.l        |    2 +
 gas/testsuite/gas/mips/option-pic-relax-4.s        |   20 +
 gas/testsuite/gas/mips/option-pic-relax-5.d        |   20 +
 gas/testsuite/gas/mips/option-pic-relax-5.l        |    2 +
 gas/testsuite/gas/mips/option-pic-relax-5.s        |   17 +
 gas/testsuite/gas/sparc/call-relax-aout.d          |   19 +
 gas/testsuite/gas/sparc/call-relax.d               |   18 +
 gas/testsuite/gas/sparc/call-relax.s               |   10 +
 gas/testsuite/gas/sparc/sparc.exp                  |    4 +
 gdb/ChangeLog                                      |  440 +++++++
 gdb/aarch64-tdep.c                                 |    1 -
 gdb/ada-lang.c                                     |   19 +-
 gdb/ada-tasks.c                                    |    4 +-
 gdb/annotate.h                                     |   11 +
 gdb/arch-utils.c                                   |    9 +
 gdb/arch-utils.h                                   |    6 +
 gdb/arm-tdep.c                                     |    1 -
 gdb/auto-load.c                                    |   16 +-
 gdb/breakpoint.c                                   |   81 +-
 gdb/breakpoint.h                                   |  125 +-
 gdb/btrace.c                                       |   23 +-
 gdb/cli/cli-setshow.c                              |   15 +-
 gdb/common/common-defs.h                           |    1 +
 gdb/common/enum-flags.h                            |   10 -
 gdb/common/function-view.h                         |   40 +-
 gdb/common/poison.h                                |   87 ++
 gdb/common/traits.h                                |   43 +-
 gdb/cp-abi.c                                       |    5 +-
 gdb/disasm.c                                       |   19 +-
 gdb/doublest.c                                     |    3 +-
 gdb/dwarf2-frame.c                                 |   92 +--
 gdb/dwarf2-frame.h                                 |   58 +
 gdb/dwarf2read.c                                   | 1367 ++++++++++++++++----
 gdb/gdb_bfd.c                                      |    4 +-
 gdb/gdbarch.c                                      |   23 +
 gdb/gdbarch.h                                      |    7 +
 gdb/gdbarch.sh                                     |    3 +
 gdb/gdbtypes.c                                     |  106 +-
 gdb/gdbtypes.h                                     |   13 +-
 gdb/ia64-tdep.c                                    |   61 +-
 gdb/infcmd.c                                       |   14 +-
 gdb/inferior.c                                     |    5 +-
 gdb/linux-thread-db.c                              |    3 +-
 gdb/mi/mi-cmd-file.c                               |    5 +-
 gdb/mi/mi-cmd-info.c                               |   10 +-
 gdb/mi/mi-cmd-stack.c                              |   28 +-
 gdb/mi/mi-cmd-var.c                                |   21 +-
 gdb/mi/mi-interp.c                                 |   12 +-
 gdb/mi/mi-main.c                                   |  110 +--
 gdb/mi/mi-symbol-cmds.c                            |    8 +-
 gdb/mips-linux-nat.c                               |    5 +-
 gdb/mips-tdep.c                                    |    2 +-
 gdb/nds32-tdep.c                                   |   23 +-
 gdb/nto-tdep.c                                     |   35 +-
 gdb/osdata.c                                       |   29 +-
 gdb/probe.c                                        |    5 +-
 gdb/progspace.c                                    |    4 +-
 gdb/python/py-inferior.c                           |    7 +-
 gdb/record-btrace.c                                |   22 +-
 gdb/regcache.c                                     |  785 +++++++-----
 gdb/regcache.h                                     |  166 +++-
 gdb/remote.c                                       |   11 +-
 gdb/skip.c                                         |    5 +-
 gdb/solib-aix.c                                    |  110 +-
 gdb/solib-darwin.c                                 |   32 +-
 gdb/solib-dsbt.c                                   |   39 +-
 gdb/solib-frv.c                                    |  110 +-
 gdb/solib-svr4.c                                   |  115 +-
 gdb/solib-svr4.h                                   |   23 +
 gdb/solib-target.c                                 |  114 +-
 gdb/solib.c                                        |    6 +-
 gdb/solist.h                                       |   10 +-
 gdb/sparc-tdep.c                                   |   32 +
 gdb/stack.c                                        |   44 +-
 gdb/symfile.h                                      |    1 +
 gdb/target.c                                       |    5 +-
 gdb/testsuite/ChangeLog                            |   23 +
 gdb/testsuite/gdb.base/environ.exp                 |  302 +----
 gdb/testsuite/gdb.base/info-program.exp            |   45 +
 gdb/testsuite/gdb.cp/oranking.cc                   |   22 +
 gdb/testsuite/gdb.cp/oranking.exp                  |    9 +-
 gdb/testsuite/gdb.cp/rvalue-ref-overload.exp       |    1 -
 gdb/testsuite/gdb.cp/rvalue-ref-params.exp         |    1 -
 gdb/thread.c                                       |   30 +-
 gdb/tracepoint.c                                   |   44 +-
 gdb/windows-nat.c                                  |   52 +-
 gdb/xcoffread.c                                    |   69 +-
 gdb/xtensa-tdep.c                                  |   21 +-
 gold/ChangeLog                                     |    4 +
 gold/testsuite/plugin_section_order.c              |    1 +
 ld/ChangeLog                                       |   60 +
 ld/testsuite/config/default.exp                    |   37 +
 ld/testsuite/ld-elf/shared.exp                     |   86 ++
 ld/testsuite/ld-i386/i386.exp                      |    1 +
 ld/testsuite/ld-i386/pr12570a.d                    |    1 +
 ld/testsuite/ld-i386/pr12570b.d                    |    1 +
 ld/testsuite/ld-i386/tls.exp                       |  111 ++
 ld/testsuite/ld-i386/tlsdesc1a.c                   |   19 +
 ld/testsuite/ld-i386/tlsdesc1b.c                   |    8 +
 ld/testsuite/ld-i386/tlsdesc2.d                    |   10 +
 ld/testsuite/ld-i386/vxworks2.sd                   |    2 +-
 ld/testsuite/ld-ifunc/ifunc.exp                    |   99 ++
 ld/testsuite/ld-mips-elf/mips-elf.exp              |   10 +
 ld/testsuite/ld-mips-elf/pr21334.dd                |   10 +
 ld/testsuite/ld-mips-elf/pr21334.gd                |   11 +
 ld/testsuite/ld-mips-elf/pr21334.ld                |    9 +
 ld/testsuite/ld-mips-elf/pr21334.s                 |   20 +
 ld/testsuite/ld-sparc/tlssunbin64.dd               |    2 +-
 ld/testsuite/ld-sparc/tlssunnopic64.dd             |    2 +-
 ld/testsuite/ld-sparc/tlssunpic64.dd               |    2 +-
 ld/testsuite/ld-x86-64/no-plt-1e.nd                |    7 +
 ld/testsuite/ld-x86-64/no-plt.exp                  |    2 +-
 ld/testsuite/ld-x86-64/pr21038a.d                  |    6 +-
 ld/testsuite/ld-x86-64/pr21038c.d                  |    4 +-
 ld/testsuite/ld-x86-64/tls.exp                     |  116 ++
 ld/testsuite/ld-x86-64/tlsdesc1a.c                 |   19 +
 ld/testsuite/ld-x86-64/tlsdesc1b.c                 |    8 +
 ld/testsuite/ld-x86-64/tlsdesc2.d                  |   10 +
 ld/testsuite/ld-x86-64/x86-64.exp                  |    1 +
 opcodes/ChangeLog                                  |   27 +
 opcodes/aarch64-opc.c                              |    4 +-
 opcodes/arc-dis.c                                  |   19 +-
 opcodes/arc-opc.c                                  |   20 +-
 opcodes/arc-tbl.h                                  |    8 +-
 opcodes/mips-dis.c                                 |    3 +
 opcodes/mips16-opc.c                               |   12 +-
 sim/aarch64/ChangeLog                              |   11 +
 sim/aarch64/simulator.c                            |  290 ++---
 sim/testsuite/sim/aarch64/ChangeLog                |    9 +
 sim/testsuite/sim/aarch64/fcvtz.s                  |    1 +
 sim/testsuite/sim/aarch64/fstur.s                  |    1 +
 sim/testsuite/sim/aarch64/ldn_multiple.s           |  136 ++
 sim/testsuite/sim/aarch64/ldn_single.s             |    2 +
 sim/testsuite/sim/aarch64/ldnr.s                   |    2 +
 sim/testsuite/sim/aarch64/mla.s                    |    2 +
 sim/testsuite/sim/aarch64/mls.s                    |    2 +
 sim/testsuite/sim/aarch64/stn_multiple.s           |  171 +++
 sim/testsuite/sim/aarch64/stn_single.s             |   24 +-
 sim/testsuite/sim/aarch64/sumulh.s                 |    3 -
 sim/testsuite/sim/aarch64/uzp.s                    |    2 +
 202 files changed, 6527 insertions(+), 2877 deletions(-)
 create mode 100644 binutils/testsuite/binutils-all/mips/mips16-alias.d
 create mode 100644 binutils/testsuite/binutils-all/mips/mips16-alias.s
 create mode 100644 binutils/testsuite/binutils-all/mips/mips16-noalias.d
 create mode 100644 gas/testsuite/gas/mips/mips16-branch-addend-4.d
 create mode 100644 gas/testsuite/gas/mips/mips16-branch-addend-4.s
 create mode 100644 gas/testsuite/gas/mips/mips16-branch-addend-5.d
 create mode 100644 gas/testsuite/gas/mips/mips16-branch-addend-5.l
 create mode 100644 gas/testsuite/gas/mips/mips16-branch-addend-5.s
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-0.d
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-0.s
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-1.d
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-1.s
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-2.d
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-2.l
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-2.s
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-3.d
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-3.l
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-3.s
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-3a.d
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-4.d
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-4.l
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-4.s
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-5.d
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-5.l
 create mode 100644 gas/testsuite/gas/mips/option-pic-relax-5.s
 create mode 100644 gas/testsuite/gas/sparc/call-relax-aout.d
 create mode 100644 gas/testsuite/gas/sparc/call-relax.d
 create mode 100644 gas/testsuite/gas/sparc/call-relax.s
 create mode 100644 gdb/common/poison.h
 create mode 100644 gdb/testsuite/gdb.base/info-program.exp
 create mode 100644 ld/testsuite/ld-i386/tlsdesc1a.c
 create mode 100644 ld/testsuite/ld-i386/tlsdesc1b.c
 create mode 100644 ld/testsuite/ld-i386/tlsdesc2.d
 create mode 100644 ld/testsuite/ld-mips-elf/pr21334.dd
 create mode 100644 ld/testsuite/ld-mips-elf/pr21334.gd
 create mode 100644 ld/testsuite/ld-mips-elf/pr21334.ld
 create mode 100644 ld/testsuite/ld-mips-elf/pr21334.s
 create mode 100644 ld/testsuite/ld-x86-64/no-plt-1e.nd
 create mode 100644 ld/testsuite/ld-x86-64/tlsdesc1a.c
 create mode 100644 ld/testsuite/ld-x86-64/tlsdesc1b.c
 create mode 100644 ld/testsuite/ld-x86-64/tlsdesc2.d
 create mode 100644 sim/testsuite/sim/aarch64/ldn_multiple.s
 create mode 100644 sim/testsuite/sim/aarch64/stn_multiple.s

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ba2d134..dff6a59 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,194 @@
+2017-04-29  Alan Modra  <amodra@gmail.com>
+
+	PR 21432
+	* reloc.c (reloc_offset_in_range): New function.
+	(bfd_perform_relocation, bfd_install_relocation): Use it.
+	(_bfd_final_link_relocate): Likewise.
+
+2017-04-28  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
+	before using .plt.got.
+	* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
+
+2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
+	instead of "+=" to update 0.
+
+2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf32-i386.c (elf_i386_create_dynamic_sections): Create the
+	.plt.got section here.
+	(elf_i386_check_relocs): Don't create the .plt.got section.
+	* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
+	the .plt.got and .plt.bnd sections here.
+	(elf_x86_64_check_relocs): Don't create the .plt.got nor
+	.plt.bnd sections.
+
+2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
+	has_bnd_reloc.
+	(elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
+	(elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
+	(elf_x86_64_check_relocs): Don't set has_bnd_reloc.
+	(elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
+	has_bnd_reloc.
+
+2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf-bfd.h (elf_backend_data): Change setup_gnu_properties
+	to return bfd *.
+	(_bfd_elf_link_setup_gnu_properties): Return bfd *.
+	* elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
+	the first relocatable ELF input with GNU properties.
+
+2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
+	VxWorks for non-PIC.
+
+2017-04-27  Alan Modra  <amodra@gmail.com>
+
+	* elf-bfd.h (struct elf_backend_data): Make asection param of
+	elf_backend_eh_frame_address_size const.
+	(_bfd_elf_eh_frame_address_size): Likewise.
+	* elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
+	* elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
+	* elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
+	* elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
+	* elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
+	(next_cie_fde_offset): Constify params.
+	(offset_adjust, adjust_eh_frame_local_symbols): Likewise.
+
+2017-04-27  Alan Modra  <amodra@gmail.com>
+
+	* elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
+	(_bfd_elf_adjust_eh_frame_global_symbol): Declare.
+	* elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
+	aug_data_len.
+	(offset_adjust): New function.
+	(_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
+	(adjust_eh_frame_local_symbols): Likewise.
+	(_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
+	after changing anything.  Return true if anything changed.
+	* elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
+	_bfd_elf_adjust_eh_frame_global_symbol for globals.
+
+2017-04-27  Alan Modra  <amodra@gmail.com>
+
+	* elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
+	when force_local.
+
+2017-04-27  Alan Modra  <amodra@gmail.com>
+
+	* elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
+	(ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
+	(ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
+	(ppc_elf_relocate_section): Likewise.  Delete silly optimisation
+	for undef and undefweak dyn_relocs.
+	* elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
+	(ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
+	(allocate_got, allocate_dynrelocs): Likewise.
+	(ppc64_elf_relocate_section): Likewise.
+
+2017-04-26  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
+	DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
+	* elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
+	add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
+
+2017-04-26  Nick Clifton  <nickc@redhat.com>
+
+	PR binutils/21434
+	* reloc.c (bfd_perform_relocation): Check for a negative address
+	in the reloc.
+
+2017-04-26  Maciej W. Rozycki  <macro@imgtec.com>
+
+	PR ld/21334
+	* elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
+	member.
+	* elfxx-target.h [!elf_backend_always_renumber_dynsyms]
+	(elf_backend_always_renumber_dynsyms): Define.
+	(elfNN_bed): Initialize `always_renumber_dynsyms' member.
+	* elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
+	* elflink.c (bfd_elf_size_dynamic_sections): Also call
+	`_bfd_elf_link_renumber_dynsyms' if the backend has requested
+	it.
+	(bfd_elf_size_dynsym_hash_dynstr): Likewise.
+
+2017-04-26  Maciej W. Rozycki  <macro@imgtec.com>
+
+	* elflink.c (bfd_elf_size_dynamic_sections): Only call
+	`_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
+	sections have been created.
+
+2017-04-26  Nick Clifton  <nickc@redhat.com>
+
+	PR binutils/21431
+	* compress.c (bfd_init_section_compress_status): Check the return
+	value from bfd_malloc.
+
+2017-04-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
+	no_finish_dynamic_symbol.
+	(elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
+	0.
+	(elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
+	weak symbol, don't make it dynamic.
+	(elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
+	set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
+	relocation for GOT reference.
+	(elf_x86_64_finish_dynamic_symbol): Abort if
+	no_finish_dynamic_symbol isn't 0.
+
+2017-04-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR ld/21402
+	* elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
+	undefined weak symbol, don't make it dynamic.
+	(elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
+	set no_finish_dynamic_symbol and generate R_386_RELATIVE
+	relocation for R_386_GOT32.
+
+2017-04-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR ld/21425
+	* elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
+
+2017-04-23  Alan Modra  <amodra@gmail.com>
+
+	PR 21414
+	* section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
+	* elf.c (lcomm_sym): New.
+	(_bfd_elf_large_com_section): Use lcomm_sym section symbol.
+	* bfd-in2.h: Regenerate.
+
+2017-04-23  Alan Modra  <amodra@gmail.com>
+
+	PR 21412
+	* elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
+	parameters and comment.
+	(_bfd_elf_get_reloc_section): Delete.
+	(_bfd_elf_plt_get_reloc_section): Declare.
+	* elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
+	New functions.  Don't blindly skip over assumed .rel/.rela prefix.
+	Extracted from..
+	(_bfd_elf_get_reloc_section): ..here.  Delete.
+	(assign_section_numbers): Call elf_get_reloc_section.
+	* elf64-ppc.c (elf_backend_get_reloc_section): Define.
+	* elfxx-target.h (elf_backend_get_reloc_section): Update.
+
+2017-04-23  Alan Modra  <amodra@gmail.com>
+
+	PR 21409
+	* dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
+	no symbols.
+
 2017-04-21  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR ld/21402
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 1d73134..17a35c0 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -1839,6 +1839,18 @@ extern asection _bfd_std_section[4];
      { NULL }, { NULL }                                                \
     }
 
+/* We use a macro to initialize the static asymbol structures because
+   traditional C does not permit us to initialize a union member while
+   gcc warns if we don't initialize it.
+   the_bfd, name, value, attr, section [, udata]  */
+#ifdef __STDC__
+#define GLOBAL_SYM_INIT(NAME, SECTION) \
+  { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
+#else
+#define GLOBAL_SYM_INIT(NAME, SECTION) \
+  { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
+#endif
+
 void bfd_section_list_clear (bfd *);
 
 asection *bfd_get_section_by_name (bfd *abfd, const char *name);
diff --git a/bfd/compress.c b/bfd/compress.c
index f881c07..c854a20 100644
--- a/bfd/compress.c
+++ b/bfd/compress.c
@@ -542,7 +542,6 @@ bfd_init_section_compress_status (bfd *abfd, sec_ptr sec)
 {
   bfd_size_type uncompressed_size;
   bfd_byte *uncompressed_buffer;
-  bfd_boolean ret;
 
   /* Error if not opened for read.  */
   if (abfd->direction != read_direction
@@ -558,18 +557,18 @@ bfd_init_section_compress_status (bfd *abfd, sec_ptr sec)
   /* Read in the full section contents and compress it.  */
   uncompressed_size = sec->size;
   uncompressed_buffer = (bfd_byte *) bfd_malloc (uncompressed_size);
+  /* PR 21431 */
+  if (uncompressed_buffer == NULL)
+    return FALSE;
+
   if (!bfd_get_section_contents (abfd, sec, uncompressed_buffer,
 				 0, uncompressed_size))
-    ret = FALSE;
-  else
-    {
-      uncompressed_size = bfd_compress_section_contents (abfd, sec,
-							 uncompressed_buffer,
-							 uncompressed_size);
-      ret = uncompressed_size != 0;
-    }
+    return FALSE;
 
-  return ret;
+  uncompressed_size = bfd_compress_section_contents (abfd, sec,
+						     uncompressed_buffer,
+						     uncompressed_size);
+  return uncompressed_size != 0;
 }
 
 /*
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 132a674..0ef3e1f 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -4205,7 +4205,7 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
          looking up the function by section + offset uses the
          DW_AT_decl_line from the function DW_TAG_subprogram for the line,
          which will be the line of the function name.  */
-      if ((section->flags & SEC_CODE) == 0)
+      if (symbols != NULL && (section->flags & SEC_CODE) == 0)
 	{
 	  asymbol **tmp;
 
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index af377ee..4110ace 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -326,6 +326,12 @@ struct eh_cie_fde
 	 or 0 if the CIE doesn't have any.  */
       unsigned int personality_offset : 8;
 
+      /* Length of augmentation.  aug_str_len is the length of the
+	 string including null terminator.  aug_data_len is the length
+	 of the rest up to the initial insns.  */
+      unsigned int aug_str_len : 3;
+      unsigned int aug_data_len : 5;
+
       /* True if we have marked relocations associated with this CIE.  */
       unsigned int gc_mark : 1;
 
@@ -354,7 +360,7 @@ struct eh_cie_fde
       unsigned int merged : 1;
 
       /* Unused bits.  */
-      unsigned int pad1 : 17;
+      unsigned int pad1 : 9;
     } cie;
   } u;
   unsigned int reloc_index;
@@ -1285,7 +1291,7 @@ struct elf_backend_data
      that can't be determined for some reason.  The default definition
      goes by the bfd's EI_CLASS.  */
   unsigned int (*elf_backend_eh_frame_address_size)
-    (bfd *, asection *);
+    (bfd *, const asection *);
 
   /* These functions tell elf-eh-frame whether to attempt to turn
      absolute or lsda encodings into pc-relative ones.  The default
@@ -1360,8 +1366,10 @@ struct elf_backend_data
   bfd_size_type (*maybe_function_sym) (const asymbol *sym, asection *sec,
 				       bfd_vma *code_off);
 
-  /* Return the section which RELOC_SEC applies to.  */
-  asection *(*get_reloc_section) (asection *reloc_sec);
+  /* Given NAME, the name of a relocation section stripped of its
+     .rel/.rela prefix, return the section in ABFD to which the
+     relocations apply.  */
+  asection *(*get_reloc_section) (bfd *abfd, const char *name);
 
   /* Called to set the sh_flags, sh_link and sh_info fields of OSECTION which
      has a type >= SHT_LOOS.  Returns TRUE if the fields were initialised,
@@ -1433,7 +1441,7 @@ struct elf_backend_data
 				       elf_property *);
 
   /* Set up GNU properties.  */
-  void (*setup_gnu_properties) (struct bfd_link_info *);
+  bfd *(*setup_gnu_properties) (struct bfd_link_info *);
 
   /* Encoding used for compact EH tables.  */
   int (*compact_eh_encoding) (struct bfd_link_info *);
@@ -1529,6 +1537,10 @@ struct elf_backend_data
   /* Address of protected data defined in the shared library may be
      external, i.e., due to copy relocation.   */
   unsigned extern_protected_data : 1;
+
+  /* True if `_bfd_elf_link_renumber_dynsyms' must be called even for
+     static binaries.  */
+  unsigned always_renumber_dynsyms : 1;
 };
 
 /* Information about reloc sections associated with a bfd_elf_section_data
@@ -1975,7 +1987,7 @@ extern void bfd_elf_print_symbol
   (bfd *, void *, asymbol *, bfd_print_symbol_type);
 
 extern unsigned int _bfd_elf_eh_frame_address_size
-  (bfd *, asection *);
+  (bfd *, const asection *);
 extern bfd_byte _bfd_elf_encode_eh_address
   (bfd *abfd, struct bfd_link_info *info, asection *osec, bfd_vma offset,
    asection *loc_sec, bfd_vma loc_offset, bfd_vma *encoded);
@@ -2174,6 +2186,8 @@ extern bfd_boolean _bfd_elf_end_eh_frame_parsing
 extern bfd_boolean _bfd_elf_discard_section_eh_frame
   (bfd *, struct bfd_link_info *, asection *,
    bfd_boolean (*) (bfd_vma, void *), struct elf_reloc_cookie *);
+extern bfd_boolean _bfd_elf_adjust_eh_frame_global_symbol
+  (struct elf_link_hash_entry *, void *);
 extern bfd_boolean _bfd_elf_discard_section_eh_frame_hdr
   (bfd *, struct bfd_link_info *);
 extern bfd_vma _bfd_elf_eh_frame_section_offset
@@ -2448,7 +2462,7 @@ extern bfd_boolean _bfd_elf_is_function_type (unsigned int);
 extern bfd_size_type _bfd_elf_maybe_function_sym (const asymbol *, asection *,
 						  bfd_vma *);
 
-extern asection *_bfd_elf_get_reloc_section (asection *);
+extern asection *_bfd_elf_plt_get_reloc_section (bfd *, const char *);
 
 extern int bfd_elf_get_default_section_type (flagword);
 
@@ -2593,7 +2607,7 @@ extern bfd_boolean _bfd_elf_parse_gnu_properties
   (bfd *, Elf_Internal_Note *);
 extern elf_property * _bfd_elf_get_property
   (bfd *, unsigned int, unsigned int);
-extern void _bfd_elf_link_setup_gnu_properties
+extern bfd *_bfd_elf_link_setup_gnu_properties
   (struct bfd_link_info *);
 
 /* The linker may need to keep track of the number of relocs that it
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index 1743823..52ba9c6 100644
--- a/bfd/elf-eh-frame.c
+++ b/bfd/elf-eh-frame.c
@@ -326,9 +326,9 @@ size_of_output_cie_fde (struct eh_cie_fde *entry)
 /* Return the offset of the FDE or CIE after ENT.  */
 
 static unsigned int
-next_cie_fde_offset (struct eh_cie_fde *ent,
-		     struct eh_cie_fde *last,
-		     asection *sec)
+next_cie_fde_offset (const struct eh_cie_fde *ent,
+		     const struct eh_cie_fde *last,
+		     const asection *sec)
 {
   while (++ent < last)
     {
@@ -757,6 +757,7 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
 
 	  strcpy (cie->augmentation, (char *) buf);
 	  buf = (bfd_byte *) strchr ((char *) buf, '\0') + 1;
+	  this_inf->u.cie.aug_str_len = buf - start - 1;
 	  ENSURE_NO_RELOCS (buf);
 	  if (buf[0] == 'e' && buf[1] == 'h')
 	    {
@@ -845,6 +846,8 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
 		    goto free_no_table;
 		  }
 	    }
+	  this_inf->u.cie.aug_data_len
+	    = buf - start - 1 - this_inf->u.cie.aug_str_len;
 
 	  /* For shared libraries, try to get rid of as many RELATIVE relocs
 	     as possible.  */
@@ -1327,6 +1330,143 @@ find_merged_cie (bfd *abfd, struct bfd_link_info *info, asection *sec,
   return new_cie->cie_inf;
 }
 
+/* For a given OFFSET in SEC, return the delta to the new location
+   after .eh_frame editing.  */
+
+static bfd_signed_vma
+offset_adjust (bfd_vma offset, const asection *sec)
+{
+  struct eh_frame_sec_info *sec_info
+    = (struct eh_frame_sec_info *) elf_section_data (sec)->sec_info;
+  unsigned int lo, hi, mid;
+  struct eh_cie_fde *ent;
+  bfd_signed_vma delta;
+
+  lo = 0;
+  hi = sec_info->count;
+  if (hi == 0)
+    return 0;
+
+  while (lo < hi)
+    {
+      mid = (lo + hi) / 2;
+      ent = &sec_info->entry[mid];
+      if (offset < ent->offset)
+	hi = mid;
+      else if (mid + 1 >= hi)
+	break;
+      else if (offset >= ent[1].offset)
+	lo = mid + 1;
+      else
+	break;
+    }
+
+  if (!ent->removed)
+    delta = (bfd_vma) ent->new_offset - (bfd_vma) ent->offset;
+  else if (ent->cie && ent->u.cie.merged)
+    {
+      struct eh_cie_fde *cie = ent->u.cie.u.merged_with;
+      delta = ((bfd_vma) cie->new_offset + cie->u.cie.u.sec->output_offset
+	       - (bfd_vma) ent->offset - sec->output_offset);
+    }
+  else
+    {
+      /* Is putting the symbol on the next entry best for a deleted
+	 CIE/FDE?  */
+      struct eh_cie_fde *last = sec_info->entry + sec_info->count;
+      delta = ((bfd_vma) next_cie_fde_offset (ent, last, sec)
+	       - (bfd_vma) ent->offset);
+      return delta;
+    }
+
+  /* Account for editing within this CIE/FDE.  */
+  offset -= ent->offset;
+  if (ent->cie)
+    {
+      unsigned int extra
+	= ent->add_augmentation_size + ent->u.cie.add_fde_encoding;
+      if (extra == 0
+	  || offset <= 9u + ent->u.cie.aug_str_len)
+	return delta;
+      delta += extra;
+      if (offset <= 9u + ent->u.cie.aug_str_len + ent->u.cie.aug_data_len)
+	return delta;
+      delta += extra;
+    }
+  else
+    {
+      unsigned int ptr_size, width, extra = ent->add_augmentation_size;
+      if (offset <= 12 || extra == 0)
+	return delta;
+      ptr_size = (get_elf_backend_data (sec->owner)
+		  ->elf_backend_eh_frame_address_size (sec->owner, sec));
+      width = get_DW_EH_PE_width (ent->fde_encoding, ptr_size);
+      if (offset <= 8 + 2 * width)
+	return delta;
+      delta += extra;
+    }
+
+  return delta;
+}
+
+/* Adjust a global symbol defined in .eh_frame, so that it stays
+   relative to its original CIE/FDE.  It is assumed that a symbol
+   defined at the beginning of a CIE/FDE belongs to that CIE/FDE
+   rather than marking the end of the previous CIE/FDE.  This matters


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


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [SCM]  users/jkratoch/indexcxx-nameswrite-namesread: .
@ 2017-04-23 20:23 jkratoch
  0 siblings, 0 replies; 5+ messages in thread
From: jkratoch @ 2017-04-23 20:23 UTC (permalink / raw)
  To: archer-commits

The branch, users/jkratoch/indexcxx-nameswrite-namesread has been updated
       via  c29f36f52c1d6be48fa15d75ee66bc10161661b4 (commit)
      from  f037c45796b4b47969b17cab1355366eb461f2d1 (commit)

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

- Log -----------------------------------------------------------------
commit c29f36f52c1d6be48fa15d75ee66bc10161661b4
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sun Apr 23 22:23:16 2017 +0200

    .

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

Summary of changes:
 gdb/defs.h       |    6 ++
 gdb/dwarf2read.c |  218 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 gdb/elfread.c    |   28 +++++--
 gdb/psymtab.h    |    1 +
 gdb/symfile.h    |    3 +-
 gdb/xcoffread.c  |    1 +
 6 files changed, 243 insertions(+), 14 deletions(-)

First 500 lines of diff:
diff --git a/gdb/defs.h b/gdb/defs.h
index a0b586f..79648ca 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -724,6 +724,12 @@ extern int (*deprecated_ui_load_progress_hook) (const char *section,
 extern void initialize_progspace (void);
 extern void initialize_inferiors (void);
 
+// From elfread.c
+
+extern const struct sym_fns elf_sym_fns_lazy_psyms;
+extern const struct sym_fns elf_sym_fns_gdb_index;
+extern const struct sym_fns elf_sym_fns_debug_names;
+
 /* * Special block numbers */
 
 enum block_enum
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index f778a31..c3acae1 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -240,6 +240,7 @@ struct dwarf2_per_objfile
   struct dwarf2_section_info frame;
   struct dwarf2_section_info eh_frame;
   struct dwarf2_section_info gdb_index;
+  struct dwarf2_section_info debug_names;
 
   VEC (dwarf2_section_info_def) *types;
 
@@ -355,6 +356,7 @@ static const struct dwarf2_debug_sections dwarf2_elf_names =
   { ".debug_frame", ".zdebug_frame" },
   { ".eh_frame", NULL },
   { ".gdb_index", ".zgdb_index" },
+  { ".debug_names", ".zdebug_names" },
   23
 };
 
@@ -1016,6 +1018,7 @@ struct dwz_file
   struct dwarf2_section_info line;
   struct dwarf2_section_info macro;
   struct dwarf2_section_info gdb_index;
+  struct dwarf2_section_info debug_names;
 
   /* The dwz's BFD.  */
   bfd *dwz_bfd;
@@ -2421,6 +2424,11 @@ dwarf2_locate_sections (bfd *abfd, asection *sectp, void *vnames)
       dwarf2_per_objfile->gdb_index.s.section = sectp;
       dwarf2_per_objfile->gdb_index.size = bfd_get_section_size (sectp);
     }
+  else if (section_is_p (sectp->name, &names->debug_names))
+    {
+      dwarf2_per_objfile->debug_names.s.section = sectp;
+      dwarf2_per_objfile->debug_names.size = bfd_get_section_size (sectp);
+    }
 
   if ((bfd_get_section_flags (abfd, sectp) & (SEC_LOAD | SEC_ALLOC))
       && bfd_section_vma (abfd, sectp) == 0)
@@ -2617,6 +2625,11 @@ locate_dwz_sections (bfd *abfd, asection *sectp, void *arg)
       dwz_file->gdb_index.s.section = sectp;
       dwz_file->gdb_index.size = bfd_get_section_size (sectp);
     }
+  else if (section_is_p (sectp->name, &dwarf2_elf_names.debug_names))
+    {
+      dwz_file->debug_names.s.section = sectp;
+      dwz_file->debug_names.size = bfd_get_section_size (sectp);
+    }
 }
 
 /* Open the separate '.dwz' debug file, if needed.  Return NULL if
@@ -3329,8 +3342,106 @@ to use the section anyway."),
   return 1;
 }
 
+/* A helper function that reads the .debug_names from SECTION and fills
+   in MAP.  FILENAME is the name of the file containing the section;
+   it is used for error reporting.
+
+   CU_LIST, CU_LIST_ELEMENTS, TYPES_LIST, and TYPES_LIST_ELEMENTS are
+   out parameters that are filled in with information about the CU and
+   TU lists in the section.
+
+   Returns 1 if all went well, 0 otherwise.  */
+
+static int
+read_debug_names_from_section (struct objfile *objfile,
+			       const char *filename,
+			       struct dwarf2_section_info *section,
+			       struct mapped_index *map,
+			       const gdb_byte **cu_list,
+			       offset_type *cu_list_elements,
+			       const gdb_byte **types_list,
+			       offset_type *types_list_elements)
+{
+  const gdb_byte *addr;
+  offset_type version;
+  offset_type *metadata;
+  int i;
+
+  if (dwarf2_section_empty_p (section))
+    return 0;
+
+  /* Older elfutils strip versions could keep the section in the main
+     executable while splitting it for the separate debug info file.  */
+  if ((get_section_flags (section) & SEC_HAS_CONTENTS) == 0)
+    return 0;
+
+  dwarf2_read_section (objfile, section);
+
+  addr = section->buffer;
+  /* Version check.  */
+  version = MAYBE_SWAP (*(offset_type *) addr);
+  /* Versions earlier than 3 emitted every copy of a psymbol.  This
+     causes the index to behave very poorly for certain requests.  Version 3
+     contained incomplete addrmap.  So, it seems better to just ignore such
+     indices.  */
+  if (version < 4)
+    {
+      static int warning_printed = 0;
+      if (!warning_printed)
+	{
+	  warning (_("Skipping obsolete .gdb_index section in %s."),
+		   filename);
+	  warning_printed = 1;
+	}
+      return 0;
+    }
+  /* Version 7 indices generated by gold refer to the CU for a symbol instead
+     of the TU (for symbols coming from TUs),
+     http://sourceware.org/bugzilla/show_bug.cgi?id=15021.
+     Plus gold-generated indices can have duplicate entries for global symbols,
+     http://sourceware.org/bugzilla/show_bug.cgi?id=15646.
+     These are just performance bugs, and we can't distinguish gdb-generated
+     indices from gold-generated ones, so issue no warning here.  */
+
+  /* Indexes with higher version than the one supported by GDB may be no
+     longer backward compatible.  */
+  if (version > 8)
+    return 0;
+
+  map->version = version;
+  map->total_size = section->size;
+
+  metadata = (offset_type *) (addr + sizeof (offset_type));
+
+  i = 0;
+  *cu_list = addr + MAYBE_SWAP (metadata[i]);
+  *cu_list_elements = ((MAYBE_SWAP (metadata[i + 1]) - MAYBE_SWAP (metadata[i]))
+		       / 8);
+  ++i;
+
+  *types_list = addr + MAYBE_SWAP (metadata[i]);
+  *types_list_elements = ((MAYBE_SWAP (metadata[i + 1])
+			   - MAYBE_SWAP (metadata[i]))
+			  / 8);
+  ++i;
+
+  map->address_table = addr + MAYBE_SWAP (metadata[i]);
+  map->address_table_size = (MAYBE_SWAP (metadata[i + 1])
+			     - MAYBE_SWAP (metadata[i]));
+  ++i;
+
+  map->symbol_table = (offset_type *) (addr + MAYBE_SWAP (metadata[i]));
+  map->symbol_table_slots = ((MAYBE_SWAP (metadata[i + 1])
+			      - MAYBE_SWAP (metadata[i]))
+			     / (2 * sizeof (offset_type)));
+  ++i;
+
+  map->constant_pool = (char *) (addr + MAYBE_SWAP (metadata[i]));
+
+  return 1;
+}
 
-/* Read the index file.  If everything went ok, initialize the "quick"
+/* Read .gdb_index.  If everything went ok, initialize the "quick"
    elements of all the CUs and return 1.  Otherwise, return 0.  */
 
 static int
@@ -3406,6 +3517,81 @@ dwarf2_read_index (struct objfile *objfile)
   return 1;
 }
 
+/* Read .debug_names.  If everything went ok, initialize the "quick"
+   elements of all the CUs and return true.  Otherwise, return false.  */
+
+static bool
+dwarf2_read_debug_names (struct objfile *objfile)
+{
+  struct mapped_index local_map, *map;
+  const gdb_byte *cu_list, *types_list, *dwz_list = NULL;
+  offset_type cu_list_elements, types_list_elements, dwz_list_elements = 0;
+  struct dwz_file *dwz;
+
+  if (!read_debug_names_from_section (objfile, objfile_name (objfile),
+				      &dwarf2_per_objfile->debug_names,
+				      &local_map, &cu_list, &cu_list_elements,
+				      &types_list, &types_list_elements))
+    return false;
+
+  /* Don't use the index if it's empty.  */
+  if (local_map.symbol_table_slots == 0)
+    return false;
+
+  /* If there is a .dwz file, read it so we can get its CU list as
+     well.  */
+  dwz = dwarf2_get_dwz_file ();
+  if (dwz != NULL)
+    {
+      struct mapped_index dwz_map;
+      const gdb_byte *dwz_types_ignore;
+      offset_type dwz_types_elements_ignore;
+
+      if (!read_debug_names_from_section (objfile,
+					  bfd_get_filename (dwz->dwz_bfd),
+					  &dwz->debug_names, &dwz_map,
+					  &dwz_list, &dwz_list_elements,
+					  &dwz_types_ignore,
+					  &dwz_types_elements_ignore))
+	{
+	  warning (_("could not read '.debug_names' section from %s; skipping"),
+		   bfd_get_filename (dwz->dwz_bfd));
+	  return false;
+	}
+    }
+
+  create_cus_from_index (objfile, cu_list, cu_list_elements, dwz_list,
+			 dwz_list_elements);
+
+  if (types_list_elements)
+    {
+      struct dwarf2_section_info *section;
+
+      /* We can only handle a single .debug_types when we have an
+	 index.  */
+      if (VEC_length (dwarf2_section_info_def, dwarf2_per_objfile->types) != 1)
+	return false;
+
+      section = VEC_index (dwarf2_section_info_def,
+			   dwarf2_per_objfile->types, 0);
+
+      create_signatured_type_table_from_index (objfile, section, types_list,
+					       types_list_elements);
+    }
+
+  create_addrmap_from_index (objfile, &local_map);
+
+  map = XOBNEW (&objfile->objfile_obstack, struct mapped_index);
+  *map = local_map;
+
+  dwarf2_per_objfile->index_table = map;
+  dwarf2_per_objfile->using_index = 1;
+  dwarf2_per_objfile->quick_file_names_table =
+    create_quick_file_names_table (dwarf2_per_objfile->n_comp_units);
+
+  return true;
+}
+
 /* A helper for the "quick" functions which sets the global
    dwarf2_per_objfile according to OBJFILE.  */
 
@@ -4350,10 +4536,29 @@ const struct quick_symbol_functions dwarf2_gdb_index_functions =
   dw2_map_symbol_filenames
 };
 
+const struct quick_symbol_functions dwarf2_debug_names_functions =
+{
+  dw2_has_symbols,
+  dw2_find_last_source_symtab,
+  dw2_forget_cached_source_info,
+  dw2_map_symtabs_matching_filename,
+  dw2_lookup_symbol,
+  dw2_print_stats,
+  dw2_dump,
+  dw2_relocate,
+  dw2_expand_symtabs_for_function,
+  dw2_expand_all_symtabs,
+  dw2_expand_symtabs_with_fullname,
+  dw2_map_matching_symbols,
+  dw2_expand_symtabs_matching,
+  dw2_find_pc_sect_compunit_symtab,
+  dw2_map_symbol_filenames
+};
+
 /* Initialize for reading DWARF for this objfile.  Return 0 if this
    file will use psymtabs, or 1 if using the GNU index.  */
 
-int
+const sym_fns &
 dwarf2_initialize_objfile (struct objfile *objfile)
 {
   /* If we're about to read full symbols, don't bother with the
@@ -4382,13 +4587,16 @@ dwarf2_initialize_objfile (struct objfile *objfile)
       /* Return 1 so that gdb sees the "quick" functions.  However,
 	 these functions will be no-ops because we will have expanded
 	 all symtabs.  */
-      return 1;
+      return elf_sym_fns_gdb_index;
     }
 
+  if (dwarf2_read_debug_names (objfile))
+    return elf_sym_fns_debug_names;
+
   if (dwarf2_read_index (objfile))
-    return 1;
+    return elf_sym_fns_gdb_index;
 
-  return 0;
+  return elf_sym_fns_lazy_psyms;
 }
 
 \f
diff --git a/gdb/elfread.c b/gdb/elfread.c
index fba2026..6f992d7 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -50,10 +50,6 @@
 
 extern void _initialize_elfread (void);
 
-/* Forward declarations.  */
-extern const struct sym_fns elf_sym_fns_gdb_index;
-extern const struct sym_fns elf_sym_fns_lazy_psyms;
-
 /* The struct elfinfo is available only during ELF symbol table and
    psymtab reading.  It is destroyed at the completion of psymtab-reading.
    It's local to elf_symfile_read.  */
@@ -1237,10 +1233,7 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
 	 information present in OBJFILE.  If there is such debug info present
 	 never use .gdb_index.  */
 
-      if (!objfile_has_partial_symbols (objfile)
-	  && dwarf2_initialize_objfile (objfile))
-	objfile_set_sym_fns (objfile, &elf_sym_fns_gdb_index);
-      else
+      if (objfile_has_partial_symbols (objfile))
 	{
 	  /* It is ok to do this even if the stabs reader made some
 	     partial symbols, because OBJF_PSYMTABS_READ has not been
@@ -1248,6 +1241,8 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
 	     when needed.  */
 	  objfile_set_sym_fns (objfile, &elf_sym_fns_lazy_psyms);
 	}
+      else
+	objfile_set_sym_fns (objfile, &dwarf2_initialize_objfile (objfile));
     }
   /* If the file has its own symbol tables it has no separate debug
      info.  `.dynsym'/`.symtab' go to MSYMBOLS, `.debug_info' goes to
@@ -1436,6 +1431,23 @@ const struct sym_fns elf_sym_fns_gdb_index =
   &dwarf2_gdb_index_functions
 };
 
+/* The same as elf_sym_fns, but not registered and uses the
+   DWARF-specific .debug_names index rather than psymtab.  */
+const struct sym_fns elf_sym_fns_debug_names =
+{
+  elf_new_init,			/* init anything gbl to entire symab */
+  elf_symfile_init,		/* read initial info, setup for sym_red() */
+  elf_symfile_read,		/* read a symbol file into symtab */
+  NULL,				/* sym_read_psymbols */
+  elf_symfile_finish,		/* finished with file, cleanup */
+  default_symfile_offsets,	/* Translate ext. to int. relocatin */
+  elf_symfile_segments,		/* Get segment information from a file.  */
+  NULL,
+  default_symfile_relocate,	/* Relocate a debug section.  */
+  &elf_probe_fns,		/* sym_probe_fns */
+  &dwarf2_debug_names_functions
+};
+
 /* STT_GNU_IFUNC resolver vector to be installed to gnu_ifunc_fns_p.  */
 
 static const struct gnu_ifunc_fns elf_gnu_ifunc_fns =
diff --git a/gdb/psymtab.h b/gdb/psymtab.h
index f0c9ae7..17ceb22 100644
--- a/gdb/psymtab.h
+++ b/gdb/psymtab.h
@@ -33,6 +33,7 @@ extern struct bcache *psymbol_bcache_get_bcache (struct psymbol_bcache *);
 extern const struct quick_symbol_functions psym_functions;
 
 extern const struct quick_symbol_functions dwarf2_gdb_index_functions;
+extern const struct quick_symbol_functions dwarf2_debug_names_functions;
 
 /* Ensure that the partial symbols for OBJFILE have been loaded.  If
    VERBOSE is non-zero, then this will print a message when symbols
diff --git a/gdb/symfile.h b/gdb/symfile.h
index ab536e8..5a3a0e5 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -606,6 +606,7 @@ struct dwarf2_debug_sections {
   struct dwarf2_section_names frame;
   struct dwarf2_section_names eh_frame;
   struct dwarf2_section_names gdb_index;
+  struct dwarf2_section_names debug_names;
   /* This field has no meaning, but exists solely to catch changes to
      this structure which are not reflected in some instance.  */
   int sentinel;
@@ -625,7 +626,7 @@ extern void dwarf2_get_section_info (struct objfile *,
 				     asection **, const gdb_byte **,
 				     bfd_size_type *);
 
-extern int dwarf2_initialize_objfile (struct objfile *);
+extern const sym_fns &dwarf2_initialize_objfile (struct objfile *);
 extern void dwarf2_build_psymtabs (struct objfile *);
 extern void dwarf2_build_frame_info (struct objfile *);
 
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 4f22cec..fd61e90 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -174,6 +174,7 @@ static const struct dwarf2_debug_sections dwarf2_xcoff_names = {
   { ".dwframe", NULL },
   { NULL, NULL }, /* eh_frame */
   { NULL, NULL }, /* gdb_index */
+  { NULL, NULL }, /* debug_names */
   23
 };
 


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


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

end of thread, other threads:[~2017-05-24  8:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-24  8:46 [SCM] users/jkratoch/indexcxx-nameswrite-namesread: jkratoch
  -- strict thread matches above, loose matches on Subject: below --
2017-05-22 21:41 jkratoch
2017-04-30 18:28 jkratoch
2017-04-29 22:28 jkratoch
2017-04-23 20:23 jkratoch

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