Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200129214324.GM30412@brightrain.aerifal.cx>
Date: Wed, 29 Jan 2020 16:43:24 -0500
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: Static linking is broken after creation of DT_TEXTREL
 segment

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.