fix 64 bit archives

Nathan Sidwell nathan@codesourcery.com
Wed Jun 23 09:35:00 GMT 2010


Hi,
This patch fixes a buffer overrun when generating the symbol map for a 64bit 
archive.  There are two loops, the outer one has a check for 'count < limit', 
but the inner one is responsible for incrementing count as it steps over a 
variable length run of symbols.  Unfortunately it fails to check for buffer end, 
and instead terminates when the abfd value changes.  Mostly this also changes 
after the end of the buffer, but sometimes it doesn't, and that leads to dumping 
out too many addresses and consequently ending up with a corrupt archive.

I took the opportunity to make the looping structure more obvious by using for 
loops rather than while loops.

built & tested on mips-linux.

ok?

nathan
-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ar.patch
Type: text/x-patch
Size: 1462 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20100623/ee116bdd/attachment.bin>


More information about the Binutils mailing list