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

replace strings in ELF .rodata sections #1344

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ahgamut
Copy link
Collaborator

@ahgamut ahgamut commented Dec 27, 2024

With tool/build/renamestr (or an equivalent feature), I hope to avoid the /zip folder when building binaries with https://github.com/ahgamut/superconfigure. Most of the folder locations involving /zip are stored in the .rodata section of the ELF binary, and /zip is more useful for the APE than the debug ELF binaries.

The current build process on superconfigure involves:

  • create a /zip folder using sudo
  • any config data that a binary requires (terminfo entries, SSL certs) is copied to /zip
  • debug binaries use the actual /zip folder (or crash)

With this PR, the build process hopefully becomes:

  • no need to create a /zip folder with sudo
  • install config data to the usual location( $LOCATION/superconfigure/cosmos/$ARCH/$SUBFOLDER)
  • run renamestr on the ELF binary to replace $LOCATION/superconfigure/cosmos/$ARCH/ to /zip, before running apelink
  • now debug binaries will work like regular ELF binaries built on a Linux system

Perhaps this feature can be part of apelink itself (the structure and some code of renamestr is copied from apelink), but I wrote a separate tool in a draft PR, for an initial exploration.

@github-actions github-actions bot added the tool label Dec 27, 2024
@ahgamut
Copy link
Collaborator Author

ahgamut commented Dec 28, 2024

Have confirmed that renamestr avoids the use of /zip for building bash and berry in superconfigure:

image

(There is a build error relating to the installation of terminfo entries, but I assume that is due my system interfering with the ncurses build process).

@ahgamut ahgamut marked this pull request as ready for review December 28, 2024 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant