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

	* ldlang.c (print_input_section): Shift printed size by opb_shift.
This commit is contained in:
Christian Eggers 2019-11-04 08:34:54 +01:00 committed by Alan Modra
parent 825165c57e
commit b0a7971ad4
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2019-11-06 Christian Eggers <ceggers@gmx.de>
* ldlang.c (print_input_section): Shift printed size by opb_shift.
2019-11-05 Alan Modra <amodra@gmail.com>
* emulparams/aarch64elf.sh (GENERATE_SHLIB_SCRIPT),

View File

@ -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)
{
@ -4669,7 +4669,7 @@ print_input_section (asection *i, bfd_boolean is_discarded)
--len;
}
minfo (_("%W (size before relaxing)\n"), i->rawsize);
minfo (_("%W (size before relaxing)\n"), TO_ADDR (i->rawsize));
}
if (i->output_section != NULL