]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - bfd/cpu-rs6000.c
Automatic date update in version.in
[thirdparty/binutils-gdb.git] / bfd / cpu-rs6000.c
CommitLineData
252b5132 1/* BFD back-end for rs6000 support
82704155 2 Copyright (C) 1990-2019 Free Software Foundation, Inc.
2ce18a16 3 Written by Mimi Phuong-Thao Vo of IBM
252b5132
RH
4 and John Gilmore of Cygnus Support.
5
cd123cb7 6 This file is part of BFD, the Binary File Descriptor library.
252b5132 7
cd123cb7
NC
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
252b5132 12
cd123cb7
NC
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
252b5132 17
cd123cb7
NC
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21 MA 02110-1301, USA. */
252b5132 22
252b5132 23#include "sysdep.h"
3db64b00 24#include "bfd.h"
252b5132
RH
25#include "libbfd.h"
26
27/* The RS/6000 architecture is compatible with the PowerPC common
28 architecture. */
29
252b5132 30static const bfd_arch_info_type *
2c3fc389
NC
31rs6000_compatible (const bfd_arch_info_type *a,
32 const bfd_arch_info_type *b)
252b5132
RH
33{
34 BFD_ASSERT (a->arch == bfd_arch_rs6000);
35 switch (b->arch)
36 {
37 default:
38 return NULL;
39 case bfd_arch_rs6000:
40 return bfd_default_compatible (a, b);
41 case bfd_arch_powerpc:
3f8b3ef3 42 if (a->mach == bfd_mach_rs6k)
252b5132
RH
43 return b;
44 return NULL;
45 }
46 /*NOTREACHED*/
47}
48
87f33987
ND
49static const bfd_arch_info_type arch_info_struct[] =
50{
51 {
52 32, /* 32 bits in a word */
53 32, /* 32 bits in an address */
54 8, /* 8 bits in a byte */
55 bfd_arch_rs6000,
56 bfd_mach_rs6k_rs1,
57 "rs6000",
58 "rs6000:rs1",
59 3,
b34976b6 60 FALSE, /* not the default */
87f33987
ND
61 rs6000_compatible,
62 bfd_default_scan,
b7761f11 63 bfd_arch_default_fill,
87f33987
ND
64 &arch_info_struct[1]
65 },
66 {
67 32, /* 32 bits in a word */
68 32, /* 32 bits in an address */
69 8, /* 8 bits in a byte */
70 bfd_arch_rs6000,
71 bfd_mach_rs6k_rsc,
72 "rs6000",
73 "rs6000:rsc",
74 3,
b34976b6 75 FALSE, /* not the default */
87f33987
ND
76 rs6000_compatible,
77 bfd_default_scan,
b7761f11 78 bfd_arch_default_fill,
87f33987
ND
79 &arch_info_struct[2]
80 },
81 {
82 32, /* 32 bits in a word */
83 32, /* 32 bits in an address */
84 8, /* 8 bits in a byte */
85 bfd_arch_rs6000,
86 bfd_mach_rs6k_rs2,
87 "rs6000",
88 "rs6000:rs2",
89 3,
b34976b6 90 FALSE, /* not the default */
87f33987
ND
91 rs6000_compatible,
92 bfd_default_scan,
b7761f11 93 bfd_arch_default_fill,
87f33987
ND
94 0
95 }
96};
97
252b5132
RH
98const bfd_arch_info_type bfd_rs6000_arch =
99 {
100 32, /* 32 bits in a word */
101 32, /* 32 bits in an address */
102 8, /* 8 bits in a byte */
103 bfd_arch_rs6000,
87f33987 104 bfd_mach_rs6k, /* POWER common architecture */
252b5132
RH
105 "rs6000",
106 "rs6000:6000",
107 3,
b34976b6 108 TRUE, /* the default */
252b5132
RH
109 rs6000_compatible,
110 bfd_default_scan,
b7761f11 111 bfd_arch_default_fill,
87f33987 112 &arch_info_struct[0]
252b5132 113 };