diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-07 19:55:37 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-07 19:55:37 +0000 |
commit | ca9211ecdede9bdedb812b2243a4abdb8dacd1b9 (patch) | |
tree | 9b19e801150082c33e9152275829a6ce90614b55 /lib/sanitizer_common/scripts/gen_dynamic_list.py | |
parent | 8ef50bf3d1c287b5013c3168de77a462dfce3495 (diff) | |
download | src-ca9211ecdede9bdedb812b2243a4abdb8dacd1b9.tar.gz src-ca9211ecdede9bdedb812b2243a4abdb8dacd1b9.zip |
Import compiler-rt trunk r224034.vendor/compiler-rt/compiler-rt-r224034
Notes
Notes:
svn path=/vendor/compiler-rt/dist/; revision=276789
svn path=/vendor/compiler-rt/compiler-rt-r224034/; revision=276790; tag=vendor/compiler-rt/compiler-rt-r224034
Diffstat (limited to 'lib/sanitizer_common/scripts/gen_dynamic_list.py')
-rwxr-xr-x | lib/sanitizer_common/scripts/gen_dynamic_list.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/sanitizer_common/scripts/gen_dynamic_list.py b/lib/sanitizer_common/scripts/gen_dynamic_list.py index 32ba9226911e..7bab230650cb 100755 --- a/lib/sanitizer_common/scripts/gen_dynamic_list.py +++ b/lib/sanitizer_common/scripts/gen_dynamic_list.py @@ -35,12 +35,16 @@ def get_global_functions(library): functions = [] nm_proc = subprocess.Popen(['nm', library], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - nm_out = nm_proc.communicate()[0].split('\n') + nm_out = nm_proc.communicate()[0].decode().split('\n') if nm_proc.returncode != 0: raise subprocess.CalledProcessError(nm_proc.returncode, 'nm') + func_symbols = ['T', 'W'] + # On PowerPC, nm prints function descriptors from .data section. + if os.uname()[4] in ["powerpc", "ppc64"]: + func_symbols += ['D'] for line in nm_out: cols = line.split(' ') - if (len(cols) == 3 and cols[1] in ('T', 'W')) : + if len(cols) == 3 and cols[1] in func_symbols : functions.append(cols[2]) return functions @@ -75,11 +79,11 @@ def main(argv): for line in f: result.append(line.rstrip()) # Print the resulting list in the format recognized by ld. - print '{' + print('{') result.sort() for f in result: - print ' ' + f + ';' - print '};' + print(' ' + f + ';') + print('};') if __name__ == '__main__': main(sys.argv) |