This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Question about section alignment
- From: "robert song" <robertsong dot linux at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 20 Feb 2008 18:38:45 +0900
- Subject: Question about section alignment
Hello, everyone.
I found that in binutils-2.17.50/gas/config/tc-mips.c there are some
codes as bellows:
/* On a native system other than VxWorks, sections must be aligned
to 16 byte boundaries. When configured for an embedded ELF
target, we don't bother. */
if (strcmp (TARGET_OS, "elf") != 0
&& strcmp (TARGET_OS, "vxworks") != 0)
{
(void) bfd_set_section_alignment (stdoutput, text_section, 4);
(void) bfd_set_section_alignment (stdoutput, data_section, 4);
(void) bfd_set_section_alignment (stdoutput, bss_section, 4);
}
I don't kow why these sections must be set to 16 byte boundaries,
when I changed
the alignment of data_section from 4 to 2 and the test file can also
be run on my
mips target. Could anyone explain it to me ?
Thank you very much.
robert