This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: .cpload $25 understanding help


Deep Visana wrote:
Hi,
Writing this to you after reading mail thread
discussion under:
http://sourceware.org/ml/binutils/2004-12/msg00094.html
Need your help as I am new to MIPS and assembly code
both.
We have seen that gcc compiler emits .cpload $25.
Q1: ".cpload $25" pseudo-ops and needs to be
interpreted by gnu assembler?
.cpload $25 causes $gp to be set to the proper value given that $25 contains the address of the same .cpload (which should always be the function entry point.
Q2: What should be done by assembler to replace it
with correct instruction. What are the content of $25?

If you read the message that you referenced you would see that the answer is:


	lui	$gp,%hi(_gp_disp)
	addiu	$gp,$gp,%lo(_gp_disp)
	addu	$gp,$gp,.cpload argument


$25 contains the address of the function being called.


Q3: Is there any good refernce/documentation to such
mips specific pseudo ops available somewhere?

Yes. I once found one by using Google. I forget where I put it.
Our basic problem is that we need to feed gcc
compiled ".s" to Greenhills MIPS assembler and it does
not understand .cpload pseudo. Any suggestions on how
to replace .cpload with correct m/c instruction in few
such .s file?


Cpu is mips 5k running in 32bit mode.

You don't say which ABI the Greenhills tools use. If they don't use the o32 ABI then you will probably have problems. GCC allows you to choose several different ABIs. You should choose one that matches what Greenhills is using.


David Daney



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]