i have this program
#include

int in_data_seg[] = { 0, 1, 2, 3 };
int in_data_seg2[] = { 400, 500, 600, 700 };

int main()
{
int i,j;
j = 2; i = 1 + in_data_seg[j];
j = 3; i = 1 + in_data_seg[j];
return 0;
}


if we build the XCOFF executable with gcc 3.3.4 and see the dump -tv
executable(MACHINE IS AIX 5.1)
***Symbol Table Information***
[Index] m Value Scn Aux Sclass Type Name
[Index] a0 Fname
[Index] a1 Tagndx Lnno Size Lnoptr Endndx
[Index] a2 Tagndx Fsiz Lnoptr Endndx
[Index] a3 Tagndx Lnno Size Dimensions
[Index] a4 CSlen PARMhsh SNhash SMtype SMclass Stab SNstab
[Index] a5 SECTlen #RELent #LINnums

[441] m 0x20000950 .data 1 unamex .data
[442] a4 0x00000024 0 0 SD RW 0 0
[443] m 0x20000950 .data 1 extern
in_data_seg
[444] a4 0x000001b9 0 0 LD RW 0 0
[445] m 0x20000960 .data 1 extern
in_data_seg2
[446] a4 0x000001b9 0 0 LD RW 0 0


basically i want to know the size of the symbol in_data_seg and
in_data_seg2
the xcoff documentation says that depending upon the SMtype CSlen
(XCOFF documnetation says it as x_scnlen i suppose they are talking
about this field) field values is interpreted in different ways.

if SMtype is XTY_SD
x_scnlen contains the csect length
if SMtype is XTY_LD
x_scnlen contains the symbol table index of the containing csect
if SMtype is XTY_CM
x_scnlen contains the csect length
if SMtype is XTY_ER
x_scnlen contains 0

so now if i look at the CSlen field it says it has symbol table index
of the containing csect
the value is 1b9 which is 441.

the 441 symbol is shown .. and is .data .. it's size is 36 one more the
combined size of in_data_seg and in_data_seg2.

i have verified this with multiple cases and the output is similar to
what we are looking at.

************************************************** ************************************************** ************
now i at runtime want to figure out what is the size of in_data_seg and
in_data_seg2 ?
************************************************** ************************************************** ************

so i can figure out the combine length but not the individual length of
the symbols.

if we compare this with the output of the excutable build with cc
dump -tv executable

it shows the following output
[117] m 0x200006c8 .data 1 extern
in_data_seg
[118] a4 0x00000010 0 0 SD RW 0 0
[120] m 0x200006d8 .data 1 extern
in_data_seg2
[121] a4 0x00000010 0 0 SD RW 0 0

so here clearly we have the size of the symbol.

thanks.