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

Re: mips64 assembler


David Kuehling <dvdkhlng@gmx.de> writes:

>>>>>> "Camm" == Camm Maguire <camm@maguirefamily.org> writes:
>> Greetings!  What is wrong with this stub attempting a jump to contents
>> of register $t0?
>> (gdb) p/x *(ul *)0x109413c@4 $3 = {0x3c080077, /*lui t0,0x77*/
>> 0x2508a170, /*addui t0,t0,0xa170*/ 0x8d08a288, /*lw t0,-23928(t0) */
>> 0x1000008 /* jr t0*/ }
>> (gdb) c Program received signal SIGTRAP, Trace/breakpoint trap.
>> 0x01094148 in ?? () /*this is the jump instruction*/ (gdb) i reg t0
>> t0: 0x2ae13bf0 /*this is the correct address*/
> I don't understand the context of what you're trying to do.  But when I
> did some MIPS32 OABI assembly last time, I noticed that calls into
> shared libraries _must_ load the address of the function into t9 before
> doing the jump.  Else position-independant code won't work.
> I.e. replace t0 in your stub with t9.

Yes, ran into this one too and solved trial and error.  Thank you so
much for the reply!  Should have read email before experimenting.

Take care,

> BTW why not use gdb's 'disas' command to look at the stub?
> David
> -- 
> GnuPG public key: http://user.cs.tu-berlin.de/~dvdkhlng/dk.gpg
> Fingerprint: B17A DC95 D293 657B 4205  D016 7DEF 5323 C174 7D40

Camm Maguire			     		    camm@maguirefamily.org
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah

Reply to: