f@3052: f@3052: On mips target, binutils currently sets DT_MIPS_RLD_MAP to 0 in dynamic f@3052: section if a --version-script sets _RLD_MAP to local. This is apparently f@3052: a binutils bug, but libc shouldn't segfault in this case. f@3052: f@3052: see also: http://sourceware.org/bugilla/show_bug.cgi?id=11615 f@3052: f@3052: Upstream-Status: Pending f@3052: f@3052: 9/19/2010 - added by Qing He f@3052: f@3052: f@3052: --- f@3052: 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: --- glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h 2009-05-16 16:36:20.000000000 +0800 f@3052: +++ glibc-2.10.1/ports/sysdeps/mips/dl-machine.h 2010-09-19 09:11:53.000000000 +0800 f@3052: @@ -70,7 +70,8 @@ f@3052: /* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill it in f@3052: with the run-time address of the r_debug structure */ f@3052: #define ELF_MACHINE_DEBUG_SETUP(l,r) \ f@3052: -do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \ f@3052: +do { if ((l)->l_info[DT_MIPS (RLD_MAP)] && \ f@3052: + (l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) \ f@3052: *(ElfW(Addr) *)((l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) = \ f@3052: (ElfW(Addr)) (r); \ f@3052: } while (0)