I speak strictly from run-time: when the gcc tries to find the fde for
a text segment, the __builtin_return_address() corresponds to the
run-time (memory) address of a text segment, but the fdes contain the
link-time addresses of the text segments in run-time.
In other words when the binary_search_unencoded_fdes() function is
called, its pc parameter is a desired run-time memory address of a
text segment in the memory (0x2344eca7), but the
ob->u.sort->array[i]->pc_begin items are link-time addresses between
the range 0x400000-0x500000. Obviously, comparing link-time addresses
with run-time addresses will never match. The relationship between
address in the memory and during link-time:
link-time address = (run-time) address in the memory - gp register value + _gp.
Ok, so now the question is: why the fdes do not contain run-time
addresses of the text segments in run-time?