* ldlang.c (lang_size_sections_1): Align lma using same alignment
as for vma.
This commit is contained in:
parent
97fc68fe16
commit
c5b0a9ef7e
2 changed files with 14 additions and 10 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2010-12-04 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* ldlang.c (lang_size_sections_1): Align lma using same alignment
|
||||||
|
as for vma.
|
||||||
|
|
||||||
2010-12-03 H.J. Lu <hongjiu.lu@intel.com>
|
2010-12-03 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* lexsup.c (ld_options): Fix a typo in comments.
|
* lexsup.c (ld_options): Fix a typo in comments.
|
||||||
|
|
19
ld/ldlang.c
19
ld/ldlang.c
|
@ -4788,6 +4788,7 @@ lang_size_sections_1
|
||||||
bfd_vma newdot, after;
|
bfd_vma newdot, after;
|
||||||
lang_output_section_statement_type *os;
|
lang_output_section_statement_type *os;
|
||||||
lang_memory_region_type *r;
|
lang_memory_region_type *r;
|
||||||
|
int section_alignment = 0;
|
||||||
|
|
||||||
os = &s->output_section_statement;
|
os = &s->output_section_statement;
|
||||||
if (os->constraint == -1)
|
if (os->constraint == -1)
|
||||||
|
@ -4857,8 +4858,6 @@ lang_size_sections_1
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int align;
|
|
||||||
|
|
||||||
if (os->addr_tree == NULL)
|
if (os->addr_tree == NULL)
|
||||||
{
|
{
|
||||||
/* No address specified for this section, get one
|
/* No address specified for this section, get one
|
||||||
|
@ -4909,16 +4908,16 @@ lang_size_sections_1
|
||||||
}
|
}
|
||||||
|
|
||||||
newdot = os->region->current;
|
newdot = os->region->current;
|
||||||
align = os->bfd_section->alignment_power;
|
section_alignment = os->bfd_section->alignment_power;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
align = os->section_alignment;
|
section_alignment = os->section_alignment;
|
||||||
|
|
||||||
/* Align to what the section needs. */
|
/* Align to what the section needs. */
|
||||||
if (align > 0)
|
if (section_alignment > 0)
|
||||||
{
|
{
|
||||||
bfd_vma savedot = newdot;
|
bfd_vma savedot = newdot;
|
||||||
newdot = align_power (newdot, align);
|
newdot = align_power (newdot, section_alignment);
|
||||||
|
|
||||||
if (newdot != savedot
|
if (newdot != savedot
|
||||||
&& (config.warn_section_align
|
&& (config.warn_section_align
|
||||||
|
@ -4974,8 +4973,8 @@ lang_size_sections_1
|
||||||
{
|
{
|
||||||
bfd_vma lma = os->lma_region->current;
|
bfd_vma lma = os->lma_region->current;
|
||||||
|
|
||||||
if (os->section_alignment != -1)
|
if (section_alignment > 0)
|
||||||
lma = align_power (lma, os->section_alignment);
|
lma = align_power (lma, section_alignment);
|
||||||
os->bfd_section->lma = lma;
|
os->bfd_section->lma = lma;
|
||||||
}
|
}
|
||||||
else if (r->last_os != NULL
|
else if (r->last_os != NULL
|
||||||
|
@ -5016,8 +5015,8 @@ lang_size_sections_1
|
||||||
else
|
else
|
||||||
lma = dot + last->lma - last->vma;
|
lma = dot + last->lma - last->vma;
|
||||||
|
|
||||||
if (os->section_alignment != -1)
|
if (section_alignment > 0)
|
||||||
lma = align_power (lma, os->section_alignment);
|
lma = align_power (lma, section_alignment);
|
||||||
os->bfd_section->lma = lma;
|
os->bfd_section->lma = lma;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue