From patchwork Mon Jan 24 03:52:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 50378 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8C5D53858437 for ; Mon, 24 Jan 2022 03:52:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C5D53858437 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1642996375; bh=O8VATgfugfTS802Y3Vn0BwC7yV9kFaZNe7JudZq7aZI=; 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=WasLLLvUA9tox9u3apUsILG5W6X/hObteX0Xrsn5wUPm2OcCVQWMHuRUaFX51xCFb lQk2xBoZLkHxdUGeV1ntHZfBVbxghmH34O9xONOxC8yNA1RJ85Uh75HY7OR0qO/zWq gxU436hv+w1NDmb0rMb3DUO3LvogXxUKuFrDKghg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 037233858C3A for ; Mon, 24 Jan 2022 03:52:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 037233858C3A Received: by mail-pf1-x436.google.com with SMTP id h5so6212059pfv.13 for ; Sun, 23 Jan 2022 19:52:34 -0800 (PST) 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=O8VATgfugfTS802Y3Vn0BwC7yV9kFaZNe7JudZq7aZI=; b=tQS0xzkyaOTKhkPewf4fJuK9ST7wF2Sjfz1jye/juiI+XLoVADwX4n+lEwJ/zzjRGn brvlL/ZXdn3Y65lTEEfg7ovv/uJzsMza+TP1pq9J6A81gzhiosCAY5V4BZmVksP5HJ0T SUord7UfwVCN+gE29wCyVlGM5ZEUmiElbULcMNGhb9TDvALdAMlJXuw/0dqjUMUS3U6+ Ori3eMA8iwtqBUbrK9KOZOuI7gpUiJedWokl5ChHA+G2TCjNKewQh+IqU8uSfpke2rJY 4XdR04o8SDDYaaShIpdhUusYVTK7zu31jxI7WVXeTkI3g1HfBgP5FZl9VcbOa147PIxL p1AA== X-Gm-Message-State: AOAM531wh4a5ZAmdw5BlH1WrF4XyrgJxzjg0OJ2ZKuZ70IMmdspjNTb1 3bkyuQJHIl8P/g2QIi/ztZm0C7k+nPk= X-Google-Smtp-Source: ABdhPJxH9UIdv4fixKSLWP9h61hA49upixNO9EDy0nD7SjiZynxpBu02FGtf46J5NWP/vOFuHqip5w== X-Received: by 2002:a63:8748:: with SMTP id i69mr10874226pge.422.1642996354173; Sun, 23 Jan 2022 19:52:34 -0800 (PST) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:6dcd:c685:dad8:6b5b]) by smtp.gmail.com with ESMTPSA id 5sm20306867pjf.34.2022.01.23.19.52.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 19:52:33 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id EFE351142F74; Mon, 24 Jan 2022 14:22:30 +1030 (ACDT) Date: Mon, 24 Jan 2022 14:22:30 +1030 To: libc-alpha@sourceware.org Subject: [PATCH 4/5] Constify a variable in dl_vdso_vsym Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3037.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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-Patchwork-Original-From: Alan Modra via Libc-alpha From: Alan Modra Reply-To: Alan Modra Cc: Tulio Magno Quites Machado Filho Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Just a tidy. Compilers may decide to put the rfv variable in .data rather than on the stack. It's slightly better to put it in .data.rel.ro.local instead. Also, making it const may enable further optimisations. diff --git a/sysdeps/unix/sysv/linux/dl-vdso.h b/sysdeps/unix/sysv/linux/dl-vdso.h index bfefce8f35..8611488acc 100644 --- a/sysdeps/unix/sysv/linux/dl-vdso.h +++ b/sysdeps/unix/sysv/linux/dl-vdso.h @@ -45,7 +45,7 @@ dl_vdso_vsym (const char *name) ElfW (Sym) wsym = { 0 }; wsym.st_info = (unsigned char) ELFW (ST_INFO (STB_WEAK, STT_NOTYPE)); - struct r_found_version rfv = { VDSO_NAME, VDSO_HASH, 1, NULL }; + const struct r_found_version rfv = { VDSO_NAME, VDSO_HASH, 1, NULL }; /* Search the scope of the vdso map. */ const ElfW (Sym) *ref = &wsym;