diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 810bdcf57b..da675abb68 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -2100,13 +2100,11 @@ dbx_end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
       /* If we know our own starting text address, then walk through all other
          psymtabs for this objfile, and if any didn't know their ending text
          address, set it to our starting address.  Take care to not set our
-         own ending address to our starting address, nor to set addresses on
-         `dependency' files that have both textlow and texthigh zero.  */
+         own ending address to our starting address.  */
 
       ALL_OBJFILE_PSYMTABS (objfile, p1)
       {
-	if (PSYMTAB_TEXTHIGH (p1) == 0 && PSYMTAB_TEXTLOW (p1) != 0
-	    && p1 != pst)
+	if (!p1->texthigh_valid && p1->textlow_valid && p1 != pst)
 	  SET_PSYMTAB_TEXTHIGH (p1, PSYMTAB_TEXTLOW (pst));
       }
     }
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 09bdb28088..fb8318a831 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -2764,7 +2764,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
 
 			  /* Kludge for Irix 5.2 zero fh->adr.  */
 			  if (!relocatable
-			      && (PSYMTAB_TEXTLOW (pst) == 0
+			      && (!pst->textlow_valid
 				  || procaddr < PSYMTAB_TEXTLOW (pst)))
 			    SET_PSYMTAB_TEXTLOW (pst, procaddr);
 			  if (high > PSYMTAB_TEXTHIGH (pst))
@@ -3543,7 +3543,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
 
 		  /* Kludge for Irix 5.2 zero fh->adr.  */
 		  if (!relocatable
-		      && (PSYMTAB_TEXTLOW (pst) == 0
+		      && (!pst->textlow_valid
 			  || procaddr < PSYMTAB_TEXTLOW (pst)))
 		    SET_PSYMTAB_TEXTLOW (pst, procaddr);
 
@@ -3742,7 +3742,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
          other cases.  */
       save_pst = fdr_to_pst[f_idx].pst;
       if (save_pst != NULL
-	  && PSYMTAB_TEXTLOW (save_pst) != 0
+	  && save_pst->textlow_valid
 	  && !(objfile->flags & OBJF_REORDERED))
 	{
 	  ALL_OBJFILE_PSYMTABS (objfile, pst)
@@ -3957,7 +3957,7 @@ psymtab_to_symtab_1 (struct objfile *objfile,
   /* Do nothing if this is a dummy psymtab.  */
 
   if (pst->n_global_syms == 0 && pst->n_static_syms == 0
-      && PSYMTAB_TEXTLOW (pst) == 0 && PSYMTAB_TEXTHIGH (pst) == 0)
+      && !pst->textlow_valid && !pst->texthigh_valid)
     return;
 
   /* Now read the symbols for this symtab.  */
diff --git a/gdb/psympriv.h b/gdb/psympriv.h
index fa175736ce..8ce3c6b2a9 100644
--- a/gdb/psympriv.h
+++ b/gdb/psympriv.h
@@ -125,7 +125,9 @@ struct partial_symtab
   /* Range of text addresses covered by this file; texthigh is the
      beginning of the next section.  Do not use if PSYMTABS_ADDRMAP_SUPPORTED
      is set.  Do not refer directly to these fields.  Instead, use the
-     accessor macros.  */
+     accessor macros.  The validity of these fields is determined by the
+     textlow_valid and texthigh_valid fields; these are located later
+     in this structure for better packing.  */
 
   CORE_ADDR textlow_;
   CORE_ADDR texthigh_;
@@ -211,6 +213,11 @@ struct partial_symtab
 
   ENUM_BITFIELD (psymtab_search_status) searched_flag : 2;
 
+  /* Validity of the textlow_ and texthigh_ fields.  */
+
+  unsigned int textlow_valid : 1;
+  unsigned int texthigh_valid : 1;
+
   /* Pointer to compunit eventually allocated for this source file, 0 if
      !readin or if we haven't looked for the symtab after it was readin.  */
 
@@ -239,8 +246,28 @@ struct partial_symtab
 #define PSYMTAB_TEXTLOW(PST) ((PST)->textlow_ + 0)
 #define PSYMTAB_TEXTHIGH(PST) ((PST)->texthigh_ + 0)
 
-#define SET_PSYMTAB_TEXTLOW(PST, V) (((PST)->textlow_) = (V))
-#define SET_PSYMTAB_TEXTHIGH(PST, V) (((PST)->texthigh_) = (V))
+/* Set the "textlow" field on the partial symbol table, and mark the
+   field as valid.  */
+
+static inline void
+set_psymtab_textlow (struct partial_symtab *pst, CORE_ADDR low)
+{
+  pst->textlow_ = low;
+  pst->textlow_valid = 1;
+}
+
+/* Set the "texthigh" field on the partial symbol table, and mark the
+   field as valid.  */
+
+static inline void
+set_psymtab_texthigh (struct partial_symtab *pst, CORE_ADDR high)
+{
+  pst->texthigh_ = high;
+  pst->texthigh_valid = 1;
+}
+
+#define SET_PSYMTAB_TEXTLOW(PST, V) set_psymtab_textlow ((PST), (V))
+#define SET_PSYMTAB_TEXTHIGH(PST, V) set_psymtab_texthigh ((PST), (V))
 
 /* Add any kind of symbol to a partial_symbol vector.  */
 
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 49716a56e5..25df119d51 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -2353,7 +2353,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
 
 			if (highval > PSYMTAB_TEXTHIGH (pst))
 			  SET_PSYMTAB_TEXTHIGH (pst, highval);
-			if (PSYMTAB_TEXTLOW (pst) == 0
+			if (!pst->textlow_valid
 			    || symbol.n_value < PSYMTAB_TEXTLOW (pst))
 			  SET_PSYMTAB_TEXTLOW (pst, symbol.n_value);
 		      }
