Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
aarch64 page-size support #80
I see that was a different solution to the same problem. Just let the user specify the page size. I thought of this but wondered how nixpkgs could feed the target page size to all of patchelf for a given platform and gave up.
My approach is to look at the architecture of the ELF being modified and use that to select page size. I think it's better but not perfect because, for example, aarch64 can have different page sizes, configured at the OS level. But 64k is a safe superset of all possible page sizes.
Ideally, the page size would be stored in the ELF file itself but that doesn't seem to be the case.
What do you think @fsateler? I don't really know how or if I should proceed.
@gitfoxi The page size is auto-detected at build time. This means that when running natively (ie, the same env that produced patchelf), the default should be correct. The page size is for operating on foreign binaries: those not generated by the same toolchain as your own patchelf binary.
Now, if you could somehow determine the page size by inspecting the elf binary, that would be awesome. As you note, the info is not readily available, so some gymnastics might be needed.