From patchwork Sat Dec 2 00:46:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 843847 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-468385-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="WsmhKyNX"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypXWc3KYsz9sMN for ; Sat, 2 Dec 2017 11:46:15 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=s+rclrZ8eD/rQZpouaxeLHbaOrKowGAAqejauAH2GhcaDr XF/lndDqVI8A1FxpodN2M3sK8EmbhbHfCdqhzRk9QBfxKuCJJpSxOrgFZEIyN35C rtgRpLb6BL4plabcarM5q1qWQ4VsWTZFuS/Uu9tBuNSDr5BouXTwww2UYu5x4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=XgMCYjNKpTT6ha1g/w+Wmd0Um4E=; b=WsmhKyNXw91ZVHMDL5n2 MO1CQ6+sAEYHYn0gp95ejxZDz12cP8Iu01yiaMe8quAvXgx7fUKlCYEsw4ta3rd5 Tzt601eD95JNcWGGOlOcANzczqjaV7+0gRZ7wzvcsf3BYpgBEp7zjYzYmM9lR9P9 lDlwe4e3/h86J35rls1ZTRA= Received: (qmail 82767 invoked by alias); 2 Dec 2017 00:46:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 82756 invoked by uid 89); 2 Dec 2017 00:46:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f46.google.com Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com) (74.125.82.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 02 Dec 2017 00:46:06 +0000 Received: by mail-wm0-f46.google.com with SMTP id r78so6297607wme.5 for ; Fri, 01 Dec 2017 16:46:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=cc+kAUZsW56JvwgIORdAQYqMp5BGnPp/81VwcbLgqGM=; b=AcDfURkC3T3vCs6luEp1QQuVebgCguX9xcJMNKS4XDVVatUM7zLWn9Mon/dO/w1q3o zyK/3IY7wWMhaU6g9XbvIK7GfaltETznG0PdRn2caDBozffUjO/kapVCRoNprsamN8k/ uT9zPgr1/TMts6rRjfVnoKIwji9cJZVdEgmBN/ZDnHz1FfIa+ysp4cwBcm8BQQKEvgYU KNbG92VVjyqzKKaYczaHETd2jiEnVLx5j/PfuWiuuk8mncycOQ4KXDFRqbbUbsM9gehb fZvT65w2mjuBbVua+pUlQA0l/gmK6/bBxUa/vpQFTtGvtGfvWe17fu69Sm1DsRQV1g8D kH8Q== X-Gm-Message-State: AJaThX5vncgJUKAB6nroVWnEWjwO3we2ku9qxICOw6+O7yIg63lsJMqh mMuCyNM3bgGOAfrfHVuHqPveoquE7G9lQd5Z86JOP6HO X-Google-Smtp-Source: AGs4zMYNbavu9JIPGFWWkdF3JR6sT4sqpVoAQCA6YaLiD/NF9wu1o25lpQ3TfX8xS+jVfJ/kChnW4Q2S/H5Dn50GYXE= X-Received: by 10.80.148.199 with SMTP id t7mr20109853eda.124.1512175563606; Fri, 01 Dec 2017 16:46:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.179.221 with HTTP; Fri, 1 Dec 2017 16:46:02 -0800 (PST) From: Ian Lance Taylor Date: Fri, 1 Dec 2017 16:46:02 -0800 Message-ID: Subject: libgo patch committed: Export cgoCheck functions To: gcc-patches , "gofrontend-dev@googlegroups.com" This patch to libgo exports the cgoCheck functions. The functions cgoCheckPointer and cgoCheckResult are called by code generated by cgo. That means that we need to export them using go:linkname, as otherwise they are local symbols. The cgo code currently uses weak references to only call the symbols if they are defined, which is why it has been working--the cgo code has not been doing any checks. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 255346) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -1949a203fca0c8bde6f2690ebc36427c5e3953c7 +338f7434175bb71f3c8905e9ad7f480aec3afee6 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/go/runtime/cgocall.go =================================================================== --- libgo/go/runtime/cgocall.go (revision 255340) +++ libgo/go/runtime/cgocall.go (working copy) @@ -11,6 +11,10 @@ import ( "unsafe" ) +// Functions called by cgo-generated code. +//go:linkname cgoCheckPointer runtime.cgoCheckPointer +//go:linkname cgoCheckResult runtime.cgoCheckResult + // Pointer checking for cgo code. // We want to detect all cases where a program that does not use