From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FSL_HELO_FAKE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 9EC721F8C8 for ; Wed, 22 Sep 2021 18:41:03 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AEC3E3858007 for ; Wed, 22 Sep 2021 18:41:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AEC3E3858007 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1632336062; bh=sN+XlzcXT31U+azwUH/r+XBdX+8jZoM+dYNdtSEh8bo=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=iFncKP71fw6FPbx21f2zZlmfiWYk5yzjNkdY5rpy41adTAWYIz1dXYji11/mYBx+3 ZD91Z9tPjn30WGlw2823F0nHX9EtsDe2x86VNDji9irCEwC+npNl5T6qiu2QckG5eG VzWjce6sFj0NZ+vRjqPoaO/4NezN3+2PKplKLhHc= Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id 79E223858D29 for ; Wed, 22 Sep 2021 18:40:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 79E223858D29 Received: by mail-pj1-x102d.google.com with SMTP id dw14so2740795pjb.1 for ; Wed, 22 Sep 2021 11:40:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=sN+XlzcXT31U+azwUH/r+XBdX+8jZoM+dYNdtSEh8bo=; b=UsLZKehqER1m+yNjvdZIyl6fIQ2PCx/vaNARwW/rhSp7ohogX1DVtajiUgocuvUuys EYqG0G8jk6n5UH+Iaqof4SC6X7ykxTmK8uJK6Jqx1GhAXGaQzycUZ/3mX8rhBS8BW3n+ 57IdMOhzEnnGSQsysObBO4AE8R4XLRUDuCYTfA6IEDeMHGcKPkwyXLJdh2pZfrixLKYE Xqvbf/GR4cjFozPCmSBIQj0pxTCOhOT04m/1YLJkhtEYJ+ksPf4v+zq+MTIrIWZnvioy VXvgqsb3Xp0x5fuKTFkvHu8H82JivQsNlZEA6e/OrJLfRRiR2zPbXHQUv5G4FZyZyFH1 5Kew== X-Gm-Message-State: AOAM533AY7PWnQSLK3bNbuUwSI6bQHO0dyVJAW2kKnVQSFpxBDVjWXkr Ow0aEqe80ColpgtcifHhpHulcg== X-Google-Smtp-Source: ABdhPJwncFlfyJ86WSa8LJ9L56SW8LP8ueLLxQ9+Vb4x40Qt1wOpyJ0XsYvpYQmvHyEjsmzZ8F5MSA== X-Received: by 2002:a17:90a:1944:: with SMTP id 4mr547194pjh.45.1632336042406; Wed, 22 Sep 2021 11:40:42 -0700 (PDT) Received: from google.com ([2620:15c:2ce:200:565:9e5f:566b:b3f3]) by smtp.gmail.com with ESMTPSA id p10sm3339968pge.38.2021.09.22.11.40.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 11:40:42 -0700 (PDT) Date: Wed, 22 Sep 2021 11:40:37 -0700 To: Carlos O'Donell Subject: Re: PING^2: [PATCH] elf: Avoid nested functions in the loader (all ports) [BZ #27220] Message-ID: <20210922184037.7anyorvbtnd5j2fm@google.com> References: <20210823043648.2648608-1-maskray@google.com> <87tuj255se.fsf@oldenburg.str.redhat.com> <20210904035235.giercjqdwzjukxb5@google.com> <96f589db-295c-2a1d-600f-28f9fb4b0eee@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <96f589db-295c-2a1d-600f-28f9fb4b0eee@redhat.com> X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: =?utf-8?q?F=C4=81ng-ru=C3=AC_S=C3=B2ng_via_Libc-alpha?= Reply-To: =?utf-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Cc: Florian Weimer , Fangrui Song via Libc-alpha , Joseph Myers Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" 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.)