This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] arm: Fix R_ARM_IRELATIVE for REL relocs.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]