0

For a C/C++ shared library (.so file), how to check all the names of headers and sources that are included in it?

I tried compile the shared library with -g option, and use readelf -Wl, but I can only get something like:

Elf file type is DYN (Shared object file)

Entry point 0x560

There are 7 program headers, starting at offset 64

Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align

LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x000754 0x000754 R E 0x200000

LOAD 0x000e70 0x0000000000200e70 0x0000000000200e70 0x0001b0 0x0001b8 RW 0x200000

DYNAMIC 0x000e88 0x0000000000200e88 0x0000000000200e88 0x000150 0x000150 RW 0x8

NOTE 0x0001c8 0x00000000000001c8 0x00000000000001c8 0x000024 0x000024 R 0x4

GNU_EH_FRAME 0x0006a8 0x00000000000006a8 0x00000000000006a8 0x000024 0x000024 R 0x4

GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x10

GNU_RELRO 0x000e70 0x0000000000200e70 0x0000000000200e70 0x000190 0x000190 R 0x1

Section to Segment mapping:

Segment Sections... 00 .note.gnu.build-id .gnu.hash .dynsym .dynstr .rela.dyn .init .plt .plt.got .text .fini .eh_frame_hdr .eh_frame

01 .init_array .fini_array .jcr .dynamic .got .got.plt .data .bss

02 .dynamic

03 .note.gnu.build-id

04 .eh_frame_hdr

05

06 .init_array .fini_array .jcr .dynamic .got

too honest for this site
  • 12,050
  • 4
  • 30
  • 52
bagebb
  • 221
  • 1
  • 2
  • 8
  • 2
    try -s option from readelf, that would give you some idea on what files could be included.. – Prabhakar Lad Dec 01 '16 at 16:35
  • There is no language C/C++. And libraries are binaries, they are neither C nor C++. They neither include headers (which are source code files, too) nor other sources. It is not clear what you want to accomplish. – too honest for this site Dec 01 '16 at 16:48

1 Answers1

1

Your .so won't necessarily even have any of this information unless it was explicitly compiled with "-G".

SUGGESTIONS:

Community
  • 1
  • 1
paulsm4
  • 114,292
  • 17
  • 138
  • 190