在 elf 二进制文件中查找所有函数定义的方法

Ways to find all function definitions in a elf binary

假设我有一个库 xxx.so。所以我通过以下方式获取所有函数名称和参数 以下命令:

readelf -Ws xxx.so  |c++filt 

它会输出如下:

  711: 00270209    40 FUNC    GLOBAL DEFAULT    8 debug_c_tree
  7712: 00270231   128 FUNC    GLOBAL DEFAULT    8 pp_c_tree_decl_identifier
  7713: 00270723    90 FUNC    GLOBAL DEFAULT    8 pp_c_init_declarator
  7714: 002f546c     0 NOTYPE  GLOBAL DEFAULT  ABS _edata
  7715: 002f546c     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start
  7716: 002fc9e1     0 NOTYPE  GLOBAL DEFAULT  ABS _end

但是我怎样才能像下面这样在 elf 二进制文件中轻松转储所有函数体:

debug_c_tree() 
{
  mov eax, edx;
  ....
  ....
}

....

how can I easily dump all function body

objdump -d xxx.so
objdump -D -z ELFfileName

这将反汇编整个文件,包括所有部分以及 space 函数之间。