This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

[Question] ifunc odering in ELF


Hello,

My name is Juchan Kim and working for QNX.
I'm writing this to ask a question regarding IFUNC.

We get a segmentation fault and here is the scenario.

We have two ifuncs foo1 and foo2 in our library

foo1 has foo1_resolver() 
foo2 has foo2_resolver()


foo1_resolver() {
	...
}

foo2_resolver() {
	foo1()
	...
}

As you can see foo2_reoslver calls foo1() inside and this is the order
in ELF
000000010fc0  000000000408 R_AARCH64_IRELATI         ac4 // foo2()
000000010fc8  000000000408 R_AARCH64_IRELATI         aec // foo1() 

When the library is loaded in our dynamic linker, it resolves foo2()
first by running foo2_resolver(), but since foo1() is not reoslvered at
that time, we get a segfault.

We can resolve it by modifying the library, but I'm looking for ways on
ELF or ld sides.

What I mean is that...
Is there any way to re-order R_AARCH64_IRELATI by dependencies using
link scrpit or 'ld'?

or I would appreiciate if you have other suggestions

Thanks,
Juchan Kim

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