1# Copyright (c) 1982 Regents of the University of California
2#
3#	@(#)pcexterns.awk	4.3	(Berkeley)	07/29/82
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# Generate "source file" stab for the library name.
9#
10NR == 1	{
11	name = substr($1, 1, index($1, ":") - 1);
12	printf "	.stabs	\"%s\",0x30,0,0x1,0\n", name;
13}
14#
15# Generate "library routine" stab.
16#
17NF == 3 && $2 == "T" {
18	printf "	.stabs	\"%s\",0x30,0,0xc,0x%d\n", substr($3, 2), NR;
19}
20#
21# Generate "library variable" stab.
22#
23NF == 3 && $2 ~ /[ABD]/ {
24	printf "	.stabs	\"%s\",0x30,0,0xb,0x%d\n", substr($3, 2), NR;
25}
26