From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id 380183858D39 for ; Mon, 3 Apr 2023 23:05:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 380183858D39 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id A468328A56B; Tue, 4 Apr 2023 01:05:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1680563118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=N/tyRjXS4F9Ou7BmfdzqY7pHRIU7hjMoUhzsoaaGhwM=; b=S/iWmd2emBC1ZJUcD86uj6H6dzzrvA47TWluXrDJzeqzaamKoOp/u9vEnzaqZh9MrbdMaU EXmiHE4nPW5FWKIZ75cv7VYG4KvC4ohjyZeD4VIdNKL0DUaTMt5LyFbe36o/7YSWD3AgF6 +fGjl+pAifqHZdHZefsscqMyZHzkH7c= Date: Tue, 4 Apr 2023 01:05:18 +0200 From: Jan Hubicka To: Rishi Raj Cc: gcc@gcc.gnu.org, mjambor@suse.cz Subject: Re: [GSOC] few question about Bypass assembler when generating LTO object files Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello, > While going through the patch and simple-object.c I understood that the > file simple-object.c is used to handle the object file format. However, > this file does not contain all the architecture information required for > LTO object files, so the workaround used in the patch is to read the > crtbegin.o file and merge the missing attributes. While this workaround is > functional, it is not optimal, and the ideal solution would be to extend > simple-object.c to include the missing information. Yes, simple-object.c simply uses architecture settings it read earlier which is problem since at compile time we do not read any object files, just parse sources). In my original patch the architecture flags were simply left blank. I am not sure if there is a version reading crtbeing.o which would probably not a be that bad workaround, at least for the start. Having a way to specify this from the machine descriptions would be better. Besides the architecture bits, for simple-object files to work we need to add the symbol table. For practically useful information we also need to stream the debug info. > > Regarding the phrase "Support in the driver to properly execute *1 binary", > it is not entirely clear what it refers to. My interpretation is that the > compiler driver (the program that coordinates the compilation process) > needs to be modified to correctly output LTO object files instead of > assembler files (the current approach involves passing the -S and -o > .o options) and also skip the assembler option while using > -fbypass-asm option but I am not sure. Can Jan or Martin please shed some > light on this? Yes, compiler drivers decides what to do and it needs to know that with -flto it does not need to produce assembly file and then invoke gas. If we go the way of reading in crtbegin.o it will also need to pass correct crtbegin to *1 binary. This is generally not that hard to do, just needs to be done :) Honza > > Thanks & Regards > > Rishi Raj > > On Sun, 2 Apr 2023 at 03:05, Rishi Raj wrote: > > > Hii Everyone, > > I had already expressed my interest in the " Bypass assembler when > > generating LTO object files" project and making a proposal for the same. I > > know I should have done it earlier but I was admitted to the hospital for > > past few days :(. > > I have a few doubts. > > 1) > > > > "One problem is that the object files produced by libiberty/simple-object.c > > (which is the low-level API used by the LTO code) > > are missing some information (such as the architecture info and symbol > > table) and API of the simple object will need to be extended to handle > > that" I found this in the previous mailing list discussion. So who output this information currently in the object file, is it assembler? > > > > Also in the current patch for this project by Jan Hubica, from where are we getting these information from? Is it from crtbegin.o? > > > > 2) > > "Support in driver to properly execute *1 binary." I found this on Jan original patch's email. what does it mean > > > > exactly? > > > > Regards > > > > Rishi Raj > > > > > > > >