linker can not load libraries metioned in DT_NEEDED section of another library #108
Comments
hidden-gp.patch.gz Unfortunately, I don't have an easy way to prove that this patch works. It requires relinking libplc4.so. I don't have a full riscv linux environment, just a simple busybox based one, and this bug does not show up on that system. I have not yet been able to write a simple testcase that reproduces the problem. |
Fix committed to the FSF Binutils tree. Let me know if you need the patch on one of the riscv-binutils-gdb branches. |
For future reference the commits which appear to fix this are: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=da02107a39f3eff5e0b6d6321da4e88f9564350a |
Palmer just brought all upstream fixes into riscv-binutils-2.29 branch a day or two ago. |
I didn't try the riscv-binutils-2.29 branch (why isn't However I can confirm that the two patches above fix the issue for me. |
riscv-tools does use the riscv-binutlis-2.29 branch of the riscv-binutils-gdb tree. However, the use of git submodules means that you don't automatically get updates from that branch. And the fact that binutils is actually two suibmodule levels down makes it more complicated. In general, there is a lack of documentation for what the various riscv projects are used for, who maintains them, how they are maintained, etc. I use riscv-gnu-toolchain myself, because it is used by the sifive freedom-u-sdk and freedom-e-sdk. I don't know what riscv-tools is for, and haven't used it myself. I'd prefer that everyone just move to the upstream trees which are better documented. Anyways, you can get updates in riscv-binutils-gdb if you want them. Just cd into the dir, run "git branch" to see that HEAD is in a detached state on the riscv-binutils-2.29 branch. Then "git checkout riscv-binutils-2.29" to checkout the head of the branch, and then a "git pull" to get the latest version of it. Once you've done this, if you run a "git submodule update --init --recursive" in either or the two parent dirs, then you go back to the original state, and you will have to checkout and pull again to get the top of the release tree. |
Test case
https://uclibc.org/~kraj/riscv-linker-test.tar.bz2
Fails to link
This example works ok on other architectures. Adding
-lplc4
to cmdline then link succeeds. Issue is observed in multiple packages.Here is DT_NEEDED entries for libnss3.so
The text was updated successfully, but these errors were encountered: