This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Problems converting elf32-sh to coff-sh
- To: <binutils@sourceware.cygnus.com>
- Subject: Problems converting elf32-sh to coff-sh
- From: François Costin <costin00@gel.ulaval.ca>
- Date: Fri, 10 Sep 1999 17:44:19 -0400
I need for some reason to convert simple elf object files into coff files.
My compiler produces some R_SH_DIR32 relocations which are not supported by
the binutils for the conversion. I know you can't do it in the general
case, but I've managed somehow to remap the R_SH_DIR32 as a R_SH_IMM32
reloc. This part seems to work fine.
Only one exception... when an object file contains a reloc to a function
inside that same object file, the converter adds a weird negative offset to
the symbol name when I ask for an objdump -x.
I did find where the offset comes from there's a line in the coff-sh.c file
inside the CALC_ADDEND macro which goes like this:
cache_ptr->addend = -(ptr->section->vma + ptr->value);
I did try to simply change this to:
cache_ptr->addend = 0;
Now, after doing an objcopy -O coff-sh, when I do an objdump -x with the new
code, I do not see the offset. But when I do the objdump with an older
version of the code, it does see it. And it fact it stays there.
I'd just like to know where in the code I can once and for all delete that
offset. It is only for that specific application and I know that if I can
delete the offset, I'll have no problems anymore converting my object files.
I hope I made myself clear. I can give more details if needed!
François Costin
Electrical Engineering
Technologies Lyre Inc.