This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: Padding between .text and .data
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'Shaun Jackman'" <sjackman at gmail dot com>, "'DJ Delorie'" <dj at redhat dot com>
- Cc: <binutils at sources dot redhat dot com>
- Date: Wed, 15 Feb 2006 18:10:49 -0000
- Subject: RE: Padding between .text and .data
On 15 February 2006 17:19, Shaun Jackman wrote:
> On 2/15/06, DJ Delorie <dj@redhat.com> wrote:
> ...
>> The idea here is that you want data in the file and data in memory to
>> both be similarly aligned; such that if you break memory up into
>> sector-sized blocks, the data in each block corresponds to a block of
>> data on disk.
> ...
>
> Thanks for the explanation, DJ. This value of 256 seems fairly
> arbitrary and hardware specific.
Linker scripts are, in general! It's the correct place for this sort of
knowledge about memory mapping and layouts.
> I discovered this optimization, because it showed up as zeros in my
> flash image when I used objcopy -Obinary, which is an unfortunate side
> effect for me. One solution, of course, is to use a custom linker
> script. I'm currently using the default linker script though, and I'd
> rather continue doing that than maintaining my own. Any other
> suggestions?
You shouldn't need to 'maintain' your linker script unless you change
binutils version, in which case you would need to generate a new variant from
the more up-to-date default linker script from the new binutils.
Having said that, is it possible that you could generate your own linker
script by some kind of postprocessing on the default linker script?
cheers,
DaveK
--
Can't think of a witty .sigline today....