mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "Андрей Аладьев" <aladjev.andrew@gmail.com>
To: musl@lists.openwall.com
Subject: Re: [musl] Static linking is broken after creation of DT_TEXTREL segment
Date: Fri, 31 Jan 2020 22:11:21 +0300	[thread overview]
Message-ID: <CAMw0sz+4TgZo+KHC3HVmx3+M=c_4siSpe3auxqZPoVj6TKmgig@mail.gmail.com> (raw)
In-Reply-To: <20200131180109.GJ1663@brightrain.aerifal.cx>

[-- Attachment #1: Type: text/plain, Size: 2132 bytes --]

Now everything is clear, thank you. Have a good weekend =)

пт, 31 янв. 2020 г. в 21:01, Rich Felker <dalias@libc.org>:

> On Fri, Jan 31, 2020 at 08:51:05PM +0300, Андрей Аладьев wrote:
> > > Moreover, adding such a thing is not desirable because it adds a
> > linear-search of an array of load segments to each relocation
> >
> > I think it is possible to make this search O(log n).
>
> This would help if n were large, but in practice it's very small (2-3
> or maybe 4) and the cost is just the code path overhead, which gets
> worse if you do that, not the largeness of n.
>
> > for (j=0; v-p->loadmap->segs[j].p_vaddr >= p->loadmap->segs[j].p_memsz;
> > j++);
> >
> > This code takes first segment that can handle address. It looks possible
> to
> > create modified list of virtual segments, that won't overlap and make a
> > binary search.
>
> They're non-overlapping anyway but not necessarily sorted, and can't
> be simultaneously sorted by addr and p_vaddr since the orders will
> differ.
>
> > > This is not a reasonable tradeoff and it's why I proposed the "hull"
> > approach
> >
> > It may not be safe from maintainability perspective. Library will be
> > changed, everybody will forget what part of code was protected by
> external
> > validation and it will provide unexpected behaviour. Please consider
> double
> > validation approach:
>
> You're really not making sense here. What does "protected by external
> validation" mean? There is presently nothing being "protected" here;
> the discussion is just about more informative errors. If this is used
> as a boundary for some sort of safety at some point in the future (as
> mentioned before, the benefit of this is probably limited to ldd and
> thus not very useful) then it will be done according to constraints
> needed to achieve that.
>
> > external validation in production and debug only mode
> > with loadmap like validation.
>
> We do not have separate "production" and "debug" modes. This kind of
> thing (combinatoric build-time options) is what lacks maintainability.
>
> Rich
>

[-- Attachment #2: Type: text/html, Size: 2644 bytes --]

  reply	other threads:[~2020-01-31 19:11 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-29 18:41 Андрей Аладьев
2020-01-29 19:19 ` Markus Wichmann
2020-01-29 19:38   ` Markus Wichmann
2020-01-29 20:48     ` Rich Felker
2020-01-29 20:08   ` Андрей Аладьев
2020-01-30 17:02     ` Markus Wichmann
2020-01-31  4:24       ` Rich Felker
2020-01-31 14:47         ` Markus Wichmann
2020-01-31 16:35           ` Rich Felker
2020-01-31 15:16       ` Андрей Аладьев
2020-01-31 16:40         ` Rich Felker
2020-01-31 17:51           ` Андрей Аладьев
2020-01-31 18:01             ` Rich Felker
2020-01-31 19:11               ` Андрей Аладьев [this message]
2020-02-03  3:10       ` Rich Felker
2020-02-03  4:05         ` Rich Felker
2020-02-03  4:32         ` Markus Wichmann
2020-02-03  4:40           ` Rich Felker
2020-01-29 20:53 ` Rich Felker
2020-01-29 21:10   ` Szabolcs Nagy
2020-01-29 21:35     ` Андрей Аладьев
2020-01-29 21:46       ` Rich Felker
2020-01-29 23:10         ` Андрей Аладьев
2020-01-29 23:20       ` Szabolcs Nagy
2020-01-29 21:14   ` Андрей Аладьев
2020-01-29 21:43     ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMw0sz+4TgZo+KHC3HVmx3+M=c_4siSpe3auxqZPoVj6TKmgig@mail.gmail.com' \
    --to=aladjev.andrew@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).