=?gb2312?B?u9i4tA==?=:Re: Hurry! compile question about switch case statement in GCC2.96

Ramana Radhakrishnan ramana.radhakrishnan@codito.com
Sat Jun 11 09:24:00 GMT 2005


> Because lw $v1,120($v1) will load .rodata+0x78 to v1 register,
>         jr v1, make PC(program counter)<--v1,
> so content of .rodata+0x78 is address of instruction, is it right?
> and switch have six case statements, so .rodata store six address of instruction.
> like as:
> 0000 0030 0000 0048 0000 0060 0000 0078 0000 0090 0000 00a8

Ah, now thats a better question .Sorry about the earlier answer, you are
not looking in the right place. 

What is in the rodata address that you refer to. ?Is it not that the
jump tables for the switch that you refer to.  Those are addresses into
the text sections. This particular part of the rodata would have its own
reloc entries. Do a objdump -Dr and look at the reloc values in rodata.
You can see the reloc values into the text around that place. 


Look at the relocation entries in the rodata section. The relocations
for the jump addresses would be in the rodata section and those will be
modified to the right address. Are these not addresses into the text
section ? 

Now is this clear ?

cheers
Ramana




More information about the Gcc-help mailing list