- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 510
Description
Describe the bug
Hi,
Debian currently ships patchelf 0.18.0 with a few patches on top (https://sources.debian.org/src/patchelf/0.18.0-1.4/), and it's currently failing to build on mips64el due to rename-dynamic-symbols.sh.
The full build log can be found here:
The relevant excerpt is:
[...]
needed space is 74296
shifting new PT_LOAD segment by 65536 bytes to work around a Linux kernel bug
rewriting section '.note.gnu.build-id' from offset 0x2a8 (size 36) to offset 0x60000 (size 36)
rewriting section '.interp' from offset 0x2cc (size 15) to offset 0x60028 (size 15)
rewriting section '.MIPS.abiflags' from offset 0x2e0 (size 24) to offset 0x60038 (size 24)
rewriting section '.MIPS.xhash' from offset 0x2f8 (size 22228) to offset 0x60050 (size 22228)
rewriting section '.dynstr' from offset 0x119e8 (size 11085) to offset 0x65728 (size 51978)
rewriting symbol table section 3
rewriting symbol table section 31
writing ./many-syms-main
# Run the patched tool and libraries
./many-syms-main: symbol lookup error: ./many-syms-main: undefined symbol: f225_special_suffix
FAIL rename-dynamic-symbols.sh (exit status: 127)
Unfortunately, I wasn't able to debug the problem further because the only mips64el machine I have available has an old Linux kernel (4.19.0-21-loongson-3) and the test passes there.  However, that fact caught my attention and I noticed a slight difference between what's in the log above and what I got when trying to reproduce the issue.
The log above mentions the .MIPS.xhash section explicitly, while the log I got when running the tests on the older kernel doesn't:
rewriting section '.MIPS.abiflags' from offset 0x200 (size 24) to offset 0x60000 (size 24)
rewriting section '.MIPS.options' from offset 0x218 (size 200) to offset 0x60018 (size 200)
rewriting section '.dynamic' from offset 0x308 (size 480) to offset 0x600e0 (size 496)
rewriting section '.dynstr' from offset 0xf078 (size 10978) to offset 0x602d0 (size 10992)
So, in a nutshell:
- The system with the newer Linux kernel generates a .MIPS.xhashsection, and the test fails.
- The system with the older Linux kernel does not generate the .MIPS.xhashsection, and the test passes.
As mentioned above, I wasn't able to get my hands on a mips64el system running a recent Linux kernel, so I don't know if this bug has been fixed or not. Apologies if it has.
Steps To Reproduce
Apparently, building patchelf on a mips64el system with a recent Linux kernel will trigger the failure.
Expected behavior
The testsuite passes.
patchelf --version output
0.18.0 + Debian patches.