Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Impacted execuatable for given function

Status
Not open for further replies.

amarg

Programmer
Nov 19, 2002
106
0
0
IN
Hi All,

I am looking for some smart way to find all the exe's names for the given local function.

We are having thousands of C and Cobol files, and out of this we are creating 100's of exes. Now if I change any one of the function, I want to know which exe is going to be impacted. One fuction written in some file can be called from lot other places, and create seperate exes.

Thanks,
Amar

 
Which operating system / compiler are you using?

Here's one example that can get the symbol names from compiled programs.
Code:
$ cat foo.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main ( ) {
  signed char a = -64;
  printf("%x\n",a);
  if ( a == 0xc0 ) {
    printf("Maybe\n");
  }
  if ( (unsigned char)a == 0xc0 ) {
    printf("Yes\n");
  }
  return 0;
}
$ gcc foo.c
$ nm -g ./a.out 
0804851c R _IO_stdin_used
         w _Jv_RegisterClasses
08049f18 D __DTOR_END__
0804a018 A __bss_start
0804a010 D __data_start
0804a014 D __dso_handle
         w __gmon_start__
080484ca T __i686.get_pc_thunk.bx
08048460 T __libc_csu_fini
08048470 T __libc_csu_init
         U __libc_start_main@@GLIBC_2.0
0804a018 A _edata
0804a020 A _end
080484fc T _fini
08048518 R _fp_hw
080482e0 T _init
08048360 T _start
0804a010 W data_start
08048414 T main
         U printf@@GLIBC_2.0
         U puts@@GLIBC_2.0

--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
 
I am using HP-UX cc compilier. But I thing nm -g will work there too. Let me try..
 
Strictly speaking, it's impossible to detect local functions in executable modules (if you have not project files, or makefiles, or module map files). As usually no such names in modules produced by a linker.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top