From patchwork Tue Jan 16 15:00:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 188541 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:42cf:b0:101:a8e8:374 with SMTP id q15csp311173dye; Tue, 16 Jan 2024 07:01:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFU2L3UbDWoAswJW3FI4lpGCYaonQm4YDet6wTk9z/pasmCkRJvXu9uD28LycDlBEHDXSSq X-Received: by 2002:a05:620a:2056:b0:783:49da:b0f4 with SMTP id d22-20020a05620a205600b0078349dab0f4mr6703327qka.17.1705417262718; Tue, 16 Jan 2024 07:01:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705417262; cv=pass; d=google.com; s=arc-20160816; b=az99yRWERwX1dCxzjYWIrz/z768H2PZU9mTqsDXlCIr3GstOTAjTBxOXnAtKLpssQE woBMpMtbxov2DtZlnBADX4n5GNyIvSPYy/OfqJXAygZ5a0CguUbwhjI9R8p+jLbgjbyJ OxmbQbspuVEjbqGxDBftWFOI5gpR+1Mx6FCwdLkMJdTVCryEqSkwfFJvBcEIIYU2XNzk B3HH6dLxtYjYHLxA0Ps8PYPVn/fgGlsTcbZVehDR6diDH8lJrFsE20pra7CJg13t/XfG dDwwwYOPhHRg6DAnbE0VDlpediKvbIRb2ZK3lhGPhqHNBihLuxl9Rt3Km1mJzRMFploe wGAg== 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=CjI720JKZFI6NRJ8TaLG0faowpFdX450CsSa8t27q9U=; fh=PmjGP+4WfLespApLYQigrPutik1D+goaATa7/0cvu4g=; b=mkfYqOmF3sjThpFRo2iGg1IkGUtHvj5ViouySiLbPtv1KQGBDonPaoT177z/Jncf0/ 1c8By0hPF/7woJAEK44CUbYVDlJlGHD4mfs88Vwjjk/wbpQGb3wooDj/wrBML6XObmZn EUefloetQjiO3104FxCw4zX/tTuIN+jiht1l/24QWBycU6dm6OBnhsTP4lYa39Wo3uWu 2w9+Y/wDUVHvqjxxsNpS5HsAvPY/Na1U7m1PXpi63z9OAKUiNT+5tt81pSbgbIXUxwFt fMsNVZW0YgAoozidD72Tskycs8ky0ouDXnq2wMjXQGtXVpNka0lmgHfA4vY8QxnPu1rY V6Yw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Ym+O8pTL; 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 c17-20020a37e111000000b007832de14c10si9898727qkm.585.2024.01.16.07.01.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 07:01:02 -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=Ym+O8pTL; 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 6D58E38618A0 for ; Tue, 16 Jan 2024 15:01:02 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id A64A73861803 for ; Tue, 16 Jan 2024 15:00:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A64A73861803 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 A64A73861803 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::334 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705417223; cv=none; b=K+2XVvV0Ei87hmzrFitrNyiiczg32zw0aW0vxtg6dAU9Af+rNwZ8IQPBSCIpRBkHLC33YUc0Ph9ZIm6M5vQ8wq3GJ+hPkhi7IYJpMjJ5ssLpmNldIs743yI/wK7XSZsoHhmORPJ5YfGBPMqo3mSooBzm/g5g5Fp0uM7pbCfb290= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705417223; c=relaxed/simple; bh=i27fY7Lc7eQBJ7w5dCrmnUw/Fnt6aLQhZbzrst1k1Uw=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=vK0jmc68p04kFjSHWh113nHF6pYqmlBQuUEGKVlYuf/jWlitXzk63OD6rAzb0d/vUkUE2wevFmOD1BoC9IQyt8FlkdGAeSOg57KCCmUNQDC7iyJ2S3a1Ya3g3mNi02WqavOUnqTwl0LaB4l8VlGVKai0K65MVudXGL+Jy1qaOlg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40e800461baso13507435e9.3 for ; Tue, 16 Jan 2024 07:00:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705417218; x=1706022018; 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=CjI720JKZFI6NRJ8TaLG0faowpFdX450CsSa8t27q9U=; b=Ym+O8pTLFkgtXck9VUY5rE4sMG+nQnY7FsZ4ZMQ2LZK2AEIkQhcoXoOgkp6hWEiHwF ZVuv/DidKtAkHzRZk9Rjv4qXOrD0MCEv0atqt7gVftgiudewO14QI7rQih6L7ArhJf/3 3ycJFZNGuN8984bCHJrB70RsoJiSZ6FGkdWAqruZulxLgT+qNaZiX7xPWSqylrZmax0L z/Oq+XL/HyGS6IEaUoAjB4x0DrhxQpbLu/TojPqIn5VSXsUZbqevqckX79VMJsxLgvCr Pawg6AYlEGKPkGLEnB5i2ulu1/9KX6cO9mhnHiBRnlqMwdgQqvmUHah/KuqiY95BKvhy 1bJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705417218; x=1706022018; 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=CjI720JKZFI6NRJ8TaLG0faowpFdX450CsSa8t27q9U=; b=IZ1KOqWkcONu5ygZ+ug5216e6qzxv6BsVwZwxyaLNMSIL+O5PGN69Ppvv81YivEAyA DdUD1P0p15c+OjmxKGuD7v7Sw65/EyaUx/sve9klQw9wl5IB8ERODwHQlvA55vXUwP8j E5/ZHXpKca0tu0tByvf+QbErBiOq0LvZ8AA9y/1L66KyHrcyYMye6IqVS9amKwcvyLuA 7nCg5IbBrAPNblv6KTSzS3Lz6e3hMel/neusAKSbi1y7jUZp+VDmUWxnJxBdgw7HSKtw hTGYSIgP30o2ezyCnOPNbZamSJW4/AlVJSDMqGH1jD6zbvXIwxVGwtNY07VQAWMvNaCl tZ1Q== X-Gm-Message-State: AOJu0YzC6jVTIld6CtUXS/XO78X4m6GTtdzzPTrFPpnMxKRkc4iRz5hr 2v0IayyCOU6vHpYhMS+6dkM= X-Received: by 2002:a05:600c:6a07:b0:40d:7da9:8662 with SMTP id jj7-20020a05600c6a0700b0040d7da98662mr2093282wmb.338.1705417218115; Tue, 16 Jan 2024 07:00:18 -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 n22-20020a05600c4f9600b0040e53f24ceasm19574890wmq.16.2024.01.16.07.00.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 16 Jan 2024 07:00:17 -0800 (PST) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: hubicka@ucw.cz, gcc-patches@gcc.gnu.org Subject: [PATCH] lto, Darwin: Fix offload section names. Date: Tue, 16 Jan 2024 15:00:16 +0000 Message-Id: <20240116150016.3471-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: 1788259611880710532 X-GMAIL-MSGID: 1788259611880710532 Tested on x86_64 Darwin, x86_64 Linux. OK for trunk? When? thanks Iain --- 8< --- Currently, these section names have wrong syntax for Mach-O. Although they were added some time ago; recently added tests are now emitting them leading to new fails on Darwin. This adds a Mach-O variant for each. gcc/ChangeLog: * lto-section-names.h (OFFLOAD_SECTION_NAME_PREFIX, OFFLOAD_VAR_TABLE_SECTION_NAME, OFFLOAD_FUNC_TABLE_SECTION_NAME, OFFLOAD_IND_FUNC_TABLE_SECTION_NAME): Provide Mach-O syntax versions when the object format is Mach-O. Signed-off-by: Iain Sandoe --- gcc/lto-section-names.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gcc/lto-section-names.h b/gcc/lto-section-names.h index a743deb4efb..1cdadf36ec0 100644 --- a/gcc/lto-section-names.h +++ b/gcc/lto-section-names.h @@ -25,7 +25,11 @@ along with GCC; see the file COPYING3. If not see name for the functions and static_initializers. For other types of sections a '.' and the section type are appended. */ #define LTO_SECTION_NAME_PREFIX ".gnu.lto_" +#if OBJECT_FORMAT_MACHO +#define OFFLOAD_SECTION_NAME_PREFIX "__GNU_OFFLD_LTO," +#else #define OFFLOAD_SECTION_NAME_PREFIX ".gnu.offload_lto_" +#endif /* Can be either OFFLOAD_SECTION_NAME_PREFIX when we stream IR for offload compiler, or LTO_SECTION_NAME_PREFIX for LTO case. */ @@ -35,8 +39,14 @@ extern const char *section_name_prefix; #define LTO_SEGMENT_NAME "__GNU_LTO" +#if OBJECT_FORMAT_MACHO +#define OFFLOAD_VAR_TABLE_SECTION_NAME "__GNU_OFFLOAD,__vars" +#define OFFLOAD_FUNC_TABLE_SECTION_NAME "__GNU_OFFLOAD,__funcs" +#define OFFLOAD_IND_FUNC_TABLE_SECTION_NAME "__GNU_OFFLOAD,__ind_fns" +#else #define OFFLOAD_VAR_TABLE_SECTION_NAME ".gnu.offload_vars" #define OFFLOAD_FUNC_TABLE_SECTION_NAME ".gnu.offload_funcs" #define OFFLOAD_IND_FUNC_TABLE_SECTION_NAME ".gnu.offload_ind_funcs" +#endif #endif /* GCC_LTO_SECTION_NAMES_H */