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

2
  • 2
    try -s option from readelf, that would give you some idea on what files could be included.. Commented Dec 1, 2016 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. Commented Dec 1, 2016 at 16:48

1 Answer 1

1

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

SUGGESTIONS:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.