Padding between .text and .data

Shaun Jackman sjackman@gmail.com
Wed Feb 15 20:11:00 GMT 2006


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. For example, it shows up on my
embedded ARM7 system, which has no MMU. Is the idea that the VMA of
the sections are arbitrary anyways, and so this optimization shouldn't
hurt anything?

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?

Cheers,
Shaun



More information about the Binutils mailing list