This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
[PATCH] arm: Fix R_ARM_IRELATIVE for REL relocs.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: "libc-ports at sourceware dot org" <libc-ports at sourceware dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Kyle McMartin <kmcmarti at redhat dot com>
- Date: Wed, 28 Aug 2013 00:23:33 -0400
- Subject: [PATCH] arm: Fix R_ARM_IRELATIVE for REL relocs.
- Authentication-results: sourceware.org; auth=none
Joseph,
While running glibc on 32-bit ARM hardware with multiarch enabled,
VFP ABI, but no NEON, almost the entire testsuite fails with
SIGILL.
Debugging shows glibc trying to execute the NEON optimized
routines although no NEON is present and the kernel has indicated
that via the HWCAP.
This is because ARM's dl-machine.h fails to pass dl_hwcap to the
IFUNC resolver function for REL relocs in elf_machine_rel.
The RELA case was fixed by Will Newton here:
http://sourceware.org/ml/libc-ports/2013-07/msg00000.html
Verified by building on ARM with no regressions.
OK to checkin?
ports/Changelog.arm
2013-08-28 Kyle McMartin <kmcmarti@redhat.com>
Carlos O'Donell <carlos@redhat.com>
* sysdeps/arm/dl-machine [!RTLD_BOOTSTRAP] (elf_machine_rel):
Pass GLRO(dl_hwcap) to the IFUNC resolver.
diff --git a/ports/sysdeps/arm/dl-machine.h b/ports/sysdeps/arm/dl-machine.h
index d251527..85dba67 100644
--- a/ports/sysdeps/arm/dl-machine.h
+++ b/ports/sysdeps/arm/dl-machine.h
@@ -503,7 +503,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
break;
case R_ARM_IRELATIVE:
value = map->l_addr + *reloc_addr;
- value = ((Elf32_Addr (*) (void)) value) ();
+ value = ((Elf32_Addr (*) (int)) value) (GLRO(dl_hwcap));
*reloc_addr = value;
break;
#endif
---
Cheers,
Carlos.