]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/binutils/binutils-2.14.90.0.7/600-arm-textrel.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / binutils / binutils-2.14.90.0.7 / 600-arm-textrel.patch
1
2 #
3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
4 #
5
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
8 @@ -54,6 +54,8 @@
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 @@
18    return TRUE;
19  }
20  
21 +/* Find any dynamic relocs that apply to read-only sections.  */
22 +
23 +static bfd_boolean
24 +elf32_arm_readonly_dynrelocs (h, inf)
25 +     struct elf_link_hash_entry *h;
26 +     PTR inf;
27 +{
28 +  struct elf32_arm_link_hash_entry *eh;
29 +  struct elf32_arm_relocs_copied *p;
30 +
31 +  if (h->root.type == bfd_link_hash_warning)
32 +    h = (struct elf_link_hash_entry *) h->root.u.i.link;
33 +
34 +  eh = (struct elf32_arm_link_hash_entry *) h;
35 +  for (p = eh->relocs_copied; p != NULL; p = p->next)
36 +    {
37 +      asection *s = p->section;
38 +
39 +      if (s != NULL && (s->flags & SEC_READONLY) != 0)
40 +       {
41 +         struct bfd_link_info *info = (struct bfd_link_info *) inf;
42 +
43 +         info->flags |= DF_TEXTREL;
44 +
45 +         /* Not an error, just cut short the traversal.  */
46 +         return FALSE;
47 +       }
48 +    }
49 +  return TRUE;
50 +}
51 +
52  /* Set the sizes of the dynamic sections.  */
53  
54  static bfd_boolean
55 @@ -3297,6 +3330,12 @@
56             return FALSE;
57         }
58  
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,
63 +                                (PTR) info);
64 +
65        if ((info->flags & DF_TEXTREL) != 0)
66         {
67           if (!add_dynamic_entry (DT_TEXTREL, 0))