mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [musl] Static linking is broken after creation of DT_TEXTREL segment
Date: Wed, 29 Jan 2020 16:43:24 -0500	[thread overview]
Message-ID: <20200129214324.GM30412@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAMw0sz+1ijpyXSg627P7JM1LU=c3hCSiO423LNwP-3cLzOLg9g@mail.gmail.com>

On Thu, Jan 30, 2020 at 12:14:00AM +0300, Андрей Аладьев wrote:
> Thank you, I will definitely report this issue to gmp or provide more
> information under existing one. Please see here:
> 
> if (dso == &ldso) {
>   /* Only ldso's REL table needs addend saving/reuse. */
>   if (rel == apply_addends_to)
>     reuse_addends = 1;
>   skip_relative = 1;
> }
> 
> if (skip_relative && IS_RELATIVE(rel[1], dso->syms)) continue;
> 
> Musl already has "skip_relative" flag. This flag can be improved like:
> 
> # ifdef SKIP_RELLOCATION_IN_READONLY_MODE
> if (readonly_mode) {
>   skip_relative = 1;
> }
> # endif
> 
> if (IS_RELATIVE(rel[1], dso->syms)) {
>   if (skip_relative) {
>     continue;
>   } else if (readonly_mode) {
>     error("Error it is not possible to make relocations in readonly mode");
>     a_crash();
>   }
> }
> 
> It will make musl more stronger and user friendlier.

I can't say for sure because this is not a complete patch and probably
not expressing things precisely, but I really don't think this is
doing what you think it's doing. The logic you're trying to modify is
about how the dynamic linker performs multiple passes of relocations
over itself.

Rich

      reply	other threads:[~2020-01-29 21:43 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               ` Андрей Аладьев
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 [this message]

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=20200129214324.GM30412@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --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).