|
1 | 1 | #!/bin/sh |
2 | | -# This script writes out all the exported symbols to a file |
3 | | -# AIX needs this as sybmols are not exported by an |
4 | | -# executable by default and we need to list |
5 | | -# them specifically in order to export them |
6 | | -# so that they can be used by native add-ons |
| 2 | +# Writes out all of the exported symbols to a file. |
| 3 | +# This is needed on AIX as symbols are not exported |
| 4 | +# by an executable by default and need to be listed |
| 5 | +# specifically for export so that they can be used |
| 6 | +# by native add-ons. |
7 | 7 | # |
8 | | -# The raw symbol data is objtained by using nm on |
9 | | -# the .a files which make up the node executable |
| 8 | +# The raw symbol data is obtained by using nm on |
| 9 | +# the .a files which make up the node executable. |
10 | 10 | # |
11 | | -# -Xany makes sure we get symbols on both |
12 | | -# 32 bit and 64 bit as by default we'd only get those |
13 | | -# for 32 bit |
| 11 | +# -Xany processes symbols for both 32-bit and |
| 12 | +# 64-bit (the default is for 32-bit only). |
14 | 13 | # |
15 | | -# -g selects only exported symbols |
| 14 | +# -g selects only exported symbols. |
16 | 15 | # |
17 | | -# -C, -B and -p ensure the output is in a format we |
18 | | -# can easily parse and convert into the symbol we need |
| 16 | +# -C, -B and -p ensure that the output is in a |
| 17 | +# format that can be easily parsed and converted |
| 18 | +# into the required symbol. |
19 | 19 | # |
20 | | -# -C suppresses the demangling of C++ names |
21 | | -# -B gives us output in BSD format |
22 | | -# -p displays the info in a standard portable output format |
| 20 | +# -C suppresses the demangling of C++ names. |
| 21 | +# -B writes the output in BSD format. |
| 22 | +# -p displays the info in a standard portable |
| 23 | +# output format. |
23 | 24 | # |
24 | | -# We only include symbols if they are of the |
25 | | -# following types and don't start with a dot. |
| 25 | +# Only include symbols if they are of the following |
| 26 | +# types and don't start with a dot. |
26 | 27 | # |
27 | | -# T - Global text symbol |
28 | | -# D - Global data symbol |
29 | | -# B - Gobal bss symbol. |
| 28 | +# T - Global text symbol. |
| 29 | +# D - Global data symbol. |
| 30 | +# B - Global bss symbol. |
30 | 31 | # |
31 | | -# the final sort allows us to remove any duplicates |
| 32 | +# The final sort allows removal of any duplicates. |
32 | 33 | # |
33 | | -# We need to exclude gtest libraries as they are not |
34 | | -# linked into the node executable |
| 34 | +# Symbols for the gtest libraries are excluded as |
| 35 | +# they are not linked into the node executable. |
35 | 36 | # |
36 | 37 | echo "Searching $1 to write out expfile to $2" |
37 | 38 |
|
38 | | -# this special sequence must be at the start of the exp file |
| 39 | +# This special sequence must be at the start of the exp file. |
39 | 40 | echo "#!." > $2.tmp |
40 | 41 |
|
41 | | -# pull the symbols from the .a files |
| 42 | +# Pull the symbols from the .a files. |
42 | 43 | find $1 -name "*.a" | grep -v gtest \ |
43 | 44 | | xargs nm -Xany -BCpg \ |
44 | 45 | | awk '{ |
|
0 commit comments