mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 01:07:52 +00:00
nm: also retrieve size for COFF function symbols
Like ELF for all symbols, COFF can record size for at least function ones. Use that - if available - in preference to the distance-to-next- symbol heuristic. To be able to use the new test there, make TI C54x follow TI C4x in providing .sdef to cover for .def already having different meaning.
This commit is contained in:
26
binutils/testsuite/binutils-all/nm-coff-1.s
Normal file
26
binutils/testsuite/binutils-all/nm-coff-1.s
Normal file
@@ -0,0 +1,26 @@
|
||||
.globl text_symbol1
|
||||
.globl text_symbol2
|
||||
.globl text_symbol3
|
||||
.macro ENDFN name:req
|
||||
.def \name
|
||||
.type 0x20 /* DT_FUNC */
|
||||
.scl 2 /* C_EXT */
|
||||
.endef
|
||||
.def \name
|
||||
.scl 0xff /* C_EFCN */
|
||||
.val .
|
||||
.endef
|
||||
.endm
|
||||
.text
|
||||
text_symbol1:
|
||||
.long 0
|
||||
.long 0
|
||||
.long 0
|
||||
ENDFN text_symbol1
|
||||
text_symbol2:
|
||||
.long 0
|
||||
.long 0
|
||||
ENDFN text_symbol2
|
||||
text_symbol3:
|
||||
.long 0
|
||||
ENDFN text_symbol3
|
||||
26
binutils/testsuite/binutils-all/nm-coff-sdef-1.s
Normal file
26
binutils/testsuite/binutils-all/nm-coff-sdef-1.s
Normal file
@@ -0,0 +1,26 @@
|
||||
.globl text_symbol1
|
||||
.globl text_symbol2
|
||||
.globl text_symbol3
|
||||
.macro ENDFN name:req
|
||||
.sdef \name
|
||||
.type 0x20 /* DT_FUNC */
|
||||
.scl 2 /* C_EXT */
|
||||
.endef
|
||||
.sdef \name
|
||||
.scl 0xff /* C_EFCN */
|
||||
.val .
|
||||
.endef
|
||||
.endm
|
||||
.text
|
||||
text_symbol1:
|
||||
.byte 0,0,0,0
|
||||
.byte 0,0,0,0
|
||||
.byte 0,0,0,0
|
||||
ENDFN text_symbol1
|
||||
text_symbol2:
|
||||
.byte 0,0,0,0
|
||||
.byte 0,0,0,0
|
||||
ENDFN text_symbol2
|
||||
text_symbol3:
|
||||
.byte 0,0,0,0
|
||||
ENDFN text_symbol3
|
||||
@@ -163,6 +163,12 @@ if { [is_elf_format]
|
||||
|| [istarget wasm32-*-*]
|
||||
|| [istarget bpf-*-*]} {
|
||||
set nm_1_src "nm-elf-1.s"
|
||||
} elseif {[is_coff_format] && ![istarget arm*-*-*]} {
|
||||
if {[istarget *c4x-*-*] || [istarget *c54x-*-*]} {
|
||||
set nm_1_src "nm-coff-sdef-1.s"
|
||||
} else {
|
||||
set nm_1_src "nm-coff-1.s"
|
||||
}
|
||||
} else {
|
||||
set nm_1_src "nm-1.s"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user