This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Zeros in same section in ld
- From: Ian Lance Taylor <iant at google dot com>
- To: pocmatos at gmail dot com (Paulo J. Matos)
- Cc: binutils at sourceware dot org
- Date: Thu, 15 Jul 2010 04:13:25 -0700
- Subject: Re: Zeros in same section in ld
- References: <yaymxttyqk8.fsf@alma.europe.root.pri>
pocmatos@gmail.com (Paulo J. Matos) writes:
> I have the following sections description in ld:
> ,----
> | dm1_region :
> | {
> | . += (0x000000);
> | . = ALIGN(0x4);
> | test4.o*(DM1_1\?$M.main.foo)
> | . += (0x002000);
> | . = ALIGN(0x4);
> | test4.o*(DM1_2\?$M.main2.bar)
> | } > DM1_REGION :DM1_REGION
> `----
>
> However, in my output file I get some data at 0x0, then a huge amount
> of zeros and then some data at 0x2000.
>
> Isn't it possible to avoid the zeros in the output file within the same
> section?
There is no way for the object file format to represent a single section
with some data followed by empty space followed by other data. It has
to represent the zeroes explicitly in that case.
Ian