Gold linker - help with .reginfo section for mips

Aleksandar Simeonov Aleksandar.Simeonov@RT-RK.com
Wed May 11 15:10:00 GMT 2011


Hi again Ian,
After few tries and errors I decided to write you again. I still have
problems with .reginfo section. I managed to find all data I need, but I
still have problems to set them in output section. I did create new
type, but still have problems to set correct output data (as well as
correct size). Any idea how to set output data and size in
Output_section class would be great since I'm stuck with this for a week
already.

Thanks in advance for your answer.

Aleksandar

P. S.
I added your previous answer to this mail since I send this to mailing
list, too.

On 26/04/2011 18:51, Ian Lance Taylor wrote:

>> 3. MIPS has .reginfo section. It contains list of registers that are
>> used in current file as well as value of _gp. It is always 24 bytes long
>> (4 bytes for general purpose registers, 16 bytes for coprocessors'
>> registers and 4 bytes for global pointer value). Currently, Gold just
>> concatenates .reginfo sections from all input files. What has to be done
>> is following: first 20 bytes of every section is combined using OR
>> operation, and last 4 bytes just get value of _gp. I'm trying to make
>> that some how, but I have problems to find data I need (I have idea
>> where to find input data, but still I haven't managed to get access to
>> it). Also, I'm not sure if I implement that on correct place (in
>> Target_mips<size, big_endian>::do_finalize_sections function)?
> 
> I think the right way to handle this is for the MIPS target to override
> the default do_make_output_section method.  For a SHT_MIPS_REGINFO
> section it should return a new kind of output section, as the ARM target
> does.  That new class should do the right thing in the various virtual
> functions such as set_final_data_size() and write().
> 
> Ian
> 



More information about the Binutils mailing list