[PATCH] Debug information checking

Andrew Stubbs ams@codesourcery.com
Thu Mar 12 10:24:00 GMT 2009


Hi all,

I'm investigating a problem in which I see the following message:

> arm-none-eabi-ld: Dwarf Error: Offset (273) greater than or equal to .debug_str size (268).

Unfortunately, I haven't figured out what's causing the problem, but I 
have discovered that the linker only detects this condition some of the 
time - specifically when it is the first read from the .debug_str 
section. The rest of the time it just reads from the offset even though 
it's out of range.

Note that you only get to this code when there are undefined symbols and 
the link is about to fail - it's looking for the filename and line number.

The attached patch ensures that it never misses a broken offset.

Does anybody have any clues what could be causing the real problem - the 
apparently broken debug info? The size given for .debug_str is 
incorrect, but I don't yet know why.

Anyway, is this patch OK?

Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-offset.patch
Type: text/x-diff
Size: 3141 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20090312/672b9cf0/attachment.bin>


More information about the Binutils mailing list