diff options
author | Alan Modra <amodra@gmail.com> | 2020-03-05 21:34:23 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-03-05 21:52:04 +1030 |
commit | 92d4b13bf378f575cdc796ec9340c12267b7eff1 (patch) | |
tree | e3515348b102b4f0d0a4761bde01e9dfd292ff57 /ld/ldlang.c | |
parent | 50a3cc5d71012a18f53f099cc18b7fa073cd83bd (diff) | |
download | binutils-gdb-92d4b13bf378f575cdc796ec9340c12267b7eff1.tar.gz |
Reduce --warn-section-align output
PR 25570
* ldlang.c (lang_size_sections_1): Don't report changes on
second and subsequent iterations that make no change in
alignment from that already reported.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r-- | ld/ldlang.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c index 6ffa7af5754..63f9d182eae 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -5597,7 +5597,13 @@ lang_size_sections_1 if (lang_sizing_iteration == 1) diff = dotdelta; else if (lang_sizing_iteration > 1) - diff = newdot - os->bfd_section->vma; + { + /* Only report adjustments that would change + alignment from what we have already reported. */ + diff = newdot - os->bfd_section->vma; + if (!(diff & (((bfd_vma) 1 << section_alignment) - 1))) + diff = 0; + } if (diff != 0 && (config.warn_section_align || os->addr_tree != NULL)) |