Re: Hurry! compile question about switch case statement in GCC2.96

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

 



> we know rodata section have been relocated.
> There have 24 bytes (6*4) modified.
> 
> But as we know, relocation doesn’t tell how much byte will be modified, 
> why linker know six words will be relocated, 
I quite don't understand your question, but anyways see if this makes
sense to you. 

The linker does not know 6 words are relocated. The linker only knows
that there are 6 relocations to be performed. The information about how
many bytes will be modified is decided by the linker based on the
relocation type. The semantics of each of these operations are decided
by the linker as specified in the processor specific ABI document.

For example in the above case 
you mentioned a R_MIPS_HI16 and a R_MIPS_LO_16. Now the relocation is
to .rodata + <some_addend> . The semantics of doing a R_MIPS_HI16 reloc
is to calculate the address for the symbol being relocated which in this
case is .rodata+some_addend and then take the top 16 bits and insert the
value back into the text section where this needs to be used .

Hope this answers your question. 

cheers
Ramana



> this is my question.
> 
> 


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux