From patchwork Mon Nov 28 12:04:51 2022 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: 26716 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5613008wrr; Mon, 28 Nov 2022 04:08:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf7W0nwlFZyNnxgmWNWmhRKilurQ4DlMH6EOzRRsX9zhPb1BJ/kqgEOq/IbG606YVRY1Zf7v X-Received: by 2002:a17:906:5055:b0:78d:cdce:bc52 with SMTP id e21-20020a170906505500b0078dcdcebc52mr28036355ejk.469.1669637284447; Mon, 28 Nov 2022 04:08:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669637284; cv=none; d=google.com; s=arc-20160816; b=ROgn9IepajHb/UNw1e45Ju2Ju64qcPahMr99JYOcbgqr0M7lhBt7NMr8qZY7R7mJzw HjSCZ2BEKi2a0JZuu5qtKgL6D4oxx6HKqAi/gYoQRIyVGsSc4Iwv7xLE9qECgzpOPANN Ts6NSEUaJ30ERUP3mKP7kTHBz8GJrhHX0H2DnJtundqgSelm03jO9FxVWMtcrWPkJKId Xv6zri3zjtiy449Div17H+4/yWQj5SOuARkESdkwwCD4UwSPGA3giAJH39Tlt1l/5mFg kb12XUerFSaA18QezH6kbcmIwrLSKNXRgB+ttv3vEztINWPevfx0UuW1WUARjpaL20N/ HF0g== 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=BR+el4ucljNhT+RPObFcsYCSzR/8w30ebXYgnceo1ZE=; b=SDpa6FMF3iVEoKhwPoL6u1mbXJ3z9wVIqcwuS8O/+GKl4O729ysRmCZMnerAkfRDot F90+ntJoGoPzJxiIMgqim6hNesZTX/x2tzlAHMi8ov2ThX4ic3/ELSMsQnrGgCCcF5fI cJwjy0PIhyVWbX19l6u2GqVSfj0UFwPLIo7KvmYndmS6X54wKoqjxs82cap/ylxRYjy0 pBfDClZEhlyvbv9nP/1hKvgbK57GhwcRlkGiDP/6lTU7orwwnnCxgbBAJei22Qh/bQSy BFNRr1pF2NgE8b7ZZq3GHlkPEppHKaMmwO0Fxr3K88i7+U5ZkoIjFTBP7A+hpFzdRBMW HeYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=wPWTHT+W; 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id tk23-20020a170907c29700b007af0ca23291si7201630ejc.906.2022.11.28.04.08.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 04:08:04 -0800 (PST) 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=wPWTHT+W; 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 DD3CF385516B for ; Mon, 28 Nov 2022 12:06:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD3CF385516B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669637194; bh=BR+el4ucljNhT+RPObFcsYCSzR/8w30ebXYgnceo1ZE=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=wPWTHT+W/Xi33jKu3fO0fsc+XrM+hTrSw3jJ4nNmWMmxoIYCqWhwx32GNMAC5TEnl L8AU/kLNf6ZUhVxyanyGZ3NfAKxGrSMxFBmGsP2sIO99latvYjxpGxy8lYFra28ncl tyV0oav/YfA4a0F5xEm8NzwaZgD50Ij6Kjq5h8YA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id EF0B73858409 for ; Mon, 28 Nov 2022 12:04:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EF0B73858409 Received: by mail-wm1-x329.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso8196375wmo.1 for ; Mon, 28 Nov 2022 04:04:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=BR+el4ucljNhT+RPObFcsYCSzR/8w30ebXYgnceo1ZE=; b=5p5WZ1VwZg9G9FVt+To77ZdrdnUGjrlchyH6bQGeQlM8aq4BJPTtF6+JIbpfNaL0Su lDG0hUo8jDcJM4U3aS+/au94YJOBoVOSo7H7bVaVzGAMiC/iP2OIXy38XBEL71EeC2Lb 5MP5Vi5Th6l49dT9Gj4L2DdNG9CuvbJQmTX+wFW8Datkbwu9w5D7xToZNSpNQpvwM/Yl fWTT5D6ofAe7FKjqICEgRaMIYHvzhOmtW5IC0FeHVuQhvX5lqfcvEbmd5E39GSVhzden /X73c+8PO4dfDOLDw4GmKN3/ky4fZDHpGi9Z+EqKz8ZO3kKNiirey0ZBE8FAWKbigy6g SCKg== X-Gm-Message-State: ANoB5pnXf3inSRK0JWdSUVEjnGq7tZilxT2xUg2k2JPhATI7mc/YeIZL AS8Soyloh7jPLwabvDtLUwubVlpadbUVqA== X-Received: by 2002:a05:600c:4194:b0:3cf:5080:412c with SMTP id p20-20020a05600c419400b003cf5080412cmr39196693wmh.99.1669637094735; Mon, 28 Nov 2022 04:04:54 -0800 (PST) Received: from localhost.localdomain (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id n2-20020a5d4002000000b00241727795c4sm12572852wrp.63.2022.11.28.04.04.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 04:04:54 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Add PIE support to backtraces on Linux Date: Mon, 28 Nov 2022 13:04:51 +0100 Message-Id: <20221128120451.171477-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 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 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?1750741585515062365?= X-GMAIL-MSGID: =?utf-8?q?1750741585515062365?= From: Eric Botcazou gcc/ada/ * adaint.c [Linux]: Include . (__gnat_get_executable_load_address) [Linux]: Enable. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/adaint.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 199dbe0e405..d2604ca9b77 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -3524,6 +3524,8 @@ __gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) #if defined (__APPLE__) #include +#elif defined (__linux__) +#include #endif const void * @@ -3532,10 +3534,8 @@ __gnat_get_executable_load_address (void) #if defined (__APPLE__) return _dyld_get_image_header (0); -#elif 0 && defined (__linux__) - /* Currently disabled as it needs at least -ldl. */ +#elif defined (__linux__) struct link_map *map = _r_debug.r_map; - return (const void *)map->l_addr; #elif defined (_WIN32)