diff options
author | Elliott Hughes <enh@google.com> | 2014-06-13 11:50:07 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-06-13 11:50:07 -0700 |
commit | e8e453439fa87d9fccf03006cc4dac76acadf44c (patch) | |
tree | 92990dd190c35402f4406807ff5de76c11540bde /libc/tools | |
parent | 0f690d9eda1893e66223138d2b930eb3e0164820 (diff) | |
download | bionic-e8e453439fa87d9fccf03006cc4dac76acadf44c.zip bionic-e8e453439fa87d9fccf03006cc4dac76acadf44c.tar.gz bionic-e8e453439fa87d9fccf03006cc4dac76acadf44c.tar.bz2 |
Bring our "libresolv" stuff in line with glibc.
Despite the name, most of resolv_private.h is actually in glibc; it's just
that there it's tucked away in libresolv whereas we have it in libc.
Change-Id: Ibcf6603f1141ffd2661cee0bffa83052d4f9e549
Diffstat (limited to 'libc/tools')
-rwxr-xr-x | libc/tools/check-symbols-glibc.py | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/libc/tools/check-symbols-glibc.py b/libc/tools/check-symbols-glibc.py index d0e00f3..58a10e0 100755 --- a/libc/tools/check-symbols-glibc.py +++ b/libc/tools/check-symbols-glibc.py @@ -11,7 +11,6 @@ toolchain = os.environ['ANDROID_TOOLCHAIN'] arch = re.sub(r'.*/linux-x86/([^/]+)/.*', r'\1', toolchain) def GetSymbolsFromSo(so_file): - # Example readelf output: # 264: 0001623c 4 FUNC GLOBAL DEFAULT 8 cabsf # 266: 00016244 4 FUNC GLOBAL DEFAULT 8 dremf @@ -23,13 +22,13 @@ def GetSymbolsFromSo(so_file): symbols = set() for line in subprocess.check_output(['readelf', '--dyn-syms', '-W', so_file]).split('\n'): - if ' HIDDEN ' in line or ' UND ' in line: - continue - m = r.match(line) - if m: - symbol = m.group(2) - symbol = re.sub('@.*', '', symbol) - symbols.add(symbol) + if ' HIDDEN ' in line or ' UND ' in line: + continue + m = r.match(line) + if m: + symbol = m.group(2) + symbol = re.sub('@.*', '', symbol) + symbols.add(symbol) return symbols @@ -46,9 +45,23 @@ def GetSymbolsFromSystemSo(*files): symbols = symbols | GetSymbolsFromSo(f) return symbols +def MangleGlibcNameToBionic(name): + if name in glibc_to_bionic_names: + return glibc_to_bionic_names[name] + return name + +glibc_to_bionic_names = { + '__res_init': 'res_init', + '__res_mkquery': 'res_mkquery', + '__res_query': 'res_query', + '__res_search': 'res_search', +} + glibc = GetSymbolsFromSystemSo('libc.so.*', 'librt.so.*', 'libpthread.so.*', 'libresolv.so.*', 'libm.so.*') bionic = GetSymbolsFromAndroidSo('libc.so', 'libm.so') +glibc = map(MangleGlibcNameToBionic, glibc) + # bionic includes various BSD symbols to ease porting other BSD-licensed code. bsd_stuff = set([ 'basename_r', |