This is the mail archive of the
mailing list for the binutils project.
Re: IFUNC question (looking to implement it on MIPS)
- From: David Miller <davem at davemloft dot net>
- To: sellcey at mips dot com
- Cc: binutils at sourceware dot org
- Date: Mon, 07 Jan 2013 15:53:51 -0800 (PST)
- Subject: Re: IFUNC question (looking to implement it on MIPS)
- References: <57ca6e82-e9cf-436d-bef5-720f27bc4140@EXCHHUB01.MIPS.com>
From: "Steve Ellcey " <email@example.com>
Date: Mon, 7 Jan 2013 15:34:29 -0800
> With all the MIPS variations out there it seems like having the IFUNC
> functionality available on MIPS would be very useful. Before doing a
> bunch of work in this space I wanted to see if anyone has already looked
> at this. It looks like most of the work is in binutils (bfd and gold
> seem to have the most target specific ifunc changes). It doesn't look
> like GCC needs much in the way of changes. I guess some work in glibc
> for the dynamic linker may be needed too.
I don't know what MIPS on GCC/binutils does currently, but one aspect
of IFUNC support that is nearly essential is the usage of GOT relative
relocations in the final binary for "local" symbols.
Usually this is done using a combination of GCC code generation and
link time relaxation. GCC should emit the potentially GOT relative
sequences even for global symbols, so that the linker can optimize
the cases where the symbols are, for example, marked hidden.
So when the linker sees that the symbol is absolutely local to the
final link, it can transform the load from the GOT into an addition
and get rid of the GOT relocation (and even the GOT slot itself).
On sparc special relocations were added to facilitate this, see