1*48062Sbostic#!/bin/sh - 27460Smckusick# 3*48062Sbostic# Copyright (c) 1982 The Regents of the University of California. 4*48062Sbostic# All rights reserved. 57460Smckusick# 6*48062Sbostic# %sccs.include.redist.sh% 722267Sdist# 8*48062Sbostic# @(#)pcexterns.awk 5.2 (Berkeley) 04/16/91 9*48062Sbostic# 10*48062Sbostic 117603Smckusick# This generates .stabs for all the global routines and variables 127603Smckusick# in a library. The format of a stab can be found in man5/stab.5. 137603Smckusick# 1414118Smckusick# This value must be coordinated with the one in ../src/pstab.h. 1514118Smckusick# 1614118SmckusickBEGIN { 1714118Smckusick N_FLAGCHECKSUM = 1; 1814118Smckusick} 1914118Smckusick# 207603Smckusick# Generate "source file" stab for the library name. 217603Smckusick# 227460SmckusickNR == 1 { 237460Smckusick name = substr($1, 1, index($1, ":") - 1); 2414118Smckusick printf " .stabs \"%s\",0x30,0,0x1,%d\n", name, N_FLAGCHECKSUM; 257460Smckusick} 267603Smckusick# 277603Smckusick# Generate "library routine" stab. 287603Smckusick# 297460SmckusickNF == 3 && $2 == "T" { 307599Smckusick printf " .stabs \"%s\",0x30,0,0xc,0x%d\n", substr($3, 2), NR; 317460Smckusick} 327603Smckusick# 337603Smckusick# Generate "library variable" stab. 347603Smckusick# 357460SmckusickNF == 3 && $2 ~ /[ABD]/ { 367599Smckusick printf " .stabs \"%s\",0x30,0,0xb,0x%d\n", substr($3, 2), NR; 377460Smckusick} 38