lllllllllllll
lllllllllllll

Reputation: 9110

How to get user defined function range (begin and end address) in elf file?

I know we can get the user defined function's begin address in elf by reading symbol table, just like below, function main and foo:

08048330 T _start
0804a014 b completed.6159
0804a00c W data_start
0804a018 b dtor_idx.6161
080483e4 T foo
080483c0 t frame_dummy
080483ee T main

but how to get the end address of certain functions?

Could anyone give me some help? Thank you!

Upvotes: 3

Views: 1650

Answers (1)

tristan
tristan

Reputation: 4322

nm -S a.out will show the symbol size (if available). Then you can get the 'end address' from the start address and size.

Upvotes: 5

Related Questions