linker --relax option with debug info

M R Swami Reddy MR.Swami.Reddy@nsc.com
Fri Dec 11 07:56:00 GMT 2009


Hi Nick,

Thank you very much for hints. I will work on further.

PS: A few changes already implemented  as part of ".long   sym1 - sym2". 
where 2 symbols
    located in diff. sections.

Thanks
Swami
Nick Clifton wrote:
> Hi Swami,
>
>   
>>> the problem(s) may be found.  (I spent a lot of time fixing the 
>>> MN10300 port to work with -g and --relax).
>>>   
>>>       
>> Is the process/fix complex?
>>     
>
> Moderately so.  If I remember correctly you have to make sure that the 
> assembler does not do some things, like resolving the distance between 
> two symbols, even if they are in the same section.  (Ie you need to 
> define md_alloc_local_subtract).  You should also disable call frame 
> optimizations when linker relaxation is enabled (md_allow_eh_opt).
>
> You will also need to make sure that alignment requests are passed on to 
> the linker and not just resolved in the assembler.  So you will need to 
> define the HANDLE_ALIGN macro and create a reloc for alignment requests.
>
> Then in the BFD code you must make sure that the alignment relocs are 
> honoured when relaxing.  Also look out for a special case when relaxing 
> offsets in a DWARF2 location list.  Search for .debug_loc in 
> elf-m10300.c to find out more about this.
>
> Cheers
>    Nick
>
>
>
>
>   




More information about the Binutils mailing list