# HG changeset patch # User Pascal Bellard # Date 1592899441 0 # Node ID 26195667e7c9ae99306434fd4c46f60e753610c6 # Parent 7880bcb5c1e0767b839c0cbad7840ab317805c57 syslinux: update iso2exe.sh diff -r 7880bcb5c1e0 -r 26195667e7c9 linld/stuff/src/CRTL.ASM --- a/linld/stuff/src/CRTL.ASM Sun Jun 21 19:06:48 2020 +0000 +++ b/linld/stuff/src/CRTL.ASM Tue Jun 23 08:04:01 2020 +0000 @@ -1123,10 +1123,11 @@ @@digitok: cmp al,cl jae @@endstrtol + cbw + cwde xchg eax,ebx mul ecx - add eax,ebx - xchg eax,ebx + add ebx,eax jmp @@strtollp @@endstrtol: mov cl,10 @@ -1154,23 +1155,14 @@ endif else ifndef USE_ARGSTR - push si di - xor ax,ax - cwd - or bx,bx - else - push di - xor ax,ax - cwd - or si,si - endif - jz @@goend - xchg ax,di - ifndef USE_ARGSTR + push si mov si,bx endif + or si,si + jz @@goend xor bx,bx xor cx,cx + xor dx,dx lodsb or al,20h cmp al,'a' @@ -1214,20 +1206,15 @@ @@digitok: cmp al,cl jae @@endstrtol + cbw push ax - push dx + xchg ax,dx + mul cx xchg ax,bx mul cx - xchg ax,bx - xchg ax,dx - xchg ax,di - pop ax - mul cx - add ax,di - xchg ax,dx - pop ax - mov ah,0 + add dx,bx + pop bx add bx,ax adc dx,0 @@ -1257,9 +1244,7 @@ xchg ax,bx @@popdisiret: ifndef USE_ARGSTR - pop di si - else - pop di + pop si endif endif strtol_ret: diff -r 7880bcb5c1e0 -r 26195667e7c9 linld/stuff/src/ISO9660.CPP --- a/linld/stuff/src/ISO9660.CPP Sun Jun 21 19:06:48 2020 +0000 +++ b/linld/stuff/src/ISO9660.CPP Tue Jun 23 08:04:01 2020 +0000 @@ -36,9 +36,7 @@ int isoreaddir(void) { char *p; -#ifdef __ROCKRIDGE - char *endname; -#endif + struct isostate *x=&isostate; if (x->curdirsize == 0xFFFF) { @@ -65,31 +63,20 @@ //x->filemod = (p[25] & 2) ? 0040755 : 0100755; //x->filemod = 0100755 - ((p[25] & (char)2) << 13); #ifdef __ROCKRIDGE - endname = NULL; // p += 34 + (p[32] & -2); ? p = x->buffer + 34 + ((p[32] + x->curpos) & -2); do { - int len = p[2]; -# if 0 - switch (* (short *) p) { - case 0x5850: // PX - x->filemod = * (short *) (p + 4); - break; - case 0x4D4E: // NM -# else + register len = p[2]; if (* (short *) p == 0x4D4E) { -# endif x->filename = p + 5; - endname = p + len; + p[len] = 0; + goto found; } p += len; +#ifndef ISOHOOK } while (x->buffer + x->curpos + x->entrysize - 2 > p); -#ifdef ISOHOOK - *endname = 0; #else - if (endname) - *endname = 0; - else + } while (1); #endif #endif #ifndef ISOHOOK @@ -111,6 +98,7 @@ } } #endif +found: x->curpos += x->entrysize; return 0; } diff -r 7880bcb5c1e0 -r 26195667e7c9 linld/stuff/src/pipehole.awk --- a/linld/stuff/src/pipehole.awk Sun Jun 21 19:06:48 2020 +0000 +++ b/linld/stuff/src/pipehole.awk Tue Jun 23 08:04:01 2020 +0000 @@ -203,6 +203,13 @@ } } # file == "load.cpp" if (file == "iso9660.cpp") { + if (/register len/) isiso=12 + if (isiso == 12) { # ISO9660.LST + sub(/mov dx,ax/,"xchg ax,bx") + if (/bx,dx/) next + sub(/i,dx/,"i,bx") + if (/while/) isiso=0 + } if (/while \(\*\+\+s/) isiso=11 if (isiso == 11) { # ISO9660.LST if (/cmp/ || /filename2open/) isiso=0 diff -r 7880bcb5c1e0 -r 26195667e7c9 syslinux/stuff/iso2exe/iso2exe.sh --- a/syslinux/stuff/iso2exe/iso2exe.sh Sun Jun 21 19:06:48 2020 +0000 +++ b/syslinux/stuff/iso2exe/iso2exe.sh Tue Jun 23 08:04:01 2020 +0000 @@ -252,19 +252,18 @@ restore_hybrid_mbr() { - if [ $(get 0 "$1") -eq 60905 ]; then + [ $(get 0 "$1") -eq 60905 ] && ddn bs=1 if="$1" of="$1" skip=$((0x1BE)) seek=0 count=3 - ddn bs=1 skip=$((0x1BE)) count=66 if="$2" | \ - ddq bs=1 seek=$((0x1BE)) count=66 of="$1" - if [ -n "$RECURSIVE_PARTITION" ]; then - for i in 0 1 2 3 ; do - n=$(get $((0x1C6+16*i)) $1 4) - [ $n -eq 0 -o $n -gt 64 ] && continue - store $((0x1C0+16*i)) 1 $1 8 - store $((0x1C6+16*i)) 0 $1 32 - store $((0x1CA+16*i)) $(($(get $((0x1CA+16*i)) $1 4)+$n)) $1 32 - done - fi + ddn bs=1 skip=$((0x1BE)) count=66 if="$2" | \ + ddq bs=1 seek=$((0x1BE)) count=66 of="$1" + if [ -n "$RECURSIVE_PARTITION" ]; then + for i in 0 1 2 3 ; do + n=$(get $((0x1C6+16*i)) $1 4) + [ $n -eq 0 -o $n -gt 64 ] && continue + store $((0x1C0+16*i)) 1 $1 8 + store $((0x1C6+16*i)) 0 $1 32 + store $((0x1CA+16*i)) $(($(get $((0x1CA+16*i)) $1 4)+$n)) $1 32 + done fi }