From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by sourceware.org (Postfix) with ESMTPS id 1E56A3858028 for ; Tue, 20 Apr 2021 01:58:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1E56A3858028 Received: by mail-il1-x133.google.com with SMTP id l19so26927098ilk.13 for ; Mon, 19 Apr 2021 18:58:04 -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:cc; bh=x2/WLb0U2/Hkk4PV4eZVj0Fn/Zd/p9+roLP53a41Z8k=; b=N9il1HguxX/zpmp4eb3+j2ngoldRksY5H9ho60+VQ4aIkoF7ot1QXFDI8ToJzA0QCK qUL3K/mEaiAT59PLEWIpzjAKH8sttGC8SWel3AKSm931OMCuGStR+86gS21tbOENrFYu nvKj1E1zkbrVhbfGMcVAegCNk10dg1xueZpNjUp4xX3bdJhwD6f9gGcDoTPUIZpWXVA5 9/uSWDKTC2cBj0u/SqnsqcREpoopi2M8qyKBta8Z0fZYmqSvB1bdPTV2yUAxhvdBF3s5 UXGSqsb7kSkE/0w/tRNVgynP77OmF+rZJoPLGIknaEgG/YDlCgwlMs57k5t5ZJHezti/ QfZw== X-Gm-Message-State: AOAM533yOChT/0iaqJzMYwLXlOhgyxNfuYrkWUNQfcTZHOeZbiaczjno 1eEGvNSNQu1A0Aqh9Z6Z5EWIgpBDeVUuUvcnqz/Il5iA X-Google-Smtp-Source: ABdhPJwzumJJl3+gA/isI7gQLVkyV/TE9nc3/30w4jsz0GIdR1KotHv2UIheerDmMl5kYh1Dil7breGR0Bg1ISiVCio= X-Received: by 2002:a05:6e02:c6b:: with SMTP id f11mr19118306ilj.260.1618883883557; Mon, 19 Apr 2021 18:58:03 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:750f:0:0:0:0:0 with HTTP; Mon, 19 Apr 2021 18:58:02 -0700 (PDT) In-Reply-To: <20210419072902.GB9028@arm.com> References: <20210419072902.GB9028@arm.com> From: Peng Yu Date: Mon, 19 Apr 2021 20:58:02 -0500 Message-ID: Subject: Re: Best reference for understanding ELF format To: Szabolcs Nagy Cc: libc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 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 01:58:09 -0000 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. I found this book is quite outdated. It does not explain the current gcc and clang. For example, gcc mostly use RELA instead of REL. But this book says this. "If the architecture has room for all the addends in the object code like the x86 does, it uses REL, if not it uses RELA. But in principle a compiler could save some space on architectures that need addends by putting all the relocations with zero addends, e.g., procedure references, in a SHT_REL section and the rest in a SHT_RELA." 64-bit details are not covered much. So a better reference in terms of all three aspects that I mentioned is needed. - up-to-date - easy-to-follow - complete -- Regards, Peng