diff --git a/src/abg-reader.cc b/src/abg-reader.cc
index ef9b44e5..e801f174 100644
--- a/src/abg-reader.cc
+++ b/src/abg-reader.cc
@@ -3852,6 +3852,19 @@ build_subrange_type(read_context&	ctxt,
 	length = strtoull(CHAR_STR(s), NULL, 0);
     }
 
+  int64_t lower_bound = 0, upper_bound = 0;
+  bool bounds_present = false;
+  if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "lower-bound"))
+    {
+      lower_bound = strtoll(CHAR_STR(s), NULL, 0);
+      s = XML_NODE_GET_ATTRIBUTE(node, "upper-bound");
+      if (!string(CHAR_STR(s)).empty())
+	upper_bound = strtoll(CHAR_STR(s), NULL, 0);
+      bounds_present = true;
+      ABG_ASSERT(is_infinite
+		 || (length == (uint64_t) upper_bound - lower_bound));
+    }
+
   string underlying_type_id;
   if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "type-id"))
     underlying_type_id = CHAR_STR(s);
@@ -3872,8 +3885,19 @@ build_subrange_type(read_context&	ctxt,
   array_type_def::subrange_type::bound_value min_bound;
   if (!is_infinite)
     if (length > 0)
+      // By default, if no 'lower-bound/upper-bound' attributes are
+      // set, we assume that the lower bound is 0 and the upper bound
+      // is length - 1.
       max_bound.set_signed(length - 1);
 
+  if (bounds_present)
+    {
+      // So lower_bound/upper_bound are set.  Let's set them rather
+      // than assume that mind_bound is zero.
+      min_bound.set_signed(lower_bound);
+      max_bound.set_signed(upper_bound);
+    }
+
   array_type_def::subrange_sptr p
     (new array_type_def::subrange_type(ctxt.get_environment(),
 				       name, min_bound, max_bound,
diff --git a/src/abg-writer.cc b/src/abg-writer.cc
index 7f0e5e35..4370fe37 100644
--- a/src/abg-writer.cc
+++ b/src/abg-writer.cc
@@ -2783,6 +2783,16 @@ write_array_subrange_type(const array_type_def::subrange_sptr&	decl,
 
   o << "'";
 
+  if (decl->get_lower_bound())
+    {
+      ABG_ASSERT(decl->is_infinite()
+		 || (decl->get_length() ==
+		     (uint64_t) (decl->get_upper_bound()
+				 - decl->get_lower_bound())));
+      o << " lower-bound='" << decl->get_lower_bound() << "' upper-bound='"
+	<< decl->get_upper_bound() << "'";
+    }
+
   type_base_sptr underlying_type = decl->get_underlying_type();
   if (underlying_type)
     {
diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
index 52d1148b..7ca7439f 100644
--- a/tests/data/Makefile.am
+++ b/tests/data/Makefile.am
@@ -1763,6 +1763,9 @@ test-diff-pkg/PR24690/flatpak-libs-debuginfo-1.4.0-1.fc30.x86_64.rpm \
 test-diff-pkg/mesa-libGLU-9.0.1-3.fc33.x86_64.rpm \
 test-diff-pkg/mesa-libGLU-debuginfo-9.0.1-3.fc33.x86_64.rpm \
 test-diff-pkg/mesa-libGLU-9.0.1-3.fc33.x86_64.self-check-report-0.txt \
+test-diff-pkg/hdf5-1.10.6-2.fc33.x86_64.rpm \
+test-diff-pkg/hdf5-1.10.6-2.fc33.x86_64.self-check-report-0.txt \
+test-diff-pkg/hdf5-debuginfo-1.10.6-2.fc33.x86_64.rpm \
 \
 test-fedabipkgdiff/dbus-glib-0.104-3.fc23.x86_64.rpm \
 test-fedabipkgdiff/dbus-glib-debuginfo-0.104-3.fc23.x86_64.rpm \
diff --git a/tests/data/test-diff-pkg/hdf5-1.10.6-2.fc33.x86_64.rpm b/tests/data/test-diff-pkg/hdf5-1.10.6-2.fc33.x86_64.rpm
new file mode 100644
index 0000000000000000000000000000000000000000..d6e09b65a1443a3c1a2273664c48048ae2942dee
GIT binary patch
diff --git a/tests/data/test-diff-pkg/hdf5-1.10.6-2.fc33.x86_64.self-check-report-0.txt b/tests/data/test-diff-pkg/hdf5-1.10.6-2.fc33.x86_64.self-check-report-0.txt
new file mode 100644
index 00000000..21d8a604
--- /dev/null
+++ b/tests/data/test-diff-pkg/hdf5-1.10.6-2.fc33.x86_64.self-check-report-0.txt
@@ -0,0 +1,24 @@
+==== SELF CHECK SUCCEEDED for 'libhdf5.so.103.2.0' ====
+==== SELF CHECK SUCCEEDED for 'libhdf5_cpp.so.103.2.0' ====
+==== SELF CHECK SUCCEEDED for 'libhdf5_fortran.so.102.0.1' ====
+==== SELF CHECK SUCCEEDED for 'h5diff' ====
+==== SELF CHECK SUCCEEDED for 'h5dump' ====
+==== SELF CHECK SUCCEEDED for 'h5repack' ====
+==== SELF CHECK SUCCEEDED for 'h5import' ====
+==== SELF CHECK SUCCEEDED for 'h5ls' ====
+==== SELF CHECK SUCCEEDED for 'h5perf_serial' ====
+==== SELF CHECK SUCCEEDED for 'h5stat' ====
+==== SELF CHECK SUCCEEDED for 'gif2h5' ====
+==== SELF CHECK SUCCEEDED for 'h5watch' ====
+==== SELF CHECK SUCCEEDED for 'h52gif' ====
+==== SELF CHECK SUCCEEDED for 'h5jam' ====
+==== SELF CHECK SUCCEEDED for 'h5format_convert' ====
+==== SELF CHECK SUCCEEDED for 'h5copy' ====
+==== SELF CHECK SUCCEEDED for 'libhdf5hl_fortran.so.100.0.5' ====
+==== SELF CHECK SUCCEEDED for 'h5clear' ====
+==== SELF CHECK SUCCEEDED for 'h5unjam' ====
+==== SELF CHECK SUCCEEDED for 'h5mkgrp' ====
+==== SELF CHECK SUCCEEDED for 'libhdf5_hl.so.100.1.3' ====
+==== SELF CHECK SUCCEEDED for 'h5debug' ====
+==== SELF CHECK SUCCEEDED for 'h5repart' ====
+==== SELF CHECK SUCCEEDED for 'libhdf5_hl_cpp.so.100.1.4' ====
diff --git a/tests/data/test-diff-pkg/hdf5-debuginfo-1.10.6-2.fc33.x86_64.rpm b/tests/data/test-diff-pkg/hdf5-debuginfo-1.10.6-2.fc33.x86_64.rpm
new file mode 100644
index 0000000000000000000000000000000000000000..87ee913d8ca54b70728738791bd6c464eef59123
GIT binary patch
diff --git a/tests/test-diff-pkg.cc b/tests/test-diff-pkg.cc
index 5524b0fa..a7115b60 100644
--- a/tests/test-diff-pkg.cc
+++ b/tests/test-diff-pkg.cc
@@ -634,6 +634,18 @@ static InOutSpec in_out_specs[] =
     "data/test-diff-pkg/mesa-libGLU-9.0.1-3.fc33.x86_64.self-check-report-0.txt",
     "output/test-diff-pkg/mesa-libGLU-9.0.1-3.fc33.x86_64.self-check-report-0.txt"
   },
+  {
+    "data/test-diff-pkg/hdf5-1.10.6-2.fc33.x86_64.rpm",
+    "data/test-diff-pkg/hdf5-1.10.6-2.fc33.x86_64.rpm",
+    "--self-check",
+    "",
+    "data/test-diff-pkg/hdf5-debuginfo-1.10.6-2.fc33.x86_64.rpm",
+    "data/test-diff-pkg/hdf5-debuginfo-1.10.6-2.fc33.x86_64.rpm",
+    "",
+    "",
+    "data/test-diff-pkg/hdf5-1.10.6-2.fc33.x86_64.self-check-report-0.txt",
+    "output/test-diff-pkg/hdf5-1.10.6-2.fc33.x86_64.self-check-report-0.txt"
+  },
 #endif // WITH_RPM_4_15
 #endif //WITH_RPM
 
