aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-06-27 01:45:30 +0000
committerNick Clifton <nickc@redhat.com>2000-06-27 01:45:30 +0000
commit65aa24b6e8082b40bb8de63732b35908cbfd088a (patch)
treefdf3cf5418105392e2b0cc7fec1c89ee566de17b /bfd
parentcc040812f5558d0d2b9c876ea0bfbb3c46e9b6dd (diff)
downloadgdb-65aa24b6e8082b40bb8de63732b35908cbfd088a.zip
gdb-65aa24b6e8082b40bb8de63732b35908cbfd088a.tar.gz
gdb-65aa24b6e8082b40bb8de63732b35908cbfd088a.tar.bz2
Applied Marek Michalkiewicz <marekm@linux.org.pl>'s patch to ehance the AVR port.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog12
-rw-r--r--bfd/archures.c1
-rw-r--r--bfd/bfd-in2.h1
-rw-r--r--bfd/cpu-avr.c16
-rw-r--r--bfd/elf32-avr.c21
5 files changed, 39 insertions, 12 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 43655d2..41f5b9f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,15 @@
+2000-06-26 Marek Michalkiewicz <marekm@linux.org.pl>
+
+ * archures.c (bfd_mach_avr5): Define.
+ * bfd-in2.h (bfd_mach_avr5): Define.
+ * cpu-avr.c (arch_info_struct): Rename bfd_mach_avr4 to
+ bfd_mach_avr5, add bfd_mach_avr4. Update comments.
+ (compatible): Update comment. Add missing test.
+ * elf32-avr.c (avr_final_link_relocate): Support 8K wrap
+ for avr2 and avr4. Simplify 8K wrap code.
+ (bfd_elf_avr_final_write_processing): Recognize bfd_mach_avr5.
+ (elf32_avr_object_p): Recognize E_AVR_MACH_AVR5.
+
2000-06-26 Kazu Hirata <kazu@hxi.com>
* coff-h8300.c: Fix formatting.
diff --git a/bfd/archures.c b/bfd/archures.c
index ffc7937..bafb9c8 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -229,6 +229,7 @@ DESCRIPTION
.#define bfd_mach_avr2 2
.#define bfd_mach_avr3 3
.#define bfd_mach_avr4 4
+.#define bfd_mach_avr5 5
. bfd_arch_last
. };
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index b0832b9..95544bf 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -1468,6 +1468,7 @@ enum bfd_architecture
#define bfd_mach_avr2 2
#define bfd_mach_avr3 3
#define bfd_mach_avr4 4
+#define bfd_mach_avr5 5
bfd_arch_last
};
diff --git a/bfd/cpu-avr.c b/bfd/cpu-avr.c
index 637b13f..9180d90 100644
--- a/bfd/cpu-avr.c
+++ b/bfd/cpu-avr.c
@@ -45,17 +45,20 @@ static const bfd_arch_info_type *compatible
static const bfd_arch_info_type arch_info_struct[] =
{
- /* AT90S1200 */
+ /* AT90S1200, ATtiny1x, ATtiny28 */
N (16, bfd_mach_avr1, "avr:1", false, & arch_info_struct[1]),
- /* AT90S2xxx, AT90S4xxx, AT90S81xx, ATtiny22 */
+ /* AT90S2xxx, AT90S4xxx, AT90S8xxx, ATtiny22 */
N (16, bfd_mach_avr2, "avr:2", false, & arch_info_struct[2]),
/* ATmega103, ATmega603 */
N (22, bfd_mach_avr3, "avr:3", false, & arch_info_struct[3]),
- /* ATmega161 */
- N (16, bfd_mach_avr4, "avr:4", false, NULL)
+ /* ATmega83, ATmega85 */
+ N (16, bfd_mach_avr4, "avr:4", false, & arch_info_struct[4]),
+
+ /* ATmega161, ATmega163, ATmega32, AT94K */
+ N (22, bfd_mach_avr5, "avr:5", false, NULL)
};
const bfd_arch_info_type bfd_avr_arch =
@@ -74,7 +77,7 @@ compatible (a,b)
if (a->arch != b->arch)
return NULL;
- /* Special case for ATmega[16]03 (avr:3) and ATmega161 (avr:4). */
+ /* Special case for ATmega[16]03 (avr:3) and ATmega83 (avr:4). */
if ((a->mach == 3 && b->mach == 4)
|| (a->mach == 4 && b->mach == 3))
return NULL;
@@ -84,6 +87,9 @@ compatible (a,b)
if (a->mach <= b->mach)
return b;
+ if (a->mach >= b->mach)
+ return a;
+
/* Never reached! */
return NULL;
}
diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c
index c64ab28..c99d667 100644
--- a/bfd/elf32-avr.c
+++ b/bfd/elf32-avr.c
@@ -548,15 +548,15 @@ avr_final_link_relocate (howto, input_bfd, input_section,
if (srel < -2048 || srel > 2047)
{
/* Apply WRAPAROUND if possible. */
- if (bfd_get_mach (input_bfd) == bfd_mach_avr2)
+ switch (bfd_get_mach (input_bfd))
{
- if (srel > 2047)
- srel -= 4096;
- else
- srel += 4096;
+ case bfd_mach_avr2:
+ case bfd_mach_avr4:
+ break;
+
+ default:
+ return bfd_reloc_overflow;
}
- else
- return bfd_reloc_overflow;
}
x = bfd_get_16 (input_bfd, contents);
@@ -899,6 +899,9 @@ bfd_elf_avr_final_write_processing (abfd, linker)
val = E_AVR_MACH_AVR4;
break;
+ case bfd_mach_avr5:
+ val = E_AVR_MACH_AVR5;
+ break;
}
elf_elfheader (abfd)->e_machine = EM_AVR;
@@ -934,6 +937,10 @@ elf32_avr_object_p (abfd)
case E_AVR_MACH_AVR4:
e_set = bfd_mach_avr4;
break;
+
+ case E_AVR_MACH_AVR5:
+ e_set = bfd_mach_avr5;
+ break;
}
}
return bfd_default_set_arch_mach (abfd, bfd_arch_avr,