Giter Club home page Giter Club logo

Comments (6)

jim-wilson avatar jim-wilson commented on July 25, 2024

hidden-gp.patch.gz
Hi Khem. The issue here is that most every program and shared library uses __global_pointer$, which is equivalent to the MIPS gp symbol. libnss3.so oddly does not. I'm not sure how that can happen, but it doesn't matter. libnss3 has a DT_NEEDED pointing at libplc4.so. libplc4.so has a __global_pointer$ symbol, and it is being exported. So when you link, the linker thinks that you have a direct symbol reference to a library not on the linker command line, and that requires an error on all targets. The real problem here is that __global_pointer$ should not be exported by shared libraries. This is easy to fix. See the attached patch.

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.

from riscv-binutils-gdb.

jim-wilson avatar jim-wilson commented on July 25, 2024

Fix committed to the FSF Binutils tree. Let me know if you need the patch on one of the riscv-binutils-gdb branches.

from riscv-binutils-gdb.

rwmjones avatar rwmjones commented on July 25, 2024

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
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=0527614a9b805d1f640f477f51f9780403487ef8

from riscv-binutils-gdb.

jim-wilson avatar jim-wilson commented on July 25, 2024

Palmer just brought all upstream fixes into riscv-binutils-2.29 branch a day or two ago.

from riscv-binutils-gdb.

rwmjones avatar rwmjones commented on July 25, 2024

I didn't try the riscv-binutils-2.29 branch (why isn't riscv-tools using that branch?)

However I can confirm that the two patches above fix the issue for me.

from riscv-binutils-gdb.

jim-wilson avatar jim-wilson commented on July 25, 2024

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.

from riscv-binutils-gdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.