From d7643439eba4ded2253cc4c0c5b2531ee82bd4ea Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Mon, 19 Aug 2002 10:07:41 +0000 Subject: Work from Stefan Allius which allows superH to use the common method for building crti.o and crtn.o --- extra/scripts/initfini.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'extra') 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() { $omitcrtn = 0; next; } + if (/^i_am_not_a_leaf/) { + $discard = 1; + next; + } if (/^_init:/ || /^_fini:/) { $omitcrtn = 1; } @@ -140,12 +145,13 @@ while() { s/ALIGN//; } } - if (!$omitcrti) { + if (!$omitcrti && !$discard) { print CRTI; } - if (!$omitcrtn) { + if (!$omitcrtn && !$discard) { print CRTN; } + $discard = 0; } close(INITFINI); close(CRTI); -- cgit v1.2.3