Comments (2)
libbacktrace only works with a fully linked executable. Are you saying that clang generates an executable with a .rel.debug_info section? Is there any spec for that?
from libbacktrace.
Yes, you're right, and I think we even had this discussion before. I've been using libbacktrace to extract debug data (like function prototypes) from object/archive files on disk - it's much faster than all the other alternative libraries I've looked at. I guess I'll close this.
But yes, to answer your questions: clang generates an executable with a .rel.debug_info section, specifically for strp entries. So when you normally have a strp entry with an offset into the .debug_str section (like a filename, function name, etc.) the actual offset into the .debug_str section isn't emitted directly into the .debug_info section, but as 0 instead there, with a relocation entry in the .rel.debug_info section that fixes it up.
I'm not sure there is or even has to be a spec for this, I suppose it'd be covered by the normal ELF relocation spec, just applied to the .debug_info section?
Now, overall, I don't really see any good reason for this - these entries aren't dynamic, they're just offsets into the string section, and I doubt clang gains anything by emitting things in this way. It makes the binary bigger by the .rel.debug_info section too. It could be that it does this because it emits the .debug_info section before the .debug_str section or so, but I can't really think of any fundamental reason for doing so - could build/emit them at around the same time and still dedup strings.
Interestingly I found that "objdump" is able to parse this, whereas "readelf" also doesn't expect this type of thing.
from libbacktrace.
Related Issues (20)
- No backtrace with Mingw64 and clang++ HOT 3
- MUSL CRuntime used by Alpine Linux HOT 5
- Build Issue MacOS
- libbacktrace does not include the origin library in its description.
- Libbacktrace fails to resolve symbols, even though the debug information is present HOT 5
- Libbacktrace issue with mingw HOT 4
- Libbacktrace fails to resolve symbols, if debug/symbol information resides (only) in a seperate file HOT 9
- Libbacktrace doesn't work on Linux ARM-32 bits HOT 2
- Can't get information in main() HOT 3
- Is it safe to load two executables? HOT 1
- mismatch with glibc backtrace HOT 5
- mtest_minidebug test failed HOT 6
- how can I build and install it? HOT 1
- Unlike GDB, LLVM ORC generated functions are not resolved HOT 1
- please add hints to error message "no debug info in Mach-O executable" HOT 3
- Test suite failures on macOS 12
- No longer works with gcc 11.2 (on Kubuntu 22.04 or 21.10) HOT 1
- Getting null values in backtrace HOT 1
- Optional fall back to LLVM symbolizer markup HOT 5
- libbacktrace giving only relative path, even when absolute path is available in DWARF information HOT 3
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 libbacktrace.