Setting gp on pic code

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

 



Hi,

I am trying to set the gp register on pic code as follows:

"la gp,_gp"

Disassembling the resulting code,

"lw gp,0(gp)"

I am confused as to why it uses a gp-relative address instead of an
absolute address for _gp. How I am supposed to reset gp then?

A bit of background. I am working on a dual core chip, with each core
running independently. They both boot from the same startup code, then
the second core waits until the first one sets all the hardware and
loads a pic binary into a shared memory region.

The second core is then released and should reset gp and jump to the
new binary (which is compiled separately from the startup code).

This arrangement seems to work OK if the binary is compiled non-pic,
but for pic code  the gp register is not set to the correct value.

Any insight into this appreciated.

Thanks,
Alex


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux