patchelf icon indicating copy to clipboard operation
patchelf copied to clipboard

Do patchelf modify lib's section offset?

Open Rewyear opened this issue 4 years ago • 1 comments

Hi I'm trying to check the following issue

mylib.so don't have SONAME.

So, I added SONAME by using patchelf like below command

patchelf --set-soname "libmylib.so" libmylib.so And i checked elf info by using "readelf -a"

Next, I used 'prelink' for reducing boot time.

but error occurred with below log

root@:~# prelink -aRm
prelink: /usr/lib/libmylib.so: section file offsets not monotonically increasing

Maybe... I think that patchelf have effects on mylib's elf info, structure

Do patchelf modify lib section offset?

I wonder how patchelf affects elf info.

When patchelf add soname, Doesn't it increase a section offset monotonically?

Rewyear avatar Jun 24 '21 01:06 Rewyear

In order to insert new strings it needs to change offsets of existing sections. You should be able to see the changes by looking at the file offsets in the output readelf -S.

Mic92 avatar Aug 10 '21 06:08 Mic92