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.
This commit is contained in:
Alan Modra 2020-03-05 21:34:23 +10:30
parent 50a3cc5d71
commit 92d4b13bf3
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2020-03-05 Alan Modra <amodra@gmail.com>
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 <amodra@gmail.com>
PR 25570

View File

@ -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))