[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 'substitute*' fails with "string contains #\nul character"
From: |
Ludovic Courtès |
Subject: |
Re: 'substitute*' fails with "string contains #\nul character" |
Date: |
Mon, 19 Aug 2013 00:13:42 +0200 |
User-agent: |
Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) |
Nikita Karetnikov <address@hidden> skribis:
>> For the purposes of bootstrapping GHC, I would rather steal whatever
>> trick Nixpkgs uses, though. :-)
>
> I can’t find anything relevant there. I suppose that Nix people don’t
> have to touch those binaries since they have ‘/bin/sh’ in a chroot.
What string exactly are you trying to patch? Just /bin/sh? In which
binary?
>> ELF tools like Andy Wingo’s tools being added to Guile 2.1, or maybe BFD
>> (part of Binutils), might allow you to modify the ELF string table that
>> contains string constants.
>
> Are you talking about the (system vm elf) module?
I think so.
> I’ve been trying to cook a patch but haven’t succeeded yet. Even
> though I’ve looked through the ELF spec and this handy tutorial [1],
> some things are still not clear.
[...]
> For instance, in order to change the “Hello” part, I have to adjust the
> corresponding section (i.e., “.rodata”). Assuming that sections are
> stored in order, I have to modify the offsets of the subsequent sections
> and the offset of the section header table itself if I change the size
> of “.rodata.” Finally, I can combine the changed executable header
> (contains the offset of the section table header), the sections, and the
> section table header.
>
> Is it correct?
I’m not sure about the details. I would have expected tools like BFD or
libelf to provide the necessary support to make this kind of operation
easier, but I’ve never tried myself.
Ludo’.
- Re: 'substitute*' fails with "string contains #\nul character", Nikita Karetnikov, 2013/08/05
- Re: 'substitute*' fails with "string contains #\nul character", Ludovic Courtès, 2013/08/15
- Re: 'substitute*' fails with "string contains #\nul character", Nikita Karetnikov, 2013/08/18
- Re: 'substitute*' fails with "string contains #\nul character",
Ludovic Courtès <=
- Re: 'substitute*' fails with "string contains #\nul character", Nikita Karetnikov, 2013/08/18
- Re: 'substitute*' fails with "string contains #\nul character", Ludovic Courtès, 2013/08/19
- Re: 'substitute*' fails with "string contains #\nul character", Nikita Karetnikov, 2013/08/20
- Re: 'substitute*' fails with "string contains #\nul character", Ludovic Courtès, 2013/08/20
- Re: 'substitute*' fails with "string contains #\nul character", Nikita Karetnikov, 2013/08/21