linux-mips
[Top] [All Lists]

MIPS section alignment of object file

To: linux-mips@linux-mips.org
Subject: MIPS section alignment of object file
From: "robert song" <robertsong.linux@gmail.com>
Date: Fri, 22 Feb 2008 01:12:01 +0900
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=OO/uF/F6vkxJkQS054UZlkloaCcHwBT6Cp5oJcpeoLk=; b=L23PXU12b2eZ+oSZIzmsl8BE01WevCCeHlTDsQzv1giyXDIzY0cpfxQr4jiYwba48YRGbJWutLBLQx0eIhGfT/h9/Kcc56lWwUT1h+/HmiY2ZKAT4spu9EgUKPLSnKFhFMnfsti89FsKS+ZGJuGCa57ECfhbb5xTBOsAqksWkVY=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=XaSTXHZV7/xwKJLmvBzRl/1hyRdCpXdbl5PFyhBUY/HXZADjdbjYeEHVXEQ92MmI2XMcs9GeQSrjPZW5lWG8nD62GRrqOyvLXMc77bIA3OMnFlsPaLWGlMkNd0AiILmHJvui4XKaXm802yvXXXFGq1WcivuzIp5S7AQG9+cJh+E=
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Hello, everyone.
some sections like  .data are set to 16 bytes alignment  in the
binutils/gas/config/tc-mips.c as bellows.
          (void) bfd_set_section_alignment (stdoutput, text_section, 4);

But in other architectures like arm, .data section is aligned to 4
bytes alignment,
and  now I test the object file generated by gas, and found that the
size of .data section sometimes is a little bigger than the situation
of 4 bytes alignments because of the amount of padding.

There are some comments in the tc-mips.c 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.

I want to know whether some mips architecture requires that the
sections of elf object file specifies to be aligned to 16 bytes,  or
else 16-bytes alignment will get a good performance than other
alignments just like 4 bytes????

I recompiled  the binutils by changing the alignment to 4 bytes, and
compiled some
test files, and ran on my mips target(TX4937). There is no problem.

I am really puzzled and any help will be appreciated.

robertsong

<Prev in Thread] Current Thread [Next in Thread>