diff --git a/gdb/remote.c b/gdb/remote.c
index e2d21c65b70..966bacd7fb5 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1864,16 +1864,6 @@ remote_target::get_remote_state ()
   return &m_remote_state;
 }
 
-/* Fetch the remote exec-file from the current program space.  */
-
-static const std::string &
-get_remote_exec_file ()
-{
-  const remote_exec_file_info &info
-    = get_remote_exec_file_info (current_program_space);
-  return info.first;
-}
-
 /* Set the remote exec file for PSPACE.  */
 
 static void
@@ -1900,7 +1890,9 @@ set_remote_exec_file_cb (const std::string &filename)
 static const std::string &
 get_remote_exec_file_cb ()
 {
-  return get_remote_exec_file ();
+  const remote_exec_file_info &info
+    = get_remote_exec_file_info (current_program_space);
+  return info.first;
 }
 
 /* Implement the "show remote exec-file" command.  */
