unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Fāng-ruì Sòng via Libc-alpha" <libc-alpha@sourceware.org>
To: Carlos O'Donell <carlos@redhat.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	Fangrui Song via Libc-alpha <libc-alpha@sourceware.org>,
	Joseph Myers <joseph@codesourcery.com>
Subject: Re: PING^2: [PATCH] elf: Avoid nested functions in the loader (all ports) [BZ #27220]
Date: Wed, 22 Sep 2021 11:40:37 -0700	[thread overview]
Message-ID: <20210922184037.7anyorvbtnd5j2fm@google.com> (raw)
In-Reply-To: <96f589db-295c-2a1d-600f-28f9fb4b0eee@redhat.com>


On 2021-09-22, Carlos O'Donell wrote:
>On 9/22/21 14:09, Joseph Myers wrote:
>> On Wed, 22 Sep 2021, Carlos O'Donell via Libc-alpha wrote:
>>
>>> - Split this patch up into more logical changes.
>>
>> I'm not convinced there's much scope for splitting up this patch more; it
>> is a logical change (versions that changed only some architectures were a
>> lot uglier).  My comment about logical changes was a more generic one, not
>> suggesting that this particular patch should be split up further.
>
>Thanks for the clarification. In which case the more detailed review of the boostrap
>relocations is the remaining point.

I really appreciate that Clang buildability is well-received :)
I went ahead and filed https://sourceware.org/bugzilla/show_bug.cgi?id=28376 "[meta] Build glibc with Clang"
to collect miscellaneous small fixes.

---

I agree that this patch is difficult to split.
Modifying the elf/ macro parameters requires fixing all use sites.

The latest version is at https://github.com/MaskRay/glibc/tree/unnest
(I use a different repo instead of the canonical sourceware repo in the fear of pushing bad commits to sourceware :)

About the global variables (cur_*): they are in elf/dl-reloc.c

-    /* String table object symbols.  */
-    const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]);
+    cur_l = l;
+    cur_scope = scope;
+    cur_strtab = (const void *) D_PTR (cur_l, l_info[DT_STRTAB]);

removing them requires more parameters to ELF_DYNAMIC_RELOCATE and RESOLVE_MAP.
Is that the direction you are imagining?

BTW: I am not familiar with the concept of bootstrap relocations.
Does it refer to relocations in ld.so itself   and   all relocations in a static pie?

---

FWIW I initially sent
https://sourceware.org/pipermail/libc-alpha/2021-August/130340.html
(https://github.com/MaskRay/glibc/tree/nesting)
which is a more literal take from
https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/google/grte/v5-2.27/master

But I slightly dislike the version myself because it duplicates lots of macros.
(This branch can give some insight for needed Clang fixes but many commits need rewrite for master.)

  reply	other threads:[~2021-09-22 18:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-23  4:36 [PATCH] elf: Avoid nested functions in the loader (all ports) [BZ #27220] Fangrui Song via Libc-alpha
2021-09-03  5:41 ` Fāng-ruì Sòng via Libc-alpha
2021-09-03 10:09 ` Florian Weimer via Libc-alpha
2021-09-04  3:52   ` Fangrui Song via Libc-alpha
2021-09-13 16:36     ` Fāng-ruì Sòng via Libc-alpha
2021-09-20 17:55       ` PING^2: " Fāng-ruì Sòng via Libc-alpha
2021-09-22 17:53         ` Carlos O'Donell via Libc-alpha
2021-09-22 18:09           ` Joseph Myers
2021-09-22 18:20             ` Carlos O'Donell via Libc-alpha
2021-09-22 18:40               ` Fāng-ruì Sòng via Libc-alpha [this message]
2021-09-22 19:21                 ` Joseph Myers
2021-09-22 19:44                   ` Fāng-ruì Sòng via Libc-alpha
2021-09-23 22:00                     ` Florian Weimer via Libc-alpha
2021-09-23 22:14                       ` Fāng-ruì Sòng via Libc-alpha

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=20210922184037.7anyorvbtnd5j2fm@google.com \
    --to=libc-alpha@sourceware.org \
    --cc=carlos@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=maskray@google.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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).