diff options
author | Gavin Romig-Koch <gavin@redhat.com> | 1998-12-15 14:10:46 +0000 |
---|---|---|
committer | Gavin Romig-Koch <gavin@redhat.com> | 1998-12-15 14:10:46 +0000 |
commit | 02650bd0a97e811838a207da56505e16f1209ae9 (patch) | |
tree | 398f4e5620b0cf6c712d3d061566f1e2169968f0 /bfd | |
parent | 759181e384bb9bda3b8f0219384d42866474ef49 (diff) | |
download | gdb-02650bd0a97e811838a207da56505e16f1209ae9.zip gdb-02650bd0a97e811838a207da56505e16f1209ae9.tar.gz gdb-02650bd0a97e811838a207da56505e16f1209ae9.tar.bz2 |
This adds ABI flags to MIPS/ELF object files.
For bfd:
* elf32-mips.c (elf_mips_abi_name): New.
(_bfd_mips_elf_merge_private_bfd_data): Compare EF_MIPS_ABI flags.
For gas:
* config/tc-mips.c (mips_abi_string): New.
(md_parse_option,md_longopts): Add mabi.
(mips_elf_final_processing): Set e_flags based on mabi flag.
For gcc:
* config/mips/mips.h (GAS_ASM_SPEC): Pass mabi to gas.
(ABI_GAS_ASM_SPEC,abi_gas_asm_spec): New.
(EXTRA_SPECS): Added ABI_GAS_ASM_SPEC,abi_gas_asm_spec.
For include/elf:
* mips.h (EF_MIPS_ABI,E_MIPS_ABI_O32,E_MIPS_ABI_O64,
E_MIPS_ABI_EABI32,E_MIPS_ABI_EABI64):
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-mips.c | 42 |
2 files changed, 47 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 4b4fabd..7a39879 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +1998-12-15 Gavin Romig-Koch <gavin@cygnus.com> + + * elf32-mips.c (elf_mips_abi_name): New. + (_bfd_mips_elf_merge_private_bfd_data): Compare EF_MIPS_ABI flags. + start-sanitize-vr4xxx 1998-12-13 Gavin Romig-Koch <gavin@cygnus.com> diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index 70d12a9..b9f90fd 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -60,6 +60,7 @@ static int mips_elf_additional_program_headers PARAMS ((bfd *)); static boolean mips_elf_modify_segment_map PARAMS ((bfd *)); static INLINE int elf_mips_isa PARAMS ((flagword)); static INLINE int elf_mips_mach PARAMS ((flagword)); +static INLINE char* elf_mips_abi_name PARAMS ((flagword)); static boolean mips_elf32_section_from_shdr PARAMS ((bfd *, Elf32_Internal_Shdr *, char *)); static boolean mips_elf32_section_processing @@ -1716,6 +1717,29 @@ elf_mips_mach (flags) return 0; } +/* Return printable name for ABI from flagword. */ + +static INLINE char* +elf_mips_abi_name (flags) + flagword flags; +{ + switch (flags & EF_MIPS_ABI) + { + case 0: + return "none"; + case E_MIPS_ABI_O32: + return "O32"; + case E_MIPS_ABI_O64: + return "O64"; + case E_MIPS_ABI_EABI32: + return "EABI32"; + case E_MIPS_ABI_EABI64: + return "EABI64"; + default: + return "unknown abi"; + } +} + /* A mapping from BFD reloc types to MIPS ELF reloc types. */ struct elf_reloc_map { @@ -2388,6 +2412,24 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd) old_flags &= ~ (EF_MIPS_ARCH | EF_MIPS_MACH); } + /* Compare ABI's */ + if ((new_flags & EF_MIPS_ABI) != (old_flags & EF_MIPS_ABI)) + { + /* Only error if both are set (to different values). */ + if ((new_flags & EF_MIPS_ABI) + && (old_flags & EF_MIPS_ABI)) + { + (*_bfd_error_handler) + (_("%s: ABI mismatch: linking %s module with previous %s modules"), + bfd_get_filename (ibfd), + elf_mips_abi_name (new_flags), + elf_mips_abi_name (old_flags)); + ok = false; + } + new_flags &= ~EF_MIPS_ABI; + old_flags &= ~EF_MIPS_ABI; + } + /* Warn about any other mismatches */ if (new_flags != old_flags) { |