readelf 를 통 해 동적 라 이브 러 리 의 내용 보기

readelf 는 유 닉 스 에서 라 이브 러 리 에 연 결 된 내용 을 보 는 도구 입 니 다.elf:Executable and Linkable Format
mac 의 설치 및 사용 방법:
1, 다운로드 binutils - 2.24. tar. gz
2. 스트레스 해소
3. 설치 (disable - wror 를 사용 하 는 것 은 mac 에서 make 가 통과 하지 못 하 는 것 을 방지 하기 위해 서 입 니 다. 참고http://stackoverflow.com/questions/20426213/error-building-ellcc)
./configure --disable-werror
make
make install

4. 실행 가능 한 파일 에 연 결 된 내용 보기:
➜  assets  readelf -Ws your_executable_file

Symbol table '.dynsym' contains 162 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 00000000     0 FUNC    GLOBAL DEFAULT  UND __libc_init
     2: 00000000     0 FUNC    GLOBAL DEFAULT  UND __cxa_atexit
     3: 00000000     0 FUNC    GLOBAL DEFAULT  UND __android_log_print
     4: 00000000     0 FUNC    GLOBAL DEFAULT  UND gettimeofday
     5: 00000000     0 FUNC    GLOBAL DEFAULT  UND access
     6: 0001196c     0 FUNC    GLOBAL DEFAULT  UND malloc
     7: 00000000     0 FUNC    GLOBAL DEFAULT  UND exit
     8: 00000000     0 FUNC    GLOBAL DEFAULT  UND inotify_init
     9: 00000000     0 FUNC    GLOBAL DEFAULT  UND inotify_add_watch
    10: 00000000     0 FUNC    GLOBAL DEFAULT  UND read
    11: 00000000     0 FUNC    GLOBAL DEFAULT  UND system
    12: 00000000     0 FUNC    GLOBAL DEFAULT  UND pthread_create
    13: 00000000     0 FUNC    GLOBAL DEFAULT  UND usleep
    14: 00000000     0 FUNC    GLOBAL DEFAULT  UND fopen
    15: 000119d8     0 FUNC    GLOBAL DEFAULT  UND free
    16: 00000000     0 FUNC    GLOBAL DEFAULT  UND time
    17: 00000000     0 FUNC    GLOBAL DEFAULT  UND localtime
    18: 00000000     0 FUNC    GLOBAL DEFAULT  UND asctime
    19: 00000000     0 FUNC    GLOBAL DEFAULT  UND fprintf
    20: 00000000     0 FUNC    GLOBAL DEFAULT  UND fclose
    21: 00000000     0 FUNC    GLOBAL DEFAULT  UND strcpy
    22: 00000000     0 FUNC    GLOBAL DEFAULT  UND strcat
    23: 00000000     0 FUNC    GLOBAL DEFAULT  UND snprintf
    24: 00000000     0 FUNC    GLOBAL DEFAULT  UND inotify_rm_watch
    25: 00000000     0 FUNC    GLOBAL DEFAULT  UND close
    26: 00000000     0 FUNC    GLOBAL DEFAULT  UND __stack_chk_fail
    27: 00000000     0 OBJECT  GLOBAL DEFAULT  UND __stack_chk_guard
    28: 00000000     0 FUNC    GLOBAL DEFAULT  UND fstat
    29: 00000000     0 FUNC    GLOBAL DEFAULT  UND lseek
    30: 00000000     0 FUNC    GLOBAL DEFAULT  UND open
    31: 00000000     0 FUNC    GLOBAL DEFAULT  UND strchr
    32: 00000000     0 FUNC    GLOBAL DEFAULT  UND fwrite
    33: 00000000     0 FUNC    GLOBAL DEFAULT  UND strtoll
    34: 00000000     0 FUNC    GLOBAL DEFAULT  UND isspace
    35: 00000000     0 FUNC    GLOBAL DEFAULT  UND strlen
    36: 00000000     0 FUNC    GLOBAL DEFAULT  UND inet_ntop
    37: 00000000     0 FUNC    GLOBAL DEFAULT  UND tolower
    38: 00000000     0 FUNC    GLOBAL DEFAULT  UND sigaction
    39: 00000000     0 FUNC    GLOBAL DEFAULT  UND alarm
    40: 00000000     0 FUNC    GLOBAL DEFAULT  UND sigsetjmp
    41: 00000000     0 FUNC    GLOBAL DEFAULT  UND siglongjmp
    42: 00000000     0 FUNC    GLOBAL DEFAULT  UND sscanf
    43: 00000000     0 FUNC    GLOBAL DEFAULT  UND fflush
    44: 00000000     0 FUNC    GLOBAL DEFAULT  UND fread
    45: 00000000     0 OBJECT  GLOBAL DEFAULT  UND __sF
    46: 00000000     0 FUNC    GLOBAL DEFAULT  UND __aeabi_memcpy
    47: 00000000     0 FUNC    GLOBAL DEFAULT  UND stat
    48: 00000000     0 FUNC    GLOBAL DEFAULT  UND basename
    49: 00000000     0 FUNC    GLOBAL DEFAULT  UND memcpy
    50: 00000000     0 FUNC    GLOBAL DEFAULT  UND fgets
    51: 00000000     0 FUNC    GLOBAL DEFAULT  UND strtol
    52: 00000000     0 FUNC    GLOBAL DEFAULT  UND strrchr
    53: 00000000     0 FUNC    GLOBAL DEFAULT  UND strncmp
    54: 00000000     0 FUNC    GLOBAL DEFAULT  UND strtok_r
    55: 00000000     0 FUNC    GLOBAL DEFAULT  UND strcmp
    56: 00000000     0 FUNC    GLOBAL DEFAULT  UND qsort
    57: 00000000     0 FUNC    GLOBAL DEFAULT  UND fputs
    58: 00000000     0 FUNC    GLOBAL DEFAULT  UND memmove
    59: 00000000     0 FUNC    GLOBAL DEFAULT  UND strstr
    60: 00000000     0 FUNC    GLOBAL DEFAULT  UND memchr
    61: 00000000     0 FUNC    GLOBAL DEFAULT  UND isdigit
    62: 00000000     0 FUNC    GLOBAL DEFAULT  UND send
    63: 00000000     0 FUNC    GLOBAL DEFAULT  UND __errno
    64: 00000000     0 FUNC    GLOBAL DEFAULT  UND recv
    65: 00000000     0 FUNC    GLOBAL DEFAULT  UND __aeabi_memmove
    66: 00000000     0 FUNC    GLOBAL DEFAULT  UND __aeabi_memset
    67: 00000000     0 FUNC    GLOBAL DEFAULT  UND strncpy
    68: 00000000     0 FUNC    GLOBAL DEFAULT  UND inet_pton
    69: 00000000     0 FUNC    GLOBAL DEFAULT  UND strtoul
    70: 00000000     0 FUNC    GLOBAL DEFAULT  UND getsockname
    71: 00000000     0 FUNC    GLOBAL DEFAULT  UND bind
    72: 00000000     0 FUNC    GLOBAL DEFAULT  UND listen
    73: 00000000     0 FUNC    GLOBAL DEFAULT  UND accept
    74: 00000000     0 FUNC    GLOBAL DEFAULT  UND strcasecmp
    75: 00000000     0 FUNC    GLOBAL DEFAULT  UND isxdigit
    76: 00000000     0 FUNC    GLOBAL DEFAULT  UND socket
    77: 00000000     0 FUNC    GLOBAL DEFAULT  UND ioctl
    78: 00146d5c   160 FUNC    GLOBAL DEFAULT    8 MD5_Init
    79: 00144070   688 FUNC    GLOBAL DEFAULT    8 MD5_Update
    80: 00146908  1108 FUNC    GLOBAL DEFAULT    8 MD5_Final
    81: 00000000     0 FUNC    GLOBAL DEFAULT  UND memcmp
    82: 00000000     0 FUNC    GLOBAL DEFAULT  UND zlibVersion
    83: 00000000     0 FUNC    GLOBAL DEFAULT  UND getenv
    84: 00000000     0 FUNC    GLOBAL DEFAULT  UND sprintf
    85: 00000000     0 FUNC    GLOBAL DEFAULT  UND fputc
    86: 00000000     0 FUNC    GLOBAL DEFAULT  UND atoi
    87: 00000000     0 FUNC    GLOBAL DEFAULT  UND geteuid
    88: 00000000     0 FUNC    GLOBAL DEFAULT  UND getpwuid
    89: 00000000     0 FUNC    GLOBAL DEFAULT  UND fseek
    90: 00000000     0 FUNC    GLOBAL DEFAULT  UND bsd_signal
    91: 00000000     0 FUNC    GLOBAL DEFAULT  UND strncasecmp
    92: 00011d38     0 FUNC    GLOBAL DEFAULT  UND calloc
    93: 00011d2c     0 FUNC    GLOBAL DEFAULT  UND strdup
    94: 00011d20     0 FUNC    GLOBAL DEFAULT  UND realloc
    95: 00000000     0 FUNC    GLOBAL DEFAULT  UND isprint
    96: 00000000     0 FUNC    GLOBAL DEFAULT  UND isalnum
    97: 00000000     0 FUNC    GLOBAL DEFAULT  UND isalpha
    98: 00000000     0 FUNC    GLOBAL DEFAULT  UND isupper
    99: 00000000     0 FUNC    GLOBAL DEFAULT  UND islower
   100: 00000000     0 FUNC    GLOBAL DEFAULT  UND isgraph
   101: 00000000     0 FUNC    GLOBAL DEFAULT  UND getpeername
   102: 00000000     0 FUNC    GLOBAL DEFAULT  UND getsockopt
   103: 00000000     0 FUNC    GLOBAL DEFAULT  UND connect
   104: 00000000     0 FUNC    GLOBAL DEFAULT  UND setsockopt
   105: 00000000     0 FUNC    GLOBAL DEFAULT  UND inflateInit_
   106: 00000000     0 FUNC    GLOBAL DEFAULT  UND inflate
   107: 00000000     0 FUNC    GLOBAL DEFAULT  UND inflateEnd
   108: 00000000     0 FUNC    GLOBAL DEFAULT  UND inflateInit2_
   109: 00000000     0 FUNC    GLOBAL DEFAULT  UND strerror_r
   110: 00000000     0 FUNC    GLOBAL DEFAULT  UND gmtime_r
   111: 00000000     0 FUNC    GLOBAL DEFAULT  UND select
   112: 00000000     0 FUNC    GLOBAL DEFAULT  UND recvfrom
   113: 00000000     0 FUNC    GLOBAL DEFAULT  UND sendto
   114: 00000000     0 FUNC    GLOBAL DEFAULT  UND strlcat
   115: 00000000     0 FUNC    GLOBAL DEFAULT  UND getaddrinfo
   116: 00000000     0 FUNC    GLOBAL DEFAULT  UND freeaddrinfo
   117: 00000000     0 FUNC    GLOBAL DEFAULT  UND fcntl
   118: 00000000     0 FUNC    GLOBAL DEFAULT  UND toupper
   119: 00000000     0 FUNC    GLOBAL DEFAULT  UND gethostname
   120: 00000000     0 FUNC    GLOBAL DEFAULT  UND waitpid
   121: 00000000     0 FUNC    GLOBAL DEFAULT  UND kill
   122: 00000000     0 FUNC    GLOBAL DEFAULT  UND strpbrk
   123: 00000000     0 FUNC    GLOBAL DEFAULT  UND socketpair
   124: 00000000     0 FUNC    GLOBAL DEFAULT  UND fork
   125: 00000000     0 FUNC    GLOBAL DEFAULT  UND dup2
   126: 00000000     0 FUNC    GLOBAL DEFAULT  UND execl
   127: 00000000     0 FUNC    GLOBAL DEFAULT  UND abort
   128: 00000000     0 FUNC    GLOBAL DEFAULT  UND gethostbyname
   129: 00000000     0 FUNC    GLOBAL DEFAULT  UND getservbyname
   130: 00000000     0 FUNC    GLOBAL DEFAULT  UND shutdown
   131: 00000000     0 FUNC    GLOBAL DEFAULT  UND write
   132: 00000000     0 FUNC    GLOBAL DEFAULT  UND perror
   133: 00000000     0 FUNC    GLOBAL DEFAULT  UND ftell
   134: 00000000     0 FUNC    GLOBAL DEFAULT  UND closelog
   135: 00000000     0 FUNC    GLOBAL DEFAULT  UND openlog
   136: 00000000     0 FUNC    GLOBAL DEFAULT  UND syslog
   137: 00000000     0 FUNC    GLOBAL DEFAULT  UND getpid
   138: 00000000     0 FUNC    GLOBAL DEFAULT  UND vfprintf
   139: 00000000     0 FUNC    GLOBAL DEFAULT  UND dlopen
   140: 00000000     0 FUNC    GLOBAL DEFAULT  UND dlerror
   141: 00000000     0 FUNC    GLOBAL DEFAULT  UND dlclose
   142: 00000000     0 FUNC    GLOBAL DEFAULT  UND dlsym
   143: 00000000     0 FUNC    GLOBAL DEFAULT  UND strerror
   144: 00000000     0 FUNC    GLOBAL DEFAULT  UND opendir
   145: 00000000     0 FUNC    GLOBAL DEFAULT  UND readdir
   146: 00000000     0 FUNC    GLOBAL DEFAULT  UND closedir
   147: 00000000     0 FUNC    GLOBAL DEFAULT  UND printf
   148: 00000000     0 FUNC    GLOBAL DEFAULT  UND poll
   149: 00000000     0 FUNC    GLOBAL DEFAULT  UND getuid
   150: 00000000     0 FUNC    GLOBAL DEFAULT  UND setvbuf
   151: 00000000     0 FUNC    GLOBAL DEFAULT  UND chmod
   152: 00000000     0 FUNC    GLOBAL DEFAULT  UND getgid
   153: 00000000     0 FUNC    GLOBAL DEFAULT  UND getegid
   154: 00000000     0 FUNC    GLOBAL DEFAULT  UND raise
   155: 00000000     0 FUNC    WEAK   DEFAULT  UND __gnu_Unwind_Find_exidx
   156: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __cxa_begin_cleanup
   157: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __cxa_type_match
   158: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __cxa_call_unexpected
   159: 001e2d84     0 NOTYPE  GLOBAL DEFAULT  ABS _edata
   160: 001e2d84     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start
   161: 001e4ea0     0 NOTYPE  GLOBAL DEFAULT  ABS _end
위의 결 과 를 보면 이 실행 가능 한 파일 에 pthread 와 같은 링크 가 있 습 니 다.create, time 등

좋은 웹페이지 즐겨찾기