From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 66F35385409B for ; Fri, 9 Dec 2022 13:13:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 66F35385409B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670591591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PND1M/H9Dica/VGo6U4YWKo1SmRwVKuiqgI4CFMlm8k=; b=F7azMN0BzkdEvZplbeAD+utbVDQLdx5kVxWGpS1keYTQKI8RR0EBsk8hBx/qzyXGTNlauK g82FxoOxKbGrkCtc8/AQiojfe2n3w/hnKLOVrHnAP5LaE+AqJLPDlXwIAuL+KbJpcDzX6q FZ+vvKJMxARp+5Ci9BpI3t6VN6Co9eA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-616-gZ1QuVb4OQKV_QBzZdje0A-1; Fri, 09 Dec 2022 08:13:08 -0500 X-MC-Unique: gZ1QuVb4OQKV_QBzZdje0A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BDB0B3C0F23E; Fri, 9 Dec 2022 13:13:07 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.193.168]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F1F5B1121331; Fri, 9 Dec 2022 13:13:06 +0000 (UTC) From: Florian Weimer To: Yago =?utf-8?Q?Guti=C3=A9rrez?= Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 0/1] __libc_start_main() now uses auxv to obtain phdr's address [BZ #29864] References: <73l3eC0YTCoWnmm2zGV-SIY9-W5DQ-peyx7secTao121qocwqub-R4Zhrpkai8_LRxy4xsn7ARdHRbI7NnzSysk6ACmQWfiavdpz-tA70xc=@protonmail.com> <877cz1hgjl.fsf@oldenburg.str.redhat.com> Date: Fri, 09 Dec 2022 14:13:03 +0100 In-Reply-To: ("Yago =?utf-8?Q?Guti=C3=A9rrez=22's?= message of "Fri, 09 Dec 2022 13:02:30 +0000") Message-ID: <87v8mkk9eo.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Yago Guti=C3=A9rrez: > diff --git a/sysdeps/unix/sysv/linux/dl-parse_auxv.h b/sysdeps/unix/sysv/= linux/dl-parse_auxv.h > index bf9374371e..f1a964ec1d 100644 > --- a/sysdeps/unix/sysv/linux/dl-parse_auxv.h > +++ b/sysdeps/unix/sysv/linux/dl-parse_auxv.h > @@ -52,6 +52,9 @@ void _dl_parse_auxv (ElfW(auxv_t) *av, dl_parse_auxv_t = auxv_values) > _dl_random =3D (void *) auxv_values[AT_RANDOM]; > GLRO(dl_minsigstacksize) =3D auxv_values[AT_MINSIGSTKSZ]; > GLRO(dl_sysinfo_dso) =3D (void *) auxv_values[AT_SYSINFO_EHDR]; > +#ifndef SHARED > + GL(dl_phdr) =3D (void*) auxv_values[AT_PHDR]; > +#endif > #ifdef NEED_DL_SYSINFO > if (GLRO(dl_sysinfo_dso) !=3D NULL) > GLRO(dl_sysinfo) =3D auxv_values[AT_SYSINFO]; The dynamic linker calls _dl_parse_auxv via _dl_sysdep_parse_arguments. This gives direct access to all auxv entries. I wonder if we should abolish _dl_aux_init and call _dl_parse_auxv here. It shouldn't be necessary to duplicate this data in _dl_main_map and separate variables (see _dl_non_dynamic_init). Can we assume that AT_PHDR and AT_PHNUM are always present on Linux? Thanks, Florian