1# Copyright (c) 1982 Regents of the University of California 2# 3# @(#)pcexterns.awk 4.4 (Berkeley) 07/25/83 4# 5# This generates .stabs for all the global routines and variables 6# in a library. The format of a stab can be found in man5/stab.5. 7# 8# This value must be coordinated with the one in ../src/pstab.h. 9# 10BEGIN { 11 N_FLAGCHECKSUM = 1; 12} 13# 14# Generate "source file" stab for the library name. 15# 16NR == 1 { 17 name = substr($1, 1, index($1, ":") - 1); 18 printf " .stabs \"%s\",0x30,0,0x1,%d\n", name, N_FLAGCHECKSUM; 19} 20# 21# Generate "library routine" stab. 22# 23NF == 3 && $2 == "T" { 24 printf " .stabs \"%s\",0x30,0,0xc,0x%d\n", substr($3, 2), NR; 25} 26# 27# Generate "library variable" stab. 28# 29NF == 3 && $2 ~ /[ABD]/ { 30 printf " .stabs \"%s\",0x30,0,0xb,0x%d\n", substr($3, 2), NR; 31} 32