/* Apply the required alignment. */
s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
- if (power_of_two > bfd_section_alignment (s))
- {
- if (!bfd_set_section_alignment (s, power_of_two))
- return false;
- }
+ if (!bfd_link_align_section (s, power_of_two))
+ return false;
/* Define the symbol as being at this point in the section. */
h->root.u.def.section = s;
section. We want this stub right at the end, up
against the .got section. */
int gotalign = bfd_section_alignment (htab->etab.sgot);
- int pltalign = bfd_section_alignment (sec);
int align = gotalign > 3 ? gotalign : 3;
bfd_size_type mask;
- if (align > pltalign)
- bfd_set_section_alignment (sec, align);
+ (void) bfd_link_align_section (sec, align);
mask = ((bfd_size_type) 1 << gotalign) - 1;
sec->size = (sec->size + sizeof (plt_stub) + mask) & ~mask;
}
/* Apply the required alignment. */
s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
- if (power_of_two > s->alignment_power)
- {
- if (!bfd_set_section_alignment (s, power_of_two))
- return false;
- }
+ if (!bfd_link_align_section (s, power_of_two))
+ return false;
/* Define the symbol as being at this point in the section. */
h->root.u.def.section = s;
/* Apply the required alignment. */
s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
- if (power_of_two > bfd_section_alignment (s))
- {
- if (!bfd_set_section_alignment (s, power_of_two))
- return false;
- }
+ if (!bfd_link_align_section (s, power_of_two))
+ return false;
/* Define the symbol as being at this point in the section. */
h->root.u.def.section = s;
non-empty. Otherwise the .text output section will be
aligned at least to plt_stub_align even when no global
entry stubs are needed. */
- if (s->alignment_power < align_power)
- s->alignment_power = align_power;
+ if (!bfd_link_align_section (s, align_power))
+ return false;
stub_align = (bfd_vma) 1 << align_power;
if (htab->params->plt_stub_align >= 0
|| ((((stub_off + stub_size - 1) & -stub_align)
/* Ensure the alignment of the first section (usually .tdata) is the largest
alignment, so that the tls segment starts aligned. */
if (tls != NULL)
- tls->alignment_power = align;
+ (void) bfd_link_align_section (tls, align);
return tls;
}
/* Make sure that any padding goes before the stub. */
align = input_section->alignment_power;
- if (!bfd_set_section_alignment (s, align))
+ if (!bfd_link_align_section (s, align))
return false;
if (align > 3)
s->size = (1 << align) - 8;
asection *input_section = stub->h->root.root.u.def.section;
s = htab->add_stub_section (".text", NULL,
input_section->output_section);
- if (s == NULL || !bfd_set_section_alignment (s, 4))
+ if (s == NULL || !bfd_link_align_section (s, 4))
return false;
htab->strampoline = s;
}
Encourage better cache usage by aligning. We do this
lazily to avoid pessimizing traditional objects. */
if (htab->root.target_os != is_vxworks
- && !bfd_set_section_alignment (htab->root.splt, 5))
+ && !bfd_link_align_section (htab->root.splt, 5))
return false;
/* Make sure that .got.plt is word-aligned. We do this lazily
for the same reason as above. */
- if (!bfd_set_section_alignment (htab->root.sgotplt,
- MIPS_ELF_LOG_FILE_ALIGN (dynobj)))
+ if (!bfd_link_align_section (htab->root.sgotplt,
+ MIPS_ELF_LOG_FILE_ALIGN (dynobj)))
return false;
/* On non-VxWorks targets, the first two entries in .got.plt
it is empty. Update its section alignment now since it
is non-empty. */
if (s == htab->elf.iplt
- && !bfd_set_section_alignment (s, htab->plt.iplt_alignment))
+ && !bfd_link_align_section (s, htab->plt.iplt_alignment))
abort ();
/* Allocate memory for the section contents. We use bfd_zalloc