This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Commit: nm.exp: --size-sort: Add more ELF-like targets. Fix non-ELF targets
- From: Nick Clifton <nickc at redhat dot com>
- To: hp at bitrange dot com
- Cc: binutils at sourceware dot org
- Date: Thu, 22 Aug 2013 12:29:23 +0100
- Subject: Commit: nm.exp: --size-sort: Add more ELF-like targets. Fix non-ELF targets
Hi Hans-Peter,
I am checking in the patch below to update your nm --size-sort test.
It was failing for a whole range of different targets for a couple of
reasons:
1. is_elf_format does not return true for a selection of rather
esoteric ELF targets. I tried fixing the is_elf_format proc
itself, but this introduces a whole slew of new regressions in
the gas and ld testsuites.
2. The .long pseudo-op does not always insert 4 bytes. On some
targets it only inserts 2 bytes. Using ".byte 0,0,0,0" does work
on all targets however. (This does not matter for the nm-elf-1.s
file where the .size directive is used, but it does affect the
nm-1.s file).
Also, for non-ELF targets using the nm-1.s source file, symbol
sizes are being computed by the difference in addresses of
successive symbols. Thus the text_symbol3 symbol needs a
successor symbol in order for its "size" to computed correctly,
allowing for the fact that some targets pad sections to an
alignment boundary.
Cheers
Nick
binutils/testsuite/ChangeLog
2013-08-22 Nick Clifton <nickc@redhat.com>
* binutils-all/nm.exp: --size-sort test: Add more ELF-like
targets.
* binutils-all/nm-1.s: Use .byte instead of .long.
Provide a terminating symbol.
Index: binutils/testsuite/binutils-all/nm-1.s
===================================================================
RCS file: /cvs/src/src/binutils/testsuite/binutils-all/nm-1.s,v
retrieving revision 1.1
diff -u -3 -p -r1.1 nm-1.s
--- binutils/testsuite/binutils-all/nm-1.s 19 Aug 2013 15:08:52 -0000 1.1
+++ binutils/testsuite/binutils-all/nm-1.s 22 Aug 2013 11:18:05 -0000
@@ -1,13 +1,15 @@
.globl text_symbol1
.globl text_symbol2
.globl text_symbol3
+ .globl end_symbol
.text
text_symbol1:
- .long 0
- .long 0
- .long 0
+ .byte 0,0,0,0
+ .byte 0,0,0,0
+ .byte 0,0,0,0
text_symbol2:
- .long 0
- .long 0
+ .byte 0,0,0,0
+ .byte 0,0,0,0
text_symbol3:
- .long 0
+ .byte 0,0,0,0
+end_symbol:
Index: binutils/testsuite/binutils-all/nm.exp
===================================================================
RCS file: /cvs/src/src/binutils/testsuite/binutils-all/nm.exp,v
retrieving revision 1.9
diff -u -3 -p -r1.9 nm.exp
--- binutils/testsuite/binutils-all/nm.exp 20 Aug 2013 22:50:11 -0000 1.9
+++ binutils/testsuite/binutils-all/nm.exp 22 Aug 2013 11:18:05 -0000
@@ -159,8 +159,22 @@ if [regexp $want $got] then {
# The target exceptions here are intended for targets that have ELF as
# an intermediate format or otherwise require the ELF-variant syntax
-# for proper size annotation.
-if {[is_elf_format] || [istarget "mmix-knuth-mmixware"]} {
+# for proper size annotation. It would be nice if is_elf_format found
+# all the ELF variants, but adding the patterns here to that proc then
+# introduces a whole slew of new regressions in the GAS and LD testsuites.
+if { [is_elf_format]
+ || [istarget *-*-dragonfly*]
+ || [istarget *-*-*elf]
+ || [istarget *-*-freebsd*]
+ || [istarget *-*-lynxos*]
+ || [istarget "mmix-knuth-mmixware"]
+ || [istarget *-*-netware*]
+ || [istarget *-*-nto*]
+ || [istarget *-*-rdos*]
+ || [istarget *-*-tpf*]
+ || [istarget *-*-uclinux*]
+ || [istarget ia64-*-*vms*]
+ || [istarget *-*-vxworks*] } {
set nm_1_src "nm-elf-1.s"
} else {
set nm_1_src "nm-1.s"