To get the view of the section containing the parameter block, I'd
suggest adding a new Object method:
[public:]
const unsigned char*
Object::get_output_view(Output_file* of, unsigned int shndx,
section_size_type* plen)
{ return this->do_get_output_view(of, shndx, plen); }
...
After thinking about this a bit, I'd prefer to save a pointer to the
output views in the Sized_relobj object, so get_output_view() can
access the pre-computed view directly, rather than trying to recompute
it. I've added a simple RAII class to make sure the saved pointer gets
NULL'd when the output views go out of scope.
Try the attached patch. If this works for you, I'll go ahead and
commit it as preparation for your patch.