summaryrefslogtreecommitdiff
path: root/extra/scripts/initfini.pl
diff options
context:
space:
mode:
Diffstat (limited to 'extra/scripts/initfini.pl')
-rwxr-xr-xextra/scripts/initfini.pl10
1 files changed, 8 insertions, 2 deletions
diff --git a/extra/scripts/initfini.pl b/extra/scripts/initfini.pl
index 7c592daac..431b39396 100755
--- a/extra/scripts/initfini.pl
+++ b/extra/scripts/initfini.pl
@@ -11,6 +11,7 @@ my($endp) = 0;
my($end) = 0;
my($omitcrti) = 0;
my($omitcrtn) = 0;
+my($discard) = 0;
my($line);
# Get commandline parameters
@@ -83,6 +84,10 @@ while(<INITFINI>) {
$omitcrtn = 0;
next;
}
+ if (/^i_am_not_a_leaf/) {
+ $discard = 1;
+ next;
+ }
if (/^_init:/ || /^_fini:/) {
$omitcrtn = 1;
}
@@ -140,12 +145,13 @@ while(<INITFINI>) {
s/ALIGN//;
}
}
- if (!$omitcrti) {
+ if (!$omitcrti && !$discard) {
print CRTI;
}
- if (!$omitcrtn) {
+ if (!$omitcrtn && !$discard) {
print CRTN;
}
+ $discard = 0;
}
close(INITFINI);
close(CRTI);