News for hackers. Stuff that matters.
Re:What Is Nix? by bennofs on Thursday May 21, 2020 @05:59AM (#23256597)
Modifying a string in ELF is hard. As long as the string has the same length as the original one, it has a good chance to work (but still fails for compressed data). But if you want an arbitrary directory, you need to replace it with a different length path, and that will probably break a lot of things.
Re:What Is Nix? by takeda on Thursday May 21, 2020 @12:00PM (#23260071)
The nix author created utility called patchelf which is used by nix all the time during the build (to rewrite library paths).

As far as I know it creates a new elf each time it is called (it doesn't modify a file on place) so the length of library name is not an issue.

Re:What Is Nix? by foldr on Thursday May 21, 2020 @07:01AM (#23256943)
It's not that hard if you leave some spare space for string constants in the .rodata section. Nix already patches ELF executables as things stand.