This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Don't align text/data/bss sections in x86 assembler
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: John Reiser <jreiser at bitwagon dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 3 Jun 2013 09:49:55 -0700
- Subject: Re: PATCH: Don't align text/data/bss sections in x86 assembler
- References: <20130531173241 dot GA30259 at intel dot com> <51AC6EFE02000078000DA75F at nat28 dot tlf dot novell dot com> <CAMe9rOpNY_h4CSnf1Wnkr-aqd3ExUHmFwxXR7AQ4NK8boNsXPQ at mail dot gmail dot com> <51ACC419 dot 9030304 at bitwagon dot com>
On Mon, Jun 3, 2013 at 9:28 AM, John Reiser <jreiser@bitwagon.com> wrote:
> On 06/03/2013, H.J. Lu wrote:
>> [[snip]] The section
>> alignment is very arbitrary:
>>
>> 1. Many arches don't do it.
>> 2. Only x86 ELF did it.
>
> x86 ELF did it for a reason. The default addressing convention for 16-bit sections
> (i286) requires paragraph alignment which in hardware is at least 0x10
> but in UNIX traditionally was 0x20. Embedding 16-bit code at the beginning
> of a 32-bit .text section was reasonable and did happen. Recent Linux
> no longer supports virtual86 mode, but there are other OS.
>
0x10 is 16 byte. If one needs 16 byte alignment, one has
to align it by hand.
--
H.J.