1 diff -urN binutils-2.14.90.0.7.orig/bfd/ChangeLog binutils-2.14.90.0.7/bfd/ChangeLog
2 --- binutils-2.14.90.0.7.orig/bfd/ChangeLog 2003-10-29 10:37:47.000000000 -0700
3 +++ binutils-2.14.90.0.7/bfd/ChangeLog 2004-04-20 01:26:12.000000000 -0600
5 +2003-10-29 Daniel Jacobowitz <drow@mvista.com>
7 + * elf32-arm.h (elf32_arm_final_link_relocate): Move check for
10 +2003-10-29 Philip Blundell <philb@gnu.org>
12 + * elf32-arm.h (elf32_arm_plt0_entry, elf32_arm_plt_entry): New
14 + (PLT_HEADER_SIZE): New.
15 + (struct elf32_arm_pcrel_relocs_copied): Rename to ...
16 + (struct elf32_arm_relocs_copied): ... this. Count both
17 + pcrel and non-pcrel relocs. All uses updated.
18 + (struct elf32_arm_link_hash_table): Add pointers to dynamic linker
19 + sections and symbol/section mapping cache.
20 + (create_got_section): New.
21 + (elf32_arm_create_dynamic_sections): New.
22 + (elf_backend_create_dynamic_sections): Use it.
23 + (elf32_arm_final_link_relocate): Support garbage collection of relocs.
24 + (elf32_arm_check_relocs): Likewise.
25 + (elf32_arm_adjust_dynamic_symbol): Likewise.
26 + (elf32_arm_copy_indirect_symbol): New.
27 + (elf32_arm_link_hash_table_create): Initialise new fields.
28 + (elf32_arm_gc_sweep_hook): Implement.
29 + (elf32_arm_discard_copies): Delete.
30 + (elf32_arm_finish_dynamic_symbol): Use new PLT code.
31 + (elf32_arm_finish_dynamic_sections): Likewise.
32 + (elf_backend_can_refcount): Define.
33 + (elf_backend_copy_indirect_symbol): Likewise.
34 + (elf_backend_plt_header_size): Set to PLT_HEADER_SIZE.
36 2003-10-29 Alan Modra <amodra@bigpond.net.au>
38 * elf64-ppc.c (elf_backend_grok_prstatus): Define.
39 diff -urN binutils-2.14.90.0.7.orig/bfd/elf-bfd.h binutils-2.14.90.0.7/bfd/elf-bfd.h
40 --- binutils-2.14.90.0.7.orig/bfd/elf-bfd.h 2003-10-29 10:37:47.000000000 -0700
41 +++ binutils-2.14.90.0.7/bfd/elf-bfd.h 2004-04-20 01:26:12.000000000 -0600
43 extern enum elf_reloc_type_class _bfd_elf_reloc_type_class
44 (const Elf_Internal_Rela *);
45 extern bfd_vma _bfd_elf_rela_local_sym
46 - (bfd *, Elf_Internal_Sym *, asection *, Elf_Internal_Rela *);
47 + (bfd *, Elf_Internal_Sym *, asection **, Elf_Internal_Rela *);
48 extern bfd_vma _bfd_elf_rel_local_sym
49 (bfd *, Elf_Internal_Sym *, asection **, bfd_vma);
50 extern bfd_vma _bfd_elf_section_offset
51 diff -urN binutils-2.14.90.0.7.orig/bfd/elf-hppa.h binutils-2.14.90.0.7/bfd/elf-hppa.h
52 --- binutils-2.14.90.0.7.orig/bfd/elf-hppa.h 2003-08-21 09:28:47.000000000 -0600
53 +++ binutils-2.14.90.0.7/bfd/elf-hppa.h 2004-04-20 01:26:12.000000000 -0600
54 @@ -1346,11 +1346,11 @@
55 /* This is a local symbol. */
56 sym = local_syms + r_symndx;
57 sym_sec = local_sections[r_symndx];
58 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel);
59 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sym_sec, rel);
61 /* If this symbol has an entry in the PA64 dynamic hash
62 table, then get it. */
63 - dyn_name = get_dyn_name (input_section, h, rel,
64 + dyn_name = get_dyn_name (input_bfd, h, rel,
65 &dynh_buf, &dynh_buflen);
66 dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
67 dyn_name, FALSE, FALSE);
70 /* If this symbol has an entry in the PA64 dynamic hash
71 table, then get it. */
72 - dyn_name = get_dyn_name (input_section, h, rel,
73 + dyn_name = get_dyn_name (input_bfd, h, rel,
74 &dynh_buf, &dynh_buflen);
75 dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
76 dyn_name, FALSE, FALSE);
79 /* If this symbol has an entry in the PA64 dynamic hash
80 table, then get it. */
81 - dyn_name = get_dyn_name (input_section, h, rel,
82 + dyn_name = get_dyn_name (input_bfd, h, rel,
83 &dynh_buf, &dynh_buflen);
84 dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
85 dyn_name, FALSE, FALSE);
88 else if (h->root.type == bfd_link_hash_undefweak)
90 - dyn_name = get_dyn_name (input_section, h, rel,
91 + dyn_name = get_dyn_name (input_bfd, h, rel,
92 &dynh_buf, &dynh_buflen);
93 dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
94 dyn_name, FALSE, FALSE);
95 diff -urN binutils-2.14.90.0.7.orig/bfd/elf-m10200.c binutils-2.14.90.0.7/bfd/elf-m10200.c
96 --- binutils-2.14.90.0.7.orig/bfd/elf-m10200.c 2003-07-23 09:08:08.000000000 -0600
97 +++ binutils-2.14.90.0.7/bfd/elf-m10200.c 2004-04-20 01:26:12.000000000 -0600
100 sym = local_syms + r_symndx;
101 sec = local_sections[r_symndx];
102 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
103 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
107 diff -urN binutils-2.14.90.0.7.orig/bfd/elf-m10300.c binutils-2.14.90.0.7/bfd/elf-m10300.c
108 --- binutils-2.14.90.0.7.orig/bfd/elf-m10300.c 2003-08-21 09:28:47.000000000 -0600
109 +++ binutils-2.14.90.0.7/bfd/elf-m10300.c 2004-04-20 01:26:12.000000000 -0600
110 @@ -1574,7 +1574,7 @@
112 sym = local_syms + r_symndx;
113 sec = local_sections[r_symndx];
114 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
115 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
119 diff -urN binutils-2.14.90.0.7.orig/bfd/elf.c binutils-2.14.90.0.7/bfd/elf.c
120 --- binutils-2.14.90.0.7.orig/bfd/elf.c 2003-10-29 10:37:47.000000000 -0700
121 +++ binutils-2.14.90.0.7/bfd/elf.c 2004-04-20 01:26:12.000000000 -0600
122 @@ -7367,9 +7367,10 @@
124 _bfd_elf_rela_local_sym (bfd *abfd,
125 Elf_Internal_Sym *sym,
128 Elf_Internal_Rela *rel)
130 + asection *sec = *psec;
133 relocation = (sec->output_section->vma
134 @@ -7379,16 +7380,14 @@
135 && ELF_ST_TYPE (sym->st_info) == STT_SECTION
136 && sec->sec_info_type == ELF_INFO_TYPE_MERGE)
142 - _bfd_merged_section_offset (abfd, &msec,
143 + _bfd_merged_section_offset (abfd, psec,
144 elf_section_data (sec)->sec_info,
145 sym->st_value + rel->r_addend,
148 - rel->r_addend += msec->output_section->vma + msec->output_offset;
151 + rel->r_addend -= relocation;
152 + rel->r_addend += sec->output_section->vma + sec->output_offset;
156 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-arm.h binutils-2.14.90.0.7/bfd/elf32-arm.h
157 --- binutils-2.14.90.0.7.orig/bfd/elf32-arm.h 2003-10-29 10:37:47.000000000 -0700
158 +++ binutils-2.14.90.0.7/bfd/elf32-arm.h 2004-04-20 01:26:12.000000000 -0600
160 static void arm_add_to_rel
161 PARAMS ((bfd *, bfd_byte *, reloc_howto_type *, bfd_signed_vma));
163 +static bfd_boolean allocate_dynrelocs
164 + PARAMS ((struct elf_link_hash_entry *h, PTR inf));
165 +static bfd_boolean create_got_section
166 + PARAMS ((bfd * dynobj, struct bfd_link_info * info));
167 +static bfd_boolean elf32_arm_create_dynamic_sections
168 + PARAMS ((bfd * dynobj, struct bfd_link_info * info));
169 static enum elf_reloc_type_class elf32_arm_reloc_type_class
170 PARAMS ((const Elf_Internal_Rela *));
171 static bfd_boolean elf32_arm_object_p
174 #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
176 +#ifdef FOUR_WORD_PLT
178 +/* The size in bytes of the special first entry in the procedure
180 +#define PLT_HEADER_SIZE 16
182 /* The size in bytes of an entry in the procedure linkage table. */
183 #define PLT_ENTRY_SIZE 16
185 @@ -126,23 +138,56 @@
186 this. It is set up so that any shared library function that is
187 called before the relocation has been set up calls the dynamic
189 -static const bfd_vma elf32_arm_plt0_entry [PLT_ENTRY_SIZE / 4] =
190 +static const bfd_vma elf32_arm_plt0_entry [PLT_HEADER_SIZE / 4] =
192 - 0xe52de004, /* str lr, [sp, #-4]! */
193 - 0xe59fe010, /* ldr lr, [pc, #16] */
194 - 0xe08fe00e, /* add lr, pc, lr */
195 - 0xe5bef008 /* ldr pc, [lr, #8]! */
196 + 0xe52de004, /* str lr, [sp, #-4]! */
197 + 0xe59fe010, /* ldr lr, [pc, #16] */
198 + 0xe08fe00e, /* add lr, pc, lr */
199 + 0xe5bef008, /* ldr pc, [lr, #8]! */
202 /* Subsequent entries in a procedure linkage table look like
204 static const bfd_vma elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] =
206 - 0xe59fc004, /* ldr ip, [pc, #4] */
207 - 0xe08fc00c, /* add ip, pc, ip */
208 - 0xe59cf000, /* ldr pc, [ip] */
209 - 0x00000000 /* offset to symbol in got */
212 + 0xe28fc600, /* add ip, pc, #NN */
213 + 0xe28cca00, /* add ip, ip, #NN */
214 + 0xe5bcf000, /* ldr pc, [ip, #NN]! */
215 + 0x00000000, /* unused */
220 +/* The size in bytes of the special first entry in the procedure
222 +#define PLT_HEADER_SIZE 20
224 +/* The size in bytes of an entry in the procedure linkage table. */
225 +#define PLT_ENTRY_SIZE 12
227 +/* The first entry in a procedure linkage table looks like
228 + this. It is set up so that any shared library function that is
229 + called before the relocation has been set up calls the dynamic
231 +static const bfd_vma elf32_arm_plt0_entry [PLT_HEADER_SIZE / 4] =
233 + 0xe52de004, /* str lr, [sp, #-4]! */
234 + 0xe59fe004, /* ldr lr, [pc, #4] */
235 + 0xe08fe00e, /* add lr, pc, lr */
236 + 0xe5bef008, /* ldr pc, [lr, #8]! */
237 + 0x00000000, /* &GOT[0] - . */
240 +/* Subsequent entries in a procedure linkage table look like
242 +static const bfd_vma elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] =
244 + 0xe28fc600, /* add ip, pc, #0xNN00000 */
245 + 0xe28cca00, /* add ip, ip, #0xNN000 */
246 + 0xe5bcf000, /* ldr pc, [ip, #0xNNN]! */
251 /* The ARM linker needs to keep track of the number of relocs that it
252 decides to copy in check_relocs for each symbol. This is so that
253 @@ -152,14 +197,16 @@
255 /* This structure keeps track of the number of PC relative relocs we
256 have copied for a given symbol. */
257 -struct elf32_arm_pcrel_relocs_copied
258 +struct elf32_arm_relocs_copied
261 - struct elf32_arm_pcrel_relocs_copied * next;
262 + struct elf32_arm_relocs_copied * next;
263 /* A section in dynobj. */
265 /* Number of relocs copied in this section. */
267 + /* Number of relocs copied in this section. */
268 + bfd_size_type pc_count;
271 /* Arm ELF linker hash entry. */
273 struct elf_link_hash_entry root;
275 /* Number of PC relative relocs copied for this symbol. */
276 - struct elf32_arm_pcrel_relocs_copied * pcrel_relocs_copied;
277 + struct elf32_arm_relocs_copied * relocs_copied;
280 -/* Declare this now that the above structures are defined. */
281 -static bfd_boolean elf32_arm_discard_copies
282 - PARAMS ((struct elf32_arm_link_hash_entry *, PTR));
284 /* Traverse an arm ELF linker hash table. */
285 #define elf32_arm_link_hash_traverse(table, func, info) \
286 (elf_link_hash_traverse \
288 /* A boolean indicating whether knowledge of the ARM's pipeline
289 length should be applied by the linker. */
290 int no_pipeline_knowledge;
292 + /* Short-cuts to get to dynamic linker sections. */
301 + /* Small local sym to section mapping cache. */
302 + struct sym_sec_cache sym_sec;
305 /* Create an entry in an ARM ELF linker hash table. */
306 @@ -231,11 +286,121 @@
307 _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
309 if (ret != (struct elf32_arm_link_hash_entry *) NULL)
310 - ret->pcrel_relocs_copied = NULL;
311 + ret->relocs_copied = NULL;
313 return (struct bfd_hash_entry *) ret;
316 +/* Create .got, .gotplt, and .rel.got sections in DYNOBJ, and set up
317 + shortcuts to them in our hash table. */
320 +create_got_section (dynobj, info)
322 + struct bfd_link_info *info;
324 + struct elf32_arm_link_hash_table *htab;
326 + if (! _bfd_elf_create_got_section (dynobj, info))
329 + htab = elf32_arm_hash_table (info);
330 + htab->sgot = bfd_get_section_by_name (dynobj, ".got");
331 + htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
332 + if (!htab->sgot || !htab->sgotplt)
335 + htab->srelgot = bfd_make_section (dynobj, ".rel.got");
336 + if (htab->srelgot == NULL
337 + || ! bfd_set_section_flags (dynobj, htab->srelgot,
338 + (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
339 + | SEC_IN_MEMORY | SEC_LINKER_CREATED
341 + || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2))
346 +/* Create .plt, .rel.plt, .got, .got.plt, .rel.got, .dynbss, and
347 + .rel.bss sections in DYNOBJ, and set up shortcuts to them in our
351 +elf32_arm_create_dynamic_sections (dynobj, info)
353 + struct bfd_link_info *info;
355 + struct elf32_arm_link_hash_table *htab;
357 + htab = elf32_arm_hash_table (info);
358 + if (!htab->sgot && !create_got_section (dynobj, info))
361 + if (!_bfd_elf_create_dynamic_sections (dynobj, info))
364 + htab->splt = bfd_get_section_by_name (dynobj, ".plt");
365 + htab->srelplt = bfd_get_section_by_name (dynobj, ".rel.plt");
366 + htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss");
368 + htab->srelbss = bfd_get_section_by_name (dynobj, ".rel.bss");
370 + if (!htab->splt || !htab->srelplt || !htab->sdynbss
371 + || (!info->shared && !htab->srelbss))
377 +/* Copy the extra info we tack onto an elf_link_hash_entry. */
380 +elf32_arm_copy_indirect_symbol (const struct elf_backend_data *bed,
381 + struct elf_link_hash_entry *dir,
382 + struct elf_link_hash_entry *ind)
384 + struct elf32_arm_link_hash_entry *edir, *eind;
386 + edir = (struct elf32_arm_link_hash_entry *) dir;
387 + eind = (struct elf32_arm_link_hash_entry *) ind;
389 + if (eind->relocs_copied != NULL)
391 + if (edir->relocs_copied != NULL)
393 + struct elf32_arm_relocs_copied **pp;
394 + struct elf32_arm_relocs_copied *p;
396 + if (ind->root.type == bfd_link_hash_indirect)
399 + /* Add reloc counts against the weak sym to the strong sym
400 + list. Merge any entries against the same section. */
401 + for (pp = &eind->relocs_copied; (p = *pp) != NULL; )
403 + struct elf32_arm_relocs_copied *q;
405 + for (q = edir->relocs_copied; q != NULL; q = q->next)
406 + if (q->section == p->section)
408 + q->pc_count += p->pc_count;
409 + q->count += p->count;
416 + *pp = edir->relocs_copied;
419 + edir->relocs_copied = eind->relocs_copied;
420 + eind->relocs_copied = NULL;
423 + _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
426 /* Create an ARM elf linker hash table. */
428 static struct bfd_link_hash_table *
429 @@ -256,10 +421,18 @@
434 + ret->sgotplt = NULL;
435 + ret->srelgot = NULL;
437 + ret->srelplt = NULL;
438 + ret->sdynbss = NULL;
439 + ret->srelbss = NULL;
440 ret->thumb_glue_size = 0;
441 ret->arm_glue_size = 0;
442 ret->bfd_of_glue_owner = NULL;
443 ret->no_pipeline_knowledge = 0;
444 + ret->sym_sec.abfd = NULL;
446 return &ret->root.root;
448 @@ -1134,16 +1307,21 @@
452 + /* r_symndx will be zero only for relocs against symbols
453 + from removed linkonce sections, or sections discarded by
454 + a linker script. */
456 + return bfd_reloc_ok;
458 /* When generating a shared object, these relocations are copied
459 into the output file to be resolved at run time. */
462 - && (r_type != R_ARM_PC24
464 - && h->dynindx != -1
465 - && (! info->symbolic
466 - || (h->elf_link_hash_flags
467 - & ELF_LINK_HASH_DEF_REGULAR) == 0))))
469 + && (input_section->flags & SEC_ALLOC)
471 + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
472 + || h->root.type != bfd_link_hash_undefweak)
473 + && (r_type != R_ARM_PC24
474 + || !SYMBOL_CALLS_LOCAL (info, h))))
476 Elf_Internal_Rela outrel;
478 @@ -1184,30 +1362,19 @@
481 memset (&outrel, 0, sizeof outrel);
482 - else if (r_type == R_ARM_PC24)
484 - BFD_ASSERT (h != NULL && h->dynindx != -1);
485 - if ((input_section->flags & SEC_ALLOC) == 0)
487 - outrel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_PC24);
490 + && h->dynindx != -1
491 + && (r_type == R_ARM_PC24
494 + || (h->elf_link_hash_flags
495 + & ELF_LINK_HASH_DEF_REGULAR) == 0))
496 + outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
500 - || ((info->symbolic || h->dynindx == -1)
501 - && (h->elf_link_hash_flags
502 - & ELF_LINK_HASH_DEF_REGULAR) != 0))
505 - outrel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
509 - BFD_ASSERT (h->dynindx != -1);
510 - if ((input_section->flags & SEC_ALLOC) == 0)
512 - outrel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_ABS32);
514 + /* This symbol is local, or marked to become local. */
516 + outrel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
519 loc = sreloc->contents;
520 @@ -1617,16 +1784,17 @@
524 - bfd_boolean dyn = elf_hash_table (info)->dynamic_sections_created;
528 BFD_ASSERT (off != (bfd_vma) -1);
529 + dyn = globals->root.dynamic_sections_created;
531 - if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
532 + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
534 - && (info->symbolic || h->dynindx == -1
535 - || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
536 - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
537 + && SYMBOL_REFERENCES_LOCAL (info, h))
538 + || (ELF_ST_VISIBILITY (h->other)
539 + && h->root.type == bfd_link_hash_undefweak))
541 /* This is actually a static link, or it is a -Bsymbolic link
542 and the symbol is defined locally. We must initialize this
543 @@ -1712,7 +1880,8 @@
544 contents, rel->r_offset, value,
547 - if (h->plt.offset == (bfd_vma) -1)
548 + if (h->plt.offset == (bfd_vma) -1
549 + || globals->splt == NULL)
550 /* We didn't make a PLT entry for this symbol. This
551 happens when statically linking PIC code, or when
553 @@ -1958,7 +2127,7 @@
554 bfd_put_32 (input_bfd, value, contents + rel->r_offset);
557 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
558 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
562 @@ -1983,9 +2152,10 @@
566 - (!info->symbolic && h->dynindx != -1)
567 + (!info->symbolic && h->dynindx != -1)
568 || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
570 + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
571 && ((input_section->flags & SEC_ALLOC) != 0
572 /* DWARF will emit R_ARM_ABS32 relocations in its
573 sections against symbols defined externally
574 @@ -2603,7 +2773,82 @@
575 asection *sec ATTRIBUTE_UNUSED;
576 const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
578 - /* We don't support garbage collection of GOT and PLT relocs yet. */
579 + Elf_Internal_Shdr *symtab_hdr;
580 + struct elf_link_hash_entry **sym_hashes;
581 + bfd_signed_vma *local_got_refcounts;
582 + const Elf_Internal_Rela *rel, *relend;
583 + unsigned long r_symndx;
584 + struct elf_link_hash_entry *h;
586 + elf_section_data (sec)->local_dynrel = NULL;
588 + symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
589 + sym_hashes = elf_sym_hashes (abfd);
590 + local_got_refcounts = elf_local_got_refcounts (abfd);
592 + relend = relocs + sec->reloc_count;
593 + for (rel = relocs; rel < relend; rel++)
594 + switch (ELF32_R_TYPE (rel->r_info))
597 + r_symndx = ELF32_R_SYM (rel->r_info);
598 + if (r_symndx >= symtab_hdr->sh_info)
600 + h = sym_hashes[r_symndx - symtab_hdr->sh_info];
601 + if (h->got.refcount > 0)
602 + h->got.refcount -= 1;
604 + else if (local_got_refcounts != NULL)
606 + if (local_got_refcounts[r_symndx] > 0)
607 + local_got_refcounts[r_symndx] -= 1;
614 + r_symndx = ELF32_R_SYM (rel->r_info);
615 + if (r_symndx >= symtab_hdr->sh_info)
617 + struct elf32_arm_link_hash_entry *eh;
618 + struct elf32_arm_relocs_copied **pp;
619 + struct elf32_arm_relocs_copied *p;
621 + h = sym_hashes[r_symndx - symtab_hdr->sh_info];
623 + if (!info->shared && h->plt.refcount > 0)
624 + h->plt.refcount -= 1;
626 + eh = (struct elf32_arm_link_hash_entry *) h;
628 + for (pp = &eh->relocs_copied; (p = *pp) != NULL; pp = &p->next)
629 + if (p->section == sec)
631 + if (ELF32_R_TYPE (rel->r_info) == R_ARM_PC24)
642 + r_symndx = ELF32_R_SYM (rel->r_info);
643 + if (r_symndx >= symtab_hdr->sh_info)
645 + h = sym_hashes[r_symndx - symtab_hdr->sh_info];
646 + if (h->plt.refcount > 0)
647 + h->plt.refcount -= 1;
658 @@ -2622,13 +2867,15 @@
659 const Elf_Internal_Rela *rel;
660 const Elf_Internal_Rela *rel_end;
662 - asection *sgot, *srelgot, *sreloc;
664 bfd_vma *local_got_offsets;
665 + struct elf32_arm_link_hash_table *htab;
667 if (info->relocatable)
670 - sgot = srelgot = sreloc = NULL;
671 + htab = elf32_arm_hash_table (info);
674 dynobj = elf_hash_table (info)->dynobj;
675 local_got_offsets = elf_local_got_offsets (abfd);
676 @@ -2653,126 +2900,82 @@
678 h = sym_hashes[r_symndx - symtab_hdr->sh_info];
680 - /* Some relocs require a global offset table. */
681 - if (dynobj == NULL)
683 - switch (ELF32_R_TYPE (rel->r_info))
688 - elf_hash_table (info)->dynobj = dynobj = abfd;
689 - if (! _bfd_elf_create_got_section (dynobj, info))
698 switch (ELF32_R_TYPE (rel->r_info))
701 - /* This symbol requires a global offset table entry. */
704 - sgot = bfd_get_section_by_name (dynobj, ".got");
705 - BFD_ASSERT (sgot != NULL);
708 + /* This symbol requires a procedure linkage table entry. We
709 + actually build the entry in adjust_dynamic_symbol,
710 + because this might be a case of linking PIC code which is
711 + never referenced by a dynamic object, in which case we
712 + don't need to generate a procedure linkage table entry
715 - /* Get the got relocation section if necessary. */
716 - if (srelgot == NULL
717 - && (h != NULL || info->shared))
719 - srelgot = bfd_get_section_by_name (dynobj, ".rel.got");
720 + /* If this is a local symbol, we resolve it directly without
721 + creating a procedure linkage table entry. */
725 - /* If no got relocation section, make one and initialize. */
726 - if (srelgot == NULL)
728 - srelgot = bfd_make_section (dynobj, ".rel.got");
729 - if (srelgot == NULL
730 - || ! bfd_set_section_flags (dynobj, srelgot,
735 - | SEC_LINKER_CREATED
737 - || ! bfd_set_section_alignment (dynobj, srelgot, 2))
741 + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
746 + /* This symbol requires a global offset table entry. */
749 - if (h->got.offset != (bfd_vma) -1)
750 - /* We have already allocated space in the .got. */
753 - h->got.offset = sgot->_raw_size;
755 - /* Make sure this symbol is output as a dynamic symbol. */
756 - if (h->dynindx == -1)
757 - if (! bfd_elf32_link_record_dynamic_symbol (info, h))
760 - srelgot->_raw_size += sizeof (Elf32_External_Rel);
765 - /* This is a global offset table entry for a local
767 - if (local_got_offsets == NULL)
768 + bfd_signed_vma *local_got_refcounts;
770 + /* This is a global offset table entry for a local symbol. */
771 + local_got_refcounts = elf_local_got_refcounts (abfd);
772 + if (local_got_refcounts == NULL)
777 size = symtab_hdr->sh_info;
778 - size *= sizeof (bfd_vma);
779 - local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size);
780 - if (local_got_offsets == NULL)
781 + size *= (sizeof (bfd_signed_vma) + sizeof(char));
782 + local_got_refcounts = ((bfd_signed_vma *)
783 + bfd_zalloc (abfd, size));
784 + if (local_got_refcounts == NULL)
786 - elf_local_got_offsets (abfd) = local_got_offsets;
787 - for (i = 0; i < symtab_hdr->sh_info; i++)
788 - local_got_offsets[i] = (bfd_vma) -1;
789 + elf_local_got_refcounts (abfd) = local_got_refcounts;
792 - if (local_got_offsets[r_symndx] != (bfd_vma) -1)
793 - /* We have already allocated space in the .got. */
796 - local_got_offsets[r_symndx] = sgot->_raw_size;
799 - /* If we are generating a shared object, we need to
800 - output a R_ARM_RELATIVE reloc so that the dynamic
801 - linker can adjust this GOT entry. */
802 - srelgot->_raw_size += sizeof (Elf32_External_Rel);
803 + local_got_refcounts[r_symndx] += 1;
806 - sgot->_raw_size += 4;
810 - /* This symbol requires a procedure linkage table entry. We
811 - actually build the entry in adjust_dynamic_symbol,
812 - because this might be a case of linking PIC code which is
813 - never referenced by a dynamic object, in which case we
814 - don't need to generate a procedure linkage table entry
817 - /* If this is a local symbol, we resolve it directly without
818 - creating a procedure linkage table entry. */
822 - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
825 + if (htab->sgot == NULL)
827 + if (htab->root.dynobj == NULL)
828 + htab->root.dynobj = abfd;
829 + if (!create_got_section (htab->root.dynobj, info))
837 + if (h != NULL && !info->shared)
839 + /* If this reloc is in a read-only section, we might
840 + need a copy reloc. We can't check reliably at this
841 + stage whether the section is read-only, as input
842 + sections have not yet been mapped to output sections.
843 + Tentatively set the flag for now, and correct in
844 + adjust_dynamic_symbol. */
845 + h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
847 + /* We may need a .plt entry if the function this reloc
848 + refers to is in a shared lib. */
849 + h->plt.refcount += 1;
852 /* If we are creating a shared library, and this is a reloc
853 against a global symbol, or a non PC relative reloc
854 against a local symbol, then we need to copy the reloc
855 @@ -2784,14 +2987,17 @@
856 possible that DEF_REGULAR is not set now but will be set
857 later (it is never cleared). We account for that
858 possibility below by storing information in the
859 - pcrel_relocs_copied field of the hash table entry. */
860 + relocs_copied field of the hash table entry. */
862 - && (ELF32_R_TYPE (rel->r_info) != R_ARM_PC24
864 - && (! info->symbolic
865 - || (h->elf_link_hash_flags
866 - & ELF_LINK_HASH_DEF_REGULAR) == 0))))
867 + && (sec->flags & SEC_ALLOC) != 0
868 + && (ELF32_R_TYPE (rel->r_info) != R_ARM_PC24
870 + && (! info->symbolic
871 + || (h->elf_link_hash_flags
872 + & ELF_LINK_HASH_DEF_REGULAR) == 0))))
874 + struct elf32_arm_relocs_copied *p, **head;
876 /* When creating a shared object, we must copy these
877 reloc types into the output file. We create a reloc
878 section in dynobj and make room for this reloc. */
879 @@ -2825,45 +3031,49 @@
880 || ! bfd_set_section_alignment (dynobj, sreloc, 2))
883 - if (sec->flags & SEC_READONLY)
884 - info->flags |= DF_TEXTREL;
886 + elf_section_data (sec)->sreloc = sreloc;
889 - sreloc->_raw_size += sizeof (Elf32_External_Rel);
890 - /* If we are linking with -Bsymbolic, and this is a
891 - global symbol, we count the number of PC relative
892 - relocations we have entered for this symbol, so that
893 - we can discard them again if the symbol is later
894 - defined by a regular object. Note that this function
895 - is only called if we are using an elf_i386 linker
896 - hash table, which means that h is really a pointer to
897 - an elf_i386_link_hash_entry. */
898 - if (h != NULL && info->symbolic
899 - && ELF32_R_TYPE (rel->r_info) == R_ARM_PC24)
900 + /* If this is a global symbol, we count the number of
901 + relocations we need for this symbol. */
904 - struct elf32_arm_link_hash_entry * eh;
905 - struct elf32_arm_pcrel_relocs_copied * p;
907 - eh = (struct elf32_arm_link_hash_entry *) h;
909 - for (p = eh->pcrel_relocs_copied; p != NULL; p = p->next)
910 - if (p->section == sreloc)
913 + head = &((struct elf32_arm_link_hash_entry *) h)->relocs_copied;
917 + /* Track dynamic relocs needed for local syms too.
918 + We really need local syms available to do this
919 + easily. Oh well. */
922 + s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
927 + head = ((struct elf32_arm_relocs_copied **)
928 + &elf_section_data (s)->local_dynrel);
932 + if (p == NULL || p->section != sec)
934 + bfd_size_type amt = sizeof *p;
935 + p = bfd_alloc (htab->root.dynobj, amt);
938 - p = ((struct elf32_arm_pcrel_relocs_copied *)
939 - bfd_alloc (dynobj, (bfd_size_type) sizeof * p));
942 - p->next = eh->pcrel_relocs_copied;
943 - eh->pcrel_relocs_copied = p;
944 - p->section = sreloc;
958 + if (ELF32_R_TYPE (rel->r_info) == R_ARM_PC24)
963 @@ -3003,71 +3213,29 @@
964 if (h->type == STT_FUNC
965 || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
967 - /* If we link a program (not a DSO), we'll get rid of unnecessary
968 - PLT entries; we point to the actual symbols -- even for pic
969 - relocs, because a program built with -fpic should have the same
970 - result as one built without -fpic, specifically considering weak
972 - FIXME: m68k and i386 differ here, for unclear reasons. */
974 - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0)
975 + if (h->plt.refcount <= 0
976 + || SYMBOL_CALLS_LOCAL (info, h)
977 + || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
978 + && h->root.type == bfd_link_hash_undefweak))
980 /* This case can occur if we saw a PLT32 reloc in an input
981 - file, but the symbol was not defined by a dynamic object.
982 - In such a case, we don't actually need to build a
983 - procedure linkage table, and we can just do a PC32 reloc
985 - BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
986 + file, but the symbol was never referred to by a dynamic
987 + object, or if all references were garbage collected. In
988 + such a case, we don't actually need to build a procedure
989 + linkage table, and we can just do a PC24 reloc instead. */
990 + h->plt.offset = (bfd_vma) -1;
991 h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
995 - /* Make sure this symbol is output as a dynamic symbol. */
996 - if (h->dynindx == -1)
998 - if (! bfd_elf32_link_record_dynamic_symbol (info, h))
1002 - s = bfd_get_section_by_name (dynobj, ".plt");
1003 - BFD_ASSERT (s != NULL);
1005 - /* If this is the first .plt entry, make room for the special
1007 - if (s->_raw_size == 0)
1008 - s->_raw_size += PLT_ENTRY_SIZE;
1010 - /* If this symbol is not defined in a regular file, and we are
1011 - not generating a shared library, then set the symbol to this
1012 - location in the .plt. This is required to make function
1013 - pointers compare as equal between the normal executable and
1014 - the shared library. */
1015 - if (! info->shared
1016 - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
1018 - h->root.u.def.section = s;
1019 - h->root.u.def.value = s->_raw_size;
1022 - h->plt.offset = s->_raw_size;
1024 - /* Make room for this entry. */
1025 - s->_raw_size += PLT_ENTRY_SIZE;
1027 - /* We also need to make an entry in the .got.plt section, which
1028 - will be placed in the .got section by the linker script. */
1029 - s = bfd_get_section_by_name (dynobj, ".got.plt");
1030 - BFD_ASSERT (s != NULL);
1031 - s->_raw_size += 4;
1033 - /* We also need to make an entry in the .rel.plt section. */
1035 - s = bfd_get_section_by_name (dynobj, ".rel.plt");
1036 - BFD_ASSERT (s != NULL);
1037 - s->_raw_size += sizeof (Elf32_External_Rel);
1042 + /* It's possible that we incorrectly decided a .plt reloc was
1043 + needed for an R_ARM_PC24 reloc to a non-function sym in
1044 + check_relocs. We can't decide accurately between function and
1045 + non-function syms in check-relocs; Objects loaded later in
1046 + the link may change h->type. So fix it now. */
1047 + h->plt.offset = (bfd_vma) -1;
1049 /* If this is a weak symbol, and there is a real definition, the
1050 processor independent code will have arranged for us to see the
1051 @@ -3142,6 +3310,198 @@
1055 +/* Allocate space in .plt, .got and associated reloc sections for
1056 + dynamic relocs. */
1059 +allocate_dynrelocs (h, inf)
1060 + struct elf_link_hash_entry *h;
1063 + struct bfd_link_info *info;
1064 + struct elf32_arm_link_hash_table *htab;
1065 + struct elf32_arm_link_hash_entry *eh;
1066 + struct elf32_arm_relocs_copied *p;
1068 + if (h->root.type == bfd_link_hash_indirect)
1071 + if (h->root.type == bfd_link_hash_warning)
1072 + /* When warning symbols are created, they **replace** the "real"
1073 + entry in the hash table, thus we never get to see the real
1074 + symbol in a hash traversal. So look at it now. */
1075 + h = (struct elf_link_hash_entry *) h->root.u.i.link;
1077 + info = (struct bfd_link_info *) inf;
1078 + htab = elf32_arm_hash_table (info);
1080 + if (htab->root.dynamic_sections_created
1081 + && h->plt.refcount > 0)
1083 + /* Make sure this symbol is output as a dynamic symbol.
1084 + Undefined weak syms won't yet be marked as dynamic. */
1085 + if (h->dynindx == -1
1086 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
1088 + if (! bfd_elf32_link_record_dynamic_symbol (info, h))
1093 + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
1095 + asection *s = htab->splt;
1097 + /* If this is the first .plt entry, make room for the special
1099 + if (s->_raw_size == 0)
1100 + s->_raw_size += PLT_HEADER_SIZE;
1102 + h->plt.offset = s->_raw_size;
1104 + /* If this symbol is not defined in a regular file, and we are
1105 + not generating a shared library, then set the symbol to this
1106 + location in the .plt. This is required to make function
1107 + pointers compare as equal between the normal executable and
1108 + the shared library. */
1109 + if (! info->shared
1110 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
1112 + h->root.u.def.section = s;
1113 + h->root.u.def.value = h->plt.offset;
1116 + /* Make room for this entry. */
1117 + s->_raw_size += PLT_ENTRY_SIZE;
1119 + /* We also need to make an entry in the .got.plt section, which
1120 + will be placed in the .got section by the linker script. */
1121 + htab->sgotplt->_raw_size += 4;
1123 + /* We also need to make an entry in the .rel.plt section. */
1124 + htab->srelplt->_raw_size += sizeof (Elf32_External_Rel);
1128 + h->plt.offset = (bfd_vma) -1;
1129 + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
1134 + h->plt.offset = (bfd_vma) -1;
1135 + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
1138 + if (h->got.refcount > 0)
1143 + /* Make sure this symbol is output as a dynamic symbol.
1144 + Undefined weak syms won't yet be marked as dynamic. */
1145 + if (h->dynindx == -1
1146 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
1148 + if (! bfd_elf32_link_record_dynamic_symbol (info, h))
1153 + h->got.offset = s->_raw_size;
1154 + s->_raw_size += 4;
1155 + dyn = htab->root.dynamic_sections_created;
1156 + if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
1157 + || h->root.type != bfd_link_hash_undefweak)
1159 + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
1160 + htab->srelgot->_raw_size += sizeof (Elf32_External_Rel);
1163 + h->got.offset = (bfd_vma) -1;
1165 + eh = (struct elf32_arm_link_hash_entry *) h;
1166 + if (eh->relocs_copied == NULL)
1169 + /* In the shared -Bsymbolic case, discard space allocated for
1170 + dynamic pc-relative relocs against symbols which turn out to be
1171 + defined in regular objects. For the normal shared case, discard
1172 + space for pc-relative relocs that have become local due to symbol
1173 + visibility changes. */
1177 + /* The only reloc that uses pc_count is R_ARM_PC24, which will
1178 + appear on a call or on something like ".long foo - .". We
1179 + want calls to protected symbols to resolve directly to the
1180 + function rather than going via the plt. If people want
1181 + function pointer comparisons to work as expected then they
1182 + should avoid writing assembly like ".long foo - .". */
1183 + if (SYMBOL_CALLS_LOCAL (info, h))
1185 + struct elf32_arm_relocs_copied **pp;
1187 + for (pp = &eh->relocs_copied; (p = *pp) != NULL; )
1189 + p->count -= p->pc_count;
1191 + if (p->count == 0)
1198 + /* Also discard relocs on undefined weak syms with non-default
1200 + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
1201 + && h->root.type == bfd_link_hash_undefweak)
1202 + eh->relocs_copied = NULL;
1206 + /* For the non-shared case, discard space for relocs against
1207 + symbols which turn out to need copy relocs or are not
1210 + if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
1211 + && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
1212 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
1213 + || (htab->root.dynamic_sections_created
1214 + && (h->root.type == bfd_link_hash_undefweak
1215 + || h->root.type == bfd_link_hash_undefined))))
1217 + /* Make sure this symbol is output as a dynamic symbol.
1218 + Undefined weak syms won't yet be marked as dynamic. */
1219 + if (h->dynindx == -1
1220 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
1222 + if (! bfd_elf32_link_record_dynamic_symbol (info, h))
1226 + /* If that succeeded, we know we'll be keeping all the
1228 + if (h->dynindx != -1)
1232 + eh->relocs_copied = NULL;
1237 + /* Finally, allocate space. */
1238 + for (p = eh->relocs_copied; p != NULL; p = p->next)
1240 + asection *sreloc = elf_section_data (p->section)->sreloc;
1241 + sreloc->_raw_size += p->count * sizeof (Elf32_External_Rel);
1247 /* Set the sizes of the dynamic sections. */
1250 @@ -3153,7 +3513,10 @@
1255 + struct elf32_arm_link_hash_table *htab;
1257 + htab = elf32_arm_hash_table (info);
1258 dynobj = elf_hash_table (info)->dynobj;
1259 BFD_ASSERT (dynobj != NULL);
1261 @@ -3168,26 +3531,74 @@
1262 s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
1267 - /* We may have created entries in the .rel.got section.
1268 - However, if we are not creating the dynamic sections, we will
1269 - not actually use these entries. Reset the size of .rel.got,
1270 - which will cause it to get stripped from the output file
1272 - s = bfd_get_section_by_name (dynobj, ".rel.got");
1277 - /* If this is a -Bsymbolic shared link, then we need to discard all
1278 - PC relative relocs against symbols defined in a regular object.
1279 - We allocated space for them in the check_relocs routine, but we
1280 - will not fill them in in the relocate_section routine. */
1281 - if (info->shared && info->symbolic)
1282 - elf32_arm_link_hash_traverse (elf32_arm_hash_table (info),
1283 - elf32_arm_discard_copies,
1286 + /* Set up .got offsets for local syms, and space for local dynamic
1288 + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
1290 + bfd_signed_vma *local_got;
1291 + bfd_signed_vma *end_local_got;
1292 + char *local_tls_type;
1293 + bfd_size_type locsymcount;
1294 + Elf_Internal_Shdr *symtab_hdr;
1297 + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour)
1300 + for (s = ibfd->sections; s != NULL; s = s->next)
1302 + struct elf32_arm_relocs_copied *p;
1304 + for (p = *((struct elf32_arm_relocs_copied **)
1305 + &elf_section_data (s)->local_dynrel);
1309 + if (!bfd_is_abs_section (p->section)
1310 + && bfd_is_abs_section (p->section->output_section))
1312 + /* Input section has been discarded, either because
1313 + it is a copy of a linkonce section or due to
1314 + linker script /DISCARD/, so we'll be discarding
1315 + the relocs too. */
1317 + else if (p->count != 0)
1319 + srel = elf_section_data (p->section)->sreloc;
1320 + srel->_raw_size += p->count * sizeof (Elf32_External_Rel);
1321 + if ((p->section->output_section->flags & SEC_READONLY) != 0)
1322 + info->flags |= DF_TEXTREL;
1327 + local_got = elf_local_got_refcounts (ibfd);
1331 + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
1332 + locsymcount = symtab_hdr->sh_info;
1333 + end_local_got = local_got + locsymcount;
1335 + srel = htab->srelgot;
1336 + for (; local_got < end_local_got; ++local_got, ++local_tls_type)
1338 + if (*local_got > 0)
1340 + *local_got = s->_raw_size;
1341 + s->_raw_size += 4;
1343 + srel->_raw_size += sizeof (Elf32_External_Rel);
1346 + *local_got = (bfd_vma) -1;
1350 + /* Allocate global sym .plt and .got entries, and space for global
1351 + sym dynamic relocs. */
1352 + elf_link_hash_traverse (&htab->root, allocate_dynrelocs, (PTR) info);
1354 /* The check_relocs and adjust_dynamic_symbol entry points have
1355 determined the sizes of the various dynamic sections. Allocate
1356 @@ -3312,33 +3723,6 @@
1360 -/* This function is called via elf32_arm_link_hash_traverse if we are
1361 - creating a shared object with -Bsymbolic. It discards the space
1362 - allocated to copy PC relative relocs against symbols which are
1363 - defined in regular objects. We allocated space for them in the
1364 - check_relocs routine, but we won't fill them in in the
1365 - relocate_section routine. */
1368 -elf32_arm_discard_copies (h, ignore)
1369 - struct elf32_arm_link_hash_entry * h;
1370 - PTR ignore ATTRIBUTE_UNUSED;
1372 - struct elf32_arm_pcrel_relocs_copied * s;
1374 - if (h->root.root.type == bfd_link_hash_warning)
1375 - h = (struct elf32_arm_link_hash_entry *) h->root.root.u.i.link;
1377 - /* We only discard relocs for symbols defined in a regular object. */
1378 - if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
1381 - for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
1382 - s->section->_raw_size -= s->count * sizeof (Elf32_External_Rel);
1387 /* Finish up dynamic symbol handling. We set the contents of various
1388 dynamic sections here. */
1390 @@ -3362,6 +3746,7 @@
1392 Elf_Internal_Rela rel;
1394 + bfd_vma got_displacement;
1396 /* This symbol has an entry in the procedure linkage table. Set
1398 @@ -3377,35 +3762,43 @@
1399 corresponds to this symbol. This is the index of this symbol
1400 in all the symbols for which we are making plt entries. The
1401 first entry in the procedure linkage table is reserved. */
1402 - plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
1403 + plt_index = (h->plt.offset - PLT_HEADER_SIZE) / PLT_ENTRY_SIZE;
1405 /* Get the offset into the .got table of the entry that
1406 corresponds to this function. Each .got entry is 4 bytes.
1407 The first three are reserved. */
1408 got_offset = (plt_index + 3) * 4;
1410 + /* Calculate the displacement between the PLT slot and the
1411 + entry in the GOT. */
1412 + got_displacement = (sgot->output_section->vma
1413 + + sgot->output_offset
1415 + - splt->output_section->vma
1416 + - splt->output_offset
1420 + BFD_ASSERT ((got_displacement & 0xf0000000) == 0);
1422 /* Fill in the entry in the procedure linkage table. */
1423 - bfd_put_32 (output_bfd, elf32_arm_plt_entry[0],
1424 + bfd_put_32 (output_bfd, elf32_arm_plt_entry[0] | ((got_displacement & 0x0ff00000) >> 20),
1425 splt->contents + h->plt.offset + 0);
1426 - bfd_put_32 (output_bfd, elf32_arm_plt_entry[1],
1427 + bfd_put_32 (output_bfd, elf32_arm_plt_entry[1] | ((got_displacement & 0x000ff000) >> 12),
1428 splt->contents + h->plt.offset + 4);
1429 - bfd_put_32 (output_bfd, elf32_arm_plt_entry[2],
1430 + bfd_put_32 (output_bfd, elf32_arm_plt_entry[2] | (got_displacement & 0x00000fff),
1431 splt->contents + h->plt.offset + 8);
1432 - bfd_put_32 (output_bfd,
1433 - (sgot->output_section->vma
1434 - + sgot->output_offset
1436 - - splt->output_section->vma
1437 - - splt->output_offset
1438 - - h->plt.offset - 12),
1439 - splt->contents + h->plt.offset + 12);
1440 +#ifdef FOUR_WORD_PLT
1441 + bfd_put_32 (output_bfd, elf32_arm_plt_entry[3],
1442 + splt->contents + h->plt.offset + 12);
1445 /* Fill in the entry in the global offset table. */
1446 bfd_put_32 (output_bfd,
1447 (splt->output_section->vma
1448 + splt->output_offset),
1449 sgot->contents + got_offset);
1452 /* Fill in the entry in the .rel.plt section. */
1453 rel.r_offset = (sgot->output_section->vma
1454 + sgot->output_offset
1455 @@ -3446,16 +3839,20 @@
1456 + sgot->output_offset
1457 + (h->got.offset &~ (bfd_vma) 1));
1459 - /* If this is a -Bsymbolic link, and the symbol is defined
1460 - locally, we just want to emit a RELATIVE reloc. The entry in
1461 - the global offset table will already have been initialized in
1462 - the relocate_section function. */
1463 + /* If this is a static link, or it is a -Bsymbolic link and the
1464 + symbol is defined locally or was forced to be local because
1465 + of a version file, we just want to emit a RELATIVE reloc.
1466 + The entry in the global offset table will already have been
1467 + initialized in the relocate_section function. */
1469 - && (info->symbolic || h->dynindx == -1)
1470 - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
1471 - rel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
1472 + && SYMBOL_REFERENCES_LOCAL (info, h))
1474 + BFD_ASSERT((h->got.offset & 1) != 0);
1475 + rel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
1479 + BFD_ASSERT((h->got.offset & 1) == 0);
1480 bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
1481 rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_GLOB_DAT);
1483 @@ -3609,10 +4006,26 @@
1484 /* Fill in the first entry in the procedure linkage table. */
1485 if (splt->_raw_size > 0)
1487 + bfd_vma got_displacement;
1489 + /* Calculate the displacement between the PLT slot and &GOT[0]. */
1490 + got_displacement = (sgot->output_section->vma
1491 + + sgot->output_offset
1492 + - splt->output_section->vma
1493 + - splt->output_offset
1496 bfd_put_32 (output_bfd, elf32_arm_plt0_entry[0], splt->contents + 0);
1497 bfd_put_32 (output_bfd, elf32_arm_plt0_entry[1], splt->contents + 4);
1498 bfd_put_32 (output_bfd, elf32_arm_plt0_entry[2], splt->contents + 8);
1499 bfd_put_32 (output_bfd, elf32_arm_plt0_entry[3], splt->contents + 12);
1500 +#ifdef FOUR_WORD_PLT
1501 + /* The displacement value goes in the otherwise-unused last word of
1502 + the second entry. */
1503 + bfd_put_32 (output_bfd, got_displacement, splt->contents + 28);
1505 + bfd_put_32 (output_bfd, got_displacement, splt->contents + 16);
1509 /* UnixWare sets the entsize of .plt to 4, although that doesn't
1510 @@ -3714,7 +4127,7 @@
1511 #define elf_backend_check_relocs elf32_arm_check_relocs
1512 #define elf_backend_relocate_section elf32_arm_relocate_section
1513 #define elf_backend_adjust_dynamic_symbol elf32_arm_adjust_dynamic_symbol
1514 -#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections
1515 +#define elf_backend_create_dynamic_sections elf32_arm_create_dynamic_sections
1516 #define elf_backend_finish_dynamic_symbol elf32_arm_finish_dynamic_symbol
1517 #define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections
1518 #define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections
1519 @@ -3723,7 +4136,9 @@
1520 #define elf_backend_object_p elf32_arm_object_p
1521 #define elf_backend_section_flags elf32_arm_section_flags
1522 #define elf_backend_final_write_processing elf32_arm_final_write_processing
1523 +#define elf_backend_copy_indirect_symbol elf32_arm_copy_indirect_symbol
1525 +#define elf_backend_can_refcount 1
1526 #define elf_backend_can_gc_sections 1
1527 #define elf_backend_plt_readonly 1
1528 #define elf_backend_want_got_plt 1
1529 @@ -3733,7 +4148,7 @@
1532 #define elf_backend_got_header_size 12
1533 -#define elf_backend_plt_header_size PLT_ENTRY_SIZE
1534 +#define elf_backend_plt_header_size PLT_HEADER_SIZE
1536 #include "elf32-target.h"
1538 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-avr.c binutils-2.14.90.0.7/bfd/elf32-avr.c
1539 --- binutils-2.14.90.0.7.orig/bfd/elf32-avr.c 2003-07-23 09:08:08.000000000 -0600
1540 +++ binutils-2.14.90.0.7/bfd/elf32-avr.c 2004-04-20 01:26:12.000000000 -0600
1543 sym = local_syms + r_symndx;
1544 sec = local_sections [r_symndx];
1545 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1546 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1548 name = bfd_elf_string_from_elf_section
1549 (input_bfd, symtab_hdr->sh_link, sym->st_name);
1550 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-cris.c binutils-2.14.90.0.7/bfd/elf32-cris.c
1551 --- binutils-2.14.90.0.7.orig/bfd/elf32-cris.c 2003-08-21 09:28:47.000000000 -0600
1552 +++ binutils-2.14.90.0.7/bfd/elf32-cris.c 2004-04-20 01:26:12.000000000 -0600
1555 sym = local_syms + r_symndx;
1556 sec = local_sections [r_symndx];
1557 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1558 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1560 symname = (bfd_elf_string_from_elf_section
1561 (input_bfd, symtab_hdr->sh_link, sym->st_name));
1562 @@ -1292,16 +1292,7 @@
1567 - sec = local_sections[r_symndx];
1570 - BFD_ASSERT (h->root.type == bfd_link_hash_defined
1572 - == bfd_link_hash_defweak));
1573 - sec = h->root.u.def.section;
1575 - if (sec != NULL && bfd_is_abs_section (sec))
1576 + if (bfd_is_abs_section (sec))
1578 else if (sec == NULL || sec->owner == NULL)
1580 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-fr30.c binutils-2.14.90.0.7/bfd/elf32-fr30.c
1581 --- binutils-2.14.90.0.7.orig/bfd/elf32-fr30.c 2003-07-23 09:08:08.000000000 -0600
1582 +++ binutils-2.14.90.0.7/bfd/elf32-fr30.c 2004-04-20 01:26:12.000000000 -0600
1585 sym = local_syms + r_symndx;
1586 sec = local_sections [r_symndx];
1587 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1588 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1590 name = bfd_elf_string_from_elf_section
1591 (input_bfd, symtab_hdr->sh_link, sym->st_name);
1592 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-frv.c binutils-2.14.90.0.7/bfd/elf32-frv.c
1593 --- binutils-2.14.90.0.7.orig/bfd/elf32-frv.c 2003-10-29 10:37:47.000000000 -0700
1594 +++ binutils-2.14.90.0.7/bfd/elf32-frv.c 2004-04-20 01:26:12.000000000 -0600
1597 sym = local_syms + r_symndx;
1598 sec = local_sections [r_symndx];
1599 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1600 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1602 name = bfd_elf_string_from_elf_section
1603 (input_bfd, symtab_hdr->sh_link, sym->st_name);
1604 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-h8300.c binutils-2.14.90.0.7/bfd/elf32-h8300.c
1605 --- binutils-2.14.90.0.7.orig/bfd/elf32-h8300.c 2003-10-29 10:37:47.000000000 -0700
1606 +++ binutils-2.14.90.0.7/bfd/elf32-h8300.c 2004-04-20 01:26:12.000000000 -0600
1609 sym = local_syms + r_symndx;
1610 sec = local_sections[r_symndx];
1611 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1612 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1616 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-hppa.c binutils-2.14.90.0.7/bfd/elf32-hppa.c
1617 --- binutils-2.14.90.0.7.orig/bfd/elf32-hppa.c 2003-10-29 10:37:47.000000000 -0700
1618 +++ binutils-2.14.90.0.7/bfd/elf32-hppa.c 2004-04-20 01:26:12.000000000 -0600
1619 @@ -3408,7 +3408,7 @@
1620 /* This is a local symbol, h defaults to NULL. */
1621 sym = local_syms + r_symndx;
1622 sym_sec = local_sections[r_symndx];
1623 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel);
1624 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sym_sec, rel);
1628 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-i370.c binutils-2.14.90.0.7/bfd/elf32-i370.c
1629 --- binutils-2.14.90.0.7.orig/bfd/elf32-i370.c 2003-07-23 09:08:08.000000000 -0600
1630 +++ binutils-2.14.90.0.7/bfd/elf32-i370.c 2004-04-20 01:26:12.000000000 -0600
1631 @@ -1210,7 +1210,7 @@
1632 sec = local_sections[r_symndx];
1633 sym_name = "<local symbol>";
1635 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1636 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1637 addend = rel->r_addend;
1640 @@ -1363,16 +1363,7 @@
1645 - sec = local_sections[r_symndx];
1648 - BFD_ASSERT (h->root.type == bfd_link_hash_defined
1650 - == bfd_link_hash_defweak));
1651 - sec = h->root.u.def.section;
1653 - if (sec != NULL && bfd_is_abs_section (sec))
1654 + if (bfd_is_abs_section (sec))
1656 else if (sec == NULL || sec->owner == NULL)
1658 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-i860.c binutils-2.14.90.0.7/bfd/elf32-i860.c
1659 --- binutils-2.14.90.0.7.orig/bfd/elf32-i860.c 2003-10-29 10:37:47.000000000 -0700
1660 +++ binutils-2.14.90.0.7/bfd/elf32-i860.c 2004-04-20 01:26:12.000000000 -0600
1661 @@ -1104,7 +1104,7 @@
1663 sym = local_syms + r_symndx;
1664 sec = local_sections [r_symndx];
1665 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1666 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1668 name = bfd_elf_string_from_elf_section
1669 (input_bfd, symtab_hdr->sh_link, sym->st_name);
1670 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-m32r.c binutils-2.14.90.0.7/bfd/elf32-m32r.c
1671 --- binutils-2.14.90.0.7.orig/bfd/elf32-m32r.c 2003-10-29 10:37:47.000000000 -0700
1672 +++ binutils-2.14.90.0.7/bfd/elf32-m32r.c 2004-04-20 01:26:12.000000000 -0600
1673 @@ -1107,7 +1107,7 @@
1674 sec = local_sections[r_symndx];
1675 sym_name = "<local symbol>";
1677 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1678 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1679 addend = rel->r_addend;
1681 /* FIXME: This won't handle local relocations against SEC_MERGE
1682 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-m68k.c binutils-2.14.90.0.7/bfd/elf32-m68k.c
1683 --- binutils-2.14.90.0.7.orig/bfd/elf32-m68k.c 2003-08-21 09:28:47.000000000 -0600
1684 +++ binutils-2.14.90.0.7/bfd/elf32-m68k.c 2004-04-20 01:26:12.000000000 -0600
1685 @@ -1403,7 +1403,7 @@
1687 sym = local_syms + r_symndx;
1688 sec = local_sections[r_symndx];
1689 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1690 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1694 @@ -1657,16 +1657,7 @@
1699 - sec = local_sections[r_symndx];
1702 - BFD_ASSERT (h->root.type == bfd_link_hash_defined
1704 - == bfd_link_hash_defweak));
1705 - sec = h->root.u.def.section;
1707 - if (sec != NULL && bfd_is_abs_section (sec))
1708 + if (bfd_is_abs_section (sec))
1710 else if (sec == NULL || sec->owner == NULL)
1712 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-mcore.c binutils-2.14.90.0.7/bfd/elf32-mcore.c
1713 --- binutils-2.14.90.0.7.orig/bfd/elf32-mcore.c 2003-10-29 10:37:48.000000000 -0700
1714 +++ binutils-2.14.90.0.7/bfd/elf32-mcore.c 2004-04-20 01:26:12.000000000 -0600
1717 sym = local_syms + r_symndx;
1718 sec = local_sections [r_symndx];
1719 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1720 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1721 addend = rel->r_addend;
1724 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-msp430.c binutils-2.14.90.0.7/bfd/elf32-msp430.c
1725 --- binutils-2.14.90.0.7.orig/bfd/elf32-msp430.c 2003-08-21 09:28:47.000000000 -0600
1726 +++ binutils-2.14.90.0.7/bfd/elf32-msp430.c 2004-04-20 01:26:12.000000000 -0600
1729 sym = local_syms + r_symndx;
1730 sec = local_sections[r_symndx];
1731 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1732 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1734 name = bfd_elf_string_from_elf_section
1735 (input_bfd, symtab_hdr->sh_link, sym->st_name);
1736 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-openrisc.c binutils-2.14.90.0.7/bfd/elf32-openrisc.c
1737 --- binutils-2.14.90.0.7.orig/bfd/elf32-openrisc.c 2003-07-23 09:08:08.000000000 -0600
1738 +++ binutils-2.14.90.0.7/bfd/elf32-openrisc.c 2004-04-20 01:26:12.000000000 -0600
1741 sym = local_syms + r_symndx;
1742 sec = local_sections[r_symndx];
1743 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1744 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1746 name = bfd_elf_string_from_elf_section
1747 (input_bfd, symtab_hdr->sh_link, sym->st_name);
1748 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-ppc.c binutils-2.14.90.0.7/bfd/elf32-ppc.c
1749 --- binutils-2.14.90.0.7.orig/bfd/elf32-ppc.c 2003-10-29 10:37:48.000000000 -0700
1750 +++ binutils-2.14.90.0.7/bfd/elf32-ppc.c 2004-04-20 01:26:12.000000000 -0600
1751 @@ -4727,7 +4727,7 @@
1752 sec = local_sections[r_symndx];
1753 sym_name = bfd_elf_local_sym_name (input_bfd, sym);
1755 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1756 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1760 @@ -5455,44 +5455,9 @@
1765 - unsigned long r_symndx;
1766 - Elf_Internal_Sym *sym;
1767 - asection *sym_sec;
1768 - bfd_byte *hit_addr = 0;
1769 - bfd_vma value = 0;
1771 - r_symndx = ELF32_R_SYM (rel->r_info);
1773 - if (r_symndx < symtab_hdr->sh_info)
1775 - sym = local_syms + r_symndx;
1776 - sym_sec = local_sections[r_symndx];
1778 - value = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel);
1782 - bfd_boolean warned;
1783 - bfd_boolean unresolved_reloc;
1785 - RELOC_FOR_GLOBAL_SYMBOL (h, elf_sym_hashes (input_bfd),
1786 - r_symndx, symtab_hdr,
1788 - unresolved_reloc, info,
1793 - hit_addr = contents + rel->r_offset;
1794 - value += rel->r_addend;
1796 - r = ppc_elf_install_value (output_bfd, hit_addr, value, r_type);
1797 - if (r != bfd_reloc_ok)
1802 + ppc_elf_install_value (output_bfd, contents + rel->r_offset,
1803 + relocation + addend, r_type);
1806 /* Indirect .sdata relocation. */
1807 case R_PPC_EMB_SDAI16:
1808 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-s390.c binutils-2.14.90.0.7/bfd/elf32-s390.c
1809 --- binutils-2.14.90.0.7.orig/bfd/elf32-s390.c 2003-08-21 09:28:47.000000000 -0600
1810 +++ binutils-2.14.90.0.7/bfd/elf32-s390.c 2004-04-20 01:26:12.000000000 -0600
1811 @@ -2327,7 +2327,7 @@
1813 sym = local_syms + r_symndx;
1814 sec = local_sections[r_symndx];
1815 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1816 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1820 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-sh.c binutils-2.14.90.0.7/bfd/elf32-sh.c
1821 --- binutils-2.14.90.0.7.orig/bfd/elf32-sh.c 2003-10-29 10:37:48.000000000 -0700
1822 +++ binutils-2.14.90.0.7/bfd/elf32-sh.c 2004-04-20 01:26:12.000000000 -0600
1823 @@ -4805,7 +4805,7 @@
1825 else if (! howto->partial_inplace)
1827 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1828 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1829 addend = rel->r_addend;
1831 else if ((sec->flags & SEC_MERGE)
1832 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-sparc.c binutils-2.14.90.0.7/bfd/elf32-sparc.c
1833 --- binutils-2.14.90.0.7.orig/bfd/elf32-sparc.c 2003-08-21 09:28:48.000000000 -0600
1834 +++ binutils-2.14.90.0.7/bfd/elf32-sparc.c 2004-04-20 01:26:12.000000000 -0600
1835 @@ -2182,7 +2182,7 @@
1837 sym = local_syms + r_symndx;
1838 sec = local_sections[r_symndx];
1839 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1840 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1844 @@ -2459,16 +2459,8 @@
1848 - else if (h == NULL)
1849 - sec = local_sections[r_symndx];
1852 - BFD_ASSERT (h->root.type == bfd_link_hash_defined
1854 - == bfd_link_hash_defweak));
1855 - sec = h->root.u.def.section;
1857 - if (sec != NULL && bfd_is_abs_section (sec))
1859 + if (bfd_is_abs_section (sec))
1861 else if (sec == NULL || sec->owner == NULL)
1863 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-v850.c binutils-2.14.90.0.7/bfd/elf32-v850.c
1864 --- binutils-2.14.90.0.7.orig/bfd/elf32-v850.c 2003-10-29 10:37:48.000000000 -0700
1865 +++ binutils-2.14.90.0.7/bfd/elf32-v850.c 2004-04-20 01:26:12.000000000 -0600
1866 @@ -1681,7 +1681,7 @@
1868 sym = local_syms + r_symndx;
1869 sec = local_sections[r_symndx];
1870 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1871 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1875 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-vax.c binutils-2.14.90.0.7/bfd/elf32-vax.c
1876 --- binutils-2.14.90.0.7.orig/bfd/elf32-vax.c 2003-08-21 09:28:48.000000000 -0600
1877 +++ binutils-2.14.90.0.7/bfd/elf32-vax.c 2004-04-20 01:26:12.000000000 -0600
1878 @@ -1483,7 +1483,7 @@
1880 sym = local_syms + r_symndx;
1881 sec = local_sections[r_symndx];
1882 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1883 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1887 @@ -1737,16 +1737,7 @@
1892 - sec = local_sections[r_symndx];
1895 - BFD_ASSERT (h->root.type == bfd_link_hash_defined
1897 - == bfd_link_hash_defweak));
1898 - sec = h->root.u.def.section;
1900 - if (sec != NULL && bfd_is_abs_section (sec))
1901 + if (bfd_is_abs_section (sec))
1903 else if (sec == NULL || sec->owner == NULL)
1905 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-xstormy16.c binutils-2.14.90.0.7/bfd/elf32-xstormy16.c
1906 --- binutils-2.14.90.0.7.orig/bfd/elf32-xstormy16.c 2003-07-23 09:08:09.000000000 -0600
1907 +++ binutils-2.14.90.0.7/bfd/elf32-xstormy16.c 2004-04-20 01:26:12.000000000 -0600
1910 sym = local_syms + r_symndx;
1911 sec = local_sections [r_symndx];
1912 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1913 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1915 name = bfd_elf_string_from_elf_section
1916 (input_bfd, symtab_hdr->sh_link, sym->st_name);
1917 diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-xtensa.c binutils-2.14.90.0.7/bfd/elf32-xtensa.c
1918 --- binutils-2.14.90.0.7.orig/bfd/elf32-xtensa.c 2003-10-29 10:37:48.000000000 -0700
1919 +++ binutils-2.14.90.0.7/bfd/elf32-xtensa.c 2004-04-20 01:26:12.000000000 -0600
1920 @@ -2004,7 +2004,7 @@
1922 sym = local_syms + r_symndx;
1923 sec = local_sections[r_symndx];
1924 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1925 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1929 diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-alpha.c binutils-2.14.90.0.7/bfd/elf64-alpha.c
1930 --- binutils-2.14.90.0.7.orig/bfd/elf64-alpha.c 2003-10-29 10:37:48.000000000 -0700
1931 +++ binutils-2.14.90.0.7/bfd/elf64-alpha.c 2004-04-20 01:26:12.000000000 -0600
1932 @@ -4394,9 +4394,11 @@
1934 if (r_symndx < symtab_hdr->sh_info)
1937 sym = local_syms + r_symndx;
1938 sec = local_sections[r_symndx];
1939 - value = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1941 + value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel);
1943 /* If this is a tp-relative relocation against sym 0,
1944 this is hackery from relax_section. Force the value to
1945 @@ -4424,7 +4426,6 @@
1946 && !gotent->reloc_xlated)
1948 struct alpha_elf_got_entry *ent;
1951 for (ent = gotent; ent; ent = ent->next)
1953 diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-hppa.c binutils-2.14.90.0.7/bfd/elf64-hppa.c
1954 --- binutils-2.14.90.0.7.orig/bfd/elf64-hppa.c 2003-10-29 10:37:48.000000000 -0700
1955 +++ binutils-2.14.90.0.7/bfd/elf64-hppa.c 2004-04-20 01:26:12.000000000 -0600
1959 static const char *get_dyn_name
1960 - PARAMS ((asection *, struct elf_link_hash_entry *,
1961 + PARAMS ((bfd *, struct elf_link_hash_entry *,
1962 const Elf_Internal_Rela *, char **, size_t *));
1964 /* This must follow the definitions of the various derived linker
1965 @@ -446,13 +446,14 @@
1966 allocate memory as necessary, possibly reusing PBUF/PLEN. */
1969 -get_dyn_name (sec, h, rel, pbuf, plen)
1971 +get_dyn_name (abfd, h, rel, pbuf, plen)
1973 struct elf_link_hash_entry *h;
1974 const Elf_Internal_Rela *rel;
1978 + asection *sec = abfd->sections;
1985 /* Collect a canonical name for this address. */
1986 - addr_name = get_dyn_name (sec, h, rel, &buf, &buf_len);
1987 + addr_name = get_dyn_name (abfd, h, rel, &buf, &buf_len);
1989 /* Collect the canonical entry data for this address. */
1990 dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
1991 diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-mmix.c binutils-2.14.90.0.7/bfd/elf64-mmix.c
1992 --- binutils-2.14.90.0.7.orig/bfd/elf64-mmix.c 2003-10-29 10:37:48.000000000 -0700
1993 +++ binutils-2.14.90.0.7/bfd/elf64-mmix.c 2004-04-20 01:26:12.000000000 -0600
1994 @@ -1472,7 +1472,7 @@
1996 sym = local_syms + r_symndx;
1997 sec = local_sections [r_symndx];
1998 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
1999 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
2001 name = bfd_elf_string_from_elf_section
2002 (input_bfd, symtab_hdr->sh_link, sym->st_name);
2003 diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-ppc.c binutils-2.14.90.0.7/bfd/elf64-ppc.c
2004 --- binutils-2.14.90.0.7.orig/bfd/elf64-ppc.c 2003-10-29 10:37:48.000000000 -0700
2005 +++ binutils-2.14.90.0.7/bfd/elf64-ppc.c 2004-04-20 01:26:12.000000000 -0600
2006 @@ -7385,7 +7385,7 @@
2007 sec = local_sections[r_symndx];
2008 sym_name = bfd_elf_local_sym_name (input_bfd, sym);
2009 sym_type = ELF64_ST_TYPE (sym->st_info);
2010 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
2011 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
2012 if (elf_section_data (sec) != NULL)
2014 long *opd_sym_adjust;
2015 @@ -8178,7 +8178,9 @@
2016 relocation = TOCstart;
2018 relocation += htab->stub_group[input_section->id].toc_off;
2019 - else if (sec != NULL && !unresolved_reloc)
2020 + else if (unresolved_reloc)
2022 + else if (sec != NULL && sec->id <= htab->top_id)
2023 relocation += htab->stub_group[sec->id].toc_off;
2025 unresolved_reloc = TRUE;
2026 diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-s390.c binutils-2.14.90.0.7/bfd/elf64-s390.c
2027 --- binutils-2.14.90.0.7.orig/bfd/elf64-s390.c 2003-08-21 09:28:48.000000000 -0600
2028 +++ binutils-2.14.90.0.7/bfd/elf64-s390.c 2004-04-20 01:26:12.000000000 -0600
2029 @@ -2297,7 +2297,7 @@
2031 sym = local_syms + r_symndx;
2032 sec = local_sections[r_symndx];
2033 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
2034 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
2038 diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-sh64.c binutils-2.14.90.0.7/bfd/elf64-sh64.c
2039 --- binutils-2.14.90.0.7.orig/bfd/elf64-sh64.c 2003-10-29 10:37:48.000000000 -0700
2040 +++ binutils-2.14.90.0.7/bfd/elf64-sh64.c 2004-04-20 01:26:12.000000000 -0600
2041 @@ -1582,7 +1582,7 @@
2043 else if (! howto->partial_inplace)
2045 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
2046 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
2047 relocation |= ((sym->st_other & STO_SH5_ISA32) != 0);
2049 else if ((sec->flags & SEC_MERGE)
2050 diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-sparc.c binutils-2.14.90.0.7/bfd/elf64-sparc.c
2051 --- binutils-2.14.90.0.7.orig/bfd/elf64-sparc.c 2003-08-21 09:28:48.000000000 -0600
2052 +++ binutils-2.14.90.0.7/bfd/elf64-sparc.c 2004-04-20 01:26:12.000000000 -0600
2053 @@ -2070,7 +2070,7 @@
2055 sym = local_syms + r_symndx;
2056 sec = local_sections[r_symndx];
2057 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
2058 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
2062 @@ -2247,16 +2247,8 @@
2066 - else if (h == NULL)
2067 - sec = local_sections[r_symndx];
2070 - BFD_ASSERT (h->root.type == bfd_link_hash_defined
2072 - == bfd_link_hash_defweak));
2073 - sec = h->root.u.def.section;
2075 - if (sec != NULL && bfd_is_abs_section (sec))
2077 + if (bfd_is_abs_section (sec))
2079 else if (sec == NULL || sec->owner == NULL)
2081 diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-x86-64.c binutils-2.14.90.0.7/bfd/elf64-x86-64.c
2082 --- binutils-2.14.90.0.7.orig/bfd/elf64-x86-64.c 2003-08-21 09:28:48.000000000 -0600
2083 +++ binutils-2.14.90.0.7/bfd/elf64-x86-64.c 2004-04-20 01:26:12.000000000 -0600
2084 @@ -1823,7 +1823,7 @@
2085 sym = local_syms + r_symndx;
2086 sec = local_sections[r_symndx];
2088 - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
2089 + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
2093 @@ -2048,16 +2048,7 @@
2098 - sec = local_sections[r_symndx];
2101 - BFD_ASSERT (h->root.type == bfd_link_hash_defined
2103 - == bfd_link_hash_defweak));
2104 - sec = h->root.u.def.section;
2106 - if (sec != NULL && bfd_is_abs_section (sec))
2107 + if (bfd_is_abs_section (sec))
2109 else if (sec == NULL || sec->owner == NULL)
2111 diff -urN binutils-2.14.90.0.7.orig/bfd/elfxx-ia64.c binutils-2.14.90.0.7/bfd/elfxx-ia64.c
2112 --- binutils-2.14.90.0.7.orig/bfd/elfxx-ia64.c 2003-10-29 10:37:48.000000000 -0700
2113 +++ binutils-2.14.90.0.7/bfd/elfxx-ia64.c 2004-04-20 01:26:12.000000000 -0600
2114 @@ -3849,9 +3849,11 @@
2115 if (r_symndx < symtab_hdr->sh_info)
2117 /* Reloc against local symbol. */
2119 sym = local_syms + r_symndx;
2120 sym_sec = local_sections[r_symndx];
2121 - value = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel);
2123 + value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel);
2124 if ((sym_sec->flags & SEC_MERGE)
2125 && ELF_ST_TYPE (sym->st_info) == STT_SECTION
2126 && sym_sec->sec_info_type == ELF_INFO_TYPE_MERGE)
2127 @@ -3862,7 +3864,6 @@
2128 if (loc_h && ! loc_h->sec_merge_done)
2130 struct elfNN_ia64_dyn_sym_info *dynent;
2133 for (dynent = loc_h->info; dynent; dynent = dynent->next)
2135 diff -urN binutils-2.14.90.0.7.orig/bfd/opncls.c binutils-2.14.90.0.7/bfd/opncls.c
2136 --- binutils-2.14.90.0.7.orig/bfd/opncls.c 2003-10-29 10:37:48.000000000 -0700
2137 +++ binutils-2.14.90.0.7/bfd/opncls.c 2004-04-20 01:26:11.000000000 -0600
2138 @@ -150,6 +150,13 @@
2141 const bfd_target *target_vec;
2144 + if (stat (filename, &s) == 0)
2145 + if (S_ISDIR(s.st_mode)) {
2146 + bfd_set_error (bfd_error_file_not_recognized);
2150 nbfd = _bfd_new_bfd ();
2152 diff -urN binutils-2.14.90.0.7.orig/binutils/objcopy.c binutils-2.14.90.0.7/binutils/objcopy.c
2153 --- binutils-2.14.90.0.7.orig/binutils/objcopy.c 2003-10-29 10:37:48.000000000 -0700
2154 +++ binutils-2.14.90.0.7/binutils/objcopy.c 2004-04-20 01:26:12.000000000 -0600
2156 #include "libiberty.h"
2158 #include "filenames.h"
2159 +#include "elf-bfd.h"
2160 #include <sys/stat.h>
2162 /* A list of symbols to explicitly strip out, or to keep. A linked
2164 -g --strip-debug Remove all debugging symbols & sections\n\
2165 --strip-unneeded Remove all symbols not needed by relocations\n\
2166 -N --strip-symbol <name> Do not copy symbol <name>\n\
2167 + --only-keep-debug Strip everything but the debug information\n\
2168 -K --keep-symbol <name> Only copy symbol <name>\n\
2169 -L --localize-symbol <name> Force symbol <name> to be marked as a local\n\
2170 -G --keep-global-symbol <name> Localize all symbols except <name>\n\
2172 -s --strip-all Remove all symbol and relocation information\n\
2173 -g -S -d --strip-debug Remove all debugging symbols & sections\n\
2174 --strip-unneeded Remove all symbols not needed by relocations\n\
2175 + --only-keep-debug Strip everything but the debug information\n\
2176 -N --strip-symbol=<name> Do not copy symbol <name>\n\
2177 -K --keep-symbol=<name> Only copy symbol <name>\n\
2178 -x --discard-all Remove all non-global symbols\n\
2183 - return strip_symbols == STRIP_NONDEBUG ? TRUE : FALSE;
2187 /* Choose which symbol entries to copy; put the result in OSYMS.
2188 @@ -1806,6 +1809,13 @@
2190 if (p != NULL && p->set_flags)
2191 flags = p->flags | (flags & (SEC_HAS_CONTENTS | SEC_RELOC));
2192 + else if (strip_symbols == STRIP_NONDEBUG && (flags & SEC_ALLOC) != 0)
2194 + flags &= ~(SEC_HAS_CONTENTS | SEC_LOAD);
2195 + if (obfd->xvec->flavour == bfd_target_elf_flavour)
2196 + elf_section_type (osection) = SHT_NOBITS;
2199 if (!bfd_set_section_flags (obfd, osection, flags))
2202 @@ -1926,6 +1936,8 @@
2205 bfd_set_reloc (obfd, osection, relcount == 0 ? NULL : relpp, relcount);
2206 + if (relcount == 0)
2210 isection->_cooked_size = isection->_raw_size;
2211 diff -urN binutils-2.14.90.0.7.orig/binutils/readelf.c binutils-2.14.90.0.7/binutils/readelf.c
2212 --- binutils-2.14.90.0.7.orig/binutils/readelf.c 2003-10-29 10:37:48.000000000 -0700
2213 +++ binutils-2.14.90.0.7/binutils/readelf.c 2004-04-20 01:26:12.000000000 -0600
2214 @@ -6055,7 +6055,7 @@
2216 bytes = section->sh_size;
2219 + if (bytes == 0 || section->sh_type == SHT_NOBITS)
2221 printf (_("\nSection '%s' has no data to dump.\n"),
2222 SECTION_NAME (section));
2223 diff -urN binutils-2.14.90.0.7.orig/gprof/gprof.texi binutils-2.14.90.0.7/gprof/gprof.texi
2224 --- binutils-2.14.90.0.7.orig/gprof/gprof.texi 2002-08-01 18:49:32.000000000 -0600
2225 +++ binutils-2.14.90.0.7/gprof/gprof.texi 2004-04-20 01:26:11.000000000 -0600
2226 @@ -137,6 +137,10 @@
2227 If more than one profile file is specified, the @code{gprof}
2228 output shows the sum of the profile information in the given profile files.
2230 +If you use gcc 2.95.x or 3.0 to compile your binaries, you may need
2231 +to add the @samp{-fprofile-arcs} to the compile command line in order
2232 +for the call graphs to be properly stored in gmon.out.
2234 @code{Gprof} calculates the amount of time spent in each routine.
2235 Next, these times are propagated along the edges of the call graph.
2236 Cycles are discovered, and calls into a cycle are made to share the time
2240 @c man begin SEEALSO
2241 -monitor(3), profil(2), cc(1), prof(1), and the Info entry for @file{gprof}.
2242 +profil(2), cc(1), prof(1), and the Info entry for @file{gprof}.
2244 ``An Execution Profiler for Modular Programs'',
2245 by S. Graham, P. Kessler, M. McKusick;
2246 @@ -267,6 +271,11 @@
2247 options. The same option, @samp{-pg}, alters either compilation or linking
2248 to do what is necessary for profiling. Here are examples:
2250 +If you use gcc 2.95.x or 3.0.x, you may need to add the
2251 +@samp{-fprofile-arcs} option to the compile line along with @samp{-pg}
2252 +in order to allow the call-graphs to be properly included in the gmon.out
2256 cc -g -c myprog.c utils.c -pg
2257 cc -o myprog myprog.o utils.o -pg
2258 diff -urN binutils-2.14.90.0.7.orig/ld/Makefile.am binutils-2.14.90.0.7/ld/Makefile.am
2259 --- binutils-2.14.90.0.7.orig/ld/Makefile.am 2003-10-29 10:37:48.000000000 -0700
2260 +++ binutils-2.14.90.0.7/ld/Makefile.am 2004-04-20 01:26:11.000000000 -0600
2262 # We put the scripts in the directory $(scriptdir)/ldscripts.
2263 # We can't put the scripts in $(datadir) because the SEARCH_DIR
2264 # directives need to be different for native and cross linkers.
2265 -scriptdir = $(tooldir)/lib
2266 +scriptdir = $(libdir)
2269 EMULATION_OFILES = @EMULATION_OFILES@
2270 diff -urN binutils-2.14.90.0.7.orig/ld/Makefile.in binutils-2.14.90.0.7/ld/Makefile.in
2271 --- binutils-2.14.90.0.7.orig/ld/Makefile.in 2003-10-29 10:37:48.000000000 -0700
2272 +++ binutils-2.14.90.0.7/ld/Makefile.in 2004-04-20 01:26:11.000000000 -0600
2274 # We put the scripts in the directory $(scriptdir)/ldscripts.
2275 # We can't put the scripts in $(datadir) because the SEARCH_DIR
2276 # directives need to be different for native and cross linkers.
2277 -scriptdir = $(tooldir)/lib
2278 +scriptdir = $(libdir)
2281 EMULATION_OFILES = @EMULATION_OFILES@
2282 diff -urN binutils-2.14.90.0.7.orig/ld/emultempl/elf32.em binutils-2.14.90.0.7/ld/emultempl/elf32.em
2283 --- binutils-2.14.90.0.7.orig/ld/emultempl/elf32.em 2003-08-21 09:28:48.000000000 -0600
2284 +++ binutils-2.14.90.0.7/ld/emultempl/elf32.em 2004-04-20 01:26:11.000000000 -0600
2286 && command_line.rpath == NULL)
2288 lib_path = (const char *) getenv ("LD_RUN_PATH");
2289 + if ((lib_path) && (strlen (lib_path) == 0))
2291 if (gld${EMULATION_NAME}_search_needed (lib_path, l->name,
2295 rpath = command_line.rpath;
2297 rpath = (const char *) getenv ("LD_RUN_PATH");
2298 + if ((rpath) && (strlen (rpath) == 0))
2300 if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
2301 (output_bfd, command_line.soname, rpath,
2302 command_line.filter_shlib,
2303 diff -urN binutils-2.14.90.0.7.orig/ltmain.sh binutils-2.14.90.0.7/ltmain.sh
2304 --- binutils-2.14.90.0.7.orig/ltmain.sh 2002-03-22 15:06:16.000000000 -0700
2305 +++ binutils-2.14.90.0.7/ltmain.sh 2004-04-20 01:26:12.000000000 -0600
2306 @@ -4413,6 +4413,10 @@
2307 # LD_LIBRARY_PATH before the program is installed.
2308 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
2309 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
2310 + if test -n "$linkname"; then
2311 + $show "(cd $output_objdir && $rm ../$linkname && $LN_S $output_objdir/$linkname ../$linkname)"
2312 + $run eval '(cd $output_objdir && $rm ../$linkname && $LN_S $output_objdir/$linkname ../$linkname)' || exit $?
2317 diff -urN binutils-2.14.90.0.7.orig/opcodes/Makefile.am binutils-2.14.90.0.7/opcodes/Makefile.am
2318 --- binutils-2.14.90.0.7.orig/opcodes/Makefile.am 2003-10-29 10:37:49.000000000 -0700
2319 +++ binutils-2.14.90.0.7/opcodes/Makefile.am 2004-04-20 01:26:12.000000000 -0600
2322 libopcodes_la_SOURCES = dis-buf.c disassemble.c dis-init.c
2323 libopcodes_la_DEPENDENCIES = $(OFILES) ../bfd/libbfd.la
2324 -libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ ../bfd/libbfd.la
2325 +libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ -L../bfd -lbfd
2326 libopcodes_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
2328 # libtool will build .libs/libopcodes.a. We create libopcodes.a in
2329 diff -urN binutils-2.14.90.0.7.orig/opcodes/Makefile.in binutils-2.14.90.0.7/opcodes/Makefile.in
2330 --- binutils-2.14.90.0.7.orig/opcodes/Makefile.in 2003-10-29 10:37:49.000000000 -0700
2331 +++ binutils-2.14.90.0.7/opcodes/Makefile.in 2004-04-20 01:26:12.000000000 -0600
2334 libopcodes_la_SOURCES = dis-buf.c disassemble.c dis-init.c
2335 libopcodes_la_DEPENDENCIES = $(OFILES) ../bfd/libbfd.la
2336 -libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ ../bfd/libbfd.la
2337 +libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ -L../bfd -lbfd
2338 libopcodes_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
2340 # libtool will build .libs/libopcodes.a. We create libopcodes.a in
2342 all-recursive install-data-recursive install-exec-recursive \
2343 installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
2344 check-recursive installcheck-recursive info-recursive dvi-recursive:
2345 - @set fnord $(MAKEFLAGS); amf=$$2; \
2346 + @set fnord $$MAKEFLAGS; amf=$$2; \
2348 target=`echo $@ | sed s/-recursive//`; \
2349 list='$(SUBDIRS)'; for subdir in $$list; do \
2352 mostlyclean-recursive clean-recursive distclean-recursive \
2353 maintainer-clean-recursive:
2354 - @set fnord $(MAKEFLAGS); amf=$$2; \
2355 + @set fnord $$MAKEFLAGS; amf=$$2; \
2357 rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
2358 rev="$$subdir $$rev"; \
2359 diff -urN binutils-2.14.90.0.7.orig/opcodes/alpha-opc.c binutils-2.14.90.0.7/opcodes/alpha-opc.c
2360 --- binutils-2.14.90.0.7.orig/opcodes/alpha-opc.c 2003-01-21 11:21:34.000000000 -0700
2361 +++ binutils-2.14.90.0.7/opcodes/alpha-opc.c 2004-04-20 01:26:11.000000000 -0600
2362 @@ -1105,7 +1105,8 @@
2363 { "wmb", MFC(0x18,0x4400), BASE, ARG_NONE },
2364 { "fetch", MFC(0x18,0x8000), BASE, { ZA, PRB } },
2365 { "fetch_m", MFC(0x18,0xA000), BASE, { ZA, PRB } },
2366 - { "rpcc", MFC(0x18,0xC000), BASE, { RA } },
2367 + { "rpcc", MFC(0x18,0xC000), BASE, { RA, ZB } },
2368 + { "rpcc", MFC(0x18,0xC000), BASE, { RA, RB } }, /* ev6 una */
2369 { "rc", MFC(0x18,0xE000), BASE, { RA } },
2370 { "ecb", MFC(0x18,0xE800), BASE, { ZA, PRB } }, /* ev56 una */
2371 { "rs", MFC(0x18,0xF000), BASE, { RA } },
2372 diff -urN binutils-2.14.90.0.7.orig/opcodes/m68k-opc.c binutils-2.14.90.0.7/opcodes/m68k-opc.c
2373 --- binutils-2.14.90.0.7.orig/opcodes/m68k-opc.c 2003-10-29 10:37:49.000000000 -0700
2374 +++ binutils-2.14.90.0.7/opcodes/m68k-opc.c 2004-04-20 01:26:12.000000000 -0600
2375 @@ -847,15 +847,15 @@
2376 {"fmoved", two(0xF000, 0x7400), two(0xF1C0, 0xFC7F), "IiF7ws", cfloat },
2377 {"fmovel", two(0xF000, 0x4000), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
2378 {"fmovel", two(0xF000, 0x6000), two(0xF1C0, 0xFC7F), "IiF7$l", mfloat },
2379 +/* FIXME: the next two variants should not permit moving an address
2380 + register to anything but the floating point instruction register. */
2381 +{"fmovel", two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8%s", mfloat },
2382 +{"fmovel", two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*ls8", mfloat },
2383 {"fmovel", two(0xF000, 0x4000), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
2384 {"fmovel", two(0xF000, 0x6000), two(0xF1C0, 0xFC7F), "IiF7bs", cfloat },
2385 /* Move the FP control registers */
2386 {"fmovel", two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8ps", cfloat },
2387 {"fmovel", two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Iibss8", cfloat },
2388 -/* FIXME: the next two variants should not permit moving an address
2389 - register to anything but the floating point instruction register. */
2390 -{"fmovel", two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8%s", mfloat },
2391 -{"fmovel", two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*ls8", mfloat },
2392 {"fmovep", two(0xF000, 0x4C00), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
2393 {"fmovep", two(0xF000, 0x6C00), two(0xF1C0, 0xFC00), "IiF7~pkC", mfloat },
2394 {"fmovep", two(0xF000, 0x7C00), two(0xF1C0, 0xFC0F), "IiF7~pDk", mfloat },