Link for xv6: https://github.com/mit-pdos/xv6-public
Source of binutils 2.44: brew install binutils
System: Ubuntu 24.04 LTS (WSL)
{{ note: you need to add __attribute__((noreturn)) to runcmd and
-Wno-array-bounds to suppress unimportant warnings }}

When compiled with gcc-13, as 2.42, ld 2.42 the kernel size on compilation
is ~200kB. When compiled with gcc-15, as 2.44, ld 2.44 the size of the
kernel is ~130 MB. When compiled with gcc-13, as 2.42, ld 2.44 the size is
again ~200 kB so I suppose as 2.44 is the culprit. I cannot use gcc-15 with
as 2.42 because of .base64 pseudo-op error.

Analysis of binary:
It looks as if the .data segment gets bloated by as 2.44. On changing the
.data entry in kernel.ld file to .data (NOLOAD), the file size of (now
not-working) kernel becomes ~190kB. There is a massive virtual address gap
between .data and .bss segments. The type of the binary is as expected
(using file kernel).


Result:
Extremely slow kernel loading (never loaded completely whenever I waited).
Tried some flags to the compiler and as that could reduce memory
consumption to no avail.

Reply via email to