Comments (6)
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.
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.
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.
Palmer just brought all upstream fixes into riscv-binutils-2.29 branch a day or two ago.
from riscv-binutils-gdb.
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.
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)
- How gdb register csr HOT 2
- riscv64 gdb doesn't recognize riscv32 symbol tables: "Sorry, Dave" HOT 1
- GDB internal error HOT 1
- About the opcode constraints documentation. HOT 3
- What is the expected behavior upon hitting a EBREAK? HOT 3
- riscv-binutils-2.35-rvb: `_`instead of `.` ? HOT 2
- How to add a new custom instruction? HOT 6
- riscv-binutils-2.35-rvb: wrong match for xperm.h HOT 2
- a tricky one about gdb HOT 5
- Overlappings on the operand name for p ext
- Registers are interpreted as 64-bit when architecture is set to rv32 HOT 2
- ld: cannot find default versions of the ISA extension `i', when linking rv32e HOT 5
- GDB build fails on CentOS 7.9.2009 HOT 1
- Is there a way to let gdbserver instruct gdb client to use compressed breakpoints? HOT 2
- objdump cant correctly dissemble instructions that reuse other's encoding
- right way to compress branching instuction (decbnez from ZCE extension)
- Objdump and auipc: the immediate value should be displayed shifted HOT 2
- Does anyone know the status about zfh support of binutils? HOT 5
- GDB Single Step fails on RISCV, EL2 with ICCM HOT 1
- continue function not working??? HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from riscv-binutils-gdb.