[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] data segment init code & .data size calculations
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] data segment init code & .data size calculations |
Date: |
Fri, 10 Sep 2004 09:38:28 +0200 (MET DST) |
Bernard Fouché <address@hidden> wrote:
> 00800100 D __data_start
> 00800104 B __bss_start
> 00800104 D __data_end
> 00800104 D _edata
Since there's no symbol to find, I suspect this comes from a helper
variable of the compiler. These are usually done by local symbols
(starting with .L) inside the assembler code so the symbol's name
isn't retained in the symbol table afterwards. This kind of helper
variables is occasionally used by the compiler when it finds it more
convenient to use the address of something. Just browse through the
generated assembler code to see it (*not* the disassembled code, I
mean).
> ..., the .data segment is zero in size but __do_copy_data,
> __do_copy_data_loop, etc. are still embedded in the final object.
It seems to me that whoever designed the current gcrt1.S file (IIRC
it's been Marek) intented to let the compiler decide whether they need
to be pulled in or not, but the compiler magic for actually detecting
these cases is not yet implemented, so the compiler always emits
references to these loops.
In practice, I've only rarely seen projects where you don't need them,
so it's probably not that terribly important.
> (the same for .bss: if a program is working only with locals: the
> .bss init code is still bundled however I think that this case would
> be very rare!)
Just a nit: .bss is not for `locals', but for global/static variables
that default to the initialization value of 0 (or NULL).
--
J"org Wunsch Unix support engineer
Wir stellen aus! Auf der SYSTEMS 2004 vom 18.-22. Oktober in München
Halle B 3, Stand 320-206 (Partner-Stand von Sun Microsystems)
Halle B 2, Stand 605 "Die Musterfirma"