GNU bug report logs - #58033
PatchELF can create broken ELF binaries

Previous Next

Package: guix;

Reported by: Lukasz Olszewski <dev <at> lukaszolszewski.info>

Date: Fri, 23 Sep 2022 22:36:02 UTC

Severity: normal

Full log


Message #20 received at 58033 <at> debbugs.gnu.org (full text, mbox):

From: Lukasz Olszewski <email <at> lukaszolszewski.info>
To: 58033 <at> debbugs.gnu.org
Subject: Re: bug#58033: A bug in file-dynamic-info used by validate-runpath in
 gnu-build-system and others.
Date: Sun, 25 Sep 2022 13:27:47 +0200
Sorry, for multiple emails with the same content. There was a delay of
over 10h in those emails showing up and I thought they were not
getting through.

Regarding the issue. It seems it has to do with the strip phase. I
managed to replicate the whole issue outside the build system by
taking binaries backed up after install.

Then if I run $ strip --strip-unneeded --enable-deterministic-archives
file the files can be run fine, but if I use patchelf to add an extra
folder to the rpath strip complains like this:
$ strip --strip-unneeded --enable-deterministic-archives
/home/luk/dev/backup_FileStoreTest
strip: /home/luk/dev/stt5WKN1: warning: allocated section `.dynstr'
not in segment

Then the binary has its elf header mangled as described previously.

By copying the unmodified file, modifying rpath and running strip a
couple of times I found that there is no problem if the rpath change
results in rpath of the same or shorter length, but adding even one
byte to it makes 'strip' later complain and mangle the binary.

Regards,
Lukasz




This bug report was last modified 2 years and 188 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.