diff options
author | dim <dim@FreeBSD.org> | 2015-01-07 19:55:37 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-01-07 19:55:37 +0000 |
commit | 2f1c5cc1039d86db0037cb086bd58f4b90dc6f66 (patch) | |
tree | 9b19e801150082c33e9152275829a6ce90614b55 /lib/sanitizer_common/scripts/gen_dynamic_list.py | |
parent | c3f67e1dc21025f1026cbf72628b19fb37f7b53d (diff) | |
download | FreeBSD-src-2f1c5cc1039d86db0037cb086bd58f4b90dc6f66.zip FreeBSD-src-2f1c5cc1039d86db0037cb086bd58f4b90dc6f66.tar.gz |
Import compiler-rt trunk r224034.
https://llvm.org/svn/llvm-project/compiler-rt/trunk@224034
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 32ba922..7bab230 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) |