mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-27 04:50:28 +00:00
Make dos errno multimapping linkage tinier
640 bytes for old kDos2Errno table 182 bytes for new kDos2Errno under hello2.com (MODE=fastbuild) 122 bytes for new kDos2Errno under hello2.com (MODE=tiny)
This commit is contained in:
parent
9fa6725067
commit
8f5678882d
63 changed files with 602 additions and 160 deletions
|
@ -29,9 +29,17 @@ scall() {
|
|||
}
|
||||
|
||||
syscon() {
|
||||
if [ -f "libc/sysv/dos2errno/${2/$/-}.S" ]; then
|
||||
EXT=".S"
|
||||
else
|
||||
EXT=".s"
|
||||
fi
|
||||
{
|
||||
echo ".include \"o/libc/sysv/consts/syscon.internal.inc\""
|
||||
echo ".syscon" "$*"
|
||||
if [ -f "libc/sysv/dos2errno/${2/$/-}.S" ]; then
|
||||
echo ".yoink kDos2Errno.${2/$/-}"
|
||||
fi
|
||||
} >"$dir/${2/$/-}.s"
|
||||
}
|
||||
|
||||
|
@ -59,3 +67,23 @@ errfun() {
|
|||
' "$ERRNO" "$NAME"
|
||||
} >"$dir/${1/$/-}.S"
|
||||
}
|
||||
|
||||
dos() {
|
||||
DOS="$1"
|
||||
UNIX="$2"
|
||||
if ! [ -f "$dir/${UNIX/$/-}.S" ]; then
|
||||
cat <<EOF >"$dir/${UNIX/$/-}.S"
|
||||
// generated by libc/sysv/dos2errno.sh
|
||||
#include "libc/nt/errors.h"
|
||||
.macro .e doscode systemv
|
||||
.short \doscode
|
||||
.long \systemv
|
||||
.endm
|
||||
.section .sort.rodata.dos2errno.2,"a",@progbits
|
||||
.globl kDos2Errno.${UNIX}
|
||||
.type kDos2Errno.${UNIX},@object
|
||||
kDos2Errno.${UNIX}:
|
||||
EOF
|
||||
fi
|
||||
printf %s\\n " .e ${DOS},${UNIX}" >>"$dir/${UNIX/$/-}.S"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue