17460Smckusick#
2*22267Sdist# Copyright (c) 1982 Regents of the University of California.
3*22267Sdist# All rights reserved.  The Berkeley software License Agreement
4*22267Sdist# specifies the terms and conditions for redistribution.
57460Smckusick#
6*22267Sdist#	@(#)pcexterns.awk	5.1 (Berkeley) 06/05/85
7*22267Sdist#
87603Smckusick# This generates .stabs for all the global routines and variables
97603Smckusick# in a library. The format of a stab can be found in man5/stab.5.
107603Smckusick#
1114118Smckusick# This value must be coordinated with the one in ../src/pstab.h.
1214118Smckusick#
1314118SmckusickBEGIN {
1414118Smckusick	N_FLAGCHECKSUM = 1;
1514118Smckusick}
1614118Smckusick#
177603Smckusick# Generate "source file" stab for the library name.
187603Smckusick#
197460SmckusickNR == 1	{
207460Smckusick	name = substr($1, 1, index($1, ":") - 1);
2114118Smckusick	printf "	.stabs	\"%s\",0x30,0,0x1,%d\n", name, N_FLAGCHECKSUM;
227460Smckusick}
237603Smckusick#
247603Smckusick# Generate "library routine" stab.
257603Smckusick#
267460SmckusickNF == 3 && $2 == "T" {
277599Smckusick	printf "	.stabs	\"%s\",0x30,0,0xc,0x%d\n", substr($3, 2), NR;
287460Smckusick}
297603Smckusick#
307603Smckusick# Generate "library variable" stab.
317603Smckusick#
327460SmckusickNF == 3 && $2 ~ /[ABD]/ {
337599Smckusick	printf "	.stabs	\"%s\",0x30,0,0xb,0x%d\n", substr($3, 2), NR;
347460Smckusick}
35