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: Zeros in same section in ld


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


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