Hi Pedro,
in your first example there is only one step missing in comparison to the second one: Your code is assembled but not linked against anything. So if you have a look at your assembler file and also at your object file (msp430-nm size-test.o) you have one locally linked static int variable (size 2Bytes) and two global "common objects" which will be resolved on link time (with other objects). The latter ones are not jet counted to the bss segment (however they will be positioned there later). You can check out this (not for production purposes ;°):
add a line
void* __stop_progExec__;
to your size-test.c file
do the steps from your first example and finally do
msp430-ld -o size-test size-test.o
then look at the object size-test with
msp430-size size-test
msp430-nm size-test
you will find your symbols allocated in the bss segment.

The appropriate steps are included in the complete way (as in your second example). You usually use the gcc (msp430-gcc) call as wrapper for all of these steps. So you find the same (correct) results as in the previous case.
Best regards

Arnd-Hendrik


Pedro Zorzenon Neto wrote:

Hi,

 I think I found a bug in msp430-size. I'll show it with an example:

/* --- begin of code --- */
int i;
static int j;
volatile int k;

int main (void) {
 return 1;
}
/* --- end of code --- */


msp430-gcc -mmcu=msp430x149 -I/usr/local/msp430/msp430/include -Wall -O1 -S 
size-test.c -o size-test.s
msp430-as -mmcu=msp430x149 size-test.s -o size-test.o
msp430-size size-test.o
  text    data     bss     dec     hex filename
    10       0       2      12       c size-test.o
msp430-gcc -mmcu=msp430x149 -B/usr/local/msp430/msp430/lib size-test.o -o 
size-test
msp430-size size-test
  text    data     bss     dec     hex filename
   110       0       6     116      74 size-test

  Why is msp430-size reporting "2" in the "bss" field for file size-test.o?

  Thanks in advance,
    Pedro


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users




Reply via email to