diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index a30c8ae4f03..fe984a06b98 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -4853,31 +4853,41 @@
 @end defun
 
 @findex gdb.lookup_static_symbol
-@defun gdb.lookup_static_symbol (name @r{[}, domain@r{]})
-This function searches for a global symbol with static linkage by name.
-The search scope can be restricted to by the domain argument.
+@defun gdb.lookup_static_symbol (name @r{[}, block @r{[}, domain@r{]]})
+This function searches for a global symbol with static linkage by
+name.
 
 @var{name} is the name of the symbol.  It must be a string.
-The optional @var{domain} argument restricts the search to the domain type.
-The @var{domain} argument must be a domain constant defined in the @code{gdb}
-module and described later in this chapter.
-
-The result is a @code{gdb.Symbol} object or @code{None} if the symbol
-is not found.
-
-Note that this function will not find function-scoped static variables. To look
-up such variables, iterate over the variables of the function's
-@code{gdb.Block} and check that @code{block.addr_class} is
-@code{gdb.SYMBOL_LOC_STATIC}.
 
 There can be multiple global symbols with static linkage with the same
 name.  This function will only return the first matching symbol that
 it finds.  Which symbol is found depends on where @value{GDBN} is
 currently stopped, as @value{GDBN} will first search for matching
-symbols in the current object file, and then search all other object
-files.  If the application is not yet running then @value{GDBN} will
-search all object files in the order they appear in the debug
-information.
+symbols in the global static scope of the current object file, and
+then search all other object files.  This corresponds to the behaviour
+you would see from the CLI if you tried to print the symbol by name.
+
+If the application is not yet running then @value{GDBN} will search
+all object files in the order they appear in the debug information.
+
+The optional @var{domain} argument restricts the search to the domain
+type.  The @var{domain} argument must be a domain constant defined in
+the @code{gdb} module and described later in this chapter.
+
+The optional @var{block} argument can be used to change which global
+static scope @value{GDBN} will search first.  If @var{block} is not
+given, or is passed the value @code{None} then @value{GDBN} will first
+search the global static scope corresponding to the current block.  If
+@var{block} is passed a @code{gdb.Block} then @value{GDBN} will first
+search the global static scope corresponding to the supplied block.
+
+The result is a @code{gdb.Symbol} object or @code{None} if the symbol
+is not found.
+
+Note that this function will not find function-scoped static
+variables. To look up such variables, iterate over the variables of
+the function's @code{gdb.Block} and check that @code{block.addr_class}
+is @code{gdb.SYMBOL_LOC_STATIC}.
 @end defun
 
 @findex gdb.lookup_global_symbol
diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c
index 647c54b0a5b..24b3f6f4376 100644
--- a/gdb/python/py-symbol.c
+++ b/gdb/python/py-symbol.c
@@ -473,19 +473,20 @@ gdbpy_lookup_global_symbol (PyObject *self, PyObject *args, PyObject *kw)
 }
 
 /* Implementation of
-   gdb.lookup_static_symbol (name [, domain]) -> symbol or None.  */
+   gdb.lookup_static_symbol (name [, block] [, domain]) -> symbol or None.  */
 
 PyObject *
 gdbpy_lookup_static_symbol (PyObject *self, PyObject *args, PyObject *kw)
 {
   const char *name;
   int domain = VAR_DOMAIN;
-  static const char *keywords[] = { "name", "domain", NULL };
+  static const char *keywords[] = { "name", "block", "domain", NULL };
   struct symbol *symbol = NULL;
+  PyObject *block_obj = NULL;
   PyObject *sym_obj;
 
-  if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s|i", keywords, &name,
-					&domain))
+  if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s|O|i", keywords, &name,
+					&block_obj, &domain))
     return NULL;
 
   /* In order to find static symbols associated with the "current" object
@@ -493,16 +494,22 @@ gdbpy_lookup_static_symbol (PyObject *self, PyObject *args, PyObject *kw)
      we can acquire a current block.  If this fails however, then we still
      want to search all static symbols, so don't throw an exception just
      yet.  */
-  const struct block *block = NULL;
-  try
-    {
-      struct frame_info *selected_frame
-	= get_selected_frame (_("No frame selected."));
-      block = get_frame_block (selected_frame, NULL);
-    }
-  catch (const gdb_exception &except)
+  const struct block *block = nullptr;
+  if (block_obj)
+    block = block_object_to_block (block_obj);
+
+  if (block == nullptr)
     {
-      /* Nothing.  */
+      try
+	{
+	  struct frame_info *selected_frame
+	    = get_selected_frame (_("No frame selected."));
+	  block = get_frame_block (selected_frame, NULL);
+	}
+      catch (const gdb_exception &except)
+	{
+	  /* Nothing.  */
+	}
     }
 
   try
diff --git a/gdb/testsuite/gdb.python/py-symbol.exp b/gdb/testsuite/gdb.python/py-symbol.exp
index ea41297f54f..0ffe07df5a8 100644
--- a/gdb/testsuite/gdb.python/py-symbol.exp
+++ b/gdb/testsuite/gdb.python/py-symbol.exp
@@ -87,6 +87,10 @@ if ![runto_main] then {
 
 global hex decimal
 
+# Grab the value of $pc, we'll use this later.
+set pc_val_file_1 [get_integer_valueof "\$pc" 0 \
+		       "get value of \$pc in main file"]
+
 gdb_breakpoint [gdb_get_line_number "Block break here."]
 gdb_continue_to_breakpoint "Block break here."
 gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "Get Frame" 0
@@ -116,7 +120,18 @@ gdb_test "python print (func.addr_class == gdb.SYMBOL_LOC_BLOCK)" "True" "test f
 gdb_breakpoint "function_in_other_file"
 gdb_continue_to_breakpoint "function_in_other_file"
 gdb_test "python print (gdb.lookup_static_symbol ('rr').value ())" "99" \
-    "print value of rr from other file"
+    "print value of rr from other file, don't pass a block value"
+gdb_test "python print (gdb.lookup_static_symbol ('rr', None).value ())" "99" \
+    "print value of rr from other file, pass block value of None"
+
+# Test gdb.lookup_static_symbol passing a block parameter
+set pc_val_file_2 [get_integer_valueof "\$pc" 0 \
+		       "get \$pc in other file"]
+gdb_test "python print (gdb.lookup_static_symbol ('rr', gdb.current_progspace ().block_for_pc (${pc_val_file_2})).value ())" "99" \
+    "print value of rr from other file, pass block for other file"
+gdb_test "python print (gdb.lookup_static_symbol ('rr', gdb.current_progspace ().block_for_pc (${pc_val_file_1})).value ())" "42" \
+    "print value of rr from other file, pass block for main file"
+
 gdb_test "python print (gdb.lookup_static_symbols ('rr')\[0\].value ())" "99" \
     "print value of gdb.lookup_static_symbols ('rr')\[0\], from the other file"
 gdb_test "python print (gdb.lookup_static_symbols ('rr')\[1\].value ())" "42" \
@@ -131,7 +146,14 @@ gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "Get Frame" 0
 # Check that we find the static sybol local to this file over the
 # static symbol from the second source file.
 gdb_test "python print (gdb.lookup_static_symbol ('rr').value ())" "42" \
-    "print value of rr from main file"
+    "print value of rr from main file, passing no block parameter"
+gdb_test "python print (gdb.lookup_static_symbol ('rr', None).value ())" "42" \
+    "print value of rr from main file, passing None block parameter"
+gdb_test "python print (gdb.lookup_static_symbol ('rr', gdb.current_progspace ().block_for_pc (${pc_val_file_2})).value ())" "99" \
+    "print value of rr from main file, pass block for other file"
+gdb_test "python print (gdb.lookup_static_symbol ('rr', gdb.current_progspace ().block_for_pc (${pc_val_file_1})).value ())" "42" \
+    "print value of rr from main file, pass block for main file"
+
 gdb_test "python print (gdb.lookup_static_symbols ('rr')\[0\].value ())" "99" \
     "print value of gdb.lookup_static_symbols ('rr')\[0\], from the main file"
 gdb_test "python print (gdb.lookup_static_symbols ('rr')\[1\].value ())" "42" \
