This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [GOLD] Adjusting --emit-relocs output
On Tue, Sep 04, 2012 at 12:55:22PM -0700, Ian Lance Taylor wrote:
> > @@ -4626,9 +4626,7 @@ Output_segment::first_section_load_addre
> > ++p)
> > {
> > if ((*p)->is_section())
> > - return ((*p)->has_load_address()
> > - ? (*p)->load_address()
> > - : (*p)->address());
> > + return static_cast<Output_section*>(*p);
>
> Don't use a static_cast here. Instead, return (*p)->output_section().
> That may require you to change the return type to be a const pointer.
> And that will give you trouble elsewhere. You may need two versions
> of this function: one a const member function and one not.
>
> OK with that change.
It turned out OK to return a non-const pointer, so I went with that.
--
Alan Modra
Australia Development Lab, IBM