r6929 - in glibc-package/trunk/debian: . patches patches/hppa
Author: aurel32
Date: 2016-01-07 17:16:13 +0000 (Thu, 07 Jan 2016)
New Revision: 6929
Added:
glibc-package/trunk/debian/patches/hppa/submitted-dladdr.diff
Modified:
glibc-package/trunk/debian/changelog
glibc-package/trunk/debian/patches/series
Log:
patches/hppa/submitted-dladdr.diff: new patch from John David Anglin to
fix dladdr issues on hppa. Closes: #810053.
Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2016-01-07 17:03:39 UTC (rev 6928)
+++ glibc-package/trunk/debian/changelog 2016-01-07 17:16:13 UTC (rev 6929)
@@ -10,6 +10,8 @@
Gomes. Closes: #809741.
* patches/hppa/cvs-update-mman.h.diff: new patch from upstream to add huge
pages support on hppa. Closes: #809776.
+ * patches/hppa/submitted-dladdr.diff: new patch from John David Anglin to
+ fix dladdr issues on hppa. Closes: #810053.
[ Samuel Thibault ]
* patches/hurd-i386/cvs-libpthread-sigstate.diff: New patch to fix spurious
Added: glibc-package/trunk/debian/patches/hppa/submitted-dladdr.diff
===================================================================
--- glibc-package/trunk/debian/patches/hppa/submitted-dladdr.diff (rev 0)
+++ glibc-package/trunk/debian/patches/hppa/submitted-dladdr.diff 2016-01-07 17:16:13 UTC (rev 6929)
@@ -0,0 +1,93 @@
+2016-01-02 John David Anglin <danglin@gcc.gnu.org>
+
+ [BZ #19415]
+ * sysdeps/hppa/dl-fptr.c (_dl_fixup): Declare.
+ (elf_machine_resolve): New. Return address of _dl_runtime_resolve.
+ (_dl_lookup_address): Rewrite using function resolver trampoline.
+ * sysdeps/hppa/dl-lookupcfg.h (DL_LOOKUP_ADDRESS): Don't clear bottom
+ two bits in address.
+
+--- a/sysdeps/hppa/dl-fptr.c
++++ b/sysdeps/hppa/dl-fptr.c
+@@ -315,23 +315,54 @@ _dl_unmap (struct link_map *map)
+ map->l_mach.fptr_table = NULL;
+ }
+
++extern ElfW(Addr) _dl_fixup (struct link_map *, ElfW(Word)) attribute_hidden;
+
+-ElfW(Addr)
+-_dl_lookup_address (const void *address)
++static inline Elf32_Addr
++elf_machine_resolve (void)
+ {
+- ElfW(Addr) addr = (ElfW(Addr)) address;
+- struct fdesc_table *t;
+- unsigned long int i;
++ Elf32_Addr addr;
+
+- for (t = local.root; t != NULL; t = t->next)
+- {
+- i = (struct fdesc *) addr - &t->fdesc[0];
+- if (i < t->first_unused && addr == (ElfW(Addr)) &t->fdesc[i])
+- {
+- addr = t->fdesc[i].ip;
+- break;
+- }
+- }
++ asm ("b,l 1f,%0\n"
++" depi 0,31,2,%0\n"
++"1: addil L'_dl_runtime_resolve - ($PIC_pcrel$0 - 8),%0\n"
++" ldo R'_dl_runtime_resolve - ($PIC_pcrel$0 - 12)(%%r1),%0\n"
++ : "=r" (addr) : : "r1");
+
+ return addr;
+ }
++
++ElfW(Addr)
++_dl_lookup_address (const void *address)
++{
++ ElfW(Addr) addr = (ElfW(Addr)) address;
++ unsigned int *desc, *gptr;
++
++ /* Check for special cases. */
++ if ((int) addr == -1
++ || (unsigned int) addr < 4096
++ || !((unsigned int) addr & 2))
++ return addr;
++
++ /* Clear least-significant two bits from descriptor address. */
++ desc = (unsigned int *) ((unsigned int) addr & ~3);
++
++ /* Check if descriptor requires resolution. The following trampoline is
++ used in each global offset table for function resolution:
++
++ ldw 0(r20),r22
++ bv r0(r22)
++ ldw 4(r20),r21
++ tramp: b,l .-12,r20
++ depwi 0,31,2,r20
++ .word _dl_runtime_resolve
++ .word "_dl_runtime_resolve ltp"
++ got: .word _DYNAMIC
++ .word "struct link map address" */
++ gptr = (unsigned int *) desc[0];
++ if (gptr[0] == 0xea9f1fdd /* b,l .-12,r20 */
++ && gptr[1] == 0xd6801c1e /* depwi 0,31,2,r20 */
++ && (ElfW(Addr)) gptr[2] == elf_machine_resolve ())
++ _dl_fixup ((struct link_map *) gptr[5], (ElfW(Word)) desc[1]);
++
++ return (ElfW(Addr)) desc[0];
++}
+--- a/sysdeps/hppa/dl-lookupcfg.h
++++ b/sysdeps/hppa/dl-lookupcfg.h
+@@ -30,9 +30,7 @@
+
+ Elf32_Addr _dl_lookup_address (const void *address);
+
+-/* Clear the bottom two bits so generic code can find the fdesc entry */
+-#define DL_LOOKUP_ADDRESS(addr) \
+- (_dl_lookup_address ((void *)((unsigned long)addr & ~3)))
++#define DL_LOOKUP_ADDRESS(addr) _dl_lookup_address ((const void *) addr)
+
+ void _dl_unmap (struct link_map *map);
+
Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series 2016-01-07 17:03:39 UTC (rev 6928)
+++ glibc-package/trunk/debian/patches/series 2016-01-07 17:16:13 UTC (rev 6929)
@@ -77,6 +77,7 @@
hppa/cvs-inline-syscall-rewrite.diff
hppa/cvs-inline-syscall.diff
hppa/cvs-update-mman.h.diff
+hppa/submitted-dladdr.diff
hurd-i386/local-enable-ldconfig.diff
hurd-i386/tg-context_functions.diff
Reply to: