| 1 |
/* BFD support for the score processor |
/* BFD support for the score processor |
| 2 |
Copyright 2006, 2007 Free Software Foundation, Inc. |
Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc. |
| 3 |
Contributed by |
Contributed by |
| 4 |
|
Brain.lin (brain.lin@sunplusct.com) |
| 5 |
Mei Ligang (ligang@sunnorth.com.cn) |
Mei Ligang (ligang@sunnorth.com.cn) |
| 6 |
Pei-Lin Tsai (pltsai@sunplus.com) |
Pei-Lin Tsai (pltsai@sunplus.com) |
| 7 |
|
|
| 8 |
This file is part of BFD, the Binary File Descriptor library. |
This file is part of BFD, the Binary File Descriptor library. |
| 9 |
|
|
| 22 |
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
| 23 |
MA 02110-1301, USA. */ |
MA 02110-1301, USA. */ |
| 24 |
|
|
|
#include "sysdep.h" |
|
| 25 |
#include "bfd.h" |
#include "bfd.h" |
| 26 |
|
#include "sysdep.h" |
| 27 |
#include "libbfd.h" |
#include "libbfd.h" |
| 28 |
|
|
| 29 |
const bfd_arch_info_type |
/* This routine is provided two arch_infos and works out which Score |
| 30 |
bfd_score_arch = |
machine which would be compatible with both and returns a pointer |
| 31 |
|
to its info structure. */ |
| 32 |
|
|
| 33 |
|
static const bfd_arch_info_type * |
| 34 |
|
compatible (const bfd_arch_info_type * a, const bfd_arch_info_type * b) |
| 35 |
{ |
{ |
| 36 |
32, /* There's 32 bits_per_word. */ |
/* If a & b are for different architectures we can do nothing. */ |
| 37 |
32, /* There's 32 bits_per_address. */ |
if (a->arch != b->arch) |
| 38 |
8, /* There's 8 bits_per_byte. */ |
return NULL; |
| 39 |
bfd_arch_score, /* One of enum bfd_architecture, defined |
|
| 40 |
in archures.c and provided in |
if (a->mach != b->mach) |
| 41 |
generated header files. */ |
return NULL; |
| 42 |
0, /* Only 1 machine, but #255 for |
|
| 43 |
historical reasons. */ |
return a; |
| 44 |
"score", /* The arch_name. */ |
} |
| 45 |
"score", /* The printable name is the same. */ |
|
| 46 |
4, /* Section alignment power; each section |
#define N(addr_bits, machine, print, default, next) \ |
| 47 |
is aligned to (only) 2^4 bytes. */ |
{ \ |
| 48 |
TRUE, /* This is the default "machine", since |
32, /* 16 bits in a word. */ \ |
| 49 |
there's only one. */ |
32, /* Bits in an address. */ \ |
| 50 |
bfd_default_compatible, /* A default function for testing |
8, /* 8 bits in a byte. */ \ |
| 51 |
"machine" compatibility of two |
bfd_arch_score, \ |
| 52 |
bfd_arch_info_type. */ |
machine, /* Machine number. */ \ |
| 53 |
bfd_default_scan, /* Check if an bfd_arch_info_type is a |
"score", /* Architecture name. */ \ |
| 54 |
match. */ |
print, /* Printable name. */ \ |
| 55 |
NULL /* Pointer to next bfd_arch_info_type in |
4, /* Section align power. */ \ |
| 56 |
the same family. */ |
default, /* The default machine. */ \ |
| 57 |
|
compatible, \ |
| 58 |
|
bfd_default_scan, \ |
| 59 |
|
next \ |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
static const bfd_arch_info_type arch_info_struct[] = |
| 63 |
|
{ |
| 64 |
|
N (16, bfd_mach_score3, "score3", FALSE, NULL), |
| 65 |
}; |
}; |
| 66 |
|
|
| 67 |
|
const bfd_arch_info_type bfd_score_arch = |
| 68 |
|
N (16, bfd_mach_score7, "score7", TRUE, & arch_info_struct[0]); |