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

Fix a variety of memory management issues #17

Merged
merged 7 commits into from
Dec 8, 2024
Merged

Conversation

ghaerr
Copy link

@ghaerr ghaerr commented Dec 8, 2024

Based on issues found when rewriting ELKS sbrk/brk and stack check routines. (To be posted on ELKS shortly).

This PR fixes the following:

  • Realloc bug in nasm and nasm32
  • Removes buggy alloca in ar86. Now checks for alloca failure for symtab.
  • Adds stddef.h header for C86
  • Attempts to add standard 4K stack and 16k heap sizes for tools. This turned out a bit tricky, since some tools are almost out of heap space.

Tested toolchain on ELKS using rewritten ELKS libc malloc, all working. (PR coming shortly for malloc fix on ELKS).

@rafael2k rafael2k merged commit 2327b2c into rafael2k:dev Dec 8, 2024
@rafael2k
Copy link
Owner

rafael2k commented Dec 8, 2024

Thanks @ghaerr. Indeed, with nasm we are tight on memory...

@ghaerr
Copy link
Author

ghaerr commented Dec 8, 2024

Thanks @rafael2k. You'll want to use the enhancements in ghaerr/elks#2128 for your further testing.

You might also notice I added a "make copy" which can be used after a "make" all, this copies libc.a and elks-bin/* to the ELKS rootfs_template/root directory (home directory of /root) for easier QEMU testing of binaries.

@ghaerr ghaerr deleted the realloc branch December 8, 2024 01:16
rafael2k pushed a commit that referenced this pull request Jan 13, 2025
Revert don't prefix __alloca modification in C86
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

Successfully merging this pull request may close these issues.

2 participants