From: Alan Modra Date: Thu, 5 Mar 2020 11:04:23 +0000 (+1030) Subject: Reduce --warn-section-align output X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=92d4b13bf378f575cdc796ec9340c12267b7eff1;p=deliverable%2Fbinutils-gdb.git 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. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index b634dd8732..666ce5cb7d 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2020-03-05 Alan Modra + + 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. + 2020-03-05 Alan Modra PR 25570 diff --git a/ld/ldlang.c b/ld/ldlang.c index 6ffa7af575..63f9d182ea 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))