From 0ffd54f0947967166fbaf2b92743fb40df96f0b3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 30 Jan 2020 10:22:56 -0500 Subject: AIX: Add ExportImportList option to skip the object files --- Modules/Platform/AIX/ExportImportList | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/Modules/Platform/AIX/ExportImportList b/Modules/Platform/AIX/ExportImportList index c7f60b5..891bce7 100755 --- a/Modules/Platform/AIX/ExportImportList +++ b/Modules/Platform/AIX/ExportImportList @@ -5,7 +5,7 @@ # This script is internal to CMake and meant only to be # invoked by CMake-generated build systems on AIX. -usage='usage: ExportImportList -o [-l ] [--] ...' +usage='usage: ExportImportList -o [-l ] [-n] [--] ...' die() { echo "$@" 1>&2; exit 1 @@ -14,10 +14,12 @@ die() { # Process command-line arguments. out='' lib='' +no_objects='' while test "$#" != 0; do case "$1" in -l) shift; lib="$1" ;; -o) shift; out="$1" ;; + -n) no_objects='1' ;; --) shift; break ;; -*) die "$usage" ;; *) break ;; @@ -32,20 +34,22 @@ trap 'rm -f "$out_tmp"' EXIT INT TERM > "$out_tmp" # Collect symbols exported from all object files. -for f in "$@"; do - dump -tov -X 32_64 "$f" | - awk ' - BEGIN { - V["EXPORTED"]=" export" - V["PROTECTED"]=" protected" - } - /^\[[0-9]+\]\tm +[^ ]+ +\.(text|data|bss) +[^ ]+ +(extern|weak) +(EXPORTED|PROTECTED| ) / { - if (!match($NF,/^(\.|__sinit|__sterm|__[0-9]+__)/)) { - print $NF V[$(NF-1)] +if test -z "$no_objects"; then + for f in "$@"; do + dump -tov -X 32_64 "$f" | + awk ' + BEGIN { + V["EXPORTED"]=" export" + V["PROTECTED"]=" protected" } - } - ' -done >> "$out_tmp" + /^\[[0-9]+\]\tm +[^ ]+ +\.(text|data|bss) +[^ ]+ +(extern|weak) +(EXPORTED|PROTECTED| ) / { + if (!match($NF,/^(\.|__sinit|__sterm|__[0-9]+__)/)) { + print $NF V[$(NF-1)] + } + } + ' + done >> "$out_tmp" +fi # Generate the export/import file. { -- cgit v0.12