ARM: Pass dl_hwcap to IFUNC resolver functions.

Message ID 51D2B314.4040109@linaro.org
State Accepted
Headers show

Commit Message

Will Newton July 2, 2013, 11:01 a.m.
elf_ifunc_invoke passes dl_hwcap to IFUNC resolvers, so we should
do the same when fixing up R_ARM_IRELATIVE relocs in elf_machine_rela.

ports/ChangeLog.arm:

2013-07-02  Will Newton  <will.newton@linaro.org>

	* sysdeps/arm/dl-machine.h (elf_machine_rela): Pass dl_hwcap
	to IFUNC resolver functions.
---
 ports/sysdeps/arm/dl-machine.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joseph Myers July 2, 2013, 1:01 p.m. | #1
On Tue, 2 Jul 2013, Will Newton wrote:

> elf_ifunc_invoke passes dl_hwcap to IFUNC resolvers, so we should
> do the same when fixing up R_ARM_IRELATIVE relocs in elf_machine_rela.
> 
> ports/ChangeLog.arm:
> 
> 2013-07-02  Will Newton  <will.newton@linaro.org>
> 
> 	* sysdeps/arm/dl-machine.h (elf_machine_rela): Pass dl_hwcap
> 	to IFUNC resolver functions.

Thanks, committed.

Patch

diff --git a/ports/sysdeps/arm/dl-machine.h b/ports/sysdeps/arm/dl-machine.h
index 4cf87a9..d251527 100644
--- a/ports/sysdeps/arm/dl-machine.h
+++ b/ports/sysdeps/arm/dl-machine.h
@@ -595,7 +595,7 @@  elf_machine_rela (struct link_map *map, const Elf32_Rela *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