[PATCH] elf: Set rel_from_abs to 1 for __ehdr_start

Alan Modra amodra@gmail.com
Fri Nov 13 22:57:24 GMT 2020


On Fri, Nov 13, 2020 at 05:34:23AM -0800, H.J. Lu wrote:
> On Thu, Nov 12, 2020 at 9:06 PM Alan Modra <amodra@gmail.com> wrote:
> >
> > On Thu, Nov 12, 2020 at 04:56:41AM -0800, H.J. Lu via Binutils wrote:
> > > --- a/ld/ldelf.c
> > > +++ b/ld/ldelf.c
> > > @@ -1590,6 +1590,7 @@ ldelf_before_allocation (char *audit, char *depaudit,
> > >                     (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
> > >                     sizeof ehdr_start_save_u);
> > >             ehdr_start->type = bfd_link_hash_defined;
> > > +           ehdr_start->ldscript_def = 1;
> > >             ehdr_start->u.def.section = bfd_abs_section_ptr;
> > >             ehdr_start->u.def.value = 0;
> > >           }
> >
> > I suspect this may interact badly with DEFINED (__ehdr_start) in a
> > script.  Can you check that please?
> >
> 
> Here is the updated patch to set rel_from_abs to 1 instead.  OK
> for master?

Yes thanks, that makes more sense.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list