changes to section alignment.
* ldmisc.c (vfinfo): Handle %ld and %lu.
+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>
* Makefile.am (configdoc.texi): Set top_srcdir in configdoc.texi..
}
else
{
- bfd_vma savedot;
+ int align;
if (os->addr_tree == NULL)
{
}
newdot = os->region->current;
+ align = os->bfd_section->alignment_power;
}
+ else
+ align = os->section_alignment;
/* Align to what the section needs. */
- savedot = newdot;
- newdot = align_power (newdot,
- os->bfd_section->alignment_power);
+ if (align > 0)
+ {
+ bfd_vma savedot = newdot;
+ newdot = align_power (newdot, align);
- if (newdot != savedot
- && (config.warn_section_align
- || os->addr_tree != NULL)
- && expld.phase != lang_mark_phase_enum)
- einfo (_("%P: warning: changing start of section"
- " %s by %lu bytes\n"),
- os->name, (unsigned long) (newdot - savedot));
+ if (newdot != savedot
+ && (config.warn_section_align
+ || os->addr_tree != NULL)
+ && expld.phase != lang_mark_phase_enum)
+ einfo (_("%P: warning: changing start of section"
+ " %s by %lu bytes\n"),
+ os->name, (unsigned long) (newdot - savedot));
+ }
bfd_set_section_vma (0, os->bfd_section, newdot);
%W hex bfd_vma with 0x with no leading zeros taking up 8 spaces
%X no object output, fail return
%d integer, like printf
+ %ld long, like printf
+ %lu unsigned long, like printf
%s arbitrary string, like printf
%u integer, like printf
%v hex bfd_vma, no leading zeros
fmt++;
switch (*fmt++)
{
- default:
- fprintf (fp, "%%%c", fmt[-1]);
- break;
-
case '%':
/* literal % */
putc ('%', fp);
/* unsigned integer, like printf */
fprintf (fp, "%u", va_arg (arg, unsigned int));
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;
}
}
}