| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d936c30 commit 5b9f811
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,18 +34,35 @@ | |||
| 34 | 34 | # Symbols for the gtest libraries are excluded as | |
| 35 | 35 | # they are not linked into the node executable. | |
| 36 | 36 | # | |
| 37 | + set -x | ||
| 37 | 38 | echo "Searching $1 to write out expfile to $2" | |
| 38 | 39 | ||
| 39 | 40 | # This special sequence must be at the start of the exp file. | |
| 40 | 41 | echo "#!." > "$2.tmp" | |
| 41 | 42 | ||
| 42 | 43 | # Pull the symbols from the .a files. | |
| 43 | - find "$1" -name "*.a" | grep -v gtest \ | ||
| 44 | - | xargs nm -Xany -BCpg \ | ||
| 45 | - | awk '{ | ||
| 46 | - if ((($2 == "T") || ($2 == "D") || ($2 == "B")) && | ||
| 47 | - (substr($3,1,1) != ".")) { print $3 } | ||
| 48 | - }' \ | ||
| 49 | - | sort -u >> "$2.tmp" | ||
| 44 | + # Use dump -tov to get visibility information and exclude HIDDEN symbols | ||
| 45 | + # This prevents AIX linker error 0711-407 when addons try to import symbols | ||
| 46 | + # with visibility attributes. | ||
| 47 | + find "$1" -name "*.a" | grep -v gtest | while read -r f; do | ||
| 48 | + dump -tov -X 32_64 "$f" 2>/dev/null | \ | ||
| 49 | + awk ' | ||
| 50 | + BEGIN { | ||
| 51 | + V["EXPORTED"]=" export" | ||
| 52 | + V["PROTECTED"]=" protected" | ||
| 53 | + V["HIDDEN"]=" hidden" | ||
| 54 | + } | ||
| 55 | + /^\[[0-9]+\]\tm +[^ ]+ +\.(text|data|tdata|bss) +[^ ]+ +(extern|weak) +(EXPORTED|PROTECTED|HIDDEN| ) / { | ||
| 56 | + # Exclude symbols starting with dot, __sinit, __sterm, __[0-9]+__ | ||
| 57 | + # Also exclude HIDDEN symbols to avoid visibility attribute issues | ||
| 58 | + if (!match($NF,/^(\.|__sinit|__sterm|__[0-9]+__)/)) { | ||
| 59 | + visibility = $(NF-1) | ||
| 60 | + if (visibility != "HIDDEN") { | ||
| 61 | + print $NF | ||
| 62 | + } | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | + ' | ||
| 66 | + done | sort -u >> "$2.tmp" | ||
| 50 | 67 | ||
| 51 | 68 | mv -f "$2.tmp" "$2" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments