public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: "Carlos O'Donell" <carlos@redhat.com>
To: "libc-ports@sourceware.org" <libc-ports@sourceware.org>,
	       "Joseph S. Myers" <joseph@codesourcery.com>
Cc: Kyle McMartin <kmcmarti@redhat.com>
Subject: [PATCH] arm: Fix R_ARM_IRELATIVE for REL relocs.
Date: Wed, 28 Aug 2013 04:23:00 -0000	[thread overview]
Message-ID: <521D7B45.5040604@redhat.com> (raw)

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.

             reply	other threads:[~2013-08-28  4:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28  4:23 Carlos O'Donell [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=521D7B45.5040604@redhat.com \
    --to=carlos@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=kmcmarti@redhat.com \
    --cc=libc-ports@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).