This is the mail archive of the binutils@sourceware.org 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]

Preliminary prelink IFUNC support (x86-64 only so far), some binutils IFUNC issues


Hi!

I've started working on prelink STT_GNU_IFUNC and R_*_IRELATIVE
support.  With the attached glibc and prelink patches (both against
respective trunks) x86-64 prelnk make check passes.

But I've discovered two issues, likely on the binutils side.

On the attached ifunctest.c gcc -O2 -o ifunctest{,.c} compiles/links, but
no R_*_IRELATIVE relocation is emitted and not surprisingly it crashes
at runtime.  Prelink testsuite contains similar testcase, just using
.globl or .globl/.hidden, instead of .local.  I'd say .local @gnu_indirect_function
symbols should be supported as well.

The other issue can be seen with:
gcc -O2 -fpic -shared -o ifunc3lib1.{so,c}
gcc -O2 -o ifunc3 ./ifunc3lib1.so
./ifunc3lib1
Here, &lib1t3 in the binary resolves to a .plt slot in the binary, while
&lib1t3 in the shared library resolves to the actual address the ifunc
returned.
Not sure what exactly we want to do here, but the function pointers should
be the same.

	Jakub

Attachment: libc6
Description: Text document

Attachment: prel6
Description: Text document

Attachment: ifunc.h
Description: Text document

Attachment: ifunc3lib1.c
Description: Text document

Attachment: ifunc3.c
Description: Text document

Attachment: ifunctest.c
Description: Text document


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