unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Lukasz Olszewski <email@lukaszolszewski.info>
Cc: 58033@debbugs.gnu.org
Subject: bug#58033: A bug in file-dynamic-info used by validate-runpath in gnu-build-system and others.
Date: Fri, 07 Oct 2022 10:31:20 +0200	[thread overview]
Message-ID: <87y1tsdoh3.fsf@gnu.org> (raw)
In-Reply-To: <CACwB4R5_8Viwqa-z6afTtSroFzXOQEu3GhM6qWYq-jZkxOM6+g@mail.gmail.com> (Lukasz Olszewski's message of "Sun, 25 Sep 2022 13:27:47 +0200")

Hi Lukasz,

Lukasz Olszewski <email@lukaszolszewski.info> skribis:

> 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.

I believe PatchELF has the potential to break binaries, especially when
trying to extend RUNPATH (the data has to fit in the string table;
PatchELF is supposed to be able to grow the string table as needed, but
there might be bugs.)

It looks like a workaround is to not run ‘strip’, right?

Ludo’.




  reply	other threads:[~2022-10-07  8:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23 22:28 bug#58033: A bug in file-dynamic-info used by validate-runpath in gnu-build-system and others Lukasz Olszewski
2022-09-24 11:23 ` Lukasz Olszewski
2022-09-24 12:04   ` Lukasz Olszewski
2022-09-24 17:01 ` Lukasz Olszewski
2022-09-24 21:37   ` Lukasz Olszewski
2022-09-25 11:27 ` Lukasz Olszewski
2022-10-07  8:31   ` Ludovic Courtès [this message]
2023-02-11 19:43 ` bug#58033: PatchELF can create broken ELF binaries Maxime Devos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y1tsdoh3.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=58033@debbugs.gnu.org \
    --cc=email@lukaszolszewski.info \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).