code generation
Ian Lepore
ian at freebsd.org
Sun May 31 16:15:49 UTC 2020
On Sat, 2020-05-30 at 23:52 +0200, Jack Raats wrote:
> Hi,
>
> Can anyone explain why a simple hello_world.c compiles on a AMD64
> machine
> to +/- 21000 bytes while on a raspberry pi 3 +/- 206000 bytes (10
> times
> more)
>
> I use FreeBSD 12.1 stable on RPi3 and cc -o hello hello.c to compile.
>
> Gr.,
> Jack
>
>
I recall some discussion recently about sections of executable files in
arm binaries now being aligned to a much larger page size than the old
4K alignment. When you have a mix of readonly and readwrite data, they
have to go into separate sections/pages so that proper read/write
permission bits can be set on the pages containing the data.
So all in all, this is probably lots and lots of zero-padding in the
files that didn't used to be there. It's onerous only in that it makes
a large collection of small programs (e.g., /usr/bin) take a lot more
disk space.
-- Ian
More information about the freebsd-arm
mailing list