unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [Question] ifunc odering in ELF
@ 2019-09-12 19:03 Juchan Kim
  2019-09-12 19:17 ` Andrew Pinski
  2019-09-17  2:43 ` Florian Weimer
  0 siblings, 2 replies; 8+ messages in thread
From: Juchan Kim @ 2019-09-12 19:03 UTC (permalink / raw)
  To: libc-alpha@sourceware.org

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-10-16 12:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-12 19:03 [Question] ifunc odering in ELF Juchan Kim
2019-09-12 19:17 ` Andrew Pinski
2019-09-17  2:43 ` Florian Weimer
2019-09-17 13:19   ` Juchan Kim
2019-09-17 13:24   ` Adhemerval Zanella
2019-09-20 15:51     ` Florian Weimer
2019-09-20 16:00       ` Szabolcs Nagy
2019-10-16 12:55         ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).