From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by sourceware.org (Postfix) with ESMTPS id 4BE98389366D for ; Tue, 6 Apr 2021 16:52:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4BE98389366D Received: by mail-qt1-x82e.google.com with SMTP id y2so11640949qtw.13 for ; Tue, 06 Apr 2021 09:52:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+nJC5pMGQV+6u6TxVQCNyONLpeCveLhEw3nyYApM4Bw=; b=j3mp/8iFmOn+TuwerYB14IIdkkESyIhUCILCTg/eGiv8k0w0q3H99jDAUYEZWpoCuG iVsmtFZHQAWmCy7jL4q0h7DR5s6n/ub0PzoFBVL3q7rmq1MVKs7OCOveYS3UI/BRY+Dn KYFSQ6BNkDDkUNOSh8mOlAuWKaYnwvaYkGYZtNdpOpaggzVZgg8AI0GDhKQZV/4sL757 zWu9ouVe8wLarqg5BvsdzG0jNhYYjL+K+n9vTqy/Pc2kwfZkPsXE6djieGMADbUkI0zV mDZYvsfIOMmzgQt1YmafEoIWh7dNY1+d5J7NFpEP/7jEO6YFsDblu5b2YTpCUKGlLENa CJ0A== X-Gm-Message-State: AOAM533YlCCY2nMcYlfEc8R9GTNEz4l4fict0ItazC8kJYOKpJ2piqQQ cndg1sfqLnDlk1WkRpJuE+k9V27yyL/9vrhF X-Google-Smtp-Source: ABdhPJy8RmuBQWJAc1xYksyQiwILmZZ2ZrED4b7+Y/Oz07N9MqUgc6cNL1+y+5qcTyVdDmtIxGv+YA== X-Received: by 2002:ac8:4e10:: with SMTP id c16mr28076370qtw.268.1617727936577; Tue, 06 Apr 2021 09:52:16 -0700 (PDT) Received: from [192.168.1.132] ([177.194.41.149]) by smtp.gmail.com with ESMTPSA id k26sm12392805qkg.120.2021.04.06.09.52.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Apr 2021 09:52:16 -0700 (PDT) Subject: Re: [PATCH 01/15] aarch64: free tlsdesc data on dlclose [BZ #27403] To: Szabolcs Nagy Cc: libc-alpha@sourceware.org References: <90458da8b7b46e806f756c2715c87fc9d2c1be95.1613390045.git.szabolcs.nagy@arm.com> <8d520e83-d0c3-b97e-21ec-17f8092e87d9@linaro.org> <20210406134326.GL23289@arm.com> From: Adhemerval Zanella Message-ID: Date: Tue, 6 Apr 2021 13:52:14 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210406134326.GL23289@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 06 Apr 2021 16:52:20 -0000 On 06/04/2021 10:43, Szabolcs Nagy wrote: > The 04/01/2021 09:57, Adhemerval Zanella wrote: >> On 15/02/2021 08:56, Szabolcs Nagy via Libc-alpha wrote: >>> DL_UNMAP_IS_SPECIAL and DL_UNMAP were not defined. The definitions are >>> now copied from arm, since the same is needed on aarch64. The cleanup >>> of tlsdesc data is handled by the custom _dl_unmap. >>> >>> Fixes bug 27403. >>> --- >>> sysdeps/aarch64/dl-lookupcfg.h | 27 +++++++++++++++++++++++++++ >>> 1 file changed, 27 insertions(+) >>> create mode 100644 sysdeps/aarch64/dl-lookupcfg.h >>> >>> diff --git a/sysdeps/aarch64/dl-lookupcfg.h b/sysdeps/aarch64/dl-lookupcfg.h >>> new file mode 100644 >>> index 0000000000..c1ae676ae1 >>> --- /dev/null >>> +++ b/sysdeps/aarch64/dl-lookupcfg.h >>> @@ -0,0 +1,27 @@ >>> +/* Configuration of lookup functions. >>> + Copyright (C) 2006-2021 Free Software Foundation, Inc. >>> + This file is part of the GNU C Library. >>> + >>> + The GNU C Library is free software; you can redistribute it and/or >>> + modify it under the terms of the GNU Lesser General Public >>> + License as published by the Free Software Foundation; either >>> + version 2.1 of the License, or (at your option) any later version. >>> + >>> + The GNU C Library is distributed in the hope that it will be useful, >>> + but WITHOUT ANY WARRANTY; without even the implied warranty of >>> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >>> + Lesser General Public License for more details. >>> + >>> + You should have received a copy of the GNU Lesser General Public >>> + License along with the GNU C Library. If not, see >>> + . */ >>> + >>> +#define DL_UNMAP_IS_SPECIAL >>> + >>> +#include_next >>> + >>> +struct link_map; >>> + >>> +extern void _dl_unmap (struct link_map *map); >>> + >>> +#define DL_UNMAP(map) _dl_unmap (map) >>> >> >> The fix looks ok to me (aarch64 supports tlsdesc, but it not >> calling htab_delete) but _dl_unmap is replicated over aarch64, >> arm, i386, and x86_64 (the architectures that supports tlsdesc). >> I think it would be simpler to add a define on linkmap.h to >> indicate the ABI supports tsldesc and consolidate the _dl_unmap >> code that call htab_delete on _dl_unmap_segments. >> >> It would allow to remove all the tlsdesc.c implementations (and >> dl-lookupcfg.h completely on some architectures) and simplify >> the required code if any other architectures decides to support >> tlsdesc. > > i agree. > > the last few patches allow even more refactoring > (by removing lazy tlsdesc code paths from x86) > > i think consolidation should be separate from the bug > fixes, so i plan to commit this patch as is. Right, but would work on the possible refactor? This should be that complicate and would prevent other architectures to incur in the same aarch64 mistake.