From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36338 invoked by alias); 2 Mar 2020 14:17:54 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 36330 invoked by uid 89); 2 Mar 2020 14:17:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (205.139.110.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Mar 2020 14:17:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583158671; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=NagYNgPJVb2uHVOdN4BuV7jT6/4YIxOlKTA892CQ+OE=; b=Tn7J4wOf+jGXzLs0vYGS6m5W0qOUOefxV4zef9MMADxuL7pHBea3Ez7Q2tPsnKxCH8/dG8 ZQ1RTvdwrp58ObAHHkzoR7cxCWpazAA67d6gkjLNlgRiK9IJD38zdxrktlBrIiYYtfqaB6 T8Fqw5GyRMFKovBazlhHItkaGYntpJM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-172-o8G_-8FvPZm7j7a_a8emhw-1; Mon, 02 Mar 2020 09:17:49 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CE3251922960; Mon, 2 Mar 2020 14:17:48 +0000 (UTC) Received: from [10.36.117.110] (ovpn-117-110.ams2.redhat.com [10.36.117.110]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F3FFA93501; Mon, 2 Mar 2020 14:17:47 +0000 (UTC) Subject: Re: [PATCH 1/2] Fix several mix up between octets and bytes in ELF program headers To: Christian Eggers , binutils@sourceware.org Cc: amodra@gmail.com References: <20200215193050.22717-1-ceggers@gmx.de> <20200215193050.22717-2-ceggers@gmx.de> From: Nick Clifton Message-ID: <1b834989-fc85-17ed-310c-10563a6ea07e@redhat.com> Date: Mon, 02 Mar 2020 14:17:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200215193050.22717-2-ceggers@gmx.de> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2020-03/txt/msg00020.txt Hi Christian, > include/ > * elf/internal.h (struct elf_internal_phdr): Add unit (octets) > to several member field comments. > (Elf_Internal_Shdr): likewise. > > bfd/ > * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp > opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting > section LMA/VMA. > (_bfd_elf_make_section_from_phdr): Similarly. > (elf_fake_sections): Fix calculation of > Elf_Internal_shdr::sh_addr from section VMA. > (_bfd_elf_map_sections_to_segments): Fix mixup between octets > and bytes. > (assign_file_positions_for_load_sections): Fix calculations of > Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix > comparison between program header address and section LMA. > (assign_file_positions_for_non_load_sections): Likewise. > (rewrite_elf_program_header): Likewise. Introduce new temp opb. > (IS_CONTAINED_BY_VMA): Add parameter opb. > (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT, > INCLUDE_SECTION_IN_SEGMENT): Likewise. > (copy_elf_program_header): Update call to > ELF_SECTION_IN_SEGMENT(). Fix calculations of p_addr_valid and > p_vaddr_offset. > * elflink.c (elf_link_add_object_symbols): Multiply section VMA > with octets per byte when comparing against p_vaddr. > > ld/ > * ldexp.c (fold_name): Return SIZEOF_HEADERS in bytes. Approved - please apply - but with one change: > + bfd_vma p_start = p->p_paddr; /* octets */ Please could yoy change the format of these comments so that they follow the GNU Coding Standard guidelines ? Ie, please start with a capital letter and end with a period: /* Octets. */ And similarly for you /* bytes */ comments - they should be /* Bytes. */ Thanks.