public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] arm: Fix R_ARM_IRELATIVE for REL relocs.
@ 2013-08-28  4:23 Carlos O'Donell
  2013-08-28 16:14 ` Joseph S. Myers
  0 siblings, 1 reply; 8+ messages in thread
From: Carlos O'Donell @ 2013-08-28  4:23 UTC (permalink / raw)
  To: libc-ports, Joseph S. Myers; +Cc: Kyle McMartin

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-08-29 19:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-28  4:23 [PATCH] arm: Fix R_ARM_IRELATIVE for REL relocs Carlos O'Donell
2013-08-28 16:14 ` Joseph S. Myers
2013-08-29  4:17   ` Carlos O'Donell
2013-08-29 10:00     ` Will Newton
2013-08-29 12:25       ` Joseph S. Myers
2013-08-29 19:18         ` Will Newton
2013-08-29 12:24     ` Joseph S. Myers
2013-08-29 19:27     ` Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).