Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suspicious file sizes #8

Open
mikrosk opened this issue May 26, 2024 · 4 comments
Open

Suspicious file sizes #8

mikrosk opened this issue May 26, 2024 · 4 comments

Comments

@mikrosk
Copy link
Member

mikrosk commented May 26, 2024

I have just noticed (in the snapshots):

  • mint 68000 libm.a: 438,7 KB
  • mint 68020 libm.a: 191,8 KB
  • mintelf 68000 libm.a: 632,1 KB
  • mintelf 68020 libm.a: 329,7 KB

Why are mintelf libraries larger by 200 KB? Why are 68000 libraries larger by 250-300 KB?

@th-otto
Copy link
Contributor

th-otto commented May 27, 2024

Because lots of functions are implemented by FPU instructions instead of softfloat versions.

@th-otto
Copy link
Contributor

th-otto commented May 27, 2024

I've also checked mint vs mintelf. The differences are

  • partly simple because of the file format (elf header + section table is larger than an a.out header)
  • partly because the a.out compiler puts constants into the text segment, so they can be accessed using pc-relative addressing. The elf compiler puts them into .rodata, so the assembler cannot optimize that, because it cannot assume that different sections are in range for pc-relative addressing. So the constants are accessed using absolute addressing, which is slightly larger (and also slightly slower IIRC).

@mikrosk
Copy link
Member Author

mikrosk commented May 27, 2024

Interesting, so I guess we have the first documented case when a.out is better at something. ;)

@vinriviere FYI

@th-otto
Copy link
Contributor

th-otto commented May 27, 2024

In my fork i have added an option to gcc to specify the name of the rodata segment. That would allow to place them in the text segment again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants