patches/eglibc/2_16/003-mips-rld-map-check.patch
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Fri Sep 21 16:10:34 2012 +0200 (2012-09-21)
changeset 3054 e978441f521c
permissions -rw-r--r--
cc/gcc: update Linaro GCC revisions to 2012.09

Update Linaro GCC with the latest available revisions.

Signed-off-by: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Message-Id: <cd97309e8b617d7d729e.1348236736@advdt005-ubuntu>
PatchWork-ID: 185741
f@3052
     1
f@3052
     2
On mips target, binutils currently sets DT_MIPS_RLD_MAP to 0 in dynamic
f@3052
     3
section if a --version-script sets _RLD_MAP to local. This is apparently
f@3052
     4
a binutils bug, but libc shouldn't segfault in this case.
f@3052
     5
f@3052
     6
see also: http://sourceware.org/bugilla/show_bug.cgi?id=11615
f@3052
     7
f@3052
     8
Upstream-Status: Pending
f@3052
     9
f@3052
    10
9/19/2010 - added by Qing He <qing.he@intel.com>
f@3052
    11
f@3052
    12
f@3052
    13
---
f@3052
    14
diff -ru glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h glibc-2.10.1/ports/sysdeps/mips/dl-machine.h
f@3052
    15
--- glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h	2009-05-16 16:36:20.000000000 +0800
f@3052
    16
+++ glibc-2.10.1/ports/sysdeps/mips/dl-machine.h	2010-09-19 09:11:53.000000000 +0800
f@3052
    17
@@ -70,7 +70,8 @@
f@3052
    18
 /* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill it in
f@3052
    19
    with the run-time address of the r_debug structure  */
f@3052
    20
 #define ELF_MACHINE_DEBUG_SETUP(l,r) \
f@3052
    21
-do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
f@3052
    22
+do { if ((l)->l_info[DT_MIPS (RLD_MAP)] && \
f@3052
    23
+         (l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) \
f@3052
    24
        *(ElfW(Addr) *)((l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) = \
f@3052
    25
        (ElfW(Addr)) (r); \
f@3052
    26
    } while (0)