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: [PATCH, CFI] Fix EH for coldfire-uclinux


On 11/03/2009 01:35 PM, Maxim Kuvyrkov wrote:
To generate bFLT binaries for coldfire-uclinux elf2flt utility is used.
Elf2flt does not honor PT_LOAD's from the executable. So, despite
appearances of the ELF file, .text and .eh_frame sections will not end
up in the same segment in bFLT file. Therefore PC-relative encoding
cannot be used for CFI on coldfire-uclinux. Hence this patch defines
CFI_DIFF_EXPR_OK to 0 for coldfire-uclinux.

I don't see anything wrong with the patch as far as it goes, but...


The best solution would be to fix elf2flt and get the eh data into the read-only section, then use DW_EH_PE_datarel for any items that reside in the data section.

The ideal relocation type for datarel relocations is something like R_386_GOTOFF. You don't have that one on m68k (though it wouldn't be hard to add, and would improve all of the code generated by the compiler for this memory model). What you do have is R_68K_GOT32O, which is DW_EH_PE_datarel|DW_EH_PE_indirect. The only thing missing at this point is the fact that unlike other targets, m68k doesn't parse the @RELOC specifiers on .long data.

Fix that and you'll significantly reduce the number of relocations needed in those bFLT files.


r~



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