This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Preserve segment virtual address only if needed
On Thu, Nov 23, 2006 at 03:23:53PM -0800, H. J. Lu wrote:
> On Fri, Nov 24, 2006 at 09:15:41AM +1030, Alan Modra wrote:
> > On Thu, Nov 23, 2006 at 08:54:10AM -0800, H. J. Lu wrote:
> > > + /* If the first section is removed, there is no need to preserve
> > > + segment virtual address. */
> > > + if (!first_section || first_section->output_section != NULL)
> >
> > This test looks wrong.
>
> The first segment may contain program header so that the first section
> in the first segment may not align with the first segment. In that
> case, even if the first section in the first segment is removed, we
> may still want to preserve segment virtual address. In that case,
> first_section is NULL. We reset the segment virtual address only if
> the first section, which is alignd with the segment, is removed.
Fine. But why "|| first_section->output_section != NULL"? Shouldn't
that be "|| first_section->output_section == NULL"?
--
Alan Modra
IBM OzLabs - Linux Technology Centre