3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
6 --- binutils-2.14.90.0.7/bfd/elf32-arm.h~600-arm-textrel 2004-09-08 12:55:41.000000000 -0500
7 +++ binutils-2.14.90.0.7/bfd/elf32-arm.h 2004-09-08 12:57:37.000000000 -0500
9 static int elf32_thumb_to_arm_stub
10 PARAMS ((struct bfd_link_info *, const char *, bfd *, bfd *, asection *,
11 bfd_byte *, asection *, bfd_vma, bfd_signed_vma, bfd_vma));
12 +static bfd_boolean elf32_arm_readonly_dynrelocs
13 + PARAMS ((struct elf_link_hash_entry *, PTR));
14 static bfd_boolean elf32_arm_relocate_section
15 PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
16 Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
17 @@ -3139,6 +3141,37 @@
21 +/* Find any dynamic relocs that apply to read-only sections. */
24 +elf32_arm_readonly_dynrelocs (h, inf)
25 + struct elf_link_hash_entry *h;
28 + struct elf32_arm_link_hash_entry *eh;
29 + struct elf32_arm_relocs_copied *p;
31 + if (h->root.type == bfd_link_hash_warning)
32 + h = (struct elf_link_hash_entry *) h->root.u.i.link;
34 + eh = (struct elf32_arm_link_hash_entry *) h;
35 + for (p = eh->relocs_copied; p != NULL; p = p->next)
37 + asection *s = p->section;
39 + if (s != NULL && (s->flags & SEC_READONLY) != 0)
41 + struct bfd_link_info *info = (struct bfd_link_info *) inf;
43 + info->flags |= DF_TEXTREL;
45 + /* Not an error, just cut short the traversal. */
52 /* Set the sizes of the dynamic sections. */
55 @@ -3297,6 +3330,12 @@
59 + /* If any dynamic relocs apply to a read-only section,
60 + then we need a DT_TEXTREL entry. */
61 + if ((info->flags & DF_TEXTREL) == 0)
62 + elf_link_hash_traverse (&htab->root, elf32_arm_readonly_dynrelocs,
65 if ((info->flags & DF_TEXTREL) != 0)
67 if (!add_dynamic_entry (DT_TEXTREL, 0))