PEL: Allow shrinking of a UserData section

Add a shrink() function to the UserData class (with a virtual version of
it in the Section base class) that will shrink the class to a new size.

This is done so that when UserData sections are added to PELs the
sections can be shrunk if necessary to keep the PEL under the maximum
size, which is 16KB.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Iade52dee8a110f7805c40aa50d6e5df45db050bf
diff --git a/extensions/openpower-pels/section.hpp b/extensions/openpower-pels/section.hpp
index 96a1aad..183268c 100644
--- a/extensions/openpower-pels/section.hpp
+++ b/extensions/openpower-pels/section.hpp
@@ -71,6 +71,25 @@
         return std::nullopt;
     }
 
+    /**
+     * @brief Shrinks a PEL section
+     *
+     * If this is even possible for a section depends on which section
+     * it is.  If a section cannot be shrunk, it doesn't need to implement
+     * shrink so it will just return false, meaning no shrinking was done.
+     *
+     * If a section can be shrunk, this function will be overridden in that
+     * class.
+     *
+     * @param[in] newSize - The new size, in bytes, to shrink to
+     *
+     * @return bool - true if successful, false else
+     */
+    virtual bool shrink(size_t newSize)
+    {
+        return false;
+    }
+
   protected:
     /**
      * @brief Returns the flattened size of the section header