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

Re: [microblaze-uclinux] bootstrap code



dear all,

On Tue, 11 May 2004, Greg Ungerer wrote:
> As an additional data point, gdb uses the extra .romfs segment
> correctly too. So it is only some elf parsers that are doing it wrong.
>
> I use gdb with jtag tools on a number of targets (mostly ColdFire
> and ARM) and it always loads the .romfs segment along with the
> .text/.data where the headers say it too.

john you are right, the necceseary information is present.

as i understood the elf format is redundant per design. the various
information on the sections/segments (size, position in file, position in
memory, etc) are stored at two places: in the section headers and in the
program headers. they are not the same, but redundant.

reading the first few sentences of this:

http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_node/ld_23.html#SEC23

and  'man elf' (those parts which are talking about program headers)

i think that the program headers are created exactly for program/boot
loaders. you can load the elf file based on the section headers (and i
think the examples you pointed greg are working this way), but if possible
i would rather use the program headers.

there are no strong arguments for that: parsing section headers is not
more difficult than parsing program headers. i just feel better if we
produce a consistent elf image, and use the parts of the elf images for
what they are meant for. (what _i_ think they are meant for... :)

(one small argument: the program and section headers are both optional in
the elf image, so some day you might find sth to load that has no section
headers).



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