From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5880 invoked by alias); 14 Feb 2010 21:43:25 -0000 Received: (qmail 5871 invoked by uid 22791); 14 Feb 2010 21:43:24 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 14 Feb 2010 21:43:11 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id o1ELgaQM023875; Sun, 14 Feb 2010 22:42:36 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id o1ELgUYd007120; Sun, 14 Feb 2010 22:42:30 +0100 (CET) Date: Sun, 14 Feb 2010 21:43:00 -0000 Message-Id: <201002142142.o1ELgUYd007120@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: jan.kratochvil@redhat.com CC: gdb-patches@sourceware.org In-reply-to: <20100214203512.GA838@host0.dyn.jankratochvil.net> (message from Jan Kratochvil on Sun, 14 Feb 2010 21:35:12 +0100) Subject: Re: [patch] STT_GNU_IFUNC support References: <20100214203512.GA838@host0.dyn.jankratochvil.net> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-02/txt/msg00355.txt.bz2 > Date: Sun, 14 Feb 2010 21:35:12 +0100 > From: Jan Kratochvil > > STT_GNU_IFUNC is defined in OS-specific range: > > #define STT_LOOS 10 /* OS-specific semantics */ > #define STT_GNU_IFUNC 10 /* Symbol is an indirect code object */ > #define STT_HIOS 12 /* OS-specific semantics */ > > ... > > Due to the function descriptors similarity I had to hook it into the OSABI > framework which does not support any inheritance. Single OSABI is chosen. > gnu-ifunc is only OS-dependent (GNU) and not arch dependent, though. > Therefore gnu-ifunc had to be hooked into all the OS-ARCH combinations where > the GNU OS gets installed as OSABI (=> *-linux-tdep.c). While the symbol may be in the OS-specific range it is actually more toolchain dependent than OS-dependent. Unless I'm missing something, all OS'es that use binutils as their toolchain will support STT_GNU_IFUNC. In particular, I expect the various BSD's to eventually support this too, and I found a Google groups discussion that said that while Sun^H^H^Oracle has no immediate plans to support this extension, they may eventually do and will reserve the slot occupied by STT_GNU_IFUNC in the STT_LOOS-STT_HIOS range. This has happened before with GNU extensions. OpenBSD/sh supports some GNU-specific ELF relocations and I personally added support for PT_GNU_EH_FRAME to OpenBSD to make DWARF-based exception handling work on several OpenBSD platforms. So I think you should move the gnu-ifunc support code out of linux-tdep.c into a more generic file. And perhaps we should consider enabling support for it on all supported ELF platforms. Given that Sun is aware of STT_GNU_IFUNC, I don't think there is a serious risk of another OS vendor using the value occupied by STT_GNU_IFUNC for a different purpose.