0

I used objdump -t on the debug-info file of a program to find the address ranges of each function. There are a few functions the bounds of which can not be determined using this method. Because objdump reports 0 for their sizes. These symbols are shown, below:

deregister_tm_clones 0000000000197ce0
register_tm_clones 0000000000197d20
__do_global_dtors_aux 0000000000197d70
frame_dummy 0000000000197db0
_fini 00000000004e9474
_init 00000000001889e8

How can I determine their sizes? I can only imagine using GDB disas command on the start address and find the end of the disassembly for the function. This may not work in all cases. What is the standard approach?


UPDATE:

I am implementing a Pintool to generate callstacks at runtime. I only need symbols in certain binaries. In other words, I need a subset of functions (e.g., those in the GTK library) to be included in the callstack. Therefore, at runtime, I will need the ranges for these libraries.

On the other hand, I need the ranges for the symbols to find their outgoing jumps. This is a sign of tail-call elimination, which necessitates stack updates.

TheAhmad
  • 810
  • 1
  • 9
  • 21
  • 1
    "What is the standard approach?" -- there isn't one. Why do you care about the sizes of these symbols? – Employed Russian May 21 '20 at 02:23
  • I am writing a `Pintool` that generates the backtrace for a subset of the binaries in the runtime stack. These are some of those that should be included in the generated stack. – TheAhmad May 21 '20 at 02:53
  • "generates the backtrace for a subset of the binaries in the runtime stack" -- I think you mean "for a subset of functions" (or else I have no idea what you said). I still don't get what symbol sizes have to do with backtrace. Please edit your question with a more detailed explanation of _why_ you need symbol sizes at all, and why you need symbol sizes for these particular symbols. – Employed Russian May 21 '20 at 02:59

0 Answers0