From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52909 invoked by alias); 1 Apr 2016 14:42:56 -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 52897 invoked by uid 89); 1 Apr 2016 14:42:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,NO_RDNS_DOTCOM_HELO,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=D*ieee.org, H*Ad:D*ieee.org, H*MI:sk:2016040, HContent-type:multipart X-HELO: vms173007pub.verizon.net Received: from vms173007pub.verizon.net (HELO vms173007pub.verizon.net) (206.46.173.7) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 01 Apr 2016 14:42:44 +0000 Received: from vz-proxy-l001.mx.aol.com ([64.236.82.158]) by vms173007.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0O4Y00LQBM6FBG50@vms173007.mailsrvcs.net> for binutils@sourceware.org; Fri, 01 Apr 2016 09:42:22 -0500 (CDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=WcjxEBVX c=1 sm=1 tr=0 a=W8DY27sA+pJ1DslXMfMu3Q==:117 a=kziv93cY1bsA:10 a=o83nqyVRAAAA:8 a=UNErw3wtHSo3_TZbETsA:9 a=ltl_qe9Jge62SiZ4:21 a=X_N-0uUDPNixRIeL:21 a=wPNLvfGTeEIA:10 a=QyXUC8HyAAAA:8 a=tZ2aPr9wk7kfLKrt-2YA:9 a=3u2ujhKRerLF9-Lv:21 a=rYNg1hl2A4oevP3z:21 Received: by 72.73.38.181 with SMTP id 441a942a; Fri, 01 Apr 2016 14:42:20 GMT Message-id: <1459521728.9097.239.camel@jericho> Subject: Re: [PATCH] Missing TO_ADDR From: Dan Reply-to: dgisselq@ieee.org To: Alan Modra Cc: dgisselq@ieee.org, binutils@sourceware.org Date: Fri, 01 Apr 2016 14:42:00 -0000 In-reply-to: <20160401013145.GB27246@bubble.grove.modra.org> References: <20160330073151.GK15812@bubble.grove.modra.org> <1459339484.9097.134.camel@jericho> <20160331073959.GT15812@bubble.grove.modra.org> <1459440197.9097.234.camel@jericho> <20160401013145.GB27246@bubble.grove.modra.org> Content-type: multipart/mixed; boundary="=-GmMRmZNNCTCtNSr/3KZ5" MIME-version: 1.0 X-SW-Source: 2016-04/txt/msg00007.txt.bz2 --=-GmMRmZNNCTCtNSr/3KZ5 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Content-length: 747 Alan, Sorry, I'm still kind of new to the whole idea of posting patches. Will this work better? 2016-04-01 Dan Gisselquist * ld/ldlang.c: Updated minfo lines so that map file sizes are given in the target machines address units. * ld/ldlang.c: Fixed three other references to section sizes that didn't go through the size in octets to target address units translation I used diff -Naur -up this time ... (Rest of patch attached) Dan On Fri, 2016-04-01 at 12:01 +1030, Alan Modra wrote: > On Thu, Mar 31, 2016 at 12:03:17PM -0400, Dan wrote: > > This would be my proposal for what to change: > > I'll approve a patch that is against current master, diff -up > preferred, and has a changelog. Please repost. > --=-GmMRmZNNCTCtNSr/3KZ5 Content-Disposition: attachment; filename="patch.txt" Content-Type: text/plain; name="patch.txt"; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Content-length: 3050 diff -Naur -up a/ld/ChangeLog b/ld/ChangeLog --- a/ld/ChangeLog 2016-04-01 10:36:46.571415208 -0400 +++ b/ld/ChangeLog 2016-04-01 10:40:00.458440792 -0400 @@ -1,3 +1,11 @@ +2016-04-01 Dan Gisselquist + + * ld/ldlang.c: Updated minfo lines so that map file sizes are + given in the target machines address units. + * ld/ldlang.c: Fixed three other references to section sizes + that didn't go through the size in octets to target address + units translation + 2016-02-23 H.J. Lu * testsuite/ld-frv/fdpic-pie-6.d: Updated. diff -Naur -up a/ld/ldlang.c b/ld/ldlang.c --- a/ld/ldlang.c 2016-03-31 11:52:02.147253098 -0400 +++ b/ld/ldlang.c 2016-03-31 12:01:13.039773821 -0400 @@ -1886,7 +1886,7 @@ lang_insert_orphan (asection *s, before sizing dynamic sections. */ dot = os->bfd_section->vma; exp_fold_tree (start_assign->exp, os->bfd_section, &dot); - dot += s->size; + dot += TO_ADDR(s->size); exp_fold_tree (stop_assign->exp, os->bfd_section, &dot); } @@ -4002,7 +4002,7 @@ print_output_section_statement ++len; } - minfo ("0x%V %W", section->vma, section->size); + minfo ("0x%V %W", section->vma, TO_ADDR(section->size)); if (section->vma != section->lma) minfo (_(" load address 0x%V"), section->lma); @@ -4312,7 +4312,9 @@ print_data_statement (lang_data_statemen break; } - minfo ("0x%V %W %s 0x%v", addr, size, name, data->value); + if (size < TO_SIZE ((unsigned) 1)) + size = TO_SIZE ((unsigned) 1); + minfo ("0x%V %W %s 0x%v", addr, TO_ADDR(size), name, data->value); if (data->exp->type.node_class != etree_value) { @@ -4355,7 +4357,7 @@ print_reloc_statement (lang_reloc_statem size = bfd_get_reloc_size (reloc->howto); - minfo ("0x%V %W RELOC %s ", addr, size, reloc->howto->name); + minfo ("0x%V %W RELOC %s ", addr, TO_ADDR(size), reloc->howto->name); if (reloc->name != NULL) minfo ("%s+", reloc->name); @@ -4388,7 +4390,7 @@ print_padding_statement (lang_padding_st addr = s->output_offset; if (s->output_section != NULL) addr += s->output_section->vma; - minfo ("0x%V %W ", addr, (bfd_vma) s->size); + minfo ("0x%V %W ", addr, TO_ADDR((bfd_vma) s->size)); if (s->fill->size != 0) { @@ -5067,7 +5069,7 @@ lang_size_sections_1 create overlapping LMAs. */ if (dot < last->vma && os->bfd_section->size != 0 - && dot + os->bfd_section->size <= last->vma) + && dot + TO_ADDR(os->bfd_section->size) <= last->vma) { /* If dot moved backwards then leave lma equal to vma. This is the old default lma, which might @@ -5084,7 +5086,7 @@ lang_size_sections_1 /* If this is an overlay, set the current lma to that at the end of the previous section. */ if (os->sectype == overlay_section) - lma = last->lma + last->size; + lma = last->lma + TO_ADDR(last->size); /* Otherwise, keep the same lma to vma relationship as the previous section. */ --=-GmMRmZNNCTCtNSr/3KZ5--