This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] avr port: bfd C files patch




Thu Mar 16 22:57:05 2000  Denis Chertykov  <denisc@overta.ru>

	* archures.c (bfd_architecture): avr architecture added.
	(bfd_archures_list): reference to avr architecture info added.
	* elf.c (prep_headers): Handle bfd_arch_avr.
	* reloc.c: Various avr relocations added.
	* targets.c (bfd_elf32_avr_vec): Declare and add to target
	vector list.


Index: binutils/bfd/archures.c
===================================================================
RCS file: /cvs/src/src/bfd/archures.c,v
retrieving revision 1.10
diff -u -r1.10 archures.c
--- archures.c	2000/02/23 13:52:20	1.10
+++ archures.c	2000/03/16 20:15:12
@@ -199,6 +199,11 @@
 .#define bfd_mach_fr30		0x46523330
 .  bfd_arch_mcore,
 .  bfd_arch_pj,
+.  bfd_arch_avr,       {* Atmel AVR mocrocontrollers *}
+.#define bfd_mach_avr1		1
+.#define bfd_mach_avr2		2
+.#define bfd_mach_avr3		3
+.#define bfd_mach_avr4		4
 .  bfd_arch_last
 .  };
 
@@ -271,6 +276,7 @@
 extern const bfd_arch_info_type bfd_v850_arch;
 extern const bfd_arch_info_type bfd_fr30_arch;
 extern const bfd_arch_info_type bfd_mcore_arch;
+extern const bfd_arch_info_type bfd_avr_arch;
 
 static const bfd_arch_info_type * const bfd_archures_list[] =
 {
@@ -309,7 +315,8 @@
   &bfd_w65_arch,
   &bfd_v850_arch,
   &bfd_fr30_arch,
-  & bfd_mcore_arch,
+  &bfd_mcore_arch,
+  &bfd_avr_arch,
 #endif
   0
 };
Index: binutils/bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.26
diff -u -r1.26 elf.c
--- elf.c	2000/03/06 15:44:25	1.26
+++ elf.c	2000/03/16 20:15:33
@@ -3276,6 +3276,9 @@
     case bfd_arch_mcore:
       i_ehdrp->e_machine = EM_MCORE;
       break;
+    case bfd_arch_avr:
+      i_ehdrp->e_machine = EM_AVR;
+      break;
     case bfd_arch_v850:
       switch (bfd_get_mach (abfd))
 	{
Index: binutils/bfd/reloc.c
===================================================================
RCS file: /cvs/src/src/bfd/reloc.c,v
retrieving revision 1.14
diff -u -r1.14 reloc.c
--- reloc.c	2000/03/11 01:16:52	1.14
+++ reloc.c	2000/03/16 20:15:49
@@ -2623,6 +2623,91 @@
   Motorola Mcore relocations.
 
 ENUM
+  BFD_RELOC_AVR_7_PCREL
+ENUMDOC
+  This is a 16 bit reloc for the AVR that stores 8 bit pc relative
+  short offset into 7 bits.
+ENUM
+  BFD_RELOC_AVR_13_PCREL
+ENUMDOC
+  This is a 16 bit reloc for the AVR that stores 13 bit pc relative
+  short offset into 12 bits.
+ENUM
+  BFD_RELOC_AVR_16_PM
+ENUMDOC
+  This is a 16 bit reloc for the AVR that stores 17 bit value (usually
+  program memory address) into 16 bits.  
+ENUM
+  BFD_RELOC_AVR_LO8_LDI
+ENUMDOC
+  This is a 16 bit reloc for the AVR that stores 8 bit value (usually
+  data memory address) into 8 bit immediate value of LDI insn.
+ENUM
+  BFD_RELOC_AVR_HI8_LDI
+ENUMDOC
+  This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
+  of data memory address) into 8 bit immediate value of LDI insn.
+ENUM
+  BFD_RELOC_AVR_HH8_LDI
+ENUMDOC
+  This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
+  of program memory address) into 8 bit immediate value of LDI insn.
+ENUM
+  BFD_RELOC_AVR_LO8_LDI_NEG
+ENUMDOC
+  This is a 16 bit reloc for the AVR that stores negated 8 bit value
+  (usually data memory address) into 8 bit immediate value of SUBI insn.
+ENUM
+  BFD_RELOC_AVR_HI8_LDI_NEG
+ENUMDOC
+  This is a 16 bit reloc for the AVR that stores negated 8 bit value
+  (high 8 bit of data memory address) into 8 bit immediate value of
+  SUBI insn.
+ENUM
+  BFD_RELOC_AVR_HH8_LDI_NEG
+ENUMDOC
+  This is a 16 bit reloc for the AVR that stores negated 8 bit value
+  (most high 8 bit of program memory address) into 8 bit immediate value
+  of LDI or SUBI insn.
+ENUM
+  BFD_RELOC_AVR_LO8_LDI_PM
+ENUMDOC
+  This is a 16 bit reloc for the AVR that stores 8 bit value (usually
+  command address) into 8 bit immediate value of LDI insn.
+ENUM
+  BFD_RELOC_AVR_HI8_LDI_PM
+ENUMDOC
+  This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
+  of command address) into 8 bit immediate value of LDI insn.
+ENUM
+  BFD_RELOC_AVR_HH8_LDI_PM
+ENUMDOC
+  This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
+  of command address) into 8 bit immediate value of LDI insn.
+ENUM
+  BFD_RELOC_AVR_LO8_LDI_PM_NEG
+ENUMDOC
+  This is a 16 bit reloc for the AVR that stores negated 8 bit value
+  (usually command address) into 8 bit immediate value of SUBI insn.
+ENUM
+  BFD_RELOC_AVR_HI8_LDI_PM_NEG
+ENUMDOC
+  This is a 16 bit reloc for the AVR that stores negated 8 bit value
+  (high 8 bit of 16 bit command address) into 8 bit immediate value
+  of SUBI insn.
+ENUM
+  BFD_RELOC_AVR_HH8_LDI_PM_NEG
+ENUMDOC
+  This is a 16 bit reloc for the AVR that stores negated 8 bit value
+  (high 6 bit of 22 bit command address) into 8 bit immediate
+  value of SUBI insn.
+ENUM
+  BFD_RELOC_AVR_CALL
+ENUMDOC
+  This is a 32 bit reloc for the AVR that stores 23 bit value
+  into 22 bits.
+
+ENUM
   BFD_RELOC_VTABLE_INHERIT
 ENUMX
   BFD_RELOC_VTABLE_ENTRY
Index: binutils/bfd/targets.c
===================================================================
RCS file: /cvs/src/src/bfd/targets.c,v
retrieving revision 1.13
diff -u -r1.13 targets.c
--- targets.c	2000/02/28 18:56:11	1.13
+++ targets.c	2000/03/16 20:15:50
@@ -506,6 +506,7 @@
 extern const bfd_target b_out_vec_big_host;
 extern const bfd_target b_out_vec_little_host;
 extern const bfd_target bfd_elf64_alpha_vec;
+extern const bfd_target bfd_elf32_avr_vec;
 extern const bfd_target bfd_elf32_bigarc_vec;
 extern const bfd_target bfd_elf32_bigarm_vec;
 extern const bfd_target bfd_elf32_bigarm_oabi_vec;
@@ -690,6 +691,7 @@
 #ifdef BFD64
 	&bfd_elf64_alpha_vec,
 #endif
+	&bfd_elf32_avr_vec,
 	&bfd_elf32_bigarc_vec,
         &bfd_elf32_bigarm_vec,
         &bfd_elf32_bigarm_oabi_vec,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]