Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Oct 2018 20:03:52 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Alexander Richardson <arichardson@freebsd.org>
Cc:        Michael.Tuexen@macmic.franken.de, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r339876 - head/libexec/rtld-elf
Message-ID:  <20181030180352.GO5335@kib.kiev.ua>
In-Reply-To: <CA%2BZ_v8oBqaFa6wNkLTsZXMfdwkGmJc=eXwT13JMZJ8SNTc8k4w@mail.gmail.com>
References:  <201810292108.w9TL83bO041913@repo.freebsd.org> <B4656C50-1A08-4E0E-B0F4-2DA527840679@macmic.franken.de> <CA%2BZ_v8oBqaFa6wNkLTsZXMfdwkGmJc=eXwT13JMZJ8SNTc8k4w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Oct 30, 2018 at 03:32:40PM +0000, Alexander Richardson wrote:
> On Tue, 30 Oct 2018 at 10:17, Michael Tuexen
> <Michael.Tuexen@macmic.franken.de> wrote:
> >
> > > On 29. Oct 2018, at 22:08, Alex Richardson <arichardson@FreeBSD.org> wrote:
> > >
> > > Author: arichardson
> > > Date: Mon Oct 29 21:08:02 2018
> > > New Revision: 339876
> > > URL: https://svnweb.freebsd.org/changeset/base/339876
> > >
> > > Log:
> > >  rtld: set obj->textsize correctly
> > >
> > >  With lld-generated binaries the first PT_LOAD will usually be a read-only
> > >  segment unless you pass --no-rosegment. For those binaries the textsize is
> > >  determined by the next PT_LOAD. To allow both LLD and bfd 2.17 binaries to
> > >  be parsed correctly use the end of the last PT_LOAD that is marked as
> > >  executable instead.
> > >
> > >  I noticed that the value was wrong while adding some debug prints for some rtld
> > >  changes for CHERI binaries. `obj->textsize` only seems to be used by PPC so the
> > >  effect is untested. However, the value before was definitely wrong and the new
> > >  result matches the phdrs.
> > I build kernel and world with a revision later than this on a PPC. Buildword
> > ends up with a world where almost all binaries are segfaulting.... Especially gdb
> > (but svn, ls or so all segfault).
> >
> > Best regards
> > Michael
> 
> This is rather surprising since if anything the range of the icache
> flush should increase rather than decrease after this change.
> 
> I can only see this causing a behaviour change if we actually need to
> flush more than just the executable segments.
> Is it possible that some binary/library contains a non-executable
> segment as the first PT_LOAD?
> Or is there some linker script that adds custom PHDRS?
> 
Could it be that there is a hole between start of the object mapping and
the last PT_LOADable segment eligible for execution ?




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181030180352.GO5335>