patches/binutils/2.15/140-arm-textrel.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun May 03 09:50:16 2009 +0000 (2009-05-03)
branchnewlib
changeset 1366 5e5d1e6f55d3
parent 1 eeea35fbf182
permissions -rw-r--r--
Update the newlib devel branch with stuff from /trunk@1498.

-------- diffstat follows --------
/devel/newlib/configure | 336 176 160 0 +++++++------
/devel/newlib/Makefile.in | 12 3 9 0 -
/devel/newlib/scripts/build/kernel/linux.sh | 2 1 1 0
/devel/newlib/scripts/build/internals.sh | 1 0 1 0 -
/devel/newlib/scripts/build/libc/eglibc.sh | 1 0 1 0 -
/devel/newlib/scripts/build/mpfr.sh | 2 1 1 0
/devel/newlib/scripts/functions | 111 5 106 0 ----
/devel/newlib/scripts/config.guess | 7 5 2 0 +
/devel/newlib/scripts/config.sub | 3 2 1 0 +
/devel/newlib/scripts/saveSample.sh.in | 4 2 2 0
/devel/newlib/docs/overview.txt | 8 6 2 0 +
/devel/newlib/samples/armeb-unknown-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/sh4-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/x86_64-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-unknown-elf/crosstool.config | 12 3 9 0 -
/devel/newlib/samples/armeb-unknown-eabi/crosstool.config | 2 0 2 0 -
/devel/newlib/samples/arm-unknown-linux-gnueabi/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/ia64-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/x86_64-unknown-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/armeb-unknown-linux-gnueabi/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc-e500v2-linux-gnuspe/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/i686-nptl-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/mips-unknown-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-iphone-linux-gnueabi/crosstool.config | 8 4 4 0
/devel/newlib/samples/armeb-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc-unknown_nofpu-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/i586-geode-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-unknown-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc-unknown-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/mips-unknown-elf/crosstool.config | 2 0 2 0 -
/devel/newlib/samples/powerpc-405-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/armeb-unknown-linux-uclibcgnueabi/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-unknown-eabi/crosstool.config | 12 3 9 0 -
/devel/newlib/samples/mipsel-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc64-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/alphaev56-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc-860-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/config/kernel/linux.in | 108 2 106 0 ----
/devel/newlib/config/global/ct-behave.in | 22 13 9 0 +
/devel/newlib/config/global/download.in | 210 15 195 0 +-------
/devel/newlib/config/libc/glibc.in | 7 7 0 0 +
/devel/newlib/config/libc/glibc-eglibc.in-common | 15 14 1 0 +
45 files changed, 382 insertions(+), 839 deletions(-)
yann@1
     1
http://sources.redhat.com/ml/binutils/2004-06/msg00010.html
yann@1
     2
--- binutils-2.15.90.0.3-old/bfd/elf32-arm.h	2004-04-12 14:56:33.000000000 -0500
yann@1
     3
+++ binutils-2.15.90.0.3/bfd/elf32-arm.h	2004-09-03 06:56:40.000000000 -0500
yann@1
     4
@@ -87,6 +87,8 @@
yann@1
     5
 #endif
yann@1
     6
 static bfd_boolean allocate_dynrelocs 
yann@1
     7
   PARAMS ((struct elf_link_hash_entry *h, PTR inf));
yann@1
     8
+static bfd_boolean elf32_arm_readonly_dynrelocs
yann@1
     9
+  PARAMS ((struct elf_link_hash_entry *, PTR));
yann@1
    10
 static bfd_boolean create_got_section 
yann@1
    11
   PARAMS ((bfd * dynobj, struct bfd_link_info * info));
yann@1
    12
 static bfd_boolean elf32_arm_create_dynamic_sections 
yann@1
    13
@@ -3531,6 +3533,37 @@
yann@1
    14
   return TRUE;
yann@1
    15
 }
yann@1
    16
 
yann@1
    17
+/* Find any dynamic relocs that apply to read-only sections.  */
yann@1
    18
+
yann@1
    19
+static bfd_boolean
yann@1
    20
+elf32_arm_readonly_dynrelocs (h, inf)
yann@1
    21
+     struct elf_link_hash_entry *h;
yann@1
    22
+     PTR inf;
yann@1
    23
+{
yann@1
    24
+  struct elf32_arm_link_hash_entry *eh;
yann@1
    25
+  struct elf32_arm_relocs_copied *p;
yann@1
    26
+
yann@1
    27
+  if (h->root.type == bfd_link_hash_warning)
yann@1
    28
+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
yann@1
    29
+
yann@1
    30
+  eh = (struct elf32_arm_link_hash_entry *) h;
yann@1
    31
+  for (p = eh->relocs_copied; p != NULL; p = p->next)
yann@1
    32
+    {
yann@1
    33
+      asection *s = p->section;
yann@1
    34
+
yann@1
    35
+      if (s != NULL && (s->flags & SEC_READONLY) != 0)
yann@1
    36
+       {
yann@1
    37
+         struct bfd_link_info *info = (struct bfd_link_info *) inf;
yann@1
    38
+
yann@1
    39
+         info->flags |= DF_TEXTREL;
yann@1
    40
+
yann@1
    41
+         /* Not an error, just cut short the traversal.  */
yann@1
    42
+         return FALSE;
yann@1
    43
+       }
yann@1
    44
+    }
yann@1
    45
+  return TRUE;
yann@1
    46
+}
yann@1
    47
+
yann@1
    48
 /* Set the sizes of the dynamic sections.  */
yann@1
    49
 
yann@1
    50
 static bfd_boolean
yann@1
    51
@@ -3740,6 +3773,12 @@
yann@1
    52
 	    return FALSE;
yann@1
    53
 	}
yann@1
    54
 
yann@1
    55
+      /* If any dynamic relocs apply to a read-only section,
yann@1
    56
+         then we need a DT_TEXTREL entry.  */
yann@1
    57
+      if ((info->flags & DF_TEXTREL) == 0)
yann@1
    58
+        elf_link_hash_traverse (&htab->root, elf32_arm_readonly_dynrelocs,
yann@1
    59
+                                (PTR) info);
yann@1
    60
+
yann@1
    61
       if ((info->flags & DF_TEXTREL) != 0)
yann@1
    62
 	{
yann@1
    63
 	  if (!add_dynamic_entry (DT_TEXTREL, 0))