From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mr.tuwien.ac.at (mr1.kom.tuwien.ac.at [128.130.2.109]) by sourceware.org (Postfix) with ESMTPS id 569163858C66 for ; Thu, 12 Jan 2023 20:06:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 569163858C66 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=student.tuwien.ac.at Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=student.tuwien.ac.at X-Virus-Scanned: amavisd-new at vc5.kom.tuwien.ac.at Received: from mail.student.tuwien.ac.at (mail1.student.tuwien.ac.at [193.170.73.221]) by mr.tuwien.ac.at (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id 30CK6NAF007818; Thu, 12 Jan 2023 21:06:23 +0100 Received: from 84-115-221-221.cable.dynamic.surfer.at ([84.115.221.221]) by mail.student.tuwien.ac.at with HTTP (HTTP/1.1 POST); Thu, 12 Jan 2023 21:06:23 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 12 Jan 2023 21:06:23 +0100 From: Alex Wieser To: gcc-help@gcc.gnu.org Subject: Plugin access machine code Message-ID: X-Sender: alexander.wieser@student.tuwien.ac.at User-Agent: Roundcube Webmail/1.1.12 X-TUW-User: e11809898 X-Spam-Status: No, score=2.8 required=5.0 tests=BAYES_50,KAM_DMARC_STATUS,LIKELY_SPAM_FROM,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello, I am trying to implement a Control Flow Integrity scheme for a custom RISCV processor and want to use a gcc plugin to get all of the control flow info that I need. Right now I have a plugin as a pass after the eh_ranges pass, that is able to draw a control flow graph and emit new instructions. 1) Is it possible to access the final addresses for any instruction from within the gcc plugin? 2) Is there a way to get the actual machine code instructions in the plugin while still having access to the control flow information? (So still access to the basic blocks and their preds/succs) BR Alex