Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
compare linux so files funcs
#! /usr/bin/env python
# -*-coding:utf-8 -*-
"""
compare so files funcs
test pass : centos6.4_x64
e-mail : mike_zhang@live.com
"""
import os
def getFuncNames(iterObj,refList):
for line in iterObj:
arr = line.strip().split(" ")
refList.append(arr[-1])
def getData(cmd,refList):
rows = os.popen(cmd).read().split("\n")
getFuncNames(rows,refList)
mysqlList = []
odbcList = []
getData("nm /usr/local/mysql/lib/libmysqlclient.so.18",mysqlList)
getData("nm /usr/lib/libodbc.so.2",odbcList)
#set([12,3]) & set([1,3])
result = list(set(mysqlList) & set(odbcList))
for item in result :
print item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment