From patchwork Tue May 16 08:40:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 94521 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp271281vqo; Tue, 16 May 2023 01:44:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5GOxtamdz/2n6jfXhrrYiPS9DyMrA4fK4zdqWRoWbH8000Qj57ez5nPHoft+2IxSFYLLwO X-Received: by 2002:aa7:dd42:0:b0:50c:804:20bb with SMTP id o2-20020aa7dd42000000b0050c080420bbmr33102354edw.16.1684226684172; Tue, 16 May 2023 01:44:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684226684; cv=none; d=google.com; s=arc-20160816; b=IgJx3gK0qXxpv7cunSzsU++yYdbiTFqat/44WwN8o2TNrmh5EPSL5VDed9h+ZtLoMY 0NMvrFJwFSAs9yLvLkOWQw0KnM8o7HcqrbH+Mg+E+5d9WZ9ZQ/paFQXbabVUhQFZtgZ8 GdAqozq1n5uVqgKWAFWcUPaqSfGfJUiuaEf7NcpfoUr2+WxKjSFpOaVBIZH6P+EPro4N 3rltOLjdhy4I1VAe/eIsjti7jjlo043evGvrM7ArfOUite+1kOzVfU/vDl+My2kAUkGV IRBTaOEVMkCRWWmnrSJrCtD+VlWrqfNM0u0FHsxabH7m/D9kdkRGrN2npZOf+ys8biCI Ij+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=Za5LIEwQLG1luS6DPyvFmTj14C/DPYdY+iWrN4rGD+Q=; b=B0QL909FgGbodnW46uo/mAuo1PDFws01GcN29FN3pl0JwoM8JuEHI9yZv3yy1LhRET p/a4NJljFhW8ImTrOkAhFh9FVWaLeJQKTXVah5Uow2ep8i3iN9Uop1WtIIZuTwIO1XWJ hYR+LuGuMuhVgehgUJy4/16JPl5ivWrdy3eiVI8Qdr9Dzq8j6U9gst/CKTPBBcxNsVzM hUY/38ClL3BAst3c6Cx2g1Fn69hUuQSutXib78WRKJ7KZyONjLG+nB2Ytb8bpuUWYbgi IlE4KL7HLaTe/QLJGQZv4sIGG9i3AdGuscliygyhLz3zLOP6c2f6k53cqjGmW7TBg1C+ AxEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=cvrBERvx; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id f13-20020a05640214cd00b0050bc5ffdee1si12050045edx.462.2023.05.16.01.44.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 01:44:44 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=cvrBERvx; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BD9F23883021 for ; Tue, 16 May 2023 08:42:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD9F23883021 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684226529; bh=Za5LIEwQLG1luS6DPyvFmTj14C/DPYdY+iWrN4rGD+Q=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=cvrBERvxHyyRtBneobWNCTB+vQVbzSfDPpkNvuAPRceH7EAAKAxVsZIhQU9gxwiUX PdBWX7FRpyhET05HKrhDCVy5DnNxb0cnKhKBwP0GNvWv7yf6ZvnrFYZJ6+UqD4USqD zLwUwQ3O7LaERCWHSvrIDu0n4MMFfdZJ3odH0qA8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 5E4A13854163 for ; Tue, 16 May 2023 08:40:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E4A13854163 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3f509ec3196so16204605e9.1 for ; Tue, 16 May 2023 01:40:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684226450; x=1686818450; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Za5LIEwQLG1luS6DPyvFmTj14C/DPYdY+iWrN4rGD+Q=; b=dG+5eHzIr9tQGT9XaFf8W/l1RzYBAcoqkb/5HJzycM0HJwQmnXIRhVMFwGKxBur4HH ppMECFkhGfi50fz3dnwDCOjOfIT5E1eciUPzIhRtZNb86xpFi/sc99FdKgxBVzVBowv5 CY58HNk2rWcXYezGa3R6I5NmZMjEnc8kvT3Z801aDQenVPu6pRCcmLwW0alYuzcupcVV maHQRRC/SCqAwbHozE0idPxb+C031JPcuUVNaXVaZ7ykQj2UPuVVuXekyULpqHoNEUH7 OwYIP8mrInsOyIn7DNmhEX/OGuN7P+Wb3q2wF2hlss95yHhn6bcVnkwm34VSzguImMk/ RqkA== X-Gm-Message-State: AC+VfDwJUPJphLKe/OijtCjyT3D5yMOaAcuN2Sx9QxBYv8gNowwqXxrg YHWDQSzzIuQ2AOcwjsToqOIii9u6dulosyEI+qfbXQ== X-Received: by 2002:a1c:7702:0:b0:3f1:8129:2c53 with SMTP id t2-20020a1c7702000000b003f181292c53mr27805835wmi.16.1684226450123; Tue, 16 May 2023 01:40:50 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id g9-20020a7bc4c9000000b003f182a10106sm1580872wmk.8.2023.05.16.01.40.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 01:40:49 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: =?utf-8?q?Marc_Poulhi=C3=A8s?= Subject: [COMMITTED] ada: Fix Ada representation of r_debug and link_map types Date: Tue, 16 May 2023 10:40:48 +0200 Message-Id: <20230516084048.1501804-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766039679630903885?= X-GMAIL-MSGID: =?utf-8?q?1766039679630903885?= Both record types need to have their components 'aliased' to match their C version. The mismatch could be observed when using LTO: warning: type of 'r_debug' does not match original declaration [-Wlto-type-mismatch] /usr/include/link.h:66:23: note: type 'struct r_debug' should match type 'struct system__traceback__symbolic__module_name__build_... ...cache_for_all_modules__r_debug_type' gcc/ada/ * libgnat/s-tsmona__linux.adb (link_map, r_debug_type): Add 'aliased' on all components. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/s-tsmona__linux.adb | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/gcc/ada/libgnat/s-tsmona__linux.adb b/gcc/ada/libgnat/s-tsmona__linux.adb index 7e1b493c991..6b539f13c16 100644 --- a/gcc/ada/libgnat/s-tsmona__linux.adb +++ b/gcc/ada/libgnat/s-tsmona__linux.adb @@ -93,23 +93,30 @@ package body Module_Name is pragma Convention (C, link_map_acc); type link_map is record - l_addr : Address; + l_addr : aliased Address; -- Base address of the shared object - l_name : Address; + l_name : aliased Address; -- Null-terminated absolute file name - l_ld : Address; + l_ld : aliased Address; -- Dynamic section - l_next, l_prev : link_map_acc; + l_next, l_prev : aliased link_map_acc; -- Chain end record; pragma Convention (C, link_map); + type r_debug_state is (RT_CONSISTENT, RT_ADD, RT_DELETE); + pragma Convention (C, r_debug_state); + pragma Unreferenced (RT_CONSISTENT, RT_ADD, RT_DELETE); + type r_debug_type is record - r_version : Integer; - r_map : link_map_acc; + r_version : aliased int; + r_map : aliased link_map_acc; + r_brk : aliased Address; + r_state : aliased r_debug_state; + r_ldbase : aliased Address; end record; pragma Convention (C, r_debug_type);