]> gcc.gnu.org Git - gcc.git/blame - gcc/mkmap-flat.awk
c-decl.c (pushdecl): Only put decls which finish_struct will do something about onto...
[gcc.git] / gcc / mkmap-flat.awk
CommitLineData
83dad10c
RH
1# Generate a flat list of symbols to export.
2# Contributed by Richard Henderson <rth@cygnus.com>
3#
1322177d 4# This file is part of GCC.
83dad10c 5#
1322177d
LB
6# GCC is free software; you can redistribute it and/or modify it under
7# the terms of the GNU General Public License as published by the Free
8# Software Foundation; either version 2, or (at your option) any later
9# version.
83dad10c 10#
1322177d
LB
11# GCC is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14# License for more details.
83dad10c
RH
15#
16# You should have received a copy of the GNU General Public License
1322177d
LB
17# along with GCC; see the file COPYING. If not, write to the Free
18# Software Foundation, 59 Temple Place - Suite 330, Boston MA
19# 02111-1307, USA.
83dad10c
RH
20
21BEGIN {
22 state = "nm";
23}
24
25# Remove comment and blank lines.
26/^ *#/ || /^ *$/ {
27 next;
28}
29
30# We begin with nm input. Collect the set of symbols that are present
31# so that we can elide undefined symbols.
32
33state == "nm" && /^%%/ {
34 state = "ver";
35 next;
36}
37
38state == "nm" && ($1 == "U" || $2 == "U") {
39 next;
40}
41
42state == "nm" && NF == 3 {
43 def[$3] = 1;
44 next;
45}
46
47state == "nm" {
48 next;
49}
50
51# Now we process a simplified variant of the Solaris symbol version
52# script. We have one symbol per line, no semicolons, simple markers
53# for beginning and ending each section, and %inherit markers for
54# describing version inheritence. A symbol may appear in more than
55# one symbol version, and the last seen takes effect.
56
57NF == 3 && $1 == "%inherit" {
58 next;
59}
60
61NF == 2 && $2 == "{" {
62 next;
63}
64
65$1 == "}" {
66 next;
67}
68
69{
70 export[$1] = 1;
71 next;
72}
73
74END {
75 for (sym in export)
76 if (def[sym])
77 print sym;
78}
This page took 1.833677 seconds and 5 git commands to generate.