Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-07 Thread Mark Millard via svn-src-head
[I note what I've failed to find a way to investigate.] On 2018-Nov-7, at 11:53, Mark Millard wrote: > [I trace code associated with bl <1322.plt_call.getenv> > in the two contexts and extend the range over which things > appear to match: up to some point after the branch > b <__glink_PLTres

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-07 Thread Mark Millard via svn-src-head
[I trace code associated with bl <1322.plt_call.getenv> in the two contexts and extend the range over which things appear to match: up to some point after the branch b <__glink_PLTresolve> .] On 2018-Nov-6, at 19:12, Mark Millard wrote: > [I've present a little information about the longer-e

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-06 Thread Mark Millard via svn-src-head
[I've present a little information about the longer-existing failure's odd backtrace for /libexec/ld-elf.so.1 /bin/ls --but on powerpc64 FreeBSD instead of 32-bit powerpc FreeBSD.] On 2018-Nov-2, at 11:50, Konstantin Belousov wrote: > On Fri, Nov 02, 2018 at 10:38:08AM -0700, Mark Millard wrote:

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-04 Thread Mark Millard via svn-src-head
On 2018-Nov-3, at 12:51 PM, Konstantin Belousov wrote: > On Sat, Nov 03, 2018 at 12:04:53PM -0700, Mark Millard wrote: >> 80903 ld-elf.so.1 CALL >> mmap(0x1,0xb000,0,0x6010,0x,0x1,0,0) >> 80903 ld-elf.so.1 RET mmap -1 errno 12 Cannot allocate memory > > This is the allocation

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-03 Thread Mark Millard via svn-src-head
On 2018-Nov-3, at 12:04 PM, Mark Millard wrote: > On 2018-Nov-3, at 8:49 AM, Konstantin Belousov wrote: > >> On Fri, Nov 02, 2018 at 05:51:25PM -0700, Mark Millard wrote: >>> On 2018-Nov-2, at 11:50 AM, Konstantin Belousov >>> wrote: >>> On Fri, Nov 02, 2018 at 10:38:08AM -0700, Mark Mi

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-03 Thread Konstantin Belousov
On Sat, Nov 03, 2018 at 12:04:53PM -0700, Mark Millard wrote: > 80903 ld-elf.so.1 CALL > mmap(0x1,0xb000,0,0x6010,0x,0x1,0,0) > 80903 ld-elf.so.1 RET mmap -1 errno 12 Cannot allocate memory This is the allocation of VA for the whole binary. I guess that the normal non-PIE bi

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-03 Thread Mark Millard via svn-src-head
On 2018-Nov-3, at 8:49 AM, Konstantin Belousov wrote: > On Fri, Nov 02, 2018 at 05:51:25PM -0700, Mark Millard wrote: >> On 2018-Nov-2, at 11:50 AM, Konstantin Belousov >> wrote: >> >>> On Fri, Nov 02, 2018 at 10:38:08AM -0700, Mark Millard wrote: . . . >>> >>> There seems to be an is

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-03 Thread Konstantin Belousov
On Fri, Nov 02, 2018 at 05:51:25PM -0700, Mark Millard wrote: > On 2018-Nov-2, at 11:50 AM, Konstantin Belousov > wrote: > > > On Fri, Nov 02, 2018 at 10:38:08AM -0700, Mark Millard wrote: > >> . . . > > > > There seems to be an issue with the direct execution mode on ppc. > > Even otherwise wo

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-02 Thread Mark Millard via svn-src-head
On 2018-Nov-2, at 11:50 AM, Konstantin Belousov wrote: > On Fri, Nov 02, 2018 at 10:38:08AM -0700, Mark Millard wrote: >> . . . > > There seems to be an issue with the direct execution mode on ppc. > Even otherwise working ld-elf.so.1 segfaults if I try to use it as > standalone binary. > > But

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-02 Thread Konstantin Belousov
On Fri, Nov 02, 2018 at 10:38:08AM -0700, Mark Millard wrote: > On 2018-Nov-2, at 8:52 AM, Konstantin Belousov wrote: > > > On Fri, Nov 02, 2018 at 08:30:17AM -0700, Mark Millard wrote: > >> Breakpoint 4, reloc_non_plt (obj=0x41041000, obj_rtld=0x1801cc7, flags=4, > >> lockstate=0x0) at /usr/src

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-02 Thread Mark Millard via svn-src-head
On 2018-Nov-2, at 8:52 AM, Konstantin Belousov wrote: > On Fri, Nov 02, 2018 at 08:30:17AM -0700, Mark Millard wrote: >> Breakpoint 4, reloc_non_plt (obj=0x41041000, obj_rtld=0x1801cc7, flags=4, >> lockstate=0x0) at /usr/src/libexec/rtld-elf/powerpc/reloc.c:338 >> 338 __

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-02 Thread Konstantin Belousov
On Fri, Nov 02, 2018 at 08:30:17AM -0700, Mark Millard wrote: > Breakpoint 4, reloc_non_plt (obj=0x41041000, obj_rtld=0x1801cc7, flags=4, > lockstate=0x0) at /usr/src/libexec/rtld-elf/powerpc/reloc.c:338 > 338 __syncicache(obj->mapbase + phdr->p_vaddr, > 1: x/i $pc > => 0

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-02 Thread Mark Millard via svn-src-head
On 2018-Nov-2, at 4:38 AM, Konstantin Belousov wrote: > On Fri, Nov 02, 2018 at 12:16:23AM -0700, Mark Millard wrote: >> It stops when the dcbst in __syncicache runs into an address in >> the p_align 65536 caused hole between the two PT_LOAD's with PF_X. >> /bin/ls itself has such a hole, as d

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-02 Thread Konstantin Belousov
On Fri, Nov 02, 2018 at 12:16:23AM -0700, Mark Millard wrote: > It stops when the dcbst in __syncicache runs into an address in > the p_align 65536 caused hole between the two PT_LOAD's with PF_X. > /bin/ls itself has such a hole, as do the .so libraries involved. Try this. I only compile-tested

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-02 Thread Mark Millard via svn-src-head
[The backtrace confirms what I reported to Alexander Richardson and Shawn Webb earlier.] On 2018-Nov-1, at 6:40 PM, Mark Millard wrote: > On 2018-Nov-1, at 5:41 PM, Konstantin Belousov wrote: > >> On Tue, Oct 30, 2018 at 12:45:13PM -0700, Mark Millard wrote: >>> Konstantin Belousov kostikbel a

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-01 Thread Mark Millard via svn-src-head
On 2018-Nov-1, at 5:41 PM, Konstantin Belousov wrote: > On Tue, Oct 30, 2018 at 12:45:13PM -0700, Mark Millard wrote: >> Konstantin Belousov kostikbel at gmail.com wrote on >> Tue Oct 30 18:04:04 UTC 2018 : >> >>> On Tue, Oct 30, 2018 at 03:32:40PM +, Alexander Richardson wrote: On Tue,

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-11-01 Thread Konstantin Belousov
On Tue, Oct 30, 2018 at 12:45:13PM -0700, Mark Millard wrote: > Konstantin Belousov kostikbel at gmail.com wrote on > Tue Oct 30 18:04:04 UTC 2018 : > > > On Tue, Oct 30, 2018 at 03:32:40PM +, Alexander Richardson wrote: > > > On Tue, 30 Oct 2018 at 10:17, Michael Tuexen > > > wrote: > > > >

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-10-31 Thread Alexander Richardson
On Wed, 31 Oct 2018 at 18:38, Mark Millard wrote: > > On 2018-Oct-30, at 3:23 PM, Alexander Richardson > wrote: > > > . . . > > Before this change obj->textsize was always set as the end of > > PT_LOAD[0]. Now it will contain everything up to the end of the last > > PT_LOAD with execute permissi

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-10-31 Thread Mark Millard via svn-src-head
On 2018-Oct-31, at 11:53 AM, Alexander Richardson wrote: > On Wed, 31 Oct 2018 at 18:38, Mark Millard > wrote: >> >> On 2018-Oct-30, at 3:23 PM, Alexander Richardson > freebsd.org> wrote: >> >>> . . . >>> Before this change obj->textsize was always set as the end of >>> PT_LOAD[0]. Now it wi

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-10-31 Thread Mark Millard via svn-src-head
On 2018-Oct-30, at 3:23 PM, Alexander Richardson wrote: > . . . > Before this change obj->textsize was always set as the end of > PT_LOAD[0]. Now it will contain everything up to the end of the last > PT_LOAD with execute permissions. In the binary you dumped this is > PT_LOAD[0] both before and

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-10-30 Thread Alexander Richardson
On Tue, 30 Oct 2018 at 22:16, Mark Millard wrote: > > On 2018-Oct-30, at 2:40 PM, Alexander Richardson > wrote: > > > On Tue, 30 Oct 2018 at 21:32, Mark Millard > > wrote: > >> > >> > >> > >> On 2018-Oct-30, at 2:23 PM, Alexander Richardson >> freebsd.org> wrote: > >> > >>> On Tue, 30 Oct 201

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-10-30 Thread Mark Millard via svn-src-head
On 2018-Oct-30, at 2:40 PM, Alexander Richardson wrote: > On Tue, 30 Oct 2018 at 21:32, Mark Millard > wrote: >> >> >> >> On 2018-Oct-30, at 2:23 PM, Alexander Richardson > freebsd.org> wrote: >> >>> On Tue, 30 Oct 2018 at 18:19, Mark Millard >>> wrote: Alexander Richardson ar

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-10-30 Thread Alexander Richardson
On Tue, 30 Oct 2018 at 21:32, Mark Millard wrote: > > > > On 2018-Oct-30, at 2:23 PM, Alexander Richardson > wrote: > > > On Tue, 30 Oct 2018 at 18:19, Mark Millard > > wrote: > >> > >> Alexander Richardson arichardson at freebsd.org wrote on > >> Tue Oct 30 15:33:00 UTC 2018 : > >> > >>> On T

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-10-30 Thread Mark Millard via svn-src-head
On 2018-Oct-30, at 2:23 PM, Alexander Richardson wrote: > On Tue, 30 Oct 2018 at 18:19, Mark Millard > wrote: >> >> Alexander Richardson arichardson at freebsd.org wrote on >> Tue Oct 30 15:33:00 UTC 2018 : >> >>> On Tue, 30 Oct 2018 at 10:17, Michael Tuexen >>> wrote: > On 29.

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-10-30 Thread Alexander Richardson
On Tue, 30 Oct 2018 at 18:19, Mark Millard wrote: > > Alexander Richardson arichardson at freebsd.org wrote on > Tue Oct 30 15:33:00 UTC 2018 : > > > On Tue, 30 Oct 2018 at 10:17, Michael Tuexen > > wrote: > > > > > > > On 29. Oct 2018, at 22:08, Alex Richardson > > > > wrote: > > > > > > > > A

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-10-30 Thread Mark Millard via svn-src-head
Konstantin Belousov kostikbel at gmail.com wrote on Tue Oct 30 18:04:04 UTC 2018 : > On Tue, Oct 30, 2018 at 03:32:40PM +, Alexander Richardson wrote: > > On Tue, 30 Oct 2018 at 10:17, Michael Tuexen > > wrote: > > > > > > > On 29. Oct 2018, at 22:08, Alex Richardson > > > > wrote: > > > >

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-10-30 Thread Mark Millard via svn-src-head
Alexander Richardson arichardson at freebsd.org wrote on Tue Oct 30 15:33:00 UTC 2018 : > On Tue, 30 Oct 2018 at 10:17, Michael Tuexen > wrote: > > > > > On 29. Oct 2018, at 22:08, Alex Richardson > > > wrote: > > > > > > Author: arichardson > > > Date: Mon Oct 29 21:08:02 2018 > > > New Revisi

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-10-30 Thread Konstantin Belousov
On Tue, Oct 30, 2018 at 03:32:40PM +, Alexander Richardson wrote: > On Tue, 30 Oct 2018 at 10:17, Michael Tuexen > wrote: > > > > > On 29. Oct 2018, at 22:08, Alex Richardson > > > wrote: > > > > > > Author: arichardson > > > Date: Mon Oct 29 21:08:02 2018 > > > New Revision: 339876 > > > UR

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-10-30 Thread Alexander Richardson
On Tue, 30 Oct 2018 at 10:17, Michael Tuexen wrote: > > > On 29. Oct 2018, at 22:08, Alex Richardson 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 c

Re: svn commit: r339876 - head/libexec/rtld-elf

2018-10-30 Thread Michael Tuexen
> On 29. Oct 2018, at 22:08, Alex Richardson 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 usual

svn commit: r339876 - head/libexec/rtld-elf

2018-10-29 Thread Alex Richardson
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