This is the mail archive of the mailing list for the binutils 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]

Re: IFUNC question (looking to implement it on MIPS)

From: "Steve Ellcey " <>
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

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