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

Handle .relr.dyn section #1626

Merged
merged 1 commit into from
Jul 2, 2024
Merged

Conversation

Coekjan
Copy link
Contributor

@Coekjan Coekjan commented Jul 2, 2024

@Coekjan
Copy link
Contributor Author

Coekjan commented Jul 2, 2024

Because RELR is a new feature introduced since glibc 2.36, current ubuntu-20.04 runners may not support this feature, resulting in these compilation errors. I think we could have 2 options:

  1. do something to the runner (e.g. upgrade it), and let it support RELR:
    • benefit: users who runs new programs (using RELR) will be happy.
    • drawback: to let the runner support RELR may need some engineering efforts on CI.
  2. do something to the code (e.g. conditionally compile the part about RELR):
    • benefit: no need to adapt CI.
    • drawback: users' x64 apps (using RELR) can not run on these prebuilt box64 binaries.

@rajdakin
Copy link
Collaborator

rajdakin commented Jul 2, 2024

  1. You can also conditionally copy/paste the new definitions in a header (something like:
#ifndef DT_RELR
typedef struct Elf64_Relr {
    (omitted)
} Elf64_Relr;
#define DT_RELR (omitted)
#define DT_RELRSZ (omitted)
#define DT_RELRENT (omitted)
...
#endif

somewhere in the elfloader.h file)

  • benefit: users who run newer programs (which use relr) will be happy
  • also benefit: no need to adapt the CI

@Coekjan Coekjan force-pushed the handle-relr-dyn-section branch 2 times, most recently from 9b8c176 to 712f3b6 Compare July 2, 2024 10:49
@Coekjan
Copy link
Contributor Author

Coekjan commented Jul 2, 2024

You can also conditionally copy/paste the new definitions in a header

I think this is good for now, and in the future if glibc 2.36 is widely used, we can remove these copied-pasted definitions.

@Coekjan Coekjan force-pushed the handle-relr-dyn-section branch 2 times, most recently from 795a769 to 10feff1 Compare July 2, 2024 10:59
@ptitSeb ptitSeb merged commit 9cd8812 into ptitSeb:main Jul 2, 2024
34 checks passed
@Coekjan Coekjan deleted the handle-relr-dyn-section branch July 2, 2024 11:53
Javier97sm pushed a commit to Javier97sm/box64 that referenced this pull request Aug 16, 2024
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.

Box64 Seems Failing to Handle .init_array
3 participants