diff options
author | Alan Modra <amodra@gmail.com> | 2022-08-04 10:12:51 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-08-04 12:00:36 +0930 |
commit | 6b9bd54c24dcf08e400e5b79a958e051ccfde30d (patch) | |
tree | 04496fb28858235f67ed838814466f863b6babf4 /ld/emultempl | |
parent | 94e27e8e69a07d69554ee7598419646d3ee99907 (diff) | |
download | gdb-6b9bd54c24dcf08e400e5b79a958e051ccfde30d.zip gdb-6b9bd54c24dcf08e400e5b79a958e051ccfde30d.tar.gz gdb-6b9bd54c24dcf08e400e5b79a958e051ccfde30d.tar.bz2 |
Re: Get rid of fprintf_vma and sprintf_vma
Commit f493c2174e messed the formatting in linker map files,
particularly for 32-bit builds where a number of tests using map files
regressed. I should have noticed the BFD64 conditional printing of
spaces to line up output due to the original %V printing hex vmas with
16 digits when BFD64 and 8 digits when not. Besides that, it is nicer
to print 32-bit vmas for 32-bit targets. So change %V back to be
target dependent, now using bfd_sprintf_vma. Since minfo doesn't
return the number of chars printed, that means some places that
currently use %V must instead sprintf to a buffer in order to find the
length printed.
* ldmisc.h (print_spaces): Declare.
(print_space): Change to a macro.
* ldmisc.c (vfinfo): Use bfd_sprintf_vma for %V. Tidy %W case.
(print_space): Delete.
(print_spaces): New function.
* emultempl/aix.em (print_symbol): Use print_spaces.
* ldctor.c (ldctor_build_sets): Likewise.
* ldmain.c (add_archive_element): Likewise.
* ldlang.c (print_one_symbol, lang_print_asneeded): Likewise.
(print_output_section_statement, print_data_statement): Likewise.
(print_reloc_statement, print_padding_statement): Likewise.
(print_assignment): Likewise. Also replace %V printing of vmas
with printing to a buffer in order to properly format output.
(print_input_section, lang_one_common): Likewise.
Diffstat (limited to 'ld/emultempl')
-rw-r--r-- | ld/emultempl/aix.em | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em index 355e2a4..af49eff 100644 --- a/ld/emultempl/aix.em +++ b/ld/emultempl/aix.em @@ -1772,11 +1772,9 @@ gld${EMULATION_NAME}_print_symbol (struct bfd_link_hash_entry *hash_entry, || hash_entry->type == bfd_link_hash_defweak) && sec == hash_entry->u.def.section) { - int i; struct xcoff_link_hash_entry *h; - for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++) - print_space (); + print_spaces (SECTION_NAME_MAP_LENGTH); minfo ("0x%V ", (hash_entry->u.def.value + hash_entry->u.def.section->output_offset |