forked from atomicobject/VMWareFB_OpenStep
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkl_ld_patch.diff
More file actions
31 lines (27 loc) · 1.02 KB
/
kl_ld_patch.diff
File metadata and controls
31 lines (27 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- /Volumes/Darwin/new_kernel/reference/kernload/cmds/kl_ld/kl_ld 2025-08-14 14:56:20
+++ kl_ld_patched 2025-08-14 21:34:45
@@ -80,15 +80,16 @@
# Add padding to make section larger than 8 bytes to prevent truncation
# Pad to 16 bytes total to ensure ld doesn't truncate
-name_len=$(printf "%s\0" "$KL_name" | wc -c)
-pad_needed=$((16 - name_len))
+# Use expr for arithmetic compatibility with older shells
+name_len=`printf "%s\0" "$KL_name" | wc -c`
+pad_needed=`expr 16 - $name_len`
if [ $pad_needed -gt 0 ]; then
# Add null padding bytes
dd if=/dev/zero bs=1 count=$pad_needed 2>/dev/null >> $KL_name_file
fi
-# Use 16-byte alignment to match the padded section size
-KL_name_sect="-sectalign $LS $KL_name_name 16 \
+# Use standard 1-byte alignment - let the 16-byte size prevent truncation
+KL_name_sect="-sectalign $LS $KL_name_name 1 \
-sectcreate $LS $KL_name_name $KL_name_file"
KL_lc_name="\"Load Commands\""
\ No newline at end of file
@@ -148,4 +149,4 @@
fi
fi
-exit 0
+exit 0
\ No newline at end of file