patchelf icon indicating copy to clipboard operation
patchelf copied to clipboard

Add --remove-needed-version

Open chitao1234 opened this issue 1 year ago • 11 comments

This pr adds a new switch --remove-needed-version, to removing symbol versioning used by libraries like glibc. This switch should fix the use case of issue #284, #252.

I have included a regression test and updated the man page.

chitao1234 avatar Aug 03 '24 07:08 chitao1234

i hope this gets added because i regularly run into this use case when dealing with either legacy software or when copying software to unsusual platforms like the steamdeck.

my current issue is trying to copy waypipe to steamdeck

jfmherokiller avatar Aug 04 '24 15:08 jfmherokiller

Thank you for the great tool

It works fine with gnu toolchain, but when I compile with clang I get

patchelf: /home/maxirmx/Projects/tebako/deps/src/_patchelf/src/patchelf.cc:946: void ElfFile<Elf64_Ehdr, Elf64_Phdr, Elf64_Shdr, unsigned long, unsigned long, Elf64_Dyn, Elf64_Sym, unsigned short, Elf64_Verdef, Elf64_Verdaux, Elf64_Verneed, Elf64_Vernaux, Elf64_Rel, Elf64_Rela, 64>::rewriteSectionsExecutable() [Elf_Ehdr = Elf64_Ehdr, Elf_Phdr = Elf64_Phdr, Elf_Shdr = Elf64_Shdr, Elf_Addr = unsigned long, Elf_Off = unsigned long, Elf_Dyn = Elf64_Dyn, Elf_Sym = Elf64_Sym, Elf_Versym = unsigned short, Elf_Verdef = Elf64_Verdef, Elf_Verdaux = Elf64_Verdaux, Elf_Verneed = Elf64_Verneed, Elf_Vernaux = Elf64_Vernaux, Elf_Rel = Elf64_Rel, Elf_Rela = Elf64_Rela, ElfClass = 64]: Assertion `lastReplaced != 0' failed.

Do you think it can be fixed ?

maxirmx avatar Aug 31 '24 18:08 maxirmx

@maxirmx Thanks for your error report.

Could you check the new commit for whether the problem persists?

chitao1234 avatar Sep 03 '24 05:09 chitao1234

@maxirmx Thanks for your error report.

Could you check the new commit for whether the problem persists?

Thank you, @chitao1234. You have fixed it.

maxirmx avatar Sep 03 '24 08:09 maxirmx

@chitao1234 Do you consider releasing this version on your own ?

maxirmx avatar Sep 03 '24 10:09 maxirmx

Would love to this new feature merged!

kcgthb avatar Oct 31 '24 21:10 kcgthb

+1 on getting this merged please!!

Noodlez1232 avatar Jan 07 '25 01:01 Noodlez1232

Any progress on this? I also have a few usecases for this feature, and it would be great to see it merged.

peeley avatar Jan 18 '25 20:01 peeley

Would love to see this too

LekKit avatar Jun 19 '25 09:06 LekKit

@Mic92 Would you mind having a look a this one ? Is is ready to ship and can unbreak the tool in some cases.

layus avatar Jun 26 '25 12:06 layus

@peeley

Any progress on this? I also have a few usecases for this feature, and it would be great to see it merged.

i have a little script that does very unelegantly strip version info. maybe could be of help. https://github.com/ohnekopf/elfnover

ohnekopf avatar Aug 12 '25 20:08 ohnekopf