5
* Written by Jared Smith and Kevin P. Fleming
7
* Copyright (C) 2006, Jared Smith and Digium, Inc.
11
# create an array of all the different prefixes you want to match on,
12
# as Perl-compatible regular expressions
13
# (yes, this is a stupid example, as the second one is just a simplified
14
# version of the first, but it's just an example)
15
$prefixes = array('\.text\.Oct');
17
$fp = fopen('test.map','r');
21
# Loop until we find the top of section we want
22
while ($line = fgets($fp))
24
if (preg_match('/Discarded input sections/i',$line))
30
# Now loop until we find the next section
31
while ($line = fgets($fp))
33
if (preg_match('/Memory Configuration/i',$line))
38
foreach ($prefixes as $prefix)
40
if (preg_match("/$prefix/i",$line))
42
preg_match("/Oct.*/", $line, $matches);
44
echo "#define SKIP_".$matches[0]." 1\n";