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: 84186 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 99C40384DECA for ; Tue, 16 Jan 2024 15:00:49 +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-Google-Smtp-Source: AGHT+IHFqGhBKravYp/LQ0KF6BeB3l1WARe+vzE8pcsVl6VMbfbHMOdJW66f6DaiIjhfAD+93id5PQ== 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+patchwork=sourceware.org@gcc.gnu.org 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 */