mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 04:49:54 +08:00
Add demangling support to readelf.
PR binutils/26331 * readelf.c (do_demangle): New option flag. (print_symbol): If do_demangle is enabled, demangle the symbol. (enum long_option_values): New enum to hold long option values. (options): Add demangle, no-demangle, recursion-limit and no-recursion-limit options. Alpha sort the table. (usage): Describe the new options. (parse_args): Handle the new options. * NEWS: Mention the new feature. * doc/binutils.texi: Document the new feature. * testsuite/binutils-all/readelf.exp: Test the new feature. * testsuite/binutils-all/mangled.s: New file - assembler source. * testsuite/binutils-all/readelf.demangled: New file - expected output from readelf.
This commit is contained in:
6
binutils/testsuite/binutils-all/mangled.s
Normal file
6
binutils/testsuite/binutils-all/mangled.s
Normal file
@ -0,0 +1,6 @@
|
||||
.text
|
||||
|
||||
.global _ZN4gold12Output_relocILi9ELb1ELi64ELb0EEC2EPNS_12Sized_relobjILi64ELb0EEEjjPNS_11Output_dataEmbbbb
|
||||
_ZN4gold12Output_relocILi9ELb1ELi64ELb0EEC2EPNS_12Sized_relobjILi64ELb0EEEjjPNS_11Output_dataEmbbbb:
|
||||
.dc.d 0
|
||||
|
5
binutils/testsuite/binutils-all/readelf.demangled
Normal file
5
binutils/testsuite/binutils-all/readelf.demangled
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
Symbol table '.symtab' contains .* entries:
|
||||
#...
|
||||
.*gold::Output_reloc<9, true, 64, false>::Output_reloc\(gold::Sized_relobj<64, false>\*, unsigned int, unsigned int, gold::Output_data\*, unsigned long, bool, bool, bool, bool\)
|
||||
#pass
|
@ -345,12 +345,28 @@ if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
|
||||
readelf_test -r $tempfile readelf.r {}
|
||||
}
|
||||
|
||||
# Test demangling symbol names.
|
||||
if {![binutils_assemble $srcdir/$subdir/mangled.s tmpdir/mangled.o]} then {
|
||||
unresolved "readelf -s -C bintest (failed to assemble)"
|
||||
} else {
|
||||
|
||||
if ![is_remote host] {
|
||||
set tempfile tmpdir/mangled.o
|
||||
} else {
|
||||
set tempfile [remote_download host tmpdir/mangled.o]
|
||||
}
|
||||
|
||||
# Run the test.
|
||||
readelf_test {--syms --demangle --wide} $tempfile readelf.demangled {}
|
||||
}
|
||||
|
||||
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 {
|
||||
unresolved "readelf -n version (failed to assemble)"
|
||||
|
Reference in New Issue
Block a user