2 # Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the OpenSSL license (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
10 # This script will translate any SYMBOL_VECTOR item that has a translation
11 # in CXX$DEMANGLER_DB. The latter is generated by and CC/DECC command that
12 # uses the qualifier /REPOSITORY with the build directory as value. When
13 # /NAMES=SHORTENED has been used, this file will hold the translations from
14 # the original symbols to the shortened variants.
16 # CXX$DEMAGLER_DB. is an ISAM file, but with the magic of RMS, it can be
17 # read as a text file, with each record as one line.
19 # The lines will have the following syntax for any symbol found that's longer
22 # LONG_symbol_34567890123{cksum}$LONG_symbol_34567890123_more_than_31_chars
24 # $ is present at the end of the shortened symbol name, and is preceded by a
25 # 7 character checksum. The $ makes it easy to separate the shortened name
26 # from the original one.
31 usage() if scalar @ARGV < 1;
33 my %translations = ();
35 open DEMANGLER_DATA, $ARGV[0]
36 or die "Couldn't open $ARGV[0]: $!\n";
37 while(<DEMANGLER_DATA>) {
39 (my $translated, my $original) = split /\$/;
40 $translations{$original} = $translated.'$';
47 ((?:[A-Za-z0-9_]+)\/)?([A-Za-z0-9_]+)=(PROCEDURE|DATA)
49 if (defined($translations{$2})) {
50 my $trans = $translations{$2};
51 my $trans_uc = uc $trans;
52 if (defined($1) && $trans ne $trans_uc) {