old-cross-binutils/binutils/testsuite/binutils-all/debug_str.s
Nick Clifton a953eec996 Fixes a problem with the BFD library running out of memory because it mistakenly
thought that an uncompressed .debug_str section was compressed.

	* compress.c (bfd_is_section_compressed): When checking the
	.debug_str section, also check the fifth byte in the section is
	not part of a string.

	* binutils-all/debug_str.s: New test.
	* binutils-all/debug_str.d: New test control file.
	* binutils-all/compress.exp: Run debug_str test.
2014-04-30 17:04:04 +01:00

12 lines
673 B
ArmAsm

/* This test is derived from a C source file which, when compiled by gcc
with debugging enabled, managed to create a .debug_str section whose
first string was ZLIB_VER_SUBVERSION. The code in bfd/compress.c
used to just check for the characters "ZLIB" at the start of a section
and then assume that the section was compressed. This meant that the BFD
library then processed the next 8 bytes as if they were the size of the
decompressed version of the section. Naturally with this test case the
resulting size was gigantic and consequently the library quickly ran out
of memory. */
.section .debug_str,"MS",@progbits,1
.string "ZLIB_VER_SUBREVISION 0"