This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH, POINTER] Reorganization of MIPS ELF specific BFD sourcecode
- From: Thiemo Seufer <ica2_ts at csv dot ica dot uni-stuttgart dot de>
- To: binutils at sources dot redhat dot com
- Date: Sat, 23 Mar 2002 19:31:18 +0100
- Subject: [PATCH, POINTER] Reorganization of MIPS ELF specific BFD sourcecode
Hi All,
in order to get a decent starting point for adding n32 ABI support,
which needs a new bfd vector and thus a new file, I organized the
current code in elf{32,64}-mips.c in a new way, removing much
copy&paste code in this process. The structure is now:
elfxx-mips.c Common code for all backends
elfxx-mips.h Prototypes for elfxx-mips.c
elf32-mips.c OldABI/No ABI support
elf64-mips.c (n)64 ABI support
It changes no functionality for OldABI and very little for n64 ABI.
Tested with targets mips-elf, mips64-elf, mips-linux, mips64-linux
without new regressions.
/bfd/ChangeLog
* Makefile.am: Add elfxx-mips.c to the known backends.
(elf32-mips.lo): remove dependency to coff/external.h.
* Makefile.in: Regenerate.
* configure.in: Add elfxx-mips.lo to all vectors using elf32-mips.lo
Remove elf32-mips.lo from 64 bit vectors. Update dependencies
accordingly.
* configure: Regenerate.
* elf-bfd.h: Move all MIPS ELF specific prototypes to elfxx-mips.h.
(irix_compat_t): IRIX compatibility level, moved from elf32-mips.c.
(elf_backend_mips_irix_compat, elf_backend_mips_rtype_to_howto): New
MIPS specific backend functions.
* elf32-mips.c: Moved most code to elfxx-mips.c.
(mips_elf_hi16_reloc): Rename from _bfd_mips_elf_hi16_reloc and make
static.
(mips_elf_lo16_reloc): Likewise, was _bfd_mips_elf_lo16_reloc.
(mips_elf_got16_reloc): Likewise, was _bfd_mips_elf_got16_reloc.
(mips_elf_gprel32_reloc): Likewise, was _bfd_mips_elf_gprel32_reloc.
(mips_elf32_rtype_to_howto): Rename from mips_rtype_to_howto. Changed
interface to allow selection of the right REL or RELA howto table.
(mips_elf32_object_p): Rename from _bfd_mips_elf_object_p and made
static. Let it refuse n32 objects.
(elf32_mips_grok_prstatus): Rename from _bfd_elf32_mips_grok_prstatus.
(elf32_mips_grok_psinfo): Rename from _bfd_elf32_mips_grok_psinfo.
(elf32_mips_discard_info): Rename from _bfd_elf32_mips_discard_info.
(elf32_mips_ignore_discarded_relocs): Rename from
_bfd_elf32_mips_ignore_discarded_relocs.
(elf32_mips_write_section): Rename from _bfd_elf32_mips_write_section.
(elf32_mips_irix_compat): New function, replaces IRIX_COMPAT.
(elf_mips_howto_table_rela): Remove.
* elf64-mips.c: Moved most code to elfxx-mips.c.
(bfd_elf64_bfd_reloc_type_lookup): Make static.
(mips_elf64_rtype_to_howto): New function.
(mips_elf64_object_p): Likewise.
(elf64_mips_irix_compat): Likewise.
* elfxx-mips.c: New file containing common code merged together from
elf32-mips.c and elf64-mips.c.
* elfxx-mips.h: New file containing MIPS specific prototypes from
elf-bfd.h.
* elfxx-target.h: Add handling for elf_backend_mips_irix_compat and
elf_backend_mips_rtype_to_howto.
Since the patch is large (~740k), it's available at
http://www.csv.ica.uni-stuttgart.de/homes/ths/linux-mips/cygnus-bfd-mipscommon
Thiemo