[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] bootstrap code



dear yasushi,

On Sat, 15 May 2004, Yasushi SHOJI wrote:
> > -	.data ALIGN (0x4) : {
> > +	.data ALIGN (0x2000) : {
> doing like this just create zero pad in the binary, which will make
> current plain binary bigger without any gain.

you are right, this change will introduce some unused gap in the resulting
binary. i made this modification to have a consistent kernel after the
second linkage.

this alignment applies to the .data section of the kernel. the kernel
image that is produced using the original script says that the .data
section should be aligned to a 8192 (0x2000) boundary. howerver it is not.
here is some part of the output of 'mb-readelf -S' on an older kernel:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  ...
  [ 4] .data             PROGBITS        8010d4f0 10d604 00ab30 00  WA   0   0 8192


when you link this image with the romfs.elf, the data section is
moved (correctly?) to this boundary. however moving sections around makes
the kernel inconsistent: ther are variables in the kernel which point to
different parts of it (ie to the begining and end of .data section).

so you either must not move the sections, or you have to update the
pointers concerned.

the introduced gap is 4k on avarage, and not more than 8k in worst case,
so i think it's not worth creating a more complicated linkage script to
save that memory (altough i think it's possible).


thank you for the comment and for reviewing the patch!


-- 
mazsi

----------------------------------------------------------------
Strawberry fields forever!  Jozsef.Imrek@strawberry.dnsalias.org
----------------------------------------------------------------
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/