mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 12:23:31 +08:00
Restore readelf's string dump to previous behaviour where newlines were caused line breaks.
PR 25543 * readelf.c (dump_section_as_strings): Display new-line characters as \n and then insert a line break. * testsuite/binutils-all/pr25543.s: New test. * testsuite/binutils-all/pr25543.d: Test driver. * testsuite/binutils-all/readelf.exp: Run the new test.
This commit is contained in:
12
binutils/testsuite/binutils-all/pr25543.d
Normal file
12
binutils/testsuite/binutils-all/pr25543.d
Normal file
@ -0,0 +1,12 @@
|
||||
#source: pr25543.s
|
||||
#readelf: -p.data
|
||||
#notarget: rx-*
|
||||
|
||||
String dump of section '.data':
|
||||
\[ 0\] line1 : This is a line without a newline at the end
|
||||
\[ 34\] line2 : This is a line with a newline at the end\\n
|
||||
\[ 66\] line3 : This is a line with a \\n
|
||||
newline in the middle
|
||||
\[ 9b\] line4 : This is a line with a \^Mcontrol character
|
||||
\[ cd\] line6 : The previous line was empty\\n
|
||||
#pass
|
7
binutils/testsuite/binutils-all/pr25543.s
Normal file
7
binutils/testsuite/binutils-all/pr25543.s
Normal file
@ -0,0 +1,7 @@
|
||||
.data
|
||||
.asciz "line1 : This is a line without a newline at the end"
|
||||
.asciz "line2 : This is a line with a newline at the end\n"
|
||||
.asciz "line3 : This is a line with a \nnewline in the middle"
|
||||
.asciz "line4 : This is a line with a \rcontrol character"
|
||||
.asciz ""
|
||||
.asciz "line6 : The previous line was empty\n"
|
@ -349,6 +349,7 @@ readelf_wi_test
|
||||
readelf_compressed_wa_test
|
||||
|
||||
readelf_dump_test
|
||||
run_dump_test "pr25543"
|
||||
|
||||
# PR 13482 - Check for off-by-one errors when dumping .note sections.
|
||||
if {![binutils_assemble $srcdir/$subdir/version.s tmpdir/version.o]} then {
|
||||
|
Reference in New Issue
Block a user