diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2004-03-01 10:11:46 +0000 |
---|---|---|
committer | Richard Sandiford <rdsandiford@googlemail.com> | 2004-03-01 10:11:46 +0000 |
commit | 676a64f422161303f6d57fca0d244400a1cdd576 (patch) | |
tree | 74fd90096f8ea65f34c066fd541c4c7ff7da07e9 /bfd | |
parent | c7a48b9ac9215f67421a769c2986b6eb2a69780b (diff) | |
download | gdb-676a64f422161303f6d57fca0d244400a1cdd576.zip gdb-676a64f422161303f6d57fca0d244400a1cdd576.tar.gz gdb-676a64f422161303f6d57fca0d244400a1cdd576.tar.bz2 |
Add fr450 support.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 11 | ||||
-rw-r--r-- | bfd/archures.c | 1 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 1 | ||||
-rw-r--r-- | bfd/cpu-frv.c | 5 | ||||
-rw-r--r-- | bfd/elf32-frv.c | 42 |
5 files changed, 54 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d091b86..0e7dadc 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,14 @@ +2004-03-01 Richard Sandiford <rsandifo@redhat.com> + + * archures.c (bfd_mach_fr450): New. + * bfd-in2.h: Regenerate. + * cpu-frv.c (arch_info_450): New bfd_arch_info_type. + (arch_info_500): Link to it. + * elf32-frv.c (elf32_frv_machine, frv_elf_merge_private_bfd_data) + (frv_elf_print_private_bfd_data): Handle fr405 and fr450 header flags. + (frv_elf_arch_extension_p): New function. + (frv_elf_merge_private_bfd_data): Use it. + 2004-02-28 H.J. Lu <hongjiu.lu@intel.com> * elf-bfd.h (_bfd_elf_link_add_archive_symbols): New prototype. diff --git a/bfd/archures.c b/bfd/archures.c index f8aeeef..1f31b5d 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -285,6 +285,7 @@ DESCRIPTION .#define bfd_mach_frvsimple 2 .#define bfd_mach_fr300 300 .#define bfd_mach_fr400 400 +.#define bfd_mach_fr450 450 .#define bfd_mach_frvtomcat 499 {* fr500 prototype *} .#define bfd_mach_fr500 500 .#define bfd_mach_fr550 550 diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 74bbccd..a56a5ee 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1717,6 +1717,7 @@ enum bfd_architecture #define bfd_mach_frvsimple 2 #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 +#define bfd_mach_fr450 450 #define bfd_mach_frvtomcat 499 /* fr500 prototype */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 diff --git a/bfd/cpu-frv.c b/bfd/cpu-frv.c index f911881..499c66d 100644 --- a/bfd/cpu-frv.c +++ b/bfd/cpu-frv.c @@ -43,8 +43,11 @@ static const bfd_arch_info_type arch_info_300 static const bfd_arch_info_type arch_info_400 = FRV_ARCH (bfd_mach_fr400, "fr400", FALSE, &arch_info_300); +static const bfd_arch_info_type arch_info_450 + = FRV_ARCH (bfd_mach_fr450, "fr450", FALSE, &arch_info_400); + static const bfd_arch_info_type arch_info_500 - = FRV_ARCH (bfd_mach_fr500, "fr500", FALSE, &arch_info_400); + = FRV_ARCH (bfd_mach_fr500, "fr500", FALSE, &arch_info_450); static const bfd_arch_info_type arch_info_550 = FRV_ARCH (bfd_mach_fr550, "fr550", FALSE, &arch_info_500); diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c index a813ddc..4a84add 100644 --- a/bfd/elf32-frv.c +++ b/bfd/elf32-frv.c @@ -4032,6 +4032,8 @@ elf32_frv_machine (abfd) default: break; case EF_FRV_CPU_FR550: return bfd_mach_fr550; case EF_FRV_CPU_FR500: return bfd_mach_fr500; + case EF_FRV_CPU_FR450: return bfd_mach_fr450; + case EF_FRV_CPU_FR405: return bfd_mach_fr400; case EF_FRV_CPU_FR400: return bfd_mach_fr400; case EF_FRV_CPU_FR300: return bfd_mach_fr300; case EF_FRV_CPU_SIMPLE: return bfd_mach_frvsimple; @@ -4082,6 +4084,33 @@ frv_elf_copy_private_bfd_data (ibfd, obfd) return TRUE; } +/* Return true if the architecture described by elf header flag + EXTENSION is an extension of the architecture described by BASE. */ + +static bfd_boolean +frv_elf_arch_extension_p (flagword base, flagword extension) +{ + if (base == extension) + return TRUE; + + /* CPU_GENERIC code can be merged with code for a specific + architecture, in which case the result is marked as being + for the specific architecture. Everything is therefore + an extension of CPU_GENERIC. */ + if (base == EF_FRV_CPU_GENERIC) + return TRUE; + + if (extension == EF_FRV_CPU_FR450) + if (base == EF_FRV_CPU_FR400 || base == EF_FRV_CPU_FR405) + return TRUE; + + if (extension == EF_FRV_CPU_FR405) + if (base == EF_FRV_CPU_FR400) + return TRUE; + + return FALSE; +} + /* Merge backend specific data from an object file to the output object file when linking. */ @@ -4266,13 +4295,10 @@ frv_elf_merge_private_bfd_data (ibfd, obfd) the generic cpu). */ new_partial = (new_flags & EF_FRV_CPU_MASK); old_partial = (old_flags & EF_FRV_CPU_MASK); - if (new_partial == old_partial) - ; - - else if (new_partial == EF_FRV_CPU_GENERIC) + if (frv_elf_arch_extension_p (new_partial, old_partial)) ; - else if (old_partial == EF_FRV_CPU_GENERIC) + else if (frv_elf_arch_extension_p (old_partial, new_partial)) old_flags = (old_flags & ~EF_FRV_CPU_MASK) | new_partial; else @@ -4284,6 +4310,8 @@ frv_elf_merge_private_bfd_data (ibfd, obfd) case EF_FRV_CPU_SIMPLE: strcat (new_opt, " -mcpu=simple"); break; case EF_FRV_CPU_FR550: strcat (new_opt, " -mcpu=fr550"); break; case EF_FRV_CPU_FR500: strcat (new_opt, " -mcpu=fr500"); break; + case EF_FRV_CPU_FR450: strcat (new_opt, " -mcpu=fr450"); break; + case EF_FRV_CPU_FR405: strcat (new_opt, " -mcpu=fr405"); break; case EF_FRV_CPU_FR400: strcat (new_opt, " -mcpu=fr400"); break; case EF_FRV_CPU_FR300: strcat (new_opt, " -mcpu=fr300"); break; case EF_FRV_CPU_TOMCAT: strcat (new_opt, " -mcpu=tomcat"); break; @@ -4296,6 +4324,8 @@ frv_elf_merge_private_bfd_data (ibfd, obfd) case EF_FRV_CPU_SIMPLE: strcat (old_opt, " -mcpu=simple"); break; case EF_FRV_CPU_FR550: strcat (old_opt, " -mcpu=fr550"); break; case EF_FRV_CPU_FR500: strcat (old_opt, " -mcpu=fr500"); break; + case EF_FRV_CPU_FR450: strcat (old_opt, " -mcpu=fr450"); break; + case EF_FRV_CPU_FR405: strcat (old_opt, " -mcpu=fr405"); break; case EF_FRV_CPU_FR400: strcat (old_opt, " -mcpu=fr400"); break; case EF_FRV_CPU_FR300: strcat (old_opt, " -mcpu=fr300"); break; case EF_FRV_CPU_TOMCAT: strcat (old_opt, " -mcpu=tomcat"); break; @@ -4363,6 +4393,8 @@ frv_elf_print_private_bfd_data (abfd, ptr) case EF_FRV_CPU_SIMPLE: fprintf (file, " -mcpu=simple"); break; case EF_FRV_CPU_FR550: fprintf (file, " -mcpu=fr550"); break; case EF_FRV_CPU_FR500: fprintf (file, " -mcpu=fr500"); break; + case EF_FRV_CPU_FR450: fprintf (file, " -mcpu=fr450"); break; + case EF_FRV_CPU_FR405: fprintf (file, " -mcpu=fr405"); break; case EF_FRV_CPU_FR400: fprintf (file, " -mcpu=fr400"); break; case EF_FRV_CPU_FR300: fprintf (file, " -mcpu=fr300"); break; case EF_FRV_CPU_TOMCAT: fprintf (file, " -mcpu=tomcat"); break; |