This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] [RFC] [GOLD] s390 -fsplit-stack support.
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Marcin KoÅcielnicki <koriakin at 0x04 dot net>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Fri, 11 Dec 2015 13:10:45 -0800
- Subject: Re: [PATCH] [RFC] [GOLD] s390 -fsplit-stack support.
- Authentication-results: sourceware.org; auth=none
- References: <1449674134-27969-1-git-send-email-koriakin at 0x04 dot net> <CAJimCsEE+wNm-jMKAMGbRynY6sVNDTNXhtjvHz=QyB1tmqa3fA at mail dot gmail dot com>
> 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.