From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by sourceware.org (Postfix) with ESMTPS id 7E86B3858025 for ; Tue, 20 Apr 2021 13:40:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7E86B3858025 Received: by mail-io1-xd2c.google.com with SMTP id a11so36378153ioo.0 for ; Tue, 20 Apr 2021 06:40:29 -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:in-reply-to:references:from:date :message-id:subject:to; bh=y6WW1O1laheyTHrm2PtpThQYzM6jPIvimrZ0wbS/CCs=; b=bNyIhqDhdDnR9EdPswLIWRU14BvhfPVr56UdTgyVllKQ1N5/DF2Nu9z1IDJfJgKp7J PKB+6DedDXEJ5gJ0z8Umn9BLzcIO6nvafP/8MSuYhuVP0+tRWtxICULDb+EgN6fcuOj1 Tkh+YcTbjUOOdbeQfkZAuoHoKGuHkzx8Bua0HwCu/Cca/itXAGI6WnFEcHMO5wdAyYN4 5TZg8+9OroXBe8jhjUyKS3soEqyf+n7/xKnH5xCyWVA+Ppfe8qmQPsMZkO3G+2yGrTga BFUGd2dQD3IBZrCKx9WwfbXbbAwX69yHXhF0jel3evwAJXv5xZ1n7I0BYsQfk551xtmS RvcA== X-Gm-Message-State: AOAM531zZU01HkxBzAI/dFr+Zc/jJvu6QdgSp3/6pc1l0wHeuah6nh3R ZOX5gnQG8iB0YAHiUBpytL3ekMyAKhr+d2nckX8= X-Google-Smtp-Source: ABdhPJzjKTRnDsn8X81fcwzbfY0Q7vv/DU32Ylx5F/aCYOUX2iQHdBgkSvlwF4yjoDfx8Ow/+9F5P8x99yOF64zrhxA= X-Received: by 2002:a5e:8304:: with SMTP id x4mr18767860iom.53.1618926029042; Tue, 20 Apr 2021 06:40:29 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:750f:0:0:0:0:0 with HTTP; Tue, 20 Apr 2021 06:40:27 -0700 (PDT) In-Reply-To: References: <20210419072902.GB9028@arm.com> From: Peng Yu Date: Tue, 20 Apr 2021 08:40:27 -0500 Message-ID: Subject: Re: Best reference for understanding ELF format To: Peng Yu , Szabolcs Nagy , libc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, 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 13:40:39 -0000 On 4/20/21, Mike Frysinger wrote: > On 19 Apr 2021 20:58, Peng Yu via Libc-help wrote: >> On 4/19/21, Szabolcs Nagy wrote: >> > The 04/17/2021 07:31, Peng Yu via Libc-help wrote: >> >> That is a book. By definition, a book will not be complete since a >> >> book is not written for completeness? >> >> >> >> For the best reference (as "reference" may have muliple meanings maybe >> >> I should use the word "spec" to avoid ambiguity), I found the >> >> following two documents. One is for 32-bit, the other is for 64-bit. >> >> Are they the most current ones? Other there any other documents that >> >> cover the things missed by them? >> >> >> >> https://refspecs.linuxfoundation.org/elf/elf.pdf >> >> https://www.uclibc.org/docs/elf-64-gen.pdf >> > >> > elf spec is part of the system v abi document. >> > the generic part is in >> > http://www.sco.com/developers/gabi/ >> > the processor specific part is published separately by >> > whoever does the tooling for the particular processor. >> > >> > (all this can be found out by 5 minute research on wikipedia) >> > >> > but since you asked for easy-to-follow and for >> > understanding elf i think the book is better. >> >> Updated is also needed. An outdated reference is not preferred even it >> is easy to follow. > > pretty much all the content in the book is still relevant. the fact that > it > doesn't cover the latest ELF extensions doesn't mean that the fundamentals > are > no longer relevant. > >> I found this book is quite outdated. It does not explain the current >> gcc and clang. > > gcc & clang don't produce ELFs. Then what produces ELFs? gcc/clang output files in ELFs. I don't understand what you mean here. > so, at best, they'd be mentioned in > passing > even in the latest docs. > >> For example, gcc mostly use RELA instead of REL. But this book says this. > > gcc doesn't generate relocations. Again. gcc produces files with relocations. Do you mean gcc does not produce them directly (instead gcc some other tools to produce an ELF file with relocations)? > also "mostly" is a bit skewed. it depends on the architecture. > >> So a better reference in terms of all three aspects that I mentioned is >> needed. > > you need to learn to walk before you can hope to run. Please provide useful information instead of nonsense like this. -- Regards, Peng