This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb/binutils-2_29-branch] Fix build with GCC 4.2


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=23f436288793a6d129533e3f8ca9a3d36accff61

commit 23f436288793a6d129533e3f8ca9a3d36accff61
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 5 09:04:51 2017 -0700

    Fix build with GCC 4.2
    
    Fix GCC 4.2 warnings like:
    
    cc1: warnings being treated as errors
    binutils-gdb/bfd/dwarf2.c:1844: warning: declaration of â??timeâ?? shadows a global declaration
    /usr/include/time.h:187: warning: shadowed declaration is here
    binutils-gdb/bfd/dwarf2.c: In function â??line_info_add_file_nameâ??:
    binutils-gdb/bfd/dwarf2.c:1854: warning: declaration of â??timeâ?? shadows a global declaration
    /usr/include/time.h:187: warning: shadowed declaration is here
    
    bfd/
    
    	* dwarf2.c (line_info_add_include_dir_stub): Replace time with
    	xtime.
    	(line_info_add_file_name): Likewise.
    	(decode_line_info): Likewise.
    
    binutils/
    
    	* dwarf.c (display_debug_names): Replace index with xindex.
    
    (cherry picked from commit 1d827a720c9659cc8d54059ccc3efae24b875c03)

Diff:
---
 bfd/ChangeLog      |  7 +++++++
 bfd/dwarf2.c       | 13 +++++++------
 binutils/ChangeLog |  4 ++++
 binutils/dwarf.c   | 16 +++++++++-------
 4 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 3b26b0e..f32b38e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2017-07-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* dwarf2.c (line_info_add_include_dir_stub): Replace time with
+	xtime.
+	(line_info_add_file_name): Likewise.
+	(decode_line_info): Likewise.
+
 2017-07-04  Tristan Gingold  <gingold@adacore.com>
 
 	* version.m4: Bump version to 2.28.90
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 5e674d4..04a2585 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -1841,7 +1841,7 @@ line_info_add_include_dir (struct line_info_table *table, char *cur_dir)
 static bfd_boolean
 line_info_add_include_dir_stub (struct line_info_table *table, char *cur_dir,
 				unsigned int dir ATTRIBUTE_UNUSED,
-				unsigned int time ATTRIBUTE_UNUSED,
+				unsigned int xtime ATTRIBUTE_UNUSED,
 				unsigned int size ATTRIBUTE_UNUSED)
 {
   return line_info_add_include_dir (table, cur_dir);
@@ -1851,7 +1851,8 @@ line_info_add_include_dir_stub (struct line_info_table *table, char *cur_dir,
 
 static bfd_boolean
 line_info_add_file_name (struct line_info_table *table, char *cur_file,
-			 unsigned int dir, unsigned int time, unsigned int size)
+			 unsigned int dir, unsigned int xtime,
+			 unsigned int size)
 {
   if ((table->num_files % FILE_ALLOC_CHUNK) == 0)
     {
@@ -1869,7 +1870,7 @@ line_info_add_file_name (struct line_info_table *table, char *cur_file,
 
   table->files[table->num_files].name = cur_file;
   table->files[table->num_files].dir = dir;
-  table->files[table->num_files].time = time;
+  table->files[table->num_files].time = xtime;
   table->files[table->num_files].size = size;
   table->num_files++;
   return TRUE;
@@ -2206,18 +2207,18 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
       /* Read file name table.  */
       while ((cur_file = read_string (abfd, line_ptr, line_end, &bytes_read)) != NULL)
 	{
-	  unsigned int dir, time, size;
+	  unsigned int dir, xtime, size;
 
 	  line_ptr += bytes_read;
 
 	  dir = _bfd_safe_read_leb128 (abfd, line_ptr, &bytes_read, FALSE, line_end);
 	  line_ptr += bytes_read;
-	  time = _bfd_safe_read_leb128 (abfd, line_ptr, &bytes_read, FALSE, line_end);
+	  xtime = _bfd_safe_read_leb128 (abfd, line_ptr, &bytes_read, FALSE, line_end);
 	  line_ptr += bytes_read;
 	  size = _bfd_safe_read_leb128 (abfd, line_ptr, &bytes_read, FALSE, line_end);
 	  line_ptr += bytes_read;
 
-	  if (!line_info_add_file_name (table, cur_file, dir, time, size))
+	  if (!line_info_add_file_name (table, cur_file, dir, xtime, size))
 	    goto fail;
 	}
 
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 6daa1a4..b5cd595 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,7 @@
+2017-07-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* dwarf.c (display_debug_names): Replace index with xindex.
+
 2017-07-04  Tristan Gingold  <gingold@adacore.com>
 
 	* configure: Regenerate.
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 70aa011..5cada37 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -7887,13 +7887,14 @@ display_debug_names (struct dwarf_section *section, void *file)
 	  abbrevptr += bytes_read;
 	  for (;;)
 	    {
-	      const dwarf_vma index = read_uleb128 (abbrevptr, &bytes_read,
-						    abbrev_table_end);
+	      const dwarf_vma xindex = read_uleb128 (abbrevptr,
+						     &bytes_read,
+						     abbrev_table_end);
 	      abbrevptr += bytes_read;
 	      const dwarf_vma form = read_uleb128 (abbrevptr, &bytes_read,
 						   abbrev_table_end);
 	      abbrevptr += bytes_read;
-	      if (index == 0 && form == 0)
+	      if (xindex == 0 && form == 0)
 		break;
 	    }
 	}
@@ -7965,17 +7966,18 @@ display_debug_names (struct dwarf_section *section, void *file)
 		printf (" %s", get_TAG_name (dwarf_tag));
 	      for (;;)
 		{
-		  const dwarf_vma index = read_uleb128 (abbrevptr, &bytes_read,
-							abbrev_table_end);
+		  const dwarf_vma xindex = read_uleb128 (abbrevptr,
+							 &bytes_read,
+							 abbrev_table_end);
 		  abbrevptr += bytes_read;
 		  const dwarf_vma form = read_uleb128 (abbrevptr, &bytes_read,
 						       abbrev_table_end);
 		  abbrevptr += bytes_read;
-		  if (index == 0 && form == 0)
+		  if (xindex == 0 && form == 0)
 		    break;
 
 		  if (tagno >= 0)
-		    printf (" %s", get_IDX_name (index));
+		    printf (" %s", get_IDX_name (xindex));
 		  entryptr = read_and_display_attr_value (0, form, 0, entryptr,
 							  unit_end, 0, 0,
 							  offset_size,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]