This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [RFC] [GOLD] s390 -fsplit-stack support.


> 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.

> I think it's reasonable to expect that a target implementation of
> do_calls_non_split may need prelocs, reloc_count, and Output_file*, so
> I don't have a problem adding those to the signatures of
> Sized_relobj_file::split_stack_adjust,
> Sized_relobj_file::split_stack_adjust_reltype,
> Target::calls_non_split, and Target::do_calls_non_split.

With this patch, we won't have to add the Output_file pointer to these
function signatures.

-cary


2015-12-11  Cary Coutant  <ccoutant@gmail.com>

gold/
        * object.cc (Sized_relobj_file::Sized_relobj_file): Initialize
        output_views_.
        * object.h (Object::get_output_view): New function.
        (Object::do_get_output_view): New function.
        (Sized_relobj_file::do_get_output_view): New function.
        (Sized_relobj_file::output_views_): New data member.
        * reloc.cc: (Sized_relobj_file::do_relocate): Store pointer to
        output views in class object.
        (Sized_relobj_file::do_get_output_view): New function.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]