This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB 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] solib-svr4.c (svr4_exec_displacement): Rename outer "displacement".


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

commit 8f61baf802b597c11fec288f840d9f7feb18eb0e
Author: Doug Evans <dje@google.com>
Date:   Fri Apr 17 10:57:45 2015 -0700

    solib-svr4.c (svr4_exec_displacement): Rename outer "displacement".
    
    gdb/ChangeLog:
    
    	* solib-svr4.c (svr4_exec_displacement): Rename outer "displacement"
    	to "exec_displacement" to avoid confusion with inner use of the name.

Diff:
---
 gdb/ChangeLog    |  5 +++++
 gdb/solib-svr4.c | 12 ++++++------
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 273c6b3..69e5c48 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-17  Doug Evans  <dje@google.com>
+
+	* solib-svr4.c (svr4_exec_displacement): Rename outer "displacement"
+	to "exec_displacement" to avoid confusion with inner use of the name.
+
 2015-04-17  Pedro Alves  <palves@redhat.com>
 
 	* arm-linux-nat.c (arm_linux_can_use_hw_breakpoint): Return zero
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index dd93847..909dfb7 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -2560,7 +2560,7 @@ svr4_exec_displacement (CORE_ADDR *displacementp)
 {
   /* ENTRY_POINT is a possible function descriptor - before
      a call to gdbarch_convert_from_func_ptr_addr.  */
-  CORE_ADDR entry_point, displacement;
+  CORE_ADDR entry_point, exec_displacement;
 
   if (exec_bfd == NULL)
     return 0;
@@ -2575,9 +2575,9 @@ svr4_exec_displacement (CORE_ADDR *displacementp)
   if (target_auxv_search (&current_target, AT_ENTRY, &entry_point) <= 0)
     return 0;
 
-  displacement = entry_point - bfd_get_start_address (exec_bfd);
+  exec_displacement = entry_point - bfd_get_start_address (exec_bfd);
 
-  /* Verify the DISPLACEMENT candidate complies with the required page
+  /* Verify the EXEC_DISPLACEMENT candidate complies with the required page
      alignment.  It is cheaper than the program headers comparison below.  */
 
   if (bfd_get_flavour (exec_bfd) == bfd_target_elf_flavour)
@@ -2589,7 +2589,7 @@ svr4_exec_displacement (CORE_ADDR *displacementp)
 	   p_offset % p_align == p_vaddr % p_align
 	 Kernel is free to load the executable with lower alignment.  */
 
-      if ((displacement & (elf->minpagesize - 1)) != 0)
+      if ((exec_displacement & (elf->minpagesize - 1)) != 0)
 	return 0;
     }
 
@@ -2910,11 +2910,11 @@ svr4_exec_displacement (CORE_ADDR *displacementp)
 
       printf_unfiltered (_("Using PIE (Position Independent Executable) "
 			   "displacement %s for \"%s\".\n"),
-			 paddress (target_gdbarch (), displacement),
+			 paddress (target_gdbarch (), exec_displacement),
 			 bfd_get_filename (exec_bfd));
     }
 
-  *displacementp = displacement;
+  *displacementp = exec_displacement;
   return 1;
 }


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