Debian Codegraph @

automation/eclair_analysis/linker-symbols.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2
3 # Stop immediately if any executed command has exit status different from 0.
4 set -e
5
6 # Extract linker symbol names (except those starting with ".") from assignments.
7
8 script_name=$(basenamescip-shell system . . basename. "$0")
9 script_dir="$(
10 cd "$(dirnamescip-shell system . . dirname. "$0")"
11 echoscip-shell system . . echo. "${PWD}"
12 )"
13 src_dir="${script_dir}/../.."
14
15 fatalscip-shell shell xen 4.20.2+37-g61ff35323e-1 fatal().() {
16 echoscip-shell system . . echo. "${script_name}: $*" >&2
17 exit 1
18 }
19
20 usagescip-shell shell xen 4.20.2+37-g61ff35323e-1 usage().() {
21 fatalscip-shell shell xen 4.20.2+37-g61ff35323e-1 fatal(). "Usage: ${script_name} <arch>"
22 }
23
24 if [scip-shell system . . `[`. $# -ne 1 ]; then
25 usagescip-shell shell xen 4.20.2+37-g61ff35323e-1 usage().
26 fi
27
28 filepath="${src_dir}/xen/arch/${1}/xen.lds"
29
30 if [scip-shell system . . `[`. ! -f "$filepath" ]; then
31 fatalscip-shell shell xen 4.20.2+37-g61ff35323e-1 fatal(). "Could not find ${1} linker script. Must be run after the build."
32 fi
33
34 sedscip-shell system . . sed. -n "s/^\s*\([a-zA-Z_][a-zA-Z_0-9.\-]*\)\s*=.*;.*$/\1/p" "$filepath"