wok rev 23994

linld: no initrd fix
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Dec 15 08:41:50 2020 +0000 (11 months ago)
parents 34d90fb03f57
children 9c5316bc7e8e
files linld/stuff/src/LINLD.CPP linld/stuff/src/pipehole.awk
line diff
     1.1 --- a/linld/stuff/src/LINLD.CPP	Sat Dec 12 17:26:44 2020 +0000
     1.2 +++ b/linld/stuff/src/LINLD.CPP	Tue Dec 15 08:41:50 2020 +0000
     1.3 @@ -60,11 +60,9 @@
     1.4  
     1.5      // Parse command line
     1.6  #ifdef	USE_ARGSTR
     1.7 -    if (!argv[1]) syntax();
     1.8 +    if (!*++argv) syntax();
     1.9      const char **clp = &cmdline;
    1.10 -    for (;;) {
    1.11 -	argv++;
    1.12 -	if (!*argv) break;
    1.13 +    do {
    1.14          if ((*(u16 *)*argv|2) == 0x362F) {	// -64 /64
    1.15  	    if (cpuhaslm() == 0) exit();
    1.16  	    continue;
    1.17 @@ -83,7 +81,7 @@
    1.18  	}
    1.19  	*clp = (const char *) buf_cmdline + 1;
    1.20  	strcatb((const char *) buf_cmdline,*argv);
    1.21 -    }
    1.22 +    } while (*++argv);
    1.23      puts(*clp);
    1.24      set_cmdline(*clp);
    1.25      load_kernel();
     2.1 --- a/linld/stuff/src/pipehole.awk	Sat Dec 12 17:26:44 2020 +0000
     2.2 +++ b/linld/stuff/src/pipehole.awk	Tue Dec 15 08:41:50 2020 +0000
     2.3 @@ -22,6 +22,8 @@
     2.4  	if (/add	si,2/) $0="	lodsw	; " $0
     2.5  	if (/add	di,2/) $0="	scasw	; " $0
     2.6  	if (/bx,offset DGROUP:s@\+26/) sub(/mov/,";mov")
     2.7 +	if (/bx,si/ || /\[bp-2\]/) next
     2.8 +	sub(/\[bx\],0/,"[si],0")
     2.9  	if (islinld==1) {
    2.10  		print "; " $0
    2.11  		if (!/word ptr/) next
    2.12 @@ -228,7 +230,7 @@
    2.13  	}
    2.14  	if (/void load_initrd\(\)/) isload=3
    2.15  	if (isload == 3) {  # LOAD.LST
    2.16 -		if (/short @2@198/) sub(/@2@198/,"load_initrd_ret")
    2.17 +		if (/je	short @2@.*/) sub(/@2@.*/,"load_initrd_ret")
    2.18  		if (/mov	ax,word ptr \[si\]/) $0="	lodsw"
    2.19  		if( /jmp/) {
    2.20  			print "load_initrd_ret:"