R_MIPS_GOT16 relocation in GOLD

Aleksandar Simeonov Aleksandar.Simeonov@RT-RK.com
Mon Aug 15 14:34:00 GMT 2011


Hi Ian,
Again I have a problem that I can't find solution. Situation is as follows:
- there are multiple R_MIPS_GOT16 relocations in a file against same
symbol, but with different addends (part of the code is shown below):
a0:	3c040000 	lui	a0,0x0
			a0: R_MIPS_GOT16	.text
a8:	3c040000 	lui	a0,0x0
			a8: R_MIPS_GOT16	.text
b0:	3c040000 	lui	a0,0x0
			b0: R_MIPS_GOT16	.text
b8:	3c040001 	lui	a0,0x1
			b8: R_MIPS_GOT16	.text

- R_MIPS_GOT16 relocation is relocation against .got section.
- .got section contains values of symbols increased by addend.
- it only contains unique values (duplicate values are discarded).
- relocation value is relative offset between global pointer value and
address of data in .got section.

Only place I found to add new fields to .got section is in
Target_mips::Scan::local/global, but there is not known value of addend
and I can't find if some field already contains value that I want to
add. Also, those data are not known in do_write function. Only during
relocation all necessary data are known, but problem is that size of
.got section is fixed.

Is there a way to overcome that problem with missing addend information
and to add only unique values in .got section? Or there is some other
possible solution?

Thanks in advance for your help,
Aleksandar



More information about the Binutils mailing list