This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] ld: Fix printed sizes in map file
- From: Christian Eggers <ceggers at gmx dot de>
- To: binutils at sourceware dot org
- Cc: Christian Eggers <ceggers at gmx dot de>
- Date: Mon, 4 Nov 2019 09:10:14 +0100
- Subject: [PATCH] ld: Fix printed sizes in map file
For targets with octets_per_byte>1, testsuite/ld-scripts/rgn-over*
produce wrong sizes in the generated map files:
.text 0x0000000000001000 0x6
^^^ # correct
*(.txt)
.txt 0x0000000000001000 0xc tmpdir/rgn-over.o
^^^ # should also be 0x6
The size in the first line is generated in ldlang.c:4436:
minfo ("0x%V %W", section->vma, TO_ADDR (section->size));
The size in the third line is generated in ldlang.c:4656:
minfo ("0x%V %W %pB\n", addr, size, i->owner);
Signed-off-by: Christian Eggers <ceggers@gmx.de>
---
ld/ChangeLog | 4 ++++
ld/ldlang.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 8f64296c07..73b8e6ff8d 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,7 @@
+2019-11-04 Christian Eggers <ceggers@gmx.de>
+
+ * ldlang.c (print_input_section): Shift printed size by opb_shift.
+
2019-10-22 Alan Modra <amodra@gmail.com>
PR 22269
diff --git a/ld/ldlang.c b/ld/ldlang.c
index df7f659486..a5805fac40 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -4653,7 +4653,7 @@ print_input_section (asection *i, bfd_boolean is_discarded)
size = 0;
}
- minfo ("0x%V %W %pB\n", addr, size, i->owner);
+ minfo ("0x%V %W %pB\n", addr, TO_ADDR(size), i->owner);
if (size != i->rawsize && i->rawsize != 0)
{
--
2.16.4