From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 275CF3861857 for ; Tue, 20 Apr 2021 16:51:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 275CF3861857 Received: by mail-pf1-x435.google.com with SMTP id h15so8280745pfv.2 for ; Tue, 20 Apr 2021 09:51:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZBMNtAy+IIXWRgLHtgXsuhbEHAnXDFJJXHzh5sBSKvs=; b=ASq5iipbpHbi3wMO7RPCkuPVzmw/oJBLW1bk5Z9mLcwFx6BO72ZZGu0OxAooTvCN7T K24Zp2J3P/G3yRN6unbXGd/ojcJ2K2XeRYi3dT/DaDoml67igoOZrREntBAIvC83OA46 jNXuLvGFcGNQvWYWj6yIJwh9gSU8H8tEaKvmYG36fKkk/SEfHUwSXv0IA8uaQ4+TSDfN xZ8mTVY/Af+ibuZT3LC4osHcjNs8CvHbfMRS3qMY9FB96xr/R6V8unO5j6XqBk6DJRhF 7pdwcdMaUdR5bs18utvu3jD9ezRWI0xh06QBQHLnVisNJvZzRLSfTKHb0ujL/xbkWPUW sZOQ== X-Gm-Message-State: AOAM532h3gHNq5xMXZLLfeezRC+UeAoTjLUdM78w7oYktdIxTo5KHPzN J1jVrVraBJOFHbHz17W7ZoDoK/yRVEZuWcqiFaR9IA== X-Google-Smtp-Source: ABdhPJzbtMMNL32PGbwNBmL6OauffHoDEK8ZnDimyOPCHEE8DT350ByawMfK2dvOyy4fhlFKMVy6x1W8XXLuZk9Ho9U= X-Received: by 2002:a63:40c1:: with SMTP id n184mr17709331pga.219.1618937514357; Tue, 20 Apr 2021 09:51:54 -0700 (PDT) MIME-Version: 1.0 References: <20210419072902.GB9028@arm.com> In-Reply-To: From: "Carlos O'Donell" Date: Tue, 20 Apr 2021 12:51:43 -0400 Message-ID: Subject: Re: Best reference for understanding ELF format To: noloader@gmail.com Cc: Peng Yu , libc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 16:52:05 -0000 On Tue, Apr 20, 2021 at 12:39 PM Jeffrey Walton via Libc-help wrote: > > On Tue, Apr 20, 2021 at 12:29 PM Peng Yu via Libc-help > wrote: > > ... > > People don't usually directly call ld to generate object, executable > > or shared library files. > > > > Instead, gcc/clang are called. So there is nothing wrong to say those > > files are produced by gcc/clang, at least at a superficially level. > > You can say that gcc/clang don't directly produce the ELF files. > > Nevertheless, this doesn't add too much to the topic of this thread. > > I think Clang can produce object files directly. Clang has an > integrated assembler. Conceptually the point is the same though. The compiler relies on an assembler and static linker to generate the object files. Whether that assembler is a library and the invocation is a library call, or it's a secondary process via a pipe, the concept being discussed is the same. The compiler itself (language front end, or driver) doesn't produce ELF format object files. Technical clarity around these distinctions helps at a later stage when we're trying to explain other concepts where the distinction matters or where the distinction is muddled e.g. LTO, ThinLTO etc. Cheers, Carlos.