This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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....


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]