]> git.pld-linux.org Git - packages/crossavr-binutils.git/blob - 500-binutils-2.20.1-bug13789.patch
- synchronized patches with Atmel official AVR8-GNU toolchain.
[packages/crossavr-binutils.git] / 500-binutils-2.20.1-bug13789.patch
1 diff -rupN bfd/archures.c bfd/archures.c
2 --- bfd/archures.c      2011-05-11 20:06:37.000000000 -0500
3 +++ bfd/archures.c      2011-05-10 13:35:37.000000000 -0500
4 @@ -368,6 +368,7 @@ DESCRIPTION
5  .#define bfd_mach_avr5         5
6  .#define bfd_mach_avr51                51
7  .#define bfd_mach_avr6         6
8 +.#define bfd_mach_avrtiny10 100 
9  .#define bfd_mach_avrxmega1 101
10  .#define bfd_mach_avrxmega2 102
11  .#define bfd_mach_avrxmega3 103
12 @@ -375,7 +376,6 @@ DESCRIPTION
13  .#define bfd_mach_avrxmega5 105
14  .#define bfd_mach_avrxmega6 106
15  .#define bfd_mach_avrxmega7 107
16 -.#define bfd_mach_avrtiny10 201
17  .  bfd_arch_bfin,        {* ADI Blackfin *}
18  .#define bfd_mach_bfin          1
19  .  bfd_arch_cr16,       {* National Semiconductor CompactRISC (ie CR16). *}
20 diff -rupN bfd/bfd-in2.h bfd/bfd-in2.h
21 --- bfd/bfd-in2.h       2011-05-11 20:06:39.000000000 -0500
22 +++ bfd/bfd-in2.h       2011-05-10 13:35:37.000000000 -0500
23 @@ -2042,6 +2042,7 @@ enum bfd_architecture
24  #define bfd_mach_avr5          5
25  #define bfd_mach_avr51         51
26  #define bfd_mach_avr6          6
27 +#define bfd_mach_avrtiny10 100 
28  #define bfd_mach_avrxmega1 101
29  #define bfd_mach_avrxmega2 102
30  #define bfd_mach_avrxmega3 103
31 @@ -2049,7 +2050,6 @@ enum bfd_architecture
32  #define bfd_mach_avrxmega5 105
33  #define bfd_mach_avrxmega6 106
34  #define bfd_mach_avrxmega7 107
35 -#define bfd_mach_avrtiny10 201
36    bfd_arch_bfin,        /* ADI Blackfin */
37  #define bfd_mach_bfin          1
38    bfd_arch_cr16,       /* National Semiconductor CompactRISC (ie CR16). */
39 diff -rupN bfd/cpu-avr.c bfd/cpu-avr.c
40 --- bfd/cpu-avr.c       2011-05-11 20:06:41.000000000 -0500
41 +++ bfd/cpu-avr.c       2011-05-10 13:35:37.000000000 -0500
42 @@ -135,29 +135,29 @@ static const bfd_arch_info_type arch_inf
43    /* 3-Byte PC.  */
44    N (22, bfd_mach_avr6, "avr:6", FALSE, & arch_info_struct[10]),
45    
46 +  /* attiny 10 */
47 +  N (16, bfd_mach_avrtiny10, "avr:100", FALSE, & arch_info_struct[11]),
48 +  
49    /* Xmega 1 */
50 -  N (24, bfd_mach_avrxmega1, "avr:101", FALSE, & arch_info_struct[11]),
51 +  N (24, bfd_mach_avrxmega1, "avr:101", FALSE, & arch_info_struct[12]),
52  
53    /* Xmega 2 */
54 -  N (24, bfd_mach_avrxmega2, "avr:102", FALSE, & arch_info_struct[12]),
55 +  N (24, bfd_mach_avrxmega2, "avr:102", FALSE, & arch_info_struct[13]),
56    
57    /* Xmega 3 */
58 -  N (24, bfd_mach_avrxmega3, "avr:103", FALSE, & arch_info_struct[13]),
59 +  N (24, bfd_mach_avrxmega3, "avr:103", FALSE, & arch_info_struct[14]),
60    
61    /* Xmega 4 */
62 -  N (24, bfd_mach_avrxmega4, "avr:104", FALSE, & arch_info_struct[14]),
63 +  N (24, bfd_mach_avrxmega4, "avr:104", FALSE, & arch_info_struct[15]),
64    
65    /* Xmega 5 */
66 -  N (24, bfd_mach_avrxmega5, "avr:105", FALSE, & arch_info_struct[15]),
67 +  N (24, bfd_mach_avrxmega5, "avr:105", FALSE, & arch_info_struct[16]),
68    
69    /* Xmega 6 */
70 -  N (24, bfd_mach_avrxmega6, "avr:106", FALSE, & arch_info_struct[16]),
71 +  N (24, bfd_mach_avrxmega6, "avr:106", FALSE, & arch_info_struct[17]),
72    
73    /* Xmega 7 */
74 -  N (24, bfd_mach_avrxmega7, "avr:107", FALSE, & arch_info_struct[17]),
75 -  
76 -  /* attiny 10 */
77 -  N (16, bfd_mach_avrtiny10, "avr:201", FALSE, NULL)
78 +  N (24, bfd_mach_avrxmega7, "avr:107", FALSE, NULL)
79    
80  };
81  
82 diff -rupN include/elf/avr.h include/elf/avr.h
83 --- include/elf/avr.h   2011-05-11 20:06:42.000000000 -0500
84 +++ include/elf/avr.h   2011-05-10 13:35:37.000000000 -0500
85 @@ -40,6 +40,7 @@
86  #define E_AVR_MACH_AVR5 5
87  #define E_AVR_MACH_AVR51 51
88  #define E_AVR_MACH_AVR6 6 
89 +#define E_AVR_MACH_AVRTINY10 100
90  #define E_AVR_MACH_XMEGA1 101
91  #define E_AVR_MACH_XMEGA2 102
92  #define E_AVR_MACH_XMEGA3 103
93 @@ -47,7 +48,6 @@
94  #define E_AVR_MACH_XMEGA5 105
95  #define E_AVR_MACH_XMEGA6 106
96  #define E_AVR_MACH_XMEGA7 107
97 -#define E_AVR_MACH_AVRTINY10 201
98  
99  /* Relocations.  */
100  START_RELOC_NUMBERS (elf_avr_reloc_type)
101 diff -rupN ld/emulparams/avrtiny10.sh ld/emulparams/avrtiny10.sh
102 --- ld/emulparams/avrtiny10.sh  2011-05-11 20:06:44.000000000 -0500
103 +++ ld/emulparams/avrtiny10.sh  2011-05-10 13:39:44.000000000 -0500
104 @@ -1,12 +1,13 @@
105 -ARCH=avr:201
106 +ARCH=avr:100
107  MACHINE=
108 -SCRIPT_NAME=avr
109 +SCRIPT_NAME=avrtiny10
110  OUTPUT_FORMAT="elf32-avr"
111  MAXPAGESIZE=1
112  EMBEDDED=yes
113  TEMPLATE_NAME=elf32
114  
115 +TEXT_ORIGIN=0x0
116  TEXT_LENGTH=4K
117 -DATA_ORIGIN=0x800040
118 -DATA_LENGTH=0x140
119 +DATA_ORIGIN=0x0800040
120 +DATA_LENGTH=0x100
121  EXTRA_EM_FILE=avrelf
122 diff -rupN ld/Makefile.am ld/Makefile.am
123 --- ld/Makefile.am      2011-05-11 20:06:47.000000000 -0500
124 +++ ld/Makefile.am      2011-05-10 13:35:37.000000000 -0500
125 @@ -764,7 +764,7 @@ eavrxmega7.c: $(srcdir)/emulparams/avrxm
126    ${GEN_DEPENDS}
127         ${GENSCRIPTS} avrxmega7 "$(tdir_avr2)"
128  eavrtiny10.c: $(srcdir)/emulparams/avrtiny10.sh \
129 -  $(srcdir)/emultempl/avrelf.em $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \
130 +  $(srcdir)/emultempl/avrelf.em $(ELF_DEPS) $(srcdir)/scripttempl/avrtiny10.sc \
131    ${GEN_DEPENDS}
132         ${GENSCRIPTS} avrtiny10 "$(tdir_avr2)"
133  ecoff_i860.c: $(srcdir)/emulparams/coff_i860.sh \
134 diff -rupN ld/scripttempl/avrtiny10.sc ld/scripttempl/avrtiny10.sc
135 --- ld/scripttempl/avrtiny10.sc 1969-12-31 18:00:00.000000000 -0600
136 +++ ld/scripttempl/avrtiny10.sc 2011-05-10 13:35:37.000000000 -0500
137 @@ -0,0 +1,240 @@
138 +cat <<EOF
139 +OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
140 +OUTPUT_ARCH(${ARCH})
141 +
142 +MEMORY
143 +{
144 +  text   (rx)   : ORIGIN = $TEXT_ORIGIN, LENGTH = $TEXT_LENGTH
145 +  data   (rw!x) : ORIGIN = $DATA_ORIGIN, LENGTH = $DATA_LENGTH
146 +  lock      (rw!x) : ORIGIN = 0x3F00, LENGTH = 2
147 +  signature (rw!x) : ORIGIN = 0x3FC0, LENGTH = 4
148 +/* REVISIT: fuse(rw!x) : */
149 +}
150 +
151 +SECTIONS
152 +{
153 +  /* Read-only sections, merged into text segment: */
154 +  ${TEXT_DYNAMIC+${DYNAMIC}}
155 +  .hash        ${RELOCATING-0} : { *(.hash)            }
156 +  .dynsym      ${RELOCATING-0} : { *(.dynsym)          }
157 +  .dynstr      ${RELOCATING-0} : { *(.dynstr)          }
158 +  .gnu.version ${RELOCATING-0} : { *(.gnu.version)     }
159 +  .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
160 +  .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
161 +
162 +  .rel.init    ${RELOCATING-0} : { *(.rel.init)                }
163 +  .rela.init   ${RELOCATING-0} : { *(.rela.init)       }
164 +  .rel.text    ${RELOCATING-0} :
165 +    {
166 +      *(.rel.text)
167 +      ${RELOCATING+*(.rel.text.*)}
168 +      ${RELOCATING+*(.rel.gnu.linkonce.t*)}
169 +    }
170 +  .rela.text   ${RELOCATING-0} :
171 +    {
172 +      *(.rela.text)
173 +      ${RELOCATING+*(.rela.text.*)}
174 +      ${RELOCATING+*(.rela.gnu.linkonce.t*)}
175 +    }
176 +  .rel.fini    ${RELOCATING-0} : { *(.rel.fini)                }
177 +  .rela.fini   ${RELOCATING-0} : { *(.rela.fini)       }
178 +  .rel.rodata  ${RELOCATING-0} :
179 +    {
180 +      *(.rel.rodata)
181 +      ${RELOCATING+*(.rel.rodata.*)}
182 +      ${RELOCATING+*(.rel.gnu.linkonce.r*)}
183 +    }
184 +  .rela.rodata ${RELOCATING-0} :
185 +    {
186 +      *(.rela.rodata)
187 +      ${RELOCATING+*(.rela.rodata.*)}
188 +      ${RELOCATING+*(.rela.gnu.linkonce.r*)}
189 +    }
190 +  .rel.data    ${RELOCATING-0} :
191 +    {
192 +      *(.rel.data)
193 +      ${RELOCATING+*(.rel.data.*)}
194 +      ${RELOCATING+*(.rel.gnu.linkonce.d*)}
195 +    }
196 +  .rela.data   ${RELOCATING-0} :
197 +    {
198 +      *(.rela.data)
199 +      ${RELOCATING+*(.rela.data.*)}
200 +      ${RELOCATING+*(.rela.gnu.linkonce.d*)}
201 +    }
202 +  .rel.ctors   ${RELOCATING-0} : { *(.rel.ctors)       }
203 +  .rela.ctors  ${RELOCATING-0} : { *(.rela.ctors)      }
204 +  .rel.dtors   ${RELOCATING-0} : { *(.rel.dtors)       }
205 +  .rela.dtors  ${RELOCATING-0} : { *(.rela.dtors)      }
206 +  .rel.got     ${RELOCATING-0} : { *(.rel.got)         }
207 +  .rela.got    ${RELOCATING-0} : { *(.rela.got)                }
208 +  .rel.bss     ${RELOCATING-0} : { *(.rel.bss)         }
209 +  .rela.bss    ${RELOCATING-0} : { *(.rela.bss)                }
210 +  .rel.plt     ${RELOCATING-0} : { *(.rel.plt)         }
211 +  .rela.plt    ${RELOCATING-0} : { *(.rela.plt)                }
212 +
213 +  /* Internal text space or external memory.  */
214 +  .text ${RELOCATING-0} : ${RELOCATING+ AT (0x0)}
215 +  {
216 +    *(.vectors)
217 +    KEEP(*(.vectors))
218 +
219 +    /* For data that needs to reside in the lower 64k of progmem.  */
220 +    *(.progmem.gcc*)
221 +    *(.progmem*)
222 +    ${RELOCATING+. = ALIGN(2);}
223 +
224 +    ${CONSTRUCTING+ __trampolines_start = . ; }
225 +    /* The jump trampolines for the 16-bit limited relocs will reside here.  */
226 +    *(.trampolines)
227 +    *(.trampolines*)
228 +    ${CONSTRUCTING+ __trampolines_end = . ; }
229 +
230 +    /* For future tablejump instruction arrays for 3 byte pc devices.
231 +       We don't relax jump/call instructions within these sections.  */
232 +    *(.jumptables) 
233 +    *(.jumptables*) 
234 +
235 +    /* For code that needs to reside in the lower 128k progmem.  */
236 +    *(.lowtext)
237 +    *(.lowtext*)
238 +
239 +    ${CONSTRUCTING+ __ctors_start = . ; }
240 +    ${CONSTRUCTING+ *(.ctors) }
241 +    ${CONSTRUCTING+ __ctors_end = . ; }
242 +    ${CONSTRUCTING+ __dtors_start = . ; }
243 +    ${CONSTRUCTING+ *(.dtors) }
244 +    ${CONSTRUCTING+ __dtors_end = . ; }
245 +    KEEP(SORT(*)(.ctors))
246 +    KEEP(SORT(*)(.dtors))
247 +
248 +    /* From this point on, we don't bother about wether the insns are
249 +       below or above the 16 bits boundary.  */
250 +    *(.init0)  /* Start here after reset.  */
251 +    KEEP (*(.init0))
252 +    *(.init1)
253 +    KEEP (*(.init1))
254 +    *(.init2)  /* Clear __zero_reg__, set up stack pointer.  */
255 +    KEEP (*(.init2))
256 +    *(.init3)
257 +    KEEP (*(.init3))
258 +    *(.init4)  /* Initialize data and BSS.  */
259 +    KEEP (*(.init4))
260 +    *(.init5)
261 +    KEEP (*(.init5))
262 +    *(.init6)  /* C++ constructors.  */
263 +    KEEP (*(.init6))
264 +    *(.init7)
265 +    KEEP (*(.init7))
266 +    *(.init8)
267 +    KEEP (*(.init8))
268 +    *(.init9)  /* Call main().  */
269 +    KEEP (*(.init9))
270 +    *(.text)
271 +    ${RELOCATING+. = ALIGN(2);}
272 +    *(.text.*)
273 +    ${RELOCATING+. = ALIGN(2);}
274 +    *(.fini9)  /* _exit() starts here.  */
275 +    KEEP (*(.fini9))
276 +    *(.fini8)
277 +    KEEP (*(.fini8))
278 +    *(.fini7)
279 +    KEEP (*(.fini7))
280 +    *(.fini6)  /* C++ destructors.  */
281 +    KEEP (*(.fini6))
282 +    *(.fini5)
283 +    KEEP (*(.fini5))
284 +    *(.fini4)
285 +    KEEP (*(.fini4))
286 +    *(.fini3)
287 +    KEEP (*(.fini3))
288 +    *(.fini2)
289 +    KEEP (*(.fini2))
290 +    *(.fini1)
291 +    KEEP (*(.fini1))
292 +    *(.fini0)  /* Infinite loop after program termination.  */
293 +    KEEP (*(.fini0))
294 +    ${RELOCATING+ _etext = . ; }
295 +  } ${RELOCATING+ > text}
296 +
297 +  .data        ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
298 +  {
299 +    ${RELOCATING+ PROVIDE (__data_start = .) ; }
300 +    *(.data)
301 +    *(.data*)
302 +    *(.rodata)  /* We need to include .rodata here if gcc is used */
303 +    *(.rodata*) /* with -fdata-sections.  */
304 +    *(.gnu.linkonce.d*)
305 +    ${RELOCATING+. = ALIGN(2);}
306 +    ${RELOCATING+ _edata = . ; }
307 +    ${RELOCATING+ PROVIDE (__data_end = .) ; }
308 +  } ${RELOCATING+ > data}
309 +
310 +  .bss ${RELOCATING-0} :${RELOCATING+ AT (ADDR (.bss))}
311 +  {
312 +    ${RELOCATING+ PROVIDE (__bss_start = .) ; }
313 +    *(.bss)
314 +    *(.bss*)
315 +    *(COMMON)
316 +    ${RELOCATING+ PROVIDE (__bss_end = .) ; }
317 +  } ${RELOCATING+ > data}
318 +
319 +  ${RELOCATING+ __data_load_start = LOADADDR(.data); }
320 +  ${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); }
321 +
322 +  /* Global data not cleared after reset.  */
323 +  .noinit ${RELOCATING-0}:
324 +  {
325 +    ${RELOCATING+ PROVIDE (__noinit_start = .) ; }
326 +    *(.noinit*)
327 +    ${RELOCATING+ PROVIDE (__noinit_end = .) ; }
328 +    ${RELOCATING+ _end = . ;  }
329 +    ${RELOCATING+ PROVIDE (__heap_start = .) ; }
330 +  } ${RELOCATING+ > data}
331 +
332 +  .lock ${RELOCATING-0}:
333 +  {
334 +    KEEP(*(.lock*))
335 +  } ${RELOCATING+ > lock}
336 +
337 +  .signature ${RELOCATING-0}:
338 +  {
339 +    KEEP(*(.signature*))
340 +  } ${RELOCATING+ > signature}
341 +
342 +  /* Stabs debugging sections.  */
343 +  .stab 0 : { *(.stab) }
344 +  .stabstr 0 : { *(.stabstr) }
345 +  .stab.excl 0 : { *(.stab.excl) }
346 +  .stab.exclstr 0 : { *(.stab.exclstr) }
347 +  .stab.index 0 : { *(.stab.index) }
348 +  .stab.indexstr 0 : { *(.stab.indexstr) }
349 +  .comment 0 : { *(.comment) }
350
351 +  /* DWARF debug sections.
352 +     Symbols in the DWARF debugging sections are relative to the beginning
353 +     of the section so we begin them at 0.  */
354 +
355 +  /* DWARF 1 */
356 +  .debug          0 : { *(.debug) }
357 +  .line           0 : { *(.line) }
358 +
359 +  /* GNU DWARF 1 extensions */
360 +  .debug_srcinfo  0 : { *(.debug_srcinfo) }
361 +  .debug_sfnames  0 : { *(.debug_sfnames) }
362 +
363 +  /* DWARF 1.1 and DWARF 2 */
364 +  .debug_aranges  0 : { *(.debug_aranges) }
365 +  .debug_pubnames 0 : { *(.debug_pubnames) }
366 +
367 +  /* DWARF 2 */
368 +  .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
369 +  .debug_abbrev   0 : { *(.debug_abbrev) }
370 +  .debug_line     0 : { *(.debug_line) }
371 +  .debug_frame    0 : { *(.debug_frame) }
372 +  .debug_str      0 : { *(.debug_str) }
373 +  .debug_loc      0 : { *(.debug_loc) }
374 +  .debug_macinfo  0 : { *(.debug_macinfo) }
375 +}
376 +EOF
377 +
This page took 0.093441 seconds and 3 git commands to generate.