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: linker --relax option with debug info


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



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