-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential Debug information corruption in the example\minimal object file #30
Comments
I have no idea what the problem is here. The CU (compilation unit) record in DWARF does not appear to have any attribute that talks about relocations or sizes of such. As far as I understand, a relocation is a mechanism to change a value in the output file based on placement of sections. It is a concern for the object file format (ELF in this case) and is not something that belongs to DWARF. Relocations can alter values (addresses) in DWARF sections as needed, but that is a mechanism related to ELF and the linker. Debug information (DWARF sections) are mostly passed through with minimal processing in the linker for performance and is intended for consumption in the debugger (if program is loaded in a debugger). For some operating systems lacking virtual memory relocations can also be applied at load time, examples are AmigaOS, TOS and (I believe) Apple IIgs. Is it possible to find further details on what the problem is here? |
I do not have much to add at the moment. I use a 68000 based platform, without Operating System. |
I'm using the new Calypsi 5.7 toolchain for 68000, and still have difficulties to read the DWARF information in the provided example found with the toolchain. calypsi-68000-5.7\example\minimal What tool do you use to verify an object file from compilation and/or the elf file generated by the Calypsi's linker? |
The tools I have used is This is a rather deep rabbit hole. DWARF is a format, not a strict standard. They encourage extensions and working with it as a basis rather than enforcing how it should be done. The reason probably being to make it more generally useful than something that gets in people's way. I wonder what the goal is here, do you want to use a debugger? In that case it is provided with the toolchain. |
I have integrated a UI debugger in my Atari Jaguar (68000 cpu) emulator; currently supporting DWARF 2 support, my goal is to support DWARF 5 too. The debugger features can display call stack, local variables, to trace at source code level, among others stuffs. I'm using the libdwarf library which is widely used by developers (for what I know). For test, I'm using the example\minimal project provided with the Calypsi's toolchain. Using a GNU objdump, such as m68k-elf-objdump.
With GNU readelf, such as m68k-elf-readelf, on the main.elf; this tool report corrupt table in the .debug_line section by example. |
Getting all that to work would be work I am not able to commit to at this point. What would have to be done is debugging the reader and figure out what is actually wrong. The error messages only says that it is not happy. The only way I managed to implement DWARF was that the family went away for a month so I got a whole month of quiet focus time to work on it. This was some years ago. I do not have that luxury these days, sadly. |
Sure, I understand and thank you for your work too. |
Using the Calypsi 4.4 example\minimal project to check the object file content.
Used dwarfdump and readelf tools to check/dump the object file and tools reported error in the obj.
By example, dwarfdump --check-all reported:
"ERROR: Failure reading CU header or DIE, corrupt DWARF: DW_DLE_RELOC_SECTION_RELOC_TARGET_SIZE_UNKNOWN (233) so doing a relocation is unsafe. Attempting to continue."
The text was updated successfully, but these errors were encountered: