From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38364 invoked by alias); 2 Mar 2020 14:18:48 -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 38352 invoked by uid 89); 2 Mar 2020 14:18:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-1.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Mar 2020 14:18:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583158725; 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=mWIIIx2gab+AgTHZMwIUQSSAc64y5gnsEwZa+aepUTM=; b=LtwSPmLycE2ZaRMnJ6XRTAMNtEzhRKzYnqglkHoyme+9X91064Vt8hxRvMfc+S2YjQt1FV 6x3S1+LPJOakTvYIorl7WH8B5V1MWNWJYsjYWk1XA64eaLlkA5/7URfpbgQ+3DFor1tpsr pChJ05U1hSwDltkkQUuBMMqNnVU9Nsc= 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-394-_c4phBuMMhe-nC45k05s4A-1; Mon, 02 Mar 2020 09:18:41 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C3330107BA9C; Mon, 2 Mar 2020 14:18:40 +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 DB74261070; Mon, 2 Mar 2020 14:18:39 +0000 (UTC) Subject: Re: [PATCH 2/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-3-ceggers@gmx.de> From: Nick Clifton Message-ID: Date: Mon, 02 Mar 2020 14:18: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-3-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/msg00021.txt Hi Christian, > include/ > * bfdlink.h (struct bfd_link_order): Add unit (bytes/octets) to > offset and size members. > * elf/internal.h (struct elf_internal_phdr): likewise for > p_align member. > (struct elf_segment_map): likewise for p_paddr and p_size > members > > bfd/ > * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of > "p_paddr" from "at". > * elfcode.h (bfd_from_remote_memory): Add units to several > parameters. New local "opb". Fix usage of p_align. Fix > calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix > call of target_read_memory(). > * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix > calculation of "offset" and "output_offset". > (bfd_elf_final_link): New local "opb". Fix calculation of "size" > from "offset" and fix calculation of "end" from "vma+size". Fix > comparison between "sh_addr" and "vma"/"output_offset". > (bfd_elf_discard_info): Fix calculation of "eh_alignment". > * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size > member. > * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/ > octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of > "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix > assignment of p_paddr from phdr_lma. Fix comparison between "lma > +size" and "next->lma". > (elf_sort_segments): Fix assignment from p_paddr to lma. > (assign_file_positions_for_load_sections): Add unit (bytes) to > local "align". Fix calculation of local "off_adjust". Fix > calculation of local "filehdr_vaddr". > (assign_file_positions_for_non_load_sections): New local "opb". > Fix calculation of "end" from "p_size". Fix comparison between > "vma+SECTION_SIZE()" and "start". Fix calculation of "p_memsz" > from "end" and "p_vaddr". > (rewrite_elf_program_header): Fix comparison between p_vaddr and > vma. Fix assignment to p_paddr from lma. Fix comparison between > p_paddr and lma. Fix assignment to p_paddr from lma. > * merge.c (sec_merge_emit): New local "opb". Convert > "alignment_power" to octets. > (_bfd_add_merge_section): New locals "alignment_power" and > "opb". Fix comparison between "alignment_power" and > "sizeof(align)". > (_bfd_merge_sections): New local "opb". Divide size by opb > before checking align mask. Approved - please apply - but please fixup the comments first. Cheers Nick