[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/24455] New: strip -S after patchelf damages the file
From: |
ilg at livius dot net |
Subject: |
[Bug binutils/24455] New: strip -S after patchelf damages the file |
Date: |
Mon, 15 Apr 2019 17:07:17 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=24455
Bug ID: 24455
Summary: strip -S after patchelf damages the file
Product: binutils
Version: 2.31
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: binutils
Assignee: unassigned at sourceware dot org
Reporter: ilg at livius dot net
Target Milestone: ---
While building cross toolchains, I faced several crashes, that I traced to a
mismatch between patchelf & strip.
The build procedure needs to patch the binaries, to set the rpath to $ORIGIN.
The tool to do this is 'patchelf', v0.10, and the command is 'patchelf
--set-rpath '$ORIGIN' "${file_path}"'.
At the end of the build procedure all binaries are striped. When applied to
patched binaries, 'script' complains about a section (.dynsym) and probably
leaves the file in an inconsistent state.
When run, the patched & stripped files fail with errors like:
relocation error:
/Host/Users/ilg/Work/riscv-none-gcc-8.2.0-2/linux-x64/install/riscv-none-gcc/bin/riscv-none-embed-as:
symbol , version GLIBC_2.2.5 not defined in file libc.so.6 with link time
reference
---
'patchelf' may share part of the blame, but even so, 'strip' should not damage
the file, it should validate the input elf and report the error.
Ideally, 'strip' should be more tolerant, and understand the patched binaries,
the loader has no problems with them.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug binutils/24455] New: strip -S after patchelf damages the file,
ilg at livius dot net <=