* ldlang.c (lang_size_sections_1): Revert 2005-11-16 functional
changes to section alignment. * ldmisc.c (vfinfo): Handle %ld and %lu.
This commit is contained in:
parent
d97a892405
commit
94b50910fb
3 changed files with 43 additions and 15 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2005-11-18 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* ldlang.c (lang_size_sections_1): Revert 2005-11-16 functional
|
||||||
|
changes to section alignment.
|
||||||
|
* ldmisc.c (vfinfo): Handle %ld and %lu.
|
||||||
|
|
||||||
2005-11-16 Mark Mitchell <mark@codesourcery.com>
|
2005-11-16 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
* Makefile.am (configdoc.texi): Set top_srcdir in configdoc.texi..
|
* Makefile.am (configdoc.texi): Set top_srcdir in configdoc.texi..
|
||||||
|
|
27
ld/ldlang.c
27
ld/ldlang.c
|
@ -4137,7 +4137,7 @@ lang_size_sections_1
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bfd_vma savedot;
|
int align;
|
||||||
|
|
||||||
if (os->addr_tree == NULL)
|
if (os->addr_tree == NULL)
|
||||||
{
|
{
|
||||||
|
@ -4188,20 +4188,25 @@ lang_size_sections_1
|
||||||
}
|
}
|
||||||
|
|
||||||
newdot = os->region->current;
|
newdot = os->region->current;
|
||||||
|
align = os->bfd_section->alignment_power;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
align = os->section_alignment;
|
||||||
|
|
||||||
/* Align to what the section needs. */
|
/* Align to what the section needs. */
|
||||||
savedot = newdot;
|
if (align > 0)
|
||||||
newdot = align_power (newdot,
|
{
|
||||||
os->bfd_section->alignment_power);
|
bfd_vma savedot = newdot;
|
||||||
|
newdot = align_power (newdot, align);
|
||||||
|
|
||||||
if (newdot != savedot
|
if (newdot != savedot
|
||||||
&& (config.warn_section_align
|
&& (config.warn_section_align
|
||||||
|| os->addr_tree != NULL)
|
|| os->addr_tree != NULL)
|
||||||
&& expld.phase != lang_mark_phase_enum)
|
&& expld.phase != lang_mark_phase_enum)
|
||||||
einfo (_("%P: warning: changing start of section"
|
einfo (_("%P: warning: changing start of section"
|
||||||
" %s by %lu bytes\n"),
|
" %s by %lu bytes\n"),
|
||||||
os->name, (unsigned long) (newdot - savedot));
|
os->name, (unsigned long) (newdot - savedot));
|
||||||
|
}
|
||||||
|
|
||||||
bfd_set_section_vma (0, os->bfd_section, newdot);
|
bfd_set_section_vma (0, os->bfd_section, newdot);
|
||||||
|
|
||||||
|
|
25
ld/ldmisc.c
25
ld/ldmisc.c
|
@ -55,6 +55,8 @@
|
||||||
%W hex bfd_vma with 0x with no leading zeros taking up 8 spaces
|
%W hex bfd_vma with 0x with no leading zeros taking up 8 spaces
|
||||||
%X no object output, fail return
|
%X no object output, fail return
|
||||||
%d integer, like printf
|
%d integer, like printf
|
||||||
|
%ld long, like printf
|
||||||
|
%lu unsigned long, like printf
|
||||||
%s arbitrary string, like printf
|
%s arbitrary string, like printf
|
||||||
%u integer, like printf
|
%u integer, like printf
|
||||||
%v hex bfd_vma, no leading zeros
|
%v hex bfd_vma, no leading zeros
|
||||||
|
@ -78,10 +80,6 @@ vfinfo (FILE *fp, const char *fmt, va_list arg, bfd_boolean is_warning)
|
||||||
fmt++;
|
fmt++;
|
||||||
switch (*fmt++)
|
switch (*fmt++)
|
||||||
{
|
{
|
||||||
default:
|
|
||||||
fprintf (fp, "%%%c", fmt[-1]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '%':
|
case '%':
|
||||||
/* literal % */
|
/* literal % */
|
||||||
putc ('%', fp);
|
putc ('%', fp);
|
||||||
|
@ -407,6 +405,25 @@ vfinfo (FILE *fp, const char *fmt, va_list arg, bfd_boolean is_warning)
|
||||||
/* unsigned integer, like printf */
|
/* unsigned integer, like printf */
|
||||||
fprintf (fp, "%u", va_arg (arg, unsigned int));
|
fprintf (fp, "%u", va_arg (arg, unsigned int));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'l':
|
||||||
|
if (*fmt == 'd')
|
||||||
|
{
|
||||||
|
fprintf (fp, "%ld", va_arg (arg, long));
|
||||||
|
++fmt;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (*fmt == 'u')
|
||||||
|
{
|
||||||
|
fprintf (fp, "%lu", va_arg (arg, unsigned long));
|
||||||
|
++fmt;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* Fall thru */
|
||||||
|
|
||||||
|
default:
|
||||||
|
fprintf (fp, "%%%c", fmt[-1]);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue