From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by sourceware.org (Postfix) with ESMTPS id EC6403858003 for ; Tue, 8 Feb 2022 22:58:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EC6403858003 Received: by mail-oi1-x22a.google.com with SMTP id m10so714308oie.2 for ; Tue, 08 Feb 2022 14:58:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=T2KZqVoSPQnt6QdmkWgtz/Az32pvSJmSEvHqf2FfjQc=; b=Be4v6JKoNcipV0zZE/kUZsoJw+Y6sIN4YKyv5yDL5YlfvFyQan3JivPNGhd30Ash3E H51kAAfZrxCcokFAfHV8gpCUQAA0dWRi6dJU0kXRfbZWnxTutccYrazh2HAc8c38/phQ OCE3pABWKvopddbjGjzfhjuWAPGp+CQy76XtrTO6Yog+b8P+TQyZ/fAkwNctnt3HxWc6 5aLirs5zmtOK+Pxt4rK65cJzxxSMPQ2UdT6HDOtDkoJ8a0tmqKxfzwdV2ZJJk9D/SkWQ hPmiGJugqYx8WSYttcAQ1r3AhmT1t58jDLJ5ldw7tJ0sLxCIEpVJHtG79RWUco4r60fH A9Rw== X-Gm-Message-State: AOAM533oFGy3GOqGsZFqmJAtNKP2c0jrWNzUcYAdUnRP3XdlqVgxw30P mpqgkmH9DHlm5iM+ZGWRiPYPkA== X-Google-Smtp-Source: ABdhPJzbHF0Fs2Pry9tWxeHJ3MkPGPzfScO6pN5MJBOYoe1TZ7Y9wisBOg3OfE/Au0Rmoecl4jJp0w== X-Received: by 2002:a05:6808:30a7:: with SMTP id bl39mr101802oib.155.1644361080362; Tue, 08 Feb 2022 14:58:00 -0800 (PST) Received: from ?IPV6:2804:431:c7ca:733:86a9:ad5:adef:2f3e? ([2804:431:c7ca:733:86a9:ad5:adef:2f3e]) by smtp.gmail.com with ESMTPSA id 12sm6477551oaj.31.2022.02.08.14.57.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 14:58:00 -0800 (PST) Message-ID: <86eead09-64ac-b12f-4c24-ae6e4e12c4ff@linaro.org> Date: Tue, 8 Feb 2022 19:57:58 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH v2 5/5] Linux: Consolidate auxiliary vector parsing Content-Language: en-US To: Florian Weimer Cc: libc-alpha@sourceware.org References: <151c5398adbbe538a275ea5ac77705b0abd0d748.1643886336.git.fweimer@redhat.com> <2b39ebaf-98ee-d0c2-39f6-6b0a87d0741a@linaro.org> <87v8xp3xng.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella In-Reply-To: <87v8xp3xng.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 08 Feb 2022 22:58:02 -0000 On 08/02/2022 17:34, Florian Weimer wrote: > * Adhemerval Zanella: > >>> diff --git a/sysdeps/unix/sysv/linux/dl-parse_auxv.h b/sysdeps/unix/sysv/linux/dl-parse_auxv.h >>> new file mode 100644 >>> index 0000000000..f450c6c5ce >>> --- /dev/null >>> +++ b/sysdeps/unix/sysv/linux/dl-parse_auxv.h > >>> +typedef ElfW(Addr) dl_parse_auxv_t[AT_MINSIGSTKSZ + 1]; >>> + >>> +/* Copy the auxiliary vector into AUX_VALUES and set up GLRO >>> + variables. */ >>> +static inline >>> +void _dl_parse_auxv (ElfW(auxv_t) *av, dl_parse_auxv_t auxv_values) >>> +{ >>> + auxv_values[AT_ENTRY] = (ElfW(Addr)) ENTRY_POINT; >> >> Extra whitespace. > > Fxied. > >>> + auxv_values[AT_PAGESZ] = EXEC_PAGESIZE; >>> + auxv_values[AT_FPUCW] = _FPU_DEFAULT; >>> + >>> + /* NB: Default to a constant CONSTANT_MINSIGSTKSZ. */ >>> + _Static_assert (__builtin_constant_p (CONSTANT_MINSIGSTKSZ), >>> + "CONSTANT_MINSIGSTKSZ is constant"); >> >> Shouldn't it warn that CONSTANT_MINSIGSTKSZ is not a constant? > > Sorry, would please rephrase? Should I change this to > ""CONSTANT_MINSIGSTKSZ is not constant"? Yeah because on a the _Static_assert failure the resulting message seems to the opposite of what triggered it. > >>> + auxv_values[AT_MINSIGSTKSZ] = CONSTANT_MINSIGSTKSZ; >>> + >>> + for (; av->a_type != AT_NULL; av++) >>> + if (av->a_type <= AT_MINSIGSTKSZ) >>> + auxv_values[av->a_type] = av->a_un.a_val; >>> + >>> + GLRO(dl_pagesize) = auxv_values[AT_PAGESZ]; >>> + __libc_enable_secure = auxv_values[AT_SECURE]; >>> + GLRO(dl_platform) = (void *) auxv_values[AT_PLATFORM]; >>> + GLRO(dl_hwcap) = auxv_values[AT_HWCAP]; >>> + GLRO(dl_hwcap2) = auxv_values[AT_HWCAP2]; >>> + GLRO(dl_clktck) = auxv_values[AT_CLKTCK]; >>> + GLRO(dl_fpu_control) = auxv_values[AT_FPUCW]; >>> + _dl_random = (void *) auxv_values[AT_RANDOM]; >>> + GLRO(dl_minsigstacksize) = auxv_values[AT_MINSIGSTKSZ]; >>> + GLRO(dl_sysinfo_dso) = (void *) auxv_values[AT_SYSINFO_EHDR]; >>> +#ifdef NEED_DL_SYSINFO >> >> I think you can now assume NEED_DL_SYSINFO is always defined. > > NEED_DL_SYSINFO is only defined by i386 and ia64, only > NEED_DL_SYSINFO_DSO is always defined on Linux. Indeed, my confusion here. > > Thanks, > Florian >