HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: determine C objects
Operating System - HP-UX
1826499
Members
1640
Online
109692
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2003 12:24 PM
09-19-2003 12:24 PM
determine C objects
hello all! I want to determine the C source files that I compiled an executable with.
example:
gcc -o example main1.c sub1.c sub2.c
so I get an example exe.
Problem:
Given only the executable and not knowing which files it was compiled with. Is it possible to determine the *.c files he/she used to compile the executable?
any help is much appreciated. thanks! :)
example:
gcc -o example main1.c sub1.c sub2.c
so I get an example exe.
Problem:
Given only the executable and not knowing which files it was compiled with. Is it possible to determine the *.c files he/she used to compile the executable?
any help is much appreciated. thanks! :)
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2003 04:35 AM
09-22-2003 04:35 AM
Re: determine C objects
if hp cc/aCC has been used, the following commands can help with unstripped binaries:
"odump -compunit" for 32-bit SOM binaries & "elfdump -dc" for 64-bit ELF binraies.
--
ranga
[i work for hpe]
"odump -compunit" for 32-bit SOM binaries & "elfdump -dc" for 64-bit ELF binraies.
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2004 09:17 AM
01-20-2004 09:17 AM
Re: determine C objects
It's possible if you are a little bit creative with the way you create your source files.
Add the line:
static char ident[]="@(#)foo.c";
At the top of your source file. That way, when you compile it into an object file, that string "@(#)foo.c" will be embedded within your object file, and the resulting executable. Then you can use the "what" command to extract the information from your object.
# cc -o foo foo1.c foo2.c
# what foo
foo:
$Revision: 92453-07 linker linker crt0.o B.11.33 020617 $
foo1.c
foo2.c
Hope this helps.
Add the line:
static char ident[]="@(#)foo.c";
At the top of your source file. That way, when you compile it into an object file, that string "@(#)foo.c" will be embedded within your object file, and the resulting executable. Then you can use the "what" command to extract the information from your object.
# cc -o foo foo1.c foo2.c
# what foo
foo:
$Revision: 92453-07 linker linker crt0.o B.11.33 020617 $
foo1.c
foo2.c
Hope this helps.
I think, therefore I am... I think!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP