]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
libsframe: correct binary search for SFrame FDE
authorJens Remus <jremus@linux.ibm.com>
Mon, 26 May 2025 18:01:14 +0000 (11:01 -0700)
committerIndu Bhagat <indu.bhagat@oracle.com>
Mon, 26 May 2025 18:01:14 +0000 (11:01 -0700)
commit9d2a24349e23afe3ee5e6ac093ffca3901d39bc5
treec0daafacc35a4dd53487f2081ebd369e3dfaf9b2
parentf0d72d35080f77c4e96f5636065df9516e20eb8d
libsframe: correct binary search for SFrame FDE

sframe_get_funcdesc_with_addr_internal erroneously returns the last FDE,
if its function start address is lower than the searched for address.

Simplify the binary search for a SFrame FDE for a given address.  Only
return an FDE, if the searched for address is within the bounds of the
FDE function start address and function size.

libsframe/
* sframe.c (sframe_get_funcdesc_with_addr_internal): Correct
binary search for SFrame FDE.

libsframe/testsuite/
* libsframe.find/plt-findfre-1.c: Add test for out of range
PLT6.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
libsframe/sframe.c
libsframe/testsuite/libsframe.find/plt-findfre-1.c