Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8460237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:33:03+00:00 2026-06-10T13:33:03+00:00

I am building a project that builds multiple shared libraries and executable files. All

  • 0

I am building a project that builds multiple shared libraries and executable files. All the source files that are used to build these binaries are in a single /src directory. So it is not obvious to figure out which source files were used to build each of the binaries (there is many-to-many relation).

My goal is to write a script that would parse a set of C files for each binary and make sure that only the right functions are called from them.

One option seems to be to try to extract this information from Makefile. But this does not work well with generated files and headers (due to dependence on Includes).

Another option could be to simply browse call graphs, but this would get complicated, because a lot of functions are called by using function pointers.

Any other ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:33:04+00:00Added an answer on June 10, 2026 at 1:33 pm

    You can first compile your project with debug information (gcc -g) and use objdump to get which source files were included.

    objdump -W <some_compiled_binary>
    

    Dwarf format should contain the information you are looking for.

     <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
        < c>   DW_AT_producer    : (indirect string, offset: 0x5f): GNU C 4.4.3 
        <10>   DW_AT_language    : 1    (ANSI C)
        <11>   DW_AT_name        : (indirect string, offset: 0x28): test_3.c    
        <15>   DW_AT_comp_dir    : (indirect string, offset: 0x36): /home/auselen/trials    
        <19>   DW_AT_low_pc      : 0x82f0   
        <1d>   DW_AT_high_pc     : 0x8408   
        <21>   DW_AT_stmt_list   : 0x0  
    

    In this example, I’ve compiled object file from test_3, and it was located in …/trials directory. Then of course you need to write some script around this to collect related source file names.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project with multiple modules, including on that is responsible for building
I've got a project managed by CMake with multiple libraries that have link time
I have a directory of source files (.h and .m) that are shared between
I have a project that builds fine If I build it manually but it
I've already got a NAnt build script that builds/runs tests/zips web project together, etc.
I'm developing a project that includes multiple static libraries. The way in which I
I am building a cmake project that includes cuda code. I am unable to
I have an ARM project that I'm building with make. I'm creating the list
I'm currently working on a project that is building a java-based desktop application to
I'm going to start a new project that's building web apps from scratch. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.