From patchwork Thu Jan 18 14:21:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 189219 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp373231dyb; Thu, 18 Jan 2024 06:22:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHeyaC7bJwmYP3DJJohENw9DwJz6H8C84G2JyQeOXYMvav1kkHq1xLf3DwIyF22ODD/0rWt X-Received: by 2002:a05:6214:2421:b0:681:81b6:2fe3 with SMTP id gy1-20020a056214242100b0068181b62fe3mr861032qvb.54.1705587740418; Thu, 18 Jan 2024 06:22:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705587740; cv=pass; d=google.com; s=arc-20160816; b=Rwxyw9vqphOCUzF65J6ZSJHV6ak11ruc8jOo3dacJv7GuHk2MvHPQNozxH+sccDfLu S8CF5AmjhrbtKWYDUGEuXGaHyB49KhMu6pNgrglWr5qwip9UQM0mEF0RztEatxByiQ+0 efVas9F3Pg6hQCaTVtgdIFXCCTKNQY/MP6J9dlKrXA2Sgz9L6tENR7QNxaVe+DJJpFET qXe9NR38WdyUBA0HbjwowfmZopfn8UwF9sYAZ0BcaOzCAGMK3mkzYG0Vf9anV/JyuAnZ AGqdiMgbbYLcWA03cnrpdK1/Ip79/g9Ez4+CGe9rY9qVH4DJPk8EofrlqdXu+d7aLeKe v0SA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=Javu7j92/t1mv00CovjXZb/UqKSZyDwCILFYgQGPebk=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=X1K1HUyHIHAhEK32uSfNjEu5W92MGuLQiq9794gdhLljpV6nv95Evl2JXIKV/qOlhi VRFH26It+nYDI/Ov8kJfpM9x9WMi16XR22sJ1nMjnTHQjrRfRrSbGYwLDygAqf71a+4V JESw+cvkzP1tu8wfuwhx3zTCKNcZ2lSYwdtXHWHFsb2heWYTW4nATIeiD4+nMiyS+Yla h/2M6GuBroMFqmZywmvwXjRIBopzODMEDJESgp6zMpSL43T9cvLwC6TI2aUepGCCP79H ZFMEJLBTcJxizIHJA47+/NikKaIQgOMvkgGGWHHK2PIOtSHF4yk3rV6APf084dFDWYFQ irHg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UjzHGaKD; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id e16-20020a0cf350000000b0068198aa2c65si560316qvm.91.2024.01.18.06.22.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 06:22:20 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UjzHGaKD; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 212C0385E453 for ; Thu, 18 Jan 2024 14:22:20 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 813F53858C2D for ; Thu, 18 Jan 2024 14:21:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 813F53858C2D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 813F53858C2D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::430 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705587697; cv=none; b=rXQyxY4l7lPVR62QLw9ApNLW/s8DHSEFgn/AWwGvK8OO7nZQqhDdABG4OX1TrRUfuWme9V5m0R5wTgXqIF8+olR1wIdd3Cldk1bLNXfntJRWcvSuttcpqVB/YoJLyF3JOSVI8WoUbPszsUkB8dvpG/y9XW3qHUaocRTcpwPC0bU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705587697; c=relaxed/simple; bh=kh8yJ1UmpWbDyhnRZJF+JLM2FAm5lOq8/rcGRKRVv8M=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=FCbePQzi+t8gIkuya9ueIguxyGjw0KqDueCNDVPtsw0GiEKbFZ+KWr0b3MCFq3fZk4K3WCNGmJuvcLrSnAmx2060BJEX2/xhOJessDp61dWbR+hmgVjBadywA6I30BquWJL2Bu4g9XG6P5ZTK0S3W8p/VyUb2wQ+AZZY5c+HbIQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-336c8ab0b20so10874812f8f.1 for ; Thu, 18 Jan 2024 06:21:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705587694; x=1706192494; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Javu7j92/t1mv00CovjXZb/UqKSZyDwCILFYgQGPebk=; b=UjzHGaKDzYmzY/KZOoMJlPT+EWiZZ2wZjKfLIpV4yZqOSoQo4rA0DCMTkkWnEi7RNW QhNImxowOT5wYd/2jcaYRbVha1rMkRJx34ZoFoZonYvNnHF9gkLMQbXS4hF0GT5NkbLs zOEj8UvqQ4w9ORqtjjtvd4IlIdzke+4jugCBEV1IDcQAZmyVLlp7j0Hc4PrRFw/pJWj/ 3TSB+a5gKBnXv+OVOPWzKNw7Od3SUSGLqtHSqrtQpyZakSZnjboJbMVoHnTi7/rgVYJI +DLVWFUcHeKULZsj7j99/EQjPL0WpE1SlY3k0QeVAHOS7sa2U8sOr01hEWHcHCuUa4Uv EnbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705587694; x=1706192494; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Javu7j92/t1mv00CovjXZb/UqKSZyDwCILFYgQGPebk=; b=a4h1xSyPM0EHP2dPxgBUSmAVzHRsRaH6DmT65roZ6rr8Jin1kfLuLz/jkc6eBVQqFQ vv7Cgq2NcKKCHD28IiMRikF2oG6XzHlJHbfRbL+YpmM93LNpahbJcMV5szQUgzR94RxH S5OKXdYdKLuV8ClGJDZijKc4gnujgAu7Wf2WCh2TWqLfTSYMrS1gjHdCHVRdrUaVuZ+v XRkGR1amRy9X4H7jpq9edVRTVfKYUQzRIYhhKfdIRQ0xAbgA60H0RRRAwmMcawY9HmyQ 2OHHWIqEWPuC+CJPnan2fFFRZl2coiZUyn7cI5daXJCSKHaZhTTCC+ZsKLhDgiT4TAIY hspg== X-Gm-Message-State: AOJu0YzYzPUX3WeSQKNi4cceJX/8oA3xZaomQVYjlgHRg8LV1cWOr+SO /pO0M0PLX5TUEfkYPUv+FSZBzhP4C9pmYVFo09P74wrXcggAfPHAx7VREEwh X-Received: by 2002:a5d:518c:0:b0:336:7674:dbbe with SMTP id k12-20020a5d518c000000b003367674dbbemr517874wrv.74.1705587694017; Thu, 18 Jan 2024 06:21:34 -0800 (PST) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id p13-20020adf9d8d000000b00337bcae5eb1sm4148553wre.72.2024.01.18.06.21.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Jan 2024 06:21:33 -0800 (PST) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [pushed] Darwin: Fix a typo in Objective-C meta-data. Date: Thu, 18 Jan 2024 14:21:32 +0000 Message-Id: <20240118142132.24592-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.39.2 (Apple Git-143) MIME-Version: 1.0 X-Spam-Status: No, score=-8.5 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, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: iain@sandoe.co.uk Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788438370289097928 X-GMAIL-MSGID: 1788438370289097928 Tested on i686, powerpc, x86_64 Darwin, x86_64 Linux, pushed to trunk, thanks, Iain --- 8< --- We have a typo in the metadata for assigning NSStrings to a specific section for the V1 (32b) ABI. When that is fixed we should never see the case where the section needs to be deduced from the properties of the DECLs. gcc/ChangeLog: * config/darwin.cc (darwin_objc1_section): Use the correct meta-data version for constant strings. (machopic_select_section): Assert if we fail to handle CFString sections as Obejctive-C meta-data or drectly. Signed-off-by: Iain Sandoe --- gcc/config/darwin.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/config/darwin.cc b/gcc/config/darwin.cc index b15f3b1a1d9..7f43718820b 100644 --- a/gcc/config/darwin.cc +++ b/gcc/config/darwin.cc @@ -1638,7 +1638,7 @@ darwin_objc1_section (tree decl ATTRIBUTE_UNUSED, tree meta, section * base) else if (startswith (p, "V1_CEXT")) return darwin_sections[objc1_class_ext_section]; - else if (startswith (p, "V2_CSTR")) + else if (startswith (p, "V1_CSTR")) return darwin_sections[objc_constant_string_object_section]; return base; @@ -1782,7 +1782,7 @@ machopic_select_section (tree decl, return base_section; /* GNU runtime is happy with it all in one pot. */ } - /* b) Constant string objects. */ + /* b) Constructors for constant NSstring [but not CFString] objects. */ if (TREE_CODE (decl) == CONSTRUCTOR && TREE_TYPE (decl) && TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE @@ -1804,6 +1804,12 @@ machopic_select_section (tree decl, else return darwin_sections[objc_string_object_section]; } + else if (!strcmp (IDENTIFIER_POINTER (name), "__builtin_CFString")) + { + /* We should have handled __anon_cfstrings above. */ + gcc_checking_assert (0); + return darwin_sections[cfstring_constant_object_section]; + } else return base_section; }