similar to Mikels answer but using a different tool that (may) give you a cleaner output.
In the past I've had the pleasure of working on a debug information analyzer tool called DIVA. It's free and open source and you can find it here:
https://github.com/SNSystems/DIVA
Whilst it's not possible with DIVA to find what object files were linked to produce your executable, you can use it to find out the compile units.
I quickly threw together a small example as follows
a.cpp
int a() {
return 1;
}
a.h
int a();
b.cpp
int b() {
return 2;
}
b.h
int b();
c.cpp
#include "a.h"
#include "b.h"
int main() {
return a + b;
}
Compiled them with clang using the following options
$ clang a.cpp b.cpp c.cpp -o test.elf -g -O0
run DIVA on test.elf with the following options:
$ diva --show-none test.elf
Which should produce the following output
{InputFile} "test.elf"
{CompileUnit} "a.cpp"
{CompileUnit} "b.cpp"
{CompileUnit} "c.cpp"